diff --git a/CHANGES.md b/CHANGES.md index d5ad485b9..55cbd9627 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,8 @@ -## Changes in 1.8.2 (in development) +## Changes in 1.8.2 + +* Bundled xcube Viewer + [1.4.1](https://github.com/xcube-dev/xcube-viewer/releases/tag/v1.4.1) + with fixes regarding the _share_ feature. * No longer logging a `TypeError` if xcube server's `GET viewer/ext/contributions` is called without any diff --git a/examples/serve/panels-demo/config.yaml b/examples/serve/panels-demo/config.yaml index 7d645c1e2..c07858b67 100644 --- a/examples/serve/panels-demo/config.yaml +++ b/examples/serve/panels-demo/config.yaml @@ -3,6 +3,8 @@ Viewer: Path: "" Extensions: - my_viewer_ext.ext + Persistence: + Path: memory://states DatasetChunkCacheSize: 100M diff --git a/xcube/version.py b/xcube/version.py index d77ef1a92..ed65e7bf7 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.8.2.dev0" +version = "1.8.2" diff --git a/xcube/webapi/viewer/dist/assets/index-DeD-TfBw.js b/xcube/webapi/viewer/dist/assets/index-D2O5Qsua.js similarity index 96% rename from xcube/webapi/viewer/dist/assets/index-DeD-TfBw.js rename to xcube/webapi/viewer/dist/assets/index-D2O5Qsua.js index 6c8249bda..457aaf22b 100644 --- a/xcube/webapi/viewer/dist/assets/index-DeD-TfBw.js +++ b/xcube/webapi/viewer/dist/assets/index-D2O5Qsua.js @@ -6,7 +6,7 @@ var lQe=Object.defineProperty;var cQe=(t,e,n)=>e in t?lQe(t,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var lM=Symbol.for("react.element"),fQe=Symbol.for("react.portal"),dQe=Symbol.for("react.fragment"),hQe=Symbol.for("react.strict_mode"),pQe=Symbol.for("react.profiler"),gQe=Symbol.for("react.provider"),mQe=Symbol.for("react.context"),vQe=Symbol.for("react.forward_ref"),yQe=Symbol.for("react.suspense"),xQe=Symbol.for("react.memo"),bQe=Symbol.for("react.lazy"),_ue=Symbol.iterator;function wQe(t){return t===null||typeof t!="object"?null:(t=_ue&&t[_ue]||t["@@iterator"],typeof t=="function"?t:null)}var w2e={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_2e=Object.assign,S2e={};function XC(t,e,n){this.props=t,this.context=e,this.refs=S2e,this.updater=n||w2e}XC.prototype.isReactComponent={};XC.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};XC.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function C2e(){}C2e.prototype=XC.prototype;function mJ(t,e,n){this.props=t,this.context=e,this.refs=S2e,this.updater=n||w2e}var vJ=mJ.prototype=new C2e;vJ.constructor=mJ;_2e(vJ,XC.prototype);vJ.isPureReactComponent=!0;var Sue=Array.isArray,O2e=Object.prototype.hasOwnProperty,yJ={current:null},E2e={key:!0,ref:!0,__self:!0,__source:!0};function T2e(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)O2e.call(e,r)&&!E2e.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1e in t?lQe(t,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var DQe=D,yc=RQe;function et(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"),JG=Object.prototype.hasOwnProperty,IQe=/^[: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]*$/,Oue={},Eue={};function LQe(t){return JG.call(Eue,t)?!0:JG.call(Oue,t)?!1:IQe.test(t)?Eue[t]=!0:(Oue[t]=!0,!1)}function $Qe(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 FQe(t,e,n,r){if(e===null||typeof e>"u"||$Qe(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 Fa(t,e,n,r,i,o,s){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=s}var Ss={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ss[t]=new Fa(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ss[e]=new Fa(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ss[t]=new Fa(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ss[t]=new Fa(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){Ss[t]=new Fa(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ss[t]=new Fa(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ss[t]=new Fa(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ss[t]=new Fa(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ss[t]=new Fa(t,5,!1,t.toLowerCase(),null,!1,!1)});var bJ=/[\-:]([a-z])/g;function wJ(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(bJ,wJ);Ss[e]=new Fa(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(bJ,wJ);Ss[e]=new Fa(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(bJ,wJ);Ss[e]=new Fa(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ss[t]=new Fa(t,1,!1,t.toLowerCase(),null,!1,!1)});Ss.xlinkHref=new Fa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ss[t]=new Fa(t,1,!1,t.toLowerCase(),null,!0,!0)});function _J(t,e,n,r){var i=Ss.hasOwnProperty(e)?Ss[e]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),JG=Object.prototype.hasOwnProperty,IQe=/^[: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]*$/,Oue={},Eue={};function LQe(t){return JG.call(Eue,t)?!0:JG.call(Oue,t)?!1:IQe.test(t)?Eue[t]=!0:(Oue[t]=!0,!1)}function $Qe(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 FQe(t,e,n,r){if(e===null||typeof e>"u"||$Qe(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 Fa(t,e,n,r,i,o,s){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=s}var Ss={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ss[t]=new Fa(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ss[e]=new Fa(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ss[t]=new Fa(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ss[t]=new Fa(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){Ss[t]=new Fa(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ss[t]=new Fa(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ss[t]=new Fa(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ss[t]=new Fa(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ss[t]=new Fa(t,5,!1,t.toLowerCase(),null,!1,!1)});var bJ=/[\-:]([a-z])/g;function wJ(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(bJ,wJ);Ss[e]=new Fa(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(bJ,wJ);Ss[e]=new Fa(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(bJ,wJ);Ss[e]=new Fa(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ss[t]=new Fa(t,1,!1,t.toLowerCase(),null,!1,!1)});Ss.xlinkHref=new Fa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ss[t]=new Fa(t,1,!1,t.toLowerCase(),null,!0,!0)});function _J(t,e,n,r){var i=Ss.hasOwnProperty(e)?Ss[e]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{C8=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?V2(t):""}function NQe(t){switch(t.tag){case 5:return V2(t.type);case 16:return V2("Lazy");case 13:return V2("Suspense");case 19:return V2("SuspenseList");case 0:case 2:case 15:return t=O8(t.type,!1),t;case 11:return t=O8(t.type.render,!1),t;case 1:return t=O8(t.type,!0),t;default:return""}}function rH(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 Yw:return"Fragment";case Xw:return"Portal";case eH:return"Profiler";case SJ:return"StrictMode";case tH:return"Suspense";case nH:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case L2e:return(t.displayName||"Context")+".Consumer";case I2e:return(t._context.displayName||"Context")+".Provider";case CJ:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case OJ:return e=t.displayName||null,e!==null?e:rH(t.type)||"Memo";case Nm:e=t._payload,t=t._init;try{return rH(t(e))}catch{}}return null}function zQe(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rH(e);case 8:return e===SJ?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Xv(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function F2e(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function jQe(t){var e=F2e(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(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function MD(t){t._valueTracker||(t._valueTracker=jQe(t))}function N2e(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=F2e(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function tF(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 iH(t,e){var n=e.checked;return Oi({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function kue(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Xv(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 z2e(t,e){e=e.checked,e!=null&&_J(t,"checked",e,!1)}function oH(t,e){z2e(t,e);var n=Xv(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")?sH(t,e.type,n):e.hasOwnProperty("defaultValue")&&sH(t,e.type,Xv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Aue(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 sH(t,e,n){(e!=="number"||tF(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var G2=Array.isArray;function k_(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=RD.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Fk(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var jT={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},BQe=["Webkit","ms","Moz","O"];Object.keys(jT).forEach(function(t){BQe.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),jT[e]=jT[t]})});function W2e(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||jT.hasOwnProperty(t)&&jT[t]?(""+e).trim():e+"px"}function V2e(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=W2e(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var UQe=Oi({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 cH(t,e){if(e){if(UQe[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(et(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(et(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(et(61))}if(e.style!=null&&typeof e.style!="object")throw Error(et(62))}}function uH(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}}var fH=null;function EJ(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var dH=null,A_=null,P_=null;function Rue(t){if(t=fM(t)){if(typeof dH!="function")throw Error(et(280));var e=t.stateNode;e&&(e=vj(e),dH(t.stateNode,t.type,e))}}function G2e(t){A_?P_?P_.push(t):P_=[t]:A_=t}function H2e(){if(A_){var t=A_,e=P_;if(P_=A_=null,Rue(t),e)for(t=0;t>>=0,t===0?32:31-(JQe(t)/eKe|0)|0}var DD=64,ID=4194304;function H2(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function oF(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=H2(a):(o&=s,o!==0&&(r=H2(o)))}else s=n&~i,s!==0?r=H2(s):o!==0&&(r=H2(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function cM(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Pf(e),t[e]=n}function iKe(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=UT),Bue=" ",Uue=!1;function dTe(t,e){switch(t){case"keyup":return RKe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hTe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Qw=!1;function IKe(t,e){switch(t){case"compositionend":return hTe(e);case"keypress":return e.which!==32?null:(Uue=!0,Bue);case"textInput":return t=e.data,t===Bue&&Uue?null:t;default:return null}}function LKe(t,e){if(Qw)return t==="compositionend"||!IJ&&dTe(t,e)?(t=uTe(),V$=MJ=av=null,Qw=!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=Hue(n)}}function vTe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?vTe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function yTe(){for(var t=window,e=tF();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=tF(t.document)}return e}function LJ(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")}function VKe(t){var e=yTe(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&vTe(n.ownerDocument.documentElement,n)){if(r!==null&&LJ(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=que(n,o);var s=que(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Kw=null,yH=null,VT=null,xH=!1;function Xue(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xH||Kw==null||Kw!==tF(r)||(r=Kw,"selectionStart"in r&&LJ(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}),VT&&Wk(VT,r)||(VT=r,r=lF(yH,"onSelect"),0e_||(t.current=OH[e_],OH[e_]=null,e_--)}function Ur(t,e){e_++,OH[e_]=t.current,t.current=e}var Yv={},ta=Ay(Yv),cl=Ay(!1),Jx=Yv;function pS(t,e){var n=t.type.contextTypes;if(!n)return Yv;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 ul(t){return t=t.childContextTypes,t!=null}function uF(){oi(cl),oi(ta)}function tfe(t,e,n){if(ta.current!==Yv)throw Error(et(168));Ur(ta,e),Ur(cl,n)}function TTe(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(et(108,zQe(t)||"Unknown",i));return Oi({},n,r)}function fF(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Yv,Jx=ta.current,Ur(ta,t),Ur(cl,cl.current),!0}function nfe(t,e,n){var r=t.stateNode;if(!r)throw Error(et(169));n?(t=TTe(t,e,Jx),r.__reactInternalMemoizedMergedChildContext=t,oi(cl),oi(ta),Ur(ta,t)):oi(cl),Ur(cl,n)}var Lp=null,yj=!1,z8=!1;function kTe(t){Lp===null?Lp=[t]:Lp.push(t)}function nZe(t){yj=!0,kTe(t)}function Py(){if(!z8&&Lp!==null){z8=!0;var t=0,e=wr;try{var n=Lp;for(wr=1;t>=s,i-=s,qp=1<<32-Pf(e)+i|n<O?(k=S,S=null):k=S.sibling;var E=d(v,S,x[O],b);if(E===null){S===null&&(S=k);break}t&&S&&E.alternate===null&&e(v,S),y=o(E,y,O),_===null?w=E:_.sibling=E,_=E,S=k}if(O===x.length)return n(v,S),di&&F0(v,O),w;if(S===null){for(;OO?(k=S,S=null):k=S.sibling;var P=d(v,S,E.value,b);if(P===null){S===null&&(S=k);break}t&&S&&P.alternate===null&&e(v,S),y=o(P,y,O),_===null?w=P:_.sibling=P,_=P,S=k}if(E.done)return n(v,S),di&&F0(v,O),w;if(S===null){for(;!E.done;O++,E=x.next())E=f(v,E.value,b),E!==null&&(y=o(E,y,O),_===null?w=E:_.sibling=E,_=E);return di&&F0(v,O),w}for(S=r(v,S);!E.done;O++,E=x.next())E=h(S,v,O,E.value,b),E!==null&&(t&&E.alternate!==null&&S.delete(E.key===null?O:E.key),y=o(E,y,O),_===null?w=E:_.sibling=E,_=E);return t&&S.forEach(function(A){return e(v,A)}),di&&F0(v,O),w}function m(v,y,x,b){if(typeof x=="object"&&x!==null&&x.type===Yw&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case PD:e:{for(var w=x.key,_=y;_!==null;){if(_.key===w){if(w=x.type,w===Yw){if(_.tag===7){n(v,_.sibling),y=i(_,x.props.children),y.return=v,v=y;break e}}else if(_.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Nm&&ofe(w)===_.type){n(v,_.sibling),y=i(_,x.props),y.ref=TE(v,_,x),y.return=v,v=y;break e}n(v,_);break}else e(v,_);_=_.sibling}x.type===Yw?(y=Ax(x.props.children,v.mode,b,x.key),y.return=v,v=y):(b=Z$(x.type,x.key,x.props,null,v.mode,b),b.ref=TE(v,y,x),b.return=v,v=b)}return s(v);case Xw:e:{for(_=x.key;y!==null;){if(y.key===_)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(v,y.sibling),y=i(y,x.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else e(v,y);y=y.sibling}y=q8(x,v.mode,b),y.return=v,v=y}return s(v);case Nm:return _=x._init,m(v,y,_(x._payload),b)}if(G2(x))return p(v,y,x,b);if(_E(x))return g(v,y,x,b);BD(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(v,y.sibling),y=i(y,x),y.return=v,v=y):(n(v,y),y=H8(x,v.mode,b),y.return=v,v=y),s(v)):n(v,y)}return m}var mS=RTe(!0),DTe=RTe(!1),pF=Ay(null),gF=null,r_=null,zJ=null;function jJ(){zJ=r_=gF=null}function BJ(t){var e=pF.current;oi(pF),t._currentValue=e}function kH(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function R_(t,e){gF=t,zJ=r_=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ol=!0),t.firstContext=null)}function xu(t){var e=t._currentValue;if(zJ!==t)if(t={context:t,memoizedValue:e,next:null},r_===null){if(gF===null)throw Error(et(308));r_=t,gF.dependencies={lanes:0,firstContext:t}}else r_=r_.next=t;return e}var cx=null;function UJ(t){cx===null?cx=[t]:cx.push(t)}function ITe(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,UJ(e)):(n.next=i.next,i.next=n),e.interleaved=n,kg(t,r)}function kg(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var zm=!1;function WJ(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function LTe(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ig(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Rv(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Hn&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,kg(t,n)}return i=r.interleaved,i===null?(e.next=e,UJ(r)):(e.next=i.next,i.next=e),r.interleaved=e,kg(t,n)}function H$(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,kJ(t,n)}}function sfe(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function mF(t,e,n,r){var i=t.updateQueue;zm=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var d=a.lane,h=a.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,g=a;switch(d=e,h=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(h,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=Oi({},f,d);break e;case 2:zm=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[a]:d.push(a))}else h={eventTime:h,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;d=a,a=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);nb|=s,t.lanes=s,t.memoizedState=f}}function afe(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=B8.transition;B8.transition={};try{t(!1),e()}finally{wr=n,B8.transition=r}}function ZTe(){return bu().memoizedState}function sZe(t,e,n){var r=Iv(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},JTe(t))eke(e,n);else if(n=ITe(t,e,n,r),n!==null){var i=Oa();Mf(n,t,r,i),tke(n,e,r)}}function aZe(t,e,n){var r=Iv(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(JTe(t))eke(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,$f(a,s)){var l=e.interleaved;l===null?(i.next=i,UJ(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=ITe(t,e,i,r),n!==null&&(i=Oa(),Mf(n,t,r,i),tke(n,e,r))}}function JTe(t){var e=t.alternate;return t===Ci||e!==null&&e===Ci}function eke(t,e){GT=yF=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function tke(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,kJ(t,n)}}var xF={readContext:xu,useCallback:ks,useContext:ks,useEffect:ks,useImperativeHandle:ks,useInsertionEffect:ks,useLayoutEffect:ks,useMemo:ks,useReducer:ks,useRef:ks,useState:ks,useDebugValue:ks,useDeferredValue:ks,useTransition:ks,useMutableSource:ks,useSyncExternalStore:ks,useId:ks,unstable_isNewReconciler:!1},lZe={readContext:xu,useCallback:function(t,e){return Od().memoizedState=[t,e===void 0?null:e],t},useContext:xu,useEffect:cfe,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,X$(4194308,4,qTe.bind(null,e,t),n)},useLayoutEffect:function(t,e){return X$(4194308,4,t,e)},useInsertionEffect:function(t,e){return X$(4,2,t,e)},useMemo:function(t,e){var n=Od();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Od();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=sZe.bind(null,Ci,t),[r.memoizedState,t]},useRef:function(t){var e=Od();return t={current:t},e.memoizedState=t},useState:lfe,useDebugValue:KJ,useDeferredValue:function(t){return Od().memoizedState=t},useTransition:function(){var t=lfe(!1),e=t[0];return t=oZe.bind(null,t[1]),Od().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ci,i=Od();if(di){if(n===void 0)throw Error(et(407));n=n()}else{if(n=e(),Uo===null)throw Error(et(349));tb&30||zTe(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,cfe(BTe.bind(null,r,o,t),[t]),r.flags|=2048,Kk(9,jTe.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Od(),e=Uo.identifierPrefix;if(di){var n=Xp,r=qp;n=(r&~(1<<32-Pf(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Yk++,0")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{C8=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?W2(t):""}function NQe(t){switch(t.tag){case 5:return W2(t.type);case 16:return W2("Lazy");case 13:return W2("Suspense");case 19:return W2("SuspenseList");case 0:case 2:case 15:return t=O8(t.type,!1),t;case 11:return t=O8(t.type.render,!1),t;case 1:return t=O8(t.type,!0),t;default:return""}}function rH(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 Yw:return"Fragment";case Xw:return"Portal";case eH:return"Profiler";case SJ:return"StrictMode";case tH:return"Suspense";case nH:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case L2e:return(t.displayName||"Context")+".Consumer";case I2e:return(t._context.displayName||"Context")+".Provider";case CJ:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case OJ:return e=t.displayName||null,e!==null?e:rH(t.type)||"Memo";case Nm:e=t._payload,t=t._init;try{return rH(t(e))}catch{}}return null}function zQe(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rH(e);case 8:return e===SJ?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Xv(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function F2e(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function jQe(t){var e=F2e(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(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function MD(t){t._valueTracker||(t._valueTracker=jQe(t))}function N2e(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=F2e(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function tF(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 iH(t,e){var n=e.checked;return Oi({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function kue(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Xv(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 z2e(t,e){e=e.checked,e!=null&&_J(t,"checked",e,!1)}function oH(t,e){z2e(t,e);var n=Xv(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")?sH(t,e.type,n):e.hasOwnProperty("defaultValue")&&sH(t,e.type,Xv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Aue(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 sH(t,e,n){(e!=="number"||tF(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var V2=Array.isArray;function k_(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=RD.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function $k(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var zT={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},BQe=["Webkit","ms","Moz","O"];Object.keys(zT).forEach(function(t){BQe.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),zT[e]=zT[t]})});function W2e(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||zT.hasOwnProperty(t)&&zT[t]?(""+e).trim():e+"px"}function V2e(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=W2e(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var UQe=Oi({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 cH(t,e){if(e){if(UQe[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(et(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(et(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(et(61))}if(e.style!=null&&typeof e.style!="object")throw Error(et(62))}}function uH(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}}var fH=null;function EJ(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var dH=null,A_=null,P_=null;function Rue(t){if(t=uM(t)){if(typeof dH!="function")throw Error(et(280));var e=t.stateNode;e&&(e=vj(e),dH(t.stateNode,t.type,e))}}function G2e(t){A_?P_?P_.push(t):P_=[t]:A_=t}function H2e(){if(A_){var t=A_,e=P_;if(P_=A_=null,Rue(t),e)for(t=0;t>>=0,t===0?32:31-(JQe(t)/eKe|0)|0}var DD=64,ID=4194304;function G2(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function oF(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=G2(a):(o&=s,o!==0&&(r=G2(o)))}else s=n&~i,s!==0?r=G2(s):o!==0&&(r=G2(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function lM(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Pf(e),t[e]=n}function iKe(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=BT),Bue=" ",Uue=!1;function dTe(t,e){switch(t){case"keyup":return RKe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hTe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Qw=!1;function IKe(t,e){switch(t){case"compositionend":return hTe(e);case"keypress":return e.which!==32?null:(Uue=!0,Bue);case"textInput":return t=e.data,t===Bue&&Uue?null:t;default:return null}}function LKe(t,e){if(Qw)return t==="compositionend"||!IJ&&dTe(t,e)?(t=uTe(),V$=MJ=av=null,Qw=!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=Hue(n)}}function vTe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?vTe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function yTe(){for(var t=window,e=tF();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=tF(t.document)}return e}function LJ(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")}function VKe(t){var e=yTe(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&vTe(n.ownerDocument.documentElement,n)){if(r!==null&&LJ(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=que(n,o);var s=que(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Kw=null,yH=null,WT=null,xH=!1;function Xue(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xH||Kw==null||Kw!==tF(r)||(r=Kw,"selectionStart"in r&&LJ(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}),WT&&Uk(WT,r)||(WT=r,r=lF(yH,"onSelect"),0e_||(t.current=OH[e_],OH[e_]=null,e_--)}function Ur(t,e){e_++,OH[e_]=t.current,t.current=e}var Yv={},ta=Ay(Yv),cl=Ay(!1),Jx=Yv;function pS(t,e){var n=t.type.contextTypes;if(!n)return Yv;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 ul(t){return t=t.childContextTypes,t!=null}function uF(){oi(cl),oi(ta)}function tfe(t,e,n){if(ta.current!==Yv)throw Error(et(168));Ur(ta,e),Ur(cl,n)}function TTe(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(et(108,zQe(t)||"Unknown",i));return Oi({},n,r)}function fF(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Yv,Jx=ta.current,Ur(ta,t),Ur(cl,cl.current),!0}function nfe(t,e,n){var r=t.stateNode;if(!r)throw Error(et(169));n?(t=TTe(t,e,Jx),r.__reactInternalMemoizedMergedChildContext=t,oi(cl),oi(ta),Ur(ta,t)):oi(cl),Ur(cl,n)}var Lp=null,yj=!1,z8=!1;function kTe(t){Lp===null?Lp=[t]:Lp.push(t)}function nZe(t){yj=!0,kTe(t)}function Py(){if(!z8&&Lp!==null){z8=!0;var t=0,e=wr;try{var n=Lp;for(wr=1;t>=s,i-=s,qp=1<<32-Pf(e)+i|n<O?(k=S,S=null):k=S.sibling;var E=d(v,S,x[O],b);if(E===null){S===null&&(S=k);break}t&&S&&E.alternate===null&&e(v,S),y=o(E,y,O),_===null?w=E:_.sibling=E,_=E,S=k}if(O===x.length)return n(v,S),di&&F0(v,O),w;if(S===null){for(;OO?(k=S,S=null):k=S.sibling;var P=d(v,S,E.value,b);if(P===null){S===null&&(S=k);break}t&&S&&P.alternate===null&&e(v,S),y=o(P,y,O),_===null?w=P:_.sibling=P,_=P,S=k}if(E.done)return n(v,S),di&&F0(v,O),w;if(S===null){for(;!E.done;O++,E=x.next())E=f(v,E.value,b),E!==null&&(y=o(E,y,O),_===null?w=E:_.sibling=E,_=E);return di&&F0(v,O),w}for(S=r(v,S);!E.done;O++,E=x.next())E=h(S,v,O,E.value,b),E!==null&&(t&&E.alternate!==null&&S.delete(E.key===null?O:E.key),y=o(E,y,O),_===null?w=E:_.sibling=E,_=E);return t&&S.forEach(function(A){return e(v,A)}),di&&F0(v,O),w}function m(v,y,x,b){if(typeof x=="object"&&x!==null&&x.type===Yw&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case PD:e:{for(var w=x.key,_=y;_!==null;){if(_.key===w){if(w=x.type,w===Yw){if(_.tag===7){n(v,_.sibling),y=i(_,x.props.children),y.return=v,v=y;break e}}else if(_.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Nm&&ofe(w)===_.type){n(v,_.sibling),y=i(_,x.props),y.ref=EE(v,_,x),y.return=v,v=y;break e}n(v,_);break}else e(v,_);_=_.sibling}x.type===Yw?(y=Ax(x.props.children,v.mode,b,x.key),y.return=v,v=y):(b=Z$(x.type,x.key,x.props,null,v.mode,b),b.ref=EE(v,y,x),b.return=v,v=b)}return s(v);case Xw:e:{for(_=x.key;y!==null;){if(y.key===_)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(v,y.sibling),y=i(y,x.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else e(v,y);y=y.sibling}y=q8(x,v.mode,b),y.return=v,v=y}return s(v);case Nm:return _=x._init,m(v,y,_(x._payload),b)}if(V2(x))return p(v,y,x,b);if(wE(x))return g(v,y,x,b);BD(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(v,y.sibling),y=i(y,x),y.return=v,v=y):(n(v,y),y=H8(x,v.mode,b),y.return=v,v=y),s(v)):n(v,y)}return m}var mS=RTe(!0),DTe=RTe(!1),pF=Ay(null),gF=null,r_=null,zJ=null;function jJ(){zJ=r_=gF=null}function BJ(t){var e=pF.current;oi(pF),t._currentValue=e}function kH(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function R_(t,e){gF=t,zJ=r_=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ol=!0),t.firstContext=null)}function xu(t){var e=t._currentValue;if(zJ!==t)if(t={context:t,memoizedValue:e,next:null},r_===null){if(gF===null)throw Error(et(308));r_=t,gF.dependencies={lanes:0,firstContext:t}}else r_=r_.next=t;return e}var cx=null;function UJ(t){cx===null?cx=[t]:cx.push(t)}function ITe(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,UJ(e)):(n.next=i.next,i.next=n),e.interleaved=n,kg(t,r)}function kg(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var zm=!1;function WJ(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function LTe(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ig(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Rv(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Hn&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,kg(t,n)}return i=r.interleaved,i===null?(e.next=e,UJ(r)):(e.next=i.next,i.next=e),r.interleaved=e,kg(t,n)}function H$(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,kJ(t,n)}}function sfe(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function mF(t,e,n,r){var i=t.updateQueue;zm=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var d=a.lane,h=a.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,g=a;switch(d=e,h=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(h,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=Oi({},f,d);break e;case 2:zm=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[a]:d.push(a))}else h={eventTime:h,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;d=a,a=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);nb|=s,t.lanes=s,t.memoizedState=f}}function afe(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=B8.transition;B8.transition={};try{t(!1),e()}finally{wr=n,B8.transition=r}}function ZTe(){return bu().memoizedState}function sZe(t,e,n){var r=Iv(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},JTe(t))eke(e,n);else if(n=ITe(t,e,n,r),n!==null){var i=Oa();Mf(n,t,r,i),tke(n,e,r)}}function aZe(t,e,n){var r=Iv(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(JTe(t))eke(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,$f(a,s)){var l=e.interleaved;l===null?(i.next=i,UJ(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=ITe(t,e,i,r),n!==null&&(i=Oa(),Mf(n,t,r,i),tke(n,e,r))}}function JTe(t){var e=t.alternate;return t===Ci||e!==null&&e===Ci}function eke(t,e){VT=yF=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function tke(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,kJ(t,n)}}var xF={readContext:xu,useCallback:ks,useContext:ks,useEffect:ks,useImperativeHandle:ks,useInsertionEffect:ks,useLayoutEffect:ks,useMemo:ks,useReducer:ks,useRef:ks,useState:ks,useDebugValue:ks,useDeferredValue:ks,useTransition:ks,useMutableSource:ks,useSyncExternalStore:ks,useId:ks,unstable_isNewReconciler:!1},lZe={readContext:xu,useCallback:function(t,e){return Od().memoizedState=[t,e===void 0?null:e],t},useContext:xu,useEffect:cfe,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,X$(4194308,4,qTe.bind(null,e,t),n)},useLayoutEffect:function(t,e){return X$(4194308,4,t,e)},useInsertionEffect:function(t,e){return X$(4,2,t,e)},useMemo:function(t,e){var n=Od();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Od();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=sZe.bind(null,Ci,t),[r.memoizedState,t]},useRef:function(t){var e=Od();return t={current:t},e.memoizedState=t},useState:lfe,useDebugValue:KJ,useDeferredValue:function(t){return Od().memoizedState=t},useTransition:function(){var t=lfe(!1),e=t[0];return t=oZe.bind(null,t[1]),Od().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ci,i=Od();if(di){if(n===void 0)throw Error(et(407));n=n()}else{if(n=e(),Uo===null)throw Error(et(349));tb&30||zTe(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,cfe(BTe.bind(null,r,o,t),[t]),r.flags|=2048,Qk(9,jTe.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Od(),e=Uo.identifierPrefix;if(di){var n=Xp,r=qp;n=(r&~(1<<32-Pf(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Xk++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Fd]=e,t[Hk]=r,fke(t,e,!1,!1),e.stateNode=t;e:{switch(s=uH(n,r),n){case"dialog":Yr("cancel",t),Yr("close",t),i=r;break;case"iframe":case"object":case"embed":Yr("load",t),i=r;break;case"video":case"audio":for(i=0;ixS&&(e.flags|=128,r=!0,kE(o,!1),e.lanes=4194304)}else{if(!r)if(t=vF(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),kE(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!di)return As(e),null}else 2*Vi()-o.renderingStartTime>xS&&n!==1073741824&&(e.flags|=128,r=!0,kE(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Vi(),e.sibling=null,n=wi.current,Ur(wi,r?n&1|2:n&1),e):(As(e),null);case 22:case 23:return ree(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ql&1073741824&&(As(e),e.subtreeFlags&6&&(e.flags|=8192)):As(e),null;case 24:return null;case 25:return null}throw Error(et(156,e.tag))}function mZe(t,e){switch(FJ(e),e.tag){case 1:return ul(e.type)&&uF(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return vS(),oi(cl),oi(ta),HJ(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return GJ(e),null;case 13:if(oi(wi),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(et(340));gS()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return oi(wi),null;case 4:return vS(),null;case 10:return BJ(e.type._context),null;case 22:case 23:return ree(),null;case 24:return null;default:return null}}var WD=!1,Ws=!1,vZe=typeof WeakSet=="function"?WeakSet:Set,Et=null;function i_(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ii(t,e,r)}else n.current=null}function FH(t,e,n){try{n()}catch(r){Ii(t,e,r)}}var bfe=!1;function yZe(t,e){if(bH=sF,t=yTe(),LJ(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++c===i&&(a=s),d===o&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(wH={focusedElem:t,selectionRange:n},sF=!1,Et=e;Et!==null;)if(e=Et,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Et=t;else for(;Et!==null;){e=Et;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,m=p.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?g:af(e.type,g),m);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(et(163))}}catch(b){Ii(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,Et=t;break}Et=e.return}return p=bfe,bfe=!1,p}function HT(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&FH(e,n,o)}i=i.next}while(i!==r)}}function wj(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function NH(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function pke(t){var e=t.alternate;e!==null&&(t.alternate=null,pke(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Fd],delete e[Hk],delete e[CH],delete e[eZe],delete e[tZe])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function gke(t){return t.tag===5||t.tag===3||t.tag===4}function wfe(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gke(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function zH(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,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=cF));else if(r!==4&&(t=t.child,t!==null))for(zH(t,e,n),t=t.sibling;t!==null;)zH(t,e,n),t=t.sibling}function jH(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(jH(t,e,n),t=t.sibling;t!==null;)jH(t,e,n),t=t.sibling}var ts=null,uf=!1;function lm(t,e,n){for(n=n.child;n!==null;)mke(t,e,n),n=n.sibling}function mke(t,e,n){if(lh&&typeof lh.onCommitFiberUnmount=="function")try{lh.onCommitFiberUnmount(hj,n)}catch{}switch(n.tag){case 5:Ws||i_(n,e);case 6:var r=ts,i=uf;ts=null,lm(t,e,n),ts=r,uf=i,ts!==null&&(uf?(t=ts,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):ts.removeChild(n.stateNode));break;case 18:ts!==null&&(uf?(t=ts,n=n.stateNode,t.nodeType===8?N8(t.parentNode,n):t.nodeType===1&&N8(t,n),Bk(t)):N8(ts,n.stateNode));break;case 4:r=ts,i=uf,ts=n.stateNode.containerInfo,uf=!0,lm(t,e,n),ts=r,uf=i;break;case 0:case 11:case 14:case 15:if(!Ws&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&FH(n,e,s),i=i.next}while(i!==r)}lm(t,e,n);break;case 1:if(!Ws&&(i_(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ii(n,e,a)}lm(t,e,n);break;case 21:lm(t,e,n);break;case 22:n.mode&1?(Ws=(r=Ws)||n.memoizedState!==null,lm(t,e,n),Ws=r):lm(t,e,n);break;default:lm(t,e,n)}}function _fe(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new vZe),e.forEach(function(r){var i=TZe.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Gu(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Vi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bZe(r/1960))-r,10t?16:t,lv===null)var r=!1;else{if(t=lv,lv=null,_F=0,Hn&6)throw Error(et(331));var i=Hn;for(Hn|=4,Et=t.current;Et!==null;){var o=Et,s=o.child;if(Et.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lVi()-tee?kx(t,0):eee|=n),fl(t,e)}function Cke(t,e){e===0&&(t.mode&1?(e=ID,ID<<=1,!(ID&130023424)&&(ID=4194304)):e=1);var n=Oa();t=kg(t,e),t!==null&&(cM(t,e,n),fl(t,n))}function EZe(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Cke(t,n)}function TZe(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(et(314))}r!==null&&r.delete(e),Cke(t,n)}var Oke;Oke=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||cl.current)ol=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ol=!1,pZe(t,e,n);ol=!!(t.flags&131072)}else ol=!1,di&&e.flags&1048576&&ATe(e,hF,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Y$(t,e),t=e.pendingProps;var i=pS(e,ta.current);R_(e,n),i=XJ(null,e,r,t,i,n);var o=YJ();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ul(r)?(o=!0,fF(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,WJ(e),i.updater=bj,e.stateNode=i,i._reactInternals=e,PH(e,r,t,n),e=DH(null,e,r,!0,o,n)):(e.tag=0,di&&o&&$J(e),ga(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Y$(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=AZe(r),t=af(r,t),i){case 0:e=RH(null,e,r,t,n);break e;case 1:e=vfe(null,e,r,t,n);break e;case 11:e=gfe(null,e,r,t,n);break e;case 14:e=mfe(null,e,r,af(r.type,t),n);break e}throw Error(et(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:af(r,i),RH(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:af(r,i),vfe(t,e,r,i,n);case 3:e:{if(lke(e),t===null)throw Error(et(387));r=e.pendingProps,o=e.memoizedState,i=o.element,LTe(t,e),mF(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=yS(Error(et(423)),e),e=yfe(t,e,r,n,i);break e}else if(r!==i){i=yS(Error(et(424)),e),e=yfe(t,e,r,n,i);break e}else for(oc=Mv(e.stateNode.containerInfo.firstChild),fc=e,di=!0,mf=null,n=DTe(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gS(),r===i){e=Ag(t,e,n);break e}ga(t,e,r,n)}e=e.child}return e;case 5:return $Te(e),t===null&&TH(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,_H(r,i)?s=null:o!==null&&_H(r,o)&&(e.flags|=32),ake(t,e),ga(t,e,s,n),e.child;case 6:return t===null&&TH(e),null;case 13:return cke(t,e,n);case 4:return VJ(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=mS(e,null,r,n):ga(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:af(r,i),gfe(t,e,r,i,n);case 7:return ga(t,e,e.pendingProps,n),e.child;case 8:return ga(t,e,e.pendingProps.children,n),e.child;case 12:return ga(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,Ur(pF,r._currentValue),r._currentValue=s,o!==null)if($f(o.value,s)){if(o.children===i.children&&!cl.current){e=Ag(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=ig(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),kH(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(et(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),kH(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ga(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,R_(e,n),i=xu(i),r=r(i),e.flags|=1,ga(t,e,r,n),e.child;case 14:return r=e.type,i=af(r,e.pendingProps),i=af(r.type,i),mfe(t,e,r,i,n);case 15:return oke(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:af(r,i),Y$(t,e),e.tag=1,ul(r)?(t=!0,fF(e)):t=!1,R_(e,n),nke(e,r,i),PH(e,r,i,n),DH(null,e,r,!0,t,n);case 19:return uke(t,e,n);case 22:return ske(t,e,n)}throw Error(et(156,e.tag))};function Eke(t,e){return J2e(t,e)}function kZe(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function eu(t,e,n,r){return new kZe(t,e,n,r)}function oee(t){return t=t.prototype,!(!t||!t.isReactComponent)}function AZe(t){if(typeof t=="function")return oee(t)?1:0;if(t!=null){if(t=t.$$typeof,t===CJ)return 11;if(t===OJ)return 14}return 2}function Lv(t,e){var n=t.alternate;return n===null?(n=eu(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Z$(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")oee(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Yw:return Ax(n.children,i,o,e);case SJ:s=8,i|=8;break;case eH:return t=eu(12,n,e,i|2),t.elementType=eH,t.lanes=o,t;case tH:return t=eu(13,n,e,i),t.elementType=tH,t.lanes=o,t;case nH:return t=eu(19,n,e,i),t.elementType=nH,t.lanes=o,t;case $2e:return Sj(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case I2e:s=10;break e;case L2e:s=9;break e;case CJ:s=11;break e;case OJ:s=14;break e;case Nm:s=16,r=null;break e}throw Error(et(130,t==null?t:typeof t,""))}return e=eu(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Ax(t,e,n,r){return t=eu(7,t,r,e),t.lanes=n,t}function Sj(t,e,n,r){return t=eu(22,t,r,e),t.elementType=$2e,t.lanes=n,t.stateNode={isHidden:!1},t}function H8(t,e,n){return t=eu(6,t,null,e),t.lanes=n,t}function q8(t,e,n){return e=eu(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function PZe(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=T8(0),this.expirationTimes=T8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=T8(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function see(t,e,n,r,i,o,s,a,l){return t=new PZe(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=eu(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},WJ(o),t}function MZe(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pke)}catch(t){console.error(t)}}Pke(),P2e.exports=Ac;var KC=P2e.exports;const HD=sn(KC);var Pfe=KC;ZG.createRoot=Pfe.createRoot,ZG.hydrateRoot=Pfe.hydrateRoot;var Mke={exports:{}},$Ze="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",FZe=$Ze,NZe=FZe;function Rke(){}function Dke(){}Dke.resetWarningCache=Rke;var zZe=function(){function t(r,i,o,s,a,l){if(l!==NZe){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:Dke,resetWarningCache:Rke};return n.PropTypes=n,n};Mke.exports=zZe();var hM=Mke.exports;const ge=sn(hM);var kj=he.createContext(null);function jZe(t){t()}var Ike=jZe,BZe=function(e){return Ike=e},UZe=function(){return Ike};function WZe(){var t=UZe(),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,s=n={callback:i,next:null,prev:n};return s.prev?s.prev.next=s:e=s,function(){!o||e===null||(o=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var Mfe={notify:function(){},get:function(){return[]}};function Lke(t,e){var n,r=Mfe;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function s(){u.onStateChange&&u.onStateChange()}function a(){return!!n}function l(){n||(n=e?e.addNestedSub(s):t.subscribe(s),r=WZe())}function c(){n&&(n(),n=void 0,r.clear(),r=Mfe)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var $ke=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect;function VZe(t){var e=t.store,n=t.context,r=t.children,i=D.useMemo(function(){var a=Lke(e);return{store:e,subscription:a}},[e]),o=D.useMemo(function(){return e.getState()},[e]);$ke(function(){var a=i.subscription;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),o!==e.getState()&&a.notifyNestedSubs(),function(){a.tryUnsubscribe(),a.onStateChange=null}},[i,o]);var s=n||kj;return he.createElement(s.Provider,{value:i},r)}function ve(){return ve=Object.assign?Object.assign.bind():function(t){for(var e=1;e<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Fd]=e,t[Gk]=r,fke(t,e,!1,!1),e.stateNode=t;e:{switch(s=uH(n,r),n){case"dialog":Yr("cancel",t),Yr("close",t),i=r;break;case"iframe":case"object":case"embed":Yr("load",t),i=r;break;case"video":case"audio":for(i=0;ixS&&(e.flags|=128,r=!0,TE(o,!1),e.lanes=4194304)}else{if(!r)if(t=vF(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),TE(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!di)return As(e),null}else 2*Vi()-o.renderingStartTime>xS&&n!==1073741824&&(e.flags|=128,r=!0,TE(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Vi(),e.sibling=null,n=wi.current,Ur(wi,r?n&1|2:n&1),e):(As(e),null);case 22:case 23:return ree(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ql&1073741824&&(As(e),e.subtreeFlags&6&&(e.flags|=8192)):As(e),null;case 24:return null;case 25:return null}throw Error(et(156,e.tag))}function mZe(t,e){switch(FJ(e),e.tag){case 1:return ul(e.type)&&uF(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return vS(),oi(cl),oi(ta),HJ(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return GJ(e),null;case 13:if(oi(wi),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(et(340));gS()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return oi(wi),null;case 4:return vS(),null;case 10:return BJ(e.type._context),null;case 22:case 23:return ree(),null;case 24:return null;default:return null}}var WD=!1,Ws=!1,vZe=typeof WeakSet=="function"?WeakSet:Set,Et=null;function i_(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ii(t,e,r)}else n.current=null}function FH(t,e,n){try{n()}catch(r){Ii(t,e,r)}}var bfe=!1;function yZe(t,e){if(bH=sF,t=yTe(),LJ(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++c===i&&(a=s),d===o&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(wH={focusedElem:t,selectionRange:n},sF=!1,Et=e;Et!==null;)if(e=Et,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Et=t;else for(;Et!==null;){e=Et;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,m=p.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?g:af(e.type,g),m);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(et(163))}}catch(b){Ii(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,Et=t;break}Et=e.return}return p=bfe,bfe=!1,p}function GT(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&FH(e,n,o)}i=i.next}while(i!==r)}}function wj(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function NH(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function pke(t){var e=t.alternate;e!==null&&(t.alternate=null,pke(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Fd],delete e[Gk],delete e[CH],delete e[eZe],delete e[tZe])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function gke(t){return t.tag===5||t.tag===3||t.tag===4}function wfe(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gke(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function zH(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,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=cF));else if(r!==4&&(t=t.child,t!==null))for(zH(t,e,n),t=t.sibling;t!==null;)zH(t,e,n),t=t.sibling}function jH(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(jH(t,e,n),t=t.sibling;t!==null;)jH(t,e,n),t=t.sibling}var ts=null,uf=!1;function lm(t,e,n){for(n=n.child;n!==null;)mke(t,e,n),n=n.sibling}function mke(t,e,n){if(lh&&typeof lh.onCommitFiberUnmount=="function")try{lh.onCommitFiberUnmount(hj,n)}catch{}switch(n.tag){case 5:Ws||i_(n,e);case 6:var r=ts,i=uf;ts=null,lm(t,e,n),ts=r,uf=i,ts!==null&&(uf?(t=ts,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):ts.removeChild(n.stateNode));break;case 18:ts!==null&&(uf?(t=ts,n=n.stateNode,t.nodeType===8?N8(t.parentNode,n):t.nodeType===1&&N8(t,n),jk(t)):N8(ts,n.stateNode));break;case 4:r=ts,i=uf,ts=n.stateNode.containerInfo,uf=!0,lm(t,e,n),ts=r,uf=i;break;case 0:case 11:case 14:case 15:if(!Ws&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&FH(n,e,s),i=i.next}while(i!==r)}lm(t,e,n);break;case 1:if(!Ws&&(i_(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ii(n,e,a)}lm(t,e,n);break;case 21:lm(t,e,n);break;case 22:n.mode&1?(Ws=(r=Ws)||n.memoizedState!==null,lm(t,e,n),Ws=r):lm(t,e,n);break;default:lm(t,e,n)}}function _fe(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new vZe),e.forEach(function(r){var i=TZe.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Gu(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Vi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bZe(r/1960))-r,10t?16:t,lv===null)var r=!1;else{if(t=lv,lv=null,_F=0,Hn&6)throw Error(et(331));var i=Hn;for(Hn|=4,Et=t.current;Et!==null;){var o=Et,s=o.child;if(Et.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lVi()-tee?kx(t,0):eee|=n),fl(t,e)}function Cke(t,e){e===0&&(t.mode&1?(e=ID,ID<<=1,!(ID&130023424)&&(ID=4194304)):e=1);var n=Oa();t=kg(t,e),t!==null&&(lM(t,e,n),fl(t,n))}function EZe(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Cke(t,n)}function TZe(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(et(314))}r!==null&&r.delete(e),Cke(t,n)}var Oke;Oke=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||cl.current)ol=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ol=!1,pZe(t,e,n);ol=!!(t.flags&131072)}else ol=!1,di&&e.flags&1048576&&ATe(e,hF,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Y$(t,e),t=e.pendingProps;var i=pS(e,ta.current);R_(e,n),i=XJ(null,e,r,t,i,n);var o=YJ();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ul(r)?(o=!0,fF(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,WJ(e),i.updater=bj,e.stateNode=i,i._reactInternals=e,PH(e,r,t,n),e=DH(null,e,r,!0,o,n)):(e.tag=0,di&&o&&$J(e),ga(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Y$(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=AZe(r),t=af(r,t),i){case 0:e=RH(null,e,r,t,n);break e;case 1:e=vfe(null,e,r,t,n);break e;case 11:e=gfe(null,e,r,t,n);break e;case 14:e=mfe(null,e,r,af(r.type,t),n);break e}throw Error(et(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:af(r,i),RH(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:af(r,i),vfe(t,e,r,i,n);case 3:e:{if(lke(e),t===null)throw Error(et(387));r=e.pendingProps,o=e.memoizedState,i=o.element,LTe(t,e),mF(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=yS(Error(et(423)),e),e=yfe(t,e,r,n,i);break e}else if(r!==i){i=yS(Error(et(424)),e),e=yfe(t,e,r,n,i);break e}else for(oc=Mv(e.stateNode.containerInfo.firstChild),fc=e,di=!0,mf=null,n=DTe(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gS(),r===i){e=Ag(t,e,n);break e}ga(t,e,r,n)}e=e.child}return e;case 5:return $Te(e),t===null&&TH(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,_H(r,i)?s=null:o!==null&&_H(r,o)&&(e.flags|=32),ake(t,e),ga(t,e,s,n),e.child;case 6:return t===null&&TH(e),null;case 13:return cke(t,e,n);case 4:return VJ(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=mS(e,null,r,n):ga(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:af(r,i),gfe(t,e,r,i,n);case 7:return ga(t,e,e.pendingProps,n),e.child;case 8:return ga(t,e,e.pendingProps.children,n),e.child;case 12:return ga(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,Ur(pF,r._currentValue),r._currentValue=s,o!==null)if($f(o.value,s)){if(o.children===i.children&&!cl.current){e=Ag(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=ig(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),kH(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(et(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),kH(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ga(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,R_(e,n),i=xu(i),r=r(i),e.flags|=1,ga(t,e,r,n),e.child;case 14:return r=e.type,i=af(r,e.pendingProps),i=af(r.type,i),mfe(t,e,r,i,n);case 15:return oke(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:af(r,i),Y$(t,e),e.tag=1,ul(r)?(t=!0,fF(e)):t=!1,R_(e,n),nke(e,r,i),PH(e,r,i,n),DH(null,e,r,!0,t,n);case 19:return uke(t,e,n);case 22:return ske(t,e,n)}throw Error(et(156,e.tag))};function Eke(t,e){return J2e(t,e)}function kZe(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function eu(t,e,n,r){return new kZe(t,e,n,r)}function oee(t){return t=t.prototype,!(!t||!t.isReactComponent)}function AZe(t){if(typeof t=="function")return oee(t)?1:0;if(t!=null){if(t=t.$$typeof,t===CJ)return 11;if(t===OJ)return 14}return 2}function Lv(t,e){var n=t.alternate;return n===null?(n=eu(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Z$(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")oee(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Yw:return Ax(n.children,i,o,e);case SJ:s=8,i|=8;break;case eH:return t=eu(12,n,e,i|2),t.elementType=eH,t.lanes=o,t;case tH:return t=eu(13,n,e,i),t.elementType=tH,t.lanes=o,t;case nH:return t=eu(19,n,e,i),t.elementType=nH,t.lanes=o,t;case $2e:return Sj(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case I2e:s=10;break e;case L2e:s=9;break e;case CJ:s=11;break e;case OJ:s=14;break e;case Nm:s=16,r=null;break e}throw Error(et(130,t==null?t:typeof t,""))}return e=eu(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Ax(t,e,n,r){return t=eu(7,t,r,e),t.lanes=n,t}function Sj(t,e,n,r){return t=eu(22,t,r,e),t.elementType=$2e,t.lanes=n,t.stateNode={isHidden:!1},t}function H8(t,e,n){return t=eu(6,t,null,e),t.lanes=n,t}function q8(t,e,n){return e=eu(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function PZe(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=T8(0),this.expirationTimes=T8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=T8(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function see(t,e,n,r,i,o,s,a,l){return t=new PZe(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=eu(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},WJ(o),t}function MZe(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pke)}catch(t){console.error(t)}}Pke(),P2e.exports=Ac;var KC=P2e.exports;const HD=sn(KC);var Pfe=KC;ZG.createRoot=Pfe.createRoot,ZG.hydrateRoot=Pfe.hydrateRoot;var Mke={exports:{}},$Ze="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",FZe=$Ze,NZe=FZe;function Rke(){}function Dke(){}Dke.resetWarningCache=Rke;var zZe=function(){function t(r,i,o,s,a,l){if(l!==NZe){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:Dke,resetWarningCache:Rke};return n.PropTypes=n,n};Mke.exports=zZe();var dM=Mke.exports;const ge=sn(dM);var kj=he.createContext(null);function jZe(t){t()}var Ike=jZe,BZe=function(e){return Ike=e},UZe=function(){return Ike};function WZe(){var t=UZe(),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,s=n={callback:i,next:null,prev:n};return s.prev?s.prev.next=s:e=s,function(){!o||e===null||(o=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var Mfe={notify:function(){},get:function(){return[]}};function Lke(t,e){var n,r=Mfe;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function s(){u.onStateChange&&u.onStateChange()}function a(){return!!n}function l(){n||(n=e?e.addNestedSub(s):t.subscribe(s),r=WZe())}function c(){n&&(n(),n=void 0,r.clear(),r=Mfe)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var $ke=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect;function VZe(t){var e=t.store,n=t.context,r=t.children,i=D.useMemo(function(){var a=Lke(e);return{store:e,subscription:a}},[e]),o=D.useMemo(function(){return e.getState()},[e]);$ke(function(){var a=i.subscription;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),o!==e.getState()&&a.notifyNestedSubs(),function(){a.tryUnsubscribe(),a.onStateChange=null}},[i,o]);var s=n||kj;return he.createElement(s.Provider,{value:i},r)}function ve(){return ve=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,s){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+s.wrappedComponentName+".")}}function UJe(t,e){return t===e}function WJe(t){var e={},n=e.connectHOC,r=n===void 0?SJe:n,i=e.mapStateToPropsFactories,o=i===void 0?MJe:i,s=e.mapDispatchToPropsFactories,a=s===void 0?kJe:s,l=e.mergePropsFactories,c=l===void 0?$Je:l,u=e.selectorFactory,f=u===void 0?jJe:u;return function(h,p,g,m){m===void 0&&(m={});var v=m,y=v.pure,x=y===void 0?!0:y,b=v.areStatesEqual,w=b===void 0?UJe:b,_=v.areOwnPropsEqual,S=_===void 0?X8:_,O=v.areStatePropsEqual,k=O===void 0?X8:O,E=v.areMergedPropsEqual,P=E===void 0?X8:E,A=Dt(v,BJe),R=Y8(h,o,"mapStateToProps"),T=Y8(p,a,"mapDispatchToProps"),M=Y8(g,c,"mergeProps");return r(f,ve({methodName:"connect",getDisplayName:function(z){return"Connect("+z+")"},shouldHandleStateChanges:!!h,initMapStateToProps:R,initMapDispatchToProps:T,initMergeProps:M,pure:x,areStatesEqual:w,areOwnPropsEqual:S,areStatePropsEqual:k,areMergedPropsEqual:P},A))}}const Rn=WJe();BZe(KC.unstable_batchedUpdates);function Pg(t){"@babel/helpers - typeof";return Pg=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},Pg(t)}function VJe(t,e){if(Pg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Pg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xke(t){var e=VJe(t,"string");return Pg(e)=="symbol"?e:e+""}function yt(t,e,n){return(e=Xke(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nfe(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 zfe(t){for(var e=1;e"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(jl(1));return n(Yke)(t,e)}if(typeof t!="function")throw new Error(jl(2));var i=t,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(jl(3));return o}function f(g){if(typeof g!="function")throw new Error(jl(4));if(l)throw new Error(jl(5));var m=!0;return c(),a.push(g),function(){if(m){if(l)throw new Error(jl(6));m=!1,c();var y=a.indexOf(g);a.splice(y,1),s=null}}}function d(g){if(!GJe(g))throw new Error(jl(7));if(typeof g.type>"u")throw new Error(jl(8));if(l)throw new Error(jl(9));try{l=!0,o=i(o,g)}finally{l=!1}for(var m=s=a,v=0;v"u"?"undefined":M(B);return $!=="object"?$:B===Math?"math":B===null?"null":Array.isArray(B)?"array":Object.prototype.toString.call(B)==="[object Date]"?"date":typeof B.toString=="function"&&/^\/.*\//.test(B.toString())?"regexp":"object"}function f(B,$,j,X,V,Y,le){V=V||[],le=le||[];var K=V.slice(0);if(typeof Y<"u"){if(X){if(typeof X=="function"&&X(K,Y))return;if((typeof X>"u"?"undefined":M(X))==="object"){if(X.prefilter&&X.prefilter(K,Y))return;if(X.normalize){var ee=X.normalize(K,Y,B,$);ee&&(B=ee[0],$=ee[1])}}}K.push(Y)}u(B)==="regexp"&&u($)==="regexp"&&(B=B.toString(),$=$.toString());var re=typeof B>"u"?"undefined":M(B),me=typeof $>"u"?"undefined":M($),te=re!=="undefined"||le&&le[le.length-1].lhs&&le[le.length-1].lhs.hasOwnProperty(Y),ae=me!=="undefined"||le&&le[le.length-1].rhs&&le[le.length-1].rhs.hasOwnProperty(Y);if(!te&&ae)j(new s(K,$));else if(!ae&&te)j(new a(K,B));else if(u(B)!==u($))j(new o(K,B,$));else if(u(B)==="date"&&B-$!==0)j(new o(K,B,$));else if(re==="object"&&B!==null&&$!==null)if(le.filter(function(G){return G.lhs===B}).length)B!==$&&j(new o(K,B,$));else{if(le.push({lhs:B,rhs:$}),Array.isArray(B)){var U;for(B.length,U=0;U=$.length?j(new l(K,U,new a(void 0,B[U]))):f(B[U],$[U],j,X,K,U,le);for(;U<$.length;)j(new l(K,U,new s(void 0,$[U++])))}else{var oe=Object.keys(B),ne=Object.keys($);oe.forEach(function(G,q){var Z=ne.indexOf(G);Z>=0?(f(B[G],$[G],j,X,K,G,le),ne=c(ne,Z)):f(B[G],void 0,j,X,K,G,le)}),ne.forEach(function(G){f(void 0,$[G],j,X,K,G,le)})}le.length=le.length-1}else B!==$&&(re==="number"&&isNaN(B)&&isNaN($)||j(new o(K,B,$)))}function d(B,$,j,X){return X=X||[],f(B,$,function(V){V&&X.push(V)},j),X.length?X:void 0}function h(B,$,j){if(j.path&&j.path.length){var X,V=B[$],Y=j.path.length-1;for(X=0;X"u"&&(X[j.path[V]]=typeof j.path[V]=="number"?[]:{}),X=X[j.path[V]];switch(j.kind){case"A":h(j.path?X[j.path[V]]:X,j.index,j.item);break;case"D":delete X[j.path[V]];break;case"E":case"N":X[j.path[V]]=j.rhs}}}function g(B,$,j){if(j.path&&j.path.length){var X,V=B[$],Y=j.path.length-1;for(X=0;X"u"&&(Y[j.path[X]]={}),Y=Y[j.path[X]];switch(j.kind){case"A":g(Y[j.path[X]],j.index,j.item);break;case"D":Y[j.path[X]]=j.lhs;break;case"E":Y[j.path[X]]=j.lhs;break;case"N":delete Y[j.path[X]]}}}function v(B,$,j){if(B&&$){var X=function(V){j&&!j(B,$,V)||p(B,$,V)};f(B,$,X)}}function y(B){return"color: "+F[B].color+"; font-weight: bold"}function x(B){var $=B.kind,j=B.path,X=B.lhs,V=B.rhs,Y=B.index,le=B.item;switch($){case"E":return[j.join("."),X,"→",V];case"N":return[j.join("."),V];case"D":return[j.join(".")];case"A":return[j.join(".")+"["+Y+"]",le];default:return[]}}function b(B,$,j,X){var V=d(B,$);try{X?j.groupCollapsed("diff"):j.group("diff")}catch{j.log("diff")}V?V.forEach(function(Y){var le=Y.kind,K=x(Y);j.log.apply(j,["%c "+F[le].text,y(le)].concat(I(K)))}):j.log("—— no diff ——");try{j.groupEnd()}catch{j.log("—— diff end —— ")}}function w(B,$,j,X){switch(typeof B>"u"?"undefined":M(B)){case"object":return typeof B[X]=="function"?B[X].apply(B,I(j)):B[X];case"function":return B($);default:return B}}function _(B){var $=B.timestamp,j=B.duration;return function(X,V,Y){var le=["action"];return le.push("%c"+String(X.type)),$&&le.push("%c@ "+V),j&&le.push("%c(in "+Y.toFixed(2)+" ms)"),le.join(" ")}}function S(B,$){var j=$.logger,X=$.actionTransformer,V=$.titleFormatter,Y=V===void 0?_($):V,le=$.collapsed,K=$.colors,ee=$.level,re=$.diff,me=typeof $.titleFormatter>"u";B.forEach(function(te,ae){var U=te.started,oe=te.startedTime,ne=te.action,G=te.prevState,q=te.error,Z=te.took,de=te.nextState,xe=B[ae+1];xe&&(de=xe.prevState,Z=xe.started-U);var H=X(ne),W=typeof le=="function"?le(function(){return de},ne,te):le,J=R(oe),se=K.title?"color: "+K.title(H)+";":"",ye=["color: gray; font-weight: lighter;"];ye.push(se),$.timestamp&&ye.push("color: gray; font-weight: lighter;"),$.duration&&ye.push("color: gray; font-weight: lighter;");var ie=Y(H,J,Z);try{W?K.title&&me?j.groupCollapsed.apply(j,["%c "+ie].concat(ye)):j.groupCollapsed(ie):K.title&&me?j.group.apply(j,["%c "+ie].concat(ye)):j.group(ie)}catch{j.log(ie)}var fe=w(ee,H,[G],"prevState"),Q=w(ee,H,[H],"action"),_e=w(ee,H,[q,G],"error"),we=w(ee,H,[de],"nextState");if(fe)if(K.prevState){var Ie="color: "+K.prevState(G)+"; font-weight: bold";j[fe]("%c prev state",Ie,G)}else j[fe]("prev state",G);if(Q)if(K.action){var Pe="color: "+K.action(H)+"; font-weight: bold";j[Q]("%c action ",Pe,H)}else j[Q]("action ",H);if(q&&_e)if(K.error){var Re="color: "+K.error(q,G)+"; font-weight: bold;";j[_e]("%c error ",Re,q)}else j[_e]("error ",q);if(we)if(K.nextState){var Te="color: "+K.nextState(de)+"; font-weight: bold";j[we]("%c next state",Te,de)}else j[we]("next state",de);re&&b(G,de,j,W);try{j.groupEnd()}catch{j.log("—— log end ——")}})}function O(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=Object.assign({},N,B),j=$.logger,X=$.stateTransformer,V=$.errorTransformer,Y=$.predicate,le=$.logErrors,K=$.diffPredicate;if(typeof j>"u")return function(){return function(re){return function(me){return re(me)}}};if(B.getState&&B.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware: + */var zj=60103,jj=60106,hM=60107,pM=60108,gM=60114,mM=60109,vM=60110,yM=60112,xM=60113,gee=60120,bM=60115,wM=60116,Uke=60121,Wke=60122,Vke=60117,Gke=60129,Hke=60131;if(typeof Symbol=="function"&&Symbol.for){var Jo=Symbol.for;zj=Jo("react.element"),jj=Jo("react.portal"),hM=Jo("react.fragment"),pM=Jo("react.strict_mode"),gM=Jo("react.profiler"),mM=Jo("react.provider"),vM=Jo("react.context"),yM=Jo("react.forward_ref"),xM=Jo("react.suspense"),gee=Jo("react.suspense_list"),bM=Jo("react.memo"),wM=Jo("react.lazy"),Uke=Jo("react.block"),Wke=Jo("react.server.block"),Vke=Jo("react.fundamental"),Gke=Jo("react.debug_trace_mode"),Hke=Jo("react.legacy_hidden")}function Zf(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case zj:switch(t=t.type,t){case hM:case gM:case pM:case xM:case gee:return t;default:switch(t=t&&t.$$typeof,t){case vM:case yM:case wM:case bM:case mM:return t;default:return e}}case jj:return e}}}var iJe=mM,oJe=zj,sJe=yM,aJe=hM,lJe=wM,cJe=bM,uJe=jj,fJe=gM,dJe=pM,hJe=xM;Fr.ContextConsumer=vM;Fr.ContextProvider=iJe;Fr.Element=oJe;Fr.ForwardRef=sJe;Fr.Fragment=aJe;Fr.Lazy=lJe;Fr.Memo=cJe;Fr.Portal=uJe;Fr.Profiler=fJe;Fr.StrictMode=dJe;Fr.Suspense=hJe;Fr.isAsyncMode=function(){return!1};Fr.isConcurrentMode=function(){return!1};Fr.isContextConsumer=function(t){return Zf(t)===vM};Fr.isContextProvider=function(t){return Zf(t)===mM};Fr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===zj};Fr.isForwardRef=function(t){return Zf(t)===yM};Fr.isFragment=function(t){return Zf(t)===hM};Fr.isLazy=function(t){return Zf(t)===wM};Fr.isMemo=function(t){return Zf(t)===bM};Fr.isPortal=function(t){return Zf(t)===jj};Fr.isProfiler=function(t){return Zf(t)===gM};Fr.isStrictMode=function(t){return Zf(t)===pM};Fr.isSuspense=function(t){return Zf(t)===xM};Fr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===hM||t===gM||t===Gke||t===pM||t===xM||t===gee||t===Hke||typeof t=="object"&&t!==null&&(t.$$typeof===wM||t.$$typeof===bM||t.$$typeof===mM||t.$$typeof===vM||t.$$typeof===yM||t.$$typeof===Vke||t.$$typeof===Uke||t[0]===Wke)};Fr.typeOf=Zf;Bke.exports=Fr;var pJe=Bke.exports,gJe=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],mJe=["reactReduxForwardedRef"],vJe=[],yJe=[null,null];function xJe(t,e){var n=t[1];return[e.payload,n+1]}function Lfe(t,e,n){$ke(function(){return t.apply(void 0,e)},n)}function bJe(t,e,n,r,i,o,s){t.current=r,e.current=i,n.current=!1,o.current&&(o.current=null,s())}function wJe(t,e,n,r,i,o,s,a,l,c){if(t){var u=!1,f=null,d=function(){if(!u){var g=e.getState(),m,v;try{m=r(g,i.current)}catch(y){v=y,f=y}v||(f=null),m===o.current?s.current||l():(o.current=m,a.current=m,s.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 _Je=function(){return[null,0]};function SJe(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,s=o===void 0?"connectAdvanced":o,a=n.renderCountProp,l=a===void 0?void 0:a,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,g=n.context,m=g===void 0?kj:g,v=Dt(n,gJe),y=m;return function(b){var w=b.displayName||b.name||"Component",_=i(w),S=ve({},v,{getDisplayName:i,methodName:s,renderCountProp:l,shouldHandleStateChanges:u,storeKey:d,displayName:_,wrappedComponentName:w,WrappedComponent:b}),O=v.pure;function k(T){return t(T.dispatch,S)}var E=O?D.useMemo:function(T){return T()};function P(T){var M=D.useMemo(function(){var Z=T.reactReduxForwardedRef,de=Dt(T,mJe);return[T.context,Z,de]},[T]),I=M[0],z=M[1],F=M[2],N=D.useMemo(function(){return I&&I.Consumer&&pJe.isContextConsumer(he.createElement(I.Consumer,null))?I:y},[I,y]),L=D.useContext(N),B=!!T.store&&!!T.store.getState&&!!T.store.dispatch;L&&L.store;var $=B?T.store:L.store,j=D.useMemo(function(){return k($)},[$]),X=D.useMemo(function(){if(!u)return yJe;var Z=Lke($,B?null:L.subscription),de=Z.notifyNestedSubs.bind(Z);return[Z,de]},[$,B,L]),V=X[0],Y=X[1],le=D.useMemo(function(){return B?L:ve({},L,{subscription:V})},[B,L,V]),K=D.useReducer(xJe,vJe,_Je),ee=K[0],re=ee[0],me=K[1];if(re&&re.error)throw re.error;var te=D.useRef(),ae=D.useRef(F),U=D.useRef(),oe=D.useRef(!1),ne=E(function(){return U.current&&F===ae.current?U.current:j($.getState(),F)},[$,re,F]);Lfe(bJe,[ae,te,oe,F,ne,U,Y]),Lfe(wJe,[u,$,V,j,ae,te,oe,U,Y,me],[$,V,j]);var G=D.useMemo(function(){return he.createElement(b,ve({},ne,{ref:z}))},[z,b,ne]),q=D.useMemo(function(){return u?he.createElement(N.Provider,{value:le},G):G},[N,G,le]);return q}var A=O?he.memo(P):P;if(A.WrappedComponent=b,A.displayName=P.displayName=_,p){var R=he.forwardRef(function(M,I){return he.createElement(A,ve({},M,{reactReduxForwardedRef:I}))});return R.displayName=_,R.WrappedComponent=b,GH(R,b)}return GH(A,b)}}function $fe(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function X8(t,e){if($fe(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,s){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+s.wrappedComponentName+".")}}function UJe(t,e){return t===e}function WJe(t){var e={},n=e.connectHOC,r=n===void 0?SJe:n,i=e.mapStateToPropsFactories,o=i===void 0?MJe:i,s=e.mapDispatchToPropsFactories,a=s===void 0?kJe:s,l=e.mergePropsFactories,c=l===void 0?$Je:l,u=e.selectorFactory,f=u===void 0?jJe:u;return function(h,p,g,m){m===void 0&&(m={});var v=m,y=v.pure,x=y===void 0?!0:y,b=v.areStatesEqual,w=b===void 0?UJe:b,_=v.areOwnPropsEqual,S=_===void 0?X8:_,O=v.areStatePropsEqual,k=O===void 0?X8:O,E=v.areMergedPropsEqual,P=E===void 0?X8:E,A=Dt(v,BJe),R=Y8(h,o,"mapStateToProps"),T=Y8(p,a,"mapDispatchToProps"),M=Y8(g,c,"mergeProps");return r(f,ve({methodName:"connect",getDisplayName:function(z){return"Connect("+z+")"},shouldHandleStateChanges:!!h,initMapStateToProps:R,initMapDispatchToProps:T,initMergeProps:M,pure:x,areStatesEqual:w,areOwnPropsEqual:S,areStatePropsEqual:k,areMergedPropsEqual:P},A))}}const Rn=WJe();BZe(KC.unstable_batchedUpdates);function Pg(t){"@babel/helpers - typeof";return Pg=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},Pg(t)}function VJe(t,e){if(Pg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Pg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xke(t){var e=VJe(t,"string");return Pg(e)=="symbol"?e:e+""}function yt(t,e,n){return(e=Xke(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nfe(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 zfe(t){for(var e=1;e"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(jl(1));return n(Yke)(t,e)}if(typeof t!="function")throw new Error(jl(2));var i=t,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(jl(3));return o}function f(g){if(typeof g!="function")throw new Error(jl(4));if(l)throw new Error(jl(5));var m=!0;return c(),a.push(g),function(){if(m){if(l)throw new Error(jl(6));m=!1,c();var y=a.indexOf(g);a.splice(y,1),s=null}}}function d(g){if(!GJe(g))throw new Error(jl(7));if(typeof g.type>"u")throw new Error(jl(8));if(l)throw new Error(jl(9));try{l=!0,o=i(o,g)}finally{l=!1}for(var m=s=a,v=0;v"u"?"undefined":M(B);return $!=="object"?$:B===Math?"math":B===null?"null":Array.isArray(B)?"array":Object.prototype.toString.call(B)==="[object Date]"?"date":typeof B.toString=="function"&&/^\/.*\//.test(B.toString())?"regexp":"object"}function f(B,$,j,X,V,Y,le){V=V||[],le=le||[];var K=V.slice(0);if(typeof Y<"u"){if(X){if(typeof X=="function"&&X(K,Y))return;if((typeof X>"u"?"undefined":M(X))==="object"){if(X.prefilter&&X.prefilter(K,Y))return;if(X.normalize){var ee=X.normalize(K,Y,B,$);ee&&(B=ee[0],$=ee[1])}}}K.push(Y)}u(B)==="regexp"&&u($)==="regexp"&&(B=B.toString(),$=$.toString());var re=typeof B>"u"?"undefined":M(B),me=typeof $>"u"?"undefined":M($),te=re!=="undefined"||le&&le[le.length-1].lhs&&le[le.length-1].lhs.hasOwnProperty(Y),ae=me!=="undefined"||le&&le[le.length-1].rhs&&le[le.length-1].rhs.hasOwnProperty(Y);if(!te&&ae)j(new s(K,$));else if(!ae&&te)j(new a(K,B));else if(u(B)!==u($))j(new o(K,B,$));else if(u(B)==="date"&&B-$!==0)j(new o(K,B,$));else if(re==="object"&&B!==null&&$!==null)if(le.filter(function(G){return G.lhs===B}).length)B!==$&&j(new o(K,B,$));else{if(le.push({lhs:B,rhs:$}),Array.isArray(B)){var U;for(B.length,U=0;U=$.length?j(new l(K,U,new a(void 0,B[U]))):f(B[U],$[U],j,X,K,U,le);for(;U<$.length;)j(new l(K,U,new s(void 0,$[U++])))}else{var oe=Object.keys(B),ne=Object.keys($);oe.forEach(function(G,q){var Z=ne.indexOf(G);Z>=0?(f(B[G],$[G],j,X,K,G,le),ne=c(ne,Z)):f(B[G],void 0,j,X,K,G,le)}),ne.forEach(function(G){f(void 0,$[G],j,X,K,G,le)})}le.length=le.length-1}else B!==$&&(re==="number"&&isNaN(B)&&isNaN($)||j(new o(K,B,$)))}function d(B,$,j,X){return X=X||[],f(B,$,function(V){V&&X.push(V)},j),X.length?X:void 0}function h(B,$,j){if(j.path&&j.path.length){var X,V=B[$],Y=j.path.length-1;for(X=0;X"u"&&(X[j.path[V]]=typeof j.path[V]=="number"?[]:{}),X=X[j.path[V]];switch(j.kind){case"A":h(j.path?X[j.path[V]]:X,j.index,j.item);break;case"D":delete X[j.path[V]];break;case"E":case"N":X[j.path[V]]=j.rhs}}}function g(B,$,j){if(j.path&&j.path.length){var X,V=B[$],Y=j.path.length-1;for(X=0;X"u"&&(Y[j.path[X]]={}),Y=Y[j.path[X]];switch(j.kind){case"A":g(Y[j.path[X]],j.index,j.item);break;case"D":Y[j.path[X]]=j.lhs;break;case"E":Y[j.path[X]]=j.lhs;break;case"N":delete Y[j.path[X]]}}}function v(B,$,j){if(B&&$){var X=function(V){j&&!j(B,$,V)||p(B,$,V)};f(B,$,X)}}function y(B){return"color: "+F[B].color+"; font-weight: bold"}function x(B){var $=B.kind,j=B.path,X=B.lhs,V=B.rhs,Y=B.index,le=B.item;switch($){case"E":return[j.join("."),X,"→",V];case"N":return[j.join("."),V];case"D":return[j.join(".")];case"A":return[j.join(".")+"["+Y+"]",le];default:return[]}}function b(B,$,j,X){var V=d(B,$);try{X?j.groupCollapsed("diff"):j.group("diff")}catch{j.log("diff")}V?V.forEach(function(Y){var le=Y.kind,K=x(Y);j.log.apply(j,["%c "+F[le].text,y(le)].concat(I(K)))}):j.log("—— no diff ——");try{j.groupEnd()}catch{j.log("—— diff end —— ")}}function w(B,$,j,X){switch(typeof B>"u"?"undefined":M(B)){case"object":return typeof B[X]=="function"?B[X].apply(B,I(j)):B[X];case"function":return B($);default:return B}}function _(B){var $=B.timestamp,j=B.duration;return function(X,V,Y){var le=["action"];return le.push("%c"+String(X.type)),$&&le.push("%c@ "+V),j&&le.push("%c(in "+Y.toFixed(2)+" ms)"),le.join(" ")}}function S(B,$){var j=$.logger,X=$.actionTransformer,V=$.titleFormatter,Y=V===void 0?_($):V,le=$.collapsed,K=$.colors,ee=$.level,re=$.diff,me=typeof $.titleFormatter>"u";B.forEach(function(te,ae){var U=te.started,oe=te.startedTime,ne=te.action,G=te.prevState,q=te.error,Z=te.took,de=te.nextState,xe=B[ae+1];xe&&(de=xe.prevState,Z=xe.started-U);var H=X(ne),W=typeof le=="function"?le(function(){return de},ne,te):le,J=R(oe),se=K.title?"color: "+K.title(H)+";":"",ye=["color: gray; font-weight: lighter;"];ye.push(se),$.timestamp&&ye.push("color: gray; font-weight: lighter;"),$.duration&&ye.push("color: gray; font-weight: lighter;");var ie=Y(H,J,Z);try{W?K.title&&me?j.groupCollapsed.apply(j,["%c "+ie].concat(ye)):j.groupCollapsed(ie):K.title&&me?j.group.apply(j,["%c "+ie].concat(ye)):j.group(ie)}catch{j.log(ie)}var fe=w(ee,H,[G],"prevState"),Q=w(ee,H,[H],"action"),_e=w(ee,H,[q,G],"error"),we=w(ee,H,[de],"nextState");if(fe)if(K.prevState){var Ie="color: "+K.prevState(G)+"; font-weight: bold";j[fe]("%c prev state",Ie,G)}else j[fe]("prev state",G);if(Q)if(K.action){var Pe="color: "+K.action(H)+"; font-weight: bold";j[Q]("%c action ",Pe,H)}else j[Q]("action ",H);if(q&&_e)if(K.error){var Re="color: "+K.error(q,G)+"; font-weight: bold;";j[_e]("%c error ",Re,q)}else j[_e]("error ",q);if(we)if(K.nextState){var Te="color: "+K.nextState(de)+"; font-weight: bold";j[we]("%c next state",Te,de)}else j[we]("next state",de);re&&b(G,de,j,W);try{j.groupEnd()}catch{j.log("—— log end ——")}})}function O(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=Object.assign({},N,B),j=$.logger,X=$.stateTransformer,V=$.errorTransformer,Y=$.predicate,le=$.logErrors,K=$.diffPredicate;if(typeof j>"u")return function(){return function(re){return function(me){return re(me)}}};if(B.getState&&B.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( @@ -74,13 +74,13 @@ 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=N,n.createLogger=O,n.logger=L,n.default=L,Object.defineProperty(n,"__esModule",{value:!0})})})(HH,HH.exports);var XJe=HH.exports;function Qke(t){var e=function(r){var i=r.dispatch,o=r.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,t):s(a)}}};return e}var Kke=Qke();Kke.withExtraArgument=Qke;const Jk={black:"#000",white:"#fff"},jm={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"},Zke={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"},Bm={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"},YJe={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"},Jke={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"},Um={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"},Wm={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"},eAe={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"},tAe={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"},$p={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"},QJe={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"},nAe={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"},rAe={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"},iAe={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"},Q0={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"},Px={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"},oAe={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"},sAe={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"},KJe={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 Mg(t,...e){const n=new URL(`https://mui.com/production-error/?code=${t}`);return e.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${t}; visit ${n} for the full message.`}const Rf="$$material";function aAe(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var ZJe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,JJe=aAe(function(t){return ZJe.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),eet=!1;function tet(t){if(t.sheet)return t.sheet;for(var e=0;e0?is(ZC,--bl):0,bS--,ro===10&&(bS=1,Uj--),ro}function dc(){return ro=bl2||tA(ro)>3?"":" "}function pet(t,e){for(;--e&&dc()&&!(ro<48||ro>102||ro>57&&ro<65||ro>70&&ro<97););return SM(t,J$()+(e<6&&uh()==32&&dc()==32))}function XH(t){for(;dc();)switch(ro){case t:return bl;case 34:case 39:t!==34&&t!==39&&XH(ro);break;case 40:t===41&&XH(t);break;case 92:dc();break}return bl}function get(t,e){for(;dc()&&t+ro!==57;)if(t+ro===84&&uh()===47)break;return"/*"+SM(e,bl-1)+"*"+Bj(t===47?t:dc())}function met(t){for(;!tA(uh());)dc();return SM(t,bl)}function vet(t){return pAe(t3("",null,null,null,[""],t=hAe(t),0,[0],t))}function t3(t,e,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,d=0,h=0,p=0,g=1,m=1,v=1,y=0,x="",b=i,w=o,_=r,S=x;m;)switch(p=y,y=dc()){case 40:if(p!=108&&is(S,f-1)==58){qH(S+=ir(e3(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:S+=e3(y);break;case 9:case 10:case 13:case 32:S+=het(p);break;case 92:S+=pet(J$()-1,7);continue;case 47:switch(uh()){case 42:case 47:qD(yet(get(dc(),J$()),e,n),l);break;default:S+="/"}break;case 123*g:a[c++]=Dd(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:v==-1&&(S=ir(S,/\f/g,"")),h>0&&Dd(S)-f&&qD(h>32?Wfe(S+";",r,n,f-1):Wfe(ir(S," ","")+";",r,n,f-2),l);break;case 59:S+=";";default:if(qD(_=Ufe(S,e,n,c,u,i,a,x,b=[],w=[],f),o),y===123)if(u===0)t3(S,e,_,_,b,o,f,a,w);else switch(d===99&&is(S,3)===110?100:d){case 100:case 108:case 109:case 115:t3(t,_,_,r&&qD(Ufe(t,_,_,0,0,i,a,x,i,b=[],f),w),i,w,f,a,r?b:w);break;default:t3(S,_,_,_,[""],w,0,a,w)}}c=u=h=0,g=v=1,x=S="",f=s;break;case 58:f=1+Dd(S),h=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&det()==125)continue}switch(S+=Bj(y),y*g){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(Dd(S)-1)*v,v=1;break;case 64:uh()===45&&(S+=e3(dc())),d=uh(),u=f=Dd(x=S+=met(J$())),y++;break;case 45:p===45&&Dd(S)==2&&(g=0)}}return o}function Ufe(t,e,n,r,i,o,s,a,l,c,u){for(var f=i-1,d=i===0?o:[""],h=xee(d),p=0,g=0,m=0;p0?d[v]+" "+y:ir(y,/&\f/g,d[v])))&&(l[m++]=x);return Wj(t,e,n,i===0?vee:a,l,c,u)}function yet(t,e,n){return Wj(t,e,n,cAe,Bj(fet()),eA(t,2,-2),0)}function Wfe(t,e,n,r){return Wj(t,e,n,yee,eA(t,0,r),eA(t,r+1,-1),r)}function I_(t,e){for(var n="",r=xee(t),i=0;i6)switch(is(t,e+1)){case 109:if(is(t,e+4)!==45)break;case 102:return ir(t,/(.+:)(.+)-([^]+)/,"$1"+nr+"$2-$3$1"+EF+(is(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~qH(t,"stretch")?gAe(ir(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(is(t,e+1)!==115)break;case 6444:switch(is(t,Dd(t)-3-(~qH(t,"!important")&&10))){case 107:return ir(t,":",":"+nr)+t;case 101:return ir(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nr+(is(t,14)===45?"inline-":"")+"box$3$1"+nr+"$2$3$1"+Is+"$2box$3")+t}break;case 5936:switch(is(t,e+11)){case 114:return nr+t+Is+ir(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nr+t+Is+ir(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nr+t+Is+ir(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nr+t+Is+t+t}return t}var ket=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case yee:e.return=gAe(e.value,e.length);break;case uAe:return I_([PE(e,{value:ir(e.value,"@","@"+nr)})],i);case vee:if(e.length)return uet(e.props,function(o){switch(cet(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return I_([PE(e,{props:[ir(o,/:(read-\w+)/,":"+EF+"$1")]})],i);case"::placeholder":return I_([PE(e,{props:[ir(o,/:(plac\w+)/,":"+nr+"input-$1")]}),PE(e,{props:[ir(o,/:(plac\w+)/,":"+EF+"$1")]}),PE(e,{props:[ir(o,/:(plac\w+)/,Is+"input-$1")]})],i)}return""})}},Aet=[ket],mAe=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(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=e.stylisPlugins||Aet,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.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 Det={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},Iet=!1,Let=/[A-Z]|^ms/g,$et=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xAe=function(e){return e.charCodeAt(1)===45},Gfe=function(e){return e!=null&&typeof e!="boolean"},K8=aAe(function(t){return xAe(t)?t:t.replace(Let,"-$&").toLowerCase()}),Hfe=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace($et,function(r,i,o){return Id={name:i,styles:o,next:Id},i})}return Det[e]!==1&&!xAe(e)&&typeof n=="number"&&n!==0?n+"px":n},Fet="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function nA(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 Id={name:i.name,styles:i.styles,next:Id},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Id={name:s.name,styles:s.styles,next:Id},s=s.next;var a=o.styles+";";return a}return Net(t,e,n)}case"function":{if(t!==void 0){var l=Id,c=n(t);return Id=l,nA(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function Net(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?Wet:Vet},Qfe=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(s){return e.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},Get=!1,Het=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return vAe(n,r,i),jet(function(){return yAe(n,r,i)}),null},qet=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,s;n!==void 0&&(o=n.label,s=n.target);var a=Qfe(e,n,r),l=a||Yfe(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;h{const e=mAe(t);class n extends lAe{constructor(i){super(i),this.prepend=e.sheet.prepend}}return e.sheet=new n({key:e.key,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy,prepend:e.sheet.prepend,insertionPoint:e.sheet.insertionPoint}),e};let QH;typeof document=="object"&&(QH=Yet({key:"css",prepend:!0}));function Qet(t){const{injectFirst:e,children:n}=t;return e&&QH?C.jsx(Bet,{value:QH,children:n}):n}function Ket(t){return t==null||Object.keys(t).length===0}function SAe(t){const{styles:e,defaultTheme:n={}}=t,r=typeof e=="function"?i=>e(Ket(i)?n:i):e;return C.jsx(Uet,{styles:r})}/** +`)};n.defaults=N,n.createLogger=O,n.logger=L,n.default=L,Object.defineProperty(n,"__esModule",{value:!0})})})(HH,HH.exports);var XJe=HH.exports;function Qke(t){var e=function(r){var i=r.dispatch,o=r.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,t):s(a)}}};return e}var Kke=Qke();Kke.withExtraArgument=Qke;const Zk={black:"#000",white:"#fff"},jm={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"},Zke={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"},Bm={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"},YJe={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"},Jke={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"},Um={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"},Wm={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"},eAe={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"},tAe={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"},$p={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"},QJe={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"},nAe={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"},rAe={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"},iAe={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"},Q0={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"},Px={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"},oAe={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"},sAe={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"},KJe={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 Mg(t,...e){const n=new URL(`https://mui.com/production-error/?code=${t}`);return e.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${t}; visit ${n} for the full message.`}const Rf="$$material";function aAe(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var ZJe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,JJe=aAe(function(t){return ZJe.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),eet=!1;function tet(t){if(t.sheet)return t.sheet;for(var e=0;e0?is(ZC,--bl):0,bS--,ro===10&&(bS=1,Uj--),ro}function dc(){return ro=bl2||eA(ro)>3?"":" "}function pet(t,e){for(;--e&&dc()&&!(ro<48||ro>102||ro>57&&ro<65||ro>70&&ro<97););return _M(t,J$()+(e<6&&uh()==32&&dc()==32))}function XH(t){for(;dc();)switch(ro){case t:return bl;case 34:case 39:t!==34&&t!==39&&XH(ro);break;case 40:t===41&&XH(t);break;case 92:dc();break}return bl}function get(t,e){for(;dc()&&t+ro!==57;)if(t+ro===84&&uh()===47)break;return"/*"+_M(e,bl-1)+"*"+Bj(t===47?t:dc())}function met(t){for(;!eA(uh());)dc();return _M(t,bl)}function vet(t){return pAe(t3("",null,null,null,[""],t=hAe(t),0,[0],t))}function t3(t,e,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,d=0,h=0,p=0,g=1,m=1,v=1,y=0,x="",b=i,w=o,_=r,S=x;m;)switch(p=y,y=dc()){case 40:if(p!=108&&is(S,f-1)==58){qH(S+=ir(e3(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:S+=e3(y);break;case 9:case 10:case 13:case 32:S+=het(p);break;case 92:S+=pet(J$()-1,7);continue;case 47:switch(uh()){case 42:case 47:qD(yet(get(dc(),J$()),e,n),l);break;default:S+="/"}break;case 123*g:a[c++]=Dd(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:v==-1&&(S=ir(S,/\f/g,"")),h>0&&Dd(S)-f&&qD(h>32?Wfe(S+";",r,n,f-1):Wfe(ir(S," ","")+";",r,n,f-2),l);break;case 59:S+=";";default:if(qD(_=Ufe(S,e,n,c,u,i,a,x,b=[],w=[],f),o),y===123)if(u===0)t3(S,e,_,_,b,o,f,a,w);else switch(d===99&&is(S,3)===110?100:d){case 100:case 108:case 109:case 115:t3(t,_,_,r&&qD(Ufe(t,_,_,0,0,i,a,x,i,b=[],f),w),i,w,f,a,r?b:w);break;default:t3(S,_,_,_,[""],w,0,a,w)}}c=u=h=0,g=v=1,x=S="",f=s;break;case 58:f=1+Dd(S),h=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&det()==125)continue}switch(S+=Bj(y),y*g){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(Dd(S)-1)*v,v=1;break;case 64:uh()===45&&(S+=e3(dc())),d=uh(),u=f=Dd(x=S+=met(J$())),y++;break;case 45:p===45&&Dd(S)==2&&(g=0)}}return o}function Ufe(t,e,n,r,i,o,s,a,l,c,u){for(var f=i-1,d=i===0?o:[""],h=xee(d),p=0,g=0,m=0;p0?d[v]+" "+y:ir(y,/&\f/g,d[v])))&&(l[m++]=x);return Wj(t,e,n,i===0?vee:a,l,c,u)}function yet(t,e,n){return Wj(t,e,n,cAe,Bj(fet()),Jk(t,2,-2),0)}function Wfe(t,e,n,r){return Wj(t,e,n,yee,Jk(t,0,r),Jk(t,r+1,-1),r)}function I_(t,e){for(var n="",r=xee(t),i=0;i6)switch(is(t,e+1)){case 109:if(is(t,e+4)!==45)break;case 102:return ir(t,/(.+:)(.+)-([^]+)/,"$1"+nr+"$2-$3$1"+EF+(is(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~qH(t,"stretch")?gAe(ir(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(is(t,e+1)!==115)break;case 6444:switch(is(t,Dd(t)-3-(~qH(t,"!important")&&10))){case 107:return ir(t,":",":"+nr)+t;case 101:return ir(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nr+(is(t,14)===45?"inline-":"")+"box$3$1"+nr+"$2$3$1"+Is+"$2box$3")+t}break;case 5936:switch(is(t,e+11)){case 114:return nr+t+Is+ir(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nr+t+Is+ir(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nr+t+Is+ir(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nr+t+Is+t+t}return t}var ket=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case yee:e.return=gAe(e.value,e.length);break;case uAe:return I_([AE(e,{value:ir(e.value,"@","@"+nr)})],i);case vee:if(e.length)return uet(e.props,function(o){switch(cet(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return I_([AE(e,{props:[ir(o,/:(read-\w+)/,":"+EF+"$1")]})],i);case"::placeholder":return I_([AE(e,{props:[ir(o,/:(plac\w+)/,":"+nr+"input-$1")]}),AE(e,{props:[ir(o,/:(plac\w+)/,":"+EF+"$1")]}),AE(e,{props:[ir(o,/:(plac\w+)/,Is+"input-$1")]})],i)}return""})}},Aet=[ket],mAe=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(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=e.stylisPlugins||Aet,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.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 Det={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},Iet=!1,Let=/[A-Z]|^ms/g,$et=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xAe=function(e){return e.charCodeAt(1)===45},Gfe=function(e){return e!=null&&typeof e!="boolean"},K8=aAe(function(t){return xAe(t)?t:t.replace(Let,"-$&").toLowerCase()}),Hfe=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace($et,function(r,i,o){return Id={name:i,styles:o,next:Id},i})}return Det[e]!==1&&!xAe(e)&&typeof n=="number"&&n!==0?n+"px":n},Fet="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function tA(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 Id={name:i.name,styles:i.styles,next:Id},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Id={name:s.name,styles:s.styles,next:Id},s=s.next;var a=o.styles+";";return a}return Net(t,e,n)}case"function":{if(t!==void 0){var l=Id,c=n(t);return Id=l,tA(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function Net(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?Wet:Vet},Qfe=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(s){return e.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},Get=!1,Het=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return vAe(n,r,i),jet(function(){return yAe(n,r,i)}),null},qet=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,s;n!==void 0&&(o=n.label,s=n.target);var a=Qfe(e,n,r),l=a||Yfe(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;h{const e=mAe(t);class n extends lAe{constructor(i){super(i),this.prepend=e.sheet.prepend}}return e.sheet=new n({key:e.key,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy,prepend:e.sheet.prepend,insertionPoint:e.sheet.insertionPoint}),e};let QH;typeof document=="object"&&(QH=Yet({key:"css",prepend:!0}));function Qet(t){const{injectFirst:e,children:n}=t;return e&&QH?C.jsx(Bet,{value:QH,children:n}):n}function Ket(t){return t==null||Object.keys(t).length===0}function SAe(t){const{styles:e,defaultTheme:n={}}=t,r=typeof e=="function"?i=>e(Ket(i)?n:i):e;return C.jsx(Uet,{styles:r})}/** * @mui/styled-engine v6.1.5 * * @license MIT * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function CAe(t,e){return YH(t,e)}function Zet(t,e){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}const Kfe=[];function Zfe(t){return Kfe[0]=t,Vj(Kfe)}function Nd(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 OAe(t){if(!Nd(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=OAe(t[n])}),e}function Wo(t,e,n={clone:!0}){const r=n.clone?{...t}:t;return Nd(t)&&Nd(e)&&Object.keys(e).forEach(i=>{Nd(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&Nd(t[i])?r[i]=Wo(t[i],e[i],n):n.clone?r[i]=Nd(e[i])?OAe(e[i]):e[i]:r[i]=e[i]}),r}const Jet=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)=>({...n,[r.key]:r.val}),{})};function ett(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=t,o=Jet(e),s=Object.keys(o);function a(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=s.indexOf(h);return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n}) and (max-width:${(p!==-1&&typeof e[s[p]]=="number"?e[s[p]]:h)-r/100}${n})`}function u(d){return s.indexOf(d)+1r.startsWith("@container")).sort((r,i)=>{var s,a;const o=/min-width:\s*([0-9.]+)/;return+(((s=r.match(o))==null?void 0:s[1])||0)-+(((a=i.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const o=e[i];return delete r[i],r[i]=o,r},{...e}):e}function ntt(t,e){return e==="@"||e.startsWith("@")&&(t.some(n=>e.startsWith(`@${n}`))||!!e.match(/^@\d/))}function rtt(t,e){const n=e.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return t.containerQueries(i).up(o)}function itt(t){const e=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>e(t.breakpoints.up(...a),s),o.down=(...a)=>e(t.breakpoints.down(...a),s),o.between=(...a)=>e(t.breakpoints.between(...a),s),o.only=(...a)=>e(t.breakpoints.only(...a),s),o.not=(...a)=>{const l=e(t.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...t,containerQueries:i}}const ott={borderRadius:4};function YT(t,e){return e?Wo(t,e,{clone:!1}):t}const Hj={xs:0,sm:600,md:900,lg:1200,xl:1536},Jfe={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${Hj[t]}px)`},stt={containerQueries:t=>({up:e=>{let n=typeof e=="number"?e:Hj[e]||e;return typeof n=="number"&&(n=`${n}px`),t?`@container ${t} (min-width:${n})`:`@container (min-width:${n})`}})};function wu(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||Jfe;return e.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(e[l]),s),{})}if(typeof e=="object"){const o=r.breakpoints||Jfe;return Object.keys(e).reduce((s,a)=>{if(ntt(o.keys,a)){const l=rtt(r.containerQueries?r:stt,a);l&&(s[l]=n(e[a],a))}else if(Object.keys(o.values||Hj).includes(a)){const l=o.up(a);s[l]=n(e[a],a)}else{const l=a;s[l]=e[l]}return s},{})}return n(e)}function att(t={}){var n;return((n=t.keys)==null?void 0:n.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function ltt(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function ctt(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 qj({values:t,breakpoints:e,base:n}){const r=n||ctt(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((s,a,l)=>(Array.isArray(t)?(s[a]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(s[a]=t[a]!=null?t[a]:t[o],o=a):s[a]=t,s),{})}function Me(t){if(typeof t!="string")throw new Error(Mg(7));return t.charAt(0).toUpperCase()+t.slice(1)}function wS(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 TF(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=wS(t,n)||r,e&&(i=e(i,r,t)),i}function Qi(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=s=>{if(s[e]==null)return null;const a=s[e],l=s.theme,c=wS(l,r)||{};return wu(s,a,f=>{let d=TF(c,i,f);return f===d&&typeof f=="string"&&(d=TF(c,i,`${e}${f==="default"?"":Me(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[e],o}function utt(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const ftt={m:"margin",p:"padding"},dtt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},ede={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},htt=utt(t=>{if(t.length>2)if(ede[t])t=ede[t];else return[t];const[e,n]=t.split(""),r=ftt[e],i=dtt[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),bee=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],wee=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...bee,...wee];function CM(t,e,n,r){const i=wS(t,e,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:typeof i=="string"?`calc(${o} * ${i})`:i*o:Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o),a=i[s];return o>=0?a:typeof a=="number"?-a:`-${a}`}:typeof i=="function"?i:()=>{}}function _ee(t){return CM(t,"spacing",8)}function OM(t,e){return typeof e=="string"||e==null?e:t(e)}function ptt(t,e){return n=>t.reduce((r,i)=>(r[i]=OM(e,n),r),{})}function gtt(t,e,n,r){if(!e.includes(n))return null;const i=htt(n),o=ptt(i,r),s=t[n];return wu(t,s,o)}function EAe(t,e){const n=_ee(t.theme);return Object.keys(t).map(r=>gtt(t,e,r,n)).reduce(YT,{})}function ki(t){return EAe(t,bee)}ki.propTypes={};ki.filterProps=bee;function Ai(t){return EAe(t,wee)}Ai.propTypes={};Ai.filterProps=wee;function TAe(t=8,e=_ee({spacing:t})){if(t.mui)return t;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=e(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function Xj(...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]?YT(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Hc(t){return typeof t!="number"?t:`${t}px solid`}function Lu(t,e){return Qi({prop:t,themeKey:"borders",transform:e})}const mtt=Lu("border",Hc),vtt=Lu("borderTop",Hc),ytt=Lu("borderRight",Hc),xtt=Lu("borderBottom",Hc),btt=Lu("borderLeft",Hc),wtt=Lu("borderColor"),_tt=Lu("borderTopColor"),Stt=Lu("borderRightColor"),Ctt=Lu("borderBottomColor"),Ott=Lu("borderLeftColor"),Ett=Lu("outline",Hc),Ttt=Lu("outlineColor"),Yj=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=CM(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:OM(e,r)});return wu(t,t.borderRadius,n)}return null};Yj.propTypes={};Yj.filterProps=["borderRadius"];Xj(mtt,vtt,ytt,xtt,btt,wtt,_tt,Stt,Ctt,Ott,Yj,Ett,Ttt);const Qj=t=>{if(t.gap!==void 0&&t.gap!==null){const e=CM(t.theme,"spacing",8),n=r=>({gap:OM(e,r)});return wu(t,t.gap,n)}return null};Qj.propTypes={};Qj.filterProps=["gap"];const Kj=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=CM(t.theme,"spacing",8),n=r=>({columnGap:OM(e,r)});return wu(t,t.columnGap,n)}return null};Kj.propTypes={};Kj.filterProps=["columnGap"];const Zj=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=CM(t.theme,"spacing",8),n=r=>({rowGap:OM(e,r)});return wu(t,t.rowGap,n)}return null};Zj.propTypes={};Zj.filterProps=["rowGap"];const ktt=Qi({prop:"gridColumn"}),Att=Qi({prop:"gridRow"}),Ptt=Qi({prop:"gridAutoFlow"}),Mtt=Qi({prop:"gridAutoColumns"}),Rtt=Qi({prop:"gridAutoRows"}),Dtt=Qi({prop:"gridTemplateColumns"}),Itt=Qi({prop:"gridTemplateRows"}),Ltt=Qi({prop:"gridTemplateAreas"}),$tt=Qi({prop:"gridArea"});Xj(Qj,Kj,Zj,ktt,Att,Ptt,Mtt,Rtt,Dtt,Itt,Ltt,$tt);function L_(t,e){return e==="grey"?e:t}const Ftt=Qi({prop:"color",themeKey:"palette",transform:L_}),Ntt=Qi({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:L_}),ztt=Qi({prop:"backgroundColor",themeKey:"palette",transform:L_});Xj(Ftt,Ntt,ztt);function Zl(t){return t<=1&&t!==0?`${t*100}%`:t}const jtt=Qi({prop:"width",transform:Zl}),See=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var i,o,s,a,l;const r=((s=(o=(i=t.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||Hj[n];return r?((l=(a=t.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${t.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Zl(n)}};return wu(t,t.maxWidth,e)}return null};See.filterProps=["maxWidth"];const Btt=Qi({prop:"minWidth",transform:Zl}),Utt=Qi({prop:"height",transform:Zl}),Wtt=Qi({prop:"maxHeight",transform:Zl}),Vtt=Qi({prop:"minHeight",transform:Zl});Qi({prop:"size",cssProperty:"width",transform:Zl});Qi({prop:"size",cssProperty:"height",transform:Zl});const Gtt=Qi({prop:"boxSizing"});Xj(jtt,See,Btt,Utt,Wtt,Vtt,Gtt);const EM={border:{themeKey:"borders",transform:Hc},borderTop:{themeKey:"borders",transform:Hc},borderRight:{themeKey:"borders",transform:Hc},borderBottom:{themeKey:"borders",transform:Hc},borderLeft:{themeKey:"borders",transform:Hc},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Hc},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Yj},color:{themeKey:"palette",transform:L_},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:L_},backgroundColor:{themeKey:"palette",transform:L_},p:{style:Ai},pt:{style:Ai},pr:{style:Ai},pb:{style:Ai},pl:{style:Ai},px:{style:Ai},py:{style:Ai},padding:{style:Ai},paddingTop:{style:Ai},paddingRight:{style:Ai},paddingBottom:{style:Ai},paddingLeft:{style:Ai},paddingX:{style:Ai},paddingY:{style:Ai},paddingInline:{style:Ai},paddingInlineStart:{style:Ai},paddingInlineEnd:{style:Ai},paddingBlock:{style:Ai},paddingBlockStart:{style:Ai},paddingBlockEnd:{style:Ai},m:{style:ki},mt:{style:ki},mr:{style:ki},mb:{style:ki},ml:{style:ki},mx:{style:ki},my:{style:ki},margin:{style:ki},marginTop:{style:ki},marginRight:{style:ki},marginBottom:{style:ki},marginLeft:{style:ki},marginX:{style:ki},marginY:{style:ki},marginInline:{style:ki},marginInlineStart:{style:ki},marginInlineEnd:{style:ki},marginBlock:{style:ki},marginBlockStart:{style:ki},marginBlockEnd:{style:ki},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:Qj},rowGap:{style:Zj},columnGap:{style:Kj},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Zl},maxWidth:{style:See},minWidth:{transform:Zl},height:{transform:Zl},maxHeight:{transform:Zl},minHeight:{transform:Zl},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Htt(...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 qtt(t,e){return typeof t=="function"?t(e):t}function Xtt(){function t(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=wS(i,c)||{};return f?f(s):wu(s,r,p=>{let g=TF(d,u,p);return p===g&&typeof p=="string"&&(g=TF(d,u,`${n}${p==="default"?"":Me(p)}`,p)),l===!1?g:{[l]:g}})}function e(n){const{sx:r,theme:i={}}=n||{};if(!r)return null;const o=i.unstable_sxConfig??EM;function s(a){let l=a;if(typeof a=="function")l=a(i);else if(typeof a!="object")return a;if(!l)return null;const c=att(i.breakpoints),u=Object.keys(c);let f=c;return Object.keys(l).forEach(d=>{const h=qtt(l[d],i);if(h!=null)if(typeof h=="object")if(o[d])f=YT(f,t(d,h,i,o));else{const p=wu({theme:i},h,g=>({[d]:g}));Htt(p,h)?f[d]=e({sx:h,theme:i}):f=YT(f,p)}else f=YT(f,t(d,h,i,o))}),ttt(i,ltt(u,f))}return Array.isArray(r)?r.map(s):s(r)}return e}const Qv=Xtt();Qv.filterProps=["sx"];function Ytt(t,e){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[t])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(t);return i==="&"?e:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:e})}return n.palette.mode===t?e:{}}function Cee(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=t,a=ett(n),l=TAe(i);let c=Wo({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...ott,...o}},s);return c=itt(c),c.applyStyles=Ytt,c=e.reduce((u,f)=>Wo(u,f),c),c.unstable_sxConfig={...EM,...s==null?void 0:s.unstable_sxConfig},c.unstable_sx=function(f){return Qv({sx:f,theme:this})},c}function Qtt(t){return Object.keys(t).length===0}function Oee(t=null){const e=D.useContext(Gj);return!e||Qtt(e)?t:e}const Ktt=Cee();function Zb(t=Ktt){return Oee(t)}function Ztt({styles:t,themeId:e,defaultTheme:n={}}){const r=Zb(n),i=typeof t=="function"?t(e&&r[e]||r):t;return C.jsx(SAe,{styles:i})}const Jtt=t=>{var r;const e={systemProps:{},otherProps:{}},n=((r=t==null?void 0:t.theme)==null?void 0:r.unstable_sxConfig)??EM;return Object.keys(t).forEach(i=>{n[i]?e.systemProps[i]=t[i]:e.otherProps[i]=t[i]}),e};function Eee(t){const{sx:e,...n}=t,{systemProps:r,otherProps:i}=Jtt(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...s)=>{const a=e(...s);return Nd(a)?{...r,...a}:r}:o={...r,...e},{...i,sx:o}}const tde=t=>t,ent=()=>{let t=tde;return{configure(e){t=e},generate(e){return t(e)},reset(){t=tde}}},kAe=ent();function AAe(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;ea!=="theme"&&a!=="sx"&&a!=="as"})(Qv);return D.forwardRef(function(l,c){const u=Zb(n),{className:f,component:d="div",...h}=Eee(l);return C.jsx(o,{as:d,ref:c,className:Oe(f,i?i(r):r),theme:e&&u[e]||u,...h})})}const nnt={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 Xe(t,e,n="Mui"){const r=nnt[e];return r?`${n}-${r}`:`${kAe.generate(t)}-${e}`}function He(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=Xe(t,i,n)}),r}function PAe(t){const{variants:e,...n}=t,r={variants:e,style:Zfe(n),isProcessed:!0};return r.style===n||e&&e.forEach(i=>{typeof i.style!="function"&&(i.style=Zfe(i.style))}),r}const rnt=Cee();function n3(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}function int(t){return t?(e,n)=>n[t]:null}function ont(t,e,n){t.theme=ant(t.theme)?n:t.theme[e]||t.theme}function r3(t,e){const n=typeof e=="function"?e(t):e;if(Array.isArray(n))return n.flatMap(r=>r3(t,r));if(Array.isArray(n==null?void 0:n.variants)){let r;if(n.isProcessed)r=n.style;else{const{variants:i,...o}=n;r=o}return MAe(t,n.variants,[r])}return n!=null&&n.isProcessed?n.style:n}function MAe(t,e,n=[]){var i;let r;e:for(let o=0;o{Zet(a,w=>w.filter(_=>_!==Qv));const{name:c,slot:u,skipVariantsResolver:f,skipSx:d,overridesResolver:h=int(cnt(u)),...p}=l,g=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,m=d||!1;let v=n3;u==="Root"||u==="root"?v=r:u?v=i:lnt(a)&&(v=void 0);const y=CAe(a,{shouldForwardProp:v,label:snt(),...p}),x=w=>{if(typeof w=="function"&&w.__emotion_real!==w)return function(S){return r3(S,w)};if(Nd(w)){const _=PAe(w);return _.variants?function(O){return r3(O,_)}:_.style}return w},b=(...w)=>{const _=[],S=w.map(x),O=[];if(_.push(o),c&&h&&O.push(function(A){var I,z;const T=(z=(I=A.theme.components)==null?void 0:I[c])==null?void 0:z.styleOverrides;if(!T)return null;const M={};for(const F in T)M[F]=r3(A,T[F]);return h(A,M)}),c&&!g&&O.push(function(A){var M,I;const R=A.theme,T=(I=(M=R==null?void 0:R.components)==null?void 0:M[c])==null?void 0:I.variants;return T?MAe(A,T):null}),m||O.push(Qv),Array.isArray(S[0])){const P=S.shift(),A=new Array(_.length).fill(""),R=new Array(O.length).fill("");let T;T=[...A,...P,...R],T.raw=[...A,...P.raw,...R],_.unshift(T)}const k=[..._,...S,...O],E=y(...k);return a.muiName&&(E.muiName=a.muiName),E};return y.withConfig&&(b.withConfig=y.withConfig),b}}function snt(t,e){return void 0}function ant(t){for(const e in t)return!1;return!0}function lnt(t){return typeof t=="string"&&t.charCodeAt(0)>96}function cnt(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}const oa=RAe();function _S(t,e){const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=r;if(i==="components"||i==="slots")n[i]={...t[i],...n[i]};else if(i==="componentsProps"||i==="slotProps"){const o=t[i],s=e[i];if(!s)n[i]=o||{};else if(!o)n[i]=s;else{n[i]={...s};for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const l=a;n[i][l]=_S(o[l],s[l])}}}else n[i]===void 0&&(n[i]=t[i])}return n}function DAe(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:_S(e.components[n].defaultProps,r)}function unt({props:t,name:e,defaultTheme:n,themeId:r}){let i=Zb(n);return r&&(i=i[r]||i),DAe({theme:i,name:e,props:t})}const Ei=typeof window<"u"?D.useLayoutEffect:D.useEffect;function fnt(t,e,n,r,i){const[o,s]=D.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return Ei(()=>{if(!n)return;const a=n(t),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[t,n]),o}const dnt={...eF},IAe=dnt.useSyncExternalStore;function hnt(t,e,n,r,i){const o=D.useCallback(()=>e,[e]),s=D.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]),[a,l]=D.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,f=>(u.addEventListener("change",f),()=>{u.removeEventListener("change",f)})]},[o,n,t]);return IAe(l,a,s)}function Tee(t,e={}){const n=Oee(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:a=!1}=DAe({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(IAe!==void 0?hnt:fnt)(l,i,o,s,a)}function Lw(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}function kee(t,e=0,n=1){return Lw(t,e,n)}function pnt(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 Kv(t){if(t.type)return t;if(t.charAt(0)==="#")return Kv(pnt(t));const e=t.indexOf("("),n=t.substring(0,e);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(Mg(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"].includes(i))throw new Error(Mg(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const gnt=t=>{const e=Kv(t);return e.values.slice(0,3).map((n,r)=>e.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},X2=(t,e)=>{try{return gnt(t)}catch{return t}};function Jj(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function LAe(t){t=Kv(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),Jj({type:a,values:l})}function KH(t){t=Kv(t);let e=t.type==="hsl"||t.type==="hsla"?Kv(LAe(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 mnt(t,e){const n=KH(t),r=KH(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function kt(t,e){return t=Kv(t),e=kee(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Jj(t)}function XD(t,e,n){try{return kt(t,e)}catch{return t}}function Oh(t,e){if(t=Kv(t),e=kee(e),t.type.includes("hsl"))t.values[2]*=1-e;else if(t.type.includes("rgb")||t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Jj(t)}function Mr(t,e,n){try{return Oh(t,e)}catch{return t}}function Eh(t,e){if(t=Kv(t),e=kee(e),t.type.includes("hsl"))t.values[2]+=(100-t.values[2])*e;else if(t.type.includes("rgb"))for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Jj(t)}function Rr(t,e,n){try{return Eh(t,e)}catch{return t}}function $Ae(t,e=.15){return KH(t)>.5?Oh(t,e):Eh(t,e)}function YD(t,e,n){try{return $Ae(t,e)}catch{return t}}const FAe=ge.oneOfType([ge.func,ge.object]);function ZH(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function TM(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 i3(t,e){var n,r,i;return D.isValidElement(t)&&e.indexOf(t.type.muiName??((i=(r=(n=t.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:i.muiName))!==-1}function yi(t){return t&&t.ownerDocument||document}function xc(t){return yi(t).defaultView||window}function JH(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let nde=0;function vnt(t){const[e,n]=D.useState(t),r=t||e;return D.useEffect(()=>{e==null&&(nde+=1,n(`mui-${nde}`))},[e]),r}const ynt={...eF},rde=ynt.useId;function Jf(t){if(rde!==void 0){const e=rde();return t??e}return vnt(t)}function bc({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=D.useRef(t!==void 0),[o,s]=D.useState(e),a=i?t:o,l=D.useCallback(c=>{i||s(c)},[]);return[a,l]}function st(t){const e=D.useRef(t);return Ei(()=>{e.current=t}),D.useRef((...n)=>(0,e.current)(...n)).current}function dn(...t){return D.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{JH(n,e)})},t)}const ide={};function NAe(t,e){const n=D.useRef(ide);return n.current===ide&&(n.current=t(e)),n}const xnt=[];function bnt(t){D.useEffect(t,xnt)}class e4{constructor(){gn(this,"currentId",null);gn(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});gn(this,"disposeEffect",()=>this.clear)}static create(){return new e4}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function cv(){const t=NAe(e4.create).current;return bnt(t.disposeEffect),t}function Zv(t){try{return t.matches(":focus-visible")}catch{}return!1}function zAe(t=window){const e=t.document.documentElement.clientWidth;return t.innerWidth-e}function wnt(t){return D.Children.toArray(t).filter(e=>D.isValidElement(e))}const jAe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function qe(t,e,n=void 0){const r={};for(const i in t){const o=t[i];let s="",a=!0;for(let l=0;lr.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function ode(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 BAe(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=Oe(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p={...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},g={...n,...i,...r};return h.length>0&&(g.className=h),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const s=Mx({...i,...r}),a=ode(r),l=ode(i),c=e(s),u=Oe(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={...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={...c,...n,...l,...a};return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}function rA(t,e,n){return typeof t=="function"?t(e,n):t}function Zt(t){var f;const{elementType:e,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=t,s=i?{}:rA(n,r),{props:a,internalRef:l}=BAe({...o,externalSlotProps:s}),c=dn(l,s==null?void 0:s.ref,(f=t.additionalProps)==null?void 0:f.ref);return s_(e,{...a,ref:c},r)}function Ry(t){var e;return parseInt(D.version,10)>=19?((e=t==null?void 0:t.props)==null?void 0:e.ref)||null:(t==null?void 0:t.ref)||null}const UAe=D.createContext(null);function t4(){return D.useContext(UAe)}const Snt=typeof Symbol=="function"&&Symbol.for,WAe=Snt?Symbol.for("mui.nested"):"__THEME_NESTED__";function Cnt(t,e){return typeof e=="function"?e(t):{...t,...e}}function Ont(t){const{children:e,theme:n}=t,r=t4(),i=D.useMemo(()=>{const o=r===null?{...n}:Cnt(r,n);return o!=null&&(o[WAe]=r!==null),o},[n,r]);return C.jsx(UAe.Provider,{value:i,children:e})}const VAe=D.createContext();function Ent({value:t,...e}){return C.jsx(VAe.Provider,{value:t??!0,...e})}const Eo=()=>D.useContext(VAe)??!1,GAe=D.createContext(void 0);function Tnt({value:t,children:e}){return C.jsx(GAe.Provider,{value:t,children:e})}function knt(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n])return r;const i=e.components[n];return i.defaultProps?_S(i.defaultProps,r):!i.styleOverrides&&!i.variants?_S(i,r):r}function Ant({props:t,name:e}){const n=D.useContext(GAe);return knt({props:t,name:e,theme:{components:n}})}const sde={};function ade(t,e,n,r=!1){return D.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),s=t?{...e,[t]:o}:o;return r?()=>s:s}return t?{...e,[t]:n}:{...e,...n}},[t,e,n,r])}function HAe(t){const{children:e,theme:n,themeId:r}=t,i=Oee(sde),o=t4()||sde,s=ade(r,i,n),a=ade(r,o,n,!0),l=s.direction==="rtl";return C.jsx(Ont,{theme:a,children:C.jsx(Gj.Provider,{value:s,children:C.jsx(Ent,{value:l,children:C.jsx(Tnt,{value:s==null?void 0:s.components,children:e})})})})}const lde={theme:void 0};function Pnt(t){let e,n;return function(i){let o=e;return(o===void 0||i.theme!==n)&&(lde.theme=i.theme,o=PAe(t(lde)),e=o,n=i.theme),o}}const Aee="mode",Pee="color-scheme",Mnt="data-color-scheme";function Rnt(t){const{defaultMode:e="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:i=Aee,colorSchemeStorageKey:o=Pee,attribute:s=Mnt,colorSchemeNode:a="document.documentElement",nonce:l}=t||{};let c="",u=s;if(s==="class"&&(u=".%s"),s==="data"&&(u="[data-%s]"),u.startsWith(".")){const d=u.substring(1);c+=`${a}.classList.remove('${d}'.replace('%s', light), '${d}'.replace('%s', dark)); + */function CAe(t,e){return YH(t,e)}function Zet(t,e){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}const Kfe=[];function Zfe(t){return Kfe[0]=t,Vj(Kfe)}function Nd(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 OAe(t){if(!Nd(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=OAe(t[n])}),e}function Wo(t,e,n={clone:!0}){const r=n.clone?{...t}:t;return Nd(t)&&Nd(e)&&Object.keys(e).forEach(i=>{Nd(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&Nd(t[i])?r[i]=Wo(t[i],e[i],n):n.clone?r[i]=Nd(e[i])?OAe(e[i]):e[i]:r[i]=e[i]}),r}const Jet=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)=>({...n,[r.key]:r.val}),{})};function ett(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=t,o=Jet(e),s=Object.keys(o);function a(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=s.indexOf(h);return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n}) and (max-width:${(p!==-1&&typeof e[s[p]]=="number"?e[s[p]]:h)-r/100}${n})`}function u(d){return s.indexOf(d)+1r.startsWith("@container")).sort((r,i)=>{var s,a;const o=/min-width:\s*([0-9.]+)/;return+(((s=r.match(o))==null?void 0:s[1])||0)-+(((a=i.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const o=e[i];return delete r[i],r[i]=o,r},{...e}):e}function ntt(t,e){return e==="@"||e.startsWith("@")&&(t.some(n=>e.startsWith(`@${n}`))||!!e.match(/^@\d/))}function rtt(t,e){const n=e.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return t.containerQueries(i).up(o)}function itt(t){const e=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>e(t.breakpoints.up(...a),s),o.down=(...a)=>e(t.breakpoints.down(...a),s),o.between=(...a)=>e(t.breakpoints.between(...a),s),o.only=(...a)=>e(t.breakpoints.only(...a),s),o.not=(...a)=>{const l=e(t.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...t,containerQueries:i}}const ott={borderRadius:4};function XT(t,e){return e?Wo(t,e,{clone:!1}):t}const Hj={xs:0,sm:600,md:900,lg:1200,xl:1536},Jfe={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${Hj[t]}px)`},stt={containerQueries:t=>({up:e=>{let n=typeof e=="number"?e:Hj[e]||e;return typeof n=="number"&&(n=`${n}px`),t?`@container ${t} (min-width:${n})`:`@container (min-width:${n})`}})};function wu(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||Jfe;return e.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(e[l]),s),{})}if(typeof e=="object"){const o=r.breakpoints||Jfe;return Object.keys(e).reduce((s,a)=>{if(ntt(o.keys,a)){const l=rtt(r.containerQueries?r:stt,a);l&&(s[l]=n(e[a],a))}else if(Object.keys(o.values||Hj).includes(a)){const l=o.up(a);s[l]=n(e[a],a)}else{const l=a;s[l]=e[l]}return s},{})}return n(e)}function att(t={}){var n;return((n=t.keys)==null?void 0:n.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function ltt(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function ctt(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 qj({values:t,breakpoints:e,base:n}){const r=n||ctt(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((s,a,l)=>(Array.isArray(t)?(s[a]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(s[a]=t[a]!=null?t[a]:t[o],o=a):s[a]=t,s),{})}function Me(t){if(typeof t!="string")throw new Error(Mg(7));return t.charAt(0).toUpperCase()+t.slice(1)}function wS(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 TF(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=wS(t,n)||r,e&&(i=e(i,r,t)),i}function Qi(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=s=>{if(s[e]==null)return null;const a=s[e],l=s.theme,c=wS(l,r)||{};return wu(s,a,f=>{let d=TF(c,i,f);return f===d&&typeof f=="string"&&(d=TF(c,i,`${e}${f==="default"?"":Me(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[e],o}function utt(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const ftt={m:"margin",p:"padding"},dtt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},ede={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},htt=utt(t=>{if(t.length>2)if(ede[t])t=ede[t];else return[t];const[e,n]=t.split(""),r=ftt[e],i=dtt[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),bee=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],wee=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...bee,...wee];function SM(t,e,n,r){const i=wS(t,e,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:typeof i=="string"?`calc(${o} * ${i})`:i*o:Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o),a=i[s];return o>=0?a:typeof a=="number"?-a:`-${a}`}:typeof i=="function"?i:()=>{}}function _ee(t){return SM(t,"spacing",8)}function CM(t,e){return typeof e=="string"||e==null?e:t(e)}function ptt(t,e){return n=>t.reduce((r,i)=>(r[i]=CM(e,n),r),{})}function gtt(t,e,n,r){if(!e.includes(n))return null;const i=htt(n),o=ptt(i,r),s=t[n];return wu(t,s,o)}function EAe(t,e){const n=_ee(t.theme);return Object.keys(t).map(r=>gtt(t,e,r,n)).reduce(XT,{})}function ki(t){return EAe(t,bee)}ki.propTypes={};ki.filterProps=bee;function Ai(t){return EAe(t,wee)}Ai.propTypes={};Ai.filterProps=wee;function TAe(t=8,e=_ee({spacing:t})){if(t.mui)return t;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=e(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function Xj(...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]?XT(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Hc(t){return typeof t!="number"?t:`${t}px solid`}function Lu(t,e){return Qi({prop:t,themeKey:"borders",transform:e})}const mtt=Lu("border",Hc),vtt=Lu("borderTop",Hc),ytt=Lu("borderRight",Hc),xtt=Lu("borderBottom",Hc),btt=Lu("borderLeft",Hc),wtt=Lu("borderColor"),_tt=Lu("borderTopColor"),Stt=Lu("borderRightColor"),Ctt=Lu("borderBottomColor"),Ott=Lu("borderLeftColor"),Ett=Lu("outline",Hc),Ttt=Lu("outlineColor"),Yj=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=SM(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:CM(e,r)});return wu(t,t.borderRadius,n)}return null};Yj.propTypes={};Yj.filterProps=["borderRadius"];Xj(mtt,vtt,ytt,xtt,btt,wtt,_tt,Stt,Ctt,Ott,Yj,Ett,Ttt);const Qj=t=>{if(t.gap!==void 0&&t.gap!==null){const e=SM(t.theme,"spacing",8),n=r=>({gap:CM(e,r)});return wu(t,t.gap,n)}return null};Qj.propTypes={};Qj.filterProps=["gap"];const Kj=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=SM(t.theme,"spacing",8),n=r=>({columnGap:CM(e,r)});return wu(t,t.columnGap,n)}return null};Kj.propTypes={};Kj.filterProps=["columnGap"];const Zj=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=SM(t.theme,"spacing",8),n=r=>({rowGap:CM(e,r)});return wu(t,t.rowGap,n)}return null};Zj.propTypes={};Zj.filterProps=["rowGap"];const ktt=Qi({prop:"gridColumn"}),Att=Qi({prop:"gridRow"}),Ptt=Qi({prop:"gridAutoFlow"}),Mtt=Qi({prop:"gridAutoColumns"}),Rtt=Qi({prop:"gridAutoRows"}),Dtt=Qi({prop:"gridTemplateColumns"}),Itt=Qi({prop:"gridTemplateRows"}),Ltt=Qi({prop:"gridTemplateAreas"}),$tt=Qi({prop:"gridArea"});Xj(Qj,Kj,Zj,ktt,Att,Ptt,Mtt,Rtt,Dtt,Itt,Ltt,$tt);function L_(t,e){return e==="grey"?e:t}const Ftt=Qi({prop:"color",themeKey:"palette",transform:L_}),Ntt=Qi({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:L_}),ztt=Qi({prop:"backgroundColor",themeKey:"palette",transform:L_});Xj(Ftt,Ntt,ztt);function Zl(t){return t<=1&&t!==0?`${t*100}%`:t}const jtt=Qi({prop:"width",transform:Zl}),See=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var i,o,s,a,l;const r=((s=(o=(i=t.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||Hj[n];return r?((l=(a=t.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${t.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Zl(n)}};return wu(t,t.maxWidth,e)}return null};See.filterProps=["maxWidth"];const Btt=Qi({prop:"minWidth",transform:Zl}),Utt=Qi({prop:"height",transform:Zl}),Wtt=Qi({prop:"maxHeight",transform:Zl}),Vtt=Qi({prop:"minHeight",transform:Zl});Qi({prop:"size",cssProperty:"width",transform:Zl});Qi({prop:"size",cssProperty:"height",transform:Zl});const Gtt=Qi({prop:"boxSizing"});Xj(jtt,See,Btt,Utt,Wtt,Vtt,Gtt);const OM={border:{themeKey:"borders",transform:Hc},borderTop:{themeKey:"borders",transform:Hc},borderRight:{themeKey:"borders",transform:Hc},borderBottom:{themeKey:"borders",transform:Hc},borderLeft:{themeKey:"borders",transform:Hc},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Hc},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Yj},color:{themeKey:"palette",transform:L_},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:L_},backgroundColor:{themeKey:"palette",transform:L_},p:{style:Ai},pt:{style:Ai},pr:{style:Ai},pb:{style:Ai},pl:{style:Ai},px:{style:Ai},py:{style:Ai},padding:{style:Ai},paddingTop:{style:Ai},paddingRight:{style:Ai},paddingBottom:{style:Ai},paddingLeft:{style:Ai},paddingX:{style:Ai},paddingY:{style:Ai},paddingInline:{style:Ai},paddingInlineStart:{style:Ai},paddingInlineEnd:{style:Ai},paddingBlock:{style:Ai},paddingBlockStart:{style:Ai},paddingBlockEnd:{style:Ai},m:{style:ki},mt:{style:ki},mr:{style:ki},mb:{style:ki},ml:{style:ki},mx:{style:ki},my:{style:ki},margin:{style:ki},marginTop:{style:ki},marginRight:{style:ki},marginBottom:{style:ki},marginLeft:{style:ki},marginX:{style:ki},marginY:{style:ki},marginInline:{style:ki},marginInlineStart:{style:ki},marginInlineEnd:{style:ki},marginBlock:{style:ki},marginBlockStart:{style:ki},marginBlockEnd:{style:ki},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:Qj},rowGap:{style:Zj},columnGap:{style:Kj},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Zl},maxWidth:{style:See},minWidth:{transform:Zl},height:{transform:Zl},maxHeight:{transform:Zl},minHeight:{transform:Zl},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Htt(...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 qtt(t,e){return typeof t=="function"?t(e):t}function Xtt(){function t(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=wS(i,c)||{};return f?f(s):wu(s,r,p=>{let g=TF(d,u,p);return p===g&&typeof p=="string"&&(g=TF(d,u,`${n}${p==="default"?"":Me(p)}`,p)),l===!1?g:{[l]:g}})}function e(n){const{sx:r,theme:i={}}=n||{};if(!r)return null;const o=i.unstable_sxConfig??OM;function s(a){let l=a;if(typeof a=="function")l=a(i);else if(typeof a!="object")return a;if(!l)return null;const c=att(i.breakpoints),u=Object.keys(c);let f=c;return Object.keys(l).forEach(d=>{const h=qtt(l[d],i);if(h!=null)if(typeof h=="object")if(o[d])f=XT(f,t(d,h,i,o));else{const p=wu({theme:i},h,g=>({[d]:g}));Htt(p,h)?f[d]=e({sx:h,theme:i}):f=XT(f,p)}else f=XT(f,t(d,h,i,o))}),ttt(i,ltt(u,f))}return Array.isArray(r)?r.map(s):s(r)}return e}const Qv=Xtt();Qv.filterProps=["sx"];function Ytt(t,e){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[t])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(t);return i==="&"?e:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:e})}return n.palette.mode===t?e:{}}function Cee(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=t,a=ett(n),l=TAe(i);let c=Wo({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...ott,...o}},s);return c=itt(c),c.applyStyles=Ytt,c=e.reduce((u,f)=>Wo(u,f),c),c.unstable_sxConfig={...OM,...s==null?void 0:s.unstable_sxConfig},c.unstable_sx=function(f){return Qv({sx:f,theme:this})},c}function Qtt(t){return Object.keys(t).length===0}function Oee(t=null){const e=D.useContext(Gj);return!e||Qtt(e)?t:e}const Ktt=Cee();function Zb(t=Ktt){return Oee(t)}function Ztt({styles:t,themeId:e,defaultTheme:n={}}){const r=Zb(n),i=typeof t=="function"?t(e&&r[e]||r):t;return C.jsx(SAe,{styles:i})}const Jtt=t=>{var r;const e={systemProps:{},otherProps:{}},n=((r=t==null?void 0:t.theme)==null?void 0:r.unstable_sxConfig)??OM;return Object.keys(t).forEach(i=>{n[i]?e.systemProps[i]=t[i]:e.otherProps[i]=t[i]}),e};function Eee(t){const{sx:e,...n}=t,{systemProps:r,otherProps:i}=Jtt(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...s)=>{const a=e(...s);return Nd(a)?{...r,...a}:r}:o={...r,...e},{...i,sx:o}}const tde=t=>t,ent=()=>{let t=tde;return{configure(e){t=e},generate(e){return t(e)},reset(){t=tde}}},kAe=ent();function AAe(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;ea!=="theme"&&a!=="sx"&&a!=="as"})(Qv);return D.forwardRef(function(l,c){const u=Zb(n),{className:f,component:d="div",...h}=Eee(l);return C.jsx(o,{as:d,ref:c,className:Oe(f,i?i(r):r),theme:e&&u[e]||u,...h})})}const nnt={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 Xe(t,e,n="Mui"){const r=nnt[e];return r?`${n}-${r}`:`${kAe.generate(t)}-${e}`}function He(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=Xe(t,i,n)}),r}function PAe(t){const{variants:e,...n}=t,r={variants:e,style:Zfe(n),isProcessed:!0};return r.style===n||e&&e.forEach(i=>{typeof i.style!="function"&&(i.style=Zfe(i.style))}),r}const rnt=Cee();function n3(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}function int(t){return t?(e,n)=>n[t]:null}function ont(t,e,n){t.theme=ant(t.theme)?n:t.theme[e]||t.theme}function r3(t,e){const n=typeof e=="function"?e(t):e;if(Array.isArray(n))return n.flatMap(r=>r3(t,r));if(Array.isArray(n==null?void 0:n.variants)){let r;if(n.isProcessed)r=n.style;else{const{variants:i,...o}=n;r=o}return MAe(t,n.variants,[r])}return n!=null&&n.isProcessed?n.style:n}function MAe(t,e,n=[]){var i;let r;e:for(let o=0;o{Zet(a,w=>w.filter(_=>_!==Qv));const{name:c,slot:u,skipVariantsResolver:f,skipSx:d,overridesResolver:h=int(cnt(u)),...p}=l,g=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,m=d||!1;let v=n3;u==="Root"||u==="root"?v=r:u?v=i:lnt(a)&&(v=void 0);const y=CAe(a,{shouldForwardProp:v,label:snt(),...p}),x=w=>{if(typeof w=="function"&&w.__emotion_real!==w)return function(S){return r3(S,w)};if(Nd(w)){const _=PAe(w);return _.variants?function(O){return r3(O,_)}:_.style}return w},b=(...w)=>{const _=[],S=w.map(x),O=[];if(_.push(o),c&&h&&O.push(function(A){var I,z;const T=(z=(I=A.theme.components)==null?void 0:I[c])==null?void 0:z.styleOverrides;if(!T)return null;const M={};for(const F in T)M[F]=r3(A,T[F]);return h(A,M)}),c&&!g&&O.push(function(A){var M,I;const R=A.theme,T=(I=(M=R==null?void 0:R.components)==null?void 0:M[c])==null?void 0:I.variants;return T?MAe(A,T):null}),m||O.push(Qv),Array.isArray(S[0])){const P=S.shift(),A=new Array(_.length).fill(""),R=new Array(O.length).fill("");let T;T=[...A,...P,...R],T.raw=[...A,...P.raw,...R],_.unshift(T)}const k=[..._,...S,...O],E=y(...k);return a.muiName&&(E.muiName=a.muiName),E};return y.withConfig&&(b.withConfig=y.withConfig),b}}function snt(t,e){return void 0}function ant(t){for(const e in t)return!1;return!0}function lnt(t){return typeof t=="string"&&t.charCodeAt(0)>96}function cnt(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}const oa=RAe();function _S(t,e){const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=r;if(i==="components"||i==="slots")n[i]={...t[i],...n[i]};else if(i==="componentsProps"||i==="slotProps"){const o=t[i],s=e[i];if(!s)n[i]=o||{};else if(!o)n[i]=s;else{n[i]={...s};for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const l=a;n[i][l]=_S(o[l],s[l])}}}else n[i]===void 0&&(n[i]=t[i])}return n}function DAe(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:_S(e.components[n].defaultProps,r)}function unt({props:t,name:e,defaultTheme:n,themeId:r}){let i=Zb(n);return r&&(i=i[r]||i),DAe({theme:i,name:e,props:t})}const Ei=typeof window<"u"?D.useLayoutEffect:D.useEffect;function fnt(t,e,n,r,i){const[o,s]=D.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return Ei(()=>{if(!n)return;const a=n(t),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[t,n]),o}const dnt={...eF},IAe=dnt.useSyncExternalStore;function hnt(t,e,n,r,i){const o=D.useCallback(()=>e,[e]),s=D.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]),[a,l]=D.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,f=>(u.addEventListener("change",f),()=>{u.removeEventListener("change",f)})]},[o,n,t]);return IAe(l,a,s)}function Tee(t,e={}){const n=Oee(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:a=!1}=DAe({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(IAe!==void 0?hnt:fnt)(l,i,o,s,a)}function Lw(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}function kee(t,e=0,n=1){return Lw(t,e,n)}function pnt(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 Kv(t){if(t.type)return t;if(t.charAt(0)==="#")return Kv(pnt(t));const e=t.indexOf("("),n=t.substring(0,e);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(Mg(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"].includes(i))throw new Error(Mg(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const gnt=t=>{const e=Kv(t);return e.values.slice(0,3).map((n,r)=>e.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},q2=(t,e)=>{try{return gnt(t)}catch{return t}};function Jj(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function LAe(t){t=Kv(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),Jj({type:a,values:l})}function KH(t){t=Kv(t);let e=t.type==="hsl"||t.type==="hsla"?Kv(LAe(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 mnt(t,e){const n=KH(t),r=KH(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function kt(t,e){return t=Kv(t),e=kee(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Jj(t)}function XD(t,e,n){try{return kt(t,e)}catch{return t}}function Oh(t,e){if(t=Kv(t),e=kee(e),t.type.includes("hsl"))t.values[2]*=1-e;else if(t.type.includes("rgb")||t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Jj(t)}function Mr(t,e,n){try{return Oh(t,e)}catch{return t}}function Eh(t,e){if(t=Kv(t),e=kee(e),t.type.includes("hsl"))t.values[2]+=(100-t.values[2])*e;else if(t.type.includes("rgb"))for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Jj(t)}function Rr(t,e,n){try{return Eh(t,e)}catch{return t}}function $Ae(t,e=.15){return KH(t)>.5?Oh(t,e):Eh(t,e)}function YD(t,e,n){try{return $Ae(t,e)}catch{return t}}const FAe=ge.oneOfType([ge.func,ge.object]);function ZH(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function EM(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 i3(t,e){var n,r,i;return D.isValidElement(t)&&e.indexOf(t.type.muiName??((i=(r=(n=t.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:i.muiName))!==-1}function yi(t){return t&&t.ownerDocument||document}function xc(t){return yi(t).defaultView||window}function JH(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let nde=0;function vnt(t){const[e,n]=D.useState(t),r=t||e;return D.useEffect(()=>{e==null&&(nde+=1,n(`mui-${nde}`))},[e]),r}const ynt={...eF},rde=ynt.useId;function Jf(t){if(rde!==void 0){const e=rde();return t??e}return vnt(t)}function bc({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=D.useRef(t!==void 0),[o,s]=D.useState(e),a=i?t:o,l=D.useCallback(c=>{i||s(c)},[]);return[a,l]}function st(t){const e=D.useRef(t);return Ei(()=>{e.current=t}),D.useRef((...n)=>(0,e.current)(...n)).current}function dn(...t){return D.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{JH(n,e)})},t)}const ide={};function NAe(t,e){const n=D.useRef(ide);return n.current===ide&&(n.current=t(e)),n}const xnt=[];function bnt(t){D.useEffect(t,xnt)}class e4{constructor(){gn(this,"currentId",null);gn(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});gn(this,"disposeEffect",()=>this.clear)}static create(){return new e4}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function cv(){const t=NAe(e4.create).current;return bnt(t.disposeEffect),t}function Zv(t){try{return t.matches(":focus-visible")}catch{}return!1}function zAe(t=window){const e=t.document.documentElement.clientWidth;return t.innerWidth-e}function wnt(t){return D.Children.toArray(t).filter(e=>D.isValidElement(e))}const jAe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function qe(t,e,n=void 0){const r={};for(const i in t){const o=t[i];let s="",a=!0;for(let l=0;lr.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function ode(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 BAe(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=Oe(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p={...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},g={...n,...i,...r};return h.length>0&&(g.className=h),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const s=Mx({...i,...r}),a=ode(r),l=ode(i),c=e(s),u=Oe(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={...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={...c,...n,...l,...a};return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}function nA(t,e,n){return typeof t=="function"?t(e,n):t}function Zt(t){var f;const{elementType:e,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=t,s=i?{}:nA(n,r),{props:a,internalRef:l}=BAe({...o,externalSlotProps:s}),c=dn(l,s==null?void 0:s.ref,(f=t.additionalProps)==null?void 0:f.ref);return s_(e,{...a,ref:c},r)}function Ry(t){var e;return parseInt(D.version,10)>=19?((e=t==null?void 0:t.props)==null?void 0:e.ref)||null:(t==null?void 0:t.ref)||null}const UAe=D.createContext(null);function t4(){return D.useContext(UAe)}const Snt=typeof Symbol=="function"&&Symbol.for,WAe=Snt?Symbol.for("mui.nested"):"__THEME_NESTED__";function Cnt(t,e){return typeof e=="function"?e(t):{...t,...e}}function Ont(t){const{children:e,theme:n}=t,r=t4(),i=D.useMemo(()=>{const o=r===null?{...n}:Cnt(r,n);return o!=null&&(o[WAe]=r!==null),o},[n,r]);return C.jsx(UAe.Provider,{value:i,children:e})}const VAe=D.createContext();function Ent({value:t,...e}){return C.jsx(VAe.Provider,{value:t??!0,...e})}const Eo=()=>D.useContext(VAe)??!1,GAe=D.createContext(void 0);function Tnt({value:t,children:e}){return C.jsx(GAe.Provider,{value:t,children:e})}function knt(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n])return r;const i=e.components[n];return i.defaultProps?_S(i.defaultProps,r):!i.styleOverrides&&!i.variants?_S(i,r):r}function Ant({props:t,name:e}){const n=D.useContext(GAe);return knt({props:t,name:e,theme:{components:n}})}const sde={};function ade(t,e,n,r=!1){return D.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),s=t?{...e,[t]:o}:o;return r?()=>s:s}return t?{...e,[t]:n}:{...e,...n}},[t,e,n,r])}function HAe(t){const{children:e,theme:n,themeId:r}=t,i=Oee(sde),o=t4()||sde,s=ade(r,i,n),a=ade(r,o,n,!0),l=s.direction==="rtl";return C.jsx(Ont,{theme:a,children:C.jsx(Gj.Provider,{value:s,children:C.jsx(Ent,{value:l,children:C.jsx(Tnt,{value:s==null?void 0:s.components,children:e})})})})}const lde={theme:void 0};function Pnt(t){let e,n;return function(i){let o=e;return(o===void 0||i.theme!==n)&&(lde.theme=i.theme,o=PAe(t(lde)),e=o,n=i.theme),o}}const Aee="mode",Pee="color-scheme",Mnt="data-color-scheme";function Rnt(t){const{defaultMode:e="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:i=Aee,colorSchemeStorageKey:o=Pee,attribute:s=Mnt,colorSchemeNode:a="document.documentElement",nonce:l}=t||{};let c="",u=s;if(s==="class"&&(u=".%s"),s==="data"&&(u="[data-%s]"),u.startsWith(".")){const d=u.substring(1);c+=`${a}.classList.remove('${d}'.replace('%s', light), '${d}'.replace('%s', dark)); ${a}.classList.add('${d}'.replace('%s', colorScheme));`}const f=u.match(/\[([^\]]+)\]/);if(f){const[d,h]=f[1].split("=");h||(c+=`${a}.removeAttribute('${d}'.replace('%s', light)); ${a}.removeAttribute('${d}'.replace('%s', dark));`),c+=` ${a}.setAttribute('${d}'.replace('%s', colorScheme), ${h?`${h}.replace('%s', colorScheme)`:'""'});`}else c+=`${a}.setAttribute('${u}', colorScheme);`;return C.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(function() { @@ -107,15 +107,15 @@ try { if (colorScheme) { ${c} } -} catch(e){}})();`}},"mui-color-scheme-init")}function cde(t){if(typeof window<"u"&&typeof window.matchMedia=="function"&&t==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function qAe(t,e){if(t.mode==="light"||t.mode==="system"&&t.systemMode==="light")return e("light");if(t.mode==="dark"||t.mode==="system"&&t.systemMode==="dark")return e("dark")}function Dnt(t){return qAe(t,e=>{if(e==="light")return t.lightColorScheme;if(e==="dark")return t.darkColorScheme})}function Z8(t,e){if(typeof window>"u")return;let n;try{n=localStorage.getItem(t)||void 0,n||localStorage.setItem(t,e)}catch{}return n||e}function Int(t){const{defaultMode:e="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:o=Aee,colorSchemeStorageKey:s=Pee,storageWindow:a=typeof window>"u"?void 0:window}=t,l=i.join(","),c=i.length>1,[u,f]=D.useState(()=>{const x=Z8(o,e),b=Z8(`${s}-light`,n),w=Z8(`${s}-dark`,r);return{mode:x,systemMode:cde(x),lightColorScheme:b,darkColorScheme:w}}),[,d]=D.useState(!1),h=D.useRef(!1);D.useEffect(()=>{c&&d(!0),h.current=!0},[c]);const p=Dnt(u),g=D.useCallback(x=>{f(b=>{if(x===b.mode)return b;const w=x??e;try{localStorage.setItem(o,w)}catch{}return{...b,mode:w,systemMode:cde(w)}})},[o,e]),m=D.useCallback(x=>{x?typeof x=="string"?x&&!l.includes(x)?console.error(`\`${x}\` does not exist in \`theme.colorSchemes\`.`):f(b=>{const w={...b};return qAe(b,_=>{try{localStorage.setItem(`${s}-${_}`,x)}catch{}_==="light"&&(w.lightColorScheme=x),_==="dark"&&(w.darkColorScheme=x)}),w}):f(b=>{const w={...b},_=x.light===null?n:x.light,S=x.dark===null?r:x.dark;if(_)if(!l.includes(_))console.error(`\`${_}\` does not exist in \`theme.colorSchemes\`.`);else{w.lightColorScheme=_;try{localStorage.setItem(`${s}-light`,_)}catch{}}if(S)if(!l.includes(S))console.error(`\`${S}\` does not exist in \`theme.colorSchemes\`.`);else{w.darkColorScheme=S;try{localStorage.setItem(`${s}-dark`,S)}catch{}}return w}):f(b=>{try{localStorage.setItem(`${s}-light`,n),localStorage.setItem(`${s}-dark`,r)}catch{}return{...b,lightColorScheme:n,darkColorScheme:r}})},[l,s,n,r]),v=D.useCallback(x=>{u.mode==="system"&&f(b=>{const w=x!=null&&x.matches?"dark":"light";return b.systemMode===w?b:{...b,systemMode:w}})},[u.mode]),y=D.useRef(v);return y.current=v,D.useEffect(()=>{if(typeof window.matchMedia!="function"||!c)return;const x=(...w)=>y.current(...w),b=window.matchMedia("(prefers-color-scheme: dark)");return b.addListener(x),x(b),()=>{b.removeListener(x)}},[c]),D.useEffect(()=>{if(a&&c){const x=b=>{const w=b.newValue;typeof b.key=="string"&&b.key.startsWith(s)&&(!w||l.match(w))&&(b.key.endsWith("light")&&m({light:w}),b.key.endsWith("dark")&&m({dark:w})),b.key===o&&(!w||["light","dark","system"].includes(w))&&g(w||e)};return a.addEventListener("storage",x),()=>{a.removeEventListener("storage",x)}}},[m,g,o,s,l,e,a,c]),{...u,mode:h.current||!c?u.mode:void 0,systemMode:h.current||!c?u.systemMode:void 0,colorScheme:h.current||!c?p:void 0,setMode:g,setColorScheme:m}}const Lnt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function $nt(t){const{themeId:e,theme:n={},modeStorageKey:r=Aee,colorSchemeStorageKey:i=Pee,disableTransitionOnChange:o=!1,defaultColorScheme:s,resolveTheme:a}=t,l={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},c=D.createContext(void 0),u=()=>D.useContext(c)||l;function f(g){var H,W,J,se,ye;const{children:m,theme:v,modeStorageKey:y=r,colorSchemeStorageKey:x=i,disableTransitionOnChange:b=o,storageWindow:w=typeof window>"u"?void 0:window,documentNode:_=typeof document>"u"?void 0:document,colorSchemeNode:S=typeof document>"u"?void 0:document.documentElement,disableNestedContext:O=!1,disableStyleSheetGeneration:k=!1,defaultMode:E="system"}=g,P=D.useRef(!1),A=t4(),R=D.useContext(c),T=!!R&&!O,M=D.useMemo(()=>v||(typeof n=="function"?n():n),[v]),I=M[e],{colorSchemes:z={},components:F={},cssVarPrefix:N,...L}=I||M,B=Object.keys(z).filter(ie=>!!z[ie]).join(","),$=D.useMemo(()=>B.split(","),[B]),j=typeof s=="string"?s:s.light,X=typeof s=="string"?s:s.dark,V=z[j]&&z[X]?E:((W=(H=z[L.defaultColorScheme])==null?void 0:H.palette)==null?void 0:W.mode)||((J=L.palette)==null?void 0:J.mode),{mode:Y,setMode:le,systemMode:K,lightColorScheme:ee,darkColorScheme:re,colorScheme:me,setColorScheme:te}=Int({supportedColorSchemes:$,defaultLightColorScheme:j,defaultDarkColorScheme:X,modeStorageKey:y,colorSchemeStorageKey:x,defaultMode:V,storageWindow:w});let ae=Y,U=me;T&&(ae=R.mode,U=R.colorScheme);const oe=U||L.defaultColorScheme,ne=((se=L.generateThemeVars)==null?void 0:se.call(L))||L.vars,G={...L,components:F,colorSchemes:z,cssVarPrefix:N,vars:ne};if(typeof G.generateSpacing=="function"&&(G.spacing=G.generateSpacing()),oe){const ie=z[oe];ie&&typeof ie=="object"&&Object.keys(ie).forEach(fe=>{ie[fe]&&typeof ie[fe]=="object"?G[fe]={...G[fe],...ie[fe]}:G[fe]=ie[fe]})}const q=L.colorSchemeSelector;D.useEffect(()=>{if(U&&S&&q&&q!=="media"){const ie=q;let fe=q;if(ie==="class"&&(fe=".%s"),ie==="data"&&(fe="[data-%s]"),ie!=null&&ie.startsWith("data-")&&!ie.includes("%s")&&(fe=`[${ie}="%s"]`),fe.startsWith("."))S.classList.remove(...$.map(Q=>fe.substring(1).replace("%s",Q))),S.classList.add(fe.substring(1).replace("%s",U));else{const Q=fe.replace("%s",U).match(/\[([^\]]+)\]/);if(Q){const[_e,we]=Q[1].split("=");we||$.forEach(Ie=>{S.removeAttribute(_e.replace(U,Ie))}),S.setAttribute(_e,we?we.replace(/"|'/g,""):"")}else S.setAttribute(fe,U)}}},[U,q,S,$]),D.useEffect(()=>{let ie;if(b&&P.current&&_){const fe=_.createElement("style");fe.appendChild(_.createTextNode(Lnt)),_.head.appendChild(fe),window.getComputedStyle(_.body),ie=setTimeout(()=>{_.head.removeChild(fe)},1)}return()=>{clearTimeout(ie)}},[U,b,_]),D.useEffect(()=>(P.current=!0,()=>{P.current=!1}),[]);const Z=D.useMemo(()=>({allColorSchemes:$,colorScheme:U,darkColorScheme:re,lightColorScheme:ee,mode:ae,setColorScheme:te,setMode:le,systemMode:K}),[$,U,re,ee,ae,te,le,K]);let de=!0;(k||L.cssVariables===!1||T&&(A==null?void 0:A.cssVarPrefix)===N)&&(de=!1);const xe=C.jsxs(D.Fragment,{children:[C.jsx(HAe,{themeId:I?e:void 0,theme:a?a(G):G,children:m}),de&&C.jsx(SAe,{styles:((ye=G.generateStyleSheets)==null?void 0:ye.call(G))||[]})]});return T?xe:C.jsx(c.Provider,{value:Z,children:xe})}const d=typeof s=="string"?s:s.light,h=typeof s=="string"?s:s.dark;return{CssVarsProvider:f,useColorScheme:u,getInitColorSchemeScript:g=>Rnt({colorSchemeStorageKey:i,defaultLightColorScheme:d,defaultDarkColorScheme:h,modeStorageKey:r,...g})}}function Fnt(t=""){function e(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${t?`${t}-`:""}${i}${e(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${t?`${t}-`:""}${r}${e(...i)})`}const ude=(t,e,n,r=[])=>{let i=t;e.forEach((o,s)=>{s===e.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},Nnt=(t,e,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):e([...o,a],l,s))})}r(t)},znt=(t,e)=>typeof e=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>t.includes(r))||t[t.length-1].toLowerCase().includes("opacity")?e:`${e}px`:e;function J8(t,e){const{prefix:n,shouldSkipGeneratingVar:r}=e||{},i={},o={},s={};return Nnt(t,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=znt(a,l);Object.assign(i,{[u]:f}),ude(o,a,`var(${u})`,c),ude(s,a,`var(${u}, ${f})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function jnt(t,e={}){const{getSelector:n=m,disableCssColorScheme:r,colorSchemeSelector:i}=e,{colorSchemes:o={},components:s,defaultColorScheme:a="light",...l}=t,{vars:c,css:u,varsWithDefaults:f}=J8(l,e);let d=f;const h={},{[a]:p,...g}=o;if(Object.entries(g||{}).forEach(([x,b])=>{const{vars:w,css:_,varsWithDefaults:S}=J8(b,e);d=Wo(d,S),h[x]={css:_,vars:w}}),p){const{css:x,vars:b,varsWithDefaults:w}=J8(p,e);d=Wo(d,w),h[a]={css:x,vars:b}}function m(x,b){var _,S;let w=i;if(i==="class"&&(w=".%s"),i==="data"&&(w="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(w=`[${i}="%s"]`),x){if(w==="media")return t.defaultColorScheme===x?":root":{[`@media (prefers-color-scheme: ${((S=(_=o[x])==null?void 0:_.palette)==null?void 0:S.mode)||x})`]:{":root":b}};if(w)return t.defaultColorScheme===x?`:root, ${w.replace("%s",String(x))}`:w.replace("%s",String(x))}return":root"}return{vars:d,generateThemeVars:()=>{let x={...c};return Object.entries(h).forEach(([,{vars:b}])=>{x=Wo(x,b)}),x},generateStyleSheets:()=>{var O,k;const x=[],b=t.defaultColorScheme||"light";function w(E,P){Object.keys(P).length&&x.push(typeof E=="string"?{[E]:{...P}}:E)}w(n(void 0,{...u}),u);const{[b]:_,...S}=h;if(_){const{css:E}=_,P=(k=(O=o[b])==null?void 0:O.palette)==null?void 0:k.mode,A=!r&&P?{colorScheme:P,...E}:{...E};w(n(b,{...A}),A)}return Object.entries(S).forEach(([E,{css:P}])=>{var T,M;const A=(M=(T=o[E])==null?void 0:T.palette)==null?void 0:M.mode,R=!r&&A?{colorScheme:A,...P}:{...P};w(n(E,{...R}),R)}),x}}}function Bnt(t){return function(n){return t==="media"?`@media (prefers-color-scheme: ${n})`:t?t.startsWith("data-")&&!t.includes("%s")?`[${t}="${n}"] &`:t==="class"?`.${n} &`:t==="data"?`[data-${n}] &`:`${t.replace("%s",n)} &`:"&"}}function XAe(){return{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:Jk.white,default:Jk.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}}}const Unt=XAe();function YAe(){return{text:{primary:Jk.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:Jk.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}}}const fde=YAe();function dde(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=Eh(t.main,i):e==="dark"&&(t.dark=Oh(t.main,o)))}function Wnt(t="light"){return t==="dark"?{main:Um[200],light:Um[50],dark:Um[400]}:{main:Um[700],light:Um[400],dark:Um[800]}}function Vnt(t="light"){return t==="dark"?{main:Bm[200],light:Bm[50],dark:Bm[400]}:{main:Bm[500],light:Bm[300],dark:Bm[700]}}function Gnt(t="light"){return t==="dark"?{main:jm[500],light:jm[300],dark:jm[700]}:{main:jm[700],light:jm[400],dark:jm[800]}}function Hnt(t="light"){return t==="dark"?{main:Wm[400],light:Wm[300],dark:Wm[700]}:{main:Wm[700],light:Wm[500],dark:Wm[900]}}function qnt(t="light"){return t==="dark"?{main:$p[400],light:$p[300],dark:$p[700]}:{main:$p[800],light:$p[500],dark:$p[900]}}function Xnt(t="light"){return t==="dark"?{main:Q0[400],light:Q0[300],dark:Q0[700]}:{main:"#ed6c02",light:Q0[500],dark:Q0[900]}}function Mee(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=t,o=t.primary||Wnt(e),s=t.secondary||Vnt(e),a=t.error||Gnt(e),l=t.info||Hnt(e),c=t.success||qnt(e),u=t.warning||Xnt(e);function f(g){return mnt(g,fde.text.primary)>=n?fde.text.primary:Unt.text.primary}const d=({color:g,name:m,mainShade:v=500,lightShade:y=300,darkShade:x=700})=>{if(g={...g},!g.main&&g[v]&&(g.main=g[v]),!g.hasOwnProperty("main"))throw new Error(Mg(11,m?` (${m})`:"",v));if(typeof g.main!="string")throw new Error(Mg(12,m?` (${m})`:"",JSON.stringify(g.main)));return dde(g,"light",y,r),dde(g,"dark",x,r),g.contrastText||(g.contrastText=f(g.main)),g};let h;return e==="light"?h=XAe():e==="dark"&&(h=YAe()),Wo({common:{...Jk},mode:e,primary:d({color:o,name:"primary"}),secondary:d({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:a,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:sAe,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r,...h},i)}function Ynt(t){const e={};return Object.entries(t).forEach(r=>{const[i,o]=r;typeof o=="object"&&(e[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),e}function Qnt(t,e){return{toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}},...e}}function Knt(t){return Math.round(t*1e5)/1e5}const hde={textTransform:"uppercase"},pde='"Roboto", "Helvetica", "Arial", sans-serif';function QAe(t,e){const{fontFamily:n=pde,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...f}=typeof e=="function"?e(t):e,d=r/14,h=u||(m=>`${m/l*d}rem`),p=(m,v,y,x,b)=>({fontFamily:n,fontWeight:m,fontSize:h(v),lineHeight:y,...n===pde?{letterSpacing:`${Knt(x/v)}em`}:{},...b,...c}),g={h1:p(i,96,1.167,-1.5),h2:p(i,60,1.2,-.5),h3:p(o,48,1.167,0),h4:p(o,34,1.235,.25),h5:p(o,24,1.334,0),h6:p(s,20,1.6,.15),subtitle1:p(o,16,1.75,.15),subtitle2:p(s,14,1.57,.1),body1:p(o,16,1.5,.15),body2:p(o,14,1.43,.15),button:p(s,14,1.75,.4,hde),caption:p(o,12,1.66,.4),overline:p(o,12,2.66,1,hde),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Wo({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...g},f,{clone:!1})}const Znt=.2,Jnt=.14,ert=.12;function li(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${Znt})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${Jnt})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${ert})`].join(",")}const trt=["none",li(0,2,1,-1,0,1,1,0,0,1,3,0),li(0,3,1,-2,0,2,2,0,0,1,5,0),li(0,3,3,-2,0,3,4,0,0,1,8,0),li(0,2,4,-1,0,4,5,0,0,1,10,0),li(0,3,5,-1,0,5,8,0,0,1,14,0),li(0,3,5,-1,0,6,10,0,0,1,18,0),li(0,4,5,-2,0,7,10,1,0,2,16,1),li(0,5,5,-3,0,8,10,1,0,3,14,2),li(0,5,6,-3,0,9,12,1,0,3,16,2),li(0,6,6,-3,0,10,14,1,0,4,18,3),li(0,6,7,-4,0,11,15,1,0,4,20,3),li(0,7,8,-4,0,12,17,2,0,5,22,4),li(0,7,8,-4,0,13,19,2,0,5,24,4),li(0,7,9,-4,0,14,21,2,0,5,26,4),li(0,8,9,-5,0,15,22,2,0,6,28,5),li(0,8,10,-5,0,16,24,2,0,6,30,5),li(0,8,11,-5,0,17,26,2,0,6,32,5),li(0,9,11,-5,0,18,28,2,0,7,34,6),li(0,9,12,-6,0,19,29,2,0,7,36,6),li(0,10,13,-6,0,20,31,3,0,8,38,7),li(0,10,13,-6,0,21,33,3,0,8,40,7),li(0,10,14,-6,0,22,35,3,0,8,42,7),li(0,11,14,-7,0,23,36,3,0,9,44,8),li(0,11,15,-7,0,24,38,3,0,9,46,8)],nrt={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)"},KAe={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function gde(t){return`${Math.round(t)}ms`}function rrt(t){if(!t)return 0;const e=t/36;return Math.min(Math.round((4+15*e**.25+e/5)*10),3e3)}function irt(t){const e={...nrt,...t.easing},n={...KAe,...t.duration};return{getAutoHeightDuration:rrt,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=e.easeInOut,delay:l=0,...c}=o;return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:gde(s)} ${a} ${typeof l=="string"?l:gde(l)}`).join(",")},...t,easing:e,duration:n}}const ort={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function srt(t){return Nd(t)||typeof t>"u"||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||Array.isArray(t)}function ZAe(t={}){const e={...t};function n(r){const i=Object.entries(r);for(let o=0;o{if(e==="light")return t.lightColorScheme;if(e==="dark")return t.darkColorScheme})}function Z8(t,e){if(typeof window>"u")return;let n;try{n=localStorage.getItem(t)||void 0,n||localStorage.setItem(t,e)}catch{}return n||e}function Int(t){const{defaultMode:e="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:o=Aee,colorSchemeStorageKey:s=Pee,storageWindow:a=typeof window>"u"?void 0:window}=t,l=i.join(","),c=i.length>1,[u,f]=D.useState(()=>{const x=Z8(o,e),b=Z8(`${s}-light`,n),w=Z8(`${s}-dark`,r);return{mode:x,systemMode:cde(x),lightColorScheme:b,darkColorScheme:w}}),[,d]=D.useState(!1),h=D.useRef(!1);D.useEffect(()=>{c&&d(!0),h.current=!0},[c]);const p=Dnt(u),g=D.useCallback(x=>{f(b=>{if(x===b.mode)return b;const w=x??e;try{localStorage.setItem(o,w)}catch{}return{...b,mode:w,systemMode:cde(w)}})},[o,e]),m=D.useCallback(x=>{x?typeof x=="string"?x&&!l.includes(x)?console.error(`\`${x}\` does not exist in \`theme.colorSchemes\`.`):f(b=>{const w={...b};return qAe(b,_=>{try{localStorage.setItem(`${s}-${_}`,x)}catch{}_==="light"&&(w.lightColorScheme=x),_==="dark"&&(w.darkColorScheme=x)}),w}):f(b=>{const w={...b},_=x.light===null?n:x.light,S=x.dark===null?r:x.dark;if(_)if(!l.includes(_))console.error(`\`${_}\` does not exist in \`theme.colorSchemes\`.`);else{w.lightColorScheme=_;try{localStorage.setItem(`${s}-light`,_)}catch{}}if(S)if(!l.includes(S))console.error(`\`${S}\` does not exist in \`theme.colorSchemes\`.`);else{w.darkColorScheme=S;try{localStorage.setItem(`${s}-dark`,S)}catch{}}return w}):f(b=>{try{localStorage.setItem(`${s}-light`,n),localStorage.setItem(`${s}-dark`,r)}catch{}return{...b,lightColorScheme:n,darkColorScheme:r}})},[l,s,n,r]),v=D.useCallback(x=>{u.mode==="system"&&f(b=>{const w=x!=null&&x.matches?"dark":"light";return b.systemMode===w?b:{...b,systemMode:w}})},[u.mode]),y=D.useRef(v);return y.current=v,D.useEffect(()=>{if(typeof window.matchMedia!="function"||!c)return;const x=(...w)=>y.current(...w),b=window.matchMedia("(prefers-color-scheme: dark)");return b.addListener(x),x(b),()=>{b.removeListener(x)}},[c]),D.useEffect(()=>{if(a&&c){const x=b=>{const w=b.newValue;typeof b.key=="string"&&b.key.startsWith(s)&&(!w||l.match(w))&&(b.key.endsWith("light")&&m({light:w}),b.key.endsWith("dark")&&m({dark:w})),b.key===o&&(!w||["light","dark","system"].includes(w))&&g(w||e)};return a.addEventListener("storage",x),()=>{a.removeEventListener("storage",x)}}},[m,g,o,s,l,e,a,c]),{...u,mode:h.current||!c?u.mode:void 0,systemMode:h.current||!c?u.systemMode:void 0,colorScheme:h.current||!c?p:void 0,setMode:g,setColorScheme:m}}const Lnt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function $nt(t){const{themeId:e,theme:n={},modeStorageKey:r=Aee,colorSchemeStorageKey:i=Pee,disableTransitionOnChange:o=!1,defaultColorScheme:s,resolveTheme:a}=t,l={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},c=D.createContext(void 0),u=()=>D.useContext(c)||l;function f(g){var H,W,J,se,ye;const{children:m,theme:v,modeStorageKey:y=r,colorSchemeStorageKey:x=i,disableTransitionOnChange:b=o,storageWindow:w=typeof window>"u"?void 0:window,documentNode:_=typeof document>"u"?void 0:document,colorSchemeNode:S=typeof document>"u"?void 0:document.documentElement,disableNestedContext:O=!1,disableStyleSheetGeneration:k=!1,defaultMode:E="system"}=g,P=D.useRef(!1),A=t4(),R=D.useContext(c),T=!!R&&!O,M=D.useMemo(()=>v||(typeof n=="function"?n():n),[v]),I=M[e],{colorSchemes:z={},components:F={},cssVarPrefix:N,...L}=I||M,B=Object.keys(z).filter(ie=>!!z[ie]).join(","),$=D.useMemo(()=>B.split(","),[B]),j=typeof s=="string"?s:s.light,X=typeof s=="string"?s:s.dark,V=z[j]&&z[X]?E:((W=(H=z[L.defaultColorScheme])==null?void 0:H.palette)==null?void 0:W.mode)||((J=L.palette)==null?void 0:J.mode),{mode:Y,setMode:le,systemMode:K,lightColorScheme:ee,darkColorScheme:re,colorScheme:me,setColorScheme:te}=Int({supportedColorSchemes:$,defaultLightColorScheme:j,defaultDarkColorScheme:X,modeStorageKey:y,colorSchemeStorageKey:x,defaultMode:V,storageWindow:w});let ae=Y,U=me;T&&(ae=R.mode,U=R.colorScheme);const oe=U||L.defaultColorScheme,ne=((se=L.generateThemeVars)==null?void 0:se.call(L))||L.vars,G={...L,components:F,colorSchemes:z,cssVarPrefix:N,vars:ne};if(typeof G.generateSpacing=="function"&&(G.spacing=G.generateSpacing()),oe){const ie=z[oe];ie&&typeof ie=="object"&&Object.keys(ie).forEach(fe=>{ie[fe]&&typeof ie[fe]=="object"?G[fe]={...G[fe],...ie[fe]}:G[fe]=ie[fe]})}const q=L.colorSchemeSelector;D.useEffect(()=>{if(U&&S&&q&&q!=="media"){const ie=q;let fe=q;if(ie==="class"&&(fe=".%s"),ie==="data"&&(fe="[data-%s]"),ie!=null&&ie.startsWith("data-")&&!ie.includes("%s")&&(fe=`[${ie}="%s"]`),fe.startsWith("."))S.classList.remove(...$.map(Q=>fe.substring(1).replace("%s",Q))),S.classList.add(fe.substring(1).replace("%s",U));else{const Q=fe.replace("%s",U).match(/\[([^\]]+)\]/);if(Q){const[_e,we]=Q[1].split("=");we||$.forEach(Ie=>{S.removeAttribute(_e.replace(U,Ie))}),S.setAttribute(_e,we?we.replace(/"|'/g,""):"")}else S.setAttribute(fe,U)}}},[U,q,S,$]),D.useEffect(()=>{let ie;if(b&&P.current&&_){const fe=_.createElement("style");fe.appendChild(_.createTextNode(Lnt)),_.head.appendChild(fe),window.getComputedStyle(_.body),ie=setTimeout(()=>{_.head.removeChild(fe)},1)}return()=>{clearTimeout(ie)}},[U,b,_]),D.useEffect(()=>(P.current=!0,()=>{P.current=!1}),[]);const Z=D.useMemo(()=>({allColorSchemes:$,colorScheme:U,darkColorScheme:re,lightColorScheme:ee,mode:ae,setColorScheme:te,setMode:le,systemMode:K}),[$,U,re,ee,ae,te,le,K]);let de=!0;(k||L.cssVariables===!1||T&&(A==null?void 0:A.cssVarPrefix)===N)&&(de=!1);const xe=C.jsxs(D.Fragment,{children:[C.jsx(HAe,{themeId:I?e:void 0,theme:a?a(G):G,children:m}),de&&C.jsx(SAe,{styles:((ye=G.generateStyleSheets)==null?void 0:ye.call(G))||[]})]});return T?xe:C.jsx(c.Provider,{value:Z,children:xe})}const d=typeof s=="string"?s:s.light,h=typeof s=="string"?s:s.dark;return{CssVarsProvider:f,useColorScheme:u,getInitColorSchemeScript:g=>Rnt({colorSchemeStorageKey:i,defaultLightColorScheme:d,defaultDarkColorScheme:h,modeStorageKey:r,...g})}}function Fnt(t=""){function e(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${t?`${t}-`:""}${i}${e(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${t?`${t}-`:""}${r}${e(...i)})`}const ude=(t,e,n,r=[])=>{let i=t;e.forEach((o,s)=>{s===e.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},Nnt=(t,e,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):e([...o,a],l,s))})}r(t)},znt=(t,e)=>typeof e=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>t.includes(r))||t[t.length-1].toLowerCase().includes("opacity")?e:`${e}px`:e;function J8(t,e){const{prefix:n,shouldSkipGeneratingVar:r}=e||{},i={},o={},s={};return Nnt(t,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=znt(a,l);Object.assign(i,{[u]:f}),ude(o,a,`var(${u})`,c),ude(s,a,`var(${u}, ${f})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function jnt(t,e={}){const{getSelector:n=m,disableCssColorScheme:r,colorSchemeSelector:i}=e,{colorSchemes:o={},components:s,defaultColorScheme:a="light",...l}=t,{vars:c,css:u,varsWithDefaults:f}=J8(l,e);let d=f;const h={},{[a]:p,...g}=o;if(Object.entries(g||{}).forEach(([x,b])=>{const{vars:w,css:_,varsWithDefaults:S}=J8(b,e);d=Wo(d,S),h[x]={css:_,vars:w}}),p){const{css:x,vars:b,varsWithDefaults:w}=J8(p,e);d=Wo(d,w),h[a]={css:x,vars:b}}function m(x,b){var _,S;let w=i;if(i==="class"&&(w=".%s"),i==="data"&&(w="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(w=`[${i}="%s"]`),x){if(w==="media")return t.defaultColorScheme===x?":root":{[`@media (prefers-color-scheme: ${((S=(_=o[x])==null?void 0:_.palette)==null?void 0:S.mode)||x})`]:{":root":b}};if(w)return t.defaultColorScheme===x?`:root, ${w.replace("%s",String(x))}`:w.replace("%s",String(x))}return":root"}return{vars:d,generateThemeVars:()=>{let x={...c};return Object.entries(h).forEach(([,{vars:b}])=>{x=Wo(x,b)}),x},generateStyleSheets:()=>{var O,k;const x=[],b=t.defaultColorScheme||"light";function w(E,P){Object.keys(P).length&&x.push(typeof E=="string"?{[E]:{...P}}:E)}w(n(void 0,{...u}),u);const{[b]:_,...S}=h;if(_){const{css:E}=_,P=(k=(O=o[b])==null?void 0:O.palette)==null?void 0:k.mode,A=!r&&P?{colorScheme:P,...E}:{...E};w(n(b,{...A}),A)}return Object.entries(S).forEach(([E,{css:P}])=>{var T,M;const A=(M=(T=o[E])==null?void 0:T.palette)==null?void 0:M.mode,R=!r&&A?{colorScheme:A,...P}:{...P};w(n(E,{...R}),R)}),x}}}function Bnt(t){return function(n){return t==="media"?`@media (prefers-color-scheme: ${n})`:t?t.startsWith("data-")&&!t.includes("%s")?`[${t}="${n}"] &`:t==="class"?`.${n} &`:t==="data"?`[data-${n}] &`:`${t.replace("%s",n)} &`:"&"}}function XAe(){return{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:Zk.white,default:Zk.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}}}const Unt=XAe();function YAe(){return{text:{primary:Zk.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:Zk.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}}}const fde=YAe();function dde(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=Eh(t.main,i):e==="dark"&&(t.dark=Oh(t.main,o)))}function Wnt(t="light"){return t==="dark"?{main:Um[200],light:Um[50],dark:Um[400]}:{main:Um[700],light:Um[400],dark:Um[800]}}function Vnt(t="light"){return t==="dark"?{main:Bm[200],light:Bm[50],dark:Bm[400]}:{main:Bm[500],light:Bm[300],dark:Bm[700]}}function Gnt(t="light"){return t==="dark"?{main:jm[500],light:jm[300],dark:jm[700]}:{main:jm[700],light:jm[400],dark:jm[800]}}function Hnt(t="light"){return t==="dark"?{main:Wm[400],light:Wm[300],dark:Wm[700]}:{main:Wm[700],light:Wm[500],dark:Wm[900]}}function qnt(t="light"){return t==="dark"?{main:$p[400],light:$p[300],dark:$p[700]}:{main:$p[800],light:$p[500],dark:$p[900]}}function Xnt(t="light"){return t==="dark"?{main:Q0[400],light:Q0[300],dark:Q0[700]}:{main:"#ed6c02",light:Q0[500],dark:Q0[900]}}function Mee(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=t,o=t.primary||Wnt(e),s=t.secondary||Vnt(e),a=t.error||Gnt(e),l=t.info||Hnt(e),c=t.success||qnt(e),u=t.warning||Xnt(e);function f(g){return mnt(g,fde.text.primary)>=n?fde.text.primary:Unt.text.primary}const d=({color:g,name:m,mainShade:v=500,lightShade:y=300,darkShade:x=700})=>{if(g={...g},!g.main&&g[v]&&(g.main=g[v]),!g.hasOwnProperty("main"))throw new Error(Mg(11,m?` (${m})`:"",v));if(typeof g.main!="string")throw new Error(Mg(12,m?` (${m})`:"",JSON.stringify(g.main)));return dde(g,"light",y,r),dde(g,"dark",x,r),g.contrastText||(g.contrastText=f(g.main)),g};let h;return e==="light"?h=XAe():e==="dark"&&(h=YAe()),Wo({common:{...Zk},mode:e,primary:d({color:o,name:"primary"}),secondary:d({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:a,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:sAe,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r,...h},i)}function Ynt(t){const e={};return Object.entries(t).forEach(r=>{const[i,o]=r;typeof o=="object"&&(e[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),e}function Qnt(t,e){return{toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}},...e}}function Knt(t){return Math.round(t*1e5)/1e5}const hde={textTransform:"uppercase"},pde='"Roboto", "Helvetica", "Arial", sans-serif';function QAe(t,e){const{fontFamily:n=pde,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...f}=typeof e=="function"?e(t):e,d=r/14,h=u||(m=>`${m/l*d}rem`),p=(m,v,y,x,b)=>({fontFamily:n,fontWeight:m,fontSize:h(v),lineHeight:y,...n===pde?{letterSpacing:`${Knt(x/v)}em`}:{},...b,...c}),g={h1:p(i,96,1.167,-1.5),h2:p(i,60,1.2,-.5),h3:p(o,48,1.167,0),h4:p(o,34,1.235,.25),h5:p(o,24,1.334,0),h6:p(s,20,1.6,.15),subtitle1:p(o,16,1.75,.15),subtitle2:p(s,14,1.57,.1),body1:p(o,16,1.5,.15),body2:p(o,14,1.43,.15),button:p(s,14,1.75,.4,hde),caption:p(o,12,1.66,.4),overline:p(o,12,2.66,1,hde),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Wo({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...g},f,{clone:!1})}const Znt=.2,Jnt=.14,ert=.12;function li(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${Znt})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${Jnt})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${ert})`].join(",")}const trt=["none",li(0,2,1,-1,0,1,1,0,0,1,3,0),li(0,3,1,-2,0,2,2,0,0,1,5,0),li(0,3,3,-2,0,3,4,0,0,1,8,0),li(0,2,4,-1,0,4,5,0,0,1,10,0),li(0,3,5,-1,0,5,8,0,0,1,14,0),li(0,3,5,-1,0,6,10,0,0,1,18,0),li(0,4,5,-2,0,7,10,1,0,2,16,1),li(0,5,5,-3,0,8,10,1,0,3,14,2),li(0,5,6,-3,0,9,12,1,0,3,16,2),li(0,6,6,-3,0,10,14,1,0,4,18,3),li(0,6,7,-4,0,11,15,1,0,4,20,3),li(0,7,8,-4,0,12,17,2,0,5,22,4),li(0,7,8,-4,0,13,19,2,0,5,24,4),li(0,7,9,-4,0,14,21,2,0,5,26,4),li(0,8,9,-5,0,15,22,2,0,6,28,5),li(0,8,10,-5,0,16,24,2,0,6,30,5),li(0,8,11,-5,0,17,26,2,0,6,32,5),li(0,9,11,-5,0,18,28,2,0,7,34,6),li(0,9,12,-6,0,19,29,2,0,7,36,6),li(0,10,13,-6,0,20,31,3,0,8,38,7),li(0,10,13,-6,0,21,33,3,0,8,40,7),li(0,10,14,-6,0,22,35,3,0,8,42,7),li(0,11,14,-7,0,23,36,3,0,9,44,8),li(0,11,15,-7,0,24,38,3,0,9,46,8)],nrt={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)"},KAe={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function gde(t){return`${Math.round(t)}ms`}function rrt(t){if(!t)return 0;const e=t/36;return Math.min(Math.round((4+15*e**.25+e/5)*10),3e3)}function irt(t){const e={...nrt,...t.easing},n={...KAe,...t.duration};return{getAutoHeightDuration:rrt,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=e.easeInOut,delay:l=0,...c}=o;return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:gde(s)} ${a} ${typeof l=="string"?l:gde(l)}`).join(",")},...t,easing:e,duration:n}}const ort={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function srt(t){return Nd(t)||typeof t>"u"||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||Array.isArray(t)}function ZAe(t={}){const e={...t};function n(r){const i=Object.entries(r);for(let o=0;oWo(h,p),d),d.unstable_sxConfig={...EM,...c==null?void 0:c.unstable_sxConfig},d.unstable_sx=function(p){return Qv({sx:p,theme:this})},d.toRuntimeSource=ZAe,d}function tq(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const art=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=tq(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function JAe(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function ePe(t){return t==="dark"?art:[]}function lrt(t){const{palette:e={mode:"light"},opacity:n,overlays:r,...i}=t,o=Mee(e);return{palette:o,opacity:{...JAe(o.mode),...n},overlays:r||ePe(o.mode),...i}}function crt(t){var e;return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!((e=t[1])!=null&&e.match(/(mode|contrastThreshold|tonalOffset)/))}const urt=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],frt=t=>(e,n)=>{const r=t.rootSelector||":root",i=t.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const s={};return urt(t.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",e)]:s,[`${r}, ${o.replace("%s",e)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(e))}`}else if(e){if(o==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[r]:n}};if(o)return o.replace("%s",String(e))}return r};function drt(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function Ne(t,e,n){!t[e]&&n&&(t[e]=n)}function Y2(t){return!t||!t.startsWith("hsl")?t:LAe(t)}function lp(t,e){`${e}Channel`in t||(t[`${e}Channel`]=X2(Y2(t[e]),`MUI: Can't create \`palette.${e}Channel\` because \`palette.${e}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). -To suppress this warning, you need to explicitly provide the \`palette.${e}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function hrt(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const gd=t=>{try{return t()}catch{}},prt=(t="mui")=>Fnt(t);function eW(t,e,n,r){if(!e)return;e=e===!0?{}:e;const i=r==="dark"?"dark":"light";if(!n){t[r]=lrt({...e,palette:{mode:i,...e==null?void 0:e.palette}});return}const{palette:o,...s}=eq({...n,palette:{mode:i,...e==null?void 0:e.palette}});return t[r]={...e,palette:o,opacity:{...JAe(i),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||ePe(i)},s}function grt(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=crt,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...c}=t,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),d=prt(o),{[f]:h,light:p,dark:g,...m}=n,v={...m};let y=h;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(Mg(21,f));const x=eW(v,y,c,f);p&&!v.light&&eW(v,p,void 0,"light"),g&&!v.dark&&eW(v,g,void 0,"dark");let b={defaultColorScheme:f,...x,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:l,getCssVar:d,colorSchemes:v,font:{...Ynt(x.typography),...x.font},spacing:hrt(c.spacing)};Object.keys(b.colorSchemes).forEach(k=>{const E=b.colorSchemes[k].palette,P=A=>{const R=A.split("-"),T=R[1],M=R[2];return d(A,E[T][M])};if(E.mode==="light"&&(Ne(E.common,"background","#fff"),Ne(E.common,"onBackground","#000")),E.mode==="dark"&&(Ne(E.common,"background","#000"),Ne(E.common,"onBackground","#fff")),drt(E,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),E.mode==="light"){Ne(E.Alert,"errorColor",Mr(E.error.light,.6)),Ne(E.Alert,"infoColor",Mr(E.info.light,.6)),Ne(E.Alert,"successColor",Mr(E.success.light,.6)),Ne(E.Alert,"warningColor",Mr(E.warning.light,.6)),Ne(E.Alert,"errorFilledBg",P("palette-error-main")),Ne(E.Alert,"infoFilledBg",P("palette-info-main")),Ne(E.Alert,"successFilledBg",P("palette-success-main")),Ne(E.Alert,"warningFilledBg",P("palette-warning-main")),Ne(E.Alert,"errorFilledColor",gd(()=>E.getContrastText(E.error.main))),Ne(E.Alert,"infoFilledColor",gd(()=>E.getContrastText(E.info.main))),Ne(E.Alert,"successFilledColor",gd(()=>E.getContrastText(E.success.main))),Ne(E.Alert,"warningFilledColor",gd(()=>E.getContrastText(E.warning.main))),Ne(E.Alert,"errorStandardBg",Rr(E.error.light,.9)),Ne(E.Alert,"infoStandardBg",Rr(E.info.light,.9)),Ne(E.Alert,"successStandardBg",Rr(E.success.light,.9)),Ne(E.Alert,"warningStandardBg",Rr(E.warning.light,.9)),Ne(E.Alert,"errorIconColor",P("palette-error-main")),Ne(E.Alert,"infoIconColor",P("palette-info-main")),Ne(E.Alert,"successIconColor",P("palette-success-main")),Ne(E.Alert,"warningIconColor",P("palette-warning-main")),Ne(E.AppBar,"defaultBg",P("palette-grey-100")),Ne(E.Avatar,"defaultBg",P("palette-grey-400")),Ne(E.Button,"inheritContainedBg",P("palette-grey-300")),Ne(E.Button,"inheritContainedHoverBg",P("palette-grey-A100")),Ne(E.Chip,"defaultBorder",P("palette-grey-400")),Ne(E.Chip,"defaultAvatarColor",P("palette-grey-700")),Ne(E.Chip,"defaultIconColor",P("palette-grey-700")),Ne(E.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Ne(E.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Ne(E.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Ne(E.LinearProgress,"primaryBg",Rr(E.primary.main,.62)),Ne(E.LinearProgress,"secondaryBg",Rr(E.secondary.main,.62)),Ne(E.LinearProgress,"errorBg",Rr(E.error.main,.62)),Ne(E.LinearProgress,"infoBg",Rr(E.info.main,.62)),Ne(E.LinearProgress,"successBg",Rr(E.success.main,.62)),Ne(E.LinearProgress,"warningBg",Rr(E.warning.main,.62)),Ne(E.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.11)`),Ne(E.Slider,"primaryTrack",Rr(E.primary.main,.62)),Ne(E.Slider,"secondaryTrack",Rr(E.secondary.main,.62)),Ne(E.Slider,"errorTrack",Rr(E.error.main,.62)),Ne(E.Slider,"infoTrack",Rr(E.info.main,.62)),Ne(E.Slider,"successTrack",Rr(E.success.main,.62)),Ne(E.Slider,"warningTrack",Rr(E.warning.main,.62));const A=YD(E.background.default,.8);Ne(E.SnackbarContent,"bg",A),Ne(E.SnackbarContent,"color",gd(()=>E.getContrastText(A))),Ne(E.SpeedDialAction,"fabHoverBg",YD(E.background.paper,.15)),Ne(E.StepConnector,"border",P("palette-grey-400")),Ne(E.StepContent,"border",P("palette-grey-400")),Ne(E.Switch,"defaultColor",P("palette-common-white")),Ne(E.Switch,"defaultDisabledColor",P("palette-grey-100")),Ne(E.Switch,"primaryDisabledColor",Rr(E.primary.main,.62)),Ne(E.Switch,"secondaryDisabledColor",Rr(E.secondary.main,.62)),Ne(E.Switch,"errorDisabledColor",Rr(E.error.main,.62)),Ne(E.Switch,"infoDisabledColor",Rr(E.info.main,.62)),Ne(E.Switch,"successDisabledColor",Rr(E.success.main,.62)),Ne(E.Switch,"warningDisabledColor",Rr(E.warning.main,.62)),Ne(E.TableCell,"border",Rr(XD(E.divider,1),.88)),Ne(E.Tooltip,"bg",XD(E.grey[700],.92))}if(E.mode==="dark"){Ne(E.Alert,"errorColor",Rr(E.error.light,.6)),Ne(E.Alert,"infoColor",Rr(E.info.light,.6)),Ne(E.Alert,"successColor",Rr(E.success.light,.6)),Ne(E.Alert,"warningColor",Rr(E.warning.light,.6)),Ne(E.Alert,"errorFilledBg",P("palette-error-dark")),Ne(E.Alert,"infoFilledBg",P("palette-info-dark")),Ne(E.Alert,"successFilledBg",P("palette-success-dark")),Ne(E.Alert,"warningFilledBg",P("palette-warning-dark")),Ne(E.Alert,"errorFilledColor",gd(()=>E.getContrastText(E.error.dark))),Ne(E.Alert,"infoFilledColor",gd(()=>E.getContrastText(E.info.dark))),Ne(E.Alert,"successFilledColor",gd(()=>E.getContrastText(E.success.dark))),Ne(E.Alert,"warningFilledColor",gd(()=>E.getContrastText(E.warning.dark))),Ne(E.Alert,"errorStandardBg",Mr(E.error.light,.9)),Ne(E.Alert,"infoStandardBg",Mr(E.info.light,.9)),Ne(E.Alert,"successStandardBg",Mr(E.success.light,.9)),Ne(E.Alert,"warningStandardBg",Mr(E.warning.light,.9)),Ne(E.Alert,"errorIconColor",P("palette-error-main")),Ne(E.Alert,"infoIconColor",P("palette-info-main")),Ne(E.Alert,"successIconColor",P("palette-success-main")),Ne(E.Alert,"warningIconColor",P("palette-warning-main")),Ne(E.AppBar,"defaultBg",P("palette-grey-900")),Ne(E.AppBar,"darkBg",P("palette-background-paper")),Ne(E.AppBar,"darkColor",P("palette-text-primary")),Ne(E.Avatar,"defaultBg",P("palette-grey-600")),Ne(E.Button,"inheritContainedBg",P("palette-grey-800")),Ne(E.Button,"inheritContainedHoverBg",P("palette-grey-700")),Ne(E.Chip,"defaultBorder",P("palette-grey-700")),Ne(E.Chip,"defaultAvatarColor",P("palette-grey-300")),Ne(E.Chip,"defaultIconColor",P("palette-grey-300")),Ne(E.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Ne(E.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Ne(E.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Ne(E.LinearProgress,"primaryBg",Mr(E.primary.main,.5)),Ne(E.LinearProgress,"secondaryBg",Mr(E.secondary.main,.5)),Ne(E.LinearProgress,"errorBg",Mr(E.error.main,.5)),Ne(E.LinearProgress,"infoBg",Mr(E.info.main,.5)),Ne(E.LinearProgress,"successBg",Mr(E.success.main,.5)),Ne(E.LinearProgress,"warningBg",Mr(E.warning.main,.5)),Ne(E.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.13)`),Ne(E.Slider,"primaryTrack",Mr(E.primary.main,.5)),Ne(E.Slider,"secondaryTrack",Mr(E.secondary.main,.5)),Ne(E.Slider,"errorTrack",Mr(E.error.main,.5)),Ne(E.Slider,"infoTrack",Mr(E.info.main,.5)),Ne(E.Slider,"successTrack",Mr(E.success.main,.5)),Ne(E.Slider,"warningTrack",Mr(E.warning.main,.5));const A=YD(E.background.default,.98);Ne(E.SnackbarContent,"bg",A),Ne(E.SnackbarContent,"color",gd(()=>E.getContrastText(A))),Ne(E.SpeedDialAction,"fabHoverBg",YD(E.background.paper,.15)),Ne(E.StepConnector,"border",P("palette-grey-600")),Ne(E.StepContent,"border",P("palette-grey-600")),Ne(E.Switch,"defaultColor",P("palette-grey-300")),Ne(E.Switch,"defaultDisabledColor",P("palette-grey-600")),Ne(E.Switch,"primaryDisabledColor",Mr(E.primary.main,.55)),Ne(E.Switch,"secondaryDisabledColor",Mr(E.secondary.main,.55)),Ne(E.Switch,"errorDisabledColor",Mr(E.error.main,.55)),Ne(E.Switch,"infoDisabledColor",Mr(E.info.main,.55)),Ne(E.Switch,"successDisabledColor",Mr(E.success.main,.55)),Ne(E.Switch,"warningDisabledColor",Mr(E.warning.main,.55)),Ne(E.TableCell,"border",Mr(XD(E.divider,1),.68)),Ne(E.Tooltip,"bg",XD(E.grey[700],.92))}lp(E.background,"default"),lp(E.background,"paper"),lp(E.common,"background"),lp(E.common,"onBackground"),lp(E,"divider"),Object.keys(E).forEach(A=>{const R=E[A];R&&typeof R=="object"&&(R.main&&Ne(E[A],"mainChannel",X2(Y2(R.main))),R.light&&Ne(E[A],"lightChannel",X2(Y2(R.light))),R.dark&&Ne(E[A],"darkChannel",X2(Y2(R.dark))),R.contrastText&&Ne(E[A],"contrastTextChannel",X2(Y2(R.contrastText))),A==="text"&&(lp(E[A],"primary"),lp(E[A],"secondary")),A==="action"&&(R.active&&lp(E[A],"active"),R.selected&&lp(E[A],"selected")))})}),b=e.reduce((k,E)=>Wo(k,E),b);const w={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:frt(b)},{vars:_,generateThemeVars:S,generateStyleSheets:O}=jnt(b,w);return b.vars=_,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([k,E])=>{b[k]=E}),b.generateThemeVars=S,b.generateStyleSheets=O,b.generateSpacing=function(){return TAe(c.spacing,_ee(this))},b.getColorSchemeSelector=Bnt(a),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=s,b.unstable_sxConfig={...EM,...c==null?void 0:c.unstable_sxConfig},b.unstable_sx=function(E){return Qv({sx:E,theme:this})},b.toRuntimeSource=ZAe,b}function mde(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:Mee({...n===!0?{}:n.palette,mode:e})})}function n4(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=t,a=o||"light",l=i==null?void 0:i[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return eq(t,...e);let u=n;"palette"in t||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const f=eq({...t,palette:u},...e);return f.defaultColorScheme=a,f.colorSchemes=c,f.palette.mode==="light"&&(f.colorSchemes.light={...c.light!==!0&&c.light,palette:f.palette},mde(f,"dark",c.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:f.palette},mde(f,"light",c.light)),f}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),grt({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...e)}const r4=n4();function To(){const t=Zb(r4);return t[Rf]||t}function kn({props:t,name:e}){return unt({props:t,name:e,defaultTheme:r4,themeId:Rf})}function i4(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Xo=t=>i4(t)&&t!=="classes",be=RAe({themeId:Rf,defaultTheme:r4,rootShouldForwardProp:Xo});function vde({theme:t,...e}){const n=Rf in t?t[Rf]:void 0;return C.jsx(HAe,{...e,themeId:n?Rf:void 0,theme:n||t})}const QD={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:mrt,useColorScheme:VXn,getInitColorSchemeScript:GXn}=$nt({themeId:Rf,theme:()=>n4({cssVariables:!0}),colorSchemeStorageKey:QD.colorSchemeStorageKey,modeStorageKey:QD.modeStorageKey,defaultColorScheme:{light:QD.defaultLightColorScheme,dark:QD.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:QAe(t.palette,t.typography)};return e.unstable_sx=function(r){return Qv({sx:r,theme:this})},e}}),vrt=mrt;function yrt({theme:t,...e}){return typeof t=="function"?C.jsx(vde,{theme:t,...e}):"colorSchemes"in(Rf in t?t[Rf]:t)?C.jsx(vrt,{theme:t,...e}):C.jsx(vde,{theme:t,...e})}function xrt(t){return C.jsx(Ztt,{...t,defaultTheme:r4,themeId:Rf})}function Ree(t){return function(n){return C.jsx(xrt,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function brt(){return Eee}const wt=Pnt;function _t(t){return Ant(t)}function wrt(t){return Xe("MuiSvgIcon",t)}He("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const _rt=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${Me(e)}`,`fontSize${Me(n)}`]};return qe(i,wrt,r)},Srt=be("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Me(n.color)}`],e[`fontSize${Me(n.fontSize)}`]]}})(wt(({theme:t})=>{var e,n,r,i,o,s,a,l,c,u,f,d,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(e=t.transitions)==null?void 0:e.create)==null?void 0:i.call(e,"fill",{duration:(r=(n=(t.vars??t).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:g=>!g.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=t.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=t.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(c=t.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter(([,g])=>g&&g.main).map(([g])=>{var m,v;return{props:{color:g},style:{color:(v=(m=(t.vars??t).palette)==null?void 0:m[g])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(d=(f=(t.vars??t).palette)==null?void 0:f.action)==null?void 0:d.active}},{props:{color:"disabled"},style:{color:(p=(h=(t.vars??t).palette)==null?void 0:h.action)==null?void 0:p.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),kF=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,p=D.isValidElement(i)&&i.type==="svg",g={...r,color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p},m={};u||(m.viewBox=d);const v=_rt(g);return C.jsxs(Srt,{as:a,className:Oe(v.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...m,...h,...p&&i.props,ownerState:g,children:[p?i.props.children:i,f?C.jsx("title",{children:f}):null]})});kF&&(kF.muiName="SvgIcon");function lt(t,e){function n(r,i){return C.jsx(kF,{"data-testid":`${e}Icon`,ref:i,...r,children:t})}return n.muiName=kF.muiName,D.memo(D.forwardRef(n))}var Ar={};/** +export default theme;`}function eq(t={},...e){const{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:s={},typography:a={},shape:l,...c}=t;if(t.vars)throw new Error(Mg(20));const u=Mee(o),f=Cee(t);let d=Wo(f,{mixins:Qnt(f.breakpoints,r),palette:u,shadows:trt.slice(),typography:QAe(u,a),transitions:irt(s),zIndex:{...ort}});return d=Wo(d,c),d=e.reduce((h,p)=>Wo(h,p),d),d.unstable_sxConfig={...OM,...c==null?void 0:c.unstable_sxConfig},d.unstable_sx=function(p){return Qv({sx:p,theme:this})},d.toRuntimeSource=ZAe,d}function tq(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const art=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=tq(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function JAe(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function ePe(t){return t==="dark"?art:[]}function lrt(t){const{palette:e={mode:"light"},opacity:n,overlays:r,...i}=t,o=Mee(e);return{palette:o,opacity:{...JAe(o.mode),...n},overlays:r||ePe(o.mode),...i}}function crt(t){var e;return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!((e=t[1])!=null&&e.match(/(mode|contrastThreshold|tonalOffset)/))}const urt=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],frt=t=>(e,n)=>{const r=t.rootSelector||":root",i=t.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const s={};return urt(t.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",e)]:s,[`${r}, ${o.replace("%s",e)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(e))}`}else if(e){if(o==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[r]:n}};if(o)return o.replace("%s",String(e))}return r};function drt(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function Ne(t,e,n){!t[e]&&n&&(t[e]=n)}function X2(t){return!t||!t.startsWith("hsl")?t:LAe(t)}function lp(t,e){`${e}Channel`in t||(t[`${e}Channel`]=q2(X2(t[e]),`MUI: Can't create \`palette.${e}Channel\` because \`palette.${e}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). +To suppress this warning, you need to explicitly provide the \`palette.${e}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function hrt(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const gd=t=>{try{return t()}catch{}},prt=(t="mui")=>Fnt(t);function eW(t,e,n,r){if(!e)return;e=e===!0?{}:e;const i=r==="dark"?"dark":"light";if(!n){t[r]=lrt({...e,palette:{mode:i,...e==null?void 0:e.palette}});return}const{palette:o,...s}=eq({...n,palette:{mode:i,...e==null?void 0:e.palette}});return t[r]={...e,palette:o,opacity:{...JAe(i),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||ePe(i)},s}function grt(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=crt,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...c}=t,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),d=prt(o),{[f]:h,light:p,dark:g,...m}=n,v={...m};let y=h;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(Mg(21,f));const x=eW(v,y,c,f);p&&!v.light&&eW(v,p,void 0,"light"),g&&!v.dark&&eW(v,g,void 0,"dark");let b={defaultColorScheme:f,...x,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:l,getCssVar:d,colorSchemes:v,font:{...Ynt(x.typography),...x.font},spacing:hrt(c.spacing)};Object.keys(b.colorSchemes).forEach(k=>{const E=b.colorSchemes[k].palette,P=A=>{const R=A.split("-"),T=R[1],M=R[2];return d(A,E[T][M])};if(E.mode==="light"&&(Ne(E.common,"background","#fff"),Ne(E.common,"onBackground","#000")),E.mode==="dark"&&(Ne(E.common,"background","#000"),Ne(E.common,"onBackground","#fff")),drt(E,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),E.mode==="light"){Ne(E.Alert,"errorColor",Mr(E.error.light,.6)),Ne(E.Alert,"infoColor",Mr(E.info.light,.6)),Ne(E.Alert,"successColor",Mr(E.success.light,.6)),Ne(E.Alert,"warningColor",Mr(E.warning.light,.6)),Ne(E.Alert,"errorFilledBg",P("palette-error-main")),Ne(E.Alert,"infoFilledBg",P("palette-info-main")),Ne(E.Alert,"successFilledBg",P("palette-success-main")),Ne(E.Alert,"warningFilledBg",P("palette-warning-main")),Ne(E.Alert,"errorFilledColor",gd(()=>E.getContrastText(E.error.main))),Ne(E.Alert,"infoFilledColor",gd(()=>E.getContrastText(E.info.main))),Ne(E.Alert,"successFilledColor",gd(()=>E.getContrastText(E.success.main))),Ne(E.Alert,"warningFilledColor",gd(()=>E.getContrastText(E.warning.main))),Ne(E.Alert,"errorStandardBg",Rr(E.error.light,.9)),Ne(E.Alert,"infoStandardBg",Rr(E.info.light,.9)),Ne(E.Alert,"successStandardBg",Rr(E.success.light,.9)),Ne(E.Alert,"warningStandardBg",Rr(E.warning.light,.9)),Ne(E.Alert,"errorIconColor",P("palette-error-main")),Ne(E.Alert,"infoIconColor",P("palette-info-main")),Ne(E.Alert,"successIconColor",P("palette-success-main")),Ne(E.Alert,"warningIconColor",P("palette-warning-main")),Ne(E.AppBar,"defaultBg",P("palette-grey-100")),Ne(E.Avatar,"defaultBg",P("palette-grey-400")),Ne(E.Button,"inheritContainedBg",P("palette-grey-300")),Ne(E.Button,"inheritContainedHoverBg",P("palette-grey-A100")),Ne(E.Chip,"defaultBorder",P("palette-grey-400")),Ne(E.Chip,"defaultAvatarColor",P("palette-grey-700")),Ne(E.Chip,"defaultIconColor",P("palette-grey-700")),Ne(E.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Ne(E.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Ne(E.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Ne(E.LinearProgress,"primaryBg",Rr(E.primary.main,.62)),Ne(E.LinearProgress,"secondaryBg",Rr(E.secondary.main,.62)),Ne(E.LinearProgress,"errorBg",Rr(E.error.main,.62)),Ne(E.LinearProgress,"infoBg",Rr(E.info.main,.62)),Ne(E.LinearProgress,"successBg",Rr(E.success.main,.62)),Ne(E.LinearProgress,"warningBg",Rr(E.warning.main,.62)),Ne(E.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.11)`),Ne(E.Slider,"primaryTrack",Rr(E.primary.main,.62)),Ne(E.Slider,"secondaryTrack",Rr(E.secondary.main,.62)),Ne(E.Slider,"errorTrack",Rr(E.error.main,.62)),Ne(E.Slider,"infoTrack",Rr(E.info.main,.62)),Ne(E.Slider,"successTrack",Rr(E.success.main,.62)),Ne(E.Slider,"warningTrack",Rr(E.warning.main,.62));const A=YD(E.background.default,.8);Ne(E.SnackbarContent,"bg",A),Ne(E.SnackbarContent,"color",gd(()=>E.getContrastText(A))),Ne(E.SpeedDialAction,"fabHoverBg",YD(E.background.paper,.15)),Ne(E.StepConnector,"border",P("palette-grey-400")),Ne(E.StepContent,"border",P("palette-grey-400")),Ne(E.Switch,"defaultColor",P("palette-common-white")),Ne(E.Switch,"defaultDisabledColor",P("palette-grey-100")),Ne(E.Switch,"primaryDisabledColor",Rr(E.primary.main,.62)),Ne(E.Switch,"secondaryDisabledColor",Rr(E.secondary.main,.62)),Ne(E.Switch,"errorDisabledColor",Rr(E.error.main,.62)),Ne(E.Switch,"infoDisabledColor",Rr(E.info.main,.62)),Ne(E.Switch,"successDisabledColor",Rr(E.success.main,.62)),Ne(E.Switch,"warningDisabledColor",Rr(E.warning.main,.62)),Ne(E.TableCell,"border",Rr(XD(E.divider,1),.88)),Ne(E.Tooltip,"bg",XD(E.grey[700],.92))}if(E.mode==="dark"){Ne(E.Alert,"errorColor",Rr(E.error.light,.6)),Ne(E.Alert,"infoColor",Rr(E.info.light,.6)),Ne(E.Alert,"successColor",Rr(E.success.light,.6)),Ne(E.Alert,"warningColor",Rr(E.warning.light,.6)),Ne(E.Alert,"errorFilledBg",P("palette-error-dark")),Ne(E.Alert,"infoFilledBg",P("palette-info-dark")),Ne(E.Alert,"successFilledBg",P("palette-success-dark")),Ne(E.Alert,"warningFilledBg",P("palette-warning-dark")),Ne(E.Alert,"errorFilledColor",gd(()=>E.getContrastText(E.error.dark))),Ne(E.Alert,"infoFilledColor",gd(()=>E.getContrastText(E.info.dark))),Ne(E.Alert,"successFilledColor",gd(()=>E.getContrastText(E.success.dark))),Ne(E.Alert,"warningFilledColor",gd(()=>E.getContrastText(E.warning.dark))),Ne(E.Alert,"errorStandardBg",Mr(E.error.light,.9)),Ne(E.Alert,"infoStandardBg",Mr(E.info.light,.9)),Ne(E.Alert,"successStandardBg",Mr(E.success.light,.9)),Ne(E.Alert,"warningStandardBg",Mr(E.warning.light,.9)),Ne(E.Alert,"errorIconColor",P("palette-error-main")),Ne(E.Alert,"infoIconColor",P("palette-info-main")),Ne(E.Alert,"successIconColor",P("palette-success-main")),Ne(E.Alert,"warningIconColor",P("palette-warning-main")),Ne(E.AppBar,"defaultBg",P("palette-grey-900")),Ne(E.AppBar,"darkBg",P("palette-background-paper")),Ne(E.AppBar,"darkColor",P("palette-text-primary")),Ne(E.Avatar,"defaultBg",P("palette-grey-600")),Ne(E.Button,"inheritContainedBg",P("palette-grey-800")),Ne(E.Button,"inheritContainedHoverBg",P("palette-grey-700")),Ne(E.Chip,"defaultBorder",P("palette-grey-700")),Ne(E.Chip,"defaultAvatarColor",P("palette-grey-300")),Ne(E.Chip,"defaultIconColor",P("palette-grey-300")),Ne(E.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Ne(E.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Ne(E.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Ne(E.LinearProgress,"primaryBg",Mr(E.primary.main,.5)),Ne(E.LinearProgress,"secondaryBg",Mr(E.secondary.main,.5)),Ne(E.LinearProgress,"errorBg",Mr(E.error.main,.5)),Ne(E.LinearProgress,"infoBg",Mr(E.info.main,.5)),Ne(E.LinearProgress,"successBg",Mr(E.success.main,.5)),Ne(E.LinearProgress,"warningBg",Mr(E.warning.main,.5)),Ne(E.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.13)`),Ne(E.Slider,"primaryTrack",Mr(E.primary.main,.5)),Ne(E.Slider,"secondaryTrack",Mr(E.secondary.main,.5)),Ne(E.Slider,"errorTrack",Mr(E.error.main,.5)),Ne(E.Slider,"infoTrack",Mr(E.info.main,.5)),Ne(E.Slider,"successTrack",Mr(E.success.main,.5)),Ne(E.Slider,"warningTrack",Mr(E.warning.main,.5));const A=YD(E.background.default,.98);Ne(E.SnackbarContent,"bg",A),Ne(E.SnackbarContent,"color",gd(()=>E.getContrastText(A))),Ne(E.SpeedDialAction,"fabHoverBg",YD(E.background.paper,.15)),Ne(E.StepConnector,"border",P("palette-grey-600")),Ne(E.StepContent,"border",P("palette-grey-600")),Ne(E.Switch,"defaultColor",P("palette-grey-300")),Ne(E.Switch,"defaultDisabledColor",P("palette-grey-600")),Ne(E.Switch,"primaryDisabledColor",Mr(E.primary.main,.55)),Ne(E.Switch,"secondaryDisabledColor",Mr(E.secondary.main,.55)),Ne(E.Switch,"errorDisabledColor",Mr(E.error.main,.55)),Ne(E.Switch,"infoDisabledColor",Mr(E.info.main,.55)),Ne(E.Switch,"successDisabledColor",Mr(E.success.main,.55)),Ne(E.Switch,"warningDisabledColor",Mr(E.warning.main,.55)),Ne(E.TableCell,"border",Mr(XD(E.divider,1),.68)),Ne(E.Tooltip,"bg",XD(E.grey[700],.92))}lp(E.background,"default"),lp(E.background,"paper"),lp(E.common,"background"),lp(E.common,"onBackground"),lp(E,"divider"),Object.keys(E).forEach(A=>{const R=E[A];R&&typeof R=="object"&&(R.main&&Ne(E[A],"mainChannel",q2(X2(R.main))),R.light&&Ne(E[A],"lightChannel",q2(X2(R.light))),R.dark&&Ne(E[A],"darkChannel",q2(X2(R.dark))),R.contrastText&&Ne(E[A],"contrastTextChannel",q2(X2(R.contrastText))),A==="text"&&(lp(E[A],"primary"),lp(E[A],"secondary")),A==="action"&&(R.active&&lp(E[A],"active"),R.selected&&lp(E[A],"selected")))})}),b=e.reduce((k,E)=>Wo(k,E),b);const w={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:frt(b)},{vars:_,generateThemeVars:S,generateStyleSheets:O}=jnt(b,w);return b.vars=_,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([k,E])=>{b[k]=E}),b.generateThemeVars=S,b.generateStyleSheets=O,b.generateSpacing=function(){return TAe(c.spacing,_ee(this))},b.getColorSchemeSelector=Bnt(a),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=s,b.unstable_sxConfig={...OM,...c==null?void 0:c.unstable_sxConfig},b.unstable_sx=function(E){return Qv({sx:E,theme:this})},b.toRuntimeSource=ZAe,b}function mde(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:Mee({...n===!0?{}:n.palette,mode:e})})}function n4(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=t,a=o||"light",l=i==null?void 0:i[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return eq(t,...e);let u=n;"palette"in t||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const f=eq({...t,palette:u},...e);return f.defaultColorScheme=a,f.colorSchemes=c,f.palette.mode==="light"&&(f.colorSchemes.light={...c.light!==!0&&c.light,palette:f.palette},mde(f,"dark",c.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:f.palette},mde(f,"light",c.light)),f}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),grt({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...e)}const r4=n4();function To(){const t=Zb(r4);return t[Rf]||t}function kn({props:t,name:e}){return unt({props:t,name:e,defaultTheme:r4,themeId:Rf})}function i4(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Xo=t=>i4(t)&&t!=="classes",be=RAe({themeId:Rf,defaultTheme:r4,rootShouldForwardProp:Xo});function vde({theme:t,...e}){const n=Rf in t?t[Rf]:void 0;return C.jsx(HAe,{...e,themeId:n?Rf:void 0,theme:n||t})}const QD={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:mrt,useColorScheme:VXn,getInitColorSchemeScript:GXn}=$nt({themeId:Rf,theme:()=>n4({cssVariables:!0}),colorSchemeStorageKey:QD.colorSchemeStorageKey,modeStorageKey:QD.modeStorageKey,defaultColorScheme:{light:QD.defaultLightColorScheme,dark:QD.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:QAe(t.palette,t.typography)};return e.unstable_sx=function(r){return Qv({sx:r,theme:this})},e}}),vrt=mrt;function yrt({theme:t,...e}){return typeof t=="function"?C.jsx(vde,{theme:t,...e}):"colorSchemes"in(Rf in t?t[Rf]:t)?C.jsx(vrt,{theme:t,...e}):C.jsx(vde,{theme:t,...e})}function xrt(t){return C.jsx(Ztt,{...t,defaultTheme:r4,themeId:Rf})}function Ree(t){return function(n){return C.jsx(xrt,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function brt(){return Eee}const wt=Pnt;function _t(t){return Ant(t)}function wrt(t){return Xe("MuiSvgIcon",t)}He("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const _rt=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${Me(e)}`,`fontSize${Me(n)}`]};return qe(i,wrt,r)},Srt=be("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Me(n.color)}`],e[`fontSize${Me(n.fontSize)}`]]}})(wt(({theme:t})=>{var e,n,r,i,o,s,a,l,c,u,f,d,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(e=t.transitions)==null?void 0:e.create)==null?void 0:i.call(e,"fill",{duration:(r=(n=(t.vars??t).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:g=>!g.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=t.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=t.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(c=t.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter(([,g])=>g&&g.main).map(([g])=>{var m,v;return{props:{color:g},style:{color:(v=(m=(t.vars??t).palette)==null?void 0:m[g])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(d=(f=(t.vars??t).palette)==null?void 0:f.action)==null?void 0:d.active}},{props:{color:"disabled"},style:{color:(p=(h=(t.vars??t).palette)==null?void 0:h.action)==null?void 0:p.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),kF=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,p=D.isValidElement(i)&&i.type==="svg",g={...r,color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p},m={};u||(m.viewBox=d);const v=_rt(g);return C.jsxs(Srt,{as:a,className:Oe(v.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...m,...h,...p&&i.props,ownerState:g,children:[p?i.props.children:i,f?C.jsx("title",{children:f}):null]})});kF&&(kF.muiName="SvgIcon");function lt(t,e){function n(r,i){return C.jsx(kF,{"data-testid":`${e}Icon`,ref:i,...r,children:t})}return n.muiName=kF.muiName,D.memo(D.forwardRef(n))}var Ar={};/** * @license React * react-is.production.min.js * @@ -123,7 +123,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Dee=Symbol.for("react.element"),Iee=Symbol.for("react.portal"),o4=Symbol.for("react.fragment"),s4=Symbol.for("react.strict_mode"),a4=Symbol.for("react.profiler"),l4=Symbol.for("react.provider"),c4=Symbol.for("react.context"),Crt=Symbol.for("react.server_context"),u4=Symbol.for("react.forward_ref"),f4=Symbol.for("react.suspense"),d4=Symbol.for("react.suspense_list"),h4=Symbol.for("react.memo"),p4=Symbol.for("react.lazy"),Ort=Symbol.for("react.offscreen"),tPe;tPe=Symbol.for("react.module.reference");function $u(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Dee:switch(t=t.type,t){case o4:case a4:case s4:case f4:case d4:return t;default:switch(t=t&&t.$$typeof,t){case Crt:case c4:case u4:case p4:case h4:case l4:return t;default:return e}}case Iee:return e}}}Ar.ContextConsumer=c4;Ar.ContextProvider=l4;Ar.Element=Dee;Ar.ForwardRef=u4;Ar.Fragment=o4;Ar.Lazy=p4;Ar.Memo=h4;Ar.Portal=Iee;Ar.Profiler=a4;Ar.StrictMode=s4;Ar.Suspense=f4;Ar.SuspenseList=d4;Ar.isAsyncMode=function(){return!1};Ar.isConcurrentMode=function(){return!1};Ar.isContextConsumer=function(t){return $u(t)===c4};Ar.isContextProvider=function(t){return $u(t)===l4};Ar.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Dee};Ar.isForwardRef=function(t){return $u(t)===u4};Ar.isFragment=function(t){return $u(t)===o4};Ar.isLazy=function(t){return $u(t)===p4};Ar.isMemo=function(t){return $u(t)===h4};Ar.isPortal=function(t){return $u(t)===Iee};Ar.isProfiler=function(t){return $u(t)===a4};Ar.isStrictMode=function(t){return $u(t)===s4};Ar.isSuspense=function(t){return $u(t)===f4};Ar.isSuspenseList=function(t){return $u(t)===d4};Ar.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===o4||t===a4||t===s4||t===f4||t===d4||t===Ort||typeof t=="object"&&t!==null&&(t.$$typeof===p4||t.$$typeof===h4||t.$$typeof===l4||t.$$typeof===c4||t.$$typeof===u4||t.$$typeof===tPe||t.getModuleId!==void 0)};Ar.typeOf=$u;function AF(t,e){return AF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},AF(t,e)}function kM(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,AF(t,e)}function Ert(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function Trt(t,e){t.classList?t.classList.add(e):Ert(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function yde(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function krt(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=yde(t.className,e):t.setAttribute("class",yde(t.className&&t.className.baseVal||"",e))}const xde={disabled:!1},PF=he.createContext(null);var nPe=function(e){return e.scrollTop},Q2="unmounted",z0="exited",j0="entering",$w="entered",nq="exiting",Rc=function(t){kM(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=z0,o.appearStatus=j0):l=$w:r.unmountOnExit||r.mountOnEnter?l=Q2:l=z0,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===Q2?{status:z0}: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 s=this.state.status;this.props.in?s!==j0&&s!==$w&&(o=j0):(s===j0||s===$w)&&(o=nq)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===j0){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:HD.findDOMNode(this);s&&nPe(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===z0&&this.setState({status:Q2})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[HD.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),d=a?f.appear:f.enter;if(!i&&!s||xde.disabled){this.safeSetState({status:$w},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:j0},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:$w},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:HD.findDOMNode(this);if(!o||xde.disabled){this.safeSetState({status:z0},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:nq},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:z0},function(){i.props.onExited(a)})})})},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,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:HD.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,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===Q2)return null;var o=this.props,s=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 a=Dt(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return he.createElement(PF.Provider,{value:null},typeof s=="function"?s(i,a):he.cloneElement(he.Children.only(s),a))},e}(he.Component);Rc.contextType=PF;Rc.propTypes={};function U1(){}Rc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:U1,onEntering:U1,onEntered:U1,onExit:U1,onExiting:U1,onExited:U1};Rc.UNMOUNTED=Q2;Rc.EXITED=z0;Rc.ENTERING=j0;Rc.ENTERED=$w;Rc.EXITING=nq;var Art=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return Trt(e,r)})},tW=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return krt(e,r)})},Lee=function(t){kM(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),s=0;st.scrollTop;function Jv(t,e){const{timeout:n,easing:r,style:i={}}=t;return{duration:i.transitionDuration??(typeof n=="number"?n:n[e.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[e.mode]:r),delay:i.transitionDelay}}function Lrt(t){return Xe("MuiCollapse",t)}He("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const $rt=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return qe(r,Lrt,n)},Frt=be("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]}})(wt(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:e})=>e.state==="exited"&&!e.in&&e.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),Nrt=be("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),zrt=be("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),MF=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCollapse"}),{addEndListener:i,children:o,className:s,collapsedSize:a="0px",component:l,easing:c,in:u,onEnter:f,onEntered:d,onEntering:h,onExit:p,onExited:g,onExiting:m,orientation:v="vertical",style:y,timeout:x=KAe.standard,TransitionComponent:b=Rc,...w}=r,_={...r,orientation:v,collapsedSize:a},S=$rt(_),O=To(),k=cv(),E=D.useRef(null),P=D.useRef(),A=typeof a=="number"?`${a}px`:a,R=v==="horizontal",T=R?"width":"height",M=D.useRef(null),I=dn(n,M),z=Y=>le=>{if(Y){const K=M.current;le===void 0?Y(K):Y(K,le)}},F=()=>E.current?E.current[R?"clientWidth":"clientHeight"]:0,N=z((Y,le)=>{E.current&&R&&(E.current.style.position="absolute"),Y.style[T]=A,f&&f(Y,le)}),L=z((Y,le)=>{const K=F();E.current&&R&&(E.current.style.position="");const{duration:ee,easing:re}=Jv({style:y,timeout:x,easing:c},{mode:"enter"});if(x==="auto"){const me=O.transitions.getAutoHeightDuration(K);Y.style.transitionDuration=`${me}ms`,P.current=me}else Y.style.transitionDuration=typeof ee=="string"?ee:`${ee}ms`;Y.style[T]=`${K}px`,Y.style.transitionTimingFunction=re,h&&h(Y,le)}),B=z((Y,le)=>{Y.style[T]="auto",d&&d(Y,le)}),$=z(Y=>{Y.style[T]=`${F()}px`,p&&p(Y)}),j=z(g),X=z(Y=>{const le=F(),{duration:K,easing:ee}=Jv({style:y,timeout:x,easing:c},{mode:"exit"});if(x==="auto"){const re=O.transitions.getAutoHeightDuration(le);Y.style.transitionDuration=`${re}ms`,P.current=re}else Y.style.transitionDuration=typeof K=="string"?K:`${K}ms`;Y.style[T]=A,Y.style.transitionTimingFunction=ee,m&&m(Y)}),V=Y=>{x==="auto"&&k.start(P.current||0,Y),i&&i(M.current,Y)};return C.jsx(b,{in:u,onEnter:N,onEntered:B,onEntering:L,onExit:$,onExited:j,onExiting:X,addEndListener:V,nodeRef:M,timeout:x==="auto"?null:x,...w,children:(Y,le)=>C.jsx(Frt,{as:l,className:Oe(S.root,s,{entered:S.entered,exited:!u&&A==="0px"&&S.hidden}[Y]),style:{[R?"minWidth":"minHeight"]:A,...y},ref:I,...le,ownerState:{..._,state:Y},children:C.jsx(Nrt,{ownerState:{..._,state:Y},className:S.wrapper,ref:E,children:C.jsx(zrt,{ownerState:{..._,state:Y},className:S.wrapperInner,children:o})})})})});MF&&(MF.muiSupportAuto=!0);function jrt(t){return Xe("MuiPaper",t)}He("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 Brt=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return qe(o,jrt,i)},Urt=be("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}`]]}})(wt(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),kl=D.forwardRef(function(e,n){var h;const r=_t({props:e,name:"MuiPaper"}),i=To(),{className:o,component:s="div",elevation:a=1,square:l=!1,variant:c="elevation",...u}=r,f={...r,component:s,elevation:a,square:l,variant:c},d=Brt(f);return C.jsx(Urt,{as:s,ownerState:f,className:Oe(d.root,o),ref:n,...u,style:{...c==="elevation"&&{"--Paper-shadow":(i.vars||i).shadows[a],...i.vars&&{"--Paper-overlay":(h=i.vars.overlays)==null?void 0:h[a]},...!i.vars&&i.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${kt("#fff",tq(a))}, ${kt("#fff",tq(a))})`}},...u.style}})});function Jl(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:s,internalForwardedProps:a,...l}=e,{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0},...d}=o,h=u[t]||r,p=rA(f[t],i),{props:{component:g,...m},internalRef:v}=BAe({className:n,...l,externalForwardedProps:t==="root"?d:void 0,externalSlotProps:p}),y=dn(v,p==null?void 0:p.ref,e.ref),x=s?s(m):{},b={...i,...x},w=t==="root"?g||c:g,_=s_(h,{...t==="root"&&!c&&!u[t]&&a,...t!=="root"&&!u[t]&&a,...m,...w&&{as:w},ref:y},b);return Object.keys(x).forEach(S=>{delete _[S]}),[h,_]}class RF{constructor(){gn(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new RF}static use(){const e=NAe(RF.create).current,[n,r]=D.useState(!1);return e.shouldMount=n,e.setShouldMount=r,D.useEffect(e.mountEffect,[n]),e}mount(){return this.mounted||(this.mounted=Vrt(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...e)})}stop(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...e)})}pulsate(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...e)})}}function Wrt(){return RF.use()}function Vrt(){let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n}function Grt(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:c}=t,[u,f]=D.useState(!1),d=Oe(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},p=Oe(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),D.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,a,c]),C.jsx("span",{className:d,style:h,children:C.jsx("span",{className:p})})}const Wc=He("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),rq=550,Hrt=80,qrt=My` + */var Dee=Symbol.for("react.element"),Iee=Symbol.for("react.portal"),o4=Symbol.for("react.fragment"),s4=Symbol.for("react.strict_mode"),a4=Symbol.for("react.profiler"),l4=Symbol.for("react.provider"),c4=Symbol.for("react.context"),Crt=Symbol.for("react.server_context"),u4=Symbol.for("react.forward_ref"),f4=Symbol.for("react.suspense"),d4=Symbol.for("react.suspense_list"),h4=Symbol.for("react.memo"),p4=Symbol.for("react.lazy"),Ort=Symbol.for("react.offscreen"),tPe;tPe=Symbol.for("react.module.reference");function $u(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Dee:switch(t=t.type,t){case o4:case a4:case s4:case f4:case d4:return t;default:switch(t=t&&t.$$typeof,t){case Crt:case c4:case u4:case p4:case h4:case l4:return t;default:return e}}case Iee:return e}}}Ar.ContextConsumer=c4;Ar.ContextProvider=l4;Ar.Element=Dee;Ar.ForwardRef=u4;Ar.Fragment=o4;Ar.Lazy=p4;Ar.Memo=h4;Ar.Portal=Iee;Ar.Profiler=a4;Ar.StrictMode=s4;Ar.Suspense=f4;Ar.SuspenseList=d4;Ar.isAsyncMode=function(){return!1};Ar.isConcurrentMode=function(){return!1};Ar.isContextConsumer=function(t){return $u(t)===c4};Ar.isContextProvider=function(t){return $u(t)===l4};Ar.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Dee};Ar.isForwardRef=function(t){return $u(t)===u4};Ar.isFragment=function(t){return $u(t)===o4};Ar.isLazy=function(t){return $u(t)===p4};Ar.isMemo=function(t){return $u(t)===h4};Ar.isPortal=function(t){return $u(t)===Iee};Ar.isProfiler=function(t){return $u(t)===a4};Ar.isStrictMode=function(t){return $u(t)===s4};Ar.isSuspense=function(t){return $u(t)===f4};Ar.isSuspenseList=function(t){return $u(t)===d4};Ar.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===o4||t===a4||t===s4||t===f4||t===d4||t===Ort||typeof t=="object"&&t!==null&&(t.$$typeof===p4||t.$$typeof===h4||t.$$typeof===l4||t.$$typeof===c4||t.$$typeof===u4||t.$$typeof===tPe||t.getModuleId!==void 0)};Ar.typeOf=$u;function AF(t,e){return AF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},AF(t,e)}function TM(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,AF(t,e)}function Ert(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function Trt(t,e){t.classList?t.classList.add(e):Ert(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function yde(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function krt(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=yde(t.className,e):t.setAttribute("class",yde(t.className&&t.className.baseVal||"",e))}const xde={disabled:!1},PF=he.createContext(null);var nPe=function(e){return e.scrollTop},Y2="unmounted",z0="exited",j0="entering",$w="entered",nq="exiting",Rc=function(t){TM(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=z0,o.appearStatus=j0):l=$w:r.unmountOnExit||r.mountOnEnter?l=Y2:l=z0,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===Y2?{status:z0}: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 s=this.state.status;this.props.in?s!==j0&&s!==$w&&(o=j0):(s===j0||s===$w)&&(o=nq)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===j0){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:HD.findDOMNode(this);s&&nPe(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===z0&&this.setState({status:Y2})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[HD.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),d=a?f.appear:f.enter;if(!i&&!s||xde.disabled){this.safeSetState({status:$w},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:j0},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:$w},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:HD.findDOMNode(this);if(!o||xde.disabled){this.safeSetState({status:z0},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:nq},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:z0},function(){i.props.onExited(a)})})})},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,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:HD.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,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===Y2)return null;var o=this.props,s=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 a=Dt(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return he.createElement(PF.Provider,{value:null},typeof s=="function"?s(i,a):he.cloneElement(he.Children.only(s),a))},e}(he.Component);Rc.contextType=PF;Rc.propTypes={};function U1(){}Rc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:U1,onEntering:U1,onEntered:U1,onExit:U1,onExiting:U1,onExited:U1};Rc.UNMOUNTED=Y2;Rc.EXITED=z0;Rc.ENTERING=j0;Rc.ENTERED=$w;Rc.EXITING=nq;var Art=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return Trt(e,r)})},tW=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return krt(e,r)})},Lee=function(t){TM(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),s=0;st.scrollTop;function Jv(t,e){const{timeout:n,easing:r,style:i={}}=t;return{duration:i.transitionDuration??(typeof n=="number"?n:n[e.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[e.mode]:r),delay:i.transitionDelay}}function Lrt(t){return Xe("MuiCollapse",t)}He("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const $rt=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return qe(r,Lrt,n)},Frt=be("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]}})(wt(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:e})=>e.state==="exited"&&!e.in&&e.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),Nrt=be("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),zrt=be("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),MF=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCollapse"}),{addEndListener:i,children:o,className:s,collapsedSize:a="0px",component:l,easing:c,in:u,onEnter:f,onEntered:d,onEntering:h,onExit:p,onExited:g,onExiting:m,orientation:v="vertical",style:y,timeout:x=KAe.standard,TransitionComponent:b=Rc,...w}=r,_={...r,orientation:v,collapsedSize:a},S=$rt(_),O=To(),k=cv(),E=D.useRef(null),P=D.useRef(),A=typeof a=="number"?`${a}px`:a,R=v==="horizontal",T=R?"width":"height",M=D.useRef(null),I=dn(n,M),z=Y=>le=>{if(Y){const K=M.current;le===void 0?Y(K):Y(K,le)}},F=()=>E.current?E.current[R?"clientWidth":"clientHeight"]:0,N=z((Y,le)=>{E.current&&R&&(E.current.style.position="absolute"),Y.style[T]=A,f&&f(Y,le)}),L=z((Y,le)=>{const K=F();E.current&&R&&(E.current.style.position="");const{duration:ee,easing:re}=Jv({style:y,timeout:x,easing:c},{mode:"enter"});if(x==="auto"){const me=O.transitions.getAutoHeightDuration(K);Y.style.transitionDuration=`${me}ms`,P.current=me}else Y.style.transitionDuration=typeof ee=="string"?ee:`${ee}ms`;Y.style[T]=`${K}px`,Y.style.transitionTimingFunction=re,h&&h(Y,le)}),B=z((Y,le)=>{Y.style[T]="auto",d&&d(Y,le)}),$=z(Y=>{Y.style[T]=`${F()}px`,p&&p(Y)}),j=z(g),X=z(Y=>{const le=F(),{duration:K,easing:ee}=Jv({style:y,timeout:x,easing:c},{mode:"exit"});if(x==="auto"){const re=O.transitions.getAutoHeightDuration(le);Y.style.transitionDuration=`${re}ms`,P.current=re}else Y.style.transitionDuration=typeof K=="string"?K:`${K}ms`;Y.style[T]=A,Y.style.transitionTimingFunction=ee,m&&m(Y)}),V=Y=>{x==="auto"&&k.start(P.current||0,Y),i&&i(M.current,Y)};return C.jsx(b,{in:u,onEnter:N,onEntered:B,onEntering:L,onExit:$,onExited:j,onExiting:X,addEndListener:V,nodeRef:M,timeout:x==="auto"?null:x,...w,children:(Y,le)=>C.jsx(Frt,{as:l,className:Oe(S.root,s,{entered:S.entered,exited:!u&&A==="0px"&&S.hidden}[Y]),style:{[R?"minWidth":"minHeight"]:A,...y},ref:I,...le,ownerState:{..._,state:Y},children:C.jsx(Nrt,{ownerState:{..._,state:Y},className:S.wrapper,ref:E,children:C.jsx(zrt,{ownerState:{..._,state:Y},className:S.wrapperInner,children:o})})})})});MF&&(MF.muiSupportAuto=!0);function jrt(t){return Xe("MuiPaper",t)}He("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 Brt=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return qe(o,jrt,i)},Urt=be("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}`]]}})(wt(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),kl=D.forwardRef(function(e,n){var h;const r=_t({props:e,name:"MuiPaper"}),i=To(),{className:o,component:s="div",elevation:a=1,square:l=!1,variant:c="elevation",...u}=r,f={...r,component:s,elevation:a,square:l,variant:c},d=Brt(f);return C.jsx(Urt,{as:s,ownerState:f,className:Oe(d.root,o),ref:n,...u,style:{...c==="elevation"&&{"--Paper-shadow":(i.vars||i).shadows[a],...i.vars&&{"--Paper-overlay":(h=i.vars.overlays)==null?void 0:h[a]},...!i.vars&&i.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${kt("#fff",tq(a))}, ${kt("#fff",tq(a))})`}},...u.style}})});function Jl(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:s,internalForwardedProps:a,...l}=e,{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0},...d}=o,h=u[t]||r,p=nA(f[t],i),{props:{component:g,...m},internalRef:v}=BAe({className:n,...l,externalForwardedProps:t==="root"?d:void 0,externalSlotProps:p}),y=dn(v,p==null?void 0:p.ref,e.ref),x=s?s(m):{},b={...i,...x},w=t==="root"?g||c:g,_=s_(h,{...t==="root"&&!c&&!u[t]&&a,...t!=="root"&&!u[t]&&a,...m,...w&&{as:w},ref:y},b);return Object.keys(x).forEach(S=>{delete _[S]}),[h,_]}class RF{constructor(){gn(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new RF}static use(){const e=NAe(RF.create).current,[n,r]=D.useState(!1);return e.shouldMount=n,e.setShouldMount=r,D.useEffect(e.mountEffect,[n]),e}mount(){return this.mounted||(this.mounted=Vrt(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...e)})}stop(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...e)})}pulsate(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...e)})}}function Wrt(){return RF.use()}function Vrt(){let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n}function Grt(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:c}=t,[u,f]=D.useState(!1),d=Oe(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},p=Oe(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),D.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,a,c]),C.jsx("span",{className:d,style:h,children:C.jsx("span",{className:p})})}const Wc=He("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),rq=550,Hrt=80,qrt=My` 0% { transform: scale(0); opacity: 0.1; @@ -196,8 +196,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann animation-iteration-count: infinite; animation-delay: 200ms; } -`,Zrt=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s,...a}=r,[l,c]=D.useState([]),u=D.useRef(0),f=D.useRef(null);D.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=D.useRef(!1),h=cv(),p=D.useRef(null),g=D.useRef(null),m=D.useCallback(b=>{const{pulsate:w,rippleX:_,rippleY:S,rippleSize:O,cb:k}=b;c(E=>[...E,C.jsx(Krt,{classes:{ripple:Oe(o.ripple,Wc.ripple),rippleVisible:Oe(o.rippleVisible,Wc.rippleVisible),ripplePulsate:Oe(o.ripplePulsate,Wc.ripplePulsate),child:Oe(o.child,Wc.child),childLeaving:Oe(o.childLeaving,Wc.childLeaving),childPulsate:Oe(o.childPulsate,Wc.childPulsate)},timeout:rq,pulsate:w,rippleX:_,rippleY:S,rippleSize:O},u.current)]),u.current+=1,f.current=k},[o]),v=D.useCallback((b={},w={},_=()=>{})=>{const{pulsate:S=!1,center:O=i||w.pulsate,fakeElement:k=!1}=w;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 E=k?null:g.current,P=E?E.getBoundingClientRect():{width:0,height:0,left:0,top:0};let A,R,T;if(O||b===void 0||b.clientX===0&&b.clientY===0||!b.clientX&&!b.touches)A=Math.round(P.width/2),R=Math.round(P.height/2);else{const{clientX:M,clientY:I}=b.touches&&b.touches.length>0?b.touches[0]:b;A=Math.round(M-P.left),R=Math.round(I-P.top)}if(O)T=Math.sqrt((2*P.width**2+P.height**2)/3),T%2===0&&(T+=1);else{const M=Math.max(Math.abs((E?E.clientWidth:0)-A),A)*2+2,I=Math.max(Math.abs((E?E.clientHeight:0)-R),R)*2+2;T=Math.sqrt(M**2+I**2)}b!=null&&b.touches?p.current===null&&(p.current=()=>{m({pulsate:S,rippleX:A,rippleY:R,rippleSize:T,cb:_})},h.start(Hrt,()=>{p.current&&(p.current(),p.current=null)})):m({pulsate:S,rippleX:A,rippleY:R,rippleSize:T,cb:_})},[i,m,h]),y=D.useCallback(()=>{v({},{pulsate:!0})},[v]),x=D.useCallback((b,w)=>{if(h.clear(),(b==null?void 0:b.type)==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{x(b,w)});return}p.current=null,c(_=>_.length>0?_.slice(1):_),f.current=w},[h]);return D.useImperativeHandle(n,()=>({pulsate:y,start:v,stop:x}),[y,v,x]),C.jsx(Qrt,{className:Oe(Wc.root,o.root,s),ref:g,...a,children:C.jsx(AM,{component:null,exit:!0,children:l})})});function Jrt(t){return Xe("MuiButtonBase",t)}const eit=He("MuiButtonBase",["root","disabled","focusVisible"]),tit=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,s=qe({root:["root",e&&"disabled",n&&"focusVisible"]},Jrt,i);return n&&r&&(s.root+=` ${r}`),s},nit=be("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"},[`&.${eit.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Ff=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:p="a",onBlur:g,onClick:m,onContextMenu:v,onDragLeave:y,onFocus:x,onFocusVisible:b,onKeyDown:w,onKeyUp:_,onMouseDown:S,onMouseLeave:O,onMouseUp:k,onTouchEnd:E,onTouchMove:P,onTouchStart:A,tabIndex:R=0,TouchRippleProps:T,touchRippleRef:M,type:I,...z}=r,F=D.useRef(null),N=Wrt(),L=dn(N.ref,M),[B,$]=D.useState(!1);c&&B&&$(!1),D.useImperativeHandle(i,()=>({focusVisible:()=>{$(!0),F.current.focus()}}),[]);const j=N.shouldMount&&!u&&!c;D.useEffect(()=>{B&&d&&!u&&N.pulsate()},[u,d,B,N]);function X(W,J,se=f){return st(ye=>(J&&J(ye),se||N[W](ye),!0))}const V=X("start",S),Y=X("stop",v),le=X("stop",y),K=X("stop",k),ee=X("stop",W=>{B&&W.preventDefault(),O&&O(W)}),re=X("start",A),me=X("stop",E),te=X("stop",P),ae=X("stop",W=>{Zv(W.target)||$(!1),g&&g(W)},!1),U=st(W=>{F.current||(F.current=W.currentTarget),Zv(W.target)&&($(!0),b&&b(W)),x&&x(W)}),oe=()=>{const W=F.current;return l&&l!=="button"&&!(W.tagName==="A"&&W.href)},ne=st(W=>{d&&!W.repeat&&B&&W.key===" "&&N.stop(W,()=>{N.start(W)}),W.target===W.currentTarget&&oe()&&W.key===" "&&W.preventDefault(),w&&w(W),W.target===W.currentTarget&&oe()&&W.key==="Enter"&&!c&&(W.preventDefault(),m&&m(W))}),G=st(W=>{d&&W.key===" "&&B&&!W.defaultPrevented&&N.stop(W,()=>{N.pulsate(W)}),_&&_(W),m&&W.target===W.currentTarget&&oe()&&W.key===" "&&!W.defaultPrevented&&m(W)});let q=l;q==="button"&&(z.href||z.to)&&(q=p);const Z={};q==="button"?(Z.type=I===void 0?"button":I,Z.disabled=c):(!z.href&&!z.to&&(Z.role="button"),c&&(Z["aria-disabled"]=c));const de=dn(n,F),xe={...r,centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:R,focusVisible:B},H=tit(xe);return C.jsxs(nit,{as:q,className:Oe(H.root,a),ownerState:xe,onBlur:ae,onClick:m,onContextMenu:Y,onFocus:U,onKeyDown:ne,onKeyUp:G,onMouseDown:V,onMouseLeave:ee,onMouseUp:K,onDragLeave:le,onTouchEnd:me,onTouchMove:te,onTouchStart:re,ref:de,tabIndex:c?-1:R,type:I,...Z,...z,children:[s,j?C.jsx(Zrt,{ref:L,center:o,...T}):null]})});function rit(t){return typeof t.main=="string"}function iit(t,e=[]){if(!rit(t))return!1;for(const n of e)if(!t.hasOwnProperty(n)||typeof t[n]!="string")return!1;return!0}function pr(t=[]){return([,e])=>e&&iit(e,t)}function oit(t){return Xe("MuiIconButton",t)}const sit=He("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),ait=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,s={root:["root",n&&"disabled",r!=="default"&&`color${Me(r)}`,i&&`edge${Me(i)}`,`size${Me(o)}`]};return qe(s,oit,e)},lit=be(Ff,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Me(n.color)}`],n.edge&&e[`edge${Me(n.edge)}`],e[`size${Me(n.size)}`]]}})(wt(({theme:t})=>({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),wt(({theme:t})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt((t.vars||t).palette[e].main,t.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${sit.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}}))),Gt=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",...f}=r,d={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,size:u},h=ait(d);return C.jsx(lit,{className:Oe(h.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:n,...f,ownerState:d,children:o})});function cit(t){return Xe("MuiTypography",t)}const DF=He("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),uit={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},fit=brt(),dit=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=t,a={root:["root",o,t.align!=="inherit"&&`align${Me(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return qe(a,cit,s)},hit=be("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${Me(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(wt(({theme:t})=>{var e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([n,r])=>n!=="inherit"&&r&&typeof r=="object").map(([n,r])=>({props:{variant:n},style:r})),...Object.entries(t.palette).filter(pr()).map(([n])=>({props:{color:n},style:{color:(t.vars||t).palette[n].main}})),...Object.entries(((e=t.palette)==null?void 0:e.text)||{}).filter(([,n])=>typeof n=="string").map(([n])=>({props:{color:`text${Me(n)}`},style:{color:(t.vars||t).palette.text[n]}})),{props:({ownerState:n})=>n.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:n})=>n.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:n})=>n.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:n})=>n.paragraph,style:{marginBottom:16}}]}})),bde={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Jt=D.forwardRef(function(e,n){const{color:r,...i}=_t({props:e,name:"MuiTypography"}),o=!uit[r],s=fit({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:f=!1,paragraph:d=!1,variant:h="body1",variantMapping:p=bde,...g}=s,m={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:f,paragraph:d,variant:h,variantMapping:p},v=c||(d?"p":p[h]||bde[h])||"span",y=dit(m);return C.jsx(hit,{as:v,ref:n,className:Oe(y.root,l),...g,ownerState:m,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...g.style}})});function pit(t){return Xe("MuiAppBar",t)}He("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const git=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${Me(e)}`,`position${Me(n)}`]};return qe(i,pit,r)},wde=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,mit=be(kl,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Me(n.position)}`],e[`color${Me(n.color)}`]]}})(wt(({theme:t})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[100],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[100]),...t.applyStyles("dark",{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[900],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[900])})}},...Object.entries(t.palette).filter(pr(["contrastText"])).map(([e])=>({props:{color:e},style:{"--AppBar-background":(t.vars??t).palette[e].main,"--AppBar-color":(t.vars??t).palette[e].contrastText}})),{props:e=>e.enableColorOnDark===!0&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>e.enableColorOnDark===!1&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundColor:t.vars?wde(t.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:t.vars?wde(t.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundImage:"none"})}}]}))),rPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=git(c);return C.jsx(mit,{square:!0,component:"header",ownerState:c,elevation:4,className:Oe(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});var dl="top",_u="bottom",Su="right",hl="left",Nee="auto",PM=[dl,_u,Su,hl],SS="start",iA="end",vit="clippingParents",iPe="viewport",ME="popper",yit="reference",_de=PM.reduce(function(t,e){return t.concat([e+"-"+SS,e+"-"+iA])},[]),oPe=[].concat(PM,[Nee]).reduce(function(t,e){return t.concat([e,e+"-"+SS,e+"-"+iA])},[]),xit="beforeRead",bit="read",wit="afterRead",_it="beforeMain",Sit="main",Cit="afterMain",Oit="beforeWrite",Eit="write",Tit="afterWrite",kit=[xit,bit,wit,_it,Sit,Cit,Oit,Eit,Tit];function Th(t){return t?(t.nodeName||"").toLowerCase():null}function wc(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ib(t){var e=wc(t).Element;return t instanceof e||t instanceof Element}function uu(t){var e=wc(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function zee(t){if(typeof ShadowRoot>"u")return!1;var e=wc(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Ait(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];!uu(o)||!Th(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function Pit(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]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!uu(i)||!Th(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Mit={name:"applyStyles",enabled:!0,phase:"write",fn:Ait,effect:Pit,requires:["computeStyles"]};function fh(t){return t.split("-")[0]}var Rx=Math.max,IF=Math.min,CS=Math.round;function iq(){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 sPe(){return!/^((?!chrome|android).)*safari/i.test(iq())}function OS(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&uu(t)&&(i=t.offsetWidth>0&&CS(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&CS(r.height)/t.offsetHeight||1);var s=ib(t)?wc(t):window,a=s.visualViewport,l=!sPe()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.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 jee(t){var e=OS(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 aPe(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&zee(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Rg(t){return wc(t).getComputedStyle(t)}function Rit(t){return["table","td","th"].indexOf(Th(t))>=0}function Dy(t){return((ib(t)?t.ownerDocument:t.document)||window.document).documentElement}function g4(t){return Th(t)==="html"?t:t.assignedSlot||t.parentNode||(zee(t)?t.host:null)||Dy(t)}function Sde(t){return!uu(t)||Rg(t).position==="fixed"?null:t.offsetParent}function Dit(t){var e=/firefox/i.test(iq()),n=/Trident/i.test(iq());if(n&&uu(t)){var r=Rg(t);if(r.position==="fixed")return null}var i=g4(t);for(zee(i)&&(i=i.host);uu(i)&&["html","body"].indexOf(Th(i))<0;){var o=Rg(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 MM(t){for(var e=wc(t),n=Sde(t);n&&Rit(n)&&Rg(n).position==="static";)n=Sde(n);return n&&(Th(n)==="html"||Th(n)==="body"&&Rg(n).position==="static")?e:n||Dit(t)||e}function Bee(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function QT(t,e,n){return Rx(t,IF(e,n))}function Iit(t,e,n){var r=QT(t,e,n);return r>n?n:r}function lPe(){return{top:0,right:0,bottom:0,left:0}}function cPe(t){return Object.assign({},lPe(),t)}function uPe(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Lit=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,cPe(typeof e!="number"?e:uPe(e,PM))};function $it(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=fh(n.placement),l=Bee(a),c=[hl,Su].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var f=Lit(i.padding,n),d=jee(o),h=l==="y"?dl:hl,p=l==="y"?_u:Su,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=MM(o),y=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,x=g/2-m/2,b=f[h],w=y-d[u]-f[p],_=y/2-d[u]/2+x,S=QT(b,_,w),O=l;n.modifiersData[r]=(e={},e[O]=S,e.centerOffset=S-_,e)}}function Fit(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)||aPe(e.elements.popper,i)&&(e.elements.arrow=i))}const Nit={name:"arrow",enabled:!0,phase:"main",fn:$it,effect:Fit,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ES(t){return t.split("-")[1]}var zit={top:"auto",right:"auto",bottom:"auto",left:"auto"};function jit(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:CS(n*i)/i||0,y:CS(r*i)/i||0}}function Cde(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,g=p===void 0?0:p,m=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),x=hl,b=dl,w=window;if(c){var _=MM(n),S="clientHeight",O="clientWidth";if(_===wc(n)&&(_=Dy(n),Rg(_).position!=="static"&&a==="absolute"&&(S="scrollHeight",O="scrollWidth")),_=_,i===dl||(i===hl||i===Su)&&o===iA){b=_u;var k=f&&_===w&&w.visualViewport?w.visualViewport.height:_[S];g-=k-r.height,g*=l?1:-1}if(i===hl||(i===dl||i===_u)&&o===iA){x=Su;var E=f&&_===w&&w.visualViewport?w.visualViewport.width:_[O];h-=E-r.width,h*=l?1:-1}}var P=Object.assign({position:a},c&&zit),A=u===!0?jit({x:h,y:g},wc(n)):{x:h,y:g};if(h=A.x,g=A.y,l){var R;return Object.assign({},P,(R={},R[b]=y?"0":"",R[x]=v?"0":"",R.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",R))}return Object.assign({},P,(e={},e[b]=y?g+"px":"",e[x]=v?h+"px":"",e.transform="",e))}function Bit(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:fh(e.placement),variation:ES(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,Cde(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Cde(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 Uit={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Bit,data:{}};var KD={passive:!0};function Wit(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=wc(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,KD)}),a&&l.addEventListener("resize",n.update,KD),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,KD)}),a&&l.removeEventListener("resize",n.update,KD)}}const Vit={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Wit,data:{}};var Git={left:"right",right:"left",bottom:"top",top:"bottom"};function o3(t){return t.replace(/left|right|bottom|top/g,function(e){return Git[e]})}var Hit={start:"end",end:"start"};function Ode(t){return t.replace(/start|end/g,function(e){return Hit[e]})}function Uee(t){var e=wc(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Wee(t){return OS(Dy(t)).left+Uee(t).scrollLeft}function qit(t,e){var n=wc(t),r=Dy(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=sPe();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Wee(t),y:l}}function Xit(t){var e,n=Dy(t),r=Uee(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Rx(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Rx(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Wee(t),l=-r.scrollTop;return Rg(i||n).direction==="rtl"&&(a+=Rx(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Vee(t){var e=Rg(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function fPe(t){return["html","body","#document"].indexOf(Th(t))>=0?t.ownerDocument.body:uu(t)&&Vee(t)?t:fPe(g4(t))}function KT(t,e){var n;e===void 0&&(e=[]);var r=fPe(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=wc(r),s=i?[o].concat(o.visualViewport||[],Vee(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(KT(g4(s)))}function oq(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Yit(t,e){var n=OS(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 Ede(t,e,n){return e===iPe?oq(qit(t,n)):ib(e)?Yit(e,n):oq(Xit(Dy(t)))}function Qit(t){var e=KT(g4(t)),n=["absolute","fixed"].indexOf(Rg(t).position)>=0,r=n&&uu(t)?MM(t):t;return ib(r)?e.filter(function(i){return ib(i)&&aPe(i,r)&&Th(i)!=="body"}):[]}function Kit(t,e,n,r){var i=e==="clippingParents"?Qit(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=Ede(t,c,r);return l.top=Rx(u.top,l.top),l.right=IF(u.right,l.right),l.bottom=IF(u.bottom,l.bottom),l.left=Rx(u.left,l.left),l},Ede(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function dPe(t){var e=t.reference,n=t.element,r=t.placement,i=r?fh(r):null,o=r?ES(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case dl:l={x:s,y:e.y-n.height};break;case _u:l={x:s,y:e.y+e.height};break;case Su:l={x:e.x+e.width,y:a};break;case hl:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?Bee(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case SS:l[c]=l[c]-(e[u]/2-n[u]/2);break;case iA:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function oA(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?vit:a,c=n.rootBoundary,u=c===void 0?iPe:c,f=n.elementContext,d=f===void 0?ME:f,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,m=g===void 0?0:g,v=cPe(typeof m!="number"?m:uPe(m,PM)),y=d===ME?yit:ME,x=t.rects.popper,b=t.elements[p?y:d],w=Kit(ib(b)?b:b.contextElement||Dy(t.elements.popper),l,u,s),_=OS(t.elements.reference),S=dPe({reference:_,element:x,strategy:"absolute",placement:i}),O=oq(Object.assign({},x,S)),k=d===ME?O:_,E={top:w.top-k.top+v.top,bottom:k.bottom-w.bottom+v.bottom,left:w.left-k.left+v.left,right:k.right-w.right+v.right},P=t.modifiersData.offset;if(d===ME&&P){var A=P[i];Object.keys(E).forEach(function(R){var T=[Su,_u].indexOf(R)>=0?1:-1,M=[dl,_u].indexOf(R)>=0?"y":"x";E[R]+=A[M]*T})}return E}function Zit(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?oPe:l,u=ES(r),f=u?a?_de:_de.filter(function(p){return ES(p)===u}):PM,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,g){return p[g]=oA(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[fh(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function Jit(t){if(fh(t)===Nee)return[];var e=o3(t);return[Ode(t),e,Ode(e)]}function eot(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,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,m=e.options.placement,v=fh(m),y=v===m,x=l||(y||!p?[o3(m)]:Jit(m)),b=[m].concat(x).reduce(function(X,V){return X.concat(fh(V)===Nee?Zit(e,{placement:V,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):V)},[]),w=e.rects.reference,_=e.rects.popper,S=new Map,O=!0,k=b[0],E=0;E=0,M=T?"width":"height",I=oA(e,{placement:P,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),z=T?R?Su:hl:R?_u:dl;w[M]>_[M]&&(z=o3(z));var F=o3(z),N=[];if(o&&N.push(I[A]<=0),a&&N.push(I[z]<=0,I[F]<=0),N.every(function(X){return X})){k=P,O=!1;break}S.set(P,N)}if(O)for(var L=p?3:1,B=function(V){var Y=b.find(function(le){var K=S.get(le);if(K)return K.slice(0,V).every(function(ee){return ee})});if(Y)return k=Y,"break"},$=L;$>0;$--){var j=B($);if(j==="break")break}e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}}const tot={name:"flip",enabled:!0,phase:"main",fn:eot,requiresIfExists:["offset"],data:{_skip:!1}};function Tde(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 kde(t){return[dl,Su,_u,hl].some(function(e){return t[e]>=0})}function not(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=oA(e,{elementContext:"reference"}),a=oA(e,{altBoundary:!0}),l=Tde(s,r),c=Tde(a,i,o),u=kde(l),f=kde(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 rot={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:not};function iot(t,e,n){var r=fh(t),i=[hl,dl].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[hl,Su].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function oot(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=oPe.reduce(function(u,f){return u[f]=iot(f,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const sot={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:oot};function aot(t){var e=t.state,n=t.name;e.modifiersData[n]=dPe({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const lot={name:"popperOffsets",enabled:!0,phase:"read",fn:aot,data:{}};function cot(t){return t==="x"?"y":"x"}function uot(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,g=p===void 0?0:p,m=oA(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=fh(e.placement),y=ES(e.placement),x=!y,b=Bee(v),w=cot(b),_=e.modifiersData.popperOffsets,S=e.rects.reference,O=e.rects.popper,k=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,E=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(_){if(o){var R,T=b==="y"?dl:hl,M=b==="y"?_u:Su,I=b==="y"?"height":"width",z=_[b],F=z+m[T],N=z-m[M],L=h?-O[I]/2:0,B=y===SS?S[I]:O[I],$=y===SS?-O[I]:-S[I],j=e.elements.arrow,X=h&&j?jee(j):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:lPe(),Y=V[T],le=V[M],K=QT(0,S[I],X[I]),ee=x?S[I]/2-L-K-Y-E.mainAxis:B-K-Y-E.mainAxis,re=x?-S[I]/2+L+K+le+E.mainAxis:$+K+le+E.mainAxis,me=e.elements.arrow&&MM(e.elements.arrow),te=me?b==="y"?me.clientTop||0:me.clientLeft||0:0,ae=(R=P==null?void 0:P[b])!=null?R:0,U=z+ee-ae-te,oe=z+re-ae,ne=QT(h?IF(F,U):F,z,h?Rx(N,oe):N);_[b]=ne,A[b]=ne-z}if(a){var G,q=b==="x"?dl:hl,Z=b==="x"?_u:Su,de=_[w],xe=w==="y"?"height":"width",H=de+m[q],W=de-m[Z],J=[dl,hl].indexOf(v)!==-1,se=(G=P==null?void 0:P[w])!=null?G:0,ye=J?H:de-S[xe]-O[xe]-se+E.altAxis,ie=J?de+S[xe]+O[xe]-se-E.altAxis:W,fe=h&&J?Iit(ye,de,ie):QT(h?ye:H,de,h?ie:W);_[w]=fe,A[w]=fe-de}e.modifiersData[r]=A}}const fot={name:"preventOverflow",enabled:!0,phase:"main",fn:uot,requiresIfExists:["offset"]};function dot(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function hot(t){return t===wc(t)||!uu(t)?Uee(t):dot(t)}function pot(t){var e=t.getBoundingClientRect(),n=CS(e.width)/t.offsetWidth||1,r=CS(e.height)/t.offsetHeight||1;return n!==1||r!==1}function got(t,e,n){n===void 0&&(n=!1);var r=uu(e),i=uu(e)&&pot(e),o=Dy(e),s=OS(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Th(e)!=="body"||Vee(o))&&(a=hot(e)),uu(e)?(l=OS(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Wee(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function mot(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 s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function vot(t){var e=mot(t);return kit.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function yot(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function xot(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 Ade={placement:"bottom",modifiers:[],strategy:"absolute"};function Pde(){for(var t=arguments.length,e=new Array(t),n=0;n{o||a(Sot(i)||document.body)},[i,o]),Ei(()=>{if(s&&!o)return JH(n,s),()=>{JH(n,null)}},[n,s,o]),o){if(D.isValidElement(r)){const c={ref:l};return D.cloneElement(r,c)}return C.jsx(D.Fragment,{children:r})}return C.jsx(D.Fragment,{children:s&&KC.createPortal(r,s)})});function Cot(t){return Xe("MuiPopper",t)}He("MuiPopper",["root"]);function Oot(t,e){if(e==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function sq(t){return typeof t=="function"?t():t}function Eot(t){return t.nodeType!==void 0}const Tot=t=>{const{classes:e}=t;return qe({root:["root"]},Cot,e)},kot={},Aot=D.forwardRef(function(e,n){const{anchorEl:r,children:i,direction:o,disablePortal:s,modifiers:a,open:l,placement:c,popperOptions:u,popperRef:f,slotProps:d={},slots:h={},TransitionProps:p,ownerState:g,...m}=e,v=D.useRef(null),y=dn(v,n),x=D.useRef(null),b=dn(x,f),w=D.useRef(b);Ei(()=>{w.current=b},[b]),D.useImperativeHandle(f,()=>x.current,[]);const _=Oot(c,o),[S,O]=D.useState(_),[k,E]=D.useState(sq(r));D.useEffect(()=>{x.current&&x.current.forceUpdate()}),D.useEffect(()=>{r&&E(sq(r))},[r]),Ei(()=>{if(!k||!l)return;const M=F=>{O(F.placement)};let I=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:F})=>{M(F)}}];a!=null&&(I=I.concat(a)),u&&u.modifiers!=null&&(I=I.concat(u.modifiers));const z=_ot(k,v.current,{placement:_,...u,modifiers:I});return w.current(z),()=>{z.destroy(),w.current(null)}},[k,s,a,l,u,_]);const P={placement:S};p!==null&&(P.TransitionProps=p);const A=Tot(e),R=h.root??"div",T=Zt({elementType:R,externalSlotProps:d.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:y},ownerState:e,className:A.root});return C.jsx(R,{...T,children:typeof i=="function"?i(P):i})}),Pot=D.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=kot,popperRef:h,style:p,transition:g=!1,slotProps:m={},slots:v={},...y}=e,[x,b]=D.useState(!0),w=()=>{b(!1)},_=()=>{b(!0)};if(!l&&!u&&(!g||x))return null;let S;if(o)S=o;else if(r){const E=sq(r);S=E&&Eot(E)?yi(E).body:yi(null).body}const O=!u&&l&&(!g||x)?"none":void 0,k=g?{in:u,onEnter:w,onExited:_}:void 0;return C.jsx(hPe,{disablePortal:a,container:S,children:C.jsx(Aot,{anchorEl:r,direction:s,disablePortal:a,modifiers:c,ref:n,open:g?!x:u,placement:f,popperOptions:d,popperRef:h,slotProps:m,slots:v,...y,style:{position:"fixed",top:0,left:0,display:O,...p},TransitionProps:k,children:i})})}),Mot=be(Pot,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Gee=D.forwardRef(function(e,n){const r=Eo(),i=_t({props:e,name:"MuiPopper"}),{anchorEl:o,component:s,components:a,componentsProps:l,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,slots:y,slotProps:x,...b}=i,w=(y==null?void 0:y.root)??(a==null?void 0:a.Root),_={anchorEl:o,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,...b};return C.jsx(Mot,{as:s,direction:r?"rtl":"ltr",slots:{root:w},slotProps:x??l,..._,ref:n})}),Rot=lt(C.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 Dot(t){return Xe("MuiChip",t)}const Sn=He("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","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"]),Iot=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=t,c={root:["root",l,n&&"disabled",`size${Me(r)}`,`color${Me(i)}`,a&&"clickable",a&&`clickableColor${Me(i)}`,s&&"deletable",s&&`deletableColor${Me(i)}`,`${l}${Me(i)}`],label:["label",`label${Me(r)}`],avatar:["avatar",`avatar${Me(r)}`,`avatarColor${Me(i)}`],icon:["icon",`icon${Me(r)}`,`iconColor${Me(o)}`],deleteIcon:["deleteIcon",`deleteIcon${Me(r)}`,`deleteIconColor${Me(i)}`,`deleteIcon${Me(l)}Color${Me(i)}`]};return qe(c,Dot,e)},Lot=be("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${Sn.avatar}`]:e.avatar},{[`& .${Sn.avatar}`]:e[`avatar${Me(a)}`]},{[`& .${Sn.avatar}`]:e[`avatarColor${Me(r)}`]},{[`& .${Sn.icon}`]:e.icon},{[`& .${Sn.icon}`]:e[`icon${Me(a)}`]},{[`& .${Sn.icon}`]:e[`iconColor${Me(i)}`]},{[`& .${Sn.deleteIcon}`]:e.deleteIcon},{[`& .${Sn.deleteIcon}`]:e[`deleteIcon${Me(a)}`]},{[`& .${Sn.deleteIcon}`]:e[`deleteIconColor${Me(r)}`]},{[`& .${Sn.deleteIcon}`]:e[`deleteIcon${Me(l)}Color${Me(r)}`]},e.root,e[`size${Me(a)}`],e[`color${Me(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${Me(r)})`],s&&e.deletable,s&&r!=="default"&&e[`deletableColor${Me(r)}`],e[l],e[`${l}${Me(r)}`]]}})(wt(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return{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",[`&.${Sn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Sn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:e,fontSize:t.typography.pxToRem(12)},[`& .${Sn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${Sn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${Sn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${Sn.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Sn.deleteIcon}`]:{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)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Sn.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Sn.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(t.palette).filter(pr(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(t.vars||t).palette[n].main,color:(t.vars||t).palette[n].contrastText,[`& .${Sn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].contrastTextChannel} / 0.7)`:kt(t.palette[n].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Sn.icon}`]:{color:t.vars?t.vars.palette.Chip.defaultIconColor:e}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Sn.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Sn.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)}}},...Object.entries(t.palette).filter(pr(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Sn.focusVisible}`]:{background:(t.vars||t).palette[n].dark}}})),{props:{clickable:!0},style:{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)},[`&.${Sn.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]}}},...Object.entries(t.palette).filter(pr(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Sn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[n].dark}}})),{props:{variant:"outlined"},style:{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]}`,[`&.${Sn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Sn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${Sn.avatar}`]:{marginLeft:4},[`& .${Sn.avatarSmall}`]:{marginLeft:2},[`& .${Sn.icon}`]:{marginLeft:4},[`& .${Sn.iconSmall}`]:{marginLeft:2},[`& .${Sn.deleteIcon}`]:{marginRight:5},[`& .${Sn.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(t.palette).filter(pr()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(t.vars||t).palette[n].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:kt(t.palette[n].main,.7)}`,[`&.${Sn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[n].main,t.palette.action.hoverOpacity)},[`&.${Sn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette[n].main,t.palette.action.focusOpacity)},[`& .${Sn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:kt(t.palette[n].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].main}}}}))]}})),$ot=be("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${Me(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function Mde(t){return t.key==="Backspace"||t.key==="Delete"}const pPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:h,onDelete:p,onKeyDown:g,onKeyUp:m,size:v="medium",variant:y="filled",tabIndex:x,skipFocusWhenDisabled:b=!1,...w}=r,_=D.useRef(null),S=dn(_,n),O=N=>{N.stopPropagation(),p&&p(N)},k=N=>{N.currentTarget===N.target&&Mde(N)&&N.preventDefault(),g&&g(N)},E=N=>{N.currentTarget===N.target&&p&&Mde(N)&&p(N),m&&m(N)},P=s!==!1&&h?!0:s,A=P||p?Ff:l||"div",R={...r,component:A,disabled:u,size:v,color:a,iconColor:D.isValidElement(f)&&f.props.color||a,onDelete:!!p,clickable:P,variant:y},T=Iot(R),M=A===Ff?{component:l||"div",focusVisibleClassName:T.focusVisible,...p&&{disableRipple:!0}}:{};let I=null;p&&(I=c&&D.isValidElement(c)?D.cloneElement(c,{className:Oe(c.props.className,T.deleteIcon),onClick:O}):C.jsx(Rot,{className:Oe(T.deleteIcon),onClick:O}));let z=null;i&&D.isValidElement(i)&&(z=D.cloneElement(i,{className:Oe(T.avatar,i.props.className)}));let F=null;return f&&D.isValidElement(f)&&(F=D.cloneElement(f,{className:Oe(T.icon,f.props.className)})),C.jsxs(Lot,{as:A,className:Oe(T.root,o),disabled:P&&u?!0:void 0,onClick:h,onKeyDown:k,onKeyUp:E,ref:S,tabIndex:b&&u?-1:x,ownerState:R,...M,...w,children:[z||F,C.jsx($ot,{className:Oe(T.label),ownerState:R,children:d}),I]})});function ZD(t){return parseInt(t,10)||0}const Fot={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Not(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const zot=D.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a,...l}=e,{current:c}=D.useRef(a!=null),u=D.useRef(null),f=dn(n,u),d=D.useRef(null),h=D.useRef(null),p=D.useCallback(()=>{const v=u.current,x=xc(v).getComputedStyle(v);if(x.width==="0px")return{outerHeightStyle:0,overflowing:!1};const b=h.current;b.style.width=x.width,b.value=v.value||e.placeholder||"x",b.value.slice(-1)===` -`&&(b.value+=" ");const w=x.boxSizing,_=ZD(x.paddingBottom)+ZD(x.paddingTop),S=ZD(x.borderBottomWidth)+ZD(x.borderTopWidth),O=b.scrollHeight;b.value="x";const k=b.scrollHeight;let E=O;o&&(E=Math.max(Number(o)*k,E)),i&&(E=Math.min(Number(i)*k,E)),E=Math.max(E,k);const P=E+(w==="border-box"?_+S:0),A=Math.abs(E-O)<=1;return{outerHeightStyle:P,overflowing:A}},[i,o,e.placeholder]),g=D.useCallback(()=>{const v=p();if(Not(v))return;const y=v.outerHeightStyle,x=u.current;d.current!==y&&(d.current=y,x.style.height=`${y}px`),x.style.overflow=v.overflowing?"hidden":""},[p]);Ei(()=>{const v=()=>{g()};let y;const x=TM(v),b=u.current,w=xc(b);w.addEventListener("resize",x);let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(v),_.observe(b)),()=>{x.clear(),cancelAnimationFrame(y),w.removeEventListener("resize",x),_&&_.disconnect()}},[p,g]),Ei(()=>{g()});const m=v=>{c||g(),r&&r(v)};return C.jsxs(D.Fragment,{children:[C.jsx("textarea",{value:a,onChange:m,ref:f,rows:o,style:s,...l}),C.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:h,tabIndex:-1,style:{...Fot.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function og(t){return typeof t=="string"}function Iy({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 m4=D.createContext(void 0);function Na(){return D.useContext(m4)}function Rde(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function LF(t,e=!1){return t&&(Rde(t.value)&&t.value!==""||e&&Rde(t.defaultValue)&&t.defaultValue!=="")}function jot(t){return t.startAdornment}function Bot(t){return Xe("MuiInputBase",t)}const TS=He("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Dde;const v4=(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${Me(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},y4=(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]},Uot=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=t,g={root:["root",`color${Me(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",d&&d!=="medium"&&`size${Me(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 qe(g,Bot,e)},x4=be("div",{name:"MuiInputBase",slot:"Root",overridesResolver:v4})(wt(({theme:t})=>({...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",[`&.${TS.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:n})=>e.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),b4=be("input",{name:"MuiInputBase",slot:"Input",overridesResolver:y4})(wt(({theme:t})=>{const e=t.palette.mode==="light",n={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},r={opacity:"0 !important"},i=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5};return{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%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${TS.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${TS.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:({ownerState:o})=>!o.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:o})=>o.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Ide=Ree({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Hee=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:o,autoFocus:s,className:a,color:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,error:g,fullWidth:m=!1,id:v,inputComponent:y="input",inputProps:x={},inputRef:b,margin:w,maxRows:_,minRows:S,multiline:O=!1,name:k,onBlur:E,onChange:P,onClick:A,onFocus:R,onKeyDown:T,onKeyUp:M,placeholder:I,readOnly:z,renderSuffix:F,rows:N,size:L,slotProps:B={},slots:$={},startAdornment:j,type:X="text",value:V,...Y}=r,le=x.value!=null?x.value:V,{current:K}=D.useRef(le!=null),ee=D.useRef(),re=D.useCallback(we=>{},[]),me=dn(ee,b,x.ref,re),[te,ae]=D.useState(!1),U=Na(),oe=Iy({props:r,muiFormControl:U,states:["color","disabled","error","hiddenLabel","size","required","filled"]});oe.focused=U?U.focused:te,D.useEffect(()=>{!U&&d&&te&&(ae(!1),E&&E())},[U,d,te,E]);const ne=U&&U.onFilled,G=U&&U.onEmpty,q=D.useCallback(we=>{LF(we)?ne&&ne():G&&G()},[ne,G]);Ei(()=>{K&&q({value:le})},[le,q,K]);const Z=we=>{R&&R(we),x.onFocus&&x.onFocus(we),U&&U.onFocus?U.onFocus(we):ae(!0)},de=we=>{E&&E(we),x.onBlur&&x.onBlur(we),U&&U.onBlur?U.onBlur(we):ae(!1)},xe=(we,...Ie)=>{if(!K){const Pe=we.target||ee.current;if(Pe==null)throw new Error(Mg(1));q({value:Pe.value})}x.onChange&&x.onChange(we,...Ie),P&&P(we,...Ie)};D.useEffect(()=>{q(ee.current)},[]);const H=we=>{ee.current&&we.currentTarget===we.target&&ee.current.focus(),A&&A(we)};let W=y,J=x;O&&W==="input"&&(N?J={type:void 0,minRows:N,maxRows:N,...J}:J={type:void 0,maxRows:_,minRows:S,...J},W=zot);const se=we=>{q(we.animationName==="mui-auto-fill-cancel"?ee.current:{value:"x"})};D.useEffect(()=>{U&&U.setAdornedStart(!!j)},[U,j]);const ye={...r,color:oe.color||"primary",disabled:oe.disabled,endAdornment:p,error:oe.error,focused:oe.focused,formControl:U,fullWidth:m,hiddenLabel:oe.hiddenLabel,multiline:O,size:oe.size,startAdornment:j,type:X},ie=Uot(ye),fe=$.root||c.Root||x4,Q=B.root||u.root||{},_e=$.input||c.Input||b4;return J={...J,...B.input??u.input},C.jsxs(D.Fragment,{children:[!h&&typeof Ide=="function"&&(Dde||(Dde=C.jsx(Ide,{}))),C.jsxs(fe,{...Q,ref:n,onClick:H,...Y,...!og(fe)&&{ownerState:{...ye,...Q.ownerState}},className:Oe(ie.root,Q.className,a,z&&"MuiInputBase-readOnly"),children:[j,C.jsx(m4.Provider,{value:null,children:C.jsx(_e,{"aria-invalid":oe.error,"aria-describedby":i,autoComplete:o,autoFocus:s,defaultValue:f,disabled:oe.disabled,id:v,onAnimationStart:se,name:k,placeholder:I,readOnly:z,required:oe.required,rows:N,value:le,onKeyDown:T,onKeyUp:M,type:X,...J,...!og(_e)&&{as:W,ownerState:{...ye,...J.ownerState}},ref:me,className:Oe(ie.input,J.className,z&&"MuiInputBase-readOnly"),onBlur:de,onChange:xe,onFocus:Z})}),p,F?F({...oe,startAdornment:j}):null]})]})});function Wot(t){return Xe("MuiInput",t)}const RE={...TS,...He("MuiInput",["root","underline","input"])};function Vot(t){return Xe("MuiOutlinedInput",t)}const md={...TS,...He("MuiOutlinedInput",["root","notchedOutline","input"])};function Got(t){return Xe("MuiFilledInput",t)}const p0={...TS,...He("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},Hot=lt(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),qot=lt(C.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 Xot(t){return Xe("MuiAvatar",t)}He("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const Yot=t=>{const{classes:e,variant:n,colorDefault:r}=t;return qe({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},Xot,e)},Qot=be("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],n.colorDefault&&e.colorDefault]}})(wt(({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:{color:(t.vars||t).palette.background.default,...t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:{backgroundColor:t.palette.grey[400],...t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})}}}]}))),Kot=be("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Zot=be(qot,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function Jot({crossOrigin:t,referrerPolicy:e,src:n,srcSet:r}){const[i,o]=D.useState(!1);return D.useEffect(()=>{if(!n&&!r)return;o(!1);let s=!0;const a=new Image;return a.onload=()=>{s&&o("loaded")},a.onerror=()=>{s&&o("error")},a.crossOrigin=t,a.referrerPolicy=e,a.src=n,r&&(a.srcset=r),()=>{s=!1}},[t,e,n,r]),i}const nW=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiAvatar"}),{alt:i,children:o,className:s,component:a="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:d,srcSet:h,variant:p="circular",...g}=r;let m=null;const v=Jot({...u,src:d,srcSet:h}),y=d||h,x=y&&v!=="error",b={...r,colorDefault:!x,component:a,variant:p};delete b.ownerState;const w=Yot(b),[_,S]=Jl("img",{className:w.img,elementType:Kot,externalForwardedProps:{slots:l,slotProps:{img:{...u,...c.img}}},additionalProps:{alt:i,src:d,srcSet:h,sizes:f},ownerState:b});return x?m=C.jsx(_,{...S}):o||o===0?m=o:y&&i?m=i[0]:m=C.jsx(Zot,{ownerState:b,className:w.fallback}),C.jsx(Qot,{as:a,className:Oe(w.root,s),ref:n,...g,ownerState:b,children:m})}),est={entering:{opacity:1},entered:{opacity:1}},eO=D.forwardRef(function(e,n){const r=To(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:h,onExited:p,onExiting:g,style:m,timeout:v=i,TransitionComponent:y=Rc,...x}=e,b=D.useRef(null),w=dn(b,Ry(a),n),_=T=>M=>{if(T){const I=b.current;M===void 0?T(I):T(I,M)}},S=_(d),O=_((T,M)=>{Fee(T);const I=Jv({style:m,timeout:v,easing:l},{mode:"enter"});T.style.webkitTransition=r.transitions.create("opacity",I),T.style.transition=r.transitions.create("opacity",I),u&&u(T,M)}),k=_(f),E=_(g),P=_(T=>{const M=Jv({style:m,timeout:v,easing:l},{mode:"exit"});T.style.webkitTransition=r.transitions.create("opacity",M),T.style.transition=r.transitions.create("opacity",M),h&&h(T)}),A=_(p),R=T=>{o&&o(b.current,T)};return C.jsx(y,{appear:s,in:c,nodeRef:b,onEnter:O,onEntered:k,onEntering:S,onExit:P,onExited:A,onExiting:E,addEndListener:R,timeout:v,...x,children:(T,M)=>D.cloneElement(a,{style:{opacity:0,visibility:T==="exited"&&!c?"hidden":void 0,...est[T],...m,...a.props.style},ref:w,...M})})});function tst(t){return Xe("MuiBackdrop",t)}He("MuiBackdrop",["root","invisible"]);const nst=t=>{const{ownerState:e,...n}=t;return n},rst=t=>{const{classes:e,invisible:n}=t;return qe({root:["root",n&&"invisible"]},tst,e)},ist=be("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})({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",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),gPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiBackdrop"}),{children:i,className:o,component:s="div",invisible:a=!1,open:l,components:c={},componentsProps:u={},slotProps:f={},slots:d={},TransitionComponent:h,transitionDuration:p,...g}=r,m={...r,component:s,invisible:a},v=rst(m),y={transition:h,root:c.Root,...d},x={...u,...f},b={slots:y,slotProps:x},[w,_]=Jl("root",{elementType:ist,externalForwardedProps:b,className:Oe(v.root,o),ownerState:m}),[S,O]=Jl("transition",{elementType:eO,externalForwardedProps:b,ownerState:m}),k=nst(O);return C.jsx(S,{in:l,timeout:p,...g,...k,children:C.jsx(w,{"aria-hidden":!0,..._,classes:v,ref:n,children:i})})}),ost=He("MuiBox",["root"]),sst=n4(),ot=tnt({themeId:Rf,defaultTheme:sst,defaultClassName:ost.root,generateClassName:kAe.generate});function ast(t){return Xe("MuiButton",t)}const W1=He("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"]),lst=D.createContext({}),cst=D.createContext(void 0),ust=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:s}=t,a={root:["root",o,`${o}${Me(e)}`,`size${Me(i)}`,`${o}Size${Me(i)}`,`color${Me(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${Me(i)}`],endIcon:["icon","endIcon",`iconSize${Me(i)}`]},l=qe(a,ast,s);return{...s,...l}},mPe=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],fst=be(Ff,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Me(n.color)}`],e[`size${Me(n.size)}`],e[`${n.variant}Size${Me(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(wt(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],n=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${W1.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${W1.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${W1.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${W1.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(pr()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(t.vars||t).palette[r].main,"--variant-outlinedColor":(t.vars||t).palette[r].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.5)`:kt(t.palette[r].main,.5),"--variant-containedColor":(t.vars||t).palette[r].contrastText,"--variant-containedBg":(t.vars||t).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[r].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[r].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[r].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[r].main,t.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:e,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${W1.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${W1.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}}]}})),dst=be("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${Me(n.size)}`]]}})({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},...mPe]}),hst=be("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${Me(n.size)}`]]}})({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},...mPe]}),Hr=D.forwardRef(function(e,n){const r=D.useContext(lst),i=D.useContext(cst),o=_S(r,e),s=_t({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:g,fullWidth:m=!1,size:v="medium",startIcon:y,type:x,variant:b="text",...w}=s,_={...s,color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:m,size:v,type:x,variant:b},S=ust(_),O=y&&C.jsx(dst,{className:S.startIcon,ownerState:_,children:y}),k=p&&C.jsx(hst,{className:S.endIcon,ownerState:_,children:p}),E=i||"";return C.jsxs(fst,{ownerState:_,className:Oe(r.className,S.root,u,E),component:c,disabled:f,focusRipple:!h,focusVisibleClassName:Oe(S.focusVisible,g),ref:n,type:x,...w,classes:S,children:[O,a,k]})});function pst(t){return Xe("MuiCard",t)}He("MuiCard",["root"]);const gst=t=>{const{classes:e}=t;return qe({root:["root"]},pst,e)},mst=be(kl,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})({overflow:"hidden"}),vPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=gst(a);return C.jsx(mst,{className:Oe(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function vst(t){return Xe("MuiCardActions",t)}He("MuiCardActions",["root","spacing"]);const yst=t=>{const{classes:e,disableSpacing:n}=t;return qe({root:["root",!n&&"spacing"]},vst,e)},xst=be("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),yPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o,...s}=r,a={...r,disableSpacing:i},l=yst(a);return C.jsx(xst,{className:Oe(l.root,o),ownerState:a,ref:n,...s})});function bst(t){return Xe("MuiCardContent",t)}He("MuiCardContent",["root"]);const wst=t=>{const{classes:e}=t;return qe({root:["root"]},bst,e)},_st=be("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:16,"&:last-child":{paddingBottom:24}}),xPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=wst(a);return C.jsx(_st,{as:o,className:Oe(l.root,i),ownerState:a,ref:n,...s})});function Sst(t){return Xe("MuiCardHeader",t)}const $F=He("MuiCardHeader",["root","avatar","action","content","title","subheader"]),Cst=t=>{const{classes:e}=t;return qe({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},Sst,e)},Ost=be("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>({[`& .${$F.title}`]:e.title,[`& .${$F.subheader}`]:e.subheader,...e.root})})({display:"flex",alignItems:"center",padding:16}),Est=be("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),Tst=be("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),kst=be("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto",[`.${DF.root}:where(& .${$F.title})`]:{display:"block"},[`.${DF.root}:where(& .${$F.subheader})`]:{display:"block"}}),Ast=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCardHeader"}),{action:i,avatar:o,className:s,component:a="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:f,titleTypographyProps:d,...h}=r,p={...r,component:a,disableTypography:l},g=Cst(p);let m=f;m!=null&&m.type!==Jt&&!l&&(m=C.jsx(Jt,{variant:o?"body2":"h5",className:g.title,component:"span",...d,children:m}));let v=c;return v!=null&&v.type!==Jt&&!l&&(v=C.jsx(Jt,{variant:o?"body2":"body1",className:g.subheader,color:"textSecondary",component:"span",...u,children:v})),C.jsxs(Ost,{className:Oe(g.root,s),as:a,ref:n,ownerState:p,...h,children:[o&&C.jsx(Est,{className:g.avatar,ownerState:p,children:o}),C.jsxs(kst,{className:g.content,ownerState:p,children:[m,v]}),i&&C.jsx(Tst,{className:g.action,ownerState:p,children:i})]})});function Pst(t){return Xe("MuiCardMedia",t)}He("MuiCardMedia",["root","media","img"]);const Mst=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return qe({root:["root",n&&"media",r&&"img"]},Pst,e)},Rst=be("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]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),Dst=["video","audio","picture","iframe","img"],Ist=["picture","img"],Lst=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCardMedia"}),{children:i,className:o,component:s="div",image:a,src:l,style:c,...u}=r,f=Dst.includes(s),d=!f&&a?{backgroundImage:`url("${a}")`,...c}:c,h={...r,component:s,isMediaComponent:f,isImageComponent:Ist.includes(s)},p=Mst(h);return C.jsx(Rst,{className:Oe(p.root,o),as:s,role:!f&&a?"img":void 0,ref:n,style:d,ownerState:h,src:f?a||l:void 0,...u,children:i})});function $st(t){return Xe("PrivateSwitchBase",t)}He("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Fst=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${Me(i)}`],input:["input"]};return qe(o,$st,e)},Nst=be(Ff)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:t,ownerState:e})=>t==="start"&&e.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:t,ownerState:e})=>t==="end"&&e.size!=="small",style:{marginRight:-12}}]}),zst=be("input",{shouldForwardProp:Xo})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),qee=D.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:s,defaultChecked:a,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:d,inputProps:h,inputRef:p,name:g,onBlur:m,onChange:v,onFocus:y,readOnly:x,required:b=!1,tabIndex:w,type:_,value:S,...O}=e,[k,E]=bc({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),P=Na(),A=N=>{y&&y(N),P&&P.onFocus&&P.onFocus(N)},R=N=>{m&&m(N),P&&P.onBlur&&P.onBlur(N)},T=N=>{if(N.nativeEvent.defaultPrevented)return;const L=N.target.checked;E(L),v&&v(N,L)};let M=l;P&&typeof M>"u"&&(M=P.disabled);const I=_==="checkbox"||_==="radio",z={...e,checked:k,disabled:M,disableFocusRipple:c,edge:u},F=Fst(z);return C.jsxs(Nst,{component:"span",className:Oe(F.root,s),centerRipple:!0,focusRipple:!c,disabled:M,tabIndex:null,role:void 0,onFocus:A,onBlur:R,ownerState:z,ref:n,...O,children:[C.jsx(zst,{autoFocus:r,checked:i,defaultChecked:a,className:F.input,disabled:M,id:I?d:void 0,name:g,onChange:T,readOnly:x,ref:p,required:b,ownerState:z,tabIndex:w,type:_,..._==="checkbox"&&S===void 0?{}:{value:S},...h}),k?o:f]})}),jst=lt(C.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"),Bst=lt(C.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"),Ust=lt(C.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 Wst(t){return Xe("MuiCheckbox",t)}const rW=He("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Vst=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${Me(r)}`,`size${Me(i)}`]},s=qe(o,Wst,e);return{...e,...s}},Gst=be(qee,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${Me(n.size)}`],n.color!=="default"&&e[`color${Me(n.color)}`]]}})(wt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{[`&.${rW.checked}, &.${rW.indeterminate}`]:{color:(t.vars||t).palette[e].main},[`&.${rW.disabled}`]:{color:(t.vars||t).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),Hst=C.jsx(Bst,{}),qst=C.jsx(jst,{}),Xst=C.jsx(Ust,{}),FF=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCheckbox"}),{checkedIcon:i=Hst,color:o="primary",icon:s=qst,indeterminate:a=!1,indeterminateIcon:l=Xst,inputProps:c,size:u="medium",disableRipple:f=!1,className:d,...h}=r,p=a?l:s,g=a?l:i,m={...r,disableRipple:f,color:o,indeterminate:a,size:u},v=Vst(m);return C.jsx(Gst,{type:"checkbox",inputProps:{"data-indeterminate":a,...c},icon:D.cloneElement(p,{fontSize:p.props.fontSize??u}),checkedIcon:D.cloneElement(g,{fontSize:g.props.fontSize??u}),ownerState:m,ref:n,className:Oe(v.root,d),disableRipple:f,...h,classes:v})});function Yst(t){return Xe("MuiCircularProgress",t)}He("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const cm=44,aq=My` +`,Zrt=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s,...a}=r,[l,c]=D.useState([]),u=D.useRef(0),f=D.useRef(null);D.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=D.useRef(!1),h=cv(),p=D.useRef(null),g=D.useRef(null),m=D.useCallback(b=>{const{pulsate:w,rippleX:_,rippleY:S,rippleSize:O,cb:k}=b;c(E=>[...E,C.jsx(Krt,{classes:{ripple:Oe(o.ripple,Wc.ripple),rippleVisible:Oe(o.rippleVisible,Wc.rippleVisible),ripplePulsate:Oe(o.ripplePulsate,Wc.ripplePulsate),child:Oe(o.child,Wc.child),childLeaving:Oe(o.childLeaving,Wc.childLeaving),childPulsate:Oe(o.childPulsate,Wc.childPulsate)},timeout:rq,pulsate:w,rippleX:_,rippleY:S,rippleSize:O},u.current)]),u.current+=1,f.current=k},[o]),v=D.useCallback((b={},w={},_=()=>{})=>{const{pulsate:S=!1,center:O=i||w.pulsate,fakeElement:k=!1}=w;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 E=k?null:g.current,P=E?E.getBoundingClientRect():{width:0,height:0,left:0,top:0};let A,R,T;if(O||b===void 0||b.clientX===0&&b.clientY===0||!b.clientX&&!b.touches)A=Math.round(P.width/2),R=Math.round(P.height/2);else{const{clientX:M,clientY:I}=b.touches&&b.touches.length>0?b.touches[0]:b;A=Math.round(M-P.left),R=Math.round(I-P.top)}if(O)T=Math.sqrt((2*P.width**2+P.height**2)/3),T%2===0&&(T+=1);else{const M=Math.max(Math.abs((E?E.clientWidth:0)-A),A)*2+2,I=Math.max(Math.abs((E?E.clientHeight:0)-R),R)*2+2;T=Math.sqrt(M**2+I**2)}b!=null&&b.touches?p.current===null&&(p.current=()=>{m({pulsate:S,rippleX:A,rippleY:R,rippleSize:T,cb:_})},h.start(Hrt,()=>{p.current&&(p.current(),p.current=null)})):m({pulsate:S,rippleX:A,rippleY:R,rippleSize:T,cb:_})},[i,m,h]),y=D.useCallback(()=>{v({},{pulsate:!0})},[v]),x=D.useCallback((b,w)=>{if(h.clear(),(b==null?void 0:b.type)==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{x(b,w)});return}p.current=null,c(_=>_.length>0?_.slice(1):_),f.current=w},[h]);return D.useImperativeHandle(n,()=>({pulsate:y,start:v,stop:x}),[y,v,x]),C.jsx(Qrt,{className:Oe(Wc.root,o.root,s),ref:g,...a,children:C.jsx(kM,{component:null,exit:!0,children:l})})});function Jrt(t){return Xe("MuiButtonBase",t)}const eit=He("MuiButtonBase",["root","disabled","focusVisible"]),tit=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,s=qe({root:["root",e&&"disabled",n&&"focusVisible"]},Jrt,i);return n&&r&&(s.root+=` ${r}`),s},nit=be("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"},[`&.${eit.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Ff=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:p="a",onBlur:g,onClick:m,onContextMenu:v,onDragLeave:y,onFocus:x,onFocusVisible:b,onKeyDown:w,onKeyUp:_,onMouseDown:S,onMouseLeave:O,onMouseUp:k,onTouchEnd:E,onTouchMove:P,onTouchStart:A,tabIndex:R=0,TouchRippleProps:T,touchRippleRef:M,type:I,...z}=r,F=D.useRef(null),N=Wrt(),L=dn(N.ref,M),[B,$]=D.useState(!1);c&&B&&$(!1),D.useImperativeHandle(i,()=>({focusVisible:()=>{$(!0),F.current.focus()}}),[]);const j=N.shouldMount&&!u&&!c;D.useEffect(()=>{B&&d&&!u&&N.pulsate()},[u,d,B,N]);function X(W,J,se=f){return st(ye=>(J&&J(ye),se||N[W](ye),!0))}const V=X("start",S),Y=X("stop",v),le=X("stop",y),K=X("stop",k),ee=X("stop",W=>{B&&W.preventDefault(),O&&O(W)}),re=X("start",A),me=X("stop",E),te=X("stop",P),ae=X("stop",W=>{Zv(W.target)||$(!1),g&&g(W)},!1),U=st(W=>{F.current||(F.current=W.currentTarget),Zv(W.target)&&($(!0),b&&b(W)),x&&x(W)}),oe=()=>{const W=F.current;return l&&l!=="button"&&!(W.tagName==="A"&&W.href)},ne=st(W=>{d&&!W.repeat&&B&&W.key===" "&&N.stop(W,()=>{N.start(W)}),W.target===W.currentTarget&&oe()&&W.key===" "&&W.preventDefault(),w&&w(W),W.target===W.currentTarget&&oe()&&W.key==="Enter"&&!c&&(W.preventDefault(),m&&m(W))}),G=st(W=>{d&&W.key===" "&&B&&!W.defaultPrevented&&N.stop(W,()=>{N.pulsate(W)}),_&&_(W),m&&W.target===W.currentTarget&&oe()&&W.key===" "&&!W.defaultPrevented&&m(W)});let q=l;q==="button"&&(z.href||z.to)&&(q=p);const Z={};q==="button"?(Z.type=I===void 0?"button":I,Z.disabled=c):(!z.href&&!z.to&&(Z.role="button"),c&&(Z["aria-disabled"]=c));const de=dn(n,F),xe={...r,centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:R,focusVisible:B},H=tit(xe);return C.jsxs(nit,{as:q,className:Oe(H.root,a),ownerState:xe,onBlur:ae,onClick:m,onContextMenu:Y,onFocus:U,onKeyDown:ne,onKeyUp:G,onMouseDown:V,onMouseLeave:ee,onMouseUp:K,onDragLeave:le,onTouchEnd:me,onTouchMove:te,onTouchStart:re,ref:de,tabIndex:c?-1:R,type:I,...Z,...z,children:[s,j?C.jsx(Zrt,{ref:L,center:o,...T}):null]})});function rit(t){return typeof t.main=="string"}function iit(t,e=[]){if(!rit(t))return!1;for(const n of e)if(!t.hasOwnProperty(n)||typeof t[n]!="string")return!1;return!0}function pr(t=[]){return([,e])=>e&&iit(e,t)}function oit(t){return Xe("MuiIconButton",t)}const sit=He("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),ait=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,s={root:["root",n&&"disabled",r!=="default"&&`color${Me(r)}`,i&&`edge${Me(i)}`,`size${Me(o)}`]};return qe(s,oit,e)},lit=be(Ff,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Me(n.color)}`],n.edge&&e[`edge${Me(n.edge)}`],e[`size${Me(n.size)}`]]}})(wt(({theme:t})=>({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),wt(({theme:t})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt((t.vars||t).palette[e].main,t.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${sit.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}}))),Gt=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",...f}=r,d={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,size:u},h=ait(d);return C.jsx(lit,{className:Oe(h.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:n,...f,ownerState:d,children:o})});function cit(t){return Xe("MuiTypography",t)}const DF=He("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),uit={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},fit=brt(),dit=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=t,a={root:["root",o,t.align!=="inherit"&&`align${Me(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return qe(a,cit,s)},hit=be("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${Me(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(wt(({theme:t})=>{var e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([n,r])=>n!=="inherit"&&r&&typeof r=="object").map(([n,r])=>({props:{variant:n},style:r})),...Object.entries(t.palette).filter(pr()).map(([n])=>({props:{color:n},style:{color:(t.vars||t).palette[n].main}})),...Object.entries(((e=t.palette)==null?void 0:e.text)||{}).filter(([,n])=>typeof n=="string").map(([n])=>({props:{color:`text${Me(n)}`},style:{color:(t.vars||t).palette.text[n]}})),{props:({ownerState:n})=>n.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:n})=>n.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:n})=>n.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:n})=>n.paragraph,style:{marginBottom:16}}]}})),bde={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Jt=D.forwardRef(function(e,n){const{color:r,...i}=_t({props:e,name:"MuiTypography"}),o=!uit[r],s=fit({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:f=!1,paragraph:d=!1,variant:h="body1",variantMapping:p=bde,...g}=s,m={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:f,paragraph:d,variant:h,variantMapping:p},v=c||(d?"p":p[h]||bde[h])||"span",y=dit(m);return C.jsx(hit,{as:v,ref:n,className:Oe(y.root,l),...g,ownerState:m,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...g.style}})});function pit(t){return Xe("MuiAppBar",t)}He("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const git=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${Me(e)}`,`position${Me(n)}`]};return qe(i,pit,r)},wde=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,mit=be(kl,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Me(n.position)}`],e[`color${Me(n.color)}`]]}})(wt(({theme:t})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[100],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[100]),...t.applyStyles("dark",{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[900],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[900])})}},...Object.entries(t.palette).filter(pr(["contrastText"])).map(([e])=>({props:{color:e},style:{"--AppBar-background":(t.vars??t).palette[e].main,"--AppBar-color":(t.vars??t).palette[e].contrastText}})),{props:e=>e.enableColorOnDark===!0&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>e.enableColorOnDark===!1&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundColor:t.vars?wde(t.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:t.vars?wde(t.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundImage:"none"})}}]}))),rPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=git(c);return C.jsx(mit,{square:!0,component:"header",ownerState:c,elevation:4,className:Oe(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});var dl="top",_u="bottom",Su="right",hl="left",Nee="auto",AM=[dl,_u,Su,hl],SS="start",rA="end",vit="clippingParents",iPe="viewport",PE="popper",yit="reference",_de=AM.reduce(function(t,e){return t.concat([e+"-"+SS,e+"-"+rA])},[]),oPe=[].concat(AM,[Nee]).reduce(function(t,e){return t.concat([e,e+"-"+SS,e+"-"+rA])},[]),xit="beforeRead",bit="read",wit="afterRead",_it="beforeMain",Sit="main",Cit="afterMain",Oit="beforeWrite",Eit="write",Tit="afterWrite",kit=[xit,bit,wit,_it,Sit,Cit,Oit,Eit,Tit];function Th(t){return t?(t.nodeName||"").toLowerCase():null}function wc(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ib(t){var e=wc(t).Element;return t instanceof e||t instanceof Element}function uu(t){var e=wc(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function zee(t){if(typeof ShadowRoot>"u")return!1;var e=wc(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Ait(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];!uu(o)||!Th(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function Pit(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]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!uu(i)||!Th(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Mit={name:"applyStyles",enabled:!0,phase:"write",fn:Ait,effect:Pit,requires:["computeStyles"]};function fh(t){return t.split("-")[0]}var Rx=Math.max,IF=Math.min,CS=Math.round;function iq(){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 sPe(){return!/^((?!chrome|android).)*safari/i.test(iq())}function OS(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&uu(t)&&(i=t.offsetWidth>0&&CS(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&CS(r.height)/t.offsetHeight||1);var s=ib(t)?wc(t):window,a=s.visualViewport,l=!sPe()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.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 jee(t){var e=OS(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 aPe(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&zee(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Rg(t){return wc(t).getComputedStyle(t)}function Rit(t){return["table","td","th"].indexOf(Th(t))>=0}function Dy(t){return((ib(t)?t.ownerDocument:t.document)||window.document).documentElement}function g4(t){return Th(t)==="html"?t:t.assignedSlot||t.parentNode||(zee(t)?t.host:null)||Dy(t)}function Sde(t){return!uu(t)||Rg(t).position==="fixed"?null:t.offsetParent}function Dit(t){var e=/firefox/i.test(iq()),n=/Trident/i.test(iq());if(n&&uu(t)){var r=Rg(t);if(r.position==="fixed")return null}var i=g4(t);for(zee(i)&&(i=i.host);uu(i)&&["html","body"].indexOf(Th(i))<0;){var o=Rg(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 PM(t){for(var e=wc(t),n=Sde(t);n&&Rit(n)&&Rg(n).position==="static";)n=Sde(n);return n&&(Th(n)==="html"||Th(n)==="body"&&Rg(n).position==="static")?e:n||Dit(t)||e}function Bee(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function YT(t,e,n){return Rx(t,IF(e,n))}function Iit(t,e,n){var r=YT(t,e,n);return r>n?n:r}function lPe(){return{top:0,right:0,bottom:0,left:0}}function cPe(t){return Object.assign({},lPe(),t)}function uPe(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Lit=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,cPe(typeof e!="number"?e:uPe(e,AM))};function $it(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=fh(n.placement),l=Bee(a),c=[hl,Su].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var f=Lit(i.padding,n),d=jee(o),h=l==="y"?dl:hl,p=l==="y"?_u:Su,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=PM(o),y=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,x=g/2-m/2,b=f[h],w=y-d[u]-f[p],_=y/2-d[u]/2+x,S=YT(b,_,w),O=l;n.modifiersData[r]=(e={},e[O]=S,e.centerOffset=S-_,e)}}function Fit(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)||aPe(e.elements.popper,i)&&(e.elements.arrow=i))}const Nit={name:"arrow",enabled:!0,phase:"main",fn:$it,effect:Fit,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ES(t){return t.split("-")[1]}var zit={top:"auto",right:"auto",bottom:"auto",left:"auto"};function jit(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:CS(n*i)/i||0,y:CS(r*i)/i||0}}function Cde(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,g=p===void 0?0:p,m=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),x=hl,b=dl,w=window;if(c){var _=PM(n),S="clientHeight",O="clientWidth";if(_===wc(n)&&(_=Dy(n),Rg(_).position!=="static"&&a==="absolute"&&(S="scrollHeight",O="scrollWidth")),_=_,i===dl||(i===hl||i===Su)&&o===rA){b=_u;var k=f&&_===w&&w.visualViewport?w.visualViewport.height:_[S];g-=k-r.height,g*=l?1:-1}if(i===hl||(i===dl||i===_u)&&o===rA){x=Su;var E=f&&_===w&&w.visualViewport?w.visualViewport.width:_[O];h-=E-r.width,h*=l?1:-1}}var P=Object.assign({position:a},c&&zit),A=u===!0?jit({x:h,y:g},wc(n)):{x:h,y:g};if(h=A.x,g=A.y,l){var R;return Object.assign({},P,(R={},R[b]=y?"0":"",R[x]=v?"0":"",R.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",R))}return Object.assign({},P,(e={},e[b]=y?g+"px":"",e[x]=v?h+"px":"",e.transform="",e))}function Bit(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:fh(e.placement),variation:ES(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,Cde(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Cde(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 Uit={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Bit,data:{}};var KD={passive:!0};function Wit(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=wc(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,KD)}),a&&l.addEventListener("resize",n.update,KD),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,KD)}),a&&l.removeEventListener("resize",n.update,KD)}}const Vit={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Wit,data:{}};var Git={left:"right",right:"left",bottom:"top",top:"bottom"};function o3(t){return t.replace(/left|right|bottom|top/g,function(e){return Git[e]})}var Hit={start:"end",end:"start"};function Ode(t){return t.replace(/start|end/g,function(e){return Hit[e]})}function Uee(t){var e=wc(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Wee(t){return OS(Dy(t)).left+Uee(t).scrollLeft}function qit(t,e){var n=wc(t),r=Dy(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=sPe();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Wee(t),y:l}}function Xit(t){var e,n=Dy(t),r=Uee(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Rx(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Rx(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Wee(t),l=-r.scrollTop;return Rg(i||n).direction==="rtl"&&(a+=Rx(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Vee(t){var e=Rg(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function fPe(t){return["html","body","#document"].indexOf(Th(t))>=0?t.ownerDocument.body:uu(t)&&Vee(t)?t:fPe(g4(t))}function QT(t,e){var n;e===void 0&&(e=[]);var r=fPe(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=wc(r),s=i?[o].concat(o.visualViewport||[],Vee(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(QT(g4(s)))}function oq(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Yit(t,e){var n=OS(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 Ede(t,e,n){return e===iPe?oq(qit(t,n)):ib(e)?Yit(e,n):oq(Xit(Dy(t)))}function Qit(t){var e=QT(g4(t)),n=["absolute","fixed"].indexOf(Rg(t).position)>=0,r=n&&uu(t)?PM(t):t;return ib(r)?e.filter(function(i){return ib(i)&&aPe(i,r)&&Th(i)!=="body"}):[]}function Kit(t,e,n,r){var i=e==="clippingParents"?Qit(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=Ede(t,c,r);return l.top=Rx(u.top,l.top),l.right=IF(u.right,l.right),l.bottom=IF(u.bottom,l.bottom),l.left=Rx(u.left,l.left),l},Ede(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function dPe(t){var e=t.reference,n=t.element,r=t.placement,i=r?fh(r):null,o=r?ES(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case dl:l={x:s,y:e.y-n.height};break;case _u:l={x:s,y:e.y+e.height};break;case Su:l={x:e.x+e.width,y:a};break;case hl:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?Bee(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case SS:l[c]=l[c]-(e[u]/2-n[u]/2);break;case rA:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function iA(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?vit:a,c=n.rootBoundary,u=c===void 0?iPe:c,f=n.elementContext,d=f===void 0?PE:f,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,m=g===void 0?0:g,v=cPe(typeof m!="number"?m:uPe(m,AM)),y=d===PE?yit:PE,x=t.rects.popper,b=t.elements[p?y:d],w=Kit(ib(b)?b:b.contextElement||Dy(t.elements.popper),l,u,s),_=OS(t.elements.reference),S=dPe({reference:_,element:x,strategy:"absolute",placement:i}),O=oq(Object.assign({},x,S)),k=d===PE?O:_,E={top:w.top-k.top+v.top,bottom:k.bottom-w.bottom+v.bottom,left:w.left-k.left+v.left,right:k.right-w.right+v.right},P=t.modifiersData.offset;if(d===PE&&P){var A=P[i];Object.keys(E).forEach(function(R){var T=[Su,_u].indexOf(R)>=0?1:-1,M=[dl,_u].indexOf(R)>=0?"y":"x";E[R]+=A[M]*T})}return E}function Zit(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?oPe:l,u=ES(r),f=u?a?_de:_de.filter(function(p){return ES(p)===u}):AM,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,g){return p[g]=iA(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[fh(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function Jit(t){if(fh(t)===Nee)return[];var e=o3(t);return[Ode(t),e,Ode(e)]}function eot(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,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,m=e.options.placement,v=fh(m),y=v===m,x=l||(y||!p?[o3(m)]:Jit(m)),b=[m].concat(x).reduce(function(X,V){return X.concat(fh(V)===Nee?Zit(e,{placement:V,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):V)},[]),w=e.rects.reference,_=e.rects.popper,S=new Map,O=!0,k=b[0],E=0;E=0,M=T?"width":"height",I=iA(e,{placement:P,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),z=T?R?Su:hl:R?_u:dl;w[M]>_[M]&&(z=o3(z));var F=o3(z),N=[];if(o&&N.push(I[A]<=0),a&&N.push(I[z]<=0,I[F]<=0),N.every(function(X){return X})){k=P,O=!1;break}S.set(P,N)}if(O)for(var L=p?3:1,B=function(V){var Y=b.find(function(le){var K=S.get(le);if(K)return K.slice(0,V).every(function(ee){return ee})});if(Y)return k=Y,"break"},$=L;$>0;$--){var j=B($);if(j==="break")break}e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}}const tot={name:"flip",enabled:!0,phase:"main",fn:eot,requiresIfExists:["offset"],data:{_skip:!1}};function Tde(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 kde(t){return[dl,Su,_u,hl].some(function(e){return t[e]>=0})}function not(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=iA(e,{elementContext:"reference"}),a=iA(e,{altBoundary:!0}),l=Tde(s,r),c=Tde(a,i,o),u=kde(l),f=kde(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 rot={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:not};function iot(t,e,n){var r=fh(t),i=[hl,dl].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[hl,Su].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function oot(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=oPe.reduce(function(u,f){return u[f]=iot(f,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const sot={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:oot};function aot(t){var e=t.state,n=t.name;e.modifiersData[n]=dPe({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const lot={name:"popperOffsets",enabled:!0,phase:"read",fn:aot,data:{}};function cot(t){return t==="x"?"y":"x"}function uot(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,g=p===void 0?0:p,m=iA(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=fh(e.placement),y=ES(e.placement),x=!y,b=Bee(v),w=cot(b),_=e.modifiersData.popperOffsets,S=e.rects.reference,O=e.rects.popper,k=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,E=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(_){if(o){var R,T=b==="y"?dl:hl,M=b==="y"?_u:Su,I=b==="y"?"height":"width",z=_[b],F=z+m[T],N=z-m[M],L=h?-O[I]/2:0,B=y===SS?S[I]:O[I],$=y===SS?-O[I]:-S[I],j=e.elements.arrow,X=h&&j?jee(j):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:lPe(),Y=V[T],le=V[M],K=YT(0,S[I],X[I]),ee=x?S[I]/2-L-K-Y-E.mainAxis:B-K-Y-E.mainAxis,re=x?-S[I]/2+L+K+le+E.mainAxis:$+K+le+E.mainAxis,me=e.elements.arrow&&PM(e.elements.arrow),te=me?b==="y"?me.clientTop||0:me.clientLeft||0:0,ae=(R=P==null?void 0:P[b])!=null?R:0,U=z+ee-ae-te,oe=z+re-ae,ne=YT(h?IF(F,U):F,z,h?Rx(N,oe):N);_[b]=ne,A[b]=ne-z}if(a){var G,q=b==="x"?dl:hl,Z=b==="x"?_u:Su,de=_[w],xe=w==="y"?"height":"width",H=de+m[q],W=de-m[Z],J=[dl,hl].indexOf(v)!==-1,se=(G=P==null?void 0:P[w])!=null?G:0,ye=J?H:de-S[xe]-O[xe]-se+E.altAxis,ie=J?de+S[xe]+O[xe]-se-E.altAxis:W,fe=h&&J?Iit(ye,de,ie):YT(h?ye:H,de,h?ie:W);_[w]=fe,A[w]=fe-de}e.modifiersData[r]=A}}const fot={name:"preventOverflow",enabled:!0,phase:"main",fn:uot,requiresIfExists:["offset"]};function dot(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function hot(t){return t===wc(t)||!uu(t)?Uee(t):dot(t)}function pot(t){var e=t.getBoundingClientRect(),n=CS(e.width)/t.offsetWidth||1,r=CS(e.height)/t.offsetHeight||1;return n!==1||r!==1}function got(t,e,n){n===void 0&&(n=!1);var r=uu(e),i=uu(e)&&pot(e),o=Dy(e),s=OS(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Th(e)!=="body"||Vee(o))&&(a=hot(e)),uu(e)?(l=OS(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Wee(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function mot(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 s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function vot(t){var e=mot(t);return kit.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function yot(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function xot(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 Ade={placement:"bottom",modifiers:[],strategy:"absolute"};function Pde(){for(var t=arguments.length,e=new Array(t),n=0;n{o||a(Sot(i)||document.body)},[i,o]),Ei(()=>{if(s&&!o)return JH(n,s),()=>{JH(n,null)}},[n,s,o]),o){if(D.isValidElement(r)){const c={ref:l};return D.cloneElement(r,c)}return C.jsx(D.Fragment,{children:r})}return C.jsx(D.Fragment,{children:s&&KC.createPortal(r,s)})});function Cot(t){return Xe("MuiPopper",t)}He("MuiPopper",["root"]);function Oot(t,e){if(e==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function sq(t){return typeof t=="function"?t():t}function Eot(t){return t.nodeType!==void 0}const Tot=t=>{const{classes:e}=t;return qe({root:["root"]},Cot,e)},kot={},Aot=D.forwardRef(function(e,n){const{anchorEl:r,children:i,direction:o,disablePortal:s,modifiers:a,open:l,placement:c,popperOptions:u,popperRef:f,slotProps:d={},slots:h={},TransitionProps:p,ownerState:g,...m}=e,v=D.useRef(null),y=dn(v,n),x=D.useRef(null),b=dn(x,f),w=D.useRef(b);Ei(()=>{w.current=b},[b]),D.useImperativeHandle(f,()=>x.current,[]);const _=Oot(c,o),[S,O]=D.useState(_),[k,E]=D.useState(sq(r));D.useEffect(()=>{x.current&&x.current.forceUpdate()}),D.useEffect(()=>{r&&E(sq(r))},[r]),Ei(()=>{if(!k||!l)return;const M=F=>{O(F.placement)};let I=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:F})=>{M(F)}}];a!=null&&(I=I.concat(a)),u&&u.modifiers!=null&&(I=I.concat(u.modifiers));const z=_ot(k,v.current,{placement:_,...u,modifiers:I});return w.current(z),()=>{z.destroy(),w.current(null)}},[k,s,a,l,u,_]);const P={placement:S};p!==null&&(P.TransitionProps=p);const A=Tot(e),R=h.root??"div",T=Zt({elementType:R,externalSlotProps:d.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:y},ownerState:e,className:A.root});return C.jsx(R,{...T,children:typeof i=="function"?i(P):i})}),Pot=D.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=kot,popperRef:h,style:p,transition:g=!1,slotProps:m={},slots:v={},...y}=e,[x,b]=D.useState(!0),w=()=>{b(!1)},_=()=>{b(!0)};if(!l&&!u&&(!g||x))return null;let S;if(o)S=o;else if(r){const E=sq(r);S=E&&Eot(E)?yi(E).body:yi(null).body}const O=!u&&l&&(!g||x)?"none":void 0,k=g?{in:u,onEnter:w,onExited:_}:void 0;return C.jsx(hPe,{disablePortal:a,container:S,children:C.jsx(Aot,{anchorEl:r,direction:s,disablePortal:a,modifiers:c,ref:n,open:g?!x:u,placement:f,popperOptions:d,popperRef:h,slotProps:m,slots:v,...y,style:{position:"fixed",top:0,left:0,display:O,...p},TransitionProps:k,children:i})})}),Mot=be(Pot,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Gee=D.forwardRef(function(e,n){const r=Eo(),i=_t({props:e,name:"MuiPopper"}),{anchorEl:o,component:s,components:a,componentsProps:l,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,slots:y,slotProps:x,...b}=i,w=(y==null?void 0:y.root)??(a==null?void 0:a.Root),_={anchorEl:o,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,...b};return C.jsx(Mot,{as:s,direction:r?"rtl":"ltr",slots:{root:w},slotProps:x??l,..._,ref:n})}),Rot=lt(C.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 Dot(t){return Xe("MuiChip",t)}const Sn=He("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","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"]),Iot=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=t,c={root:["root",l,n&&"disabled",`size${Me(r)}`,`color${Me(i)}`,a&&"clickable",a&&`clickableColor${Me(i)}`,s&&"deletable",s&&`deletableColor${Me(i)}`,`${l}${Me(i)}`],label:["label",`label${Me(r)}`],avatar:["avatar",`avatar${Me(r)}`,`avatarColor${Me(i)}`],icon:["icon",`icon${Me(r)}`,`iconColor${Me(o)}`],deleteIcon:["deleteIcon",`deleteIcon${Me(r)}`,`deleteIconColor${Me(i)}`,`deleteIcon${Me(l)}Color${Me(i)}`]};return qe(c,Dot,e)},Lot=be("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${Sn.avatar}`]:e.avatar},{[`& .${Sn.avatar}`]:e[`avatar${Me(a)}`]},{[`& .${Sn.avatar}`]:e[`avatarColor${Me(r)}`]},{[`& .${Sn.icon}`]:e.icon},{[`& .${Sn.icon}`]:e[`icon${Me(a)}`]},{[`& .${Sn.icon}`]:e[`iconColor${Me(i)}`]},{[`& .${Sn.deleteIcon}`]:e.deleteIcon},{[`& .${Sn.deleteIcon}`]:e[`deleteIcon${Me(a)}`]},{[`& .${Sn.deleteIcon}`]:e[`deleteIconColor${Me(r)}`]},{[`& .${Sn.deleteIcon}`]:e[`deleteIcon${Me(l)}Color${Me(r)}`]},e.root,e[`size${Me(a)}`],e[`color${Me(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${Me(r)})`],s&&e.deletable,s&&r!=="default"&&e[`deletableColor${Me(r)}`],e[l],e[`${l}${Me(r)}`]]}})(wt(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return{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",[`&.${Sn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Sn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:e,fontSize:t.typography.pxToRem(12)},[`& .${Sn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${Sn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${Sn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${Sn.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Sn.deleteIcon}`]:{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)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Sn.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Sn.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(t.palette).filter(pr(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(t.vars||t).palette[n].main,color:(t.vars||t).palette[n].contrastText,[`& .${Sn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].contrastTextChannel} / 0.7)`:kt(t.palette[n].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Sn.icon}`]:{color:t.vars?t.vars.palette.Chip.defaultIconColor:e}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Sn.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Sn.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)}}},...Object.entries(t.palette).filter(pr(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Sn.focusVisible}`]:{background:(t.vars||t).palette[n].dark}}})),{props:{clickable:!0},style:{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)},[`&.${Sn.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]}}},...Object.entries(t.palette).filter(pr(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Sn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[n].dark}}})),{props:{variant:"outlined"},style:{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]}`,[`&.${Sn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Sn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${Sn.avatar}`]:{marginLeft:4},[`& .${Sn.avatarSmall}`]:{marginLeft:2},[`& .${Sn.icon}`]:{marginLeft:4},[`& .${Sn.iconSmall}`]:{marginLeft:2},[`& .${Sn.deleteIcon}`]:{marginRight:5},[`& .${Sn.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(t.palette).filter(pr()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(t.vars||t).palette[n].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:kt(t.palette[n].main,.7)}`,[`&.${Sn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[n].main,t.palette.action.hoverOpacity)},[`&.${Sn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette[n].main,t.palette.action.focusOpacity)},[`& .${Sn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:kt(t.palette[n].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].main}}}}))]}})),$ot=be("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${Me(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function Mde(t){return t.key==="Backspace"||t.key==="Delete"}const pPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:h,onDelete:p,onKeyDown:g,onKeyUp:m,size:v="medium",variant:y="filled",tabIndex:x,skipFocusWhenDisabled:b=!1,...w}=r,_=D.useRef(null),S=dn(_,n),O=N=>{N.stopPropagation(),p&&p(N)},k=N=>{N.currentTarget===N.target&&Mde(N)&&N.preventDefault(),g&&g(N)},E=N=>{N.currentTarget===N.target&&p&&Mde(N)&&p(N),m&&m(N)},P=s!==!1&&h?!0:s,A=P||p?Ff:l||"div",R={...r,component:A,disabled:u,size:v,color:a,iconColor:D.isValidElement(f)&&f.props.color||a,onDelete:!!p,clickable:P,variant:y},T=Iot(R),M=A===Ff?{component:l||"div",focusVisibleClassName:T.focusVisible,...p&&{disableRipple:!0}}:{};let I=null;p&&(I=c&&D.isValidElement(c)?D.cloneElement(c,{className:Oe(c.props.className,T.deleteIcon),onClick:O}):C.jsx(Rot,{className:Oe(T.deleteIcon),onClick:O}));let z=null;i&&D.isValidElement(i)&&(z=D.cloneElement(i,{className:Oe(T.avatar,i.props.className)}));let F=null;return f&&D.isValidElement(f)&&(F=D.cloneElement(f,{className:Oe(T.icon,f.props.className)})),C.jsxs(Lot,{as:A,className:Oe(T.root,o),disabled:P&&u?!0:void 0,onClick:h,onKeyDown:k,onKeyUp:E,ref:S,tabIndex:b&&u?-1:x,ownerState:R,...M,...w,children:[z||F,C.jsx($ot,{className:Oe(T.label),ownerState:R,children:d}),I]})});function ZD(t){return parseInt(t,10)||0}const Fot={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Not(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const zot=D.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a,...l}=e,{current:c}=D.useRef(a!=null),u=D.useRef(null),f=dn(n,u),d=D.useRef(null),h=D.useRef(null),p=D.useCallback(()=>{const v=u.current,x=xc(v).getComputedStyle(v);if(x.width==="0px")return{outerHeightStyle:0,overflowing:!1};const b=h.current;b.style.width=x.width,b.value=v.value||e.placeholder||"x",b.value.slice(-1)===` +`&&(b.value+=" ");const w=x.boxSizing,_=ZD(x.paddingBottom)+ZD(x.paddingTop),S=ZD(x.borderBottomWidth)+ZD(x.borderTopWidth),O=b.scrollHeight;b.value="x";const k=b.scrollHeight;let E=O;o&&(E=Math.max(Number(o)*k,E)),i&&(E=Math.min(Number(i)*k,E)),E=Math.max(E,k);const P=E+(w==="border-box"?_+S:0),A=Math.abs(E-O)<=1;return{outerHeightStyle:P,overflowing:A}},[i,o,e.placeholder]),g=D.useCallback(()=>{const v=p();if(Not(v))return;const y=v.outerHeightStyle,x=u.current;d.current!==y&&(d.current=y,x.style.height=`${y}px`),x.style.overflow=v.overflowing?"hidden":""},[p]);Ei(()=>{const v=()=>{g()};let y;const x=EM(v),b=u.current,w=xc(b);w.addEventListener("resize",x);let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(v),_.observe(b)),()=>{x.clear(),cancelAnimationFrame(y),w.removeEventListener("resize",x),_&&_.disconnect()}},[p,g]),Ei(()=>{g()});const m=v=>{c||g(),r&&r(v)};return C.jsxs(D.Fragment,{children:[C.jsx("textarea",{value:a,onChange:m,ref:f,rows:o,style:s,...l}),C.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:h,tabIndex:-1,style:{...Fot.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function og(t){return typeof t=="string"}function Iy({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 m4=D.createContext(void 0);function Na(){return D.useContext(m4)}function Rde(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function LF(t,e=!1){return t&&(Rde(t.value)&&t.value!==""||e&&Rde(t.defaultValue)&&t.defaultValue!=="")}function jot(t){return t.startAdornment}function Bot(t){return Xe("MuiInputBase",t)}const TS=He("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Dde;const v4=(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${Me(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},y4=(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]},Uot=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=t,g={root:["root",`color${Me(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",d&&d!=="medium"&&`size${Me(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 qe(g,Bot,e)},x4=be("div",{name:"MuiInputBase",slot:"Root",overridesResolver:v4})(wt(({theme:t})=>({...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",[`&.${TS.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:n})=>e.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),b4=be("input",{name:"MuiInputBase",slot:"Input",overridesResolver:y4})(wt(({theme:t})=>{const e=t.palette.mode==="light",n={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},r={opacity:"0 !important"},i=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5};return{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%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${TS.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${TS.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:({ownerState:o})=>!o.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:o})=>o.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Ide=Ree({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Hee=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:o,autoFocus:s,className:a,color:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,error:g,fullWidth:m=!1,id:v,inputComponent:y="input",inputProps:x={},inputRef:b,margin:w,maxRows:_,minRows:S,multiline:O=!1,name:k,onBlur:E,onChange:P,onClick:A,onFocus:R,onKeyDown:T,onKeyUp:M,placeholder:I,readOnly:z,renderSuffix:F,rows:N,size:L,slotProps:B={},slots:$={},startAdornment:j,type:X="text",value:V,...Y}=r,le=x.value!=null?x.value:V,{current:K}=D.useRef(le!=null),ee=D.useRef(),re=D.useCallback(we=>{},[]),me=dn(ee,b,x.ref,re),[te,ae]=D.useState(!1),U=Na(),oe=Iy({props:r,muiFormControl:U,states:["color","disabled","error","hiddenLabel","size","required","filled"]});oe.focused=U?U.focused:te,D.useEffect(()=>{!U&&d&&te&&(ae(!1),E&&E())},[U,d,te,E]);const ne=U&&U.onFilled,G=U&&U.onEmpty,q=D.useCallback(we=>{LF(we)?ne&&ne():G&&G()},[ne,G]);Ei(()=>{K&&q({value:le})},[le,q,K]);const Z=we=>{R&&R(we),x.onFocus&&x.onFocus(we),U&&U.onFocus?U.onFocus(we):ae(!0)},de=we=>{E&&E(we),x.onBlur&&x.onBlur(we),U&&U.onBlur?U.onBlur(we):ae(!1)},xe=(we,...Ie)=>{if(!K){const Pe=we.target||ee.current;if(Pe==null)throw new Error(Mg(1));q({value:Pe.value})}x.onChange&&x.onChange(we,...Ie),P&&P(we,...Ie)};D.useEffect(()=>{q(ee.current)},[]);const H=we=>{ee.current&&we.currentTarget===we.target&&ee.current.focus(),A&&A(we)};let W=y,J=x;O&&W==="input"&&(N?J={type:void 0,minRows:N,maxRows:N,...J}:J={type:void 0,maxRows:_,minRows:S,...J},W=zot);const se=we=>{q(we.animationName==="mui-auto-fill-cancel"?ee.current:{value:"x"})};D.useEffect(()=>{U&&U.setAdornedStart(!!j)},[U,j]);const ye={...r,color:oe.color||"primary",disabled:oe.disabled,endAdornment:p,error:oe.error,focused:oe.focused,formControl:U,fullWidth:m,hiddenLabel:oe.hiddenLabel,multiline:O,size:oe.size,startAdornment:j,type:X},ie=Uot(ye),fe=$.root||c.Root||x4,Q=B.root||u.root||{},_e=$.input||c.Input||b4;return J={...J,...B.input??u.input},C.jsxs(D.Fragment,{children:[!h&&typeof Ide=="function"&&(Dde||(Dde=C.jsx(Ide,{}))),C.jsxs(fe,{...Q,ref:n,onClick:H,...Y,...!og(fe)&&{ownerState:{...ye,...Q.ownerState}},className:Oe(ie.root,Q.className,a,z&&"MuiInputBase-readOnly"),children:[j,C.jsx(m4.Provider,{value:null,children:C.jsx(_e,{"aria-invalid":oe.error,"aria-describedby":i,autoComplete:o,autoFocus:s,defaultValue:f,disabled:oe.disabled,id:v,onAnimationStart:se,name:k,placeholder:I,readOnly:z,required:oe.required,rows:N,value:le,onKeyDown:T,onKeyUp:M,type:X,...J,...!og(_e)&&{as:W,ownerState:{...ye,...J.ownerState}},ref:me,className:Oe(ie.input,J.className,z&&"MuiInputBase-readOnly"),onBlur:de,onChange:xe,onFocus:Z})}),p,F?F({...oe,startAdornment:j}):null]})]})});function Wot(t){return Xe("MuiInput",t)}const ME={...TS,...He("MuiInput",["root","underline","input"])};function Vot(t){return Xe("MuiOutlinedInput",t)}const md={...TS,...He("MuiOutlinedInput",["root","notchedOutline","input"])};function Got(t){return Xe("MuiFilledInput",t)}const p0={...TS,...He("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},Hot=lt(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),qot=lt(C.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 Xot(t){return Xe("MuiAvatar",t)}He("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const Yot=t=>{const{classes:e,variant:n,colorDefault:r}=t;return qe({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},Xot,e)},Qot=be("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],n.colorDefault&&e.colorDefault]}})(wt(({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:{color:(t.vars||t).palette.background.default,...t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:{backgroundColor:t.palette.grey[400],...t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})}}}]}))),Kot=be("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Zot=be(qot,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function Jot({crossOrigin:t,referrerPolicy:e,src:n,srcSet:r}){const[i,o]=D.useState(!1);return D.useEffect(()=>{if(!n&&!r)return;o(!1);let s=!0;const a=new Image;return a.onload=()=>{s&&o("loaded")},a.onerror=()=>{s&&o("error")},a.crossOrigin=t,a.referrerPolicy=e,a.src=n,r&&(a.srcset=r),()=>{s=!1}},[t,e,n,r]),i}const nW=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiAvatar"}),{alt:i,children:o,className:s,component:a="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:d,srcSet:h,variant:p="circular",...g}=r;let m=null;const v=Jot({...u,src:d,srcSet:h}),y=d||h,x=y&&v!=="error",b={...r,colorDefault:!x,component:a,variant:p};delete b.ownerState;const w=Yot(b),[_,S]=Jl("img",{className:w.img,elementType:Kot,externalForwardedProps:{slots:l,slotProps:{img:{...u,...c.img}}},additionalProps:{alt:i,src:d,srcSet:h,sizes:f},ownerState:b});return x?m=C.jsx(_,{...S}):o||o===0?m=o:y&&i?m=i[0]:m=C.jsx(Zot,{ownerState:b,className:w.fallback}),C.jsx(Qot,{as:a,className:Oe(w.root,s),ref:n,...g,ownerState:b,children:m})}),est={entering:{opacity:1},entered:{opacity:1}},eO=D.forwardRef(function(e,n){const r=To(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:h,onExited:p,onExiting:g,style:m,timeout:v=i,TransitionComponent:y=Rc,...x}=e,b=D.useRef(null),w=dn(b,Ry(a),n),_=T=>M=>{if(T){const I=b.current;M===void 0?T(I):T(I,M)}},S=_(d),O=_((T,M)=>{Fee(T);const I=Jv({style:m,timeout:v,easing:l},{mode:"enter"});T.style.webkitTransition=r.transitions.create("opacity",I),T.style.transition=r.transitions.create("opacity",I),u&&u(T,M)}),k=_(f),E=_(g),P=_(T=>{const M=Jv({style:m,timeout:v,easing:l},{mode:"exit"});T.style.webkitTransition=r.transitions.create("opacity",M),T.style.transition=r.transitions.create("opacity",M),h&&h(T)}),A=_(p),R=T=>{o&&o(b.current,T)};return C.jsx(y,{appear:s,in:c,nodeRef:b,onEnter:O,onEntered:k,onEntering:S,onExit:P,onExited:A,onExiting:E,addEndListener:R,timeout:v,...x,children:(T,M)=>D.cloneElement(a,{style:{opacity:0,visibility:T==="exited"&&!c?"hidden":void 0,...est[T],...m,...a.props.style},ref:w,...M})})});function tst(t){return Xe("MuiBackdrop",t)}He("MuiBackdrop",["root","invisible"]);const nst=t=>{const{ownerState:e,...n}=t;return n},rst=t=>{const{classes:e,invisible:n}=t;return qe({root:["root",n&&"invisible"]},tst,e)},ist=be("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})({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",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),gPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiBackdrop"}),{children:i,className:o,component:s="div",invisible:a=!1,open:l,components:c={},componentsProps:u={},slotProps:f={},slots:d={},TransitionComponent:h,transitionDuration:p,...g}=r,m={...r,component:s,invisible:a},v=rst(m),y={transition:h,root:c.Root,...d},x={...u,...f},b={slots:y,slotProps:x},[w,_]=Jl("root",{elementType:ist,externalForwardedProps:b,className:Oe(v.root,o),ownerState:m}),[S,O]=Jl("transition",{elementType:eO,externalForwardedProps:b,ownerState:m}),k=nst(O);return C.jsx(S,{in:l,timeout:p,...g,...k,children:C.jsx(w,{"aria-hidden":!0,..._,classes:v,ref:n,children:i})})}),ost=He("MuiBox",["root"]),sst=n4(),ot=tnt({themeId:Rf,defaultTheme:sst,defaultClassName:ost.root,generateClassName:kAe.generate});function ast(t){return Xe("MuiButton",t)}const W1=He("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"]),lst=D.createContext({}),cst=D.createContext(void 0),ust=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:s}=t,a={root:["root",o,`${o}${Me(e)}`,`size${Me(i)}`,`${o}Size${Me(i)}`,`color${Me(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${Me(i)}`],endIcon:["icon","endIcon",`iconSize${Me(i)}`]},l=qe(a,ast,s);return{...s,...l}},mPe=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],fst=be(Ff,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Me(n.color)}`],e[`size${Me(n.size)}`],e[`${n.variant}Size${Me(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(wt(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],n=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${W1.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${W1.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${W1.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${W1.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(pr()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(t.vars||t).palette[r].main,"--variant-outlinedColor":(t.vars||t).palette[r].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.5)`:kt(t.palette[r].main,.5),"--variant-containedColor":(t.vars||t).palette[r].contrastText,"--variant-containedBg":(t.vars||t).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[r].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[r].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[r].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[r].main,t.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:e,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${W1.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${W1.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}}]}})),dst=be("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${Me(n.size)}`]]}})({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},...mPe]}),hst=be("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${Me(n.size)}`]]}})({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},...mPe]}),Hr=D.forwardRef(function(e,n){const r=D.useContext(lst),i=D.useContext(cst),o=_S(r,e),s=_t({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:g,fullWidth:m=!1,size:v="medium",startIcon:y,type:x,variant:b="text",...w}=s,_={...s,color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:m,size:v,type:x,variant:b},S=ust(_),O=y&&C.jsx(dst,{className:S.startIcon,ownerState:_,children:y}),k=p&&C.jsx(hst,{className:S.endIcon,ownerState:_,children:p}),E=i||"";return C.jsxs(fst,{ownerState:_,className:Oe(r.className,S.root,u,E),component:c,disabled:f,focusRipple:!h,focusVisibleClassName:Oe(S.focusVisible,g),ref:n,type:x,...w,classes:S,children:[O,a,k]})});function pst(t){return Xe("MuiCard",t)}He("MuiCard",["root"]);const gst=t=>{const{classes:e}=t;return qe({root:["root"]},pst,e)},mst=be(kl,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})({overflow:"hidden"}),vPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=gst(a);return C.jsx(mst,{className:Oe(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function vst(t){return Xe("MuiCardActions",t)}He("MuiCardActions",["root","spacing"]);const yst=t=>{const{classes:e,disableSpacing:n}=t;return qe({root:["root",!n&&"spacing"]},vst,e)},xst=be("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),yPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o,...s}=r,a={...r,disableSpacing:i},l=yst(a);return C.jsx(xst,{className:Oe(l.root,o),ownerState:a,ref:n,...s})});function bst(t){return Xe("MuiCardContent",t)}He("MuiCardContent",["root"]);const wst=t=>{const{classes:e}=t;return qe({root:["root"]},bst,e)},_st=be("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:16,"&:last-child":{paddingBottom:24}}),xPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=wst(a);return C.jsx(_st,{as:o,className:Oe(l.root,i),ownerState:a,ref:n,...s})});function Sst(t){return Xe("MuiCardHeader",t)}const $F=He("MuiCardHeader",["root","avatar","action","content","title","subheader"]),Cst=t=>{const{classes:e}=t;return qe({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},Sst,e)},Ost=be("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>({[`& .${$F.title}`]:e.title,[`& .${$F.subheader}`]:e.subheader,...e.root})})({display:"flex",alignItems:"center",padding:16}),Est=be("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),Tst=be("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),kst=be("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto",[`.${DF.root}:where(& .${$F.title})`]:{display:"block"},[`.${DF.root}:where(& .${$F.subheader})`]:{display:"block"}}),Ast=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCardHeader"}),{action:i,avatar:o,className:s,component:a="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:f,titleTypographyProps:d,...h}=r,p={...r,component:a,disableTypography:l},g=Cst(p);let m=f;m!=null&&m.type!==Jt&&!l&&(m=C.jsx(Jt,{variant:o?"body2":"h5",className:g.title,component:"span",...d,children:m}));let v=c;return v!=null&&v.type!==Jt&&!l&&(v=C.jsx(Jt,{variant:o?"body2":"body1",className:g.subheader,color:"textSecondary",component:"span",...u,children:v})),C.jsxs(Ost,{className:Oe(g.root,s),as:a,ref:n,ownerState:p,...h,children:[o&&C.jsx(Est,{className:g.avatar,ownerState:p,children:o}),C.jsxs(kst,{className:g.content,ownerState:p,children:[m,v]}),i&&C.jsx(Tst,{className:g.action,ownerState:p,children:i})]})});function Pst(t){return Xe("MuiCardMedia",t)}He("MuiCardMedia",["root","media","img"]);const Mst=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return qe({root:["root",n&&"media",r&&"img"]},Pst,e)},Rst=be("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]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),Dst=["video","audio","picture","iframe","img"],Ist=["picture","img"],Lst=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCardMedia"}),{children:i,className:o,component:s="div",image:a,src:l,style:c,...u}=r,f=Dst.includes(s),d=!f&&a?{backgroundImage:`url("${a}")`,...c}:c,h={...r,component:s,isMediaComponent:f,isImageComponent:Ist.includes(s)},p=Mst(h);return C.jsx(Rst,{className:Oe(p.root,o),as:s,role:!f&&a?"img":void 0,ref:n,style:d,ownerState:h,src:f?a||l:void 0,...u,children:i})});function $st(t){return Xe("PrivateSwitchBase",t)}He("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Fst=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${Me(i)}`],input:["input"]};return qe(o,$st,e)},Nst=be(Ff)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:t,ownerState:e})=>t==="start"&&e.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:t,ownerState:e})=>t==="end"&&e.size!=="small",style:{marginRight:-12}}]}),zst=be("input",{shouldForwardProp:Xo})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),qee=D.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:s,defaultChecked:a,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:d,inputProps:h,inputRef:p,name:g,onBlur:m,onChange:v,onFocus:y,readOnly:x,required:b=!1,tabIndex:w,type:_,value:S,...O}=e,[k,E]=bc({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),P=Na(),A=N=>{y&&y(N),P&&P.onFocus&&P.onFocus(N)},R=N=>{m&&m(N),P&&P.onBlur&&P.onBlur(N)},T=N=>{if(N.nativeEvent.defaultPrevented)return;const L=N.target.checked;E(L),v&&v(N,L)};let M=l;P&&typeof M>"u"&&(M=P.disabled);const I=_==="checkbox"||_==="radio",z={...e,checked:k,disabled:M,disableFocusRipple:c,edge:u},F=Fst(z);return C.jsxs(Nst,{component:"span",className:Oe(F.root,s),centerRipple:!0,focusRipple:!c,disabled:M,tabIndex:null,role:void 0,onFocus:A,onBlur:R,ownerState:z,ref:n,...O,children:[C.jsx(zst,{autoFocus:r,checked:i,defaultChecked:a,className:F.input,disabled:M,id:I?d:void 0,name:g,onChange:T,readOnly:x,ref:p,required:b,ownerState:z,tabIndex:w,type:_,..._==="checkbox"&&S===void 0?{}:{value:S},...h}),k?o:f]})}),jst=lt(C.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"),Bst=lt(C.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"),Ust=lt(C.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 Wst(t){return Xe("MuiCheckbox",t)}const rW=He("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Vst=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${Me(r)}`,`size${Me(i)}`]},s=qe(o,Wst,e);return{...e,...s}},Gst=be(qee,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${Me(n.size)}`],n.color!=="default"&&e[`color${Me(n.color)}`]]}})(wt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{[`&.${rW.checked}, &.${rW.indeterminate}`]:{color:(t.vars||t).palette[e].main},[`&.${rW.disabled}`]:{color:(t.vars||t).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),Hst=C.jsx(Bst,{}),qst=C.jsx(jst,{}),Xst=C.jsx(Ust,{}),FF=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCheckbox"}),{checkedIcon:i=Hst,color:o="primary",icon:s=qst,indeterminate:a=!1,indeterminateIcon:l=Xst,inputProps:c,size:u="medium",disableRipple:f=!1,className:d,...h}=r,p=a?l:s,g=a?l:i,m={...r,disableRipple:f,color:o,indeterminate:a,size:u},v=Vst(m);return C.jsx(Gst,{type:"checkbox",inputProps:{"data-indeterminate":a,...c},icon:D.cloneElement(p,{fontSize:p.props.fontSize??u}),checkedIcon:D.cloneElement(g,{fontSize:g.props.fontSize??u}),ownerState:m,ref:n,className:Oe(v.root,d),disableRipple:f,...h,classes:v})});function Yst(t){return Xe("MuiCircularProgress",t)}He("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const cm=44,aq=My` 0% { transform: rotate(0deg); } @@ -224,7 +224,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann animation: ${aq} 1.4s linear infinite; `:null,Kst=typeof lq!="string"?JC` animation: ${lq} 1.4s ease-in-out infinite; - `:null,Zst=t=>{const{classes:e,variant:n,color:r,disableShrink:i}=t,o={root:["root",n,`color${Me(r)}`],svg:["svg"],circle:["circle",`circle${Me(n)}`,i&&"circleDisableShrink"]};return qe(o,Yst,e)},Jst=be("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${Me(n.color)}`]]}})(wt(({theme:t})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Qst||{animation:`${aq} 1.4s linear infinite`}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}}))]}))),eat=be("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),tat=be("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${Me(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(wt(({theme:t})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink,style:Kst||{animation:`${lq} 1.4s ease-in-out infinite`}}]}))),Ly=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,size:a=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate",...d}=r,h={...r,color:o,disableShrink:s,size:a,thickness:c,value:u,variant:f},p=Zst(h),g={},m={},v={};if(f==="determinate"){const y=2*Math.PI*((cm-c)/2);g.strokeDasharray=y.toFixed(3),v["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*y).toFixed(3)}px`,m.transform="rotate(-90deg)"}return C.jsx(Jst,{className:Oe(p.root,i),style:{width:a,height:a,...m,...l},ownerState:h,ref:n,role:"progressbar",...v,...d,children:C.jsx(eat,{className:p.svg,ownerState:h,viewBox:`${cm/2} ${cm/2} ${cm} ${cm}`,children:C.jsx(tat,{className:p.circle,style:g,ownerState:h,cx:cm,cy:cm,r:(cm-c)/2,fill:"none",strokeWidth:c})})})});function Lde(t){return t.substring(2).toLowerCase()}function nat(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=dn(Ry(e),a),f=st(p=>{const g=c.current;c.current=!1;const m=yi(a.current);if(!l.current||!a.current||"clientX"in p&&nat(p,m))return;if(s.current){s.current=!1;return}let v;p.composedPath?v=p.composedPath().includes(a.current):v=!m.documentElement.contains(p.target)||a.current.contains(p.target),!v&&(n||!g)&&i(p)}),d=p=>g=>{c.current=!0;const m=e.props[p];m&&m(g)},h={ref:u};return o!==!1&&(h[o]=d(o)),D.useEffect(()=>{if(o!==!1){const p=Lde(o),g=yi(a.current),m=()=>{s.current=!0};return g.addEventListener(p,f),g.addEventListener("touchmove",m),()=>{g.removeEventListener(p,f),g.removeEventListener("touchmove",m)}}},[f,o]),r!==!1&&(h[r]=d(r)),D.useEffect(()=>{if(r!==!1){const p=Lde(r),g=yi(a.current);return g.addEventListener(p,f),()=>{g.removeEventListener(p,f)}}},[f,r]),C.jsx(D.Fragment,{children:D.cloneElement(e,h)})}const cq=typeof Ree({})=="function",iat=(t,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!t.vars&&{colorScheme:t.palette.mode}}),oat=t=>({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}}),bPe=(t,e=!1)=>{var o,s;const n={};e&&t.colorSchemes&&typeof t.getColorSchemeSelector=="function"&&Object.entries(t.colorSchemes).forEach(([a,l])=>{var u,f;const c=t.getColorSchemeSelector(a);c.startsWith("@")?n[c]={":root":{colorScheme:(u=l.palette)==null?void 0:u.mode}}:n[c.replace(/\s*&/,"")]={colorScheme:(f=l.palette)==null?void 0:f.mode}});let r={html:iat(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:{margin:0,...oat(t),"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}},...n};const i=(s=(o=t.components)==null?void 0:o.MuiCssBaseline)==null?void 0:s.styleOverrides;return i&&(r=[r,i]),r},s3="mui-ecs",sat=t=>{const e=bPe(t,!1),n=Array.isArray(e)?e[0]:e;return!t.vars&&n&&(n.html[`:root:has(${s3})`]={colorScheme:t.palette.mode}),t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([r,i])=>{var s,a;const o=t.getColorSchemeSelector(r);o.startsWith("@")?n[o]={[`:root:not(:has(.${s3}))`]:{colorScheme:(s=i.palette)==null?void 0:s.mode}}:n[o.replace(/\s*&/,"")]={[`&:not(:has(.${s3}))`]:{colorScheme:(a=i.palette)==null?void 0:a.mode}}}),e},aat=Ree(cq?({theme:t,enableColorScheme:e})=>bPe(t,e):({theme:t})=>sat(t));function lat(t){const e=_t({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return C.jsxs(D.Fragment,{children:[cq&&C.jsx(aat,{enableColorScheme:r}),!cq&&!r&&C.jsx("span",{className:s3,style:{display:"none"}}),n]})}function cat(t){const e=yi(t);return e.body===t?xc(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function ZT(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function $de(t){return parseInt(xc(t).getComputedStyle(t).paddingRight,10)||0}function uat(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(t.tagName),r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function Fde(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,s=>{const a=!o.includes(s),l=!uat(s);a&&l&&ZT(s,i)})}function iW(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function fat(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(cat(r)){const s=zAe(xc(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${$de(r)+s}px`;const a=yi(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${$de(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=yi(r).body;else{const s=r.parentElement,a=xc(r);o=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s: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:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function dat(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class hat{constructor(){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&&ZT(e.modalRef,!1);const i=dat(n);Fde(n,e.mount,e.modalRef,i,!0);const o=iW(this.containers,s=>s.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=iW(this.containers,o=>o.modals.includes(e)),i=this.containers[r];i.restore||(i.restore=fat(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=iW(this.containers,s=>s.modals.includes(e)),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&&ZT(e.modalRef,n),Fde(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&ZT(s.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}const pat=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function gat(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 mat(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 vat(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||mat(t))}function yat(t){const e=[],n=[];return Array.from(t.querySelectorAll(pat)).forEach((r,i)=>{const o=gat(r);o===-1||!vat(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 xat(){return!0}function wPe(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=yat,isEnabled:s=xat,open:a}=t,l=D.useRef(!1),c=D.useRef(null),u=D.useRef(null),f=D.useRef(null),d=D.useRef(null),h=D.useRef(!1),p=D.useRef(null),g=dn(Ry(e),p),m=D.useRef(null);D.useEffect(()=>{!a||!p.current||(h.current=!n)},[n,a]),D.useEffect(()=>{if(!a||!p.current)return;const x=yi(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)}},[a]),D.useEffect(()=>{if(!a||!p.current)return;const x=yi(p.current),b=S=>{m.current=S,!(r||!s()||S.key!=="Tab")&&x.activeElement===p.current&&S.shiftKey&&(l.current=!0,u.current&&u.current.focus())},w=()=>{var k,E;const S=p.current;if(S===null)return;if(!x.hasFocus()||!s()||l.current){l.current=!1;return}if(S.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 O=[];if((x.activeElement===c.current||x.activeElement===u.current)&&(O=o(p.current)),O.length>0){const P=!!((k=m.current)!=null&&k.shiftKey&&((E=m.current)==null?void 0:E.key)==="Tab"),A=O[0],R=O[O.length-1];typeof A!="string"&&typeof R!="string"&&(P?R.focus():A.focus())}else S.focus()};x.addEventListener("focusin",w),x.addEventListener("keydown",b,!0);const _=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&w()},50);return()=>{clearInterval(_),x.removeEventListener("focusin",w),x.removeEventListener("keydown",b,!0)}},[n,r,i,s,a,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 C.jsxs(D.Fragment,{children:[C.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),D.cloneElement(e,{ref:g,onFocus:v}),C.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}function bat(t){return typeof t=="function"?t():t}function wat(t){return t?t.props.hasOwnProperty("in"):!1}const JD=new hat;function _at(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:o,onTransitionExited:s,children:a,onClose:l,open:c,rootRef:u}=t,f=D.useRef({}),d=D.useRef(null),h=D.useRef(null),p=dn(h,u),[g,m]=D.useState(!c),v=wat(a);let y=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(y=!1);const x=()=>yi(d.current),b=()=>(f.current.modalRef=h.current,f.current.mount=d.current,f.current),w=()=>{JD.mount(b(),{disableScrollLock:r}),h.current&&(h.current.scrollTop=0)},_=st(()=>{const M=bat(e)||x().body;JD.add(b(),M),h.current&&w()}),S=()=>JD.isTopModal(b()),O=st(M=>{d.current=M,M&&(c&&S()?w():h.current&&ZT(h.current,y))}),k=D.useCallback(()=>{JD.remove(b(),y)},[y]);D.useEffect(()=>()=>{k()},[k]),D.useEffect(()=>{c?_():(!v||!i)&&k()},[c,k,v,i,_]);const E=M=>I=>{var z;(z=M.onKeyDown)==null||z.call(M,I),!(I.key!=="Escape"||I.which===229||!S())&&(n||(I.stopPropagation(),l&&l(I,"escapeKeyDown")))},P=M=>I=>{var z;(z=M.onClick)==null||z.call(M,I),I.target===I.currentTarget&&l&&l(I,"backdropClick")};return{getRootProps:(M={})=>{const I=Mx(t);delete I.onTransitionEnter,delete I.onTransitionExited;const z={...I,...M};return{role:"presentation",...z,onKeyDown:E(z),ref:p}},getBackdropProps:(M={})=>{const I=M;return{"aria-hidden":!0,...I,onClick:P(I),open:c}},getTransitionProps:()=>{const M=()=>{m(!1),o&&o()},I=()=>{m(!0),s&&s(),i&&k()};return{onEnter:ZH(M,a==null?void 0:a.props.onEnter),onExited:ZH(I,a==null?void 0:a.props.onExited)}},rootRef:p,portalRef:O,isTopModal:S,exited:g,hasTransition:v}}function Sat(t){return Xe("MuiModal",t)}He("MuiModal",["root","hidden","backdrop"]);const Cat=t=>{const{open:e,exited:n,classes:r}=t;return qe({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},Sat,r)},Oat=be("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(wt(({theme:t})=>({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]}))),Eat=be(gPe,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),_Pe=D.forwardRef(function(e,n){const r=_t({name:"MuiModal",props:e}),{BackdropComponent:i=Eat,BackdropProps:o,classes:s,className:a,closeAfterTransition:l=!1,children:c,container:u,component:f,components:d={},componentsProps:h={},disableAutoFocus:p=!1,disableEnforceFocus:g=!1,disableEscapeKeyDown:m=!1,disablePortal:v=!1,disableRestoreFocus:y=!1,disableScrollLock:x=!1,hideBackdrop:b=!1,keepMounted:w=!1,onBackdropClick:_,onClose:S,onTransitionEnter:O,onTransitionExited:k,open:E,slotProps:P={},slots:A={},theme:R,...T}=r,M={...r,closeAfterTransition:l,disableAutoFocus:p,disableEnforceFocus:g,disableEscapeKeyDown:m,disablePortal:v,disableRestoreFocus:y,disableScrollLock:x,hideBackdrop:b,keepMounted:w},{getRootProps:I,getBackdropProps:z,getTransitionProps:F,portalRef:N,isTopModal:L,exited:B,hasTransition:$}=_at({...M,rootRef:n}),j={...M,exited:B},X=Cat(j),V={};if(c.props.tabIndex===void 0&&(V.tabIndex="-1"),$){const{onEnter:te,onExited:ae}=F();V.onEnter=te,V.onExited=ae}const Y={...T,slots:{root:d.Root,backdrop:d.Backdrop,...A},slotProps:{...h,...P}},[le,K]=Jl("root",{elementType:Oat,externalForwardedProps:Y,getSlotProps:I,additionalProps:{ref:n,as:f},ownerState:j,className:Oe(a,X==null?void 0:X.root,!j.open&&j.exited&&(X==null?void 0:X.hidden))}),[ee,re]=Jl("backdrop",{elementType:i,externalForwardedProps:Y,additionalProps:o,getSlotProps:te=>z({...te,onClick:ae=>{_&&_(ae),te!=null&&te.onClick&&te.onClick(ae)}}),className:Oe(o==null?void 0:o.className,X==null?void 0:X.backdrop),ownerState:j}),me=dn(o==null?void 0:o.ref,re.ref);return!w&&!E&&(!$||B)?null:C.jsx(hPe,{ref:N,container:u,disablePortal:v,children:C.jsxs(le,{...K,children:[!b&&i?C.jsx(ee,{...re,ref:me}):null,C.jsx(wPe,{disableEnforceFocus:g,disableAutoFocus:p,disableRestoreFocus:y,isEnabled:L,open:E,children:D.cloneElement(c,V)})]})})});function Tat(t){return Xe("MuiDialog",t)}const JT=He("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),SPe=D.createContext({}),kat=be(gPe,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),Aat=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=t,s={root:["root"],container:["container",`scroll${Me(n)}`],paper:["paper",`paperScroll${Me(n)}`,`paperWidth${Me(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return qe(s,Tat,e)},Pat=be(_Pe,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),Mat=be("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${Me(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),Rat=be(kl,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${Me(n.scroll)}`],e[`paperWidth${Me(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(wt(({theme:t})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${JT.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter(e=>e!=="xs").map(e=>({props:{maxWidth:e},style:{maxWidth:`${t.breakpoints.values[e]}${t.breakpoints.unit}`,[`&.${JT.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e]+32*2)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${JT.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),ed=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialog"}),i=To(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:u,children:f,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:g=!1,maxWidth:m="sm",onBackdropClick:v,onClick:y,onClose:x,open:b,PaperComponent:w=kl,PaperProps:_={},scroll:S="paper",TransitionComponent:O=eO,transitionDuration:k=o,TransitionProps:E,...P}=r,A={...r,disableEscapeKeyDown:h,fullScreen:p,fullWidth:g,maxWidth:m,scroll:S},R=Aat(A),T=D.useRef(),M=N=>{T.current=N.target===N.currentTarget},I=N=>{y&&y(N),T.current&&(T.current=null,v&&v(N),x&&x(N,"backdropClick"))},z=Jf(a),F=D.useMemo(()=>({titleId:z}),[z]);return C.jsx(Pat,{className:Oe(R.root,d),closeAfterTransition:!0,components:{Backdrop:kat},componentsProps:{backdrop:{transitionDuration:k,as:c,...u}},disableEscapeKeyDown:h,onClose:x,open:b,ref:n,onClick:I,ownerState:A,...P,children:C.jsx(O,{appear:!0,in:b,timeout:k,role:"presentation",...E,children:C.jsx(Mat,{className:Oe(R.container),onMouseDown:M,ownerState:A,children:C.jsx(Rat,{as:w,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":z,"aria-modal":l,..._,className:Oe(R.paper,_.className),ownerState:A,children:C.jsx(SPe.Provider,{value:F,children:f})})})})})});function Dat(t){return Xe("MuiDialogActions",t)}He("MuiDialogActions",["root","spacing"]);const Iat=t=>{const{classes:e,disableSpacing:n}=t;return qe({root:["root",!n&&"spacing"]},Dat,e)},Lat=be("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:t})=>!t.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Jb=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1,...s}=r,a={...r,disableSpacing:o},l=Iat(a);return C.jsx(Lat,{className:Oe(l.root,i),ownerState:a,ref:n,...s})});function $at(t){return Xe("MuiDialogContent",t)}He("MuiDialogContent",["root","dividers"]);function Fat(t){return Xe("MuiDialogTitle",t)}const Nat=He("MuiDialogTitle",["root"]),zat=t=>{const{classes:e,dividers:n}=t;return qe({root:["root",n&&"dividers"]},$at,e)},jat=be("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(wt(({theme:t})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:e})=>e.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${Nat.root} + &`]:{paddingTop:0}}}]}))),Nf=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1,...s}=r,a={...r,dividers:o},l=zat(a);return C.jsx(jat,{className:Oe(l.root,i),ownerState:a,ref:n,...s})});function Bat(t){return Xe("MuiDialogContentText",t)}He("MuiDialogContentText",["root"]);const Uat=t=>{const{classes:e}=t,r=qe({root:["root"]},Bat,e);return{...e,...r}},Wat=be(Jt,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Vat=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialogContentText"}),{children:i,className:o,...s}=r,a=Uat(s);return C.jsx(Wat,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Oe(a.root,o),...r,classes:a})}),Gat=t=>{const{classes:e}=t;return qe({root:["root"]},Fat,e)},Hat=be(Jt,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),$y=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialogTitle"}),{className:i,id:o,...s}=r,a=r,l=Gat(a),{titleId:c=o}=D.useContext(SPe);return C.jsx(Hat,{component:"h2",className:Oe(l.root,i),ownerState:a,ref:n,variant:"h6",id:o??c,...s})});function qat(t){return Xe("MuiDivider",t)}const Nde=He("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),Xat=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=t;return qe({root:["root",e&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},qat,r)},Yat=be("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]}})(wt(({theme:t})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:kt(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&e.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>e.orientation==="vertical"&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>e.textAlign==="right"&&e.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>e.textAlign==="left"&&e.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),Qat=be("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(wt(({theme:t})=>({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}))),zf=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,orientation:a="horizontal",component:l=o||a==="vertical"?"div":"hr",flexItem:c=!1,light:u=!1,role:f=l!=="hr"?"separator":void 0,textAlign:d="center",variant:h="fullWidth",...p}=r,g={...r,absolute:i,component:l,flexItem:c,light:u,orientation:a,role:f,textAlign:d,variant:h},m=Xat(g);return C.jsx(Yat,{as:l,className:Oe(m.root,s),role:f,ref:n,ownerState:g,"aria-orientation":f==="separator"&&(l!=="hr"||a==="vertical")?a:void 0,...p,children:o?C.jsx(Qat,{className:m.wrapper,ownerState:g,children:o}):null})});zf&&(zf.muiSkipListHighlight=!0);function Kat(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=xc(e);let s;if(e.fakeTransform)s=e.fakeTransform;else{const c=o.getComputedStyle(e);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}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 Zat(t){return typeof t=="function"?t():t}function eI(t,e,n){const r=Zat(n),i=Kat(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const Jat=D.forwardRef(function(e,n){const r=To(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:d,onEnter:h,onEntered:p,onEntering:g,onExit:m,onExited:v,onExiting:y,style:x,timeout:b=o,TransitionComponent:w=Rc,..._}=e,S=D.useRef(null),O=dn(Ry(l),S,n),k=F=>N=>{F&&(N===void 0?F(S.current):F(S.current,N))},E=k((F,N)=>{eI(u,F,c),Fee(F),h&&h(F,N)}),P=k((F,N)=>{const L=Jv({timeout:b,style:x,easing:f},{mode:"enter"});F.style.webkitTransition=r.transitions.create("-webkit-transform",{...L}),F.style.transition=r.transitions.create("transform",{...L}),F.style.webkitTransform="none",F.style.transform="none",g&&g(F,N)}),A=k(p),R=k(y),T=k(F=>{const N=Jv({timeout:b,style:x,easing:f},{mode:"exit"});F.style.webkitTransition=r.transitions.create("-webkit-transform",N),F.style.transition=r.transitions.create("transform",N),eI(u,F,c),m&&m(F)}),M=k(F=>{F.style.webkitTransition="",F.style.transition="",v&&v(F)}),I=F=>{s&&s(S.current,F)},z=D.useCallback(()=>{S.current&&eI(u,S.current,c)},[u,c]);return D.useEffect(()=>{if(d||u==="down"||u==="right")return;const F=TM(()=>{S.current&&eI(u,S.current,c)}),N=xc(S.current);return N.addEventListener("resize",F),()=>{F.clear(),N.removeEventListener("resize",F)}},[u,d,c]),D.useEffect(()=>{d||z()},[d,z]),C.jsx(w,{nodeRef:S,onEnter:E,onEntered:A,onEntering:P,onExit:T,onExited:M,onExiting:R,addEndListener:I,appear:a,in:d,timeout:b,..._,children:(F,N)=>D.cloneElement(l,{ref:O,style:{visibility:F==="exited"&&!d?"hidden":void 0,...x,...l.props.style},...N})})}),elt=t=>{const{classes:e,disableUnderline:n,startAdornment:r,endAdornment:i,size:o,hiddenLabel:s,multiline:a}=t,l={root:["root",!n&&"underline",r&&"adornedStart",i&&"adornedEnd",o==="small"&&`size${Me(o)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},c=qe(l,Got,e);return{...e,...c}},tlt=be(x4,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...v4(t,e),!n.disableUnderline&&e.underline]}})(wt(({theme:t})=>{const e=t.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r,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:i,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r}},[`&.${p0.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r},[`&.${p0.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{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"},[`&.${p0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${p0.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})`:n}`,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(.${p0.disabled}, .${p0.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${p0.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(pr()).map(([s])=>{var a;return{props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(a=(t.vars||t).palette[s])==null?void 0:a.main}`}}}}),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:a})=>s.multiline&&a==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),nlt=be(b4,{name:"MuiFilledInput",slot:"Input",overridesResolver:y4})(wt(({theme:t})=>({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"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),NF=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFilledInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,hiddenLabel:l,inputComponent:c="input",multiline:u=!1,slotProps:f,slots:d={},type:h="text",...p}=r,g={...r,disableUnderline:i,fullWidth:a,inputComponent:c,multiline:u,type:h},m=elt(r),v={root:{ownerState:g},input:{ownerState:g}},y=f??s?Wo(v,f??s):v,x=d.root??o.Root??tlt,b=d.input??o.Input??nlt;return C.jsx(Hee,{slots:{root:x,input:b},componentsProps:y,fullWidth:a,inputComponent:c,multiline:u,ref:n,type:h,...p,classes:m})});NF&&(NF.muiName="Input");function rlt(t){return Xe("MuiFormControl",t)}He("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const ilt=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${Me(n)}`,r&&"fullWidth"]};return qe(i,rlt,e)},olt=be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>({...e.root,...e[`margin${Me(t.margin)}`],...t.fullWidth&&e.fullWidth})})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),td=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:h="none",required:p=!1,size:g="medium",variant:m="outlined",...v}=r,y={...r,color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:g,variant:m},x=ilt(y),[b,w]=D.useState(()=>{let R=!1;return i&&D.Children.forEach(i,T=>{if(!i3(T,["Input","Select"]))return;const M=i3(T,["Select"])?T.props.input:T;M&&jot(M.props)&&(R=!0)}),R}),[_,S]=D.useState(()=>{let R=!1;return i&&D.Children.forEach(i,T=>{i3(T,["Input","Select"])&&(LF(T.props,!0)||LF(T.props.inputProps,!0))&&(R=!0)}),R}),[O,k]=D.useState(!1);l&&O&&k(!1);const E=u!==void 0&&!l?u:O;let P;D.useRef(!1);const A=D.useMemo(()=>({adornedStart:b,setAdornedStart:w,color:s,disabled:l,error:c,filled:_,focused:E,fullWidth:f,hiddenLabel:d,size:g,onBlur:()=>{k(!1)},onEmpty:()=>{S(!1)},onFilled:()=>{S(!0)},onFocus:()=>{k(!0)},registerEffect:P,required:p,variant:m}),[b,s,l,c,_,E,f,d,P,p,g,m]);return C.jsx(m4.Provider,{value:A,children:C.jsx(olt,{as:a,ownerState:y,className:Oe(x.root,o),ref:n,...v,children:i})})});function slt(t){return Xe("MuiFormControlLabel",t)}const K2=He("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),alt=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,s={root:["root",n&&"disabled",`labelPlacement${Me(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return qe(s,slt,e)},llt=be("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${K2.label}`]:e.label},e.root,e[`labelPlacement${Me(n.labelPlacement)}`]]}})(wt(({theme:t})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${K2.disabled}`]:{cursor:"default"},[`& .${K2.label}`]:{[`&.${K2.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>e==="start"||e==="top"||e==="bottom",style:{marginLeft:16}}]}))),clt=be("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(wt(({theme:t})=>({[`&.${K2.error}`]:{color:(t.vars||t).palette.error.main}}))),sg=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormControlLabel"}),{checked:i,className:o,componentsProps:s={},control:a,disabled:l,disableTypography:c,inputRef:u,label:f,labelPlacement:d="end",name:h,onChange:p,required:g,slots:m={},slotProps:v={},value:y,...x}=r,b=Na(),w=l??a.props.disabled??(b==null?void 0:b.disabled),_=g??a.props.required,S={disabled:w,required:_};["checked","name","onChange","value","inputRef"].forEach(M=>{typeof a.props[M]>"u"&&typeof r[M]<"u"&&(S[M]=r[M])});const O=Iy({props:r,muiFormControl:b,states:["error"]}),k={...r,disabled:w,labelPlacement:d,required:_,error:O.error},E=alt(k),P={slots:m,slotProps:{...s,...v}},[A,R]=Jl("typography",{elementType:Jt,externalForwardedProps:P,ownerState:k});let T=f;return T!=null&&T.type!==Jt&&!c&&(T=C.jsx(A,{component:"span",...R,className:Oe(E.label,R==null?void 0:R.className),children:T})),C.jsxs(llt,{className:Oe(E.root,o),ownerState:k,ref:n,...x,children:[D.cloneElement(a,S),_?C.jsxs("div",{children:[T,C.jsxs(clt,{ownerState:k,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]}):T]})});function ult(t){return Xe("MuiFormGroup",t)}He("MuiFormGroup",["root","row","error"]);const flt=t=>{const{classes:e,row:n,error:r}=t;return qe({root:["root",n&&"row",r&&"error"]},ult,e)},dlt=be("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),hlt=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1,...s}=r,a=Na(),l=Iy({props:r,muiFormControl:a,states:["error"]}),c={...r,row:o,error:l.error},u=flt(c);return C.jsx(dlt,{className:Oe(u.root,i),ownerState:c,ref:n,...s})});function plt(t){return Xe("MuiFormHelperText",t)}const zde=He("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var jde;const glt=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${Me(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return qe(c,plt,e)},mlt=be("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${Me(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(wt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${zde.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${zde.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),Xee=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p",disabled:a,error:l,filled:c,focused:u,margin:f,required:d,variant:h,...p}=r,g=Na(),m=Iy({props:r,muiFormControl:g,states:["variant","size","disabled","error","filled","focused","required"]}),v={...r,component:s,contained:m.variant==="filled"||m.variant==="outlined",variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete v.ownerState;const y=glt(v);return C.jsx(mlt,{as:s,className:Oe(y.root,o),ref:n,...p,ownerState:v,children:i===" "?jde||(jde=C.jsx("span",{className:"notranslate",children:"​"})):i})});function vlt(t){return Xe("MuiFormLabel",t)}const ek=He("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ylt=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=t,l={root:["root",`color${Me(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return qe(l,vlt,e)},xlt=be("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>({...e.root,...t.color==="secondary"&&e.colorSecondary,...t.filled&&e.filled})})(wt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{[`&.${ek.focused}`]:{color:(t.vars||t).palette[e].main}}})),{props:{},style:{[`&.${ek.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${ek.error}`]:{color:(t.vars||t).palette.error.main}}}]}))),blt=be("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(wt(({theme:t})=>({[`&.${ek.error}`]:{color:(t.vars||t).palette.error.main}}))),CPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormLabel"}),{children:i,className:o,color:s,component:a="label",disabled:l,error:c,filled:u,focused:f,required:d,...h}=r,p=Na(),g=Iy({props:r,muiFormControl:p,states:["color","required","focused","disabled","error","filled"]}),m={...r,color:g.color||"primary",component:a,disabled:g.disabled,error:g.error,filled:g.filled,focused:g.focused,required:g.required},v=ylt(m);return C.jsxs(xlt,{as:a,ownerState:m,className:Oe(v.root,o),ref:n,...h,children:[i,g.required&&C.jsxs(blt,{ownerState:m,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]})}),Bde=D.createContext();function wlt(t){return Xe("MuiGrid",t)}const _lt=[0,1,2,3,4,5,6,7,8,9,10],Slt=["column-reverse","column","row-reverse","row"],Clt=["nowrap","wrap-reverse","wrap"],DE=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],sA=He("MuiGrid",["root","container","item","zeroMinWidth",..._lt.map(t=>`spacing-xs-${t}`),...Slt.map(t=>`direction-xs-${t}`),...Clt.map(t=>`wrap-xs-${t}`),...DE.map(t=>`grid-xs-${t}`),...DE.map(t=>`grid-sm-${t}`),...DE.map(t=>`grid-md-${t}`),...DE.map(t=>`grid-lg-${t}`),...DE.map(t=>`grid-xl-${t}`)]);function Olt({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 s=qj({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*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} + ${u})`;c={flexBasis:f,maxWidth:f}}}o={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 Elt({theme:t,ownerState:e}){const n=qj({values:e.direction,breakpoints:t.breakpoints.values});return wu({theme:t},n,r=>{const i={flexDirection:r};return r.startsWith("column")&&(i[`& > .${sA.item}`]={maxWidth:"none"}),i})}function OPe({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 Tlt({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=qj({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=OPe({breakpoints:t.breakpoints.values,values:o})),i=wu({theme:t},o,(a,l)=>{const c=t.spacing(a);return c!=="0px"?{marginTop:t.spacing(-a),[`& > .${sA.item}`]:{paddingTop:c}}:s!=null&&s.includes(l)?{}:{marginTop:0,[`& > .${sA.item}`]:{paddingTop:0}}})}return i}function klt({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=qj({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=OPe({breakpoints:t.breakpoints.values,values:o})),i=wu({theme:t},o,(a,l)=>{const c=t.spacing(a);if(c!=="0px"){const u=t.spacing(-a);return{width:`calc(100% + ${c})`,marginLeft:u,[`& > .${sA.item}`]:{paddingLeft:c}}}return s!=null&&s.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${sA.item}`]:{paddingLeft:0}}})}return i}function Alt(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 Plt=be("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=Alt(s,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)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...f]}})(({ownerState:t})=>({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}}),Elt,Tlt,klt,Olt);function Mlt(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 Rlt=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let c=[];n&&(c=Mlt(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",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return qe(f,wlt,e)},oW=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiGrid"}),{breakpoints:i}=To(),o=Eee(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:g="wrap",zeroMinWidth:m=!1,...v}=o,y=h||p,x=l||p,b=D.useContext(Bde),w=u?a||12:b,_={},S={...v};i.keys.forEach(E=>{v[E]!=null&&(_[E]=v[E],delete S[E])});const O={...o,columns:w,container:u,direction:f,item:d,rowSpacing:y,columnSpacing:x,wrap:g,zeroMinWidth:m,spacing:p,..._,breakpoints:i.keys},k=Rlt(O);return C.jsx(Bde.Provider,{value:w,children:C.jsx(Plt,{ownerState:O,className:Oe(k.root,s),as:c,ref:n,...S})})});function uq(t){return`scale(${t}, ${t**2})`}const Dlt={entering:{opacity:1,transform:uq(1)},entered:{opacity:1,transform:"none"}},sW=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),ob=D.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:h,style:p,timeout:g="auto",TransitionComponent:m=Rc,...v}=e,y=cv(),x=D.useRef(),b=To(),w=D.useRef(null),_=dn(w,Ry(o),n),S=M=>I=>{if(M){const z=w.current;I===void 0?M(z):M(z,I)}},O=S(u),k=S((M,I)=>{Fee(M);const{duration:z,delay:F,easing:N}=Jv({style:p,timeout:g,easing:s},{mode:"enter"});let L;g==="auto"?(L=b.transitions.getAutoHeightDuration(M.clientHeight),x.current=L):L=z,M.style.transition=[b.transitions.create("opacity",{duration:L,delay:F}),b.transitions.create("transform",{duration:sW?L:L*.666,delay:F,easing:N})].join(","),l&&l(M,I)}),E=S(c),P=S(h),A=S(M=>{const{duration:I,delay:z,easing:F}=Jv({style:p,timeout:g,easing:s},{mode:"exit"});let N;g==="auto"?(N=b.transitions.getAutoHeightDuration(M.clientHeight),x.current=N):N=I,M.style.transition=[b.transitions.create("opacity",{duration:N,delay:z}),b.transitions.create("transform",{duration:sW?N:N*.666,delay:sW?z:z||N*.333,easing:F})].join(","),M.style.opacity=0,M.style.transform=uq(.75),f&&f(M)}),R=S(d),T=M=>{g==="auto"&&y.start(x.current||0,M),r&&r(w.current,M)};return C.jsx(m,{appear:i,in:a,nodeRef:w,onEnter:k,onEntered:E,onEntering:O,onExit:A,onExited:R,onExiting:P,addEndListener:T,timeout:g==="auto"?null:g,...v,children:(M,I)=>D.cloneElement(o,{style:{opacity:0,transform:uq(.75),visibility:M==="exited"&&!a?"hidden":void 0,...Dlt[M],...p,...o.props.style},ref:_,...I})})});ob&&(ob.muiSupportAuto=!0);function Ilt(t){return Xe("MuiIcon",t)}He("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Llt=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${Me(e)}`,`fontSize${Me(n)}`]};return qe(i,Ilt,r)},$lt=be("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Me(n.color)}`],e[`fontSize${Me(n.fontSize)}`]]}})(wt(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}}))]}))),kS=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiIcon"}),{baseClassName:i="material-icons",className:o,color:s="inherit",component:a="span",fontSize:l="medium",...c}=r,u={...r,baseClassName:i,color:s,component:a,fontSize:l},f=Llt(u);return C.jsx($lt,{as:a,className:Oe(i,"notranslate",f.root,o),ownerState:u,"aria-hidden":!0,ref:n,...c})});kS&&(kS.muiName="Icon");const Flt=t=>{const{classes:e,disableUnderline:n}=t,i=qe({root:["root",!n&&"underline"],input:["input"]},Wot,e);return{...e,...i}},Nlt=be(x4,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...v4(t,e),!n.disableUnderline&&e.underline]}})(wt(({theme:t})=>{let n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{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"},[`&.${RE.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${RE.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,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(.${RE.disabled}, .${RE.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${RE.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(pr()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}}))]}})),zlt=be(b4,{name:"MuiInput",slot:"Input",overridesResolver:y4})({}),Dg=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:f={},type:d="text",...h}=r,p=Flt(r),m={root:{ownerState:{disableUnderline:i}}},v=u??s?Wo(u??s,m):m,y=f.root??o.Root??Nlt,x=f.input??o.Input??zlt;return C.jsx(Hee,{slots:{root:y,input:x},slotProps:v,fullWidth:a,inputComponent:l,multiline:c,ref:n,type:d,...h,classes:p})});Dg&&(Dg.muiName="Input");function jlt(t){return Xe("MuiInputAdornment",t)}const Ude=He("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var Wde;const Blt=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Me(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},Ult=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=t,a={root:["root",n&&"disablePointerEvents",i&&`position${Me(i)}`,s,r&&"hiddenLabel",o&&`size${Me(o)}`]};return qe(a,jlt,e)},Wlt=be("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Blt})(wt(({theme:t})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${Ude.positionStart}&:not(.${Ude.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),EPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:c,variant:u,...f}=r,d=Na()||{};let h=u;u&&d.variant,d&&!h&&(h=d.variant);const p={...r,hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:a,position:c,variant:h},g=Ult(p);return C.jsx(m4.Provider,{value:null,children:C.jsx(Wlt,{as:s,ownerState:p,className:Oe(g.root,o),ref:n,...f,children:typeof i=="string"&&!l?C.jsx(Jt,{color:"textSecondary",children:i}):C.jsxs(D.Fragment,{children:[c==="start"?Wde||(Wde=C.jsx("span",{className:"notranslate",children:"​"})):null,i]})})})});function Vlt(t){return Xe("MuiInputLabel",t)}He("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Glt=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${Me(r)}`,s],asterisk:[a&&"asterisk"]},c=qe(l,Vlt,e);return{...e,...c}},Hlt=be(CPe,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ek.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]]}})(wt(({theme:t})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:e})=>e.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:e})=>e.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:e,ownerState:n,size:r})=>e==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),Fy=D.forwardRef(function(e,n){const r=_t({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,margin:o,shrink:s,variant:a,className:l,...c}=r,u=Na();let f=s;typeof f>"u"&&u&&(f=u.filled||u.focused||u.adornedStart);const d=Iy({props:r,muiFormControl:u,states:["size","variant","required","focused"]}),h={...r,disableAnimation:i,formControl:u,shrink:f,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=Glt(h);return C.jsx(Hlt,{"data-shrink":f,ref:n,className:Oe(p.root,l),...c,ownerState:h,classes:p})});function qlt(t){return Xe("MuiLinearProgress",t)}He("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const fq=4,dq=My` + `:null,Zst=t=>{const{classes:e,variant:n,color:r,disableShrink:i}=t,o={root:["root",n,`color${Me(r)}`],svg:["svg"],circle:["circle",`circle${Me(n)}`,i&&"circleDisableShrink"]};return qe(o,Yst,e)},Jst=be("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${Me(n.color)}`]]}})(wt(({theme:t})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Qst||{animation:`${aq} 1.4s linear infinite`}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}}))]}))),eat=be("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),tat=be("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${Me(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(wt(({theme:t})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink,style:Kst||{animation:`${lq} 1.4s ease-in-out infinite`}}]}))),Ly=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,size:a=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate",...d}=r,h={...r,color:o,disableShrink:s,size:a,thickness:c,value:u,variant:f},p=Zst(h),g={},m={},v={};if(f==="determinate"){const y=2*Math.PI*((cm-c)/2);g.strokeDasharray=y.toFixed(3),v["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*y).toFixed(3)}px`,m.transform="rotate(-90deg)"}return C.jsx(Jst,{className:Oe(p.root,i),style:{width:a,height:a,...m,...l},ownerState:h,ref:n,role:"progressbar",...v,...d,children:C.jsx(eat,{className:p.svg,ownerState:h,viewBox:`${cm/2} ${cm/2} ${cm} ${cm}`,children:C.jsx(tat,{className:p.circle,style:g,ownerState:h,cx:cm,cy:cm,r:(cm-c)/2,fill:"none",strokeWidth:c})})})});function Lde(t){return t.substring(2).toLowerCase()}function nat(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=dn(Ry(e),a),f=st(p=>{const g=c.current;c.current=!1;const m=yi(a.current);if(!l.current||!a.current||"clientX"in p&&nat(p,m))return;if(s.current){s.current=!1;return}let v;p.composedPath?v=p.composedPath().includes(a.current):v=!m.documentElement.contains(p.target)||a.current.contains(p.target),!v&&(n||!g)&&i(p)}),d=p=>g=>{c.current=!0;const m=e.props[p];m&&m(g)},h={ref:u};return o!==!1&&(h[o]=d(o)),D.useEffect(()=>{if(o!==!1){const p=Lde(o),g=yi(a.current),m=()=>{s.current=!0};return g.addEventListener(p,f),g.addEventListener("touchmove",m),()=>{g.removeEventListener(p,f),g.removeEventListener("touchmove",m)}}},[f,o]),r!==!1&&(h[r]=d(r)),D.useEffect(()=>{if(r!==!1){const p=Lde(r),g=yi(a.current);return g.addEventListener(p,f),()=>{g.removeEventListener(p,f)}}},[f,r]),C.jsx(D.Fragment,{children:D.cloneElement(e,h)})}const cq=typeof Ree({})=="function",iat=(t,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!t.vars&&{colorScheme:t.palette.mode}}),oat=t=>({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}}),bPe=(t,e=!1)=>{var o,s;const n={};e&&t.colorSchemes&&typeof t.getColorSchemeSelector=="function"&&Object.entries(t.colorSchemes).forEach(([a,l])=>{var u,f;const c=t.getColorSchemeSelector(a);c.startsWith("@")?n[c]={":root":{colorScheme:(u=l.palette)==null?void 0:u.mode}}:n[c.replace(/\s*&/,"")]={colorScheme:(f=l.palette)==null?void 0:f.mode}});let r={html:iat(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:{margin:0,...oat(t),"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}},...n};const i=(s=(o=t.components)==null?void 0:o.MuiCssBaseline)==null?void 0:s.styleOverrides;return i&&(r=[r,i]),r},s3="mui-ecs",sat=t=>{const e=bPe(t,!1),n=Array.isArray(e)?e[0]:e;return!t.vars&&n&&(n.html[`:root:has(${s3})`]={colorScheme:t.palette.mode}),t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([r,i])=>{var s,a;const o=t.getColorSchemeSelector(r);o.startsWith("@")?n[o]={[`:root:not(:has(.${s3}))`]:{colorScheme:(s=i.palette)==null?void 0:s.mode}}:n[o.replace(/\s*&/,"")]={[`&:not(:has(.${s3}))`]:{colorScheme:(a=i.palette)==null?void 0:a.mode}}}),e},aat=Ree(cq?({theme:t,enableColorScheme:e})=>bPe(t,e):({theme:t})=>sat(t));function lat(t){const e=_t({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return C.jsxs(D.Fragment,{children:[cq&&C.jsx(aat,{enableColorScheme:r}),!cq&&!r&&C.jsx("span",{className:s3,style:{display:"none"}}),n]})}function cat(t){const e=yi(t);return e.body===t?xc(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function KT(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function $de(t){return parseInt(xc(t).getComputedStyle(t).paddingRight,10)||0}function uat(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(t.tagName),r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function Fde(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,s=>{const a=!o.includes(s),l=!uat(s);a&&l&&KT(s,i)})}function iW(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function fat(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(cat(r)){const s=zAe(xc(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${$de(r)+s}px`;const a=yi(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${$de(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=yi(r).body;else{const s=r.parentElement,a=xc(r);o=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s: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:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function dat(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class hat{constructor(){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&&KT(e.modalRef,!1);const i=dat(n);Fde(n,e.mount,e.modalRef,i,!0);const o=iW(this.containers,s=>s.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=iW(this.containers,o=>o.modals.includes(e)),i=this.containers[r];i.restore||(i.restore=fat(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=iW(this.containers,s=>s.modals.includes(e)),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&&KT(e.modalRef,n),Fde(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&KT(s.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}const pat=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function gat(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 mat(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 vat(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||mat(t))}function yat(t){const e=[],n=[];return Array.from(t.querySelectorAll(pat)).forEach((r,i)=>{const o=gat(r);o===-1||!vat(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 xat(){return!0}function wPe(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=yat,isEnabled:s=xat,open:a}=t,l=D.useRef(!1),c=D.useRef(null),u=D.useRef(null),f=D.useRef(null),d=D.useRef(null),h=D.useRef(!1),p=D.useRef(null),g=dn(Ry(e),p),m=D.useRef(null);D.useEffect(()=>{!a||!p.current||(h.current=!n)},[n,a]),D.useEffect(()=>{if(!a||!p.current)return;const x=yi(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)}},[a]),D.useEffect(()=>{if(!a||!p.current)return;const x=yi(p.current),b=S=>{m.current=S,!(r||!s()||S.key!=="Tab")&&x.activeElement===p.current&&S.shiftKey&&(l.current=!0,u.current&&u.current.focus())},w=()=>{var k,E;const S=p.current;if(S===null)return;if(!x.hasFocus()||!s()||l.current){l.current=!1;return}if(S.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 O=[];if((x.activeElement===c.current||x.activeElement===u.current)&&(O=o(p.current)),O.length>0){const P=!!((k=m.current)!=null&&k.shiftKey&&((E=m.current)==null?void 0:E.key)==="Tab"),A=O[0],R=O[O.length-1];typeof A!="string"&&typeof R!="string"&&(P?R.focus():A.focus())}else S.focus()};x.addEventListener("focusin",w),x.addEventListener("keydown",b,!0);const _=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&w()},50);return()=>{clearInterval(_),x.removeEventListener("focusin",w),x.removeEventListener("keydown",b,!0)}},[n,r,i,s,a,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 C.jsxs(D.Fragment,{children:[C.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),D.cloneElement(e,{ref:g,onFocus:v}),C.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}function bat(t){return typeof t=="function"?t():t}function wat(t){return t?t.props.hasOwnProperty("in"):!1}const JD=new hat;function _at(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:o,onTransitionExited:s,children:a,onClose:l,open:c,rootRef:u}=t,f=D.useRef({}),d=D.useRef(null),h=D.useRef(null),p=dn(h,u),[g,m]=D.useState(!c),v=wat(a);let y=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(y=!1);const x=()=>yi(d.current),b=()=>(f.current.modalRef=h.current,f.current.mount=d.current,f.current),w=()=>{JD.mount(b(),{disableScrollLock:r}),h.current&&(h.current.scrollTop=0)},_=st(()=>{const M=bat(e)||x().body;JD.add(b(),M),h.current&&w()}),S=()=>JD.isTopModal(b()),O=st(M=>{d.current=M,M&&(c&&S()?w():h.current&&KT(h.current,y))}),k=D.useCallback(()=>{JD.remove(b(),y)},[y]);D.useEffect(()=>()=>{k()},[k]),D.useEffect(()=>{c?_():(!v||!i)&&k()},[c,k,v,i,_]);const E=M=>I=>{var z;(z=M.onKeyDown)==null||z.call(M,I),!(I.key!=="Escape"||I.which===229||!S())&&(n||(I.stopPropagation(),l&&l(I,"escapeKeyDown")))},P=M=>I=>{var z;(z=M.onClick)==null||z.call(M,I),I.target===I.currentTarget&&l&&l(I,"backdropClick")};return{getRootProps:(M={})=>{const I=Mx(t);delete I.onTransitionEnter,delete I.onTransitionExited;const z={...I,...M};return{role:"presentation",...z,onKeyDown:E(z),ref:p}},getBackdropProps:(M={})=>{const I=M;return{"aria-hidden":!0,...I,onClick:P(I),open:c}},getTransitionProps:()=>{const M=()=>{m(!1),o&&o()},I=()=>{m(!0),s&&s(),i&&k()};return{onEnter:ZH(M,a==null?void 0:a.props.onEnter),onExited:ZH(I,a==null?void 0:a.props.onExited)}},rootRef:p,portalRef:O,isTopModal:S,exited:g,hasTransition:v}}function Sat(t){return Xe("MuiModal",t)}He("MuiModal",["root","hidden","backdrop"]);const Cat=t=>{const{open:e,exited:n,classes:r}=t;return qe({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},Sat,r)},Oat=be("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(wt(({theme:t})=>({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]}))),Eat=be(gPe,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),_Pe=D.forwardRef(function(e,n){const r=_t({name:"MuiModal",props:e}),{BackdropComponent:i=Eat,BackdropProps:o,classes:s,className:a,closeAfterTransition:l=!1,children:c,container:u,component:f,components:d={},componentsProps:h={},disableAutoFocus:p=!1,disableEnforceFocus:g=!1,disableEscapeKeyDown:m=!1,disablePortal:v=!1,disableRestoreFocus:y=!1,disableScrollLock:x=!1,hideBackdrop:b=!1,keepMounted:w=!1,onBackdropClick:_,onClose:S,onTransitionEnter:O,onTransitionExited:k,open:E,slotProps:P={},slots:A={},theme:R,...T}=r,M={...r,closeAfterTransition:l,disableAutoFocus:p,disableEnforceFocus:g,disableEscapeKeyDown:m,disablePortal:v,disableRestoreFocus:y,disableScrollLock:x,hideBackdrop:b,keepMounted:w},{getRootProps:I,getBackdropProps:z,getTransitionProps:F,portalRef:N,isTopModal:L,exited:B,hasTransition:$}=_at({...M,rootRef:n}),j={...M,exited:B},X=Cat(j),V={};if(c.props.tabIndex===void 0&&(V.tabIndex="-1"),$){const{onEnter:te,onExited:ae}=F();V.onEnter=te,V.onExited=ae}const Y={...T,slots:{root:d.Root,backdrop:d.Backdrop,...A},slotProps:{...h,...P}},[le,K]=Jl("root",{elementType:Oat,externalForwardedProps:Y,getSlotProps:I,additionalProps:{ref:n,as:f},ownerState:j,className:Oe(a,X==null?void 0:X.root,!j.open&&j.exited&&(X==null?void 0:X.hidden))}),[ee,re]=Jl("backdrop",{elementType:i,externalForwardedProps:Y,additionalProps:o,getSlotProps:te=>z({...te,onClick:ae=>{_&&_(ae),te!=null&&te.onClick&&te.onClick(ae)}}),className:Oe(o==null?void 0:o.className,X==null?void 0:X.backdrop),ownerState:j}),me=dn(o==null?void 0:o.ref,re.ref);return!w&&!E&&(!$||B)?null:C.jsx(hPe,{ref:N,container:u,disablePortal:v,children:C.jsxs(le,{...K,children:[!b&&i?C.jsx(ee,{...re,ref:me}):null,C.jsx(wPe,{disableEnforceFocus:g,disableAutoFocus:p,disableRestoreFocus:y,isEnabled:L,open:E,children:D.cloneElement(c,V)})]})})});function Tat(t){return Xe("MuiDialog",t)}const ZT=He("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),SPe=D.createContext({}),kat=be(gPe,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),Aat=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=t,s={root:["root"],container:["container",`scroll${Me(n)}`],paper:["paper",`paperScroll${Me(n)}`,`paperWidth${Me(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return qe(s,Tat,e)},Pat=be(_Pe,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),Mat=be("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${Me(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),Rat=be(kl,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${Me(n.scroll)}`],e[`paperWidth${Me(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(wt(({theme:t})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${ZT.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter(e=>e!=="xs").map(e=>({props:{maxWidth:e},style:{maxWidth:`${t.breakpoints.values[e]}${t.breakpoints.unit}`,[`&.${ZT.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e]+32*2)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${ZT.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),ed=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialog"}),i=To(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:u,children:f,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:g=!1,maxWidth:m="sm",onBackdropClick:v,onClick:y,onClose:x,open:b,PaperComponent:w=kl,PaperProps:_={},scroll:S="paper",TransitionComponent:O=eO,transitionDuration:k=o,TransitionProps:E,...P}=r,A={...r,disableEscapeKeyDown:h,fullScreen:p,fullWidth:g,maxWidth:m,scroll:S},R=Aat(A),T=D.useRef(),M=N=>{T.current=N.target===N.currentTarget},I=N=>{y&&y(N),T.current&&(T.current=null,v&&v(N),x&&x(N,"backdropClick"))},z=Jf(a),F=D.useMemo(()=>({titleId:z}),[z]);return C.jsx(Pat,{className:Oe(R.root,d),closeAfterTransition:!0,components:{Backdrop:kat},componentsProps:{backdrop:{transitionDuration:k,as:c,...u}},disableEscapeKeyDown:h,onClose:x,open:b,ref:n,onClick:I,ownerState:A,...P,children:C.jsx(O,{appear:!0,in:b,timeout:k,role:"presentation",...E,children:C.jsx(Mat,{className:Oe(R.container),onMouseDown:M,ownerState:A,children:C.jsx(Rat,{as:w,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":z,"aria-modal":l,..._,className:Oe(R.paper,_.className),ownerState:A,children:C.jsx(SPe.Provider,{value:F,children:f})})})})})});function Dat(t){return Xe("MuiDialogActions",t)}He("MuiDialogActions",["root","spacing"]);const Iat=t=>{const{classes:e,disableSpacing:n}=t;return qe({root:["root",!n&&"spacing"]},Dat,e)},Lat=be("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:t})=>!t.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Jb=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1,...s}=r,a={...r,disableSpacing:o},l=Iat(a);return C.jsx(Lat,{className:Oe(l.root,i),ownerState:a,ref:n,...s})});function $at(t){return Xe("MuiDialogContent",t)}He("MuiDialogContent",["root","dividers"]);function Fat(t){return Xe("MuiDialogTitle",t)}const Nat=He("MuiDialogTitle",["root"]),zat=t=>{const{classes:e,dividers:n}=t;return qe({root:["root",n&&"dividers"]},$at,e)},jat=be("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(wt(({theme:t})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:e})=>e.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${Nat.root} + &`]:{paddingTop:0}}}]}))),Nf=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1,...s}=r,a={...r,dividers:o},l=zat(a);return C.jsx(jat,{className:Oe(l.root,i),ownerState:a,ref:n,...s})});function Bat(t){return Xe("MuiDialogContentText",t)}He("MuiDialogContentText",["root"]);const Uat=t=>{const{classes:e}=t,r=qe({root:["root"]},Bat,e);return{...e,...r}},Wat=be(Jt,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Vat=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialogContentText"}),{children:i,className:o,...s}=r,a=Uat(s);return C.jsx(Wat,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Oe(a.root,o),...r,classes:a})}),Gat=t=>{const{classes:e}=t;return qe({root:["root"]},Fat,e)},Hat=be(Jt,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),$y=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDialogTitle"}),{className:i,id:o,...s}=r,a=r,l=Gat(a),{titleId:c=o}=D.useContext(SPe);return C.jsx(Hat,{component:"h2",className:Oe(l.root,i),ownerState:a,ref:n,variant:"h6",id:o??c,...s})});function qat(t){return Xe("MuiDivider",t)}const Nde=He("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),Xat=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=t;return qe({root:["root",e&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},qat,r)},Yat=be("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]}})(wt(({theme:t})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:kt(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&e.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>e.orientation==="vertical"&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>e.textAlign==="right"&&e.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>e.textAlign==="left"&&e.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),Qat=be("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(wt(({theme:t})=>({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}))),zf=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,orientation:a="horizontal",component:l=o||a==="vertical"?"div":"hr",flexItem:c=!1,light:u=!1,role:f=l!=="hr"?"separator":void 0,textAlign:d="center",variant:h="fullWidth",...p}=r,g={...r,absolute:i,component:l,flexItem:c,light:u,orientation:a,role:f,textAlign:d,variant:h},m=Xat(g);return C.jsx(Yat,{as:l,className:Oe(m.root,s),role:f,ref:n,ownerState:g,"aria-orientation":f==="separator"&&(l!=="hr"||a==="vertical")?a:void 0,...p,children:o?C.jsx(Qat,{className:m.wrapper,ownerState:g,children:o}):null})});zf&&(zf.muiSkipListHighlight=!0);function Kat(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=xc(e);let s;if(e.fakeTransform)s=e.fakeTransform;else{const c=o.getComputedStyle(e);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}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 Zat(t){return typeof t=="function"?t():t}function eI(t,e,n){const r=Zat(n),i=Kat(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const Jat=D.forwardRef(function(e,n){const r=To(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:d,onEnter:h,onEntered:p,onEntering:g,onExit:m,onExited:v,onExiting:y,style:x,timeout:b=o,TransitionComponent:w=Rc,..._}=e,S=D.useRef(null),O=dn(Ry(l),S,n),k=F=>N=>{F&&(N===void 0?F(S.current):F(S.current,N))},E=k((F,N)=>{eI(u,F,c),Fee(F),h&&h(F,N)}),P=k((F,N)=>{const L=Jv({timeout:b,style:x,easing:f},{mode:"enter"});F.style.webkitTransition=r.transitions.create("-webkit-transform",{...L}),F.style.transition=r.transitions.create("transform",{...L}),F.style.webkitTransform="none",F.style.transform="none",g&&g(F,N)}),A=k(p),R=k(y),T=k(F=>{const N=Jv({timeout:b,style:x,easing:f},{mode:"exit"});F.style.webkitTransition=r.transitions.create("-webkit-transform",N),F.style.transition=r.transitions.create("transform",N),eI(u,F,c),m&&m(F)}),M=k(F=>{F.style.webkitTransition="",F.style.transition="",v&&v(F)}),I=F=>{s&&s(S.current,F)},z=D.useCallback(()=>{S.current&&eI(u,S.current,c)},[u,c]);return D.useEffect(()=>{if(d||u==="down"||u==="right")return;const F=EM(()=>{S.current&&eI(u,S.current,c)}),N=xc(S.current);return N.addEventListener("resize",F),()=>{F.clear(),N.removeEventListener("resize",F)}},[u,d,c]),D.useEffect(()=>{d||z()},[d,z]),C.jsx(w,{nodeRef:S,onEnter:E,onEntered:A,onEntering:P,onExit:T,onExited:M,onExiting:R,addEndListener:I,appear:a,in:d,timeout:b,..._,children:(F,N)=>D.cloneElement(l,{ref:O,style:{visibility:F==="exited"&&!d?"hidden":void 0,...x,...l.props.style},...N})})}),elt=t=>{const{classes:e,disableUnderline:n,startAdornment:r,endAdornment:i,size:o,hiddenLabel:s,multiline:a}=t,l={root:["root",!n&&"underline",r&&"adornedStart",i&&"adornedEnd",o==="small"&&`size${Me(o)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},c=qe(l,Got,e);return{...e,...c}},tlt=be(x4,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...v4(t,e),!n.disableUnderline&&e.underline]}})(wt(({theme:t})=>{const e=t.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r,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:i,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r}},[`&.${p0.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r},[`&.${p0.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{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"},[`&.${p0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${p0.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})`:n}`,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(.${p0.disabled}, .${p0.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${p0.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(pr()).map(([s])=>{var a;return{props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(a=(t.vars||t).palette[s])==null?void 0:a.main}`}}}}),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:a})=>s.multiline&&a==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),nlt=be(b4,{name:"MuiFilledInput",slot:"Input",overridesResolver:y4})(wt(({theme:t})=>({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"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),NF=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFilledInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,hiddenLabel:l,inputComponent:c="input",multiline:u=!1,slotProps:f,slots:d={},type:h="text",...p}=r,g={...r,disableUnderline:i,fullWidth:a,inputComponent:c,multiline:u,type:h},m=elt(r),v={root:{ownerState:g},input:{ownerState:g}},y=f??s?Wo(v,f??s):v,x=d.root??o.Root??tlt,b=d.input??o.Input??nlt;return C.jsx(Hee,{slots:{root:x,input:b},componentsProps:y,fullWidth:a,inputComponent:c,multiline:u,ref:n,type:h,...p,classes:m})});NF&&(NF.muiName="Input");function rlt(t){return Xe("MuiFormControl",t)}He("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const ilt=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${Me(n)}`,r&&"fullWidth"]};return qe(i,rlt,e)},olt=be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>({...e.root,...e[`margin${Me(t.margin)}`],...t.fullWidth&&e.fullWidth})})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),td=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:h="none",required:p=!1,size:g="medium",variant:m="outlined",...v}=r,y={...r,color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:g,variant:m},x=ilt(y),[b,w]=D.useState(()=>{let R=!1;return i&&D.Children.forEach(i,T=>{if(!i3(T,["Input","Select"]))return;const M=i3(T,["Select"])?T.props.input:T;M&&jot(M.props)&&(R=!0)}),R}),[_,S]=D.useState(()=>{let R=!1;return i&&D.Children.forEach(i,T=>{i3(T,["Input","Select"])&&(LF(T.props,!0)||LF(T.props.inputProps,!0))&&(R=!0)}),R}),[O,k]=D.useState(!1);l&&O&&k(!1);const E=u!==void 0&&!l?u:O;let P;D.useRef(!1);const A=D.useMemo(()=>({adornedStart:b,setAdornedStart:w,color:s,disabled:l,error:c,filled:_,focused:E,fullWidth:f,hiddenLabel:d,size:g,onBlur:()=>{k(!1)},onEmpty:()=>{S(!1)},onFilled:()=>{S(!0)},onFocus:()=>{k(!0)},registerEffect:P,required:p,variant:m}),[b,s,l,c,_,E,f,d,P,p,g,m]);return C.jsx(m4.Provider,{value:A,children:C.jsx(olt,{as:a,ownerState:y,className:Oe(x.root,o),ref:n,...v,children:i})})});function slt(t){return Xe("MuiFormControlLabel",t)}const Q2=He("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),alt=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,s={root:["root",n&&"disabled",`labelPlacement${Me(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return qe(s,slt,e)},llt=be("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Q2.label}`]:e.label},e.root,e[`labelPlacement${Me(n.labelPlacement)}`]]}})(wt(({theme:t})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Q2.disabled}`]:{cursor:"default"},[`& .${Q2.label}`]:{[`&.${Q2.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>e==="start"||e==="top"||e==="bottom",style:{marginLeft:16}}]}))),clt=be("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(wt(({theme:t})=>({[`&.${Q2.error}`]:{color:(t.vars||t).palette.error.main}}))),sg=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormControlLabel"}),{checked:i,className:o,componentsProps:s={},control:a,disabled:l,disableTypography:c,inputRef:u,label:f,labelPlacement:d="end",name:h,onChange:p,required:g,slots:m={},slotProps:v={},value:y,...x}=r,b=Na(),w=l??a.props.disabled??(b==null?void 0:b.disabled),_=g??a.props.required,S={disabled:w,required:_};["checked","name","onChange","value","inputRef"].forEach(M=>{typeof a.props[M]>"u"&&typeof r[M]<"u"&&(S[M]=r[M])});const O=Iy({props:r,muiFormControl:b,states:["error"]}),k={...r,disabled:w,labelPlacement:d,required:_,error:O.error},E=alt(k),P={slots:m,slotProps:{...s,...v}},[A,R]=Jl("typography",{elementType:Jt,externalForwardedProps:P,ownerState:k});let T=f;return T!=null&&T.type!==Jt&&!c&&(T=C.jsx(A,{component:"span",...R,className:Oe(E.label,R==null?void 0:R.className),children:T})),C.jsxs(llt,{className:Oe(E.root,o),ownerState:k,ref:n,...x,children:[D.cloneElement(a,S),_?C.jsxs("div",{children:[T,C.jsxs(clt,{ownerState:k,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]}):T]})});function ult(t){return Xe("MuiFormGroup",t)}He("MuiFormGroup",["root","row","error"]);const flt=t=>{const{classes:e,row:n,error:r}=t;return qe({root:["root",n&&"row",r&&"error"]},ult,e)},dlt=be("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),hlt=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1,...s}=r,a=Na(),l=Iy({props:r,muiFormControl:a,states:["error"]}),c={...r,row:o,error:l.error},u=flt(c);return C.jsx(dlt,{className:Oe(u.root,i),ownerState:c,ref:n,...s})});function plt(t){return Xe("MuiFormHelperText",t)}const zde=He("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var jde;const glt=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${Me(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return qe(c,plt,e)},mlt=be("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${Me(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(wt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${zde.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${zde.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),Xee=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p",disabled:a,error:l,filled:c,focused:u,margin:f,required:d,variant:h,...p}=r,g=Na(),m=Iy({props:r,muiFormControl:g,states:["variant","size","disabled","error","filled","focused","required"]}),v={...r,component:s,contained:m.variant==="filled"||m.variant==="outlined",variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete v.ownerState;const y=glt(v);return C.jsx(mlt,{as:s,className:Oe(y.root,o),ref:n,...p,ownerState:v,children:i===" "?jde||(jde=C.jsx("span",{className:"notranslate",children:"​"})):i})});function vlt(t){return Xe("MuiFormLabel",t)}const JT=He("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ylt=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=t,l={root:["root",`color${Me(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return qe(l,vlt,e)},xlt=be("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>({...e.root,...t.color==="secondary"&&e.colorSecondary,...t.filled&&e.filled})})(wt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{[`&.${JT.focused}`]:{color:(t.vars||t).palette[e].main}}})),{props:{},style:{[`&.${JT.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${JT.error}`]:{color:(t.vars||t).palette.error.main}}}]}))),blt=be("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(wt(({theme:t})=>({[`&.${JT.error}`]:{color:(t.vars||t).palette.error.main}}))),CPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiFormLabel"}),{children:i,className:o,color:s,component:a="label",disabled:l,error:c,filled:u,focused:f,required:d,...h}=r,p=Na(),g=Iy({props:r,muiFormControl:p,states:["color","required","focused","disabled","error","filled"]}),m={...r,color:g.color||"primary",component:a,disabled:g.disabled,error:g.error,filled:g.filled,focused:g.focused,required:g.required},v=ylt(m);return C.jsxs(xlt,{as:a,ownerState:m,className:Oe(v.root,o),ref:n,...h,children:[i,g.required&&C.jsxs(blt,{ownerState:m,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]})}),Bde=D.createContext();function wlt(t){return Xe("MuiGrid",t)}const _lt=[0,1,2,3,4,5,6,7,8,9,10],Slt=["column-reverse","column","row-reverse","row"],Clt=["nowrap","wrap-reverse","wrap"],RE=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],oA=He("MuiGrid",["root","container","item","zeroMinWidth",..._lt.map(t=>`spacing-xs-${t}`),...Slt.map(t=>`direction-xs-${t}`),...Clt.map(t=>`wrap-xs-${t}`),...RE.map(t=>`grid-xs-${t}`),...RE.map(t=>`grid-sm-${t}`),...RE.map(t=>`grid-md-${t}`),...RE.map(t=>`grid-lg-${t}`),...RE.map(t=>`grid-xl-${t}`)]);function Olt({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 s=qj({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*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} + ${u})`;c={flexBasis:f,maxWidth:f}}}o={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 Elt({theme:t,ownerState:e}){const n=qj({values:e.direction,breakpoints:t.breakpoints.values});return wu({theme:t},n,r=>{const i={flexDirection:r};return r.startsWith("column")&&(i[`& > .${oA.item}`]={maxWidth:"none"}),i})}function OPe({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 Tlt({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=qj({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=OPe({breakpoints:t.breakpoints.values,values:o})),i=wu({theme:t},o,(a,l)=>{const c=t.spacing(a);return c!=="0px"?{marginTop:t.spacing(-a),[`& > .${oA.item}`]:{paddingTop:c}}:s!=null&&s.includes(l)?{}:{marginTop:0,[`& > .${oA.item}`]:{paddingTop:0}}})}return i}function klt({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=qj({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=OPe({breakpoints:t.breakpoints.values,values:o})),i=wu({theme:t},o,(a,l)=>{const c=t.spacing(a);if(c!=="0px"){const u=t.spacing(-a);return{width:`calc(100% + ${c})`,marginLeft:u,[`& > .${oA.item}`]:{paddingLeft:c}}}return s!=null&&s.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${oA.item}`]:{paddingLeft:0}}})}return i}function Alt(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 Plt=be("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=Alt(s,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)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...f]}})(({ownerState:t})=>({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}}),Elt,Tlt,klt,Olt);function Mlt(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 Rlt=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let c=[];n&&(c=Mlt(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",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return qe(f,wlt,e)},oW=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiGrid"}),{breakpoints:i}=To(),o=Eee(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:g="wrap",zeroMinWidth:m=!1,...v}=o,y=h||p,x=l||p,b=D.useContext(Bde),w=u?a||12:b,_={},S={...v};i.keys.forEach(E=>{v[E]!=null&&(_[E]=v[E],delete S[E])});const O={...o,columns:w,container:u,direction:f,item:d,rowSpacing:y,columnSpacing:x,wrap:g,zeroMinWidth:m,spacing:p,..._,breakpoints:i.keys},k=Rlt(O);return C.jsx(Bde.Provider,{value:w,children:C.jsx(Plt,{ownerState:O,className:Oe(k.root,s),as:c,ref:n,...S})})});function uq(t){return`scale(${t}, ${t**2})`}const Dlt={entering:{opacity:1,transform:uq(1)},entered:{opacity:1,transform:"none"}},sW=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),ob=D.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:h,style:p,timeout:g="auto",TransitionComponent:m=Rc,...v}=e,y=cv(),x=D.useRef(),b=To(),w=D.useRef(null),_=dn(w,Ry(o),n),S=M=>I=>{if(M){const z=w.current;I===void 0?M(z):M(z,I)}},O=S(u),k=S((M,I)=>{Fee(M);const{duration:z,delay:F,easing:N}=Jv({style:p,timeout:g,easing:s},{mode:"enter"});let L;g==="auto"?(L=b.transitions.getAutoHeightDuration(M.clientHeight),x.current=L):L=z,M.style.transition=[b.transitions.create("opacity",{duration:L,delay:F}),b.transitions.create("transform",{duration:sW?L:L*.666,delay:F,easing:N})].join(","),l&&l(M,I)}),E=S(c),P=S(h),A=S(M=>{const{duration:I,delay:z,easing:F}=Jv({style:p,timeout:g,easing:s},{mode:"exit"});let N;g==="auto"?(N=b.transitions.getAutoHeightDuration(M.clientHeight),x.current=N):N=I,M.style.transition=[b.transitions.create("opacity",{duration:N,delay:z}),b.transitions.create("transform",{duration:sW?N:N*.666,delay:sW?z:z||N*.333,easing:F})].join(","),M.style.opacity=0,M.style.transform=uq(.75),f&&f(M)}),R=S(d),T=M=>{g==="auto"&&y.start(x.current||0,M),r&&r(w.current,M)};return C.jsx(m,{appear:i,in:a,nodeRef:w,onEnter:k,onEntered:E,onEntering:O,onExit:A,onExited:R,onExiting:P,addEndListener:T,timeout:g==="auto"?null:g,...v,children:(M,I)=>D.cloneElement(o,{style:{opacity:0,transform:uq(.75),visibility:M==="exited"&&!a?"hidden":void 0,...Dlt[M],...p,...o.props.style},ref:_,...I})})});ob&&(ob.muiSupportAuto=!0);function Ilt(t){return Xe("MuiIcon",t)}He("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Llt=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${Me(e)}`,`fontSize${Me(n)}`]};return qe(i,Ilt,r)},$lt=be("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Me(n.color)}`],e[`fontSize${Me(n.fontSize)}`]]}})(wt(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}}))]}))),kS=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiIcon"}),{baseClassName:i="material-icons",className:o,color:s="inherit",component:a="span",fontSize:l="medium",...c}=r,u={...r,baseClassName:i,color:s,component:a,fontSize:l},f=Llt(u);return C.jsx($lt,{as:a,className:Oe(i,"notranslate",f.root,o),ownerState:u,"aria-hidden":!0,ref:n,...c})});kS&&(kS.muiName="Icon");const Flt=t=>{const{classes:e,disableUnderline:n}=t,i=qe({root:["root",!n&&"underline"],input:["input"]},Wot,e);return{...e,...i}},Nlt=be(x4,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...v4(t,e),!n.disableUnderline&&e.underline]}})(wt(({theme:t})=>{let n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{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"},[`&.${ME.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ME.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,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(.${ME.disabled}, .${ME.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${ME.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(pr()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}}))]}})),zlt=be(b4,{name:"MuiInput",slot:"Input",overridesResolver:y4})({}),Dg=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:f={},type:d="text",...h}=r,p=Flt(r),m={root:{ownerState:{disableUnderline:i}}},v=u??s?Wo(u??s,m):m,y=f.root??o.Root??Nlt,x=f.input??o.Input??zlt;return C.jsx(Hee,{slots:{root:y,input:x},slotProps:v,fullWidth:a,inputComponent:l,multiline:c,ref:n,type:d,...h,classes:p})});Dg&&(Dg.muiName="Input");function jlt(t){return Xe("MuiInputAdornment",t)}const Ude=He("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var Wde;const Blt=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Me(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},Ult=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=t,a={root:["root",n&&"disablePointerEvents",i&&`position${Me(i)}`,s,r&&"hiddenLabel",o&&`size${Me(o)}`]};return qe(a,jlt,e)},Wlt=be("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Blt})(wt(({theme:t})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${Ude.positionStart}&:not(.${Ude.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),EPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:c,variant:u,...f}=r,d=Na()||{};let h=u;u&&d.variant,d&&!h&&(h=d.variant);const p={...r,hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:a,position:c,variant:h},g=Ult(p);return C.jsx(m4.Provider,{value:null,children:C.jsx(Wlt,{as:s,ownerState:p,className:Oe(g.root,o),ref:n,...f,children:typeof i=="string"&&!l?C.jsx(Jt,{color:"textSecondary",children:i}):C.jsxs(D.Fragment,{children:[c==="start"?Wde||(Wde=C.jsx("span",{className:"notranslate",children:"​"})):null,i]})})})});function Vlt(t){return Xe("MuiInputLabel",t)}He("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Glt=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${Me(r)}`,s],asterisk:[a&&"asterisk"]},c=qe(l,Vlt,e);return{...e,...c}},Hlt=be(CPe,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${JT.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]]}})(wt(({theme:t})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:e})=>e.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:e})=>e.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:e,ownerState:n,size:r})=>e==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),Fy=D.forwardRef(function(e,n){const r=_t({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,margin:o,shrink:s,variant:a,className:l,...c}=r,u=Na();let f=s;typeof f>"u"&&u&&(f=u.filled||u.focused||u.adornedStart);const d=Iy({props:r,muiFormControl:u,states:["size","variant","required","focused"]}),h={...r,disableAnimation:i,formControl:u,shrink:f,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=Glt(h);return C.jsx(Hlt,{"data-shrink":f,ref:n,className:Oe(p.root,l),...c,ownerState:h,classes:p})});function qlt(t){return Xe("MuiLinearProgress",t)}He("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const fq=4,dq=My` 0% { left: -35%; right: 100%; @@ -275,24 +275,24 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann } `,Qlt=typeof pq!="string"?JC` animation: ${pq} 3s infinite linear; - `:null,Klt=t=>{const{classes:e,variant:n,color:r}=t,i={root:["root",`color${Me(r)}`,n],dashed:["dashed",`dashedColor${Me(r)}`],bar1:["bar",`barColor${Me(r)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar",n!=="buffer"&&`barColor${Me(r)}`,n==="buffer"&&`color${Me(r)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return qe(i,qlt,e)},Yee=(t,e)=>t.vars?t.vars.palette.LinearProgress[`${e}Bg`]:t.palette.mode==="light"?Eh(t.palette[e].main,.62):Oh(t.palette[e].main,.5),Zlt=be("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${Me(n.color)}`],e[n.variant]]}})(wt(({theme:t})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{backgroundColor:Yee(t,e)}})),{props:({ownerState:e})=>e.color==="inherit"&&e.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),Jlt=be("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.dashed,e[`dashedColor${Me(n.color)}`]]}})(wt(({theme:t})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(t.palette).filter(pr()).map(([e])=>{const n=Yee(t,e);return{props:{color:e},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),Qlt||{animation:`${pq} 3s infinite linear`}),ect=be("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.bar,e[`barColor${Me(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&e.bar1Indeterminate,n.variant==="determinate"&&e.bar1Determinate,n.variant==="buffer"&&e.bar1Buffer]}})(wt(({theme:t})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{backgroundColor:(t.vars||t).palette[e].main}})),{props:{variant:"determinate"},style:{transition:`transform .${fq}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${fq}s linear`}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:{width:"auto"}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:Xlt||{animation:`${dq} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),tct=be("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.bar,e[`barColor${Me(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&e.bar2Indeterminate,n.variant==="buffer"&&e.bar2Buffer]}})(wt(({theme:t})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{"--LinearProgressBar2-barColor":(t.vars||t).palette[e].main}})),{props:({ownerState:e})=>e.variant!=="buffer"&&e.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:e})=>e.variant!=="buffer"&&e.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,variant:"buffer"},style:{backgroundColor:Yee(t,e),transition:`transform .${fq}s linear`}})),{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:{width:"auto"}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:Ylt||{animation:`${hq} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),nct=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiLinearProgress"}),{className:i,color:o="primary",value:s,valueBuffer:a,variant:l="indeterminate",...c}=r,u={...r,color:o,variant:l},f=Klt(u),d=Eo(),h={},p={bar1:{},bar2:{}};if((l==="determinate"||l==="buffer")&&s!==void 0){h["aria-valuenow"]=Math.round(s),h["aria-valuemin"]=0,h["aria-valuemax"]=100;let g=s-100;d&&(g=-g),p.bar1.transform=`translateX(${g}%)`}if(l==="buffer"&&a!==void 0){let g=(a||0)-100;d&&(g=-g),p.bar2.transform=`translateX(${g}%)`}return C.jsxs(Zlt,{className:Oe(f.root,i),ownerState:u,role:"progressbar",...h,ref:n,...c,children:[l==="buffer"?C.jsx(Jlt,{className:f.dashed,ownerState:u}):null,C.jsx(ect,{className:f.bar1,ownerState:u,style:p.bar1}),l==="determinate"?null:C.jsx(tct,{className:f.bar2,ownerState:u,style:p.bar2})]})});function rct(t){return Xe("MuiLink",t)}const ict=He("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),oct=({theme:t,ownerState:e})=>{const n=e.color,r=wS(t,`palette.${n}`,!1)||e.color,i=wS(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:kt(r,.4)},Vde={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},sct=t=>{const{classes:e,component:n,focusVisible:r,underline:i}=t,o={root:["root",`underline${Me(i)}`,n==="button"&&"button",r&&"focusVisible"]};return qe(o,rct,e)},act=be(Jt,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${Me(n.underline)}`],n.component==="button"&&e.button]}})(wt(({theme:t})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:n})=>e==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{underline:"always",color:e},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette[e].mainChannel} / 0.4)`:kt(t.palette[e].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:kt(t.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.secondaryChannel} / 0.4)`:kt(t.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(t.vars||t).palette.text.disabled}},{props:{component:"button"},style:{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"},[`&.${ict.focusVisible}`]:{outline:"auto"}}}]}))),lct=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiLink"}),i=To(),{className:o,color:s="primary",component:a="a",onBlur:l,onFocus:c,TypographyClasses:u,underline:f="always",variant:d="inherit",sx:h,...p}=r,[g,m]=D.useState(!1),v=w=>{Zv(w.target)||m(!1),l&&l(w)},y=w=>{Zv(w.target)&&m(!0),c&&c(w)},x={...r,color:s,component:a,focusVisible:g,underline:f,variant:d},b=sct(x);return C.jsx(act,{color:s,className:Oe(b.root,o),classes:u,component:a,onBlur:v,onFocus:y,ref:n,ownerState:x,variant:d,...p,sx:[...Vde[s]===void 0?[{color:s}]:[],...Array.isArray(h)?h:[h]],style:{...p.style,...f==="always"&&s!=="inherit"&&!Vde[s]&&{"--Link-underlineColor":oct({theme:i,ownerState:x})}}})}),Df=D.createContext({});function cct(t){return Xe("MuiList",t)}He("MuiList",["root","padding","dense","subheader"]);const uct=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return qe({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},cct,e)},fct=be("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]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>t.subheader,style:{paddingTop:0}}]}),RM=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c,...u}=r,f=D.useMemo(()=>({dense:a}),[a]),d={...r,component:s,dense:a,disablePadding:l},h=uct(d);return C.jsx(Df.Provider,{value:f,children:C.jsxs(fct,{as:s,className:Oe(h.root,o),ref:n,ownerState:d,...u,children:[c,i]})})});function dct(t){return Xe("MuiListItem",t)}He("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function hct(t){return Xe("MuiListItemButton",t)}const Fw=He("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),pct=(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]},gct=t=>{const{alignItems:e,classes:n,dense:r,disabled:i,disableGutters:o,divider:s,selected:a}=t,c=qe({root:["root",r&&"dense",!o&&"gutters",s&&"divider",i&&"disabled",e==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},hct,n);return{...n,...c}},mct=be(Ff,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:pct})(wt(({theme:t})=>({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"}},[`&.${Fw.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Fw.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)}},[`&.${Fw.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)}},[`&.${Fw.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Fw.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),TPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:s="div",children:a,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:d=!1,className:h,...p}=r,g=D.useContext(Df),m=D.useMemo(()=>({dense:l||g.dense||!1,alignItems:i,disableGutters:c}),[i,g.dense,l,c]),v=D.useRef(null);Ei(()=>{o&&v.current&&v.current.focus()},[o]);const y={...r,alignItems:i,dense:m.dense,disableGutters:c,divider:u,selected:d},x=gct(y),b=dn(v,n);return C.jsx(Df.Provider,{value:m,children:C.jsx(mct,{ref:b,href:p.href||p.to,component:(p.href||p.to)&&s==="div"?"button":s,focusVisibleClassName:Oe(x.focusVisible,f),ownerState:y,className:Oe(x.root,h),...p,classes:x,children:a})})});function vct(t){return Xe("MuiListItemSecondaryAction",t)}He("MuiListItemSecondaryAction",["root","disableGutters"]);const yct=t=>{const{disableGutters:e,classes:n}=t;return qe({root:["root",e&&"disableGutters"]},vct,n)},xct=be("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:t})=>t.disableGutters,style:{right:0}}]}),aA=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItemSecondaryAction"}),{className:i,...o}=r,s=D.useContext(Df),a={...r,disableGutters:s.disableGutters},l=yct(a);return C.jsx(xct,{className:Oe(l.root,i),ownerState:a,ref:n,...o})});aA.muiName="ListItemSecondaryAction";const bct=(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.hasSecondaryAction&&e.secondaryAction]},wct=t=>{const{alignItems:e,classes:n,dense:r,disableGutters:i,disablePadding:o,divider:s,hasSecondaryAction:a}=t;return qe({root:["root",r&&"dense",!i&&"gutters",!o&&"padding",s&&"divider",e==="flex-start"&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},dct,n)},_ct=be("div",{name:"MuiListItem",slot:"Root",overridesResolver:bct})(wt(({theme:t})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${Fw.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{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"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),Sct=be("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),$_=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItem"}),{alignItems:i="center",children:o,className:s,component:a,components:l={},componentsProps:c={},ContainerComponent:u="li",ContainerProps:{className:f,...d}={},dense:h=!1,disableGutters:p=!1,disablePadding:g=!1,divider:m=!1,secondaryAction:v,slotProps:y={},slots:x={},...b}=r,w=D.useContext(Df),_=D.useMemo(()=>({dense:h||w.dense||!1,alignItems:i,disableGutters:p}),[i,w.dense,h,p]),S=D.useRef(null),O=D.Children.toArray(o),k=O.length&&i3(O[O.length-1],["ListItemSecondaryAction"]),E={...r,alignItems:i,dense:_.dense,disableGutters:p,disablePadding:g,divider:m,hasSecondaryAction:k},P=wct(E),A=dn(S,n),R=x.root||l.Root||_ct,T=y.root||c.root||{},M={className:Oe(P.root,T.className,s),...b};let I=a||"li";return k?(I=!M.component&&!a?"div":I,u==="li"&&(I==="li"?I="div":M.component==="li"&&(M.component="div")),C.jsx(Df.Provider,{value:_,children:C.jsxs(Sct,{as:u,className:Oe(P.container,f),ref:A,ownerState:E,...d,children:[C.jsx(R,{...T,...!og(R)&&{as:I,ownerState:{...E,...T.ownerState}},...M,children:O}),O.pop()]})})):C.jsx(Df.Provider,{value:_,children:C.jsxs(R,{...T,as:I,ref:A,...!og(R)&&{ownerState:{...E,...T.ownerState}},...M,children:[O,v&&C.jsx(aA,{children:v})]})})});function Cct(t){return Xe("MuiListItemIcon",t)}const Gde=He("MuiListItemIcon",["root","alignItemsFlexStart"]),Oct=t=>{const{alignItems:e,classes:n}=t;return qe({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},Cct,n)},Ect=be("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(wt(({theme:t})=>({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),kPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItemIcon"}),{className:i,...o}=r,s=D.useContext(Df),a={...r,alignItems:s.alignItems},l=Oct(a);return C.jsx(Ect,{className:Oe(l.root,i),ownerState:a,ref:n,...o})});function Tct(t){return Xe("MuiListItemText",t)}const a_=He("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),kct=t=>{const{classes:e,inset:n,primary:r,secondary:i,dense:o}=t;return qe({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},Tct,e)},Act=be("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${a_.primary}`]:e.primary},{[`& .${a_.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${DF.root}:where(& .${a_.primary})`]:{display:"block"},[`.${DF.root}:where(& .${a_.secondary})`]:{display:"block"},variants:[{props:({ownerState:t})=>t.primary&&t.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:56}}]}),fu=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItemText"}),{children:i,className:o,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f,...d}=r,{dense:h}=D.useContext(Df);let p=l??i,g=u;const m={...r,disableTypography:s,inset:a,primary:!!p,secondary:!!g,dense:h},v=kct(m);return p!=null&&p.type!==Jt&&!s&&(p=C.jsx(Jt,{variant:h?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",...c,children:p})),g!=null&&g.type!==Jt&&!s&&(g=C.jsx(Jt,{variant:"body2",className:v.secondary,color:"textSecondary",...f,children:g})),C.jsxs(Act,{className:Oe(v.root,o),ownerState:m,ref:n,...d,children:[p,g]})});function aW(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function Hde(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function APe(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.startsWith(e.keys.join(""))}function IE(t,e,n,r,i,o){let s=!1,a=i(t,e,e?n:!1);for(;a;){if(a===t.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!APe(a,o)||l)a=i(t,a,n);else return a.focus(),!0}return!1}const w4=D.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu",...d}=e,h=D.useRef(null),p=D.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ei(()=>{i&&h.current.focus()},[i]),D.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:b})=>{const w=!h.current.style.width;if(x.clientHeight{const b=h.current,w=x.key;if(x.ctrlKey||x.metaKey||x.altKey){u&&u(x);return}const S=yi(b).activeElement;if(w==="ArrowDown")x.preventDefault(),IE(b,S,c,l,aW);else if(w==="ArrowUp")x.preventDefault(),IE(b,S,c,l,Hde);else if(w==="Home")x.preventDefault(),IE(b,null,c,l,aW);else if(w==="End")x.preventDefault(),IE(b,null,c,l,Hde);else if(w.length===1){const O=p.current,k=w.toLowerCase(),E=performance.now();O.keys.length>0&&(E-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&k!==O.keys[0]&&(O.repeating=!1)),O.lastTime=E,O.keys.push(k);const P=S&&!O.repeating&&APe(S,O);O.previousKeyMatched&&(P||IE(b,S,!1,l,aW,O))?x.preventDefault():O.previousKeyMatched=!1}u&&u(x)},m=dn(h,n);let v=-1;D.Children.forEach(s,(x,b)=>{if(!D.isValidElement(x)){v===b&&(v+=1,v>=s.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>=s.length&&(v=-1))});const y=D.Children.map(s,(x,b)=>{if(b===v){const w={};return o&&(w.autoFocus=!0),x.props.tabIndex===void 0&&f==="selectedMenu"&&(w.tabIndex=0),D.cloneElement(x,w)}return x});return C.jsx(RM,{role:"menu",ref:m,className:a,onKeyDown:g,tabIndex:i?0:-1,...d,children:y})});function Pct(t){return Xe("MuiPopover",t)}He("MuiPopover",["root","paper"]);function qde(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function Xde(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function Yde(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function lW(t){return typeof t=="function"?t():t}const Mct=t=>{const{classes:e}=t;return qe({root:["root"],paper:["paper"]},Pct,e)},Rct=be(_Pe,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),PPe=be(kl,{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}),e1=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiPopover"}),{action:i,anchorEl:o,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:l="anchorEl",children:c,className:u,container:f,elevation:d=8,marginThreshold:h=16,open:p,PaperProps:g={},slots:m={},slotProps:v={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:x=ob,transitionDuration:b="auto",TransitionProps:{onEntering:w,..._}={},disableScrollLock:S=!1,...O}=r,k=(v==null?void 0:v.paper)??g,E=D.useRef(),P={...r,anchorOrigin:s,anchorReference:l,elevation:d,marginThreshold:h,externalPaperSlotProps:k,transformOrigin:y,TransitionComponent:x,transitionDuration:b,TransitionProps:_},A=Mct(P),R=D.useCallback(()=>{if(l==="anchorPosition")return a;const re=lW(o),te=(re&&re.nodeType===1?re:yi(E.current).body).getBoundingClientRect();return{top:te.top+qde(te,s.vertical),left:te.left+Xde(te,s.horizontal)}},[o,s.horizontal,s.vertical,a,l]),T=D.useCallback(re=>({vertical:qde(re,y.vertical),horizontal:Xde(re,y.horizontal)}),[y.horizontal,y.vertical]),M=D.useCallback(re=>{const me={width:re.offsetWidth,height:re.offsetHeight},te=T(me);if(l==="none")return{top:null,left:null,transformOrigin:Yde(te)};const ae=R();let U=ae.top-te.vertical,oe=ae.left-te.horizontal;const ne=U+me.height,G=oe+me.width,q=xc(lW(o)),Z=q.innerHeight-h,de=q.innerWidth-h;if(h!==null&&UZ){const xe=ne-Z;U-=xe,te.vertical+=xe}if(h!==null&&oede){const xe=G-de;oe-=xe,te.horizontal+=xe}return{top:`${Math.round(U)}px`,left:`${Math.round(oe)}px`,transformOrigin:Yde(te)}},[o,l,R,T,h]),[I,z]=D.useState(p),F=D.useCallback(()=>{const re=E.current;if(!re)return;const me=M(re);me.top!==null&&re.style.setProperty("top",me.top),me.left!==null&&(re.style.left=me.left),re.style.transformOrigin=me.transformOrigin,z(!0)},[M]);D.useEffect(()=>(S&&window.addEventListener("scroll",F),()=>window.removeEventListener("scroll",F)),[o,S,F]);const N=(re,me)=>{w&&w(re,me),F()},L=()=>{z(!1)};D.useEffect(()=>{p&&F()}),D.useImperativeHandle(i,()=>p?{updatePosition:()=>{F()}}:null,[p,F]),D.useEffect(()=>{if(!p)return;const re=TM(()=>{F()}),me=xc(o);return me.addEventListener("resize",re),()=>{re.clear(),me.removeEventListener("resize",re)}},[o,p,F]);let B=b;b==="auto"&&!x.muiSupportAuto&&(B=void 0);const $=f||(o?yi(lW(o)).body:void 0),j={slots:m,slotProps:{...v,paper:k}},[X,V]=Jl("paper",{elementType:PPe,externalForwardedProps:j,additionalProps:{elevation:d,className:Oe(A.paper,k==null?void 0:k.className),style:I?k.style:{...k.style,opacity:0}},ownerState:P}),[Y,{slotProps:le,...K}]=Jl("root",{elementType:Rct,externalForwardedProps:j,additionalProps:{slotProps:{backdrop:{invisible:!0}},container:$,open:p},ownerState:P,className:Oe(A.root,u)}),ee=dn(E,V.ref);return C.jsx(Y,{...K,...!og(Y)&&{slotProps:le,disableScrollLock:S},...O,ref:n,children:C.jsx(x,{appear:!0,in:p,onEntering:N,onExited:L,timeout:B,..._,children:C.jsx(X,{...V,ref:ee,children:c})})})});function Dct(t){return Xe("MuiMenu",t)}He("MuiMenu",["root","paper","list"]);const Ict={vertical:"top",horizontal:"right"},Lct={vertical:"top",horizontal:"left"},$ct=t=>{const{classes:e}=t;return qe({root:["root"],paper:["paper"],list:["list"]},Dct,e)},Fct=be(e1,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Nct=be(PPe,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),zct=be(w4,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),Ny=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiMenu"}),{autoFocus:i=!0,children:o,className:s,disableAutoFocusItem:a=!1,MenuListProps:l={},onClose:c,open:u,PaperProps:f={},PopoverClasses:d,transitionDuration:h="auto",TransitionProps:{onEntering:p,...g}={},variant:m="selectedMenu",slots:v={},slotProps:y={},...x}=r,b=Eo(),w={...r,autoFocus:i,disableAutoFocusItem:a,MenuListProps:l,onEntering:p,PaperProps:f,transitionDuration:h,TransitionProps:g,variant:m},_=$ct(w),S=i&&!a&&u,O=D.useRef(null),k=(I,z)=>{O.current&&O.current.adjustStyleForScrollbar(I,{direction:b?"rtl":"ltr"}),p&&p(I,z)},E=I=>{I.key==="Tab"&&(I.preventDefault(),c&&c(I,"tabKeyDown"))};let P=-1;D.Children.map(o,(I,z)=>{D.isValidElement(I)&&(I.props.disabled||(m==="selectedMenu"&&I.props.selected||P===-1)&&(P=z))});const A=v.paper??Nct,R=y.paper??f,T=Zt({elementType:v.root,externalSlotProps:y.root,ownerState:w,className:[_.root,s]}),M=Zt({elementType:A,externalSlotProps:R,ownerState:w,className:_.paper});return C.jsx(Fct,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:b?"right":"left"},transformOrigin:b?Ict:Lct,slots:{paper:A,root:v.root},slotProps:{root:T,paper:M},open:u,ref:n,transitionDuration:h,TransitionProps:{onEntering:k,...g},ownerState:w,...x,classes:d,children:C.jsx(zct,{onKeyDown:E,actions:O,autoFocus:i&&(P===-1||a),autoFocusItem:S,variant:m,...l,className:Oe(_.list,l.className),children:o})})});function jct(t){return Xe("MuiMenuItem",t)}const LE=He("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Bct=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},Uct=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=t,l=qe({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},jct,s);return{...s,...l}},Wct=be(Ff,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:Bct})(wt(({theme:t})=>({...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","&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${LE.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${LE.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)}},[`&.${LE.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)}},[`&.${LE.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${LE.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${Nde.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${Nde.inset}`]:{marginLeft:52},[`& .${a_.root}`]:{marginTop:0,marginBottom:0},[`& .${a_.inset}`]:{paddingLeft:36},[`& .${Gde.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[t.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...t.typography.body2,[`& .${Gde.root} svg`]:{fontSize:"1.25rem"}}}]}))),Br=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:d,...h}=r,p=D.useContext(Df),g=D.useMemo(()=>({dense:s||p.dense||!1,disableGutters:l}),[p.dense,s,l]),m=D.useRef(null);Ei(()=>{i&&m.current&&m.current.focus()},[i]);const v={...r,dense:g.dense,divider:a,disableGutters:l},y=Uct(r),x=dn(m,n);let b;return r.disabled||(b=f!==void 0?f:-1),C.jsx(Df.Provider,{value:g,children:C.jsx(Wct,{ref:x,role:u,tabIndex:b,component:o,focusVisibleClassName:Oe(y.focusVisible,c),className:Oe(y.root,d),...h,ownerState:v,classes:y})})});function Vct(t){return Xe("MuiNativeSelect",t)}const Qee=He("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Gct=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Me(n)}`,o&&"iconOpen",r&&"disabled"]};return qe(a,Vct,e)},MPe=be("select")(({theme:t})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${Qee.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!=="filled"&&e.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]})),Hct=be(MPe,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Xo,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${Qee.multiple}`]:e.multiple}]}})({}),RPe=be("svg")(({theme:t})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${Qee.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),qct=be(RPe,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Me(n.variant)}`],n.open&&e.iconOpen]}})({}),Xct=D.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard",...c}=e,u={...e,disabled:i,variant:l,error:o},f=Gct(u);return C.jsxs(D.Fragment,{children:[C.jsx(Hct,{ownerState:u,className:Oe(f.select,r),disabled:i,ref:a||n,...c}),e.multiple?null:C.jsx(qct,{as:s,ownerState:u,className:f.icon})]})});var Qde;const Yct=be("fieldset",{shouldForwardProp:Xo})({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%"}),Qct=be("legend",{shouldForwardProp:Xo})(wt(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]})));function Kct(t){const{children:e,classes:n,className:r,label:i,notched:o,...s}=t,a=i!=null&&i!=="",l={...t,notched:o,withLabel:a};return C.jsx(Yct,{"aria-hidden":!0,className:r,ownerState:l,...s,children:C.jsx(Qct,{ownerState:l,children:a?C.jsx("span",{children:i}):Qde||(Qde=C.jsx("span",{className:"notranslate",children:"​"}))})})}const Zct=t=>{const{classes:e}=t,r=qe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Vot,e);return{...e,...r}},Jct=be(x4,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:v4})(wt(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${md.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${md.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${md.focused} .${md.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(pr()).map(([n])=>({props:{color:n},style:{[`&.${md.focused} .${md.notchedOutline}`]:{borderColor:(t.vars||t).palette[n].main}}})),{props:{},style:{[`&.${md.error} .${md.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${md.disabled} .${md.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),eut=be(Kct,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(wt(({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}})),tut=be(b4,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:y4})(wt(({theme:t})=>({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"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),zF=D.forwardRef(function(e,n){var r;const i=_t({props:e,name:"MuiOutlinedInput"}),{components:o={},fullWidth:s=!1,inputComponent:a="input",label:l,multiline:c=!1,notched:u,slots:f={},type:d="text",...h}=i,p=Zct(i),g=Na(),m=Iy({props:i,muiFormControl:g,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...i,color:m.color||"primary",disabled:m.disabled,error:m.error,focused:m.focused,formControl:g,fullWidth:s,hiddenLabel:m.hiddenLabel,multiline:c,size:m.size,type:d},y=f.root??o.Root??Jct,x=f.input??o.Input??tut;return C.jsx(Hee,{slots:{root:y,input:x},renderSuffix:b=>C.jsx(eut,{ownerState:v,className:p.notchedOutline,label:l!=null&&l!==""&&m.required?r||(r=C.jsxs(D.Fragment,{children:[l," ","*"]})):l,notched:typeof u<"u"?u:!!(b.startAdornment||b.filled||b.focused)}),fullWidth:s,inputComponent:a,multiline:c,ref:n,type:d,...h,classes:{...p,notchedOutline:null}})});zF&&(zF.muiName="Input");const nut=lt(C.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"),rut=lt(C.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"),iut=be("span",{shouldForwardProp:Xo})({position:"relative",display:"flex"}),out=be(nut)({transform:"scale(1)"}),sut=be(rut)(wt(({theme:t})=>({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}}]})));function DPe(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i={...t,checked:e};return C.jsxs(iut,{className:n.root,ownerState:i,children:[C.jsx(out,{fontSize:r,className:n.background,ownerState:i}),C.jsx(sut,{fontSize:r,className:n.dot,ownerState:i})]})}const IPe=D.createContext(void 0);function aut(){return D.useContext(IPe)}function lut(t){return Xe("MuiRadio",t)}const Kde=He("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),cut=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${Me(n)}`,r!=="medium"&&`size${Me(r)}`]};return{...e,...qe(i,lut,e)}},uut=be(qee,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${Me(n.size)}`],e[`color${Me(n.color)}`]]}})(wt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,[`&.${Kde.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,disabled:!1},style:{[`&.${Kde.checked}`]:{color:(t.vars||t).palette[e].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function fut(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const Zde=C.jsx(DPe,{checked:!0}),Jde=C.jsx(DPe,{}),F_=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiRadio"}),{checked:i,checkedIcon:o=Zde,color:s="primary",icon:a=Jde,name:l,onChange:c,size:u="medium",className:f,disabled:d,disableRipple:h=!1,...p}=r,g=Na();let m=d;g&&typeof m>"u"&&(m=g.disabled),m??(m=!1);const v={...r,disabled:m,disableRipple:h,color:s,size:u},y=cut(v),x=aut();let b=i;const w=ZH(c,x&&x.onChange);let _=l;return x&&(typeof b>"u"&&(b=fut(x.value,r.value)),typeof _>"u"&&(_=x.name)),C.jsx(uut,{type:"radio",icon:D.cloneElement(a,{fontSize:Jde.props.fontSize??u}),checkedIcon:D.cloneElement(o,{fontSize:Zde.props.fontSize??u}),disabled:m,ownerState:v,classes:y,name:_,checked:b,onChange:w,ref:n,className:Oe(y.root,f),...p})});function dut(t){return Xe("MuiRadioGroup",t)}He("MuiRadioGroup",["root","row","error"]);const hut=t=>{const{classes:e,row:n,error:r}=t;return qe({root:["root",n&&"row",r&&"error"]},dut,e)},_4=D.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:c,...u}=e,f=D.useRef(null),d=hut(e),[h,p]=bc({controlled:c,default:s,name:"RadioGroup"});D.useImperativeHandle(r,()=>({focus:()=>{let y=f.current.querySelector("input:not(:disabled):checked");y||(y=f.current.querySelector("input:not(:disabled)")),y&&y.focus()}}),[]);const g=dn(n,f),m=Jf(a),v=D.useMemo(()=>({name:m,onChange(y){p(y.target.value),l&&l(y,y.target.value)},value:h}),[m,l,p,h]);return C.jsx(IPe.Provider,{value:v,children:C.jsx(hlt,{role:"radiogroup",ref:g,className:Oe(d.root,o),...u,children:i})})});function put(t){return Xe("MuiSelect",t)}const $E=He("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var ehe;const gut=be(MPe,{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${$E.select}`]:e.select},{[`&.${$E.select}`]:e[n.variant]},{[`&.${$E.error}`]:e.error},{[`&.${$E.multiple}`]:e.multiple}]}})({[`&.${$E.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),mut=be(RPe,{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Me(n.variant)}`],n.open&&e.iconOpen]}})({}),vut=be("input",{shouldForwardProp:t=>i4(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 the(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function yut(t){return t==null||typeof t=="string"&&!t.trim()}const xut=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Me(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return qe(a,put,e)},but=D.forwardRef(function(e,n){var Pe;const{"aria-describedby":r,"aria-label":i,autoFocus:o,autoWidth:s,children:a,className:l,defaultOpen:c,defaultValue:u,disabled:f,displayEmpty:d,error:h=!1,IconComponent:p,inputRef:g,labelId:m,MenuProps:v={},multiple:y,name:x,onBlur:b,onChange:w,onClose:_,onFocus:S,onOpen:O,open:k,readOnly:E,renderValue:P,SelectDisplayProps:A={},tabIndex:R,type:T,value:M,variant:I="standard",...z}=e,[F,N]=bc({controlled:M,default:u,name:"Select"}),[L,B]=bc({controlled:k,default:c,name:"Select"}),$=D.useRef(null),j=D.useRef(null),[X,V]=D.useState(null),{current:Y}=D.useRef(k!=null),[le,K]=D.useState(),ee=dn(n,g),re=D.useCallback(Re=>{j.current=Re,Re&&V(Re)},[]),me=X==null?void 0:X.parentNode;D.useImperativeHandle(ee,()=>({focus:()=>{j.current.focus()},node:$.current,value:F}),[F]),D.useEffect(()=>{c&&L&&X&&!Y&&(K(s?null:me.clientWidth),j.current.focus())},[X,s]),D.useEffect(()=>{o&&j.current.focus()},[o]),D.useEffect(()=>{if(!m)return;const Re=yi(j.current).getElementById(m);if(Re){const Te=()=>{getSelection().isCollapsed&&j.current.focus()};return Re.addEventListener("click",Te),()=>{Re.removeEventListener("click",Te)}}},[m]);const te=(Re,Te)=>{Re?O&&O(Te):_&&_(Te),Y||(K(s?null:me.clientWidth),B(Re))},ae=Re=>{Re.button===0&&(Re.preventDefault(),j.current.focus(),te(!0,Re))},U=Re=>{te(!1,Re)},oe=D.Children.toArray(a),ne=Re=>{const Te=oe.find(Le=>Le.props.value===Re.target.value);Te!==void 0&&(N(Te.props.value),w&&w(Re,Te))},G=Re=>Te=>{let Le;if(Te.currentTarget.hasAttribute("tabindex")){if(y){Le=Array.isArray(F)?F.slice():[];const ue=F.indexOf(Re.props.value);ue===-1?Le.push(Re.props.value):Le.splice(ue,1)}else Le=Re.props.value;if(Re.props.onClick&&Re.props.onClick(Te),F!==Le&&(N(Le),w)){const ue=Te.nativeEvent||Te,$e=new ue.constructor(ue.type,ue);Object.defineProperty($e,"target",{writable:!0,value:{value:Le,name:x}}),w($e,Re)}y||te(!1,Te)}},q=Re=>{E||[" ","ArrowUp","ArrowDown","Enter"].includes(Re.key)&&(Re.preventDefault(),te(!0,Re))},Z=X!==null&&L,de=Re=>{!Z&&b&&(Object.defineProperty(Re,"target",{writable:!0,value:{value:F,name:x}}),b(Re))};delete z["aria-invalid"];let xe,H;const W=[];let J=!1;(LF({value:F})||d)&&(P?xe=P(F):J=!0);const se=oe.map(Re=>{if(!D.isValidElement(Re))return null;let Te;if(y){if(!Array.isArray(F))throw new Error(Mg(2));Te=F.some(Le=>the(Le,Re.props.value)),Te&&J&&W.push(Re.props.children)}else Te=the(F,Re.props.value),Te&&J&&(H=Re.props.children);return D.cloneElement(Re,{"aria-selected":Te?"true":"false",onClick:G(Re),onKeyUp:Le=>{Le.key===" "&&Le.preventDefault(),Re.props.onKeyUp&&Re.props.onKeyUp(Le)},role:"option",selected:Te,value:void 0,"data-value":Re.props.value})});J&&(y?W.length===0?xe=null:xe=W.reduce((Re,Te,Le)=>(Re.push(Te),Le{const{classes:e}=t;return e},Kee={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>Xo(t)&&t!=="variant",slot:"Root"},_ut=be(Dg,Kee)(""),Sut=be(zF,Kee)(""),Cut=be(NF,Kee)(""),Hg=D.forwardRef(function(e,n){const r=kn({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=Hot,id:f,input:d,inputProps:h,label:p,labelId:g,MenuProps:m,multiple:v=!1,native:y=!1,onClose:x,onOpen:b,open:w,renderValue:_,SelectDisplayProps:S,variant:O="outlined",...k}=r,E=y?Xct:but,P=Na(),A=Iy({props:r,muiFormControl:P,states:["variant","error"]}),R=A.variant||O,T={...r,variant:R,classes:s},M=wut(T),{root:I,...z}=M,F=d||{standard:C.jsx(_ut,{ownerState:T}),outlined:C.jsx(Sut,{label:p,ownerState:T}),filled:C.jsx(Cut,{ownerState:T})}[R],N=dn(n,Ry(F));return C.jsx(D.Fragment,{children:D.cloneElement(F,{inputComponent:E,inputProps:{children:o,error:A.error,IconComponent:u,variant:R,type:void 0,multiple:v,...y?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:g,MenuProps:m,onClose:x,onOpen:b,open:w,renderValue:_,SelectDisplayProps:{id:f,...S}},...h,classes:h?Wo(z,h.classes):z,...d?d.props.inputProps:{}},...(v&&y||c)&&R==="outlined"?{notched:!0}:{},ref:N,className:Oe(F.props.className,a,M.root),...!d&&{variant:R},...k})})});Hg.muiName="Select";function Out(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const Eut=2;function LPe(t,e){return t-e}function nhe(t,e){const{index:n}=t.reduce((r,i,o)=>{const s=Math.abs(e-i);return r===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}%`})}},Mut=t=>t;let iI;function ihe(){return iI===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?iI=CSS.supports("touch-action","none"):iI=!0),iI}function Rut(t){const{"aria-labelledby":e,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:d="horizontal",rootRef:h,scale:p=Mut,step:g=1,shiftStep:m=10,tabIndex:v,value:y}=t,x=D.useRef(void 0),[b,w]=D.useState(-1),[_,S]=D.useState(-1),[O,k]=D.useState(!1),E=D.useRef(0),[P,A]=bc({controlled:y,default:n??l,name:"Slider"}),R=u&&((W,J,se)=>{const ye=W.nativeEvent||W,ie=new ye.constructor(ye.type,ye);Object.defineProperty(ie,"target",{writable:!0,value:{value:J,name:c}}),u(ie,J,se)}),T=Array.isArray(P);let M=T?P.slice().sort(LPe):[P];M=M.map(W=>W==null?l:Lw(W,l,a));const I=s===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((W,J)=>({value:l+g*J})):s||[],z=I.map(W=>W.value),[F,N]=D.useState(-1),L=D.useRef(null),B=dn(h,L),$=W=>J=>{var ye;const se=Number(J.currentTarget.getAttribute("data-index"));Zv(J.target)&&N(se),S(se),(ye=W==null?void 0:W.onFocus)==null||ye.call(W,J)},j=W=>J=>{var se;Zv(J.target)||N(-1),S(-1),(se=W==null?void 0:W.onBlur)==null||se.call(W,J)},X=(W,J)=>{const se=Number(W.currentTarget.getAttribute("data-index")),ye=M[se],ie=z.indexOf(ye);let fe=J;if(I&&g==null){const Q=z[z.length-1];fe>Q?fe=Q:feJ=>{var se;if(g!==null){const ye=Number(J.currentTarget.getAttribute("data-index")),ie=M[ye];let fe=null;(J.key==="ArrowLeft"||J.key==="ArrowDown")&&J.shiftKey||J.key==="PageDown"?fe=Math.max(ie-m,l):((J.key==="ArrowRight"||J.key==="ArrowUp")&&J.shiftKey||J.key==="PageUp")&&(fe=Math.min(ie+m,a)),fe!==null&&(X(J,fe),J.preventDefault())}(se=W==null?void 0:W.onKeyDown)==null||se.call(W,J)};Ei(()=>{var W;r&&L.current.contains(document.activeElement)&&((W=document.activeElement)==null||W.blur())},[r]),r&&b!==-1&&w(-1),r&&F!==-1&&N(-1);const Y=W=>J=>{var se;(se=W.onChange)==null||se.call(W,J),X(J,J.target.valueAsNumber)},le=D.useRef(void 0);let K=d;o&&d==="horizontal"&&(K+="-reverse");const ee=({finger:W,move:J=!1})=>{const{current:se}=L,{width:ye,height:ie,bottom:fe,left:Q}=se.getBoundingClientRect();let _e;K.startsWith("vertical")?_e=(fe-W.y)/ie:_e=(W.x-Q)/ye,K.includes("-reverse")&&(_e=1-_e);let we;if(we=Tut(_e,l,a),g)we=Aut(we,g,l);else{const Pe=nhe(z,we);we=z[Pe]}we=Lw(we,l,a);let Ie=0;if(T){J?Ie=le.current:Ie=nhe(M,we),i&&(we=Lw(we,M[Ie-1]||-1/0,M[Ie+1]||1/0));const Pe=we;we=rhe({values:M,newValue:we,index:Ie}),i&&J||(Ie=we.indexOf(Pe),le.current=Ie)}return{newValue:we,activeIndex:Ie}},re=st(W=>{const J=tI(W,x);if(!J)return;if(E.current+=1,W.type==="mousemove"&&W.buttons===0){me(W);return}const{newValue:se,activeIndex:ye}=ee({finger:J,move:!0});nI({sliderRef:L,activeIndex:ye,setActive:w}),A(se),!O&&E.current>Eut&&k(!0),R&&!rI(se,P)&&R(W,se,ye)}),me=st(W=>{const J=tI(W,x);if(k(!1),!J)return;const{newValue:se}=ee({finger:J,move:!0});w(-1),W.type==="touchend"&&S(-1),f&&f(W,se),x.current=void 0,ae()}),te=st(W=>{if(r)return;ihe()||W.preventDefault();const J=W.changedTouches[0];J!=null&&(x.current=J.identifier);const se=tI(W,x);if(se!==!1){const{newValue:ie,activeIndex:fe}=ee({finger:se});nI({sliderRef:L,activeIndex:fe,setActive:w}),A(ie),R&&!rI(ie,P)&&R(W,ie,fe)}E.current=0;const ye=yi(L.current);ye.addEventListener("touchmove",re,{passive:!0}),ye.addEventListener("touchend",me,{passive:!0})}),ae=D.useCallback(()=>{const W=yi(L.current);W.removeEventListener("mousemove",re),W.removeEventListener("mouseup",me),W.removeEventListener("touchmove",re),W.removeEventListener("touchend",me)},[me,re]);D.useEffect(()=>{const{current:W}=L;return W.addEventListener("touchstart",te,{passive:ihe()}),()=>{W.removeEventListener("touchstart",te),ae()}},[ae,te]),D.useEffect(()=>{r&&ae()},[r,ae]);const U=W=>J=>{var ie;if((ie=W.onMouseDown)==null||ie.call(W,J),r||J.defaultPrevented||J.button!==0)return;J.preventDefault();const se=tI(J,x);if(se!==!1){const{newValue:fe,activeIndex:Q}=ee({finger:se});nI({sliderRef:L,activeIndex:Q,setActive:w}),A(fe),R&&!rI(fe,P)&&R(J,fe,Q)}E.current=0;const ye=yi(L.current);ye.addEventListener("mousemove",re,{passive:!0}),ye.addEventListener("mouseup",me)},oe=jF(T?M[0]:l,l,a),ne=jF(M[M.length-1],l,a)-oe,G=(W={})=>{const J=Mx(W),se={onMouseDown:U(J||{})},ye={...J,...se};return{...W,ref:B,...ye}},q=W=>J=>{var ye;(ye=W.onMouseOver)==null||ye.call(W,J);const se=Number(J.currentTarget.getAttribute("data-index"));S(se)},Z=W=>J=>{var se;(se=W.onMouseLeave)==null||se.call(W,J),S(-1)};return{active:b,axis:K,axisProps:Put,dragging:O,focusedThumbIndex:F,getHiddenInputProps:(W={})=>{const J=Mx(W),se={onChange:Y(J||{}),onFocus:$(J||{}),onBlur:j(J||{}),onKeyDown:V(J||{})},ye={...J,...se};return{tabIndex:v,"aria-labelledby":e,"aria-orientation":d,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":t.step??void 0,disabled:r,...W,...ye,style:{...jAe,direction:o?"rtl":"ltr",width:"100%",height:"100%"}}},getRootProps:G,getThumbProps:(W={})=>{const J=Mx(W),se={onMouseOver:q(J||{}),onMouseLeave:Z(J||{})};return{...W,...J,...se}},marks:I,open:_,range:T,rootRef:B,trackLeap:ne,trackOffset:oe,values:M,getThumbStyle:W=>({pointerEvents:b!==-1&&b!==W?"none":void 0})}}const Dut=t=>!t||!og(t);function Iut(t){return Xe("MuiSlider",t)}const tu=He("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"]),Lut=t=>{const{open:e}=t;return{offset:Oe(e&&tu.valueLabelOpen),circle:tu.valueLabelCircle,label:tu.valueLabelLabel}};function $ut(t){const{children:e,className:n,value:r}=t,i=Lut(t);return e?D.cloneElement(e,{className:Oe(e.props.className)},C.jsxs(D.Fragment,{children:[e.props.children,C.jsx("span",{className:Oe(i.offset,n),"aria-hidden":!0,children:C.jsx("span",{className:i.circle,children:C.jsx("span",{className:i.label,children:r})})})]})):null}function ohe(t){return t}const Fut=be("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${Me(n.color)}`],n.size!=="medium"&&e[`size${Me(n.size)}`],n.marked&&e.marked,n.orientation==="vertical"&&e.vertical,n.track==="inverted"&&e.trackInverted,n.track===!1&&e.trackFalse]}})(wt(({theme:t})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${tu.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${tu.dragging}`]:{[`& .${tu.thumb}, & .${tu.track}`]:{transition:"none"}},variants:[...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].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}}]}))),Nut=be("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}}]}),zut=be("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(wt(({theme:t})=>({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.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,track:"inverted"},style:{...t.vars?{backgroundColor:t.vars.palette.Slider[`${e}Track`],borderColor:t.vars.palette.Slider[`${e}Track`]}:{backgroundColor:Eh(t.palette[e].main,.62),borderColor:Eh(t.palette[e].main,.62),...t.applyStyles("dark",{backgroundColor:Oh(t.palette[e].main,.5)}),...t.applyStyles("dark",{borderColor:Oh(t.palette[e].main,.5)})}}}))]}))),jut=be("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.thumb,e[`thumbColor${Me(n.color)}`],n.size!=="medium"&&e[`thumbSize${Me(n.size)}`]]}})(wt(({theme:t})=>({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%)"},[`&.${tu.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.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{[`&:hover, &.${tu.focusVisible}`]:{...t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${kt(t.palette[e].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${tu.active}`]:{...t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${kt(t.palette[e].main,.16)}`}}}}))]}))),But=be($ut,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(wt(({theme:t})=>({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%"},[`&.${tu.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%"},[`&.${tu.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"}}]}))),Uut=be("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>i4(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:n}=t;return[e.mark,n&&e.markActive]}})(wt(({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}}]}))),Wut=be("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>i4(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(wt(({theme:t})=>({...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}}]}))),Vut=t=>{const{disabled:e,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=t,c={root:["root",e&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Me(a)}`,l&&`size${Me(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",l&&`thumbSize${Me(l)}`,a&&`thumbColor${Me(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return qe(c,Iut,s)},Gut=({children:t})=>t,t1=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSlider"}),i=Eo(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:f="primary",classes:d,className:h,disableSwap:p=!1,disabled:g=!1,getAriaLabel:m,getAriaValueText:v,marks:y=!1,max:x=100,min:b=0,name:w,onChange:_,onChangeCommitted:S,orientation:O="horizontal",shiftStep:k=10,size:E="medium",step:P=1,scale:A=ohe,slotProps:R,slots:T,tabIndex:M,track:I="normal",value:z,valueLabelDisplay:F="off",valueLabelFormat:N=ohe,...L}=r,B={...r,isRtl:i,max:x,min:b,classes:d,disabled:g,disableSwap:p,orientation:O,marks:y,color:f,size:E,step:P,shiftStep:k,scale:A,track:I,valueLabelDisplay:F,valueLabelFormat:N},{axisProps:$,getRootProps:j,getHiddenInputProps:X,getThumbProps:V,open:Y,active:le,axis:K,focusedThumbIndex:ee,range:re,dragging:me,marks:te,values:ae,trackOffset:U,trackLeap:oe,getThumbStyle:ne}=Rut({...B,rootRef:n});B.marked=te.length>0&&te.some(ut=>ut.label),B.dragging=me,B.focusedThumbIndex=ee;const G=Vut(B),q=(T==null?void 0:T.root)??c.Root??Fut,Z=(T==null?void 0:T.rail)??c.Rail??Nut,de=(T==null?void 0:T.track)??c.Track??zut,xe=(T==null?void 0:T.thumb)??c.Thumb??jut,H=(T==null?void 0:T.valueLabel)??c.ValueLabel??But,W=(T==null?void 0:T.mark)??c.Mark??Uut,J=(T==null?void 0:T.markLabel)??c.MarkLabel??Wut,se=(T==null?void 0:T.input)??c.Input??"input",ye=(R==null?void 0:R.root)??u.root,ie=(R==null?void 0:R.rail)??u.rail,fe=(R==null?void 0:R.track)??u.track,Q=(R==null?void 0:R.thumb)??u.thumb,_e=(R==null?void 0:R.valueLabel)??u.valueLabel,we=(R==null?void 0:R.mark)??u.mark,Ie=(R==null?void 0:R.markLabel)??u.markLabel,Pe=(R==null?void 0:R.input)??u.input,Re=Zt({elementType:q,getSlotProps:j,externalSlotProps:ye,externalForwardedProps:L,additionalProps:{...Dut(q)&&{as:l}},ownerState:{...B,...ye==null?void 0:ye.ownerState},className:[G.root,h]}),Te=Zt({elementType:Z,externalSlotProps:ie,ownerState:B,className:G.rail}),Le=Zt({elementType:de,externalSlotProps:fe,additionalProps:{style:{...$[K].offset(U),...$[K].leap(oe)}},ownerState:{...B,...fe==null?void 0:fe.ownerState},className:G.track}),ue=Zt({elementType:xe,getSlotProps:V,externalSlotProps:Q,ownerState:{...B,...Q==null?void 0:Q.ownerState},className:G.thumb}),$e=Zt({elementType:H,externalSlotProps:_e,ownerState:{...B,..._e==null?void 0:_e.ownerState},className:G.valueLabel}),Se=Zt({elementType:W,externalSlotProps:we,ownerState:B,className:G.mark}),Ye=Zt({elementType:J,externalSlotProps:Ie,ownerState:B,className:G.markLabel}),tt=Zt({elementType:se,getSlotProps:X,externalSlotProps:Pe,ownerState:B});return C.jsxs(q,{...Re,children:[C.jsx(Z,{...Te}),C.jsx(de,{...Le}),te.filter(ut=>ut.value>=b&&ut.value<=x).map((ut,qt)=>{const Dn=jF(ut.value,b,x),Zi=$[K].offset(Dn);let yn;return I===!1?yn=ae.includes(ut.value):yn=I==="normal"&&(re?ut.value>=ae[0]&&ut.value<=ae[ae.length-1]:ut.value<=ae[0])||I==="inverted"&&(re?ut.value<=ae[0]||ut.value>=ae[ae.length-1]:ut.value>=ae[0]),C.jsxs(D.Fragment,{children:[C.jsx(W,{"data-index":qt,...Se,...!og(W)&&{markActive:yn},style:{...Zi,...Se.style},className:Oe(Se.className,yn&&G.markActive)}),ut.label!=null?C.jsx(J,{"aria-hidden":!0,"data-index":qt,...Ye,...!og(J)&&{markLabelActive:yn},style:{...Zi,...Ye.style},className:Oe(G.markLabel,Ye.className,yn&&G.markLabelActive),children:ut.label}):null]},qt)}),ae.map((ut,qt)=>{const Dn=jF(ut,b,x),Zi=$[K].offset(Dn),yn=F==="off"?Gut:H;return C.jsx(yn,{...!og(yn)&&{valueLabelFormat:N,valueLabelDisplay:F,value:typeof N=="function"?N(A(ut),qt):N,index:qt,open:Y===qt||le===qt||F==="on",disabled:g},...$e,children:C.jsx(xe,{"data-index":qt,...ue,className:Oe(G.thumb,ue.className,le===qt&&G.active,ee===qt&&G.focusVisible),style:{...Zi,...ne(qt),...ue.style},children:C.jsx(se,{"data-index":qt,"aria-label":m?m(qt):o,"aria-valuenow":A(ut),"aria-labelledby":a,"aria-valuetext":v?v(A(ut),qt):s,value:ae[qt],...tt})})},qt)})]})});function Hut(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=t,s=cv();D.useEffect(()=>{if(!i)return;function v(y){y.defaultPrevented||y.key==="Escape"&&(r==null||r(y,"escapeKeyDown"))}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i,r]);const a=st((v,y)=>{r==null||r(v,y)}),l=st(v=>{!r||v==null||s.start(v,()=>{a(null,"timeout")})});D.useEffect(()=>(i&&l(e),s.clear),[i,e,l,s]);const c=v=>{r==null||r(v,"clickaway")},u=s.clear,f=D.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()},g=v=>y=>{const x=v.onMouseLeave;x==null||x(y),f()};return D.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={...Mx(t),...Mx(v)};return{role:"presentation",...v,...y,onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:g(y)}},onClickAway:c}}function qut(t){return Xe("MuiSnackbarContent",t)}He("MuiSnackbarContent",["root","message","action"]);const Xut=t=>{const{classes:e}=t;return qe({root:["root"],action:["action"],message:["message"]},qut,e)},Yut=be(kl,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(wt(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=$Ae(t.palette.background.default,e);return{...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}}})),Qut=be("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),Kut=be("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),$Pe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSnackbarContent"}),{action:i,className:o,message:s,role:a="alert",...l}=r,c=r,u=Xut(c);return C.jsxs(Yut,{role:a,square:!0,elevation:6,className:Oe(u.root,o),ownerState:c,ref:n,...l,children:[C.jsx(Qut,{className:u.message,ownerState:c,children:s}),i?C.jsx(Kut,{className:u.action,ownerState:c,children:i}):null]})});function Zut(t){return Xe("MuiSnackbar",t)}He("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const Jut=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${Me(n.vertical)}${Me(n.horizontal)}`]};return qe(r,Zut,e)},she=be("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${Me(n.anchorOrigin.vertical)}${Me(n.anchorOrigin.horizontal)}`]]}})(wt(({theme:t})=>({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:e})=>e.anchorOrigin.vertical==="top",style:{top:8,[t.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:e})=>e.anchorOrigin.vertical!=="top",style:{bottom:8,[t.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[t.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[t.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="center",style:{[t.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),eft=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSnackbar"}),i=To(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:d,ContentProps:h,disableWindowBlurListener:p=!1,message:g,onBlur:m,onClose:v,onFocus:y,onMouseEnter:x,onMouseLeave:b,open:w,resumeHideDuration:_,TransitionComponent:S=ob,transitionDuration:O=o,TransitionProps:{onEnter:k,onExited:E,...P}={},...A}=r,R={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:S,transitionDuration:O},T=Jut(R),{getRootProps:M,onClickAway:I}=Hut({...R}),[z,F]=D.useState(!0),N=Zt({elementType:she,getSlotProps:M,externalForwardedProps:A,ownerState:R,additionalProps:{ref:n},className:[T.root,f]}),L=$=>{F(!0),E&&E($)},B=($,j)=>{F(!1),k&&k($,j)};return!w&&z?null:C.jsx(rat,{onClickAway:I,...d,children:C.jsx(she,{...N,children:C.jsx(S,{appear:!0,in:w,timeout:O,direction:a==="top"?"down":"up",onEnter:B,onExited:L,...P,children:u||C.jsx($Pe,{message:g,action:s,...h})})})})});function tft(t){return Xe("MuiTooltip",t)}const Mi=He("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function nft(t){return Math.round(t*1e5)/1e5}const rft=t=>{const{classes:e,disableInteractive:n,arrow:r,touch:i,placement:o}=t,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${Me(o.split("-")[0])}`],arrow:["arrow"]};return qe(s,tft,e)},ift=be(Gee,{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]}})(wt(({theme:t})=>({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${Mi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Mi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Mi.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Mi.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Mi.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Mi.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Mi.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Mi.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),oft=be("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${Me(n.placement.split("-")[0])}`]]}})(wt(({theme:t})=>({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,[`.${Mi.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Mi.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Mi.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${nft(16/14)}em`,fontWeight:t.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Mi.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Mi.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),sft=be("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(wt(({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 oI=!1;const ahe=new e4;let FE={x:0,y:0};function sI(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const Mt=D.forwardRef(function(e,n){var Dn,Zi,yn;const r=_t({props:e,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:s,components:a={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:f=!1,disableInteractive:d=!1,disableTouchListener:h=!1,enterDelay:p=100,enterNextDelay:g=0,enterTouchDelay:m=700,followCursor:v=!1,id:y,leaveDelay:x=0,leaveTouchDelay:b=1500,onClose:w,onOpen:_,open:S,placement:O="bottom",PopperComponent:k,PopperProps:E={},slotProps:P={},slots:A={},title:R,TransitionComponent:T=ob,TransitionProps:M,...I}=r,z=D.isValidElement(o)?o:C.jsx("span",{children:o}),F=To(),N=Eo(),[L,B]=D.useState(),[$,j]=D.useState(null),X=D.useRef(!1),V=d||v,Y=cv(),le=cv(),K=cv(),ee=cv(),[re,me]=bc({controlled:S,default:!1,name:"Tooltip",state:"open"});let te=re;const ae=Jf(y),U=D.useRef(),oe=st(()=>{U.current!==void 0&&(document.body.style.WebkitUserSelect=U.current,U.current=void 0),ee.clear()});D.useEffect(()=>oe,[oe]);const ne=Ht=>{ahe.clear(),oI=!0,me(!0),_&&!te&&_(Ht)},G=st(Ht=>{ahe.start(800+x,()=>{oI=!1}),me(!1),w&&te&&w(Ht),Y.start(F.transitions.duration.shortest,()=>{X.current=!1})}),q=Ht=>{X.current&&Ht.type!=="touchstart"||(L&&L.removeAttribute("title"),le.clear(),K.clear(),p||oI&&g?le.start(oI?g:p,()=>{ne(Ht)}):ne(Ht))},Z=Ht=>{le.clear(),K.start(x,()=>{G(Ht)})},[,de]=D.useState(!1),xe=Ht=>{Zv(Ht.target)||(de(!1),Z(Ht))},H=Ht=>{L||B(Ht.currentTarget),Zv(Ht.target)&&(de(!0),q(Ht))},W=Ht=>{X.current=!0;const fr=z.props;fr.onTouchStart&&fr.onTouchStart(Ht)},J=Ht=>{W(Ht),K.clear(),Y.clear(),oe(),U.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ee.start(m,()=>{document.body.style.WebkitUserSelect=U.current,q(Ht)})},se=Ht=>{z.props.onTouchEnd&&z.props.onTouchEnd(Ht),oe(),K.start(b,()=>{G(Ht)})};D.useEffect(()=>{if(!te)return;function Ht(fr){fr.key==="Escape"&&G(fr)}return document.addEventListener("keydown",Ht),()=>{document.removeEventListener("keydown",Ht)}},[G,te]);const ye=dn(Ry(z),B,n);!R&&R!==0&&(te=!1);const ie=D.useRef(),fe=Ht=>{const fr=z.props;fr.onMouseMove&&fr.onMouseMove(Ht),FE={x:Ht.clientX,y:Ht.clientY},ie.current&&ie.current.update()},Q={},_e=typeof R=="string";c?(Q.title=!te&&_e&&!f?R:null,Q["aria-describedby"]=te?ae:null):(Q["aria-label"]=_e?R:null,Q["aria-labelledby"]=te&&!_e?ae:null);const we={...Q,...I,...z.props,className:Oe(I.className,z.props.className),onTouchStart:W,ref:ye,...v?{onMouseMove:fe}:{}},Ie={};h||(we.onTouchStart=J,we.onTouchEnd=se),f||(we.onMouseOver=sI(q,we.onMouseOver),we.onMouseLeave=sI(Z,we.onMouseLeave),V||(Ie.onMouseOver=q,Ie.onMouseLeave=Z)),u||(we.onFocus=sI(H,we.onFocus),we.onBlur=sI(xe,we.onBlur),V||(Ie.onFocus=H,Ie.onBlur=xe));const Pe=D.useMemo(()=>{var fr;let Ht=[{name:"arrow",enabled:!!$,options:{element:$,padding:4}}];return(fr=E.popperOptions)!=null&&fr.modifiers&&(Ht=Ht.concat(E.popperOptions.modifiers)),{...E.popperOptions,modifiers:Ht}},[$,E]),Re={...r,isRtl:N,arrow:i,disableInteractive:V,placement:O,PopperComponentProp:k,touch:X.current},Te=rft(Re),Le=A.popper??a.Popper??ift,ue=A.transition??a.Transition??T??ob,$e=A.tooltip??a.Tooltip??oft,Se=A.arrow??a.Arrow??sft,Ye=s_(Le,{...E,...P.popper??l.popper,className:Oe(Te.popper,E==null?void 0:E.className,(Dn=P.popper??l.popper)==null?void 0:Dn.className)},Re),tt=s_(ue,{...M,...P.transition??l.transition},Re),ut=s_($e,{...P.tooltip??l.tooltip,className:Oe(Te.tooltip,(Zi=P.tooltip??l.tooltip)==null?void 0:Zi.className)},Re),qt=s_(Se,{...P.arrow??l.arrow,className:Oe(Te.arrow,(yn=P.arrow??l.arrow)==null?void 0:yn.className)},Re);return C.jsxs(D.Fragment,{children:[D.cloneElement(z,we),C.jsx(Le,{as:k??Gee,placement:O,anchorEl:v?{getBoundingClientRect:()=>({top:FE.y,left:FE.x,right:FE.x,bottom:FE.y,width:0,height:0})}:L,popperRef:ie,open:L?te:!1,id:ae,transition:!0,...Ie,...Ye,popperOptions:Pe,children:({TransitionProps:Ht})=>C.jsx(ue,{timeout:F.transitions.duration.shorter,...Ht,...tt,children:C.jsxs($e,{...ut,children:[R,i?C.jsx(Se,{...qt,ref:j}):null]})})})]})});function aft(t){return Xe("MuiSwitch",t)}const da=He("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),lft=t=>{const{classes:e,edge:n,size:r,color:i,checked:o,disabled:s}=t,a={root:["root",n&&`edge${Me(n)}`,`size${Me(r)}`],switchBase:["switchBase",`color${Me(i)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=qe(a,aft,e);return{...e,...l}},cft=be("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${Me(n.edge)}`],e[`size${Me(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,[`& .${da.thumb}`]:{width:16,height:16},[`& .${da.switchBase}`]:{padding:4,[`&.${da.checked}`]:{transform:"translateX(16px)"}}}}]}),uft=be(qee,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${da.input}`]:e.input},n.color!=="default"&&e[`color${Me(n.color)}`]]}})(wt(({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}),[`&.${da.checked}`]:{transform:"translateX(20px)"},[`&.${da.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${da.checked} + .${da.track}`]:{opacity:.5},[`&.${da.disabled} + .${da.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${da.input}`]:{left:"-100%",width:"300%"}})),wt(({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(pr(["light"])).map(([e])=>({props:{color:e},style:{[`&.${da.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"}},[`&.${da.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Eh(t.palette[e].main,.62):Oh(t.palette[e].main,.55)}`}},[`&.${da.checked} + .${da.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]}))),fft=be("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(wt(({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}`}))),dft=be("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(wt(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Zee=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:s=!1,size:a="medium",sx:l,...c}=r,u={...r,color:o,edge:s,size:a},f=lft(u),d=C.jsx(dft,{className:f.thumb,ownerState:u});return C.jsxs(cft,{className:Oe(f.root,i),sx:l,ownerState:u,children:[C.jsx(uft,{type:"checkbox",icon:d,checkedIcon:d,ref:n,ownerState:u,...c,classes:{...f,root:f.switchBase}}),C.jsx(fft,{className:f.track,ownerState:u})]})});function hft(t){return Xe("MuiTab",t)}const Ic=He("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),pft=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:i,icon:o,label:s,selected:a,disabled:l}=t,c={root:["root",o&&s&&"labelIcon",`textColor${Me(n)}`,r&&"fullWidth",i&&"wrapped",a&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]};return qe(c,hft,e)},gft=be(Ff,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${Me(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped,{[`& .${Ic.iconWrapper}`]:e.iconWrapper},{[`& .${Ic.icon}`]:e.icon}]}})(wt(({theme:t})=>({...t.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition==="top"||e.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&e.iconPosition!=="top"&&e.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="top",style:{[`& > .${Ic.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="bottom",style:{[`& > .${Ic.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="start",style:{[`& > .${Ic.icon}`]:{marginRight:t.spacing(1)}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="end",style:{[`& > .${Ic.icon}`]:{marginLeft:t.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Ic.selected}`]:{opacity:1},[`&.${Ic.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Ic.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Ic.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Ic.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Ic.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:t.typography.pxToRem(12)}}]}))),sb=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:s=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:h,onFocus:p,selected:g,selectionFollowsFocus:m,textColor:v="inherit",value:y,wrapped:x=!1,...b}=r,w={...r,disabled:o,disableFocusRipple:s,selected:g,icon:!!l,iconPosition:c,label:!!f,fullWidth:a,textColor:v,wrapped:x},_=pft(w),S=l&&f&&D.isValidElement(l)?D.cloneElement(l,{className:Oe(_.icon,l.props.className)}):l,O=E=>{!g&&d&&d(E,y),h&&h(E)},k=E=>{m&&!g&&d&&d(E,y),p&&p(E)};return C.jsxs(gft,{focusRipple:!s,className:Oe(_.root,i),ref:n,role:"tab","aria-selected":g,disabled:o,onClick:O,onFocus:k,ownerState:w,tabIndex:g?0:-1,...b,children:[c==="top"||c==="start"?C.jsxs(D.Fragment,{children:[S,f]}):C.jsxs(D.Fragment,{children:[f,S]}),u]})}),FPe=D.createContext();function mft(t){return Xe("MuiTable",t)}He("MuiTable",["root","stickyHeader"]);const vft=t=>{const{classes:e,stickyHeader:n}=t;return qe({root:["root",n&&"stickyHeader"]},mft,e)},yft=be("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(wt(({theme:t})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...t.typography.body2,padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),lhe="table",Jee=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTable"}),{className:i,component:o=lhe,padding:s="normal",size:a="medium",stickyHeader:l=!1,...c}=r,u={...r,component:o,padding:s,size:a,stickyHeader:l},f=vft(u),d=D.useMemo(()=>({padding:s,size:a,stickyHeader:l}),[s,a,l]);return C.jsx(FPe.Provider,{value:d,children:C.jsx(yft,{as:o,role:o===lhe?null:"table",ref:n,className:Oe(f.root,i),ownerState:u,...c})})}),S4=D.createContext();function xft(t){return Xe("MuiTableBody",t)}He("MuiTableBody",["root"]);const bft=t=>{const{classes:e}=t;return qe({root:["root"]},xft,e)},wft=be("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),_ft={variant:"body"},che="tbody",ete=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableBody"}),{className:i,component:o=che,...s}=r,a={...r,component:o},l=bft(a);return C.jsx(S4.Provider,{value:_ft,children:C.jsx(wft,{className:Oe(l.root,i),as:o,ref:n,role:o===che?null:"rowgroup",ownerState:a,...s})})});function Sft(t){return Xe("MuiTableCell",t)}const Cft=He("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Oft=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:s}=t,a={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${Me(r)}`,i!=="normal"&&`padding${Me(i)}`,`size${Me(o)}`]};return qe(a,Sft,e)},Eft=be("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${Me(n.size)}`],n.padding!=="normal"&&e[`padding${Me(n.padding)}`],n.align!=="inherit"&&e[`align${Me(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(wt(({theme:t})=>({...t.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid - ${t.palette.mode==="light"?Eh(kt(t.palette.divider,1),.88):Oh(kt(t.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(t.vars||t).palette.text.primary}},{props:{variant:"footer"},style:{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${Cft.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default}}]}))),ui=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:c,sortDirection:u,variant:f,...d}=r,h=D.useContext(FPe),p=D.useContext(S4),g=p&&p.variant==="head";let m;s?m=s:m=g?"th":"td";let v=l;m==="td"?v=void 0:!v&&g&&(v="col");const y=f||p&&p.variant,x={...r,align:i,component:m,padding:a||(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=Oft(x);let w=null;return u&&(w=u==="asc"?"ascending":"descending"),C.jsx(Eft,{as:m,ref:n,className:Oe(b.root,o),"aria-sort":w,scope:v,ownerState:x,...d})});function Tft(t){return Xe("MuiTableContainer",t)}He("MuiTableContainer",["root"]);const kft=t=>{const{classes:e}=t;return qe({root:["root"]},Tft,e)},Aft=be("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),NPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableContainer"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=kft(a);return C.jsx(Aft,{ref:n,as:o,className:Oe(l.root,i),ownerState:a,...s})});function Pft(t){return Xe("MuiTableHead",t)}He("MuiTableHead",["root"]);const Mft=t=>{const{classes:e}=t;return qe({root:["root"]},Pft,e)},Rft=be("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),Dft={variant:"head"},uhe="thead",Ift=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableHead"}),{className:i,component:o=uhe,...s}=r,a={...r,component:o},l=Mft(a);return C.jsx(S4.Provider,{value:Dft,children:C.jsx(Rft,{as:o,className:Oe(l.root,i),ref:n,role:o===uhe?null:"rowgroup",ownerState:a,...s})})});function Lft(t){return Xe("MuiToolbar",t)}He("MuiToolbar",["root","gutters","regular","dense"]);const $ft=t=>{const{classes:e,disableGutters:n,variant:r}=t;return qe({root:["root",!n&&"gutters",r]},Lft,e)},Fft=be("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(wt(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}))),C4=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=$ft(c);return C.jsx(Fft,{as:o,className:Oe(u.root,i),ref:n,ownerState:c,...l})}),Nft=lt(C.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),zft=lt(C.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function jft(t){return Xe("MuiTableRow",t)}const fhe=He("MuiTableRow",["root","selected","hover","head","footer"]),Bft=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return qe({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},jft,e)},Uft=be("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(wt(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${fhe.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${fhe.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)}}}))),dhe="tr",Ad=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableRow"}),{className:i,component:o=dhe,hover:s=!1,selected:a=!1,...l}=r,c=D.useContext(S4),u={...r,component:o,hover:s,selected:a,head:c&&c.variant==="head",footer:c&&c.variant==="footer"},f=Bft(u);return C.jsx(Uft,{as:o,ref:n,className:Oe(f.root,i),role:o===dhe?null:"row",ownerState:u,...l})});function Wft(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function Vft(t,e,n,r={},i=()=>{}){const{ease:o=Wft,duration:s=300}=r;let a=null;const l=e[t];let c=!1;const u=()=>{c=!0},f=d=>{if(c){i(new Error("Animation cancelled"));return}a===null&&(a=d);const h=Math.min(1,(d-a)/s);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 Gft={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Hft(t){const{onChange:e,...n}=t,r=D.useRef(),i=D.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Ei(()=>{const s=TM(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),a=xc(i.current);return a.addEventListener("resize",s),()=>{s.clear(),a.removeEventListener("resize",s)}},[e]),D.useEffect(()=>{o(),e(r.current)},[e]),C.jsx("div",{style:Gft,ref:i,...n})}function qft(t){return Xe("MuiTabScrollButton",t)}const Xft=He("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Yft=t=>{const{classes:e,orientation:n,disabled:r}=t;return qe({root:["root",n,r&&"disabled"]},qft,e)},Qft=be(Ff,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Xft.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),Kft=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTabScrollButton"}),{className:i,slots:o={},slotProps:s={},direction:a,orientation:l,disabled:c,...u}=r,f=Eo(),d={isRtl:f,...r},h=Yft(d),p=o.StartScrollButtonIcon??Nft,g=o.EndScrollButtonIcon??zft,m=Zt({elementType:p,externalSlotProps:s.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=Zt({elementType:g,externalSlotProps:s.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return C.jsx(Qft,{component:"div",className:Oe(h.root,i),ref:n,role:null,ownerState:d,tabIndex:null,...u,style:{...u.style,...l==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${f?-90:90}deg)`}},children:a==="left"?C.jsx(p,{...m}):C.jsx(g,{...v})})});function Zft(t){return Xe("MuiTabs",t)}const a3=He("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),hhe=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,phe=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,aI=(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}}},Jft=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:s,scrollButtonsHideMobile:a,classes:l}=t;return qe({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",a&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},Zft,l)},edt=be("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${a3.scrollButtons}`]:e.scrollButtons},{[`& .${a3.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(wt(({theme:t})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${a3.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}}}]}))),tdt=be("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]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:t})=>t.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:t})=>t.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:t})=>t.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:t})=>t.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),ndt=be("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})({display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.centered,style:{justifyContent:"center"}}]}),rdt=be("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(wt(({theme:t})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(t.vars||t).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(t.vars||t).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),idt=be(Hft)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),ghe={},O4=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTabs"}),i=To(),o=Eo(),{"aria-label":s,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:g,orientation:m="horizontal",ScrollButtonComponent:v=Kft,scrollButtons:y="auto",selectionFollowsFocus:x,slots:b={},slotProps:w={},TabIndicatorProps:_={},TabScrollButtonProps:S={},textColor:O="primary",value:k,variant:E="standard",visibleScrollbar:P=!1,...A}=r,R=E==="scrollable",T=m==="vertical",M=T?"scrollTop":"scrollLeft",I=T?"top":"left",z=T?"bottom":"right",F=T?"clientHeight":"clientWidth",N=T?"height":"width",L={...r,component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:m,vertical:T,scrollButtons:y,textColor:O,variant:E,visibleScrollbar:P,fixed:!R,hideScrollbar:R&&!P,scrollableX:R&&!T,scrollableY:R&&T,centered:c&&!R,scrollButtonsHideMobile:!h},B=Jft(L),$=Zt({elementType:b.StartScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:L}),j=Zt({elementType:b.EndScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:L}),[X,V]=D.useState(!1),[Y,le]=D.useState(ghe),[K,ee]=D.useState(!1),[re,me]=D.useState(!1),[te,ae]=D.useState(!1),[U,oe]=D.useState({overflow:"hidden",scrollbarWidth:0}),ne=new Map,G=D.useRef(null),q=D.useRef(null),Z=()=>{const Te=G.current;let Le;if(Te){const $e=Te.getBoundingClientRect();Le={clientWidth:Te.clientWidth,scrollLeft:Te.scrollLeft,scrollTop:Te.scrollTop,scrollWidth:Te.scrollWidth,top:$e.top,bottom:$e.bottom,left:$e.left,right:$e.right}}let ue;if(Te&&k!==!1){const $e=q.current.children;if($e.length>0){const Se=$e[ne.get(k)];ue=Se?Se.getBoundingClientRect():null}}return{tabsMeta:Le,tabMeta:ue}},de=st(()=>{const{tabsMeta:Te,tabMeta:Le}=Z();let ue=0,$e;T?($e="top",Le&&Te&&(ue=Le.top-Te.top+Te.scrollTop)):($e=o?"right":"left",Le&&Te&&(ue=(o?-1:1)*(Le[$e]-Te[$e]+Te.scrollLeft)));const Se={[$e]:ue,[N]:Le?Le[N]:0};if(typeof Y[$e]!="number"||typeof Y[N]!="number")le(Se);else{const Ye=Math.abs(Y[$e]-Se[$e]),tt=Math.abs(Y[N]-Se[N]);(Ye>=1||tt>=1)&&le(Se)}}),xe=(Te,{animation:Le=!0}={})=>{Le?Vft(M,G.current,Te,{duration:i.transitions.duration.standard}):G.current[M]=Te},H=Te=>{let Le=G.current[M];T?Le+=Te:Le+=Te*(o?-1:1),xe(Le)},W=()=>{const Te=G.current[F];let Le=0;const ue=Array.from(q.current.children);for(let $e=0;$eTe){$e===0&&(Le=Te);break}Le+=Se[F]}return Le},J=()=>{H(-1*W())},se=()=>{H(W())},ye=D.useCallback(Te=>{oe({overflow:null,scrollbarWidth:Te})},[]),ie=()=>{const Te={};Te.scrollbarSizeListener=R?C.jsx(idt,{onChange:ye,className:Oe(B.scrollableX,B.hideScrollbar)}):null;const ue=R&&(y==="auto"&&(K||re)||y===!0);return Te.scrollButtonStart=ue?C.jsx(v,{slots:{StartScrollButtonIcon:b.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:$},orientation:m,direction:o?"right":"left",onClick:J,disabled:!K,...S,className:Oe(B.scrollButtons,S.className)}):null,Te.scrollButtonEnd=ue?C.jsx(v,{slots:{EndScrollButtonIcon:b.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:j},orientation:m,direction:o?"left":"right",onClick:se,disabled:!re,...S,className:Oe(B.scrollButtons,S.className)}):null,Te},fe=st(Te=>{const{tabsMeta:Le,tabMeta:ue}=Z();if(!(!ue||!Le)){if(ue[I]Le[z]){const $e=Le[M]+(ue[z]-Le[z]);xe($e,{animation:Te})}}}),Q=st(()=>{R&&y!==!1&&ae(!te)});D.useEffect(()=>{const Te=TM(()=>{G.current&&de()});let Le;const ue=Ye=>{Ye.forEach(tt=>{tt.removedNodes.forEach(ut=>{Le==null||Le.unobserve(ut)}),tt.addedNodes.forEach(ut=>{Le==null||Le.observe(ut)})}),Te(),Q()},$e=xc(G.current);$e.addEventListener("resize",Te);let Se;return typeof ResizeObserver<"u"&&(Le=new ResizeObserver(Te),Array.from(q.current.children).forEach(Ye=>{Le.observe(Ye)})),typeof MutationObserver<"u"&&(Se=new MutationObserver(ue),Se.observe(q.current,{childList:!0})),()=>{Te.clear(),$e.removeEventListener("resize",Te),Se==null||Se.disconnect(),Le==null||Le.disconnect()}},[de,Q]),D.useEffect(()=>{const Te=Array.from(q.current.children),Le=Te.length;if(typeof IntersectionObserver<"u"&&Le>0&&R&&y!==!1){const ue=Te[0],$e=Te[Le-1],Se={root:G.current,threshold:.99},Ye=Dn=>{ee(!Dn[0].isIntersecting)},tt=new IntersectionObserver(Ye,Se);tt.observe(ue);const ut=Dn=>{me(!Dn[0].isIntersecting)},qt=new IntersectionObserver(ut,Se);return qt.observe($e),()=>{tt.disconnect(),qt.disconnect()}}},[R,y,te,u==null?void 0:u.length]),D.useEffect(()=>{V(!0)},[]),D.useEffect(()=>{de()}),D.useEffect(()=>{fe(ghe!==Y)},[fe,Y]),D.useImperativeHandle(l,()=>({updateIndicator:de,updateScrollButtons:Q}),[de,Q]);const _e=C.jsx(rdt,{..._,className:Oe(B.indicator,_.className),ownerState:L,style:{...Y,..._.style}});let we=0;const Ie=D.Children.map(u,Te=>{if(!D.isValidElement(Te))return null;const Le=Te.props.value===void 0?we:Te.props.value;ne.set(Le,we);const ue=Le===k;return we+=1,D.cloneElement(Te,{fullWidth:E==="fullWidth",indicator:ue&&!X&&_e,selected:ue,selectionFollowsFocus:x,onChange:g,textColor:O,value:Le,...we===1&&k===!1&&!Te.props.tabIndex?{tabIndex:0}:{}})}),Pe=Te=>{const Le=q.current,ue=yi(Le).activeElement;if(ue.getAttribute("role")!=="tab")return;let Se=m==="horizontal"?"ArrowLeft":"ArrowUp",Ye=m==="horizontal"?"ArrowRight":"ArrowDown";switch(m==="horizontal"&&o&&(Se="ArrowRight",Ye="ArrowLeft"),Te.key){case Se:Te.preventDefault(),aI(Le,ue,phe);break;case Ye:Te.preventDefault(),aI(Le,ue,hhe);break;case"Home":Te.preventDefault(),aI(Le,null,hhe);break;case"End":Te.preventDefault(),aI(Le,null,phe);break}},Re=ie();return C.jsxs(edt,{className:Oe(B.root,f),ownerState:L,ref:n,as:d,...A,children:[Re.scrollButtonStart,Re.scrollbarSizeListener,C.jsxs(tdt,{className:B.scroller,ownerState:L,style:{overflow:U.overflow,[T?`margin${o?"Left":"Right"}`:"marginBottom"]:P?void 0:-U.scrollbarWidth},ref:G,children:[C.jsx(ndt,{"aria-label":s,"aria-labelledby":a,"aria-orientation":m==="vertical"?"vertical":null,className:B.flexContainer,ownerState:L,onKeyDown:Pe,ref:q,role:"tablist",children:Ie}),X&&_e]}),Re.scrollButtonEnd]})});function odt(t){return Xe("MuiTextField",t)}He("MuiTextField",["root"]);const sdt={standard:Dg,filled:NF,outlined:zF},adt=t=>{const{classes:e}=t;return qe({root:["root"]},odt,e)},ldt=be(td,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Jr=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:g,InputLabelProps:m,inputProps:v,InputProps:y,inputRef:x,label:b,maxRows:w,minRows:_,multiline:S=!1,name:O,onBlur:k,onChange:E,onFocus:P,placeholder:A,required:R=!1,rows:T,select:M=!1,SelectProps:I,slots:z={},slotProps:F={},type:N,value:L,variant:B="outlined",...$}=r,j={...r,autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:S,required:R,select:M,variant:B},X=adt(j),V=Jf(g),Y=p&&V?`${V}-helper-text`:void 0,le=b&&V?`${V}-label`:void 0,K=sdt[B],ee={slots:z,slotProps:{input:y,inputLabel:m,htmlInput:v,formHelperText:d,select:I,...F}},re={},me=ee.slotProps.inputLabel;B==="outlined"&&(me&&typeof me.shrink<"u"&&(re.notched=me.shrink),re.label=b),M&&((!I||!I.native)&&(re.id=void 0),re["aria-describedby"]=void 0);const[te,ae]=Jl("input",{elementType:K,externalForwardedProps:ee,additionalProps:re,ownerState:j}),[U,oe]=Jl("inputLabel",{elementType:Fy,externalForwardedProps:ee,ownerState:j}),[ne,G]=Jl("htmlInput",{elementType:"input",externalForwardedProps:ee,ownerState:j}),[q,Z]=Jl("formHelperText",{elementType:Xee,externalForwardedProps:ee,ownerState:j}),[de,xe]=Jl("select",{elementType:Hg,externalForwardedProps:ee,ownerState:j}),H=C.jsx(te,{"aria-describedby":Y,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:S,name:O,rows:T,maxRows:w,minRows:_,type:N,value:L,id:V,inputRef:x,onBlur:k,onChange:E,onFocus:P,placeholder:A,inputProps:G,slots:{input:z.htmlInput?ne:void 0},...ae});return C.jsxs(ldt,{className:Oe(X.root,a),disabled:u,error:f,fullWidth:h,ref:n,required:R,color:l,variant:B,ownerState:j,...$,children:[b!=null&&b!==""&&C.jsx(U,{htmlFor:V,id:le,...oe,children:b}),M?C.jsx(de,{"aria-describedby":Y,id:V,labelId:le,value:L,input:H,...xe,children:s}):H,p&&C.jsx(q,{id:Y,...Z,children:p})]})});function cdt(t){return Xe("MuiToggleButton",t)}const dx=He("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),zPe=D.createContext({}),jPe=D.createContext(void 0);function udt(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.includes(t):t===e}const fdt=t=>{const{classes:e,fullWidth:n,selected:r,disabled:i,size:o,color:s}=t,a={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${Me(o)}`,s]};return qe(a,cdt,e)},ddt=be(Ff,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`size${Me(n.size)}`]]}})(wt(({theme:t})=>({...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,[`&.${dx.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})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${dx.selected}`]:{color:(t.vars||t).palette.text.primary,backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.text.primary,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.text.primary,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.text.primary,t.palette.action.selectedOpacity)}}}}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{[`&.${dx.selected}`]:{color:(t.vars||t).palette[e].main,backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette[e].main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette[e].main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette[e].main,t.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:t.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:t.typography.pxToRem(15)}}]}))),xr=D.forwardRef(function(e,n){const{value:r,...i}=D.useContext(zPe),o=D.useContext(jPe),s=_S({...i,selected:udt(e.value,r)},e),a=_t({props:s,name:"MuiToggleButton"}),{children:l,className:c,color:u="standard",disabled:f=!1,disableFocusRipple:d=!1,fullWidth:h=!1,onChange:p,onClick:g,selected:m,size:v="medium",value:y,...x}=a,b={...a,color:u,disabled:f,disableFocusRipple:d,fullWidth:h,size:v},w=fdt(b),_=O=>{g&&(g(O,y),O.defaultPrevented)||p&&p(O,y)},S=o||"";return C.jsx(ddt,{className:Oe(i.className,w.root,c,S),disabled:f,focusRipple:!d,ref:n,onClick:_,onChange:p,value:y,ownerState:b,"aria-pressed":m,...x,children:l})});function hdt(t){return Xe("MuiToggleButtonGroup",t)}const Xr=He("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),pdt=t=>{const{classes:e,orientation:n,fullWidth:r,disabled:i}=t,o={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${Me(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return qe(o,hdt,e)},gdt=be("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Xr.grouped}`]:e.grouped},{[`& .${Xr.grouped}`]:e[`grouped${Me(n.orientation)}`]},{[`& .${Xr.firstButton}`]:e.firstButton},{[`& .${Xr.lastButton}`]:e.lastButton},{[`& .${Xr.middleButton}`]:e.middleButton},e.root,n.orientation==="vertical"&&e.vertical,n.fullWidth&&e.fullWidth]}})(wt(({theme:t})=>({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${Xr.grouped}`]:{[`&.${Xr.selected} + .${Xr.grouped}.${Xr.selected}`]:{borderTop:0,marginTop:0}},[`& .${Xr.firstButton},& .${Xr.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Xr.lastButton},& .${Xr.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Xr.lastButton}.${dx.disabled},& .${Xr.middleButton}.${dx.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${Xr.grouped}`]:{[`&.${Xr.selected} + .${Xr.grouped}.${Xr.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Xr.firstButton},& .${Xr.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Xr.lastButton},& .${Xr.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Xr.lastButton}.${dx.disabled},& .${Xr.middleButton}.${dx.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),tO=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiToggleButtonGroup"}),{children:i,className:o,color:s="standard",disabled:a=!1,exclusive:l=!1,fullWidth:c=!1,onChange:u,orientation:f="horizontal",size:d="medium",value:h,...p}=r,g={...r,disabled:a,fullWidth:c,orientation:f,size:d},m=pdt(g),v=D.useCallback((S,O)=>{if(!u)return;const k=h&&h.indexOf(O);let E;h&&k>=0?(E=h.slice(),E.splice(k,1)):E=h?h.concat(O):[O],u(S,E)},[u,h]),y=D.useCallback((S,O)=>{u&&u(S,h===O?null:O)},[u,h]),x=D.useMemo(()=>({className:m.grouped,onChange:l?y:v,value:h,size:d,fullWidth:c,color:s,disabled:a}),[m.grouped,l,y,v,h,d,c,s,a]),b=wnt(i),w=b.length,_=S=>{const O=S===0,k=S===w-1;return O&&k?"":O?m.firstButton:k?m.lastButton:m.middleButton};return C.jsx(gdt,{role:"group",className:Oe(m.root,o),ref:n,ownerState:g,...p,children:C.jsx(zPe.Provider,{value:x,children:b.map((S,O)=>C.jsx(jPe.Provider,{value:_(O),children:S},O))})})}),mdt="default",vdt={id:"local",name:"Local Server",url:"http://localhost:8080"},ydt={appBarTitle:"xcube Viewer",windowTitle:"xcube Viewer",windowIcon:null,headerBackgroundColor:"DimGray",compact:!1,themeMode:"system",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,allowSharing:!0,allowUserVariables:!0,allowViewModePython:!0,allow3D:!0},lI={name:mdt,server:vdt,branding:ydt};function xdt(){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 nO=xdt();function BPe(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 bdt={amber:iAe,blue:Um,blueGrey:KJe,brown:oAe,cyan:eAe,deepOrange:Px,deepPurple:YJe,green:$p,grey:sAe,indigo:Jke,lightBlue:Wm,lightGreen:QJe,lime:nAe,orange:Q0,pink:Zke,purple:Bm,red:jm,teal:tAe,yellow:rAe};function mhe(t,e){const n=t[e];let r=null;if(typeof n=="string"?(r=bdt[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 wdt(t,e,n){const r=t[e];typeof r=="string"&&(t[e]=BPe(nO.href,n,r))}function _dt(t,e){return t={...t},mhe(t,"primaryColor"),mhe(t,"secondaryColor"),wdt(t,"logoImage",e),t}function yr(t){return typeof t=="number"}function n1(t){return typeof t=="string"}function Sdt(t){return typeof t=="function"}function vhe(t){return t!==null&&typeof t=="object"&&t.constructor===Object}const Up=new URLSearchParams(window.location.search),sf=class sf{constructor(e,n,r,i){gn(this,"name");gn(this,"server");gn(this,"branding");gn(this,"authClient");this.name=e,this.server=n,this.branding=r,this.authClient=i}static async load(){let e=Up.get("configPath")||"config";const n=await this.loadRawConfig(e);n===lI&&(e="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),s=parseInt(Up.get("compact")||"0")!==0;let a=_dt({...lI.branding,...n.branding,compact:s||n.branding.compact},e);return a=xhe(a,"allowUserVariables"),a=xhe(a,"allow3D"),sf._instance=new sf(r,o,a,i),a.windowTitle&&this.changeWindowTitle(a.windowTitle),a.windowIcon&&this.changeWindowIcon(a.windowIcon),sf._instance}static getAuthConfig(e){let n=e.authClient&&{...e.authClient};const r=sf.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={...lI.server,...e.server},r=sf.getApiServerFromEnv();return n.id=Up.get("serverId")||r.id||n.id,n.name=Up.get("serverName")||r.name||n.name,n.url=Up.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(e){let n=null,r=null;const i=BPe(nO.href,e,"config.json");try{const o=await fetch(i);if(o.ok)n=await o.json();else{const{status:s,statusText:a}=o;r=`HTTP status ${s}`,a&&(r+=` (${a})`)}}catch(o){n=null,r=`${o}`}return n===null&&(n=lI),n}static get instance(){return sf.assertConfigLoaded(),sf._instance}static assertConfigLoaded(){if(!sf._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}}};gn(sf,"_instance");let Pn=sf;const tte=[["red",jm],["yellow",rAe],["blue",Um],["pink",Zke],["lightBlue",Wm],["green",$p],["orange",Q0],["lime",nAe],["purple",Bm],["indigo",Jke],["cyan",eAe],["brown",oAe],["teal",tAe]],Cdt=(()=>{const t={};return tte.forEach(([e,n])=>{t[e]=n}),t})(),yhe=tte.map(([t,e])=>t);function Odt(t){return t==="light"?800:400}function ab(t){return yhe[t%yhe.length]}function UPe(t,e){const n=Odt(e);return Cdt[t][n]}function nte(t){return yr(t)||(t=Pn.instance.branding.polygonFillOpacity),yr(t)?t:.25}const Edt={Mapbox:{param:"access_token",token:"pk.eyJ1IjoiZm9ybWFuIiwiYSI6ImNrM2JranV0bDBtenczb2szZG84djh6bWUifQ.q0UKwf4CWt5fcQwIDwF8Bg"}};function Tdt(t){return Edt[t]}function xhe(t,e){const n=Up.get(e),r=n?!!parseInt(n):!!t[e];return{...t,[e]:r}}const kdt=[{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:[]}],Adt=kdt,rte="User";function BF(t){return t?`${t.group}: ${t.title}`:"-"}function UF(t,e){return t.find(n=>n.id===e)||null}function WPe(t="datasets"){const e=[];return Adt.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 VPe=WPe("datasets"),Pdt=WPe("overlays"),Mdt=VPe[0].id,rO="EPSG:4326",ite="EPSG:3857",GPe=ite;var jh=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 AS={PROPERTYCHANGE:"propertychange"};var ote=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function Rdt(t,e,n){for(var r,i,o=lb,s=0,a=t.length,l=!1;s>1),i=+o(t[r],e),i<0?s=r+1:(a=r,l=!i);return l?s:~s}function lb(t,e){return t>e?1:t0){for(i=1;i0?i-1:i:t[i-1]-e0||s===0)})}function Dx(){return!0}function DM(){return!1}function cb(){}function Ldt(t){var e=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!e||this!==i||!r1(o,r))&&(e=!0,i=this,r=o,n=t.apply(this,arguments)),n}}var pi=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]=cb,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},e}(ote);const nn={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 zn(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 s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function WF(t,e,n,r){return zn(t,e,n,r,!0)}function si(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),IM(t))}var Fdt=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)}}(),LM=function(t){Fdt(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(nn.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),s=0;s=0||ey.match(/cpu (os|iphone os) 15_4 like mac os x/));var Hdt=ey.indexOf("webkit")!==-1&&ey.indexOf("edge")==-1,qdt=ey.indexOf("macintosh")!==-1,YPe=typeof devicePixelRatio<"u"?devicePixelRatio:1,E4=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Xdt=typeof Image<"u"&&Image.prototype.decode,QPe=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 dh(){return[1,0,0,1,0,0]}function Ydt(t,e,n,r,i,o,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t}function Qdt(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 Bi(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 Kdt(t,e,n){return Ydt(t,e,0,0,n,0,0)}function Ig(t,e,n,r,i,o,s,a){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]=s*r*c-a*r*l+e,t[5]=s*i*l+a*i*c+n,t}function ate(t,e){var n=Zdt(e);bn(n!==0,32);var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5];return t[0]=s/n,t[1]=-i/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*l-s*a)/n,t[5]=-(r*l-i*a)/n,t}function Zdt(t){return t[0]*t[3]-t[1]*t[2]}var whe;function KPe(t){var e="matrix("+t.join(", ")+")";if(E4)return e;var n=whe||(whe=document.createElement("div"));return n.style.transform=e,n.style.transform}const Ro={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function _he(t){for(var e=_c(),n=0,r=t.length;ni&&(l=l|Ro.RIGHT),ao&&(l=l|Ro.ABOVE),l===Ro.UNKNOWN&&(l=Ro.INTERSECTING),l}function _c(){return[1/0,1/0,-1/0,-1/0]}function Bf(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 FM(t){return Bf(1/0,1/0,-1/0,-1/0,t)}function eht(t,e){var n=t[0],r=t[1];return Bf(n,r,n,r,e)}function JPe(t,e,n,r,i){var o=FM(i);return tMe(o,t,e,n,r)}function cA(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function eMe(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function tk(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function tMe(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 hte(t){return t[2]=s&&g<=l),!r&&o&Ro.RIGHT&&!(i&Ro.RIGHT)&&(m=h-(d-l)*p,r=m>=a&&m<=c),!r&&o&Ro.BELOW&&!(i&Ro.BELOW)&&(g=d-(h-a)/p,r=g>=s&&g<=l),!r&&o&Ro.LEFT&&!(i&Ro.LEFT)&&(m=h-(d-s)*p,r=m>=a&&m<=c)}return r}function oht(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 s=[],a=[],o=0,l=i.length;o=n[2])){var i=ei(n),o=Math.floor((r[0]-n[0])/i),s=o*i;t[0]-=s,t[2]-=s}return t}function sht(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]]];nMe(t,e);var r=ei(n);if(ei(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 rMe=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_||jf[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 oo(t,e,n){return Math.min(Math.max(t,e),n)}var aht=function(){var t;return"cosh"in Math?t=Math.cosh:t=function(e){var n=Math.exp(e);return(n+1/n)/2},t}(),lht=function(){var t;return"log2"in Math?t=Math.log2:t=function(e){return Math.log(e)*Math.LOG2E},t}();function cht(t,e,n,r,i,o){var s=i-n,a=o-r;if(s!==0||a!==0){var l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return Ix(t,e,n,r)}function Ix(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function uht(t){for(var e=t.length,n=0;ni&&(i=s,r=o)}if(i===0)return null;var a=t[r];t[r]=t[n],t[n]=a;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 l3(t){return t*Math.PI/180}function $v(t,e){var n=t%e;return n*e<0?n+e:n}function Fp(t,e,n){return t+n*(e-t)}function iMe(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function cI(t,e){return Math.floor(iMe(t,e))}function uI(t,e){return Math.ceil(iMe(t,e))}var fht=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)}}(),NM=6378137,c_=Math.PI*NM,dht=[-c_,-c_,c_,c_],hht=[-180,-85,180,85],fI=NM*Math.log(Math.tan(Math.PI/2)),V1=function(t){fht(e,t);function e(n){return t.call(this,{code:n,units:$o.METERS,extent:dht,global:!0,worldExtent:hht,getPointResolution:function(r,i){return r/aht(i[1]/NM)}})||this}return e}(rMe),She=[new V1("EPSG:3857"),new V1("EPSG:102100"),new V1("EPSG:102113"),new V1("EPSG:900913"),new V1("http://www.opengis.net/def/crs/EPSG/0/3857"),new V1("http://www.opengis.net/gml/srs/epsg.xml#3857")];function pht(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 s=0;sfI?a=fI:a<-fI&&(a=-fI),o[s+1]=a}return o}function ght(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 s=0;ss)return 1;if(s>o)return-1}return 0}function Sht(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function GF(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function pte(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 Cht(t,e){return t[0]*=e,t[1]*=e,t}function Oht(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function oMe(t,e){if(e.canWrapX()){var n=ei(e.getExtent()),r=Eht(t,e,n);r&&(t[0]-=r*n)}return t}function Eht(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]r[2])){var o=n||ei(r);i=Math.floor((t[0]-r[0])/o)}return i}var Tht=63710088e-1;function Ehe(t,e,n){var r=Tht,i=l3(t[1]),o=l3(e[1]),s=(o-i)/2,a=l3(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var bq=!0;function kht(t){var e=!0;bq=!e}function gte(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&&(bq=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function lMe(t,e){return t}function hx(t,e){return t}function Iht(){The(She),The(Ohe),Mht(Ohe,She,pht,ght)}Iht();function Lx(t,e,n,r,i,o){for(var s=o||[],a=0,l=e;l1)f=n;else if(d>0){for(var h=0;hi&&(i=c),o=a,s=l}return i}function bte(t,e,n,r,i){for(var o=0,s=n.length;o0;){for(var f=c.pop(),d=c.pop(),h=0,p=t[d],g=t[d+1],m=t[f],v=t[f+1],y=d+r;yh&&(u=y,h=w)}h>i&&(l[(u-e)/r]=1,d+r0&&g>h)&&(p<0&&m0&&m>p)){c=f,u=d;continue}o[s++]=c,o[s++]=u,a=c,l=u,c=f,u=d}}return o[s++]=c,o[s++]=u,s}function dMe(t,e,n,r,i,o,s,a){for(var l=0,c=n.length;l1?s:2,b=o||new Array(x),p=0;p>1;io&&(c-a)*(o-l)-(i-a)*(u-l)>0&&s++:u<=o&&(c-a)*(o-l)-(i-a)*(u-l)<0&&s--,a=c,l=u}return s!==0}function Ote(t,e,n,r,i,o){if(n.length===0||!px(t,e,n[0],r,i,o))return!1;for(var s=1,a=n.length;s=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:hMe(t,e,n,r,function(s,a){return iht(i,s,a)}):!1}function Qht(t,e,n,r,i){for(var o=0,s=n.length;ob&&(c=(u+f)/2,Ote(t,e,n,r,c,p)&&(x=c,b=w)),u=f}return isNaN(x)&&(x=i[o]),s?(s.push(x,p,b),s):[x,p,b]}function ipt(t,e,n,r,i){for(var o=[],s=0,a=n.length;s0}function _Me(t,e,n,r,i){for(var o=0,s=n.length;o="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==` + `:null,Klt=t=>{const{classes:e,variant:n,color:r}=t,i={root:["root",`color${Me(r)}`,n],dashed:["dashed",`dashedColor${Me(r)}`],bar1:["bar",`barColor${Me(r)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar",n!=="buffer"&&`barColor${Me(r)}`,n==="buffer"&&`color${Me(r)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return qe(i,qlt,e)},Yee=(t,e)=>t.vars?t.vars.palette.LinearProgress[`${e}Bg`]:t.palette.mode==="light"?Eh(t.palette[e].main,.62):Oh(t.palette[e].main,.5),Zlt=be("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${Me(n.color)}`],e[n.variant]]}})(wt(({theme:t})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{backgroundColor:Yee(t,e)}})),{props:({ownerState:e})=>e.color==="inherit"&&e.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),Jlt=be("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.dashed,e[`dashedColor${Me(n.color)}`]]}})(wt(({theme:t})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(t.palette).filter(pr()).map(([e])=>{const n=Yee(t,e);return{props:{color:e},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),Qlt||{animation:`${pq} 3s infinite linear`}),ect=be("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.bar,e[`barColor${Me(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&e.bar1Indeterminate,n.variant==="determinate"&&e.bar1Determinate,n.variant==="buffer"&&e.bar1Buffer]}})(wt(({theme:t})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{backgroundColor:(t.vars||t).palette[e].main}})),{props:{variant:"determinate"},style:{transition:`transform .${fq}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${fq}s linear`}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:{width:"auto"}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:Xlt||{animation:`${dq} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),tct=be("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.bar,e[`barColor${Me(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&e.bar2Indeterminate,n.variant==="buffer"&&e.bar2Buffer]}})(wt(({theme:t})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{"--LinearProgressBar2-barColor":(t.vars||t).palette[e].main}})),{props:({ownerState:e})=>e.variant!=="buffer"&&e.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:e})=>e.variant!=="buffer"&&e.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,variant:"buffer"},style:{backgroundColor:Yee(t,e),transition:`transform .${fq}s linear`}})),{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:{width:"auto"}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:Ylt||{animation:`${hq} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),nct=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiLinearProgress"}),{className:i,color:o="primary",value:s,valueBuffer:a,variant:l="indeterminate",...c}=r,u={...r,color:o,variant:l},f=Klt(u),d=Eo(),h={},p={bar1:{},bar2:{}};if((l==="determinate"||l==="buffer")&&s!==void 0){h["aria-valuenow"]=Math.round(s),h["aria-valuemin"]=0,h["aria-valuemax"]=100;let g=s-100;d&&(g=-g),p.bar1.transform=`translateX(${g}%)`}if(l==="buffer"&&a!==void 0){let g=(a||0)-100;d&&(g=-g),p.bar2.transform=`translateX(${g}%)`}return C.jsxs(Zlt,{className:Oe(f.root,i),ownerState:u,role:"progressbar",...h,ref:n,...c,children:[l==="buffer"?C.jsx(Jlt,{className:f.dashed,ownerState:u}):null,C.jsx(ect,{className:f.bar1,ownerState:u,style:p.bar1}),l==="determinate"?null:C.jsx(tct,{className:f.bar2,ownerState:u,style:p.bar2})]})});function rct(t){return Xe("MuiLink",t)}const ict=He("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),oct=({theme:t,ownerState:e})=>{const n=e.color,r=wS(t,`palette.${n}`,!1)||e.color,i=wS(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:kt(r,.4)},Vde={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},sct=t=>{const{classes:e,component:n,focusVisible:r,underline:i}=t,o={root:["root",`underline${Me(i)}`,n==="button"&&"button",r&&"focusVisible"]};return qe(o,rct,e)},act=be(Jt,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${Me(n.underline)}`],n.component==="button"&&e.button]}})(wt(({theme:t})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:n})=>e==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{underline:"always",color:e},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette[e].mainChannel} / 0.4)`:kt(t.palette[e].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:kt(t.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.secondaryChannel} / 0.4)`:kt(t.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(t.vars||t).palette.text.disabled}},{props:{component:"button"},style:{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"},[`&.${ict.focusVisible}`]:{outline:"auto"}}}]}))),lct=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiLink"}),i=To(),{className:o,color:s="primary",component:a="a",onBlur:l,onFocus:c,TypographyClasses:u,underline:f="always",variant:d="inherit",sx:h,...p}=r,[g,m]=D.useState(!1),v=w=>{Zv(w.target)||m(!1),l&&l(w)},y=w=>{Zv(w.target)&&m(!0),c&&c(w)},x={...r,color:s,component:a,focusVisible:g,underline:f,variant:d},b=sct(x);return C.jsx(act,{color:s,className:Oe(b.root,o),classes:u,component:a,onBlur:v,onFocus:y,ref:n,ownerState:x,variant:d,...p,sx:[...Vde[s]===void 0?[{color:s}]:[],...Array.isArray(h)?h:[h]],style:{...p.style,...f==="always"&&s!=="inherit"&&!Vde[s]&&{"--Link-underlineColor":oct({theme:i,ownerState:x})}}})}),Df=D.createContext({});function cct(t){return Xe("MuiList",t)}He("MuiList",["root","padding","dense","subheader"]);const uct=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return qe({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},cct,e)},fct=be("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]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>t.subheader,style:{paddingTop:0}}]}),MM=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c,...u}=r,f=D.useMemo(()=>({dense:a}),[a]),d={...r,component:s,dense:a,disablePadding:l},h=uct(d);return C.jsx(Df.Provider,{value:f,children:C.jsxs(fct,{as:s,className:Oe(h.root,o),ref:n,ownerState:d,...u,children:[c,i]})})});function dct(t){return Xe("MuiListItem",t)}He("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function hct(t){return Xe("MuiListItemButton",t)}const Fw=He("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),pct=(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]},gct=t=>{const{alignItems:e,classes:n,dense:r,disabled:i,disableGutters:o,divider:s,selected:a}=t,c=qe({root:["root",r&&"dense",!o&&"gutters",s&&"divider",i&&"disabled",e==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},hct,n);return{...n,...c}},mct=be(Ff,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:pct})(wt(({theme:t})=>({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"}},[`&.${Fw.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Fw.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)}},[`&.${Fw.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)}},[`&.${Fw.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Fw.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),TPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:s="div",children:a,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:d=!1,className:h,...p}=r,g=D.useContext(Df),m=D.useMemo(()=>({dense:l||g.dense||!1,alignItems:i,disableGutters:c}),[i,g.dense,l,c]),v=D.useRef(null);Ei(()=>{o&&v.current&&v.current.focus()},[o]);const y={...r,alignItems:i,dense:m.dense,disableGutters:c,divider:u,selected:d},x=gct(y),b=dn(v,n);return C.jsx(Df.Provider,{value:m,children:C.jsx(mct,{ref:b,href:p.href||p.to,component:(p.href||p.to)&&s==="div"?"button":s,focusVisibleClassName:Oe(x.focusVisible,f),ownerState:y,className:Oe(x.root,h),...p,classes:x,children:a})})});function vct(t){return Xe("MuiListItemSecondaryAction",t)}He("MuiListItemSecondaryAction",["root","disableGutters"]);const yct=t=>{const{disableGutters:e,classes:n}=t;return qe({root:["root",e&&"disableGutters"]},vct,n)},xct=be("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:t})=>t.disableGutters,style:{right:0}}]}),sA=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItemSecondaryAction"}),{className:i,...o}=r,s=D.useContext(Df),a={...r,disableGutters:s.disableGutters},l=yct(a);return C.jsx(xct,{className:Oe(l.root,i),ownerState:a,ref:n,...o})});sA.muiName="ListItemSecondaryAction";const bct=(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.hasSecondaryAction&&e.secondaryAction]},wct=t=>{const{alignItems:e,classes:n,dense:r,disableGutters:i,disablePadding:o,divider:s,hasSecondaryAction:a}=t;return qe({root:["root",r&&"dense",!i&&"gutters",!o&&"padding",s&&"divider",e==="flex-start"&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},dct,n)},_ct=be("div",{name:"MuiListItem",slot:"Root",overridesResolver:bct})(wt(({theme:t})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${Fw.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{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"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),Sct=be("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),$_=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItem"}),{alignItems:i="center",children:o,className:s,component:a,components:l={},componentsProps:c={},ContainerComponent:u="li",ContainerProps:{className:f,...d}={},dense:h=!1,disableGutters:p=!1,disablePadding:g=!1,divider:m=!1,secondaryAction:v,slotProps:y={},slots:x={},...b}=r,w=D.useContext(Df),_=D.useMemo(()=>({dense:h||w.dense||!1,alignItems:i,disableGutters:p}),[i,w.dense,h,p]),S=D.useRef(null),O=D.Children.toArray(o),k=O.length&&i3(O[O.length-1],["ListItemSecondaryAction"]),E={...r,alignItems:i,dense:_.dense,disableGutters:p,disablePadding:g,divider:m,hasSecondaryAction:k},P=wct(E),A=dn(S,n),R=x.root||l.Root||_ct,T=y.root||c.root||{},M={className:Oe(P.root,T.className,s),...b};let I=a||"li";return k?(I=!M.component&&!a?"div":I,u==="li"&&(I==="li"?I="div":M.component==="li"&&(M.component="div")),C.jsx(Df.Provider,{value:_,children:C.jsxs(Sct,{as:u,className:Oe(P.container,f),ref:A,ownerState:E,...d,children:[C.jsx(R,{...T,...!og(R)&&{as:I,ownerState:{...E,...T.ownerState}},...M,children:O}),O.pop()]})})):C.jsx(Df.Provider,{value:_,children:C.jsxs(R,{...T,as:I,ref:A,...!og(R)&&{ownerState:{...E,...T.ownerState}},...M,children:[O,v&&C.jsx(sA,{children:v})]})})});function Cct(t){return Xe("MuiListItemIcon",t)}const Gde=He("MuiListItemIcon",["root","alignItemsFlexStart"]),Oct=t=>{const{alignItems:e,classes:n}=t;return qe({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},Cct,n)},Ect=be("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(wt(({theme:t})=>({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),kPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItemIcon"}),{className:i,...o}=r,s=D.useContext(Df),a={...r,alignItems:s.alignItems},l=Oct(a);return C.jsx(Ect,{className:Oe(l.root,i),ownerState:a,ref:n,...o})});function Tct(t){return Xe("MuiListItemText",t)}const a_=He("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),kct=t=>{const{classes:e,inset:n,primary:r,secondary:i,dense:o}=t;return qe({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},Tct,e)},Act=be("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${a_.primary}`]:e.primary},{[`& .${a_.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${DF.root}:where(& .${a_.primary})`]:{display:"block"},[`.${DF.root}:where(& .${a_.secondary})`]:{display:"block"},variants:[{props:({ownerState:t})=>t.primary&&t.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:56}}]}),fu=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiListItemText"}),{children:i,className:o,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f,...d}=r,{dense:h}=D.useContext(Df);let p=l??i,g=u;const m={...r,disableTypography:s,inset:a,primary:!!p,secondary:!!g,dense:h},v=kct(m);return p!=null&&p.type!==Jt&&!s&&(p=C.jsx(Jt,{variant:h?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",...c,children:p})),g!=null&&g.type!==Jt&&!s&&(g=C.jsx(Jt,{variant:"body2",className:v.secondary,color:"textSecondary",...f,children:g})),C.jsxs(Act,{className:Oe(v.root,o),ownerState:m,ref:n,...d,children:[p,g]})});function aW(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function Hde(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function APe(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.startsWith(e.keys.join(""))}function DE(t,e,n,r,i,o){let s=!1,a=i(t,e,e?n:!1);for(;a;){if(a===t.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!APe(a,o)||l)a=i(t,a,n);else return a.focus(),!0}return!1}const w4=D.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu",...d}=e,h=D.useRef(null),p=D.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ei(()=>{i&&h.current.focus()},[i]),D.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:b})=>{const w=!h.current.style.width;if(x.clientHeight{const b=h.current,w=x.key;if(x.ctrlKey||x.metaKey||x.altKey){u&&u(x);return}const S=yi(b).activeElement;if(w==="ArrowDown")x.preventDefault(),DE(b,S,c,l,aW);else if(w==="ArrowUp")x.preventDefault(),DE(b,S,c,l,Hde);else if(w==="Home")x.preventDefault(),DE(b,null,c,l,aW);else if(w==="End")x.preventDefault(),DE(b,null,c,l,Hde);else if(w.length===1){const O=p.current,k=w.toLowerCase(),E=performance.now();O.keys.length>0&&(E-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&k!==O.keys[0]&&(O.repeating=!1)),O.lastTime=E,O.keys.push(k);const P=S&&!O.repeating&&APe(S,O);O.previousKeyMatched&&(P||DE(b,S,!1,l,aW,O))?x.preventDefault():O.previousKeyMatched=!1}u&&u(x)},m=dn(h,n);let v=-1;D.Children.forEach(s,(x,b)=>{if(!D.isValidElement(x)){v===b&&(v+=1,v>=s.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>=s.length&&(v=-1))});const y=D.Children.map(s,(x,b)=>{if(b===v){const w={};return o&&(w.autoFocus=!0),x.props.tabIndex===void 0&&f==="selectedMenu"&&(w.tabIndex=0),D.cloneElement(x,w)}return x});return C.jsx(MM,{role:"menu",ref:m,className:a,onKeyDown:g,tabIndex:i?0:-1,...d,children:y})});function Pct(t){return Xe("MuiPopover",t)}He("MuiPopover",["root","paper"]);function qde(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function Xde(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function Yde(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function lW(t){return typeof t=="function"?t():t}const Mct=t=>{const{classes:e}=t;return qe({root:["root"],paper:["paper"]},Pct,e)},Rct=be(_Pe,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),PPe=be(kl,{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}),e1=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiPopover"}),{action:i,anchorEl:o,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:l="anchorEl",children:c,className:u,container:f,elevation:d=8,marginThreshold:h=16,open:p,PaperProps:g={},slots:m={},slotProps:v={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:x=ob,transitionDuration:b="auto",TransitionProps:{onEntering:w,..._}={},disableScrollLock:S=!1,...O}=r,k=(v==null?void 0:v.paper)??g,E=D.useRef(),P={...r,anchorOrigin:s,anchorReference:l,elevation:d,marginThreshold:h,externalPaperSlotProps:k,transformOrigin:y,TransitionComponent:x,transitionDuration:b,TransitionProps:_},A=Mct(P),R=D.useCallback(()=>{if(l==="anchorPosition")return a;const re=lW(o),te=(re&&re.nodeType===1?re:yi(E.current).body).getBoundingClientRect();return{top:te.top+qde(te,s.vertical),left:te.left+Xde(te,s.horizontal)}},[o,s.horizontal,s.vertical,a,l]),T=D.useCallback(re=>({vertical:qde(re,y.vertical),horizontal:Xde(re,y.horizontal)}),[y.horizontal,y.vertical]),M=D.useCallback(re=>{const me={width:re.offsetWidth,height:re.offsetHeight},te=T(me);if(l==="none")return{top:null,left:null,transformOrigin:Yde(te)};const ae=R();let U=ae.top-te.vertical,oe=ae.left-te.horizontal;const ne=U+me.height,G=oe+me.width,q=xc(lW(o)),Z=q.innerHeight-h,de=q.innerWidth-h;if(h!==null&&UZ){const xe=ne-Z;U-=xe,te.vertical+=xe}if(h!==null&&oede){const xe=G-de;oe-=xe,te.horizontal+=xe}return{top:`${Math.round(U)}px`,left:`${Math.round(oe)}px`,transformOrigin:Yde(te)}},[o,l,R,T,h]),[I,z]=D.useState(p),F=D.useCallback(()=>{const re=E.current;if(!re)return;const me=M(re);me.top!==null&&re.style.setProperty("top",me.top),me.left!==null&&(re.style.left=me.left),re.style.transformOrigin=me.transformOrigin,z(!0)},[M]);D.useEffect(()=>(S&&window.addEventListener("scroll",F),()=>window.removeEventListener("scroll",F)),[o,S,F]);const N=(re,me)=>{w&&w(re,me),F()},L=()=>{z(!1)};D.useEffect(()=>{p&&F()}),D.useImperativeHandle(i,()=>p?{updatePosition:()=>{F()}}:null,[p,F]),D.useEffect(()=>{if(!p)return;const re=EM(()=>{F()}),me=xc(o);return me.addEventListener("resize",re),()=>{re.clear(),me.removeEventListener("resize",re)}},[o,p,F]);let B=b;b==="auto"&&!x.muiSupportAuto&&(B=void 0);const $=f||(o?yi(lW(o)).body:void 0),j={slots:m,slotProps:{...v,paper:k}},[X,V]=Jl("paper",{elementType:PPe,externalForwardedProps:j,additionalProps:{elevation:d,className:Oe(A.paper,k==null?void 0:k.className),style:I?k.style:{...k.style,opacity:0}},ownerState:P}),[Y,{slotProps:le,...K}]=Jl("root",{elementType:Rct,externalForwardedProps:j,additionalProps:{slotProps:{backdrop:{invisible:!0}},container:$,open:p},ownerState:P,className:Oe(A.root,u)}),ee=dn(E,V.ref);return C.jsx(Y,{...K,...!og(Y)&&{slotProps:le,disableScrollLock:S},...O,ref:n,children:C.jsx(x,{appear:!0,in:p,onEntering:N,onExited:L,timeout:B,..._,children:C.jsx(X,{...V,ref:ee,children:c})})})});function Dct(t){return Xe("MuiMenu",t)}He("MuiMenu",["root","paper","list"]);const Ict={vertical:"top",horizontal:"right"},Lct={vertical:"top",horizontal:"left"},$ct=t=>{const{classes:e}=t;return qe({root:["root"],paper:["paper"],list:["list"]},Dct,e)},Fct=be(e1,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Nct=be(PPe,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),zct=be(w4,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),Ny=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiMenu"}),{autoFocus:i=!0,children:o,className:s,disableAutoFocusItem:a=!1,MenuListProps:l={},onClose:c,open:u,PaperProps:f={},PopoverClasses:d,transitionDuration:h="auto",TransitionProps:{onEntering:p,...g}={},variant:m="selectedMenu",slots:v={},slotProps:y={},...x}=r,b=Eo(),w={...r,autoFocus:i,disableAutoFocusItem:a,MenuListProps:l,onEntering:p,PaperProps:f,transitionDuration:h,TransitionProps:g,variant:m},_=$ct(w),S=i&&!a&&u,O=D.useRef(null),k=(I,z)=>{O.current&&O.current.adjustStyleForScrollbar(I,{direction:b?"rtl":"ltr"}),p&&p(I,z)},E=I=>{I.key==="Tab"&&(I.preventDefault(),c&&c(I,"tabKeyDown"))};let P=-1;D.Children.map(o,(I,z)=>{D.isValidElement(I)&&(I.props.disabled||(m==="selectedMenu"&&I.props.selected||P===-1)&&(P=z))});const A=v.paper??Nct,R=y.paper??f,T=Zt({elementType:v.root,externalSlotProps:y.root,ownerState:w,className:[_.root,s]}),M=Zt({elementType:A,externalSlotProps:R,ownerState:w,className:_.paper});return C.jsx(Fct,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:b?"right":"left"},transformOrigin:b?Ict:Lct,slots:{paper:A,root:v.root},slotProps:{root:T,paper:M},open:u,ref:n,transitionDuration:h,TransitionProps:{onEntering:k,...g},ownerState:w,...x,classes:d,children:C.jsx(zct,{onKeyDown:E,actions:O,autoFocus:i&&(P===-1||a),autoFocusItem:S,variant:m,...l,className:Oe(_.list,l.className),children:o})})});function jct(t){return Xe("MuiMenuItem",t)}const IE=He("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Bct=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},Uct=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=t,l=qe({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},jct,s);return{...s,...l}},Wct=be(Ff,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:Bct})(wt(({theme:t})=>({...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","&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${IE.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${IE.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)}},[`&.${IE.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)}},[`&.${IE.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${IE.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${Nde.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${Nde.inset}`]:{marginLeft:52},[`& .${a_.root}`]:{marginTop:0,marginBottom:0},[`& .${a_.inset}`]:{paddingLeft:36},[`& .${Gde.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[t.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...t.typography.body2,[`& .${Gde.root} svg`]:{fontSize:"1.25rem"}}}]}))),Br=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:d,...h}=r,p=D.useContext(Df),g=D.useMemo(()=>({dense:s||p.dense||!1,disableGutters:l}),[p.dense,s,l]),m=D.useRef(null);Ei(()=>{i&&m.current&&m.current.focus()},[i]);const v={...r,dense:g.dense,divider:a,disableGutters:l},y=Uct(r),x=dn(m,n);let b;return r.disabled||(b=f!==void 0?f:-1),C.jsx(Df.Provider,{value:g,children:C.jsx(Wct,{ref:x,role:u,tabIndex:b,component:o,focusVisibleClassName:Oe(y.focusVisible,c),className:Oe(y.root,d),...h,ownerState:v,classes:y})})});function Vct(t){return Xe("MuiNativeSelect",t)}const Qee=He("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Gct=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Me(n)}`,o&&"iconOpen",r&&"disabled"]};return qe(a,Vct,e)},MPe=be("select")(({theme:t})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${Qee.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!=="filled"&&e.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]})),Hct=be(MPe,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Xo,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${Qee.multiple}`]:e.multiple}]}})({}),RPe=be("svg")(({theme:t})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${Qee.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),qct=be(RPe,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Me(n.variant)}`],n.open&&e.iconOpen]}})({}),Xct=D.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard",...c}=e,u={...e,disabled:i,variant:l,error:o},f=Gct(u);return C.jsxs(D.Fragment,{children:[C.jsx(Hct,{ownerState:u,className:Oe(f.select,r),disabled:i,ref:a||n,...c}),e.multiple?null:C.jsx(qct,{as:s,ownerState:u,className:f.icon})]})});var Qde;const Yct=be("fieldset",{shouldForwardProp:Xo})({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%"}),Qct=be("legend",{shouldForwardProp:Xo})(wt(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]})));function Kct(t){const{children:e,classes:n,className:r,label:i,notched:o,...s}=t,a=i!=null&&i!=="",l={...t,notched:o,withLabel:a};return C.jsx(Yct,{"aria-hidden":!0,className:r,ownerState:l,...s,children:C.jsx(Qct,{ownerState:l,children:a?C.jsx("span",{children:i}):Qde||(Qde=C.jsx("span",{className:"notranslate",children:"​"}))})})}const Zct=t=>{const{classes:e}=t,r=qe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Vot,e);return{...e,...r}},Jct=be(x4,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:v4})(wt(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${md.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${md.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${md.focused} .${md.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(pr()).map(([n])=>({props:{color:n},style:{[`&.${md.focused} .${md.notchedOutline}`]:{borderColor:(t.vars||t).palette[n].main}}})),{props:{},style:{[`&.${md.error} .${md.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${md.disabled} .${md.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),eut=be(Kct,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(wt(({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}})),tut=be(b4,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:y4})(wt(({theme:t})=>({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"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),zF=D.forwardRef(function(e,n){var r;const i=_t({props:e,name:"MuiOutlinedInput"}),{components:o={},fullWidth:s=!1,inputComponent:a="input",label:l,multiline:c=!1,notched:u,slots:f={},type:d="text",...h}=i,p=Zct(i),g=Na(),m=Iy({props:i,muiFormControl:g,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...i,color:m.color||"primary",disabled:m.disabled,error:m.error,focused:m.focused,formControl:g,fullWidth:s,hiddenLabel:m.hiddenLabel,multiline:c,size:m.size,type:d},y=f.root??o.Root??Jct,x=f.input??o.Input??tut;return C.jsx(Hee,{slots:{root:y,input:x},renderSuffix:b=>C.jsx(eut,{ownerState:v,className:p.notchedOutline,label:l!=null&&l!==""&&m.required?r||(r=C.jsxs(D.Fragment,{children:[l," ","*"]})):l,notched:typeof u<"u"?u:!!(b.startAdornment||b.filled||b.focused)}),fullWidth:s,inputComponent:a,multiline:c,ref:n,type:d,...h,classes:{...p,notchedOutline:null}})});zF&&(zF.muiName="Input");const nut=lt(C.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"),rut=lt(C.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"),iut=be("span",{shouldForwardProp:Xo})({position:"relative",display:"flex"}),out=be(nut)({transform:"scale(1)"}),sut=be(rut)(wt(({theme:t})=>({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}}]})));function DPe(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i={...t,checked:e};return C.jsxs(iut,{className:n.root,ownerState:i,children:[C.jsx(out,{fontSize:r,className:n.background,ownerState:i}),C.jsx(sut,{fontSize:r,className:n.dot,ownerState:i})]})}const IPe=D.createContext(void 0);function aut(){return D.useContext(IPe)}function lut(t){return Xe("MuiRadio",t)}const Kde=He("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),cut=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${Me(n)}`,r!=="medium"&&`size${Me(r)}`]};return{...e,...qe(i,lut,e)}},uut=be(qee,{shouldForwardProp:t=>Xo(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${Me(n.size)}`],e[`color${Me(n.color)}`]]}})(wt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,[`&.${Kde.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,disabled:!1},style:{[`&.${Kde.checked}`]:{color:(t.vars||t).palette[e].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function fut(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const Zde=C.jsx(DPe,{checked:!0}),Jde=C.jsx(DPe,{}),F_=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiRadio"}),{checked:i,checkedIcon:o=Zde,color:s="primary",icon:a=Jde,name:l,onChange:c,size:u="medium",className:f,disabled:d,disableRipple:h=!1,...p}=r,g=Na();let m=d;g&&typeof m>"u"&&(m=g.disabled),m??(m=!1);const v={...r,disabled:m,disableRipple:h,color:s,size:u},y=cut(v),x=aut();let b=i;const w=ZH(c,x&&x.onChange);let _=l;return x&&(typeof b>"u"&&(b=fut(x.value,r.value)),typeof _>"u"&&(_=x.name)),C.jsx(uut,{type:"radio",icon:D.cloneElement(a,{fontSize:Jde.props.fontSize??u}),checkedIcon:D.cloneElement(o,{fontSize:Zde.props.fontSize??u}),disabled:m,ownerState:v,classes:y,name:_,checked:b,onChange:w,ref:n,className:Oe(y.root,f),...p})});function dut(t){return Xe("MuiRadioGroup",t)}He("MuiRadioGroup",["root","row","error"]);const hut=t=>{const{classes:e,row:n,error:r}=t;return qe({root:["root",n&&"row",r&&"error"]},dut,e)},_4=D.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:c,...u}=e,f=D.useRef(null),d=hut(e),[h,p]=bc({controlled:c,default:s,name:"RadioGroup"});D.useImperativeHandle(r,()=>({focus:()=>{let y=f.current.querySelector("input:not(:disabled):checked");y||(y=f.current.querySelector("input:not(:disabled)")),y&&y.focus()}}),[]);const g=dn(n,f),m=Jf(a),v=D.useMemo(()=>({name:m,onChange(y){p(y.target.value),l&&l(y,y.target.value)},value:h}),[m,l,p,h]);return C.jsx(IPe.Provider,{value:v,children:C.jsx(hlt,{role:"radiogroup",ref:g,className:Oe(d.root,o),...u,children:i})})});function put(t){return Xe("MuiSelect",t)}const LE=He("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var ehe;const gut=be(MPe,{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${LE.select}`]:e.select},{[`&.${LE.select}`]:e[n.variant]},{[`&.${LE.error}`]:e.error},{[`&.${LE.multiple}`]:e.multiple}]}})({[`&.${LE.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),mut=be(RPe,{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Me(n.variant)}`],n.open&&e.iconOpen]}})({}),vut=be("input",{shouldForwardProp:t=>i4(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 the(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function yut(t){return t==null||typeof t=="string"&&!t.trim()}const xut=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Me(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return qe(a,put,e)},but=D.forwardRef(function(e,n){var Pe;const{"aria-describedby":r,"aria-label":i,autoFocus:o,autoWidth:s,children:a,className:l,defaultOpen:c,defaultValue:u,disabled:f,displayEmpty:d,error:h=!1,IconComponent:p,inputRef:g,labelId:m,MenuProps:v={},multiple:y,name:x,onBlur:b,onChange:w,onClose:_,onFocus:S,onOpen:O,open:k,readOnly:E,renderValue:P,SelectDisplayProps:A={},tabIndex:R,type:T,value:M,variant:I="standard",...z}=e,[F,N]=bc({controlled:M,default:u,name:"Select"}),[L,B]=bc({controlled:k,default:c,name:"Select"}),$=D.useRef(null),j=D.useRef(null),[X,V]=D.useState(null),{current:Y}=D.useRef(k!=null),[le,K]=D.useState(),ee=dn(n,g),re=D.useCallback(Re=>{j.current=Re,Re&&V(Re)},[]),me=X==null?void 0:X.parentNode;D.useImperativeHandle(ee,()=>({focus:()=>{j.current.focus()},node:$.current,value:F}),[F]),D.useEffect(()=>{c&&L&&X&&!Y&&(K(s?null:me.clientWidth),j.current.focus())},[X,s]),D.useEffect(()=>{o&&j.current.focus()},[o]),D.useEffect(()=>{if(!m)return;const Re=yi(j.current).getElementById(m);if(Re){const Te=()=>{getSelection().isCollapsed&&j.current.focus()};return Re.addEventListener("click",Te),()=>{Re.removeEventListener("click",Te)}}},[m]);const te=(Re,Te)=>{Re?O&&O(Te):_&&_(Te),Y||(K(s?null:me.clientWidth),B(Re))},ae=Re=>{Re.button===0&&(Re.preventDefault(),j.current.focus(),te(!0,Re))},U=Re=>{te(!1,Re)},oe=D.Children.toArray(a),ne=Re=>{const Te=oe.find(Le=>Le.props.value===Re.target.value);Te!==void 0&&(N(Te.props.value),w&&w(Re,Te))},G=Re=>Te=>{let Le;if(Te.currentTarget.hasAttribute("tabindex")){if(y){Le=Array.isArray(F)?F.slice():[];const ue=F.indexOf(Re.props.value);ue===-1?Le.push(Re.props.value):Le.splice(ue,1)}else Le=Re.props.value;if(Re.props.onClick&&Re.props.onClick(Te),F!==Le&&(N(Le),w)){const ue=Te.nativeEvent||Te,$e=new ue.constructor(ue.type,ue);Object.defineProperty($e,"target",{writable:!0,value:{value:Le,name:x}}),w($e,Re)}y||te(!1,Te)}},q=Re=>{E||[" ","ArrowUp","ArrowDown","Enter"].includes(Re.key)&&(Re.preventDefault(),te(!0,Re))},Z=X!==null&&L,de=Re=>{!Z&&b&&(Object.defineProperty(Re,"target",{writable:!0,value:{value:F,name:x}}),b(Re))};delete z["aria-invalid"];let xe,H;const W=[];let J=!1;(LF({value:F})||d)&&(P?xe=P(F):J=!0);const se=oe.map(Re=>{if(!D.isValidElement(Re))return null;let Te;if(y){if(!Array.isArray(F))throw new Error(Mg(2));Te=F.some(Le=>the(Le,Re.props.value)),Te&&J&&W.push(Re.props.children)}else Te=the(F,Re.props.value),Te&&J&&(H=Re.props.children);return D.cloneElement(Re,{"aria-selected":Te?"true":"false",onClick:G(Re),onKeyUp:Le=>{Le.key===" "&&Le.preventDefault(),Re.props.onKeyUp&&Re.props.onKeyUp(Le)},role:"option",selected:Te,value:void 0,"data-value":Re.props.value})});J&&(y?W.length===0?xe=null:xe=W.reduce((Re,Te,Le)=>(Re.push(Te),Le{const{classes:e}=t;return e},Kee={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>Xo(t)&&t!=="variant",slot:"Root"},_ut=be(Dg,Kee)(""),Sut=be(zF,Kee)(""),Cut=be(NF,Kee)(""),Hg=D.forwardRef(function(e,n){const r=kn({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=Hot,id:f,input:d,inputProps:h,label:p,labelId:g,MenuProps:m,multiple:v=!1,native:y=!1,onClose:x,onOpen:b,open:w,renderValue:_,SelectDisplayProps:S,variant:O="outlined",...k}=r,E=y?Xct:but,P=Na(),A=Iy({props:r,muiFormControl:P,states:["variant","error"]}),R=A.variant||O,T={...r,variant:R,classes:s},M=wut(T),{root:I,...z}=M,F=d||{standard:C.jsx(_ut,{ownerState:T}),outlined:C.jsx(Sut,{label:p,ownerState:T}),filled:C.jsx(Cut,{ownerState:T})}[R],N=dn(n,Ry(F));return C.jsx(D.Fragment,{children:D.cloneElement(F,{inputComponent:E,inputProps:{children:o,error:A.error,IconComponent:u,variant:R,type:void 0,multiple:v,...y?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:g,MenuProps:m,onClose:x,onOpen:b,open:w,renderValue:_,SelectDisplayProps:{id:f,...S}},...h,classes:h?Wo(z,h.classes):z,...d?d.props.inputProps:{}},...(v&&y||c)&&R==="outlined"?{notched:!0}:{},ref:N,className:Oe(F.props.className,a,M.root),...!d&&{variant:R},...k})})});Hg.muiName="Select";function Out(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const Eut=2;function LPe(t,e){return t-e}function nhe(t,e){const{index:n}=t.reduce((r,i,o)=>{const s=Math.abs(e-i);return r===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}%`})}},Mut=t=>t;let iI;function ihe(){return iI===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?iI=CSS.supports("touch-action","none"):iI=!0),iI}function Rut(t){const{"aria-labelledby":e,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:d="horizontal",rootRef:h,scale:p=Mut,step:g=1,shiftStep:m=10,tabIndex:v,value:y}=t,x=D.useRef(void 0),[b,w]=D.useState(-1),[_,S]=D.useState(-1),[O,k]=D.useState(!1),E=D.useRef(0),[P,A]=bc({controlled:y,default:n??l,name:"Slider"}),R=u&&((W,J,se)=>{const ye=W.nativeEvent||W,ie=new ye.constructor(ye.type,ye);Object.defineProperty(ie,"target",{writable:!0,value:{value:J,name:c}}),u(ie,J,se)}),T=Array.isArray(P);let M=T?P.slice().sort(LPe):[P];M=M.map(W=>W==null?l:Lw(W,l,a));const I=s===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((W,J)=>({value:l+g*J})):s||[],z=I.map(W=>W.value),[F,N]=D.useState(-1),L=D.useRef(null),B=dn(h,L),$=W=>J=>{var ye;const se=Number(J.currentTarget.getAttribute("data-index"));Zv(J.target)&&N(se),S(se),(ye=W==null?void 0:W.onFocus)==null||ye.call(W,J)},j=W=>J=>{var se;Zv(J.target)||N(-1),S(-1),(se=W==null?void 0:W.onBlur)==null||se.call(W,J)},X=(W,J)=>{const se=Number(W.currentTarget.getAttribute("data-index")),ye=M[se],ie=z.indexOf(ye);let fe=J;if(I&&g==null){const Q=z[z.length-1];fe>Q?fe=Q:feJ=>{var se;if(g!==null){const ye=Number(J.currentTarget.getAttribute("data-index")),ie=M[ye];let fe=null;(J.key==="ArrowLeft"||J.key==="ArrowDown")&&J.shiftKey||J.key==="PageDown"?fe=Math.max(ie-m,l):((J.key==="ArrowRight"||J.key==="ArrowUp")&&J.shiftKey||J.key==="PageUp")&&(fe=Math.min(ie+m,a)),fe!==null&&(X(J,fe),J.preventDefault())}(se=W==null?void 0:W.onKeyDown)==null||se.call(W,J)};Ei(()=>{var W;r&&L.current.contains(document.activeElement)&&((W=document.activeElement)==null||W.blur())},[r]),r&&b!==-1&&w(-1),r&&F!==-1&&N(-1);const Y=W=>J=>{var se;(se=W.onChange)==null||se.call(W,J),X(J,J.target.valueAsNumber)},le=D.useRef(void 0);let K=d;o&&d==="horizontal"&&(K+="-reverse");const ee=({finger:W,move:J=!1})=>{const{current:se}=L,{width:ye,height:ie,bottom:fe,left:Q}=se.getBoundingClientRect();let _e;K.startsWith("vertical")?_e=(fe-W.y)/ie:_e=(W.x-Q)/ye,K.includes("-reverse")&&(_e=1-_e);let we;if(we=Tut(_e,l,a),g)we=Aut(we,g,l);else{const Pe=nhe(z,we);we=z[Pe]}we=Lw(we,l,a);let Ie=0;if(T){J?Ie=le.current:Ie=nhe(M,we),i&&(we=Lw(we,M[Ie-1]||-1/0,M[Ie+1]||1/0));const Pe=we;we=rhe({values:M,newValue:we,index:Ie}),i&&J||(Ie=we.indexOf(Pe),le.current=Ie)}return{newValue:we,activeIndex:Ie}},re=st(W=>{const J=tI(W,x);if(!J)return;if(E.current+=1,W.type==="mousemove"&&W.buttons===0){me(W);return}const{newValue:se,activeIndex:ye}=ee({finger:J,move:!0});nI({sliderRef:L,activeIndex:ye,setActive:w}),A(se),!O&&E.current>Eut&&k(!0),R&&!rI(se,P)&&R(W,se,ye)}),me=st(W=>{const J=tI(W,x);if(k(!1),!J)return;const{newValue:se}=ee({finger:J,move:!0});w(-1),W.type==="touchend"&&S(-1),f&&f(W,se),x.current=void 0,ae()}),te=st(W=>{if(r)return;ihe()||W.preventDefault();const J=W.changedTouches[0];J!=null&&(x.current=J.identifier);const se=tI(W,x);if(se!==!1){const{newValue:ie,activeIndex:fe}=ee({finger:se});nI({sliderRef:L,activeIndex:fe,setActive:w}),A(ie),R&&!rI(ie,P)&&R(W,ie,fe)}E.current=0;const ye=yi(L.current);ye.addEventListener("touchmove",re,{passive:!0}),ye.addEventListener("touchend",me,{passive:!0})}),ae=D.useCallback(()=>{const W=yi(L.current);W.removeEventListener("mousemove",re),W.removeEventListener("mouseup",me),W.removeEventListener("touchmove",re),W.removeEventListener("touchend",me)},[me,re]);D.useEffect(()=>{const{current:W}=L;return W.addEventListener("touchstart",te,{passive:ihe()}),()=>{W.removeEventListener("touchstart",te),ae()}},[ae,te]),D.useEffect(()=>{r&&ae()},[r,ae]);const U=W=>J=>{var ie;if((ie=W.onMouseDown)==null||ie.call(W,J),r||J.defaultPrevented||J.button!==0)return;J.preventDefault();const se=tI(J,x);if(se!==!1){const{newValue:fe,activeIndex:Q}=ee({finger:se});nI({sliderRef:L,activeIndex:Q,setActive:w}),A(fe),R&&!rI(fe,P)&&R(J,fe,Q)}E.current=0;const ye=yi(L.current);ye.addEventListener("mousemove",re,{passive:!0}),ye.addEventListener("mouseup",me)},oe=jF(T?M[0]:l,l,a),ne=jF(M[M.length-1],l,a)-oe,G=(W={})=>{const J=Mx(W),se={onMouseDown:U(J||{})},ye={...J,...se};return{...W,ref:B,...ye}},q=W=>J=>{var ye;(ye=W.onMouseOver)==null||ye.call(W,J);const se=Number(J.currentTarget.getAttribute("data-index"));S(se)},Z=W=>J=>{var se;(se=W.onMouseLeave)==null||se.call(W,J),S(-1)};return{active:b,axis:K,axisProps:Put,dragging:O,focusedThumbIndex:F,getHiddenInputProps:(W={})=>{const J=Mx(W),se={onChange:Y(J||{}),onFocus:$(J||{}),onBlur:j(J||{}),onKeyDown:V(J||{})},ye={...J,...se};return{tabIndex:v,"aria-labelledby":e,"aria-orientation":d,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":t.step??void 0,disabled:r,...W,...ye,style:{...jAe,direction:o?"rtl":"ltr",width:"100%",height:"100%"}}},getRootProps:G,getThumbProps:(W={})=>{const J=Mx(W),se={onMouseOver:q(J||{}),onMouseLeave:Z(J||{})};return{...W,...J,...se}},marks:I,open:_,range:T,rootRef:B,trackLeap:ne,trackOffset:oe,values:M,getThumbStyle:W=>({pointerEvents:b!==-1&&b!==W?"none":void 0})}}const Dut=t=>!t||!og(t);function Iut(t){return Xe("MuiSlider",t)}const tu=He("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"]),Lut=t=>{const{open:e}=t;return{offset:Oe(e&&tu.valueLabelOpen),circle:tu.valueLabelCircle,label:tu.valueLabelLabel}};function $ut(t){const{children:e,className:n,value:r}=t,i=Lut(t);return e?D.cloneElement(e,{className:Oe(e.props.className)},C.jsxs(D.Fragment,{children:[e.props.children,C.jsx("span",{className:Oe(i.offset,n),"aria-hidden":!0,children:C.jsx("span",{className:i.circle,children:C.jsx("span",{className:i.label,children:r})})})]})):null}function ohe(t){return t}const Fut=be("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${Me(n.color)}`],n.size!=="medium"&&e[`size${Me(n.size)}`],n.marked&&e.marked,n.orientation==="vertical"&&e.vertical,n.track==="inverted"&&e.trackInverted,n.track===!1&&e.trackFalse]}})(wt(({theme:t})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${tu.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${tu.dragging}`]:{[`& .${tu.thumb}, & .${tu.track}`]:{transition:"none"}},variants:[...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].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}}]}))),Nut=be("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}}]}),zut=be("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(wt(({theme:t})=>({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.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e,track:"inverted"},style:{...t.vars?{backgroundColor:t.vars.palette.Slider[`${e}Track`],borderColor:t.vars.palette.Slider[`${e}Track`]}:{backgroundColor:Eh(t.palette[e].main,.62),borderColor:Eh(t.palette[e].main,.62),...t.applyStyles("dark",{backgroundColor:Oh(t.palette[e].main,.5)}),...t.applyStyles("dark",{borderColor:Oh(t.palette[e].main,.5)})}}}))]}))),jut=be("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.thumb,e[`thumbColor${Me(n.color)}`],n.size!=="medium"&&e[`thumbSize${Me(n.size)}`]]}})(wt(({theme:t})=>({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%)"},[`&.${tu.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.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{[`&:hover, &.${tu.focusVisible}`]:{...t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${kt(t.palette[e].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${tu.active}`]:{...t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${kt(t.palette[e].main,.16)}`}}}}))]}))),But=be($ut,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(wt(({theme:t})=>({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%"},[`&.${tu.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%"},[`&.${tu.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"}}]}))),Uut=be("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>i4(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:n}=t;return[e.mark,n&&e.markActive]}})(wt(({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}}]}))),Wut=be("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>i4(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(wt(({theme:t})=>({...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}}]}))),Vut=t=>{const{disabled:e,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=t,c={root:["root",e&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Me(a)}`,l&&`size${Me(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",l&&`thumbSize${Me(l)}`,a&&`thumbColor${Me(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return qe(c,Iut,s)},Gut=({children:t})=>t,t1=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSlider"}),i=Eo(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:f="primary",classes:d,className:h,disableSwap:p=!1,disabled:g=!1,getAriaLabel:m,getAriaValueText:v,marks:y=!1,max:x=100,min:b=0,name:w,onChange:_,onChangeCommitted:S,orientation:O="horizontal",shiftStep:k=10,size:E="medium",step:P=1,scale:A=ohe,slotProps:R,slots:T,tabIndex:M,track:I="normal",value:z,valueLabelDisplay:F="off",valueLabelFormat:N=ohe,...L}=r,B={...r,isRtl:i,max:x,min:b,classes:d,disabled:g,disableSwap:p,orientation:O,marks:y,color:f,size:E,step:P,shiftStep:k,scale:A,track:I,valueLabelDisplay:F,valueLabelFormat:N},{axisProps:$,getRootProps:j,getHiddenInputProps:X,getThumbProps:V,open:Y,active:le,axis:K,focusedThumbIndex:ee,range:re,dragging:me,marks:te,values:ae,trackOffset:U,trackLeap:oe,getThumbStyle:ne}=Rut({...B,rootRef:n});B.marked=te.length>0&&te.some(ut=>ut.label),B.dragging=me,B.focusedThumbIndex=ee;const G=Vut(B),q=(T==null?void 0:T.root)??c.Root??Fut,Z=(T==null?void 0:T.rail)??c.Rail??Nut,de=(T==null?void 0:T.track)??c.Track??zut,xe=(T==null?void 0:T.thumb)??c.Thumb??jut,H=(T==null?void 0:T.valueLabel)??c.ValueLabel??But,W=(T==null?void 0:T.mark)??c.Mark??Uut,J=(T==null?void 0:T.markLabel)??c.MarkLabel??Wut,se=(T==null?void 0:T.input)??c.Input??"input",ye=(R==null?void 0:R.root)??u.root,ie=(R==null?void 0:R.rail)??u.rail,fe=(R==null?void 0:R.track)??u.track,Q=(R==null?void 0:R.thumb)??u.thumb,_e=(R==null?void 0:R.valueLabel)??u.valueLabel,we=(R==null?void 0:R.mark)??u.mark,Ie=(R==null?void 0:R.markLabel)??u.markLabel,Pe=(R==null?void 0:R.input)??u.input,Re=Zt({elementType:q,getSlotProps:j,externalSlotProps:ye,externalForwardedProps:L,additionalProps:{...Dut(q)&&{as:l}},ownerState:{...B,...ye==null?void 0:ye.ownerState},className:[G.root,h]}),Te=Zt({elementType:Z,externalSlotProps:ie,ownerState:B,className:G.rail}),Le=Zt({elementType:de,externalSlotProps:fe,additionalProps:{style:{...$[K].offset(U),...$[K].leap(oe)}},ownerState:{...B,...fe==null?void 0:fe.ownerState},className:G.track}),ue=Zt({elementType:xe,getSlotProps:V,externalSlotProps:Q,ownerState:{...B,...Q==null?void 0:Q.ownerState},className:G.thumb}),$e=Zt({elementType:H,externalSlotProps:_e,ownerState:{...B,..._e==null?void 0:_e.ownerState},className:G.valueLabel}),Se=Zt({elementType:W,externalSlotProps:we,ownerState:B,className:G.mark}),Ye=Zt({elementType:J,externalSlotProps:Ie,ownerState:B,className:G.markLabel}),tt=Zt({elementType:se,getSlotProps:X,externalSlotProps:Pe,ownerState:B});return C.jsxs(q,{...Re,children:[C.jsx(Z,{...Te}),C.jsx(de,{...Le}),te.filter(ut=>ut.value>=b&&ut.value<=x).map((ut,qt)=>{const Dn=jF(ut.value,b,x),Zi=$[K].offset(Dn);let yn;return I===!1?yn=ae.includes(ut.value):yn=I==="normal"&&(re?ut.value>=ae[0]&&ut.value<=ae[ae.length-1]:ut.value<=ae[0])||I==="inverted"&&(re?ut.value<=ae[0]||ut.value>=ae[ae.length-1]:ut.value>=ae[0]),C.jsxs(D.Fragment,{children:[C.jsx(W,{"data-index":qt,...Se,...!og(W)&&{markActive:yn},style:{...Zi,...Se.style},className:Oe(Se.className,yn&&G.markActive)}),ut.label!=null?C.jsx(J,{"aria-hidden":!0,"data-index":qt,...Ye,...!og(J)&&{markLabelActive:yn},style:{...Zi,...Ye.style},className:Oe(G.markLabel,Ye.className,yn&&G.markLabelActive),children:ut.label}):null]},qt)}),ae.map((ut,qt)=>{const Dn=jF(ut,b,x),Zi=$[K].offset(Dn),yn=F==="off"?Gut:H;return C.jsx(yn,{...!og(yn)&&{valueLabelFormat:N,valueLabelDisplay:F,value:typeof N=="function"?N(A(ut),qt):N,index:qt,open:Y===qt||le===qt||F==="on",disabled:g},...$e,children:C.jsx(xe,{"data-index":qt,...ue,className:Oe(G.thumb,ue.className,le===qt&&G.active,ee===qt&&G.focusVisible),style:{...Zi,...ne(qt),...ue.style},children:C.jsx(se,{"data-index":qt,"aria-label":m?m(qt):o,"aria-valuenow":A(ut),"aria-labelledby":a,"aria-valuetext":v?v(A(ut),qt):s,value:ae[qt],...tt})})},qt)})]})});function Hut(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=t,s=cv();D.useEffect(()=>{if(!i)return;function v(y){y.defaultPrevented||y.key==="Escape"&&(r==null||r(y,"escapeKeyDown"))}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i,r]);const a=st((v,y)=>{r==null||r(v,y)}),l=st(v=>{!r||v==null||s.start(v,()=>{a(null,"timeout")})});D.useEffect(()=>(i&&l(e),s.clear),[i,e,l,s]);const c=v=>{r==null||r(v,"clickaway")},u=s.clear,f=D.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()},g=v=>y=>{const x=v.onMouseLeave;x==null||x(y),f()};return D.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={...Mx(t),...Mx(v)};return{role:"presentation",...v,...y,onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:g(y)}},onClickAway:c}}function qut(t){return Xe("MuiSnackbarContent",t)}He("MuiSnackbarContent",["root","message","action"]);const Xut=t=>{const{classes:e}=t;return qe({root:["root"],action:["action"],message:["message"]},qut,e)},Yut=be(kl,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(wt(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=$Ae(t.palette.background.default,e);return{...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}}})),Qut=be("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),Kut=be("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),$Pe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSnackbarContent"}),{action:i,className:o,message:s,role:a="alert",...l}=r,c=r,u=Xut(c);return C.jsxs(Yut,{role:a,square:!0,elevation:6,className:Oe(u.root,o),ownerState:c,ref:n,...l,children:[C.jsx(Qut,{className:u.message,ownerState:c,children:s}),i?C.jsx(Kut,{className:u.action,ownerState:c,children:i}):null]})});function Zut(t){return Xe("MuiSnackbar",t)}He("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const Jut=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${Me(n.vertical)}${Me(n.horizontal)}`]};return qe(r,Zut,e)},she=be("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${Me(n.anchorOrigin.vertical)}${Me(n.anchorOrigin.horizontal)}`]]}})(wt(({theme:t})=>({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:e})=>e.anchorOrigin.vertical==="top",style:{top:8,[t.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:e})=>e.anchorOrigin.vertical!=="top",style:{bottom:8,[t.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[t.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[t.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="center",style:{[t.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),eft=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSnackbar"}),i=To(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:d,ContentProps:h,disableWindowBlurListener:p=!1,message:g,onBlur:m,onClose:v,onFocus:y,onMouseEnter:x,onMouseLeave:b,open:w,resumeHideDuration:_,TransitionComponent:S=ob,transitionDuration:O=o,TransitionProps:{onEnter:k,onExited:E,...P}={},...A}=r,R={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:S,transitionDuration:O},T=Jut(R),{getRootProps:M,onClickAway:I}=Hut({...R}),[z,F]=D.useState(!0),N=Zt({elementType:she,getSlotProps:M,externalForwardedProps:A,ownerState:R,additionalProps:{ref:n},className:[T.root,f]}),L=$=>{F(!0),E&&E($)},B=($,j)=>{F(!1),k&&k($,j)};return!w&&z?null:C.jsx(rat,{onClickAway:I,...d,children:C.jsx(she,{...N,children:C.jsx(S,{appear:!0,in:w,timeout:O,direction:a==="top"?"down":"up",onEnter:B,onExited:L,...P,children:u||C.jsx($Pe,{message:g,action:s,...h})})})})});function tft(t){return Xe("MuiTooltip",t)}const Mi=He("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function nft(t){return Math.round(t*1e5)/1e5}const rft=t=>{const{classes:e,disableInteractive:n,arrow:r,touch:i,placement:o}=t,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${Me(o.split("-")[0])}`],arrow:["arrow"]};return qe(s,tft,e)},ift=be(Gee,{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]}})(wt(({theme:t})=>({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${Mi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Mi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Mi.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Mi.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Mi.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Mi.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Mi.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Mi.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),oft=be("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${Me(n.placement.split("-")[0])}`]]}})(wt(({theme:t})=>({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,[`.${Mi.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Mi.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Mi.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${nft(16/14)}em`,fontWeight:t.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Mi.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Mi.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),sft=be("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(wt(({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 oI=!1;const ahe=new e4;let $E={x:0,y:0};function sI(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const Mt=D.forwardRef(function(e,n){var Dn,Zi,yn;const r=_t({props:e,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:s,components:a={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:f=!1,disableInteractive:d=!1,disableTouchListener:h=!1,enterDelay:p=100,enterNextDelay:g=0,enterTouchDelay:m=700,followCursor:v=!1,id:y,leaveDelay:x=0,leaveTouchDelay:b=1500,onClose:w,onOpen:_,open:S,placement:O="bottom",PopperComponent:k,PopperProps:E={},slotProps:P={},slots:A={},title:R,TransitionComponent:T=ob,TransitionProps:M,...I}=r,z=D.isValidElement(o)?o:C.jsx("span",{children:o}),F=To(),N=Eo(),[L,B]=D.useState(),[$,j]=D.useState(null),X=D.useRef(!1),V=d||v,Y=cv(),le=cv(),K=cv(),ee=cv(),[re,me]=bc({controlled:S,default:!1,name:"Tooltip",state:"open"});let te=re;const ae=Jf(y),U=D.useRef(),oe=st(()=>{U.current!==void 0&&(document.body.style.WebkitUserSelect=U.current,U.current=void 0),ee.clear()});D.useEffect(()=>oe,[oe]);const ne=Ht=>{ahe.clear(),oI=!0,me(!0),_&&!te&&_(Ht)},G=st(Ht=>{ahe.start(800+x,()=>{oI=!1}),me(!1),w&&te&&w(Ht),Y.start(F.transitions.duration.shortest,()=>{X.current=!1})}),q=Ht=>{X.current&&Ht.type!=="touchstart"||(L&&L.removeAttribute("title"),le.clear(),K.clear(),p||oI&&g?le.start(oI?g:p,()=>{ne(Ht)}):ne(Ht))},Z=Ht=>{le.clear(),K.start(x,()=>{G(Ht)})},[,de]=D.useState(!1),xe=Ht=>{Zv(Ht.target)||(de(!1),Z(Ht))},H=Ht=>{L||B(Ht.currentTarget),Zv(Ht.target)&&(de(!0),q(Ht))},W=Ht=>{X.current=!0;const fr=z.props;fr.onTouchStart&&fr.onTouchStart(Ht)},J=Ht=>{W(Ht),K.clear(),Y.clear(),oe(),U.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ee.start(m,()=>{document.body.style.WebkitUserSelect=U.current,q(Ht)})},se=Ht=>{z.props.onTouchEnd&&z.props.onTouchEnd(Ht),oe(),K.start(b,()=>{G(Ht)})};D.useEffect(()=>{if(!te)return;function Ht(fr){fr.key==="Escape"&&G(fr)}return document.addEventListener("keydown",Ht),()=>{document.removeEventListener("keydown",Ht)}},[G,te]);const ye=dn(Ry(z),B,n);!R&&R!==0&&(te=!1);const ie=D.useRef(),fe=Ht=>{const fr=z.props;fr.onMouseMove&&fr.onMouseMove(Ht),$E={x:Ht.clientX,y:Ht.clientY},ie.current&&ie.current.update()},Q={},_e=typeof R=="string";c?(Q.title=!te&&_e&&!f?R:null,Q["aria-describedby"]=te?ae:null):(Q["aria-label"]=_e?R:null,Q["aria-labelledby"]=te&&!_e?ae:null);const we={...Q,...I,...z.props,className:Oe(I.className,z.props.className),onTouchStart:W,ref:ye,...v?{onMouseMove:fe}:{}},Ie={};h||(we.onTouchStart=J,we.onTouchEnd=se),f||(we.onMouseOver=sI(q,we.onMouseOver),we.onMouseLeave=sI(Z,we.onMouseLeave),V||(Ie.onMouseOver=q,Ie.onMouseLeave=Z)),u||(we.onFocus=sI(H,we.onFocus),we.onBlur=sI(xe,we.onBlur),V||(Ie.onFocus=H,Ie.onBlur=xe));const Pe=D.useMemo(()=>{var fr;let Ht=[{name:"arrow",enabled:!!$,options:{element:$,padding:4}}];return(fr=E.popperOptions)!=null&&fr.modifiers&&(Ht=Ht.concat(E.popperOptions.modifiers)),{...E.popperOptions,modifiers:Ht}},[$,E]),Re={...r,isRtl:N,arrow:i,disableInteractive:V,placement:O,PopperComponentProp:k,touch:X.current},Te=rft(Re),Le=A.popper??a.Popper??ift,ue=A.transition??a.Transition??T??ob,$e=A.tooltip??a.Tooltip??oft,Se=A.arrow??a.Arrow??sft,Ye=s_(Le,{...E,...P.popper??l.popper,className:Oe(Te.popper,E==null?void 0:E.className,(Dn=P.popper??l.popper)==null?void 0:Dn.className)},Re),tt=s_(ue,{...M,...P.transition??l.transition},Re),ut=s_($e,{...P.tooltip??l.tooltip,className:Oe(Te.tooltip,(Zi=P.tooltip??l.tooltip)==null?void 0:Zi.className)},Re),qt=s_(Se,{...P.arrow??l.arrow,className:Oe(Te.arrow,(yn=P.arrow??l.arrow)==null?void 0:yn.className)},Re);return C.jsxs(D.Fragment,{children:[D.cloneElement(z,we),C.jsx(Le,{as:k??Gee,placement:O,anchorEl:v?{getBoundingClientRect:()=>({top:$E.y,left:$E.x,right:$E.x,bottom:$E.y,width:0,height:0})}:L,popperRef:ie,open:L?te:!1,id:ae,transition:!0,...Ie,...Ye,popperOptions:Pe,children:({TransitionProps:Ht})=>C.jsx(ue,{timeout:F.transitions.duration.shorter,...Ht,...tt,children:C.jsxs($e,{...ut,children:[R,i?C.jsx(Se,{...qt,ref:j}):null]})})})]})});function aft(t){return Xe("MuiSwitch",t)}const da=He("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),lft=t=>{const{classes:e,edge:n,size:r,color:i,checked:o,disabled:s}=t,a={root:["root",n&&`edge${Me(n)}`,`size${Me(r)}`],switchBase:["switchBase",`color${Me(i)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=qe(a,aft,e);return{...e,...l}},cft=be("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${Me(n.edge)}`],e[`size${Me(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,[`& .${da.thumb}`]:{width:16,height:16},[`& .${da.switchBase}`]:{padding:4,[`&.${da.checked}`]:{transform:"translateX(16px)"}}}}]}),uft=be(qee,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${da.input}`]:e.input},n.color!=="default"&&e[`color${Me(n.color)}`]]}})(wt(({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}),[`&.${da.checked}`]:{transform:"translateX(20px)"},[`&.${da.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${da.checked} + .${da.track}`]:{opacity:.5},[`&.${da.disabled} + .${da.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${da.input}`]:{left:"-100%",width:"300%"}})),wt(({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(pr(["light"])).map(([e])=>({props:{color:e},style:{[`&.${da.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"}},[`&.${da.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Eh(t.palette[e].main,.62):Oh(t.palette[e].main,.55)}`}},[`&.${da.checked} + .${da.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]}))),fft=be("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(wt(({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}`}))),dft=be("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(wt(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Zee=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:s=!1,size:a="medium",sx:l,...c}=r,u={...r,color:o,edge:s,size:a},f=lft(u),d=C.jsx(dft,{className:f.thumb,ownerState:u});return C.jsxs(cft,{className:Oe(f.root,i),sx:l,ownerState:u,children:[C.jsx(uft,{type:"checkbox",icon:d,checkedIcon:d,ref:n,ownerState:u,...c,classes:{...f,root:f.switchBase}}),C.jsx(fft,{className:f.track,ownerState:u})]})});function hft(t){return Xe("MuiTab",t)}const Ic=He("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),pft=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:i,icon:o,label:s,selected:a,disabled:l}=t,c={root:["root",o&&s&&"labelIcon",`textColor${Me(n)}`,r&&"fullWidth",i&&"wrapped",a&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]};return qe(c,hft,e)},gft=be(Ff,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${Me(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped,{[`& .${Ic.iconWrapper}`]:e.iconWrapper},{[`& .${Ic.icon}`]:e.icon}]}})(wt(({theme:t})=>({...t.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition==="top"||e.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&e.iconPosition!=="top"&&e.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="top",style:{[`& > .${Ic.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="bottom",style:{[`& > .${Ic.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="start",style:{[`& > .${Ic.icon}`]:{marginRight:t.spacing(1)}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="end",style:{[`& > .${Ic.icon}`]:{marginLeft:t.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Ic.selected}`]:{opacity:1},[`&.${Ic.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Ic.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Ic.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Ic.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Ic.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:t.typography.pxToRem(12)}}]}))),sb=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:s=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:h,onFocus:p,selected:g,selectionFollowsFocus:m,textColor:v="inherit",value:y,wrapped:x=!1,...b}=r,w={...r,disabled:o,disableFocusRipple:s,selected:g,icon:!!l,iconPosition:c,label:!!f,fullWidth:a,textColor:v,wrapped:x},_=pft(w),S=l&&f&&D.isValidElement(l)?D.cloneElement(l,{className:Oe(_.icon,l.props.className)}):l,O=E=>{!g&&d&&d(E,y),h&&h(E)},k=E=>{m&&!g&&d&&d(E,y),p&&p(E)};return C.jsxs(gft,{focusRipple:!s,className:Oe(_.root,i),ref:n,role:"tab","aria-selected":g,disabled:o,onClick:O,onFocus:k,ownerState:w,tabIndex:g?0:-1,...b,children:[c==="top"||c==="start"?C.jsxs(D.Fragment,{children:[S,f]}):C.jsxs(D.Fragment,{children:[f,S]}),u]})}),FPe=D.createContext();function mft(t){return Xe("MuiTable",t)}He("MuiTable",["root","stickyHeader"]);const vft=t=>{const{classes:e,stickyHeader:n}=t;return qe({root:["root",n&&"stickyHeader"]},mft,e)},yft=be("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(wt(({theme:t})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...t.typography.body2,padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),lhe="table",Jee=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTable"}),{className:i,component:o=lhe,padding:s="normal",size:a="medium",stickyHeader:l=!1,...c}=r,u={...r,component:o,padding:s,size:a,stickyHeader:l},f=vft(u),d=D.useMemo(()=>({padding:s,size:a,stickyHeader:l}),[s,a,l]);return C.jsx(FPe.Provider,{value:d,children:C.jsx(yft,{as:o,role:o===lhe?null:"table",ref:n,className:Oe(f.root,i),ownerState:u,...c})})}),S4=D.createContext();function xft(t){return Xe("MuiTableBody",t)}He("MuiTableBody",["root"]);const bft=t=>{const{classes:e}=t;return qe({root:["root"]},xft,e)},wft=be("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),_ft={variant:"body"},che="tbody",ete=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableBody"}),{className:i,component:o=che,...s}=r,a={...r,component:o},l=bft(a);return C.jsx(S4.Provider,{value:_ft,children:C.jsx(wft,{className:Oe(l.root,i),as:o,ref:n,role:o===che?null:"rowgroup",ownerState:a,...s})})});function Sft(t){return Xe("MuiTableCell",t)}const Cft=He("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Oft=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:s}=t,a={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${Me(r)}`,i!=="normal"&&`padding${Me(i)}`,`size${Me(o)}`]};return qe(a,Sft,e)},Eft=be("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${Me(n.size)}`],n.padding!=="normal"&&e[`padding${Me(n.padding)}`],n.align!=="inherit"&&e[`align${Me(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(wt(({theme:t})=>({...t.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid + ${t.palette.mode==="light"?Eh(kt(t.palette.divider,1),.88):Oh(kt(t.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(t.vars||t).palette.text.primary}},{props:{variant:"footer"},style:{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${Cft.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default}}]}))),ui=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:c,sortDirection:u,variant:f,...d}=r,h=D.useContext(FPe),p=D.useContext(S4),g=p&&p.variant==="head";let m;s?m=s:m=g?"th":"td";let v=l;m==="td"?v=void 0:!v&&g&&(v="col");const y=f||p&&p.variant,x={...r,align:i,component:m,padding:a||(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=Oft(x);let w=null;return u&&(w=u==="asc"?"ascending":"descending"),C.jsx(Eft,{as:m,ref:n,className:Oe(b.root,o),"aria-sort":w,scope:v,ownerState:x,...d})});function Tft(t){return Xe("MuiTableContainer",t)}He("MuiTableContainer",["root"]);const kft=t=>{const{classes:e}=t;return qe({root:["root"]},Tft,e)},Aft=be("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),NPe=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableContainer"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=kft(a);return C.jsx(Aft,{ref:n,as:o,className:Oe(l.root,i),ownerState:a,...s})});function Pft(t){return Xe("MuiTableHead",t)}He("MuiTableHead",["root"]);const Mft=t=>{const{classes:e}=t;return qe({root:["root"]},Pft,e)},Rft=be("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),Dft={variant:"head"},uhe="thead",Ift=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableHead"}),{className:i,component:o=uhe,...s}=r,a={...r,component:o},l=Mft(a);return C.jsx(S4.Provider,{value:Dft,children:C.jsx(Rft,{as:o,className:Oe(l.root,i),ref:n,role:o===uhe?null:"rowgroup",ownerState:a,...s})})});function Lft(t){return Xe("MuiToolbar",t)}He("MuiToolbar",["root","gutters","regular","dense"]);const $ft=t=>{const{classes:e,disableGutters:n,variant:r}=t;return qe({root:["root",!n&&"gutters",r]},Lft,e)},Fft=be("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(wt(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}))),C4=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=$ft(c);return C.jsx(Fft,{as:o,className:Oe(u.root,i),ref:n,ownerState:c,...l})}),Nft=lt(C.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),zft=lt(C.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function jft(t){return Xe("MuiTableRow",t)}const fhe=He("MuiTableRow",["root","selected","hover","head","footer"]),Bft=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return qe({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},jft,e)},Uft=be("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(wt(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${fhe.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${fhe.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)}}}))),dhe="tr",Ad=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTableRow"}),{className:i,component:o=dhe,hover:s=!1,selected:a=!1,...l}=r,c=D.useContext(S4),u={...r,component:o,hover:s,selected:a,head:c&&c.variant==="head",footer:c&&c.variant==="footer"},f=Bft(u);return C.jsx(Uft,{as:o,ref:n,className:Oe(f.root,i),role:o===dhe?null:"row",ownerState:u,...l})});function Wft(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function Vft(t,e,n,r={},i=()=>{}){const{ease:o=Wft,duration:s=300}=r;let a=null;const l=e[t];let c=!1;const u=()=>{c=!0},f=d=>{if(c){i(new Error("Animation cancelled"));return}a===null&&(a=d);const h=Math.min(1,(d-a)/s);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 Gft={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Hft(t){const{onChange:e,...n}=t,r=D.useRef(),i=D.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Ei(()=>{const s=EM(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),a=xc(i.current);return a.addEventListener("resize",s),()=>{s.clear(),a.removeEventListener("resize",s)}},[e]),D.useEffect(()=>{o(),e(r.current)},[e]),C.jsx("div",{style:Gft,ref:i,...n})}function qft(t){return Xe("MuiTabScrollButton",t)}const Xft=He("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Yft=t=>{const{classes:e,orientation:n,disabled:r}=t;return qe({root:["root",n,r&&"disabled"]},qft,e)},Qft=be(Ff,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Xft.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),Kft=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTabScrollButton"}),{className:i,slots:o={},slotProps:s={},direction:a,orientation:l,disabled:c,...u}=r,f=Eo(),d={isRtl:f,...r},h=Yft(d),p=o.StartScrollButtonIcon??Nft,g=o.EndScrollButtonIcon??zft,m=Zt({elementType:p,externalSlotProps:s.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=Zt({elementType:g,externalSlotProps:s.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return C.jsx(Qft,{component:"div",className:Oe(h.root,i),ref:n,role:null,ownerState:d,tabIndex:null,...u,style:{...u.style,...l==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${f?-90:90}deg)`}},children:a==="left"?C.jsx(p,{...m}):C.jsx(g,{...v})})});function Zft(t){return Xe("MuiTabs",t)}const a3=He("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),hhe=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,phe=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,aI=(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}}},Jft=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:s,scrollButtonsHideMobile:a,classes:l}=t;return qe({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",a&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},Zft,l)},edt=be("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${a3.scrollButtons}`]:e.scrollButtons},{[`& .${a3.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(wt(({theme:t})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${a3.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}}}]}))),tdt=be("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]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:t})=>t.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:t})=>t.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:t})=>t.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:t})=>t.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),ndt=be("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})({display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.centered,style:{justifyContent:"center"}}]}),rdt=be("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(wt(({theme:t})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(t.vars||t).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(t.vars||t).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),idt=be(Hft)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),ghe={},O4=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTabs"}),i=To(),o=Eo(),{"aria-label":s,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:g,orientation:m="horizontal",ScrollButtonComponent:v=Kft,scrollButtons:y="auto",selectionFollowsFocus:x,slots:b={},slotProps:w={},TabIndicatorProps:_={},TabScrollButtonProps:S={},textColor:O="primary",value:k,variant:E="standard",visibleScrollbar:P=!1,...A}=r,R=E==="scrollable",T=m==="vertical",M=T?"scrollTop":"scrollLeft",I=T?"top":"left",z=T?"bottom":"right",F=T?"clientHeight":"clientWidth",N=T?"height":"width",L={...r,component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:m,vertical:T,scrollButtons:y,textColor:O,variant:E,visibleScrollbar:P,fixed:!R,hideScrollbar:R&&!P,scrollableX:R&&!T,scrollableY:R&&T,centered:c&&!R,scrollButtonsHideMobile:!h},B=Jft(L),$=Zt({elementType:b.StartScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:L}),j=Zt({elementType:b.EndScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:L}),[X,V]=D.useState(!1),[Y,le]=D.useState(ghe),[K,ee]=D.useState(!1),[re,me]=D.useState(!1),[te,ae]=D.useState(!1),[U,oe]=D.useState({overflow:"hidden",scrollbarWidth:0}),ne=new Map,G=D.useRef(null),q=D.useRef(null),Z=()=>{const Te=G.current;let Le;if(Te){const $e=Te.getBoundingClientRect();Le={clientWidth:Te.clientWidth,scrollLeft:Te.scrollLeft,scrollTop:Te.scrollTop,scrollWidth:Te.scrollWidth,top:$e.top,bottom:$e.bottom,left:$e.left,right:$e.right}}let ue;if(Te&&k!==!1){const $e=q.current.children;if($e.length>0){const Se=$e[ne.get(k)];ue=Se?Se.getBoundingClientRect():null}}return{tabsMeta:Le,tabMeta:ue}},de=st(()=>{const{tabsMeta:Te,tabMeta:Le}=Z();let ue=0,$e;T?($e="top",Le&&Te&&(ue=Le.top-Te.top+Te.scrollTop)):($e=o?"right":"left",Le&&Te&&(ue=(o?-1:1)*(Le[$e]-Te[$e]+Te.scrollLeft)));const Se={[$e]:ue,[N]:Le?Le[N]:0};if(typeof Y[$e]!="number"||typeof Y[N]!="number")le(Se);else{const Ye=Math.abs(Y[$e]-Se[$e]),tt=Math.abs(Y[N]-Se[N]);(Ye>=1||tt>=1)&&le(Se)}}),xe=(Te,{animation:Le=!0}={})=>{Le?Vft(M,G.current,Te,{duration:i.transitions.duration.standard}):G.current[M]=Te},H=Te=>{let Le=G.current[M];T?Le+=Te:Le+=Te*(o?-1:1),xe(Le)},W=()=>{const Te=G.current[F];let Le=0;const ue=Array.from(q.current.children);for(let $e=0;$eTe){$e===0&&(Le=Te);break}Le+=Se[F]}return Le},J=()=>{H(-1*W())},se=()=>{H(W())},ye=D.useCallback(Te=>{oe({overflow:null,scrollbarWidth:Te})},[]),ie=()=>{const Te={};Te.scrollbarSizeListener=R?C.jsx(idt,{onChange:ye,className:Oe(B.scrollableX,B.hideScrollbar)}):null;const ue=R&&(y==="auto"&&(K||re)||y===!0);return Te.scrollButtonStart=ue?C.jsx(v,{slots:{StartScrollButtonIcon:b.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:$},orientation:m,direction:o?"right":"left",onClick:J,disabled:!K,...S,className:Oe(B.scrollButtons,S.className)}):null,Te.scrollButtonEnd=ue?C.jsx(v,{slots:{EndScrollButtonIcon:b.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:j},orientation:m,direction:o?"left":"right",onClick:se,disabled:!re,...S,className:Oe(B.scrollButtons,S.className)}):null,Te},fe=st(Te=>{const{tabsMeta:Le,tabMeta:ue}=Z();if(!(!ue||!Le)){if(ue[I]Le[z]){const $e=Le[M]+(ue[z]-Le[z]);xe($e,{animation:Te})}}}),Q=st(()=>{R&&y!==!1&&ae(!te)});D.useEffect(()=>{const Te=EM(()=>{G.current&&de()});let Le;const ue=Ye=>{Ye.forEach(tt=>{tt.removedNodes.forEach(ut=>{Le==null||Le.unobserve(ut)}),tt.addedNodes.forEach(ut=>{Le==null||Le.observe(ut)})}),Te(),Q()},$e=xc(G.current);$e.addEventListener("resize",Te);let Se;return typeof ResizeObserver<"u"&&(Le=new ResizeObserver(Te),Array.from(q.current.children).forEach(Ye=>{Le.observe(Ye)})),typeof MutationObserver<"u"&&(Se=new MutationObserver(ue),Se.observe(q.current,{childList:!0})),()=>{Te.clear(),$e.removeEventListener("resize",Te),Se==null||Se.disconnect(),Le==null||Le.disconnect()}},[de,Q]),D.useEffect(()=>{const Te=Array.from(q.current.children),Le=Te.length;if(typeof IntersectionObserver<"u"&&Le>0&&R&&y!==!1){const ue=Te[0],$e=Te[Le-1],Se={root:G.current,threshold:.99},Ye=Dn=>{ee(!Dn[0].isIntersecting)},tt=new IntersectionObserver(Ye,Se);tt.observe(ue);const ut=Dn=>{me(!Dn[0].isIntersecting)},qt=new IntersectionObserver(ut,Se);return qt.observe($e),()=>{tt.disconnect(),qt.disconnect()}}},[R,y,te,u==null?void 0:u.length]),D.useEffect(()=>{V(!0)},[]),D.useEffect(()=>{de()}),D.useEffect(()=>{fe(ghe!==Y)},[fe,Y]),D.useImperativeHandle(l,()=>({updateIndicator:de,updateScrollButtons:Q}),[de,Q]);const _e=C.jsx(rdt,{..._,className:Oe(B.indicator,_.className),ownerState:L,style:{...Y,..._.style}});let we=0;const Ie=D.Children.map(u,Te=>{if(!D.isValidElement(Te))return null;const Le=Te.props.value===void 0?we:Te.props.value;ne.set(Le,we);const ue=Le===k;return we+=1,D.cloneElement(Te,{fullWidth:E==="fullWidth",indicator:ue&&!X&&_e,selected:ue,selectionFollowsFocus:x,onChange:g,textColor:O,value:Le,...we===1&&k===!1&&!Te.props.tabIndex?{tabIndex:0}:{}})}),Pe=Te=>{const Le=q.current,ue=yi(Le).activeElement;if(ue.getAttribute("role")!=="tab")return;let Se=m==="horizontal"?"ArrowLeft":"ArrowUp",Ye=m==="horizontal"?"ArrowRight":"ArrowDown";switch(m==="horizontal"&&o&&(Se="ArrowRight",Ye="ArrowLeft"),Te.key){case Se:Te.preventDefault(),aI(Le,ue,phe);break;case Ye:Te.preventDefault(),aI(Le,ue,hhe);break;case"Home":Te.preventDefault(),aI(Le,null,hhe);break;case"End":Te.preventDefault(),aI(Le,null,phe);break}},Re=ie();return C.jsxs(edt,{className:Oe(B.root,f),ownerState:L,ref:n,as:d,...A,children:[Re.scrollButtonStart,Re.scrollbarSizeListener,C.jsxs(tdt,{className:B.scroller,ownerState:L,style:{overflow:U.overflow,[T?`margin${o?"Left":"Right"}`:"marginBottom"]:P?void 0:-U.scrollbarWidth},ref:G,children:[C.jsx(ndt,{"aria-label":s,"aria-labelledby":a,"aria-orientation":m==="vertical"?"vertical":null,className:B.flexContainer,ownerState:L,onKeyDown:Pe,ref:q,role:"tablist",children:Ie}),X&&_e]}),Re.scrollButtonEnd]})});function odt(t){return Xe("MuiTextField",t)}He("MuiTextField",["root"]);const sdt={standard:Dg,filled:NF,outlined:zF},adt=t=>{const{classes:e}=t;return qe({root:["root"]},odt,e)},ldt=be(td,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Jr=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:g,InputLabelProps:m,inputProps:v,InputProps:y,inputRef:x,label:b,maxRows:w,minRows:_,multiline:S=!1,name:O,onBlur:k,onChange:E,onFocus:P,placeholder:A,required:R=!1,rows:T,select:M=!1,SelectProps:I,slots:z={},slotProps:F={},type:N,value:L,variant:B="outlined",...$}=r,j={...r,autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:S,required:R,select:M,variant:B},X=adt(j),V=Jf(g),Y=p&&V?`${V}-helper-text`:void 0,le=b&&V?`${V}-label`:void 0,K=sdt[B],ee={slots:z,slotProps:{input:y,inputLabel:m,htmlInput:v,formHelperText:d,select:I,...F}},re={},me=ee.slotProps.inputLabel;B==="outlined"&&(me&&typeof me.shrink<"u"&&(re.notched=me.shrink),re.label=b),M&&((!I||!I.native)&&(re.id=void 0),re["aria-describedby"]=void 0);const[te,ae]=Jl("input",{elementType:K,externalForwardedProps:ee,additionalProps:re,ownerState:j}),[U,oe]=Jl("inputLabel",{elementType:Fy,externalForwardedProps:ee,ownerState:j}),[ne,G]=Jl("htmlInput",{elementType:"input",externalForwardedProps:ee,ownerState:j}),[q,Z]=Jl("formHelperText",{elementType:Xee,externalForwardedProps:ee,ownerState:j}),[de,xe]=Jl("select",{elementType:Hg,externalForwardedProps:ee,ownerState:j}),H=C.jsx(te,{"aria-describedby":Y,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:S,name:O,rows:T,maxRows:w,minRows:_,type:N,value:L,id:V,inputRef:x,onBlur:k,onChange:E,onFocus:P,placeholder:A,inputProps:G,slots:{input:z.htmlInput?ne:void 0},...ae});return C.jsxs(ldt,{className:Oe(X.root,a),disabled:u,error:f,fullWidth:h,ref:n,required:R,color:l,variant:B,ownerState:j,...$,children:[b!=null&&b!==""&&C.jsx(U,{htmlFor:V,id:le,...oe,children:b}),M?C.jsx(de,{"aria-describedby":Y,id:V,labelId:le,value:L,input:H,...xe,children:s}):H,p&&C.jsx(q,{id:Y,...Z,children:p})]})});function cdt(t){return Xe("MuiToggleButton",t)}const dx=He("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),zPe=D.createContext({}),jPe=D.createContext(void 0);function udt(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.includes(t):t===e}const fdt=t=>{const{classes:e,fullWidth:n,selected:r,disabled:i,size:o,color:s}=t,a={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${Me(o)}`,s]};return qe(a,cdt,e)},ddt=be(Ff,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`size${Me(n.size)}`]]}})(wt(({theme:t})=>({...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,[`&.${dx.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})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${dx.selected}`]:{color:(t.vars||t).palette.text.primary,backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.text.primary,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.text.primary,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.text.primary,t.palette.action.selectedOpacity)}}}}},...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{[`&.${dx.selected}`]:{color:(t.vars||t).palette[e].main,backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette[e].main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette[e].main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette[e].main,t.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:t.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:t.typography.pxToRem(15)}}]}))),xr=D.forwardRef(function(e,n){const{value:r,...i}=D.useContext(zPe),o=D.useContext(jPe),s=_S({...i,selected:udt(e.value,r)},e),a=_t({props:s,name:"MuiToggleButton"}),{children:l,className:c,color:u="standard",disabled:f=!1,disableFocusRipple:d=!1,fullWidth:h=!1,onChange:p,onClick:g,selected:m,size:v="medium",value:y,...x}=a,b={...a,color:u,disabled:f,disableFocusRipple:d,fullWidth:h,size:v},w=fdt(b),_=O=>{g&&(g(O,y),O.defaultPrevented)||p&&p(O,y)},S=o||"";return C.jsx(ddt,{className:Oe(i.className,w.root,c,S),disabled:f,focusRipple:!d,ref:n,onClick:_,onChange:p,value:y,ownerState:b,"aria-pressed":m,...x,children:l})});function hdt(t){return Xe("MuiToggleButtonGroup",t)}const Xr=He("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),pdt=t=>{const{classes:e,orientation:n,fullWidth:r,disabled:i}=t,o={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${Me(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return qe(o,hdt,e)},gdt=be("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Xr.grouped}`]:e.grouped},{[`& .${Xr.grouped}`]:e[`grouped${Me(n.orientation)}`]},{[`& .${Xr.firstButton}`]:e.firstButton},{[`& .${Xr.lastButton}`]:e.lastButton},{[`& .${Xr.middleButton}`]:e.middleButton},e.root,n.orientation==="vertical"&&e.vertical,n.fullWidth&&e.fullWidth]}})(wt(({theme:t})=>({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${Xr.grouped}`]:{[`&.${Xr.selected} + .${Xr.grouped}.${Xr.selected}`]:{borderTop:0,marginTop:0}},[`& .${Xr.firstButton},& .${Xr.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Xr.lastButton},& .${Xr.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Xr.lastButton}.${dx.disabled},& .${Xr.middleButton}.${dx.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${Xr.grouped}`]:{[`&.${Xr.selected} + .${Xr.grouped}.${Xr.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Xr.firstButton},& .${Xr.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Xr.lastButton},& .${Xr.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Xr.lastButton}.${dx.disabled},& .${Xr.middleButton}.${dx.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),tO=D.forwardRef(function(e,n){const r=_t({props:e,name:"MuiToggleButtonGroup"}),{children:i,className:o,color:s="standard",disabled:a=!1,exclusive:l=!1,fullWidth:c=!1,onChange:u,orientation:f="horizontal",size:d="medium",value:h,...p}=r,g={...r,disabled:a,fullWidth:c,orientation:f,size:d},m=pdt(g),v=D.useCallback((S,O)=>{if(!u)return;const k=h&&h.indexOf(O);let E;h&&k>=0?(E=h.slice(),E.splice(k,1)):E=h?h.concat(O):[O],u(S,E)},[u,h]),y=D.useCallback((S,O)=>{u&&u(S,h===O?null:O)},[u,h]),x=D.useMemo(()=>({className:m.grouped,onChange:l?y:v,value:h,size:d,fullWidth:c,color:s,disabled:a}),[m.grouped,l,y,v,h,d,c,s,a]),b=wnt(i),w=b.length,_=S=>{const O=S===0,k=S===w-1;return O&&k?"":O?m.firstButton:k?m.lastButton:m.middleButton};return C.jsx(gdt,{role:"group",className:Oe(m.root,o),ref:n,ownerState:g,...p,children:C.jsx(zPe.Provider,{value:x,children:b.map((S,O)=>C.jsx(jPe.Provider,{value:_(O),children:S},O))})})}),mdt="default",vdt={id:"local",name:"Local Server",url:"http://localhost:8080"},ydt={appBarTitle:"xcube Viewer",windowTitle:"xcube Viewer",windowIcon:null,headerBackgroundColor:"DimGray",compact:!1,themeMode:"system",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,allowSharing:!0,allowUserVariables:!0,allowViewModePython:!0,allow3D:!0},lI={name:mdt,server:vdt,branding:ydt};function xdt(){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 RM=xdt();function BPe(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 bdt={amber:iAe,blue:Um,blueGrey:KJe,brown:oAe,cyan:eAe,deepOrange:Px,deepPurple:YJe,green:$p,grey:sAe,indigo:Jke,lightBlue:Wm,lightGreen:QJe,lime:nAe,orange:Q0,pink:Zke,purple:Bm,red:jm,teal:tAe,yellow:rAe};function mhe(t,e){const n=t[e];let r=null;if(typeof n=="string"?(r=bdt[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 wdt(t,e,n){const r=t[e];typeof r=="string"&&(t[e]=BPe(RM.href,n,r))}function _dt(t,e){return t={...t},mhe(t,"primaryColor"),mhe(t,"secondaryColor"),wdt(t,"logoImage",e),t}function yr(t){return typeof t=="number"}function n1(t){return typeof t=="string"}function Sdt(t){return typeof t=="function"}function vhe(t){return t!==null&&typeof t=="object"&&t.constructor===Object}const Up=new URLSearchParams(window.location.search),sf=class sf{constructor(e,n,r,i){gn(this,"name");gn(this,"server");gn(this,"branding");gn(this,"authClient");this.name=e,this.server=n,this.branding=r,this.authClient=i}static async load(){let e=Up.get("configPath")||"config";const n=await this.loadRawConfig(e);n===lI&&(e="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),s=parseInt(Up.get("compact")||"0")!==0;let a=_dt({...lI.branding,...n.branding,compact:s||n.branding.compact},e);return a=xhe(a,"allowUserVariables"),a=xhe(a,"allow3D"),sf._instance=new sf(r,o,a,i),a.windowTitle&&this.changeWindowTitle(a.windowTitle),a.windowIcon&&this.changeWindowIcon(a.windowIcon),sf._instance}static getAuthConfig(e){let n=e.authClient&&{...e.authClient};const r=sf.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={...lI.server,...e.server},r=sf.getApiServerFromEnv();return n.id=Up.get("serverId")||r.id||n.id,n.name=Up.get("serverName")||r.name||n.name,n.url=Up.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(e){let n=null,r=null;const i=BPe(RM.href,e,"config.json");try{const o=await fetch(i);if(o.ok)n=await o.json();else{const{status:s,statusText:a}=o;r=`HTTP status ${s}`,a&&(r+=` (${a})`)}}catch(o){n=null,r=`${o}`}return n===null&&(n=lI),n}static get instance(){return sf.assertConfigLoaded(),sf._instance}static assertConfigLoaded(){if(!sf._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}}};gn(sf,"_instance");let Pn=sf;const tte=[["red",jm],["yellow",rAe],["blue",Um],["pink",Zke],["lightBlue",Wm],["green",$p],["orange",Q0],["lime",nAe],["purple",Bm],["indigo",Jke],["cyan",eAe],["brown",oAe],["teal",tAe]],Cdt=(()=>{const t={};return tte.forEach(([e,n])=>{t[e]=n}),t})(),yhe=tte.map(([t,e])=>t);function Odt(t){return t==="light"?800:400}function ab(t){return yhe[t%yhe.length]}function UPe(t,e){const n=Odt(e);return Cdt[t][n]}function nte(t){return yr(t)||(t=Pn.instance.branding.polygonFillOpacity),yr(t)?t:.25}const Edt={Mapbox:{param:"access_token",token:"pk.eyJ1IjoiZm9ybWFuIiwiYSI6ImNrM2JranV0bDBtenczb2szZG84djh6bWUifQ.q0UKwf4CWt5fcQwIDwF8Bg"}};function Tdt(t){return Edt[t]}function xhe(t,e){const n=Up.get(e),r=n?!!parseInt(n):!!t[e];return{...t,[e]:r}}const kdt=[{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:[]}],Adt=kdt,rte="User";function BF(t){return t?`${t.group}: ${t.title}`:"-"}function UF(t,e){return t.find(n=>n.id===e)||null}function WPe(t="datasets"){const e=[];return Adt.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 VPe=WPe("datasets"),Pdt=WPe("overlays"),Mdt=VPe[0].id,nO="EPSG:4326",ite="EPSG:3857",GPe=ite;var jh=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 AS={PROPERTYCHANGE:"propertychange"};var ote=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function Rdt(t,e,n){for(var r,i,o=lb,s=0,a=t.length,l=!1;s>1),i=+o(t[r],e),i<0?s=r+1:(a=r,l=!i);return l?s:~s}function lb(t,e){return t>e?1:t0){for(i=1;i0?i-1:i:t[i-1]-e0||s===0)})}function Dx(){return!0}function DM(){return!1}function cb(){}function Ldt(t){var e=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!e||this!==i||!r1(o,r))&&(e=!0,i=this,r=o,n=t.apply(this,arguments)),n}}var pi=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]=cb,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},e}(ote);const nn={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 zn(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 s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function WF(t,e,n,r){return zn(t,e,n,r,!0)}function si(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),IM(t))}var Fdt=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)}}(),LM=function(t){Fdt(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(nn.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),s=0;s=0||ey.match(/cpu (os|iphone os) 15_4 like mac os x/));var Hdt=ey.indexOf("webkit")!==-1&&ey.indexOf("edge")==-1,qdt=ey.indexOf("macintosh")!==-1,YPe=typeof devicePixelRatio<"u"?devicePixelRatio:1,E4=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Xdt=typeof Image<"u"&&Image.prototype.decode,QPe=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 dh(){return[1,0,0,1,0,0]}function Ydt(t,e,n,r,i,o,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t}function Qdt(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 Bi(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 Kdt(t,e,n){return Ydt(t,e,0,0,n,0,0)}function Ig(t,e,n,r,i,o,s,a){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]=s*r*c-a*r*l+e,t[5]=s*i*l+a*i*c+n,t}function ate(t,e){var n=Zdt(e);bn(n!==0,32);var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5];return t[0]=s/n,t[1]=-i/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*l-s*a)/n,t[5]=-(r*l-i*a)/n,t}function Zdt(t){return t[0]*t[3]-t[1]*t[2]}var whe;function KPe(t){var e="matrix("+t.join(", ")+")";if(E4)return e;var n=whe||(whe=document.createElement("div"));return n.style.transform=e,n.style.transform}const Ro={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function _he(t){for(var e=_c(),n=0,r=t.length;ni&&(l=l|Ro.RIGHT),ao&&(l=l|Ro.ABOVE),l===Ro.UNKNOWN&&(l=Ro.INTERSECTING),l}function _c(){return[1/0,1/0,-1/0,-1/0]}function Bf(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 FM(t){return Bf(1/0,1/0,-1/0,-1/0,t)}function eht(t,e){var n=t[0],r=t[1];return Bf(n,r,n,r,e)}function JPe(t,e,n,r,i){var o=FM(i);return tMe(o,t,e,n,r)}function lA(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function eMe(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function ek(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function tMe(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 hte(t){return t[2]=s&&g<=l),!r&&o&Ro.RIGHT&&!(i&Ro.RIGHT)&&(m=h-(d-l)*p,r=m>=a&&m<=c),!r&&o&Ro.BELOW&&!(i&Ro.BELOW)&&(g=d-(h-a)/p,r=g>=s&&g<=l),!r&&o&Ro.LEFT&&!(i&Ro.LEFT)&&(m=h-(d-s)*p,r=m>=a&&m<=c)}return r}function oht(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 s=[],a=[],o=0,l=i.length;o=n[2])){var i=ei(n),o=Math.floor((r[0]-n[0])/i),s=o*i;t[0]-=s,t[2]-=s}return t}function sht(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]]];nMe(t,e);var r=ei(n);if(ei(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 rMe=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_||jf[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 oo(t,e,n){return Math.min(Math.max(t,e),n)}var aht=function(){var t;return"cosh"in Math?t=Math.cosh:t=function(e){var n=Math.exp(e);return(n+1/n)/2},t}(),lht=function(){var t;return"log2"in Math?t=Math.log2:t=function(e){return Math.log(e)*Math.LOG2E},t}();function cht(t,e,n,r,i,o){var s=i-n,a=o-r;if(s!==0||a!==0){var l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return Ix(t,e,n,r)}function Ix(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function uht(t){for(var e=t.length,n=0;ni&&(i=s,r=o)}if(i===0)return null;var a=t[r];t[r]=t[n],t[n]=a;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 l3(t){return t*Math.PI/180}function $v(t,e){var n=t%e;return n*e<0?n+e:n}function Fp(t,e,n){return t+n*(e-t)}function iMe(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function cI(t,e){return Math.floor(iMe(t,e))}function uI(t,e){return Math.ceil(iMe(t,e))}var fht=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)}}(),NM=6378137,c_=Math.PI*NM,dht=[-c_,-c_,c_,c_],hht=[-180,-85,180,85],fI=NM*Math.log(Math.tan(Math.PI/2)),V1=function(t){fht(e,t);function e(n){return t.call(this,{code:n,units:$o.METERS,extent:dht,global:!0,worldExtent:hht,getPointResolution:function(r,i){return r/aht(i[1]/NM)}})||this}return e}(rMe),She=[new V1("EPSG:3857"),new V1("EPSG:102100"),new V1("EPSG:102113"),new V1("EPSG:900913"),new V1("http://www.opengis.net/def/crs/EPSG/0/3857"),new V1("http://www.opengis.net/gml/srs/epsg.xml#3857")];function pht(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 s=0;sfI?a=fI:a<-fI&&(a=-fI),o[s+1]=a}return o}function ght(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 s=0;ss)return 1;if(s>o)return-1}return 0}function Sht(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function GF(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function pte(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 Cht(t,e){return t[0]*=e,t[1]*=e,t}function Oht(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function oMe(t,e){if(e.canWrapX()){var n=ei(e.getExtent()),r=Eht(t,e,n);r&&(t[0]-=r*n)}return t}function Eht(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]r[2])){var o=n||ei(r);i=Math.floor((t[0]-r[0])/o)}return i}var Tht=63710088e-1;function Ehe(t,e,n){var r=Tht,i=l3(t[1]),o=l3(e[1]),s=(o-i)/2,a=l3(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var bq=!0;function kht(t){var e=!0;bq=!e}function gte(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&&(bq=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function lMe(t,e){return t}function hx(t,e){return t}function Iht(){The(She),The(Ohe),Mht(Ohe,She,pht,ght)}Iht();function Lx(t,e,n,r,i,o){for(var s=o||[],a=0,l=e;l1)f=n;else if(d>0){for(var h=0;hi&&(i=c),o=a,s=l}return i}function bte(t,e,n,r,i){for(var o=0,s=n.length;o0;){for(var f=c.pop(),d=c.pop(),h=0,p=t[d],g=t[d+1],m=t[f],v=t[f+1],y=d+r;yh&&(u=y,h=w)}h>i&&(l[(u-e)/r]=1,d+r0&&g>h)&&(p<0&&m0&&m>p)){c=f,u=d;continue}o[s++]=c,o[s++]=u,a=c,l=u,c=f,u=d}}return o[s++]=c,o[s++]=u,s}function dMe(t,e,n,r,i,o,s,a){for(var l=0,c=n.length;l1?s:2,b=o||new Array(x),p=0;p>1;io&&(c-a)*(o-l)-(i-a)*(u-l)>0&&s++:u<=o&&(c-a)*(o-l)-(i-a)*(u-l)<0&&s--,a=c,l=u}return s!==0}function Ote(t,e,n,r,i,o){if(n.length===0||!px(t,e,n[0],r,i,o))return!1;for(var s=1,a=n.length;s=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:hMe(t,e,n,r,function(s,a){return iht(i,s,a)}):!1}function Qht(t,e,n,r,i){for(var o=0,s=n.length;ob&&(c=(u+f)/2,Ote(t,e,n,r,c,p)&&(x=c,b=w)),u=f}return isNaN(x)&&(x=i[o]),s?(s.push(x,p,b),s):[x,p,b]}function ipt(t,e,n,r,i){for(var o=[],s=0,a=n.length;s0}function _Me(t,e,n,r,i){for(var o=0,s=n.length;o="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=rr.LEFT_PAREN;else if(e==",")i=rr.COMMA;else if(e==")")i=rr.RIGHT_PAREN;else if(this.isNumeric_(e)||e=="-")i=rr.NUMBER,r=this.readNumber_();else if(this.isAlpha_(e))i=rr.TEXT,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(e==="")i=rr.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}(),xpt=function(){function t(e){this.lexer_=e,this.token_={position:0,type:rr.START},this.layout_=Kn.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=Kn.XY,n=this.token_;if(this.isTokenType(rr.TEXT)){var r=n.value;r===OMe?e=Kn.XYZ:r===EMe?e=Kn.XYM:r===mpt&&(e=Kn.XYZM),e!==Kn.XY&&this.consume_()}return e},t.prototype.parseGeometryCollectionText_=function(){if(this.match(rr.LEFT_PAREN)){var e=[];do e.push(this.parseGeometry_());while(this.match(rr.COMMA));if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parsePoint_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parsePointList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(rr.LEFT_PAREN)){var e=void 0;if(this.token_.type==rr.LEFT_PAREN?e=this.parsePointTextList_():e=this.parsePointList_(),this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parsePolygonTextList_();if(this.match(rr.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+" "+CMe:i+"("+r+")"}const Dhe="color:green;font-weight:bold;",Ept="color:blue;font-weight:bold;";class Tpt{constructor(e){gn(this,"_languages");gn(this,"_content");gn(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(a=>{if(!i[a])throw new Error(`Internal error: invalid entry at index ${o} in "./resources/lang.json": missing translation for locale: "${a}": ${i}`)});const s=Ihe(i.en);r[s]&&console.warn(`Translation already defined for "${i.en}".`),r[s]=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=Ihe(e),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${e}`,Dhe,` for locale %c${this._locale}`,Ept),o=e)):(console.debug(`missing translation for phrase %c${e}`,Dhe),o=e),n&&Object.keys(n).forEach(s=>{o=o.replace("${"+s+"}",`${n[s]}`)}),o}}const kpt=()=>{let t;return navigator.languages&&navigator.languages.length>0?t=navigator.languages[0]:t=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",t.split("-")[0]},Ihe=t=>t.toLowerCase(),Apt={en:"English",de:"Deutsch",se:"Svenska"},Ppt=[{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:"Textual format",de:"Textformat",se:"Textformat"},{en:"Tabular format",de:"Tabellenformat",se:"Tabellformat"},{en:"JSON format",de:"JSON-Format",se:"JSON-format"},{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"},{en:"docs/dev-reference.en.md",de:"docs/dev-reference.en.md",se:"docs/dev-reference.en.md"}],Mpt={languages:Apt,dictionary:Ppt},pe=new Tpt(Mpt);pe.locale=kpt();class Rpt extends Error{}const MMe={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function RMe(t,e){return new Dpt(e).parse(t)}let Dpt=class{constructor(e){gn(this,"options");this.options={...MMe,...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 s=!1;const a=[];let l=0,c=0;for(;c-1){var c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return QF}function i(a,l){r(a)===QF&&(n.unshift({key:a,value:l}),n.length>t&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var Npt=function(e,n){return e===n};function zpt(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]!==a&&(o=[a,...o])}n.properties&&(s=Lhe(n.properties,o)),s===void 0&&(s=Lhe(n,o)),t[r]=s||i}function fgt(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 Lhe(t,e){let n;for(const r of e)if(r in t)return t[r];return n}function zM(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 Mte(t,e){t.forEach(n=>{sO(n)&&n.features.forEach(r=>{e(n,r)})})}function dgt(t,e){const n=n1(e)?(r,i)=>i.id===e:e;for(const r of t)if(sO(r)){const i=r.features.find(o=>n(r,o));if(i)return M4(r,i)}return null}function hgt(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=IMe(r[i],e);if(o)return o}return null}function Rte(t,e){if(e)for(const n of t){const r=IMe(n,e);if(r!==null)return r}return null}const pgt=["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"].map(t=>t.toLowerCase());function $he(t){if(t=t.trim(),t==="")return"csv";if(t[0]==="{")return"geojson";const e=t.substring(0,20).toLowerCase();return pgt.find(r=>e.startsWith(r)&&(e.length===r.length||` - (`.indexOf(e[r.length])>=0))?"wkt":"csv"}function c3(t){return t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e!=="")}const ggt=t=>{if(t.trim()!=="")try{RMe(t)}catch(e){return console.error(e),`${e}`}return null},LMe={name:"Text/CSV",fileExt:".txt,.csv",checkError:ggt},kq={...MMe,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 mgt=0,vgt=0;function ygt(t,e){const n=RMe(t,e);if(n.length<2)throw new Error(pe.get("Missing header line in CSV"));for(const _ of n[0])if(typeof _!="string"||_==="")throw new Error(pe.get("Invalid header line in CSV"));const r=n[0].map(_=>_),i=r.map(_=>_.toLowerCase()),o=r.length;for(const _ of n)if(_.length!==o)throw new Error(pe.get("All rows must have same length"));const s=xgt(i),a=G1(s,e.groupNames),l=G1(s,e.labelNames),c=G1(s,e.timeNames),u=G1(s,e.xNames),f=G1(s,e.yNames);let d=G1(s,e.geometryNames);if(e.forceGeometry||u<0||f<0||u===f){if(d<0)throw new Error(pe.get("No geometry column(s) found"))}else d=-1;let p=e.groupPrefix.trim();p===""&&(p=kq.groupPrefix);let g=e.labelPrefix.trim();g===""&&(g=kq.labelPrefix);let m="";if(a===-1){const _=++mgt;m=`${p}${_}`}const v=new TMe,y={};let x=1,b=0,w=ab(0);for(;x=0&&(S=`${_[c]}`),a>=0&&(m=`${_[a]}`);let O=y[m];O||(O=Ate(m,[]),y[m]=O,w=ab(b),b++);let k=null;if(d>=0){if(typeof _[d]=="string")try{k=v.readGeometry(t)}catch{}}else{const A=_[u],R=_[f];typeof A=="number"&&Number.isFinite(A)&&typeof R=="number"&&Number.isFinite(R)&&(k=new hh([A,R]))}if(k===null)throw new Error(pe.get(`Invalid geometry in data row ${x}`));const E={};_.forEach((A,R)=>{if(R!==u&&R!==f&&R!==d){const T=r[R];E[T]=A}});let P;if(l>=0)P=`${_[l]}`;else{const A=++vgt;P=`${g}${A}`}S!==""&&(E.time=S),E.color||(E.color=w),E.label||(E.label=P),E.source||(E.source="CSV"),O.features.push(Pte(k,E))}return Object.getOwnPropertyNames(y).map(_=>y[_])}function xgt(t){const e={};for(let n=0;n{if(t.trim()!=="")try{JSON.parse(t)}catch(e){return console.error(e),`${e}`}return null},$Me={name:"GeoJSON",fileExt:".json,.geojson",checkError:bgt},Aq={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let wgt=0,_gt=0;function Sgt(t,e){const n=c3(e.groupNames||"");let r=e.groupPrefix.trim();r===""&&(r=Aq.groupPrefix);const i=c3(e.labelNames||"");let o=e.labelPrefix.trim();o===""&&(o=Aq.labelPrefix);const s=c3(e.timeNames||""),a=new s1;let l;try{l=a.readFeatures(t)}catch{try{const d=a.readGeometry(t);l=[new Wp(d)]}catch{throw new Error(pe.get("Invalid GeoJSON"))}}const c={};let u=0;return l.forEach(f=>{const d=f.getProperties(),h=f.getGeometry();if(h){let p="",g="",m="",v=ab(0);if(d){const b={};Object.getOwnPropertyNames(d).forEach(w=>{b[w.toLowerCase()]=d[w]}),p=cW(b,s,p),m=cW(b,i,m),g=cW(b,n,g)}if(g===""){const b=++wgt;g=`${r}-${b}`}if(m===""){const b=++_gt;m=`${o}-${b}`}let y=c[g];y||(y=Ate(g,[]),c[g]=y,v=ab(u),u++);const x={...d};p!==""&&(x.time=p),x.color||(x.color=v),x.label||(x.label=m),x.source||(x.source="GeoJSON"),y.features.push(Pte(h,x))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function cW(t,e,n){if(n===""){for(const r of e)if(t[r]==="string")return t[r]}return n}function FMe(t){return t.getTimezoneOffset()*6e4}function Cgt(t){return t.getTime()-FMe(t)}function uW(t){const e=new Date(t);return new Date(e.getTime()+FMe(e))}function dA(t){return new Date(t).toISOString().substring(0,10)}function aO(t){return NMe(new Date(t).toISOString())}function NMe(t){return t.substring(0,19).replace("T"," ")}const Ogt=t=>null,zMe={name:"WKT",fileExt:".txt,.wkt",checkError:Ogt},Pq={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:aO(new Date().getTime())};let Egt=0,Tgt=0;function kgt(t,e){let n=e.groupPrefix.trim();n===""&&(n=Pq.groupPrefix);let r=e.group.trim();if(r===""){const a=++Egt;r=`${n}${a}`}let i=e.labelPrefix.trim();i===""&&(i=Pq.labelPrefix);let o=e.label.trim();if(o===""){const a=++Tgt;o=`${i}${a}`}const s=e.time.trim();try{const a=new TMe().readGeometry(t);let l={color:ab(Math.floor(1e3*Math.random())),label:o,source:"WKT"};s!==""&&(l={time:s,...l});const c=[Pte(a,l)];return[Ate(r,c)]}catch{throw new Error(pe.get("Invalid Geometry WKT"))}}function lO(t){return Agt("localStorage",t)}function Agt(t,e){try{const n=window[t],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new Pgt(n,e)}catch{return null}}class Pgt{constructor(e,n){gn(this,"nativeStorage");gn(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 s=r?r(o):o;return i?i(s):s}catch(s){console.error(`Failed parsing user setting "${e}": ${s}`)}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 s=JSON.parse(o);if(Array.isArray(s))return s;const a=r[e];return Array.isArray(a)?a:[]},i)}getObjectProperty(e,n,r){this.getProperty(e,n,r,i=>{const o=JSON.parse(i),s=r[e],a={...s,...o};return Object.getOwnPropertyNames(o).forEach(l=>{const c=s[l],u=o[l];vhe(c)&&vhe(u)&&(a[l]={...c,...u})}),a})}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 Mgt(t){const e=lO(Pn.instance.name);if(e)try{e.setObjectItem("userServers",t)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function Rgt(){const t=lO(Pn.instance.name);if(t)try{return t.getObjectItem("userServers",[])}catch(e){console.warn(`failed to load user servers: ${e}`)}return[]}function Dgt(t){const e=lO(Pn.instance.name);if(e)try{e.setObjectItem("userVariables",t)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function Igt(){const t=lO(Pn.instance.name);if(t)try{return t.getObjectItem("userVariables",{})}catch(e){console.warn(`failed to load user variables: ${e}`)}return{}}function vd(t){const e=lO(Pn.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),e.setPrimitiveProperty("themeMode",t)}catch(n){console.warn(`failed to store user settings: ${n}`)}}function Lgt(t){const e=lO(Pn.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,$gt),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),e.getStringProperty("themeMode",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 Fhe={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function $gt(t){if(Array.isArray(t))return t.map(e=>({...e,type:Fgt(e.type)}))}function Fgt(t){return n1(t)&&t in Fhe?Fhe[t]:"continuous"}const Ngt=[250,500,1e3,2500],zgt=["info","timeSeries","stats","volume"],jMe=["light","dark","system"],jgt=[["light","Light"],["dark","Dark"],["system","System"]];function Bgt(){const t=Pn.instance.branding,e={selectedDatasetId:null,selectedVariableName:null,selectedDataset2Id:null,selectedVariable2Name:null,selectedPlaceGroupIds:[],selectedPlaceId:null,selectedUserPlaceId:null,selectedServerId:Pn.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:{...kq},geojson:{...Aq},wkt:{...Pq}},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||GPe,imageSmoothingEnabled:!1,selectedBaseMapId:Mdt,selectedOverlayId:null,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export",themeMode:Ugt()};return Lgt(e)}function Ugt(){const t=Pn.instance.branding.themeMode;return t&&jMe.includes(t)?t:"system"}function BMe(t,e){return e||(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t&&jMe.includes(t)&&t!=="system"?t:e}const Hs={};function Z2(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 UMe={exports:{}};const Wgt={},Vgt=Object.freeze(Object.defineProperty({__proto__:null,default:Wgt},Symbol.toStringTag,{value:"Module"})),Ggt=y2e(Vgt);(function(t,e){(function(n,r){t.exports=r()})(ri,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 ri<"u"&&ri.crypto&&(o=ri.crypto),!o&&typeof Z2=="function")try{o=Ggt}catch{}var s=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.")},a=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=a(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,w=this.sigBytes,_=y.sigBytes;if(this.clamp(),w%4)for(var S=0;S<_;S++){var O=b[S>>>2]>>>24-S%4*8&255;x[w+S>>>2]|=O<<24-(w+S)%4*8}else for(var k=0;k<_;k+=4)x[w+k>>>2]=b[k>>>2];return this.sigBytes+=_,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-_%4*8&255;w.push((S>>>4).toString(16)),w.push((S&15).toString(16))}return w.join("")},parse:function(y){for(var x=y.length,b=[],w=0;w>>3]|=parseInt(y.substr(w,2),16)<<24-w%8*4;return new f.init(b,x/2)}},p=d.Latin1={stringify:function(y){for(var x=y.words,b=y.sigBytes,w=[],_=0;_>>2]>>>24-_%4*8&255;w.push(String.fromCharCode(S))}return w.join("")},parse:function(y){for(var x=y.length,b=[],w=0;w>>2]|=(y.charCodeAt(w)&255)<<24-w%4*8;return new f.init(b,x)}},g=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)))}},m=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var x,b=this._data,w=b.words,_=b.sigBytes,S=this.blockSize,O=S*4,k=_/O;y?k=r.ceil(k):k=r.max((k|0)-this._minBufferSize,0);var E=k*S,P=r.min(E*4,_);if(E){for(var A=0;A>>7)^(k<<14|k>>>18)^k>>>3,P=f[O-2],A=(P<<15|P>>>17)^(P<<13|P>>>19)^P>>>10;f[O]=E+f[O-7]+A+f[O-16]}var R=b&w^~b&_,T=m&v^m&y^v&y,M=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),I=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),z=S+I+R+u[O]+f[O],F=M+T;S=_,_=w,w=b,b=x+z|0,x=y,y=v,v=m,m=z+F|0}g[0]=g[0]+m|0,g[1]=g[1]+v|0,g[2]=g[2]+y|0,g[3]=g[3]+x|0,g[4]=g[4]+b|0,g[5]=g[5]+w|0,g[6]=g[6]+_|0,g[7]=g[7]+S|0},_doFinalize:function(){var h=this._data,p=h.words,g=this._nDataBytes*8,m=h.sigBytes*8;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=r.floor(g/4294967296),p[(m+64>>>9<<4)+15]=g,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=a._createHelper(d),i.HmacSHA256=a._createHmacHelper(d)}(Math),n.SHA256})})(WMe);var qgt=WMe.exports;const Xgt=sn(qgt);var VMe={exports:{}};(function(t,e){(function(n,r){t.exports=r(R4)})(ri,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,s=r.enc;s.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,g=c[h+1>>>2]>>>24-(h+1)%4*8&255,m=c[h+2>>>2]>>>24-(h+2)%4*8&255,v=p<<16|g<<8|m,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,m=p|g;f[d>>>2]|=m<<24-d%4*8,d++}return o.create(f,d)}}(),n.enc.Base64})})(VMe);var Ygt=VMe.exports;const Nhe=sn(Ygt);var GMe={exports:{}};(function(t,e){(function(n,r){t.exports=r(R4)})(ri,function(n){return n.enc.Utf8})})(GMe);var Qgt=GMe.exports;const Kgt=sn(Qgt);function Mq(t){this.message=t}Mq.prototype=new Error,Mq.prototype.name="InvalidCharacterError";var zhe=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Mq("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,s="";r=e.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?s+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};function Zgt(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(zhe(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 zhe(e)}}function KF(t){this.message=t}function Jgt(t,e){if(typeof t!="string")throw new KF("Invalid token specified");var n=(e=e||{}).header===!0?0:1;try{return JSON.parse(Zgt(t.split(".")[n]))}catch(r){throw new KF("Invalid token specified: "+r.message)}}KF.prototype=new Error,KF.prototype.name="InvalidTokenError";var emt={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Ed,Td,ZF=(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))(ZF||{});(t=>{function e(){Ed=3,Td=emt}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");Ed=i}t.setLevel=n;function r(i){Td=i}t.setLogger=r})(ZF||(ZF={}));var on=class{constructor(t){this._name=t}debug(...t){Ed>=4&&Td.debug(on._format(this._name,this._method),...t)}info(...t){Ed>=3&&Td.info(on._format(this._name,this._method),...t)}warn(...t){Ed>=2&&Td.warn(on._format(this._name,this._method),...t)}error(...t){Ed>=1&&Td.error(on._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 on(`${t}.${e}`);return n.debug("begin"),n}static _format(t,e){const n=`[${t}]`;return e?`${n} ${e}:`:n}static debug(t,...e){Ed>=4&&Td.debug(on._format(t),...e)}static info(t,...e){Ed>=3&&Td.info(on._format(t),...e)}static warn(t,...e){Ed>=2&&Td.warn(on._format(t),...e)}static error(t,...e){Ed>=1&&Td.error(on._format(t),...e)}};ZF.reset();var tmt="10000000-1000-4000-8000-100000000000",Qd=class{static _randomWord(){return Hgt.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return tmt.replace(/[018]/g,e=>(+e^Qd._randomWord()&15>>+e/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Qd.generateUUIDv4()+Qd.generateUUIDv4()+Qd.generateUUIDv4()}static generateCodeChallenge(t){try{const e=Xgt(t);return Nhe.stringify(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw on.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(t,e){const n=Kgt.parse([t,e].join(":"));return Nhe.stringify(n)}},Vm=class{constructor(e){this._name=e,this._logger=new on(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const n=this._callbacks.lastIndexOf(e);n>=0&&this._callbacks.splice(n,1)}raise(...e){this._logger.debug("raise:",...e);for(const n of this._callbacks)n(...e)}},Rq=class{static decode(t){try{return Jgt(t)}catch(e){throw on.error("JwtUtils.decode",e),e}}},jhe=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(",")}},du=class extends Vm{constructor(){super(...arguments),this._logger=new on(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-du.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=du.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const n=this._logger.create("init");e=Math.max(Math.floor(e),1);const r=du.getEpochTime()+e;if(this.expiration===r&&this._timerHandle){n.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),n.debug("using duration",e),this._expiration=r;const i=Math.min(e,5);this._timerHandle=setInterval(this._callback,i*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},Dq=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))}},ub=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 on.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}},Dte=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},nmt=class{constructor(t){this._logger=new on("AccessTokenEvents"),this._expiringTimer=new du("Access token expiring"),this._expiredTimer=new du("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)}},rmt=class{constructor(t,e,n,r,i){this._callback=t,this._client_id=e,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new on("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=s=>{s.origin===this._frame_origin&&s.source===this._frame.contentWindow&&(s.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):s.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(s.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)}},HMe=class{constructor(){this._logger=new on("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]}},Ite=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new on("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(s){throw s instanceof DOMException&&s.name==="AbortError"?new Dte("Network timed out"):s}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 s=o.headers.get("Content-Type");if(s&&!this._contentTypes.find(l=>s.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${t}`)),o.ok&&this._jwtHandler&&(s!=null&&s.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let a;try{a=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:",a),a.error?new ub(a):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(a)}`);return a}async postForm(t,{body:e,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(s.Authorization="Basic "+n),this.appendExtraHeaders(s);let a;try{o.debug("url:",t),a=await this.fetchWithTimeout(t,{method:"POST",headers:s,body:e,timeoutInSeconds:r,credentials:i})}catch(f){throw o.error("Network error"),f}o.debug("HTTP response received, status",a.status);const l=a.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 a.text();let u={};if(c)try{u=JSON.parse(c)}catch(f){throw o.error("Error parsing JSON response",f),a.ok?f:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw o.error("Error from server:",u),u.error?new ub(u,e):new Error(`${a.statusText} (${a.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)})}},imt=class{constructor(t){this._settings=t,this._logger=new on("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new Ite(["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}},qMe=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new on("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=Rq.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new Ite(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}},YMe=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new on("TokenClient"),this._jsonService=new Ite(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 s=new URLSearchParams({grant_type:t,redirect_uri:e});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;a=Qd.generateBasicAuth(n,r);break;case"client_secret_post":s.append("client_id",n),r&&s.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:s,basicAuth:a,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 s=new URLSearchParams({grant_type:t,scope:r});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Qd.generateBasicAuth(e,n);break;case"client_secret_post":s.append("client_id",e),n&&s.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:s,basicAuth:a,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 s=new URLSearchParams({grant_type:t});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Qd.generateBasicAuth(e,n);break;case"client_secret_post":s.append("client_id",e),n&&s.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:s,basicAuth:a,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,s]of Object.entries(t))s!=null&&i.set(o,s);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")}},dmt=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new on("ResponseValidator"),this._userInfoService=new fmt(this._settings,this._metadataService),this._tokenClient=new YMe(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 ub(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 ub(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=Rq.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const o=Rq.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}},MS=class{constructor(t){this.id=t.id||Qd.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=du.getEpochTime(),this.request_type=t.request_type}toStorageString(){return new on("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(t){return on.createStatic("State","fromStorageString"),new MS(JSON.parse(t))}static async clearStaleState(t,e){const n=on.createStatic("State","clearStaleState"),r=du.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:a,...m,...h}))x!=null&&v.searchParams.append(y,x.toString());this.url=v.href}},pmt="openid",fW=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-du.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+du.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(pmt))||!!this.id_token}},gmt=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 on("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const s=new URL(t);n&&s.searchParams.append("id_token_hint",n),r&&(s.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new MS({data:e,request_type:o}),s.searchParams.append("state",this.state.id)));for(const[a,l]of Object.entries({...i}))l!=null&&s.searchParams.append(a,l.toString());this.url=s.href}},mmt=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")}},vmt=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],ymt=["sub","iss","aud","exp","iat"],xmt=class{constructor(t){this._settings=t,this._logger=new on("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=vmt;for(const r of n)ymt.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 s=n[r];s?Array.isArray(s)?s.includes(o)||s.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(s,o):n[r]=[s,o]):n[r]=o}return n}},bmt=class{constructor(t){this._logger=new on("OidcClient"),this.settings=new XMe(t),this.metadataService=new imt(this.settings),this._claimsService=new xmt(this.settings),this._validator=new dmt(this.settings,this.metadataService,this._claimsService),this._tokenClient=new YMe(this.settings,this.metadataService)}async createSigninRequest({state:t,request:e,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:s,nonce:a,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:g=this.settings.acr_values,resource:m=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 w=await this.metadataService.getAuthorizationEndpoint();b.debug("Received authorization endpoint",w);const _=new hmt({url:w,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:g,resource:m,request:e,request_uri:n,extraQueryParams:y,extraTokenParams:x,request_type:r,response_mode:v,client_secret:this.settings.client_secret,skipUserInfo:s,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const S=_.state;return await this.settings.stateStore.set(S.id,S.toStorageString()),_}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new fW(Dq.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:Lte.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 fW(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 a=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=t.scope)==null?void 0:n.split(" "))||[]).filter(c=>a.includes(c)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,scope:i,timeoutInSeconds:e}),s=new fW(new URLSearchParams);return Object.assign(s,o),r.debug("validating response",s),await this._validator.validateRefreshResponse(s,{...t,scope:i}),s}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"),s=await this.metadataService.getEndSessionEndpoint();if(!s)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",s);const a=new gmt({url:s,id_token_hint:e,post_logout_redirect_uri:r,state_data:t,extraQueryParams:i,request_type:n});await this.clearStaleState();const l=a.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),a}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new mmt(Dq.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 ub(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:MS.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"),MS.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})}},wmt=class{constructor(t){this._userManager=t,this._logger=new on("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,s=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,l=new rmt(this._callback,o,i,s,a);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)}}}},u3=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-du.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+du.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 on("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 on.createStatic("User","fromStorageString"),new u3(JSON.parse(t))}},Bhe="oidc-client",QMe=class{constructor(){this._abort=new Vm("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 s=a=>{var l;const c=a.data,u=(l=t.scriptOrigin)!=null?l:window.location.origin;if(!(a.origin!==u||(c==null?void 0:c.source)!==Bhe)){try{const f=Dq.readParams(c.url,t.response_mode).get("state");if(f||e.warn("no state found in response url"),a.source!==this._window&&f!==t.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",s,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",s,!1)),this._disposeHandlers.add(this._abort.addHandler(a=>{this._dispose(),o(a)}))});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:Bhe,url:e,keepOpen:n},r)}},KMe={location:!1,toolbar:!1,height:640},ZMe="_blank",_mt=60,Smt=2,JMe=10,Cmt=class extends XMe{constructor(t){const{popup_redirect_uri:e=t.redirect_uri,popup_post_logout_redirect_uri:n=t.post_logout_redirect_uri,popupWindowFeatures:r=KMe,popupWindowTarget:i=ZMe,redirectMethod:o="assign",redirectTarget:s="self",iframeNotifyParentOrigin:a=t.iframeNotifyParentOrigin,iframeScriptOrigin:l=t.iframeScriptOrigin,silent_redirect_uri:c=t.redirect_uri,silentRequestTimeoutInSeconds:u=JMe,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:g=!1,checkSessionIntervalInSeconds:m=Smt,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:x=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:w=!1,accessTokenExpiringNotificationTimeInSeconds:_=_mt,userStore:S}=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=s,this.iframeNotifyParentOrigin=a,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=g,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=y,this.query_status_response_type=v,this.revokeTokenTypes=x,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=w,this.accessTokenExpiringNotificationTimeInSeconds=_,S)this.userStore=S;else{const O=typeof window<"u"?window.sessionStorage:new HMe;this.userStore=new qMe({store:O})}}},Iq=class extends QMe{constructor({silentRequestTimeoutInSeconds:t=JMe}){super(),this._logger=new on("IFrameWindow"),this._timeoutInSeconds=t,this._frame=Iq.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 Dte("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)}},Omt=class{constructor(t){this._settings=t,this._logger=new on("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:t=this._settings.silentRequestTimeoutInSeconds}){return new Iq({silentRequestTimeoutInSeconds:t})}async callback(t){this._logger.create("callback"),Iq.notifyParent(t,this._settings.iframeNotifyParentOrigin)}},Emt=500,Uhe=class extends QMe{constructor({popupWindowTarget:t=ZMe,popupWindowFeatures:e={}}){super(),this._logger=new on("PopupWindow");const n=jhe.center({...KMe,...e});this._window=window.open(void 0,t,jhe.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"))},Emt);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)}},Tmt=class{constructor(t){this._settings=t,this._logger=new on("PopupNavigator")}async prepare({popupWindowFeatures:t=this._settings.popupWindowFeatures,popupWindowTarget:e=this._settings.popupWindowTarget}){return new Uhe({popupWindowFeatures:t,popupWindowTarget:e})}async callback(t,e=!1){this._logger.create("callback"),Uhe.notifyOpener(t,e)}},kmt=class{constructor(t){this._settings=t,this._logger=new on("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 s=>{this._logger.create("navigate");const a=new Promise((l,c)=>{o=c});return i(s.url),await a},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),r.stop()}}}},Amt=class extends nmt{constructor(t){super({expiringNotificationTimeInSeconds:t.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new on("UserManagerEvents"),this._userLoaded=new Vm("User loaded"),this._userUnloaded=new Vm("User unloaded"),this._silentRenewError=new Vm("Silent renew error"),this._userSignedIn=new Vm("User signed in"),this._userSignedOut=new Vm("User signed out"),this._userSessionChanged=new Vm("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()}},Pmt=class{constructor(t){this._userManager=t,this._logger=new on("SilentRenewService"),this._isStarted=!1,this._retryTimer=new du("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 Dte){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)}},Mmt=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}},Rmt=class{constructor(t){this._logger=new on("UserManager"),this.settings=new Cmt(t),this._client=new bmt(t),this._redirectNavigator=new kmt(this.settings),this._popupNavigator=new Tmt(this.settings),this._iframeNavigator=new Omt(this.settings),this._events=new Amt(this.settings),this._silentRenewService=new Pmt(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new wmt(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 s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),a=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},s);return a&&(a.profile&&a.profile.sub?e.info("success, signed in subject",a.profile.sub):e.info("no subject")),a}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 Mmt(o);return await this._useRefreshToken(c)}const s=this.settings.silent_redirect_uri;s||n.throw(new Error("No silent_redirect_uri configured"));let a;o&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",o.profile.sub),a=o.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return o=await this._signin({request_type:"si:s",redirect_uri:s,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,...i},l,a),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 u3({...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(),s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=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},s);try{const l=await this._client.processSigninResponse(a.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 ub)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 u3(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 ub({...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,s=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},s),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 s=await this._client.createSignoutRequest(t);return r.debug("got signout request"),await e.navigate({url:s.url,state:(n=s.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,s=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:s,id_token_hint:o,...i},a),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"),u3.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()}},$te=he.createContext(void 0);$te.displayName="AuthContext";var Dmt={isLoading:!0,isAuthenticated:!1},Imt=(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}`)}}},Lmt=(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")))},$mt=t=>e=>e instanceof Error?e:new Error(t),Fmt=$mt("Login failed"),Nmt=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],zmt=["signinPopup","signinSilent","signinRedirect","signoutPopup","signoutRedirect","signoutSilent"],dW=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.`)},jmt=typeof window>"u"?null:Rmt,Bmt=t=>{const{children:e,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:s,implementation:a=jmt,userManager:l,...c}=t,[u]=D.useState(()=>l??(a?new a(c):{settings:c})),[f,d]=D.useReducer(Imt,Dmt),h=D.useMemo(()=>Object.assign({settings:u.settings,events:u.events},Object.fromEntries(Nmt.map(x=>{var b,w;return[x,(w=(b=u[x])==null?void 0:b.bind(u))!=null?w:dW(x)]})),Object.fromEntries(zmt.map(x=>[x,u[x]?async(...b)=>{d({type:"NAVIGATOR_INIT",method:x});try{return await u[x](...b)}finally{d({type:"NAVIGATOR_CLOSE"})}}:dW(x)]))),[u]),p=D.useRef(!1);D.useEffect(()=>{!u||p.current||(p.current=!0,(async()=>{let x=null;try{Lmt()&&!r&&(x=await u.signinCallback(),n&&n(x)),x=x||await u.getUser(),d({type:"INITIALISED",user:x})}catch(b){d({type:"ERROR",error:Fmt(b)})}})())},[u,r,n]),D.useEffect(()=>{if(!u)return;const x=_=>{d({type:"USER_LOADED",user:_})};u.events.addUserLoaded(x);const b=()=>{d({type:"USER_UNLOADED"})};u.events.addUserUnloaded(b);const w=_=>{d({type:"ERROR",error:_})};return u.events.addSilentRenewError(w),()=>{u.events.removeUserLoaded(x),u.events.removeUserUnloaded(b),u.events.removeSilentRenewError(w)}},[u]);const g=D.useCallback(u?()=>u.removeUser().then(i):dW("removeUser"),[u,i]),m=D.useCallback(x=>h.signoutRedirect(x).then(o),[h.signoutRedirect,o]),v=D.useCallback(x=>h.signoutPopup(x).then(s),[h.signoutPopup,s]),y=D.useCallback(x=>h.signoutSilent(x),[h.signoutSilent]);return he.createElement($te.Provider,{value:{...f,...h,removeUser:g,signoutRedirect:m,signoutPopup:v,signoutSilent:y}},e)},Umt=()=>{const t=he.useContext($te);if(!t)throw new Error("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component.");return t};class eRe extends D.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?C.jsxs("div",{children:[C.jsx("h2",{className:"errorBoundary-header",children:pe.get("Something went wrong.")}),C.jsxs("details",{className:"errorBoundary-details",style:{whiteSpace:"pre-wrap"},children:[this.state.error.toString(),C.jsx("br",{})]})]}):this.props.children}}const Wmt=({children:t})=>{const e=Pn.instance.authClient;if(!e)return C.jsx(C.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=nO.href;return C.jsx(eRe,{children:C.jsx(Bmt,{...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})})},tRe=lt(C.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"),nRe=lt(C.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"),rRe=lt(C.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"),iRe=lt(C.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"}),"Share"),Vmt=lt([C.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.07s5.12-1.95 7.07 0c1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),C.jsx("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy"),oRe=lt(C.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");class sRe extends Error{constructor(n,r){super(r);gn(this,"statusCode");this.statusCode=n}}function jy(t){return t?{headers:[["Authorization",`Bearer ${t}`]]}:{}}function By(t,e){if(e.length>0){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 aRe(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(pe.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 sRe(n.status,r)}async function nd(t,e,n){let r;Sdt(e)?n=e:r=e;const o=await(await aRe(t,r)).json();return n?n(o):o}const Gmt=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Hmt=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 s=Number.parseInt(r[o]);if(s<0||s>255)return;i[o]=s}if(r.length===4){if(e=Whe(r[3]),e===void 0)return;i[3]=e}return i}if(r.length!==2||(t=r[0],e=Whe(r[1]),e===void 0))return}const n=(t.startsWith("#")?cRe:Xmt)(t);if(n){if(n.length===3)return[...n,e===void 0?255:e];if(n.length===4&&e===void 0)return n}};function lRe(t){return"#"+t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function cRe(t){if(Gmt.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 Whe=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)},qmt=t=>Ymt[t.toLowerCase()],Xmt=t=>{const e=qmt(t);if(e)return cRe(e)},Ymt={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 Qmt(t){return nd(`${t}/colorbars`,Kmt)}function Kmt(t){const e=[],n={},r={};return t.forEach(i=>{const[o,s,a]=i,l=[];a.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(Zmt)}}else if(c.length===2){const[u,f]=c;l.push(u),n[u]=f}}),e.push({title:o,description:s,names:l})}),{groups:e,images:n,customColorMaps:r}}function Zmt(t){const e=Jmt(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 Jmt(t){return t?n1(t)?t:lRe(t):"#000000"}function evt(t,e){const n=By(`${t}/datasets`,[["details","1"]]),r=jy(e);return nd(n,r,tvt)}function tvt(t){return(t.datasets||[]).map(nvt)}function nvt(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,s=o.map(a=>new Date(a).getTime());return e=[...e],e[n]={...r,coordinates:s,labels:o},{...t,dimensions:e}}}}return t}function rvt(t,e,n,r){const i=jy(r),o=encodeURIComponent(e),s=encodeURIComponent(n);return nd(`${t}/datasets/${o}/places/${s}`,i)}function ivt(t){return nd(`${t}/expressions/capabilities`)}function ovt(t){return nd(`${t}/`)}function jM(t){return n1(t.expression)}function cO(t){return encodeURIComponent(n1(t)?t:t.id)}function BM(t){return encodeURIComponent(n1(t)?t:jM(t)?`${t.name}=${t.expression}`:t.name)}function svt(t,e,n,r,i,o,s,a,l,c){let u,f=null;const d=[];a?(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]),s&&d.push(["endDate",s]);const h=By(`${t}/timeseries/${cO(e)}/${BM(n)}`,d),p={...jy(c),method:"post",body:JSON.stringify(i)};return nd(h,p,m=>{const v=m.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 avt(t,e,n,r,i,o){const s=i!==null?[["time",i]]:[],a=By(`${t}/statistics/${cO(e)}/${BM(n)}`,s),l={...jy(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:e,variable:n,placeInfo:r,time:i};return nd(a,l,u=>({source:c,statistics:u.result}))}function lvt(t,e,n,r,i,o,s){const a=[["lon",r.toString()],["lat",i.toString()]];o&&a.push(["time",o]);const l=By(`${t}/statistics/${cO(e)}/${BM(n)}`,a);return nd(l,jy(s),c=>c.result?c.result:{})}function cvt(t,e){const n=By(`${t}/maintenance/update`,[]),r=jy(e);try{return nd(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}function uvt(t,e,n){const r=By(`${t}/viewer/state`,[["key",n]]);return nd(r,jy(e)).then(i=>i).catch(i=>`${i}`)}function fvt(t,e,n){const r=By(`${t}/viewer/state`,[]),i={...jy(e),method:"PUT",body:JSON.stringify(n)};try{return nd(r,i).then(o=>o.key).catch(o=>{console.error(o)})}catch(o){return console.error(o),Promise.resolve(void 0)}}class JF extends Error{}function dvt(t,e){if(t===null)throw new JF(`assertion failed: ${e} must not be null`)}function hvt(t,e){if(typeof t>"u")throw new JF(`assertion failed: ${e} must not be undefined`)}function pvt(t,e){dvt(t,e),hvt(t,e)}function hW(t,e){if(Array.isArray(t)){if(t.length===0)throw new JF(`assertion failed: ${e} must be a non-empty array`)}else throw new JF(`assertion failed: ${e} must be an array`)}function hA(t,e){return e&&t.find(n=>n.id===e)||null}function Lq(t,e){return e&&t.variables.find(n=>n.name===e)||null}function gvt(t){return t.variables.findIndex(e=>n1(e.expression))}function Fte(t){const e=gvt(t);return e>=0?[t.variables.slice(0,e),t.variables.slice(e)]:[t.variables,[]]}function uRe(t){pvt(t,"dataset"),hW(t.dimensions,"dataset.dimensions");const e=t.dimensions.find(n=>n.name==="time");return e?(hW(e.coordinates,"timeDimension.coordinates"),hW(e.labels,"timeDimension.labels"),e):null}function fRe(t){const e=uRe(t);if(!e)return null;const n=e.coordinates;return[n[0],n[n.length-1]]}const dRe="User",hRe=`0.0: #23FF52 +`).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 s=!1;const a=[];let l=0,c=0;for(;c-1){var c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return QF}function i(a,l){r(a)===QF&&(n.unshift({key:a,value:l}),n.length>t&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var Npt=function(e,n){return e===n};function zpt(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]!==a&&(o=[a,...o])}n.properties&&(s=Lhe(n.properties,o)),s===void 0&&(s=Lhe(n,o)),t[r]=s||i}function fgt(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 Lhe(t,e){let n;for(const r of e)if(r in t)return t[r];return n}function zM(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 Mte(t,e){t.forEach(n=>{oO(n)&&n.features.forEach(r=>{e(n,r)})})}function dgt(t,e){const n=n1(e)?(r,i)=>i.id===e:e;for(const r of t)if(oO(r)){const i=r.features.find(o=>n(r,o));if(i)return M4(r,i)}return null}function hgt(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=IMe(r[i],e);if(o)return o}return null}function Rte(t,e){if(e)for(const n of t){const r=IMe(n,e);if(r!==null)return r}return null}const pgt=["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"].map(t=>t.toLowerCase());function $he(t){if(t=t.trim(),t==="")return"csv";if(t[0]==="{")return"geojson";const e=t.substring(0,20).toLowerCase();return pgt.find(r=>e.startsWith(r)&&(e.length===r.length||` + (`.indexOf(e[r.length])>=0))?"wkt":"csv"}function c3(t){return t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e!=="")}const ggt=t=>{if(t.trim()!=="")try{RMe(t)}catch(e){return console.error(e),`${e}`}return null},LMe={name:"Text/CSV",fileExt:".txt,.csv",checkError:ggt},kq={...MMe,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 mgt=0,vgt=0;function ygt(t,e){const n=RMe(t,e);if(n.length<2)throw new Error(pe.get("Missing header line in CSV"));for(const _ of n[0])if(typeof _!="string"||_==="")throw new Error(pe.get("Invalid header line in CSV"));const r=n[0].map(_=>_),i=r.map(_=>_.toLowerCase()),o=r.length;for(const _ of n)if(_.length!==o)throw new Error(pe.get("All rows must have same length"));const s=xgt(i),a=G1(s,e.groupNames),l=G1(s,e.labelNames),c=G1(s,e.timeNames),u=G1(s,e.xNames),f=G1(s,e.yNames);let d=G1(s,e.geometryNames);if(e.forceGeometry||u<0||f<0||u===f){if(d<0)throw new Error(pe.get("No geometry column(s) found"))}else d=-1;let p=e.groupPrefix.trim();p===""&&(p=kq.groupPrefix);let g=e.labelPrefix.trim();g===""&&(g=kq.labelPrefix);let m="";if(a===-1){const _=++mgt;m=`${p}${_}`}const v=new TMe,y={};let x=1,b=0,w=ab(0);for(;x=0&&(S=`${_[c]}`),a>=0&&(m=`${_[a]}`);let O=y[m];O||(O=Ate(m,[]),y[m]=O,w=ab(b),b++);let k=null;if(d>=0){if(typeof _[d]=="string")try{k=v.readGeometry(t)}catch{}}else{const A=_[u],R=_[f];typeof A=="number"&&Number.isFinite(A)&&typeof R=="number"&&Number.isFinite(R)&&(k=new hh([A,R]))}if(k===null)throw new Error(pe.get(`Invalid geometry in data row ${x}`));const E={};_.forEach((A,R)=>{if(R!==u&&R!==f&&R!==d){const T=r[R];E[T]=A}});let P;if(l>=0)P=`${_[l]}`;else{const A=++vgt;P=`${g}${A}`}S!==""&&(E.time=S),E.color||(E.color=w),E.label||(E.label=P),E.source||(E.source="CSV"),O.features.push(Pte(k,E))}return Object.getOwnPropertyNames(y).map(_=>y[_])}function xgt(t){const e={};for(let n=0;n{if(t.trim()!=="")try{JSON.parse(t)}catch(e){return console.error(e),`${e}`}return null},$Me={name:"GeoJSON",fileExt:".json,.geojson",checkError:bgt},Aq={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let wgt=0,_gt=0;function Sgt(t,e){const n=c3(e.groupNames||"");let r=e.groupPrefix.trim();r===""&&(r=Aq.groupPrefix);const i=c3(e.labelNames||"");let o=e.labelPrefix.trim();o===""&&(o=Aq.labelPrefix);const s=c3(e.timeNames||""),a=new s1;let l;try{l=a.readFeatures(t)}catch{try{const d=a.readGeometry(t);l=[new Wp(d)]}catch{throw new Error(pe.get("Invalid GeoJSON"))}}const c={};let u=0;return l.forEach(f=>{const d=f.getProperties(),h=f.getGeometry();if(h){let p="",g="",m="",v=ab(0);if(d){const b={};Object.getOwnPropertyNames(d).forEach(w=>{b[w.toLowerCase()]=d[w]}),p=cW(b,s,p),m=cW(b,i,m),g=cW(b,n,g)}if(g===""){const b=++wgt;g=`${r}-${b}`}if(m===""){const b=++_gt;m=`${o}-${b}`}let y=c[g];y||(y=Ate(g,[]),c[g]=y,v=ab(u),u++);const x={...d};p!==""&&(x.time=p),x.color||(x.color=v),x.label||(x.label=m),x.source||(x.source="GeoJSON"),y.features.push(Pte(h,x))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function cW(t,e,n){if(n===""){for(const r of e)if(t[r]==="string")return t[r]}return n}function FMe(t){return t.getTimezoneOffset()*6e4}function Cgt(t){return t.getTime()-FMe(t)}function uW(t){const e=new Date(t);return new Date(e.getTime()+FMe(e))}function fA(t){return new Date(t).toISOString().substring(0,10)}function sO(t){return NMe(new Date(t).toISOString())}function NMe(t){return t.substring(0,19).replace("T"," ")}const Ogt=t=>null,zMe={name:"WKT",fileExt:".txt,.wkt",checkError:Ogt},Pq={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:sO(new Date().getTime())};let Egt=0,Tgt=0;function kgt(t,e){let n=e.groupPrefix.trim();n===""&&(n=Pq.groupPrefix);let r=e.group.trim();if(r===""){const a=++Egt;r=`${n}${a}`}let i=e.labelPrefix.trim();i===""&&(i=Pq.labelPrefix);let o=e.label.trim();if(o===""){const a=++Tgt;o=`${i}${a}`}const s=e.time.trim();try{const a=new TMe().readGeometry(t);let l={color:ab(Math.floor(1e3*Math.random())),label:o,source:"WKT"};s!==""&&(l={time:s,...l});const c=[Pte(a,l)];return[Ate(r,c)]}catch{throw new Error(pe.get("Invalid Geometry WKT"))}}function aO(t){return Agt("localStorage",t)}function Agt(t,e){try{const n=window[t],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new Pgt(n,e)}catch{return null}}class Pgt{constructor(e,n){gn(this,"nativeStorage");gn(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 s=r?r(o):o;return i?i(s):s}catch(s){console.error(`Failed parsing user setting "${e}": ${s}`)}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 s=JSON.parse(o);if(Array.isArray(s))return s;const a=r[e];return Array.isArray(a)?a:[]},i)}getObjectProperty(e,n,r){this.getProperty(e,n,r,i=>{const o=JSON.parse(i),s=r[e],a={...s,...o};return Object.getOwnPropertyNames(o).forEach(l=>{const c=s[l],u=o[l];vhe(c)&&vhe(u)&&(a[l]={...c,...u})}),a})}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 Mgt(t){const e=aO(Pn.instance.name);if(e)try{e.setObjectItem("userServers",t)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function Rgt(){const t=aO(Pn.instance.name);if(t)try{return t.getObjectItem("userServers",[])}catch(e){console.warn(`failed to load user servers: ${e}`)}return[]}function Dgt(t){const e=aO(Pn.instance.name);if(e)try{e.setObjectItem("userVariables",t)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function Igt(){const t=aO(Pn.instance.name);if(t)try{return t.getObjectItem("userVariables",{})}catch(e){console.warn(`failed to load user variables: ${e}`)}return{}}function vd(t){const e=aO(Pn.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),e.setPrimitiveProperty("themeMode",t)}catch(n){console.warn(`failed to store user settings: ${n}`)}}function Lgt(t){const e=aO(Pn.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,$gt),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),e.getStringProperty("themeMode",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 Fhe={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function $gt(t){if(Array.isArray(t))return t.map(e=>({...e,type:Fgt(e.type)}))}function Fgt(t){return n1(t)&&t in Fhe?Fhe[t]:"continuous"}const Ngt=[250,500,1e3,2500],zgt=["info","timeSeries","stats","volume"],jMe=["light","dark","system"],jgt=[["light","Light"],["dark","Dark"],["system","System"]];function Bgt(){const t=Pn.instance.branding,e={selectedDatasetId:null,selectedVariableName:null,selectedDataset2Id:null,selectedVariable2Name:null,selectedPlaceGroupIds:[],selectedPlaceId:null,selectedUserPlaceId:null,selectedServerId:Pn.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:{...kq},geojson:{...Aq},wkt:{...Pq}},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||GPe,imageSmoothingEnabled:!1,selectedBaseMapId:Mdt,selectedOverlayId:null,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export",themeMode:Ugt()};return Lgt(e)}function Ugt(){const t=Pn.instance.branding.themeMode;return t&&jMe.includes(t)?t:"system"}function BMe(t,e){return e||(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t&&jMe.includes(t)&&t!=="system"?t:e}const Hs={};function K2(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 UMe={exports:{}};const Wgt={},Vgt=Object.freeze(Object.defineProperty({__proto__:null,default:Wgt},Symbol.toStringTag,{value:"Module"})),Ggt=y2e(Vgt);(function(t,e){(function(n,r){t.exports=r()})(ri,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 ri<"u"&&ri.crypto&&(o=ri.crypto),!o&&typeof K2=="function")try{o=Ggt}catch{}var s=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.")},a=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=a(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,w=this.sigBytes,_=y.sigBytes;if(this.clamp(),w%4)for(var S=0;S<_;S++){var O=b[S>>>2]>>>24-S%4*8&255;x[w+S>>>2]|=O<<24-(w+S)%4*8}else for(var k=0;k<_;k+=4)x[w+k>>>2]=b[k>>>2];return this.sigBytes+=_,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-_%4*8&255;w.push((S>>>4).toString(16)),w.push((S&15).toString(16))}return w.join("")},parse:function(y){for(var x=y.length,b=[],w=0;w>>3]|=parseInt(y.substr(w,2),16)<<24-w%8*4;return new f.init(b,x/2)}},p=d.Latin1={stringify:function(y){for(var x=y.words,b=y.sigBytes,w=[],_=0;_>>2]>>>24-_%4*8&255;w.push(String.fromCharCode(S))}return w.join("")},parse:function(y){for(var x=y.length,b=[],w=0;w>>2]|=(y.charCodeAt(w)&255)<<24-w%4*8;return new f.init(b,x)}},g=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)))}},m=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var x,b=this._data,w=b.words,_=b.sigBytes,S=this.blockSize,O=S*4,k=_/O;y?k=r.ceil(k):k=r.max((k|0)-this._minBufferSize,0);var E=k*S,P=r.min(E*4,_);if(E){for(var A=0;A>>7)^(k<<14|k>>>18)^k>>>3,P=f[O-2],A=(P<<15|P>>>17)^(P<<13|P>>>19)^P>>>10;f[O]=E+f[O-7]+A+f[O-16]}var R=b&w^~b&_,T=m&v^m&y^v&y,M=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),I=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),z=S+I+R+u[O]+f[O],F=M+T;S=_,_=w,w=b,b=x+z|0,x=y,y=v,v=m,m=z+F|0}g[0]=g[0]+m|0,g[1]=g[1]+v|0,g[2]=g[2]+y|0,g[3]=g[3]+x|0,g[4]=g[4]+b|0,g[5]=g[5]+w|0,g[6]=g[6]+_|0,g[7]=g[7]+S|0},_doFinalize:function(){var h=this._data,p=h.words,g=this._nDataBytes*8,m=h.sigBytes*8;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=r.floor(g/4294967296),p[(m+64>>>9<<4)+15]=g,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=a._createHelper(d),i.HmacSHA256=a._createHmacHelper(d)}(Math),n.SHA256})})(WMe);var qgt=WMe.exports;const Xgt=sn(qgt);var VMe={exports:{}};(function(t,e){(function(n,r){t.exports=r(R4)})(ri,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,s=r.enc;s.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,g=c[h+1>>>2]>>>24-(h+1)%4*8&255,m=c[h+2>>>2]>>>24-(h+2)%4*8&255,v=p<<16|g<<8|m,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,m=p|g;f[d>>>2]|=m<<24-d%4*8,d++}return o.create(f,d)}}(),n.enc.Base64})})(VMe);var Ygt=VMe.exports;const Nhe=sn(Ygt);var GMe={exports:{}};(function(t,e){(function(n,r){t.exports=r(R4)})(ri,function(n){return n.enc.Utf8})})(GMe);var Qgt=GMe.exports;const Kgt=sn(Qgt);function Mq(t){this.message=t}Mq.prototype=new Error,Mq.prototype.name="InvalidCharacterError";var zhe=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Mq("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,s="";r=e.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?s+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};function Zgt(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(zhe(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 zhe(e)}}function KF(t){this.message=t}function Jgt(t,e){if(typeof t!="string")throw new KF("Invalid token specified");var n=(e=e||{}).header===!0?0:1;try{return JSON.parse(Zgt(t.split(".")[n]))}catch(r){throw new KF("Invalid token specified: "+r.message)}}KF.prototype=new Error,KF.prototype.name="InvalidTokenError";var emt={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Ed,Td,ZF=(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))(ZF||{});(t=>{function e(){Ed=3,Td=emt}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");Ed=i}t.setLevel=n;function r(i){Td=i}t.setLogger=r})(ZF||(ZF={}));var on=class{constructor(t){this._name=t}debug(...t){Ed>=4&&Td.debug(on._format(this._name,this._method),...t)}info(...t){Ed>=3&&Td.info(on._format(this._name,this._method),...t)}warn(...t){Ed>=2&&Td.warn(on._format(this._name,this._method),...t)}error(...t){Ed>=1&&Td.error(on._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 on(`${t}.${e}`);return n.debug("begin"),n}static _format(t,e){const n=`[${t}]`;return e?`${n} ${e}:`:n}static debug(t,...e){Ed>=4&&Td.debug(on._format(t),...e)}static info(t,...e){Ed>=3&&Td.info(on._format(t),...e)}static warn(t,...e){Ed>=2&&Td.warn(on._format(t),...e)}static error(t,...e){Ed>=1&&Td.error(on._format(t),...e)}};ZF.reset();var tmt="10000000-1000-4000-8000-100000000000",Qd=class{static _randomWord(){return Hgt.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return tmt.replace(/[018]/g,e=>(+e^Qd._randomWord()&15>>+e/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Qd.generateUUIDv4()+Qd.generateUUIDv4()+Qd.generateUUIDv4()}static generateCodeChallenge(t){try{const e=Xgt(t);return Nhe.stringify(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw on.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(t,e){const n=Kgt.parse([t,e].join(":"));return Nhe.stringify(n)}},Vm=class{constructor(e){this._name=e,this._logger=new on(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const n=this._callbacks.lastIndexOf(e);n>=0&&this._callbacks.splice(n,1)}raise(...e){this._logger.debug("raise:",...e);for(const n of this._callbacks)n(...e)}},Rq=class{static decode(t){try{return Jgt(t)}catch(e){throw on.error("JwtUtils.decode",e),e}}},jhe=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(",")}},du=class extends Vm{constructor(){super(...arguments),this._logger=new on(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-du.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=du.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const n=this._logger.create("init");e=Math.max(Math.floor(e),1);const r=du.getEpochTime()+e;if(this.expiration===r&&this._timerHandle){n.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),n.debug("using duration",e),this._expiration=r;const i=Math.min(e,5);this._timerHandle=setInterval(this._callback,i*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},Dq=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))}},ub=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 on.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}},Dte=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},nmt=class{constructor(t){this._logger=new on("AccessTokenEvents"),this._expiringTimer=new du("Access token expiring"),this._expiredTimer=new du("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)}},rmt=class{constructor(t,e,n,r,i){this._callback=t,this._client_id=e,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new on("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=s=>{s.origin===this._frame_origin&&s.source===this._frame.contentWindow&&(s.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):s.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(s.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)}},HMe=class{constructor(){this._logger=new on("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]}},Ite=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new on("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(s){throw s instanceof DOMException&&s.name==="AbortError"?new Dte("Network timed out"):s}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 s=o.headers.get("Content-Type");if(s&&!this._contentTypes.find(l=>s.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${t}`)),o.ok&&this._jwtHandler&&(s!=null&&s.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let a;try{a=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:",a),a.error?new ub(a):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(a)}`);return a}async postForm(t,{body:e,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(s.Authorization="Basic "+n),this.appendExtraHeaders(s);let a;try{o.debug("url:",t),a=await this.fetchWithTimeout(t,{method:"POST",headers:s,body:e,timeoutInSeconds:r,credentials:i})}catch(f){throw o.error("Network error"),f}o.debug("HTTP response received, status",a.status);const l=a.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 a.text();let u={};if(c)try{u=JSON.parse(c)}catch(f){throw o.error("Error parsing JSON response",f),a.ok?f:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw o.error("Error from server:",u),u.error?new ub(u,e):new Error(`${a.statusText} (${a.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)})}},imt=class{constructor(t){this._settings=t,this._logger=new on("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new Ite(["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}},qMe=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new on("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=Rq.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new Ite(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}},YMe=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new on("TokenClient"),this._jsonService=new Ite(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 s=new URLSearchParams({grant_type:t,redirect_uri:e});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;a=Qd.generateBasicAuth(n,r);break;case"client_secret_post":s.append("client_id",n),r&&s.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:s,basicAuth:a,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 s=new URLSearchParams({grant_type:t,scope:r});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Qd.generateBasicAuth(e,n);break;case"client_secret_post":s.append("client_id",e),n&&s.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:s,basicAuth:a,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 s=new URLSearchParams({grant_type:t});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Qd.generateBasicAuth(e,n);break;case"client_secret_post":s.append("client_id",e),n&&s.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:s,basicAuth:a,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,s]of Object.entries(t))s!=null&&i.set(o,s);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")}},dmt=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new on("ResponseValidator"),this._userInfoService=new fmt(this._settings,this._metadataService),this._tokenClient=new YMe(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 ub(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 ub(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=Rq.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const o=Rq.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}},MS=class{constructor(t){this.id=t.id||Qd.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=du.getEpochTime(),this.request_type=t.request_type}toStorageString(){return new on("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(t){return on.createStatic("State","fromStorageString"),new MS(JSON.parse(t))}static async clearStaleState(t,e){const n=on.createStatic("State","clearStaleState"),r=du.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:a,...m,...h}))x!=null&&v.searchParams.append(y,x.toString());this.url=v.href}},pmt="openid",fW=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-du.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+du.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(pmt))||!!this.id_token}},gmt=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 on("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const s=new URL(t);n&&s.searchParams.append("id_token_hint",n),r&&(s.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new MS({data:e,request_type:o}),s.searchParams.append("state",this.state.id)));for(const[a,l]of Object.entries({...i}))l!=null&&s.searchParams.append(a,l.toString());this.url=s.href}},mmt=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")}},vmt=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],ymt=["sub","iss","aud","exp","iat"],xmt=class{constructor(t){this._settings=t,this._logger=new on("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=vmt;for(const r of n)ymt.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 s=n[r];s?Array.isArray(s)?s.includes(o)||s.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(s,o):n[r]=[s,o]):n[r]=o}return n}},bmt=class{constructor(t){this._logger=new on("OidcClient"),this.settings=new XMe(t),this.metadataService=new imt(this.settings),this._claimsService=new xmt(this.settings),this._validator=new dmt(this.settings,this.metadataService,this._claimsService),this._tokenClient=new YMe(this.settings,this.metadataService)}async createSigninRequest({state:t,request:e,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:s,nonce:a,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:g=this.settings.acr_values,resource:m=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 w=await this.metadataService.getAuthorizationEndpoint();b.debug("Received authorization endpoint",w);const _=new hmt({url:w,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:g,resource:m,request:e,request_uri:n,extraQueryParams:y,extraTokenParams:x,request_type:r,response_mode:v,client_secret:this.settings.client_secret,skipUserInfo:s,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const S=_.state;return await this.settings.stateStore.set(S.id,S.toStorageString()),_}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new fW(Dq.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:Lte.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 fW(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 a=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=t.scope)==null?void 0:n.split(" "))||[]).filter(c=>a.includes(c)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,scope:i,timeoutInSeconds:e}),s=new fW(new URLSearchParams);return Object.assign(s,o),r.debug("validating response",s),await this._validator.validateRefreshResponse(s,{...t,scope:i}),s}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"),s=await this.metadataService.getEndSessionEndpoint();if(!s)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",s);const a=new gmt({url:s,id_token_hint:e,post_logout_redirect_uri:r,state_data:t,extraQueryParams:i,request_type:n});await this.clearStaleState();const l=a.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),a}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new mmt(Dq.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 ub(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:MS.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"),MS.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})}},wmt=class{constructor(t){this._userManager=t,this._logger=new on("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,s=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,l=new rmt(this._callback,o,i,s,a);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)}}}},u3=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-du.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+du.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 on("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 on.createStatic("User","fromStorageString"),new u3(JSON.parse(t))}},Bhe="oidc-client",QMe=class{constructor(){this._abort=new Vm("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 s=a=>{var l;const c=a.data,u=(l=t.scriptOrigin)!=null?l:window.location.origin;if(!(a.origin!==u||(c==null?void 0:c.source)!==Bhe)){try{const f=Dq.readParams(c.url,t.response_mode).get("state");if(f||e.warn("no state found in response url"),a.source!==this._window&&f!==t.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",s,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",s,!1)),this._disposeHandlers.add(this._abort.addHandler(a=>{this._dispose(),o(a)}))});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:Bhe,url:e,keepOpen:n},r)}},KMe={location:!1,toolbar:!1,height:640},ZMe="_blank",_mt=60,Smt=2,JMe=10,Cmt=class extends XMe{constructor(t){const{popup_redirect_uri:e=t.redirect_uri,popup_post_logout_redirect_uri:n=t.post_logout_redirect_uri,popupWindowFeatures:r=KMe,popupWindowTarget:i=ZMe,redirectMethod:o="assign",redirectTarget:s="self",iframeNotifyParentOrigin:a=t.iframeNotifyParentOrigin,iframeScriptOrigin:l=t.iframeScriptOrigin,silent_redirect_uri:c=t.redirect_uri,silentRequestTimeoutInSeconds:u=JMe,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:g=!1,checkSessionIntervalInSeconds:m=Smt,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:x=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:w=!1,accessTokenExpiringNotificationTimeInSeconds:_=_mt,userStore:S}=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=s,this.iframeNotifyParentOrigin=a,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=g,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=y,this.query_status_response_type=v,this.revokeTokenTypes=x,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=w,this.accessTokenExpiringNotificationTimeInSeconds=_,S)this.userStore=S;else{const O=typeof window<"u"?window.sessionStorage:new HMe;this.userStore=new qMe({store:O})}}},Iq=class extends QMe{constructor({silentRequestTimeoutInSeconds:t=JMe}){super(),this._logger=new on("IFrameWindow"),this._timeoutInSeconds=t,this._frame=Iq.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 Dte("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)}},Omt=class{constructor(t){this._settings=t,this._logger=new on("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:t=this._settings.silentRequestTimeoutInSeconds}){return new Iq({silentRequestTimeoutInSeconds:t})}async callback(t){this._logger.create("callback"),Iq.notifyParent(t,this._settings.iframeNotifyParentOrigin)}},Emt=500,Uhe=class extends QMe{constructor({popupWindowTarget:t=ZMe,popupWindowFeatures:e={}}){super(),this._logger=new on("PopupWindow");const n=jhe.center({...KMe,...e});this._window=window.open(void 0,t,jhe.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"))},Emt);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)}},Tmt=class{constructor(t){this._settings=t,this._logger=new on("PopupNavigator")}async prepare({popupWindowFeatures:t=this._settings.popupWindowFeatures,popupWindowTarget:e=this._settings.popupWindowTarget}){return new Uhe({popupWindowFeatures:t,popupWindowTarget:e})}async callback(t,e=!1){this._logger.create("callback"),Uhe.notifyOpener(t,e)}},kmt=class{constructor(t){this._settings=t,this._logger=new on("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 s=>{this._logger.create("navigate");const a=new Promise((l,c)=>{o=c});return i(s.url),await a},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),r.stop()}}}},Amt=class extends nmt{constructor(t){super({expiringNotificationTimeInSeconds:t.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new on("UserManagerEvents"),this._userLoaded=new Vm("User loaded"),this._userUnloaded=new Vm("User unloaded"),this._silentRenewError=new Vm("Silent renew error"),this._userSignedIn=new Vm("User signed in"),this._userSignedOut=new Vm("User signed out"),this._userSessionChanged=new Vm("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()}},Pmt=class{constructor(t){this._userManager=t,this._logger=new on("SilentRenewService"),this._isStarted=!1,this._retryTimer=new du("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 Dte){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)}},Mmt=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}},Rmt=class{constructor(t){this._logger=new on("UserManager"),this.settings=new Cmt(t),this._client=new bmt(t),this._redirectNavigator=new kmt(this.settings),this._popupNavigator=new Tmt(this.settings),this._iframeNavigator=new Omt(this.settings),this._events=new Amt(this.settings),this._silentRenewService=new Pmt(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new wmt(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 s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),a=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},s);return a&&(a.profile&&a.profile.sub?e.info("success, signed in subject",a.profile.sub):e.info("no subject")),a}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 Mmt(o);return await this._useRefreshToken(c)}const s=this.settings.silent_redirect_uri;s||n.throw(new Error("No silent_redirect_uri configured"));let a;o&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",o.profile.sub),a=o.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return o=await this._signin({request_type:"si:s",redirect_uri:s,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,...i},l,a),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 u3({...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(),s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=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},s);try{const l=await this._client.processSigninResponse(a.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 ub)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 u3(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 ub({...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,s=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},s),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 s=await this._client.createSignoutRequest(t);return r.debug("got signout request"),await e.navigate({url:s.url,state:(n=s.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,s=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:s,id_token_hint:o,...i},a),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"),u3.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()}},$te=he.createContext(void 0);$te.displayName="AuthContext";var Dmt={isLoading:!0,isAuthenticated:!1},Imt=(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}`)}}},Lmt=(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")))},$mt=t=>e=>e instanceof Error?e:new Error(t),Fmt=$mt("Login failed"),Nmt=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],zmt=["signinPopup","signinSilent","signinRedirect","signoutPopup","signoutRedirect","signoutSilent"],dW=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.`)},jmt=typeof window>"u"?null:Rmt,Bmt=t=>{const{children:e,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:s,implementation:a=jmt,userManager:l,...c}=t,[u]=D.useState(()=>l??(a?new a(c):{settings:c})),[f,d]=D.useReducer(Imt,Dmt),h=D.useMemo(()=>Object.assign({settings:u.settings,events:u.events},Object.fromEntries(Nmt.map(x=>{var b,w;return[x,(w=(b=u[x])==null?void 0:b.bind(u))!=null?w:dW(x)]})),Object.fromEntries(zmt.map(x=>[x,u[x]?async(...b)=>{d({type:"NAVIGATOR_INIT",method:x});try{return await u[x](...b)}finally{d({type:"NAVIGATOR_CLOSE"})}}:dW(x)]))),[u]),p=D.useRef(!1);D.useEffect(()=>{!u||p.current||(p.current=!0,(async()=>{let x=null;try{Lmt()&&!r&&(x=await u.signinCallback(),n&&n(x)),x=x||await u.getUser(),d({type:"INITIALISED",user:x})}catch(b){d({type:"ERROR",error:Fmt(b)})}})())},[u,r,n]),D.useEffect(()=>{if(!u)return;const x=_=>{d({type:"USER_LOADED",user:_})};u.events.addUserLoaded(x);const b=()=>{d({type:"USER_UNLOADED"})};u.events.addUserUnloaded(b);const w=_=>{d({type:"ERROR",error:_})};return u.events.addSilentRenewError(w),()=>{u.events.removeUserLoaded(x),u.events.removeUserUnloaded(b),u.events.removeSilentRenewError(w)}},[u]);const g=D.useCallback(u?()=>u.removeUser().then(i):dW("removeUser"),[u,i]),m=D.useCallback(x=>h.signoutRedirect(x).then(o),[h.signoutRedirect,o]),v=D.useCallback(x=>h.signoutPopup(x).then(s),[h.signoutPopup,s]),y=D.useCallback(x=>h.signoutSilent(x),[h.signoutSilent]);return he.createElement($te.Provider,{value:{...f,...h,removeUser:g,signoutRedirect:m,signoutPopup:v,signoutSilent:y}},e)},Umt=()=>{const t=he.useContext($te);if(!t)throw new Error("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component.");return t};class eRe extends D.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?C.jsxs("div",{children:[C.jsx("h2",{className:"errorBoundary-header",children:pe.get("Something went wrong.")}),C.jsxs("details",{className:"errorBoundary-details",style:{whiteSpace:"pre-wrap"},children:[this.state.error.toString(),C.jsx("br",{})]})]}):this.props.children}}const Wmt=({children:t})=>{const e=Pn.instance.authClient;if(!e)return C.jsx(C.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=RM.href;return C.jsx(eRe,{children:C.jsx(Bmt,{...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})})},tRe=lt(C.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"),nRe=lt(C.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"),rRe=lt(C.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"),iRe=lt(C.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"}),"Share"),Vmt=lt([C.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.07s5.12-1.95 7.07 0c1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),C.jsx("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy"),oRe=lt(C.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");class sRe extends Error{constructor(n,r){super(r);gn(this,"statusCode");this.statusCode=n}}function jy(t){return t?{headers:[["Authorization",`Bearer ${t}`]]}:{}}function By(t,e){if(e.length>0){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 aRe(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(pe.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 sRe(n.status,r)}async function nd(t,e,n){let r;Sdt(e)?n=e:r=e;const o=await(await aRe(t,r)).json();return n?n(o):o}const Gmt=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Hmt=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 s=Number.parseInt(r[o]);if(s<0||s>255)return;i[o]=s}if(r.length===4){if(e=Whe(r[3]),e===void 0)return;i[3]=e}return i}if(r.length!==2||(t=r[0],e=Whe(r[1]),e===void 0))return}const n=(t.startsWith("#")?cRe:Xmt)(t);if(n){if(n.length===3)return[...n,e===void 0?255:e];if(n.length===4&&e===void 0)return n}};function lRe(t){return"#"+t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function cRe(t){if(Gmt.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 Whe=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)},qmt=t=>Ymt[t.toLowerCase()],Xmt=t=>{const e=qmt(t);if(e)return cRe(e)},Ymt={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 Qmt(t){return nd(`${t}/colorbars`,Kmt)}function Kmt(t){const e=[],n={},r={};return t.forEach(i=>{const[o,s,a]=i,l=[];a.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(Zmt)}}else if(c.length===2){const[u,f]=c;l.push(u),n[u]=f}}),e.push({title:o,description:s,names:l})}),{groups:e,images:n,customColorMaps:r}}function Zmt(t){const e=Jmt(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 Jmt(t){return t?n1(t)?t:lRe(t):"#000000"}function evt(t,e){const n=By(`${t}/datasets`,[["details","1"]]),r=jy(e);return nd(n,r,tvt)}function tvt(t){return(t.datasets||[]).map(nvt)}function nvt(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,s=o.map(a=>new Date(a).getTime());return e=[...e],e[n]={...r,coordinates:s,labels:o},{...t,dimensions:e}}}}return t}function rvt(t,e,n,r){const i=jy(r),o=encodeURIComponent(e),s=encodeURIComponent(n);return nd(`${t}/datasets/${o}/places/${s}`,i)}function ivt(t){return nd(`${t}/expressions/capabilities`)}function ovt(t){return nd(`${t}/`)}function jM(t){return n1(t.expression)}function lO(t){return encodeURIComponent(n1(t)?t:t.id)}function BM(t){return encodeURIComponent(n1(t)?t:jM(t)?`${t.name}=${t.expression}`:t.name)}function svt(t,e,n,r,i,o,s,a,l,c){let u,f=null;const d=[];a?(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]),s&&d.push(["endDate",s]);const h=By(`${t}/timeseries/${lO(e)}/${BM(n)}`,d),p={...jy(c),method:"post",body:JSON.stringify(i)};return nd(h,p,m=>{const v=m.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 avt(t,e,n,r,i,o){const s=i!==null?[["time",i]]:[],a=By(`${t}/statistics/${lO(e)}/${BM(n)}`,s),l={...jy(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:e,variable:n,placeInfo:r,time:i};return nd(a,l,u=>({source:c,statistics:u.result}))}function lvt(t,e,n,r,i,o,s){const a=[["lon",r.toString()],["lat",i.toString()]];o&&a.push(["time",o]);const l=By(`${t}/statistics/${lO(e)}/${BM(n)}`,a);return nd(l,jy(s),c=>c.result?c.result:{})}function cvt(t,e){const n=By(`${t}/maintenance/update`,[]),r=jy(e);try{return nd(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}function uvt(t,e,n){const r=By(`${t}/viewer/state`,[["key",n]]);return nd(r,jy(e)).then(i=>i).catch(i=>`${i}`)}function fvt(t,e,n){const r=By(`${t}/viewer/state`,[]),i={...jy(e),method:"PUT",body:JSON.stringify(n)};try{return nd(r,i).then(o=>o.key).catch(o=>{console.error(o)})}catch(o){return console.error(o),Promise.resolve(void 0)}}class JF extends Error{}function dvt(t,e){if(t===null)throw new JF(`assertion failed: ${e} must not be null`)}function hvt(t,e){if(typeof t>"u")throw new JF(`assertion failed: ${e} must not be undefined`)}function pvt(t,e){dvt(t,e),hvt(t,e)}function hW(t,e){if(Array.isArray(t)){if(t.length===0)throw new JF(`assertion failed: ${e} must be a non-empty array`)}else throw new JF(`assertion failed: ${e} must be an array`)}function dA(t,e){return e&&t.find(n=>n.id===e)||null}function Lq(t,e){return e&&t.variables.find(n=>n.name===e)||null}function gvt(t){return t.variables.findIndex(e=>n1(e.expression))}function Fte(t){const e=gvt(t);return e>=0?[t.variables.slice(0,e),t.variables.slice(e)]:[t.variables,[]]}function uRe(t){pvt(t,"dataset"),hW(t.dimensions,"dataset.dimensions");const e=t.dimensions.find(n=>n.name==="time");return e?(hW(e.coordinates,"timeDimension.coordinates"),hW(e.labels,"timeDimension.labels"),e):null}function fRe(t){const e=uRe(t);if(!e)return null;const n=e.coordinates;return[n[0],n[n.length-1]]}const dRe="User",hRe=`0.0: #23FF52 0.5: red 1.0: 120,30,255`;function mvt(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 s=0,a=0;s(f.value-o)/(s-o));let l=0,c=a[0],u=a[1];for(let f=0,d=0;fu&&(l++,c=a[l],u=a[l+1]);const p=(h-c)/(u-c),[g,m,v,y]=t[l].color,[x,b,w,_]=t[l+1].color;r[d]=g+p*(x-g),r[d+1]=m+p*(b-m),r[d+2]=v+p*(w-v),r[d+3]=y+p*(_-y)}}return r}function vvt(t,e,n){const r=mvt(t,e,n.width),i=new ImageData(r,r.length/4,1);return createImageBitmap(i).then(o=>{const s=n.getContext("2d");s&&s.drawImage(o,0,0,n.width,n.height)})}function yvt(t){const{colorRecords:e,errorMessage:n}=gRe(t.code);if(!e)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,vvt(e,t.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function pRe(t){const{colorRecords:e}=gRe(t);if(e)return e.map(n=>({...n,color:lRe(n.color)}))}function gRe(t){try{return{colorRecords:xvt(t)}}catch(e){if(e instanceof SyntaxError)return{errorMessage:`${e.message}`};throw e}}function xvt(t){const e=[];t.split(` -`).map(o=>o.trim().split(":").map(s=>s.trim())).forEach((o,s)=>{if(o.length==2||o.length==3){const[a,l]=o,c=parseFloat(a),u=Hmt(l);if(!Number.isFinite(c))throw new SyntaxError(`Line ${s+1}: invalid value: ${a}`);if(!u)throw new SyntaxError(`Line ${s+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 ${s+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,s)=>o.value-s.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 Nte={exports:{}};function bvt(t,e){var n=e&&e.cache?e.cache:Evt,r=e&&e.serializer?e.serializer:Ovt,i=e&&e.strategy?e.strategy:_vt;return i(t,{cache:n,serializer:r})}function wvt(t){return t==null||typeof t=="number"||typeof t=="boolean"}function mRe(t,e,n,r){var i=wvt(r)?r:n(r),o=e.get(i);return typeof o>"u"&&(o=t.call(this,r),e.set(i,o)),o}function vRe(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 zte(t,e,n,r,i){return n.bind(e,t,r,i)}function _vt(t,e){var n=t.length===1?mRe:vRe;return zte(t,this,n,e.cache.create(),e.serializer)}function Svt(t,e){var n=vRe;return zte(t,this,n,e.cache.create(),e.serializer)}function Cvt(t,e){var n=mRe;return zte(t,this,n,e.cache.create(),e.serializer)}function Ovt(){return JSON.stringify(arguments)}function D4(){this.cache=Object.create(null)}D4.prototype.has=function(t){return t in this.cache};D4.prototype.get=function(t){return this.cache[t]};D4.prototype.set=function(t,e){this.cache[t]=e};var Evt={create:function(){return new D4}};Nte.exports=bvt;Nte.exports.strategies={variadic:Svt,monadic:Cvt};var Tvt=Nte.exports;const kvt=sn(Tvt),Ya={ADD:"add",REMOVE:"remove"};var yRe=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)}}(),Vhe={LENGTH:"length"},pI=function(t){yRe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.element=r,o.index=i,o}return e}(jh),nu=function(t){yRe(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 s=0,a=i.array_.length;s0;)this.pop()},e.prototype.extend=function(n){for(var r=0,i=n.length;r0&&t[1]>0}function xRe(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 ec(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var bRe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=ec(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 $t()},t.prototype.getImage=function(e){return $t()},t.prototype.getHitDetectionImage=function(){return $t()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return $t()},t.prototype.getImageSize=function(){return $t()},t.prototype.getOrigin=function(){return $t()},t.prototype.getSize=function(){return $t()},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_=ec(e)},t.prototype.listenImageChange=function(e){$t()},t.prototype.load=function(){$t()},t.prototype.unlistenImageChange=function(e){$t()},t}(),Avt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Pvt=/^([a-z]*)$|^hsla?\(.*\)$/i;function wRe(t){return typeof t=="string"?t:_Re(t)}function Mvt(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 Rvt=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 s in e)o++&3||(delete e[s],--n)}i=Dvt(r),e[r]=i,++n}return i}}();function eN(t){return Array.isArray(t)?t:Rvt(t)}function Dvt(t){var e,n,r,i,o;if(Pvt.exec(t)&&(t=Mvt(t)),Avt.exec(t)){var s=t.length-1,a=void 0;s<=4?a=1:a=2;var l=s===4||s===8;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),l?i=parseInt(t.substr(1+3*a,a),16):i=255,a==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),qhe(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),qhe(o)):bn(!1,14);return o}function qhe(t){return t[0]=oo(t[0]+.5|0,0,255),t[1]=oo(t[1]+.5|0,0,255),t[2]=oo(t[2]+.5|0,0,255),t[3]=oo(t[3],0,1),t}function _Re(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 Kd(t){return Array.isArray(t)?_Re(t):t}function Sc(t,e,n,r){var i;return n&&n.length?i=n.shift():E4?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function SRe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Xhe(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function $q(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Ivt(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function Lvt(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 gI="ol-hidden",UM="ol-unselectable",jte="ol-control",Yhe="ol-collapsed",$vt=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"),Qhe=["style","variant","weight","size","lineHeight","family"],CRe=function(t){var e=t.match($vt);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=Qhe.length;ro.trim().split(":").map(s=>s.trim())).forEach((o,s)=>{if(o.length==2||o.length==3){const[a,l]=o,c=parseFloat(a),u=Hmt(l);if(!Number.isFinite(c))throw new SyntaxError(`Line ${s+1}: invalid value: ${a}`);if(!u)throw new SyntaxError(`Line ${s+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 ${s+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,s)=>o.value-s.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 Nte={exports:{}};function bvt(t,e){var n=e&&e.cache?e.cache:Evt,r=e&&e.serializer?e.serializer:Ovt,i=e&&e.strategy?e.strategy:_vt;return i(t,{cache:n,serializer:r})}function wvt(t){return t==null||typeof t=="number"||typeof t=="boolean"}function mRe(t,e,n,r){var i=wvt(r)?r:n(r),o=e.get(i);return typeof o>"u"&&(o=t.call(this,r),e.set(i,o)),o}function vRe(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 zte(t,e,n,r,i){return n.bind(e,t,r,i)}function _vt(t,e){var n=t.length===1?mRe:vRe;return zte(t,this,n,e.cache.create(),e.serializer)}function Svt(t,e){var n=vRe;return zte(t,this,n,e.cache.create(),e.serializer)}function Cvt(t,e){var n=mRe;return zte(t,this,n,e.cache.create(),e.serializer)}function Ovt(){return JSON.stringify(arguments)}function D4(){this.cache=Object.create(null)}D4.prototype.has=function(t){return t in this.cache};D4.prototype.get=function(t){return this.cache[t]};D4.prototype.set=function(t,e){this.cache[t]=e};var Evt={create:function(){return new D4}};Nte.exports=bvt;Nte.exports.strategies={variadic:Svt,monadic:Cvt};var Tvt=Nte.exports;const kvt=sn(Tvt),Ya={ADD:"add",REMOVE:"remove"};var yRe=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)}}(),Vhe={LENGTH:"length"},pI=function(t){yRe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.element=r,o.index=i,o}return e}(jh),nu=function(t){yRe(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 s=0,a=i.array_.length;s0;)this.pop()},e.prototype.extend=function(n){for(var r=0,i=n.length;r0&&t[1]>0}function xRe(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 ec(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var bRe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=ec(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 $t()},t.prototype.getImage=function(e){return $t()},t.prototype.getHitDetectionImage=function(){return $t()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return $t()},t.prototype.getImageSize=function(){return $t()},t.prototype.getOrigin=function(){return $t()},t.prototype.getSize=function(){return $t()},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_=ec(e)},t.prototype.listenImageChange=function(e){$t()},t.prototype.load=function(){$t()},t.prototype.unlistenImageChange=function(e){$t()},t}(),Avt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Pvt=/^([a-z]*)$|^hsla?\(.*\)$/i;function wRe(t){return typeof t=="string"?t:_Re(t)}function Mvt(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 Rvt=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 s in e)o++&3||(delete e[s],--n)}i=Dvt(r),e[r]=i,++n}return i}}();function eN(t){return Array.isArray(t)?t:Rvt(t)}function Dvt(t){var e,n,r,i,o;if(Pvt.exec(t)&&(t=Mvt(t)),Avt.exec(t)){var s=t.length-1,a=void 0;s<=4?a=1:a=2;var l=s===4||s===8;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),l?i=parseInt(t.substr(1+3*a,a),16):i=255,a==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),qhe(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),qhe(o)):bn(!1,14);return o}function qhe(t){return t[0]=oo(t[0]+.5|0,0,255),t[1]=oo(t[1]+.5|0,0,255),t[2]=oo(t[2]+.5|0,0,255),t[3]=oo(t[3],0,1),t}function _Re(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 Kd(t){return Array.isArray(t)?_Re(t):t}function Sc(t,e,n,r){var i;return n&&n.length?i=n.shift():E4?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function SRe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Xhe(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function $q(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Ivt(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function Lvt(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 gI="ol-hidden",UM="ol-unselectable",jte="ol-control",Yhe="ol-collapsed",$vt=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"),Qhe=["style","variant","weight","size","lineHeight","family"],CRe=function(t){var e=t.match($vt);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=Qhe.length;r=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}function Kvt(t,e,n,r,i){kRe(t,e,n||0,r||t.length-1,i||Zvt)}function kRe(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),u=Math.max(n,Math.floor(e-s*l/o+c)),f=Math.min(r,Math.floor(e+(o-s)*l/o+c));kRe(t,e,u,f,i)}var d=t[e],h=n,p=r;for(zE(t,n,e),i(t[r],d)>0&&zE(t,n,r);h0;)p--}i(t[n],d)===0?zE(t,n,p):(p++,zE(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function zE(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Zvt(t,e){return te?1:0}let ARe=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(!vI(e,n))return r;const i=this.toBBox,o=[];for(;n;){for(let s=0;s=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 s=this._chooseSplitIndex(r,o,i),a=zw(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,H1(r,this.toBBox),H1(a,this.toBBox),n?e[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,n){this.data=zw([e,n]),this.data.height=e.height+1,this.data.leaf=!1,H1(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,o=1/0,s=1/0;for(let a=n;a<=r-n;a++){const l=J2(e,0,a,this.toBBox),c=J2(e,a,r,this.toBBox),u=ryt(l,c),f=gW(l)+gW(c);u=n;c--){const u=e.children[c];eT(a,e.leaf?o(u):u),l+=mI(a)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)eT(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():H1(e[n],this.toBBox)}};function Jvt(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function zw(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Jhe(t,e,n,r,i){const o=[e,n];for(;o.length;){if(n=o.pop(),e=o.pop(),n-e<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Kvt(t,s,e,n,i),o.push(e,s,s,n)}}var iyt=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)}}(),epe={RENDER_ORDER:"renderOrder"},oyt=function(t){iyt(e,t);function e(n){var r=this,i=n||{},o=pi({},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(epe.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 ARe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(epe.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:Hvt,this.styleFunction_=n===null?void 0:Gvt(this.style_),this.changed()},e}(I4),Wt={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},yI=[Wt.FILL],fv=[Wt.STROKE],mx=[Wt.BEGIN_PATH],tpe=[Wt.CLOSE_PATH],PRe=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}(),syt=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)}}(),VM=function(t){syt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.tolerance=n,s.maxExtent=r,s.pixelRatio=o,s.maxLineWidth=0,s.resolution=i,s.beginGeometryInstruction1_=null,s.beginGeometryInstruction2_=null,s.bufferedMaxExtent_=null,s.instructions=[],s.coordinates=[],s.tmpCoordinate_=[],s.hitDetectionInstructions=[],s.state={},s}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_,s=this.coordinates,a=s.length,l=0,c=n.length;ll&&(this.instructions.push([Wt.CUSTOM,l,u,n,i,uv]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i,uv]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([Wt.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[Wt.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Wt.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,s,a=-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=[Wt.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[Wt.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,s=n.lineDash,a=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||s!=n.currentLineDash&&!r1(n.currentLineDash,s)||n.currentLineDashOffset!=a||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=s,n.currentLineDashOffset=a,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=[Wt.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=ZPe(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;lA(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(PRe),ayt=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)}}(),lyt=function(t){ayt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.hitDetectionImage_=null,s.image_=null,s.imagePixelRatio_=void 0,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s.declutterMode_=void 0,s.declutterImageWithText_=void 0,s}return e.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,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([Wt.DRAW_IMAGE,s,a,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(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,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([Wt.DRAW_IMAGE,s,a,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(),s=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_=s[0],this.originY_=s[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}(VM),cyt=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)}}(),uyt=function(t){cyt(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 s=this.coordinates.length,a=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[Wt.MOVE_TO_LINE_TO,s,a];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,pA,gA],mx);var a=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(fv),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],mx);for(var a=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=a.length;ft&&(l>a&&(a=l,o=c,s=f),l=0,c=f-i)),d=h,m=y,v=x),p=b,g=w}return l+=h,l>a?[c,f]:[o,s]}var hyt=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)}}(),rk={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},pyt=function(t){hyt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.labels_=null,s.text_="",s.textOffsetX_=0,s.textOffsetY_=0,s.textRotateWithView_=void 0,s.textRotation_=0,s.textFillState_=null,s.fillStates={},s.textStrokeState_=null,s.strokeStates={},s.textState_={},s.textStates={},s.textKey_="",s.fillKey_="",s.strokeKey_="",s.declutterImageWithText_=void 0,s}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_,s=this.textState_;if(!(this.text_===""||!s||!i&&!o)){var a=this.coordinates,l=a.length,c=n.getType(),u=null,f=n.getStride();if(s.placement===Xvt.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!va(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,g=h.length;pA[2]}else P=b>k;var R=Math.PI,T=[],M=_+r===e;e=_,m=0,v=S,d=t[e],h=t[e+1];var I;if(M){y(),I=Math.atan2(h-g,d-p),P&&(I+=I>0?-R:R);var z=(k+b)/2,F=(E+w)/2;return T[0]=[z,F,(O-o)/2,I,i],T}i=i.replace(/\n/g," ");for(var N=0,L=i.length;N0?-R:R),I!==void 0){var $=B-I;if($+=$>R?-2*R:$<-R?2*R:0,Math.abs($)>s)return null}I=B;for(var j=N,X=0;N0&&t.push(` -`,""),t.push(e,""),t}var Cyt=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_=dh(),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 s=i?this.strokeStates[i]:null,a=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?rk[l.justify]:spe(Array.isArray(e)?e[0]:e,l.textAlign||yA),h=i&&s.lineWidth?s.lineWidth:0,p=f?e:e.split(` +`||c===u){o=Math.max(o,s),i.push(s),s=0,a+=l;continue}var d=e[c+1]||t.font,h=rN(d,f);n.push(h),s+=h;var p=zvt(d);r.push(p),l=Math.max(l,p)}return{width:o,height:a,widths:n,heights:r,lineWidths:i}}function Bvt(t,e,n,r,i,o,s,a,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]),Uvt(r,t)):u[0]<0||u[1]<0?(t.translate(l,c),t.scale(u[0],u[1]),t.drawImage(r,i,o,s,a,0,0,s,a)):t.drawImage(r,i,o,s,a,l,c,s*u[0],a*u[1]),t.restore()}function Uvt(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 Kvt(t,e,n,r,i){kRe(t,e,n||0,r||t.length-1,i||Zvt)}function kRe(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),u=Math.max(n,Math.floor(e-s*l/o+c)),f=Math.min(r,Math.floor(e+(o-s)*l/o+c));kRe(t,e,u,f,i)}var d=t[e],h=n,p=r;for(NE(t,n,e),i(t[r],d)>0&&NE(t,n,r);h0;)p--}i(t[n],d)===0?NE(t,n,p):(p++,NE(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function NE(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Zvt(t,e){return te?1:0}let ARe=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(!vI(e,n))return r;const i=this.toBBox,o=[];for(;n;){for(let s=0;s=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 s=this._chooseSplitIndex(r,o,i),a=zw(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,H1(r,this.toBBox),H1(a,this.toBBox),n?e[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,n){this.data=zw([e,n]),this.data.height=e.height+1,this.data.leaf=!1,H1(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,o=1/0,s=1/0;for(let a=n;a<=r-n;a++){const l=Z2(e,0,a,this.toBBox),c=Z2(e,a,r,this.toBBox),u=ryt(l,c),f=gW(l)+gW(c);u=n;c--){const u=e.children[c];J2(a,e.leaf?o(u):u),l+=mI(a)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)J2(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():H1(e[n],this.toBBox)}};function Jvt(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function zw(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Jhe(t,e,n,r,i){const o=[e,n];for(;o.length;){if(n=o.pop(),e=o.pop(),n-e<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Kvt(t,s,e,n,i),o.push(e,s,s,n)}}var iyt=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)}}(),epe={RENDER_ORDER:"renderOrder"},oyt=function(t){iyt(e,t);function e(n){var r=this,i=n||{},o=pi({},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(epe.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 ARe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(epe.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:Hvt,this.styleFunction_=n===null?void 0:Gvt(this.style_),this.changed()},e}(I4),Wt={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},yI=[Wt.FILL],fv=[Wt.STROKE],mx=[Wt.BEGIN_PATH],tpe=[Wt.CLOSE_PATH],PRe=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}(),syt=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)}}(),VM=function(t){syt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.tolerance=n,s.maxExtent=r,s.pixelRatio=o,s.maxLineWidth=0,s.resolution=i,s.beginGeometryInstruction1_=null,s.beginGeometryInstruction2_=null,s.bufferedMaxExtent_=null,s.instructions=[],s.coordinates=[],s.tmpCoordinate_=[],s.hitDetectionInstructions=[],s.state={},s}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_,s=this.coordinates,a=s.length,l=0,c=n.length;ll&&(this.instructions.push([Wt.CUSTOM,l,u,n,i,uv]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i,uv]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([Wt.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[Wt.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Wt.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,s,a=-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=[Wt.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[Wt.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,s=n.lineDash,a=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||s!=n.currentLineDash&&!r1(n.currentLineDash,s)||n.currentLineDashOffset!=a||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=s,n.currentLineDashOffset=a,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=[Wt.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=ZPe(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;aA(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(PRe),ayt=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)}}(),lyt=function(t){ayt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.hitDetectionImage_=null,s.image_=null,s.imagePixelRatio_=void 0,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s.declutterMode_=void 0,s.declutterImageWithText_=void 0,s}return e.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,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([Wt.DRAW_IMAGE,s,a,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(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,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([Wt.DRAW_IMAGE,s,a,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(),s=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_=s[0],this.originY_=s[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}(VM),cyt=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)}}(),uyt=function(t){cyt(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 s=this.coordinates.length,a=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[Wt.MOVE_TO_LINE_TO,s,a];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,hA,pA],mx);var a=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(fv),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],mx);for(var a=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=a.length;ft&&(l>a&&(a=l,o=c,s=f),l=0,c=f-i)),d=h,m=y,v=x),p=b,g=w}return l+=h,l>a?[c,f]:[o,s]}var hyt=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)}}(),nk={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},pyt=function(t){hyt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.labels_=null,s.text_="",s.textOffsetX_=0,s.textOffsetY_=0,s.textRotateWithView_=void 0,s.textRotation_=0,s.textFillState_=null,s.fillStates={},s.textStrokeState_=null,s.strokeStates={},s.textState_={},s.textStates={},s.textKey_="",s.fillKey_="",s.strokeKey_="",s.declutterImageWithText_=void 0,s}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_,s=this.textState_;if(!(this.text_===""||!s||!i&&!o)){var a=this.coordinates,l=a.length,c=n.getType(),u=null,f=n.getStride();if(s.placement===Xvt.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!va(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,g=h.length;pA[2]}else P=b>k;var R=Math.PI,T=[],M=_+r===e;e=_,m=0,v=S,d=t[e],h=t[e+1];var I;if(M){y(),I=Math.atan2(h-g,d-p),P&&(I+=I>0?-R:R);var z=(k+b)/2,F=(E+w)/2;return T[0]=[z,F,(O-o)/2,I,i],T}i=i.replace(/\n/g," ");for(var N=0,L=i.length;N0?-R:R),I!==void 0){var $=B-I;if($+=$>R?-2*R:$<-R?2*R:0,Math.abs($)>s)return null}I=B;for(var j=N,X=0;N0&&t.push(` +`,""),t.push(e,""),t}var Cyt=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_=dh(),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 s=i?this.strokeStates[i]:null,a=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?nk[l.justify]:spe(Array.isArray(e)?e[0]:e,l.textAlign||vA),h=i&&s.lineWidth?s.lineWidth:0,p=f?e:e.split(` `).reduce(Syt,[]),g=jvt(l,p),m=g.width,v=g.height,y=g.widths,x=g.heights,b=g.lineWidths,w=m+h,_=[],S=(w+2)*u[0],O=(v+h)*u[1],k={width:S<0?Math.floor(S):Math.ceil(S),height:O<0?Math.floor(O):Math.ceil(O),contextInstructions:_};if((u[0]!=1||u[1]!=1)&&_.push("scale",u),i){_.push("strokeStyle",s.strokeStyle),_.push("lineWidth",h),_.push("lineCap",s.lineCap),_.push("lineJoin",s.lineJoin),_.push("miterLimit",s.miterLimit);var E=E4?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;E.prototype.setLineDash&&(_.push("setLineDash",[s.lineDash]),_.push("lineDashOffset",s.lineDashOffset))}r&&_.push("fillStyle",a.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");for(var P=.5-d,A=d*w+P*h,R=[],T=[],M=0,I=0,z=0,F=0,N,L=0,B=p.length;Le?e-c:o,b=s+u>n?n-u:s,w=p[3]+x*d[0]+p[1],_=p[0]+b*d[1]+p[2],S=v-p[3],O=y-p[0];(g||f!==0)&&(um[0]=S,fm[0]=S,um[1]=O,cp[1]=O,cp[0]=S+w,up[0]=cp[0],up[1]=O+_,fm[1]=up[1]);var k;return f!==0?(k=Ig(dh(),r,i,1,1,f,-r,-i),Bi(k,um),Bi(k,cp),Bi(k,up),Bi(k,fm),Bf(Math.min(um[0],cp[0],up[0],fm[0]),Math.min(um[1],cp[1],up[1],fm[1]),Math.max(um[0],cp[0],up[0],fm[0]),Math.max(um[1],cp[1],up[1],fm[1]),q1)):Bf(Math.min(S,S+w),Math.min(O,O+_),Math.max(S,S+w),Math.max(O,O+_),q1),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:q1[0],minY:q1[1],maxX:q1[2],maxY:q1[3],value:m},canvasTransform:k,scale:d}},t.prototype.replayImageOrLabel_=function(e,n,r,i,o,s,a){var l=!!(s||a),c=i.declutterBox,u=e.canvas,f=a?a[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,um,cp,up,fm,s,a),Bvt(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=Bi(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],s=this.createLabel(e,n,i,r),a=this.strokeStates[r],l=this.pixelRatio,c=spe(Array.isArray(e)?e[0]:e,o.textAlign||yA),u=rk[o.textBaseline||nN],f=a&&a.lineWidth?a.lineWidth:0,d=s.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*s.height/l+2*(.5-u)*f;return{label:s,anchorX:h,anchorY:p}},t.prototype.execute_=function(e,n,r,i,o,s,a,l){var c;this.pixelCoordinates_&&r1(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Lx(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),Qdt(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,g,m,v,y,x,b,w,_,S,O,k=0,E=0,P=null,A=null,R=this.coordinateCache_,T=this.viewRotation_,M=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,I={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},z=this.instructions!=i||this.overlaps?0:200,F,N,L,B;uz&&(this.fill_(e),k=0),E>z&&(e.stroke(),E=0),!k&&!E&&(e.beginPath(),m=NaN,v=NaN),++u;break;case Wt.CIRCLE:d=$[1];var X=c[d],V=c[d+1],Y=c[d+2],le=c[d+3],K=Y-X,ee=le-V,re=Math.sqrt(K*K+ee*ee);e.moveTo(X+re,V),e.arc(X,V,re,0,2*Math.PI,!0),++u;break;case Wt.CLOSE_PATH:e.closePath(),++u;break;case Wt.CUSTOM:d=$[1],h=$[2];var me=$[3],te=$[4],ae=$.length==6?$[5]:void 0;I.geometry=me,I.feature=F,u in R||(R[u]=[]);var U=R[u];ae?ae(c,d,h,2,U):(U[0]=c[d],U[1]=c[d+1],U.length=2),te(U,I),++u;break;case Wt.DRAW_IMAGE:d=$[1],h=$[2],b=$[3],p=$[4],g=$[5];var oe=$[6],ne=$[7],G=$[8],q=$[9],Z=$[10],de=$[11],xe=$[12],H=$[13],W=$[14],J=$[15];if(!b&&$.length>=20){w=$[19],_=$[20],S=$[21],O=$[22];var se=this.drawLabelWithPointPlacement_(w,_,S,O);b=se.label,$[3]=b;var ye=$[23];p=(se.anchorX-ye)*this.pixelRatio,$[4]=p;var ie=$[24];g=(se.anchorY-ie)*this.pixelRatio,$[5]=g,oe=b.height,$[6]=oe,H=b.width,$[13]=H}var fe=void 0;$.length>25&&(fe=$[25]);var Q=void 0,_e=void 0,we=void 0;$.length>17?(Q=$[16],_e=$[17],we=$[18]):(Q=gx,_e=!1,we=!1),Z&&M?de+=T:!Z&&!M&&(de-=T);for(var Ie=0;d0){if(!s||h!=="Image"&&h!=="Text"||s.indexOf(_)!==-1){var P=(d[k]-3)/4,A=i-P%a,R=i-(P/a|0),T=o(_,S,A*A+R*R);if(T)return T}u.clearRect(0,0,a,a);break}}var g=Object.keys(this.executorsByZIndex_).map(Number);g.sort(lb);var m,v,y,x,b;for(m=g.length-1;m>=0;--m){var w=g[m].toString();for(y=this.executorsByZIndex_[w],v=vW.length-1;v>=0;--v)if(h=vW[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],s=n[3],a=[r,i,r,s,o,s,o,i];return Lx(a,0,8,2,e,a),a},t.prototype.isEmpty=function(){return PS(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,s,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(lb),this.maxExtent_&&(e.save(),this.clip(e,r));var c=s||vW,u,f,d,h,p,g;for(a&&l.reverse(),u=0,f=l.length;un)break;var a=r[s];a||(a=[],r[s]=a),a.push(((t+i)*e+(t+o))*4+3),i>0&&a.push(((t-i)*e+(t+o))*4+3),o>0&&(a.push(((t+i)*e+(t-o))*4+3),i>0&&a.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=lpe(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=lpe(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function lpe(t,e,n){var r=n?wRe(n):"null";return e+":"+t+":"+r}var oN=new kyt,Ayt=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)}}(),Pyt=function(t){Ayt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.extent=n,s.pixelRatio_=i,s.resolution=r,s.state=o,s}return e.prototype.changed=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return $t()},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(){$t()},e}(iO),Myt=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){Myt(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,i,jr.IDLE)||this;return l.src_=o,l.image_=new Image,s!==null&&(l.image_.crossOrigin=s),l.unlisten_=null,l.state=jr.IDLE,l.imageLoadFunction_=a,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=jr.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Cu(this.extent)/this.image_.height),this.state=jr.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==jr.IDLE||this.state==jr.ERROR)&&(this.state=jr.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Bte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=Cu(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(Pyt);function Bte(t,e,n){var r=t,i=!0,o=!1,s=!1,a=[WF(r,nn.LOAD,function(){s=!0,o||e()})];return r.src&&Xdt?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(s?e():n())})):a.push(WF(r,nn.ERROR,n)),function(){i=!1,a.forEach(si)}}var Ryt=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)}}(),jE=null,Dyt=function(t){Ryt(e,t);function e(n,r,i,o,s,a){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_=a,l.unlisten_=null,l.imageState_=s,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===jr.LOADED){jE||(jE=Sc(1,1)),jE.drawImage(this.image_,0,0);try{jE.getImageData(0,0,1,1),this.tainted_=!1}catch{jE=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=jr.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=jr.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=Sc(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_==jr.IDLE){this.imageState_=jr.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Bte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==jr.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=wRe(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),s=o.data,a=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=s.length;f0,6);var f=i.src!==void 0?jr.IDLE:jr.LOADED;return r.color_=i.color!==void 0?eN(i.color):null,r.iconImage_=Iyt(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:Lc.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_==Gm.FRACTION||this.anchorYUnits_==Gm.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==Gm.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==Gm.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=Lc.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==Lc.TOP_RIGHT||this.anchorOrigin_==Lc.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==Lc.BOTTOM_LEFT||this.anchorOrigin_==Lc.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_!=Lc.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==Lc.TOP_RIGHT||this.offsetOrigin_==Lc.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==Lc.BOTTOM_LEFT||this.offsetOrigin_==Lc.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(nn.CHANGE,n)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(nn.CHANGE,n)},e}(bRe),zd=.5;function Fyt(t,e,n,r,i,o,s){var a=t[0]*zd,l=t[1]*zd,c=Sc(a,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new Tyt(c,zd,i,null,s),d=n.length,h=Math.floor((256*256*256-1)/d),p={},g=1;g<=d;++g){var m=n[g-1],v=m.getStyleFunction()||r;if(r){var y=v(m,o);if(y){Array.isArray(y)||(y=[y]);for(var x=g*h,b="#"+("000000"+x.toString(16)).slice(-6),w=0,_=y.length;w<_;++w){var S=y[w],O=S.getGeometryFunction()(m);if(!(!O||!va(i,O.getExtent()))){var k=S.clone(),E=k.getFill();E&&E.setColor(b);var P=k.getStroke();P&&(P.setColor(b),P.setLineDash(null)),k.setText(void 0);var A=S.getImage();if(A&&A.getOpacity()!==0){var R=A.getImageSize();if(!R)continue;var T=Sc(R[0],R[1],void 0,{alpha:!1}),M=T.canvas;T.fillStyle=b,T.fillRect(0,0,M.width,M.height),k.setImage(new $yt({img:M,imgSize:R,anchor:A.getAnchor(),anchorXUnits:Gm.PIXELS,anchorYUnits:Gm.PIXELS,offset:A.getOrigin(),opacity:1,size:A.getSize(),scale:A.getScale(),rotation:A.getRotation(),rotateWithView:A.getRotateWithView()}))}var I=k.getZIndex()||0,z=p[I];z||(z={},p[I]=z,z.Polygon=[],z.Circle=[],z.LineString=[],z.Point=[]),z[O.getType().replace("Multi","")].push(O,k)}}}}}for(var F=Object.keys(p).map(Number).sort(lb),g=0,N=F.length;gg[2];)++y,x=v*y,f.push(this.getRenderTransform(o,s,a,zd,d,h,x).slice()),m-=v}this.hitDetectionImageData_=Fyt(i,f,this.renderedFeatures_,u.getStyleFunction(),c,s,a)}r(Nyt(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s){var a=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(g,m,v){var y=or(g),x=f[y];if(x){if(x!==!0&&vw[0]&&O[2]>w[2]&&b.push([O[0]-_,O[1],O[2]-_,O[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==m&&l_(this.wrappedRenderedExtent_,y))return r1(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var k=new rpe(jq(d,h),y,d,h),E;this.getLayer().getDeclutter()&&(E=new rpe(jq(d,h),y,d,h));for(var P,A,R,A=0,R=b.length;A=200&&a.status<300){var c=e.getType(),u=void 0;c=="json"||c=="text"?u=a.responseText:c=="xml"?(u=a.responseXML,u||(u=new DOMParser().parseFromString(a.responseText,"application/xml"))):c=="arraybuffer"&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function dpe(t,e){return function(n,r,i,o,s){var a=this;r0t(t,e,n,r,i,function(l,c){a.addFeatures(l),o!==void 0&&o(l)},s||cb)}}var $Re=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)}}(),dm=function(t){$Re(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(jh),GM=function(t){$Re(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_=cb,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&&(bn(r.format_,7),r.loader_=dpe(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:t0t;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new upe:null,r.loadedExtentsRtree_=new upe,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var s,a;return Array.isArray(i.features)?a=i.features:i.features&&(s=i.features,a=s.getArray()),!o&&s===void 0&&(s=new nu(a)),a!==void 0&&r.addFeaturesInternal(a),s!==void 0&&r.bindFeaturesCollection_(s),r}return e.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},e.prototype.addFeatureInternal=function(n){var r=or(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 dm(Hu.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[zn(r,nn.CHANGE,this.handleFeatureChange_,this),zn(r,AS.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&&(bn(!(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=[],s=0,a=n.length;s0},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(cA(o.extent,n))return i=o,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(n){if(n){var r=or(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=or(n),i=this.featureChangeKeys_[r];if(i){i.forEach(si),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new dm(Hu.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){bn(this.format_,7),this.url_=n,this.setLoader(dpe(n,this.format_))},e}(LRe);function hm(t,e){return Bi(t.inversePixelTransform,e.slice(0))}const Xt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function FRe(t){return Math.pow(t,3)}function uO(t){return 1-FRe(1-t)}function i0t(t){return 3*t*t-2*t*t*t}function o0t(t){return t}var s0t=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)}}(),NRe=function(t){s0t(e,t);function e(n,r,i){var o=t.call(this)||this,s=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=s.transition===void 0?250:s.transition,o.transitionStarts_={},o.interpolate=!!s.interpolate,o}return e.prototype.changed=function(){this.dispatchEvent(nn.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()==Xt.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()==Xt.LOADED){n.interimTile=null;break}else n.getState()==Xt.LOADING?r=n:n.getState()==Xt.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!==Xt.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},e.prototype.load=function(){$t()},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:FRe(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}(iO),a0t=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)}}(),Ute=function(t){a0t(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,a)||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_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(n){this.image_=n,this.state=Xt.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=Xt.ERROR,this.unlistenImage_(),this.image_=l0t(),this.changed()},e.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=Xt.LOADED:this.state=Xt.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Xt.ERROR&&(this.state=Xt.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Xt.IDLE&&(this.state=Xt.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Bte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(NRe);function l0t(){var t=Sc(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var c0t=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],s=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(s,o),this.initialVelocity_=Math.sqrt(o*o+s*s)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),u0t=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)}}(),f0t=function(t){u0t(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){$t()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;Ig(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),ate(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s,a,l,c){var u,f=r.viewState;function d(M,I,z,F){return s.call(a,I,M?z:null,F)}var h=f.projection,p=oMe(n.slice(),h),g=[[0,0]];if(h.canWrapX()&&o){var m=h.getExtent(),v=ei(m);g.push([-v,0],[v,0])}for(var y=r.layerStatesArray,x=y.length,b=[],w=[],_=0;_=0;--S){var O=y[S],k=O.layer;if(k.hasRenderer()&&iN(O,f)&&l.call(c,k)){var E=k.getRenderer(),P=k.getSource();if(E&&P){var A=P.getWrapX()?p:n,R=d.bind(null,O.managed);w[0]=A[0]+g[_][0],w[1]=A[1]+g[_][1],u=E.forEachFeatureAtCoordinate(w,r,i,R,b)}if(u)return u}}if(b.length!==0){var T=1/b.length;return b.forEach(function(M,I){return M.distanceSq+=I*T}),b.sort(function(M,I){return M.distanceSq-I.distanceSq}),b.some(function(M){return u=M.callback(M.feature,M.layer,M.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){return $t()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,s,a){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Dx,this,s,a);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){$t()},e.prototype.scheduleExpireIconCache=function(n){oN.canExpireCache()&&n.postRenderFunctions.push(d0t)},e}(ote);function d0t(t,e){oN.expire()}var h0t=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)}}(),p0t=function(t){h0t(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=zn(Cp,AS.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=UM+" 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 MRe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){si(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(Fv.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=[],s=null,a=0,l=r.length;a=0;--a)o[a].renderDeclutter(n);Lvt(this.element_,this.children_),this.dispatchRenderEvent(Fv.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){for(var a=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&iN(f,a)&&s(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var g=o(d,p);if(g)return g}}}},e}(f0t),zRe=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)}}(),Hm=function(t){zRe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(jh),xW={LAYERS:"layers"},$4=function(t){zRe(e,t);function e(n){var r=this,i=n||{},o=pi({},i);delete o.layers;var s=i.layers;return r=t.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(xW.LAYERS,r.handleLayersChanged_),s?Array.isArray(s)?s=new nu(s.slice(),{unique:!0}):bn(typeof s.getArray=="function",43):s=new nu(void 0,{unique:!0}),r.setLayers(s),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(si),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push(zn(n,Ya.ADD,this.handleLayersAdd_,this),zn(n,Ya.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(si);IM(this.listenerKeys_);for(var i=n.getArray(),o=0,s=i.length;othis.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(si(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(nn.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(si(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(si),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(iO);const Mm={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},$s={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var sN=1/0,x0t=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,IM(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){bn(!(this.keyFunction_(e)in this.queuedElements_),31);var n=this.priorityFunction_(e);return n!=sN?(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],s=r[e],a=e;e>1;){var l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=ce;){var a=this.getParentIndex_(n);if(i[a]>s)r[n]=r[a],i[n]=i[a],n=a;else break}r[n]=o,i[n]=s},t.prototype.reprioritize=function(){var e=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,s,a,l;for(a=0;a0;)s=this.dequeue()[0],a=s.getKey(),o=s.getState(),o===Xt.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,s.load())},e}(x0t);function _0t(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return sN;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}const qu={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var S0t=42,Wte=256;function hpe(t,e,n){return function(r,i,o,s,a){if(r){if(!i&&!e)return r;var l=e?0:o[0]*i,c=e?0:o[1]*i,u=a?a[0]:0,f=a?a[1]:0,d=t[0]+l/2+u,h=t[2]-l/2+u,p=t[1]+c/2+f,g=t[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>g&&(p=(g+p)/2,g=p);var m=oo(r[0],d,h),v=oo(r[1],p,g);if(s&&n&&i){var y=30*i;m+=-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]-g)/y)}return[m,v]}}}function C0t(t){return t}function Vte(t,e,n,r){var i=ei(e)/n[0],o=Cu(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function Gte(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),oo(r,n/2,e*2)}function O0t(t,e,n,r){return function(i,o,s,a){if(i!==void 0){var l=t[0],c=t[t.length-1],u=n?Vte(l,n,s,r):l;if(a){var f=e!==void 0?e:!0;return f?Gte(i,u,c):oo(i,c,u)}var d=Math.min(u,i),h=Math.floor(ste(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_[Bs.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(Bs.ANIMATING,-this.hints_[Bs.ANIMATING]);for(var n,r=0,i=this.animations_.length;r=0;--i){for(var o=this.animations_[i],s=!0,a=0,l=o.length;a0?u/c.duration:1;f>=1?(c.complete=!0,f=1):s=!1;var d=c.easing(f);if(c.sourceCenter){var h=c.sourceCenter[0],p=c.sourceCenter[1],g=c.targetCenter[0],m=c.targetCenter[1];this.nextCenter_=c.targetCenter;var v=h+d*(g-h),y=p+d*(m-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()),w=this.constraints_.resolution(x,0,b,!0);this.targetCenter_=this.calculateCenterZoom(w,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=x,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){var _=d===1?$v(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+d*(c.targetRotation-c.sourceRotation);if(c.anchor){var S=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(S,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=_}if(this.applyTargetState_(!0),r=!0,!c.complete)break}}if(s){this.animations_[i]=null,this.setHint(Bs.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var O=o[0].callback;O&&xI(O,!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]],pte(i,n-this.getRotation()),Sht(i,r)),i},e.prototype.calculateCenterZoom=function(n,r){var i,o=this.getCenterInternal(),s=this.getResolution();if(o!==void 0&&s!==void 0){var a=r[0]-n*(r[0]-o[0])/s,l=r[1]-n*(r[1]-o[1])/s;i=[a,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&&wq(n,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(qu.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 lMe(r,this.getProjection())},e.prototype.calculateExtentInternal=function(n){var r=n||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();bn(i,1);var o=this.getResolution();bn(o!==void 0,2);var s=this.getRotation();return bn(s!==void 0,3),vq(i,o,s,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(qu.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(hx(n,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=ei(n)/i[0],s=Cu(n)/i[1];return Math.max(o,s)},e.prototype.getResolutionForValueFunction=function(n){var r=n||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/Math.log(r);return function(a){var l=i/Math.pow(r,a*s);return l}},e.prototype.getRotation=function(){return this.get(qu.ROTATION)},e.prototype.getValueForResolutionFunction=function(n){var r=Math.log(n||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/r;return function(a){var l=Math.log(i/a)/r/s;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(),s=this.padding_;if(s){var a=this.getViewportSizeMinusPadding_();o=wW(o,this.getViewportSize_(),[a[0]/2+s[3],a[1]/2+s[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 s=ste(this.resolutions_,n,1);r=s,i=this.resolutions_[s],s==this.resolutions_.length-1?o=2:o=i/this.resolutions_[s+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=oo(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,oo(n-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,n-this.minZoom_)},e.prototype.fit=function(n,r){var i;if(bn(Array.isArray(n)||typeof n.getSimplifiedGeometry=="function",24),Array.isArray(n)){bn(!hte(n),25);var o=hx(n,this.getProjection());i=Oq(o)}else if(n.getType()==="Circle"){var o=hx(n.getExtent(),this.getProjection());i=Oq(o),i.rotate(this.getRotation(),ty(o))}else{var s=Dht();s?i=n.clone().transform(s,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),s=n.getFlatCoordinates(),a=n.getStride(),l=1/0,c=1/0,u=-1/0,f=-1/0,d=0,h=s.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 s=n.viewHints;if(s[Bs.ANIMATING]||s[Bs.INTERACTING]){var a=Date.now()-n.time>8;i=a?0:8,o=a?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!r1(r,this.renderedAttributions_)){Ivt(this.ulElement_);for(var o=0,s=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:uO}):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 s=this.element.classList.contains(gI);!s&&i===0?this.element.classList.add(gI):s&&i!==0&&this.element.classList.remove(gI)}this.label_.style.transform=o}this.rotation_=i}},e}(F4),U0t=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)}}(),W0t=function(t){U0t(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",s=i.delta!==void 0?i.delta:1,a=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=a,h.setAttribute("type","button"),h.title=f,h.appendChild(typeof c=="string"?document.createTextNode(c):c),h.addEventListener(nn.CLICK,r.handleClick_.bind(r,s),!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(nn.CLICK,r.handleClick_.bind(r,-s),!1);var g=o+" "+UM+" "+jte,m=r.element;return m.className=g,m.appendChild(h),m.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 s=i.getConstrainedZoom(o+n);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:uO})):i.setZoom(s)}}},e}(F4),V0t=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)}}(),_W="units",m0={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},G0t=[1,2,5],BE=25.4/.28,H0t=function(t){V0t(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+" "+UM,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(_W,r.handleUnitsChanged_),r.setUnits(i.units||m0.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(_W)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(n){this.set(_W,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(),s=o==m0.DEGREES?$o.DEGREES:$o.METERS,a=HF(i,n.resolution,r,s),l=this.minWidth_*(this.dpi_||BE)/BE,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||BE)/BE:void 0,u=l*a,f="";if(o==m0.DEGREES){var d=jf[$o.DEGREES];u*=d,u=c){p=v,g=y,m=x;break}else if(g>=l)break;v=p,y=g,x=m,++h}var w;this.scaleBar_?w=this.createScaleBar(g,p,f):w=p.toFixed(m<0?-m:0)+" "+f,this.renderedHTML_!=w&&(this.innerElement_.innerHTML=w,this.renderedHTML_=w),this.renderedWidth_!=g&&(this.innerElement_.style.width=g+"px",this.renderedWidth_=g),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(),s=[],a=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&&s.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+s.join("")+"
";return f},e.prototype.createMarker=function(n,r){var i=n==="absolute"?3:-10;return'
'},e.prototype.createStepText=function(n,r,i,o,s){var a=n===0?0:Math.round(o/this.scaleBarSteps_*n*100)/100,l=a+(n===0?"":" "+s),c=n===0?-3:r/this.scaleBarSteps_*-1,u=n===0?0:r/this.scaleBarSteps_*2;return'
'+l+"
"},e.prototype.getScaleForResolution=function(){var n=HF(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,$o.METERS),r=this.dpi_||BE,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}(F4);function q0t(t){var e={},n=new nu,r=e.zoom!==void 0?e.zoom:!0;r&&n.push(new W0t(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&n.push(new B0t(e.rotateOptions));var o=e.attribution!==void 0?e.attribution:!0;return o&&n.push(new z0t(e.attributionOptions)),n}const Uq={ACTIVE:"active"};var X0t=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)}}(),HM=function(t){X0t(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(Uq.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(n){return!0},e.prototype.setActive=function(n){this.set(Uq.ACTIVE,n)},e.prototype.setMap=function(n){this.map_=n},e}(Bh);function Y0t(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:o0t,center:t.getConstrainedCenter(i)})}}function qte(t,e,n,r){var i=t.getZoom();if(i!==void 0){var o=t.getConstrainedZoom(i+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:r!==void 0?r:250,easing:uO})}}var Q0t=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)}}(),K0t=function(t){Q0t(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==hr.DBLCLICK){var i=n.originalEvent,o=n.map,s=n.coordinate,a=i.shiftKey?-this.delta_:this.delta_,l=o.getView();qte(l,a,s,this.duration_),i.preventDefault(),r=!0}return!r},e}(HM),Z0t=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)}}(),fO=function(t){Z0t(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==hr.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==hr.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==hr.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==hr.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}(HM);function Xte(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}(fO),ixt=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)}}(),oxt=function(t){ixt(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,{stopDown:DM})||this,r.condition_=i.condition?i.condition:J0t,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){if(SW(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==Hte){var o=r.getSize(),s=n.pixel,a=Math.atan2(o[1]/2-s[1],s[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=a-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=a}}},e.prototype.handleUpEvent=function(n){if(!SW(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(n){if(!SW(n))return!1;if(VRe(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(fO),sxt=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)}}(),axt=function(t){sxt(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 ny([o])},e.prototype.getGeometry=function(){return this.geometry_},e}(ote),qRe=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)}}(),bI={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},CW=function(t){qRe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return e}(jh),lxt=function(t){qRe(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new axt(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:VRe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(n,r,i){var o=i[0]-r[0],s=i[1]-r[1];return o*o+s*s>=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 CW(bI.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 CW(r?bI.BOXEND:bI.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 CW(bI.BOXSTART,n.coordinate,n)),!0):!1},e.prototype.onBoxEnd=function(n){},e}(fO),cxt=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)}}(),uxt=function(t){cxt(e,t);function e(n){var r=this,i=n||{},o=i.condition?i.condition:GRe;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 s=i.rotatedExtentForGeometry(o),a=i.getResolutionForExtentInternal(s),l=i.getResolution()/a;o=o.clone(),o.scale(l*l)}i.fitInternal(o,{duration:this.duration_,easing:uO})},e}(lxt);const v0={LEFT:37,UP:38,RIGHT:39,DOWN:40};var fxt=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)}}(),dxt=function(t){fxt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return Yte(o)&&HRe(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==nn.KEYDOWN){var i=n.originalEvent,o=i.keyCode;if(this.condition_(n)&&(o==v0.DOWN||o==v0.LEFT||o==v0.RIGHT||o==v0.UP)){var s=n.map,a=s.getView(),l=a.getResolution()*this.pixelDelta_,c=0,u=0;o==v0.DOWN?u=-l:o==v0.LEFT?c=-l:o==v0.RIGHT?c=l:u=l;var f=[c,u];pte(f,a.getRotation()),Y0t(a,f,this.duration_),i.preventDefault(),r=!0}}return!r},e}(HM),hxt=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)}}(),pxt=function(t){hxt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:HRe,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==nn.KEYDOWN||n.type==nn.KEYPRESS){var i=n.originalEvent,o=i.charCode;if(this.condition_(n)&&(o==43||o==45)){var s=n.map,a=o==43?this.delta_:-this.delta_,l=s.getView();qte(l,a,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(HM),gxt=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)}}(),OW={TRACKPAD:"trackpad",WHEEL:"wheel"},mxt=function(t){gxt(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:WRe;return r.condition_=i.onFocusOnly?Wq(URe,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!==nn.WHEEL)return!0;var i=n.map,o=n.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=n.coordinate);var s;if(n.type==nn.WHEEL&&(s=o.deltaY,Vdt&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=YPe),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;var a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?OW.TRACKPAD:OW.WHEEL);var l=i.getView();if(this.mode_===OW.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(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=s;var c=Math.max(this.timeout_-(a-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=-oo(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),qte(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}(HM),vxt=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)}}(),yxt=function(t){vxt(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=DM),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],s=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(this.lastAngle_!==void 0){var a=s-this.lastAngle_;this.rotationDelta_+=a,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=a}this.lastAngle_=s;var l=n.map,c=l.getView();if(c.getConstraints().rotation!==Hte){var u=l.getViewport().getBoundingClientRect(),f=Xte(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}(fO),xxt=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)}}(),bxt=function(t){xxt(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=DM),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],s=i.clientX-o.clientX,a=i.clientY-o.clientY,l=Math.sqrt(s*s+a*a);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=Xte(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}(fO),wxt=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)}}(),Qte=function(t){wxt(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 s=r||0;o.setCenterAndRadius(n,s,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 s=this.flatCoordinates,a=n-s[0],l=r-s[1],c=a*a+l*l;if(c=i[0]||n[1]<=i[1]&&n[3]>=i[1]?!0:cte(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 s=1;s=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===hr.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===hr.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===hr.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===hr.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===hr.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 Pp(hr.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_===Vn.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],s=r[1]-i[1],a=o*o+s*s;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=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_],s=this.mode_;if(s===Vn.POINT)r=!0;else if(s===Vn.CIRCLE)r=this.sketchCoords_.length===2;else if(s===Vn.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(s===Vn.POLYGON){var a=this.sketchCoords_;i=a[0].length>this.minPoints_,o=[a[0][0],a[0][a[0].length-2]]}if(i)for(var l=this.getMap(),c=0,u=o.length;c=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),this.geometryFunction_(s,r,i)):a===Vn.POLYGON&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),o&&(this.finishCoordinate_=s[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===Vn.LINE_STRING||o===Vn.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var s=this.finishCoordinate_.slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}this.geometryFunction_(i,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o===Vn.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var a=this.sketchLine_.getGeometry();if(i.length>=2){var s=i[i.length-2].slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}a.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_===Vn.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,o)):this.mode_===Vn.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,o),r=i.getCoordinates()),this.type_==="MultiPoint"?n.setGeometry(new P4([r])):this.type_==="MultiLineString"?n.setGeometry(new Ete([r])):this.type_==="MultiPolygon"&&n.setGeometry(new Tte([r])),this.dispatchEvent(new _I(wI.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 _I(wI.DRAWABORT,n))},e.prototype.appendCoordinates=function(n){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(n[0]);var o;if(r===Vn.LINE_STRING||r===Vn.CIRCLE)o=this.sketchCoords_;else if(r===Vn.POLYGON)o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&o.shift(),o.pop();for(var s=0;s0&&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 bn(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 bn(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){bn(!(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 vpe(t,e,n,r){return r!==void 0?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function N4(t,e,n){return t+"/"+e+"/"+n}function YRe(t){return N4(t[0],t[1],t[2])}function kxt(t){return t.split("/").map(Number)}function QRe(t){return(t[1]<n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return o?o.containsXY(r,i):!0}var Pxt=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)}}(),KRe=function(t){Pxt(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=kxt(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(YRe(o.tileCoord)),o.release())}).bind(this))}},e}(Txt),Kte=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 X1(t,e,n,r,i){return i!==void 0?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new Kte(t,e,n,r)}var Mxt=.5,Rxt=10,ype=.25,Dxt=function(){function t(e,n,r,i,o,s){this.sourceProj_=e,this.targetProj_=n;var a={},l=uA(this.targetProj_,this.sourceProj_);this.transformInv_=function(x){var b=x[0]+"/"+x[1];return a[b]||(a[b]=l(x)),a[b]},this.maxSourceExtent_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&ei(i)==ei(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ei(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ei(this.targetProj_.getExtent()):null;var c=o1(r),u=dte(r),f=fte(r),d=ute(r),h=this.transformInv_(c),p=this.transformInv_(u),g=this.transformInv_(f),m=this.transformInv_(d),v=Rxt+(s?Math.max(0,Math.ceil(lht(mq(r)/(s*s*256*256)))):0);if(this.addQuad_(c,u,f,d,h,p,g,m,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(x,b,w){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 w=Math.min(b[0][0],b[1][0],b[2][0]),_=Math.max(b[0][0],b[1][0],b[2][0]);_-w.5&&f<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var g=_he([e,n,r,i]),m=ei(g)/this.targetWorldWidth_;p=m>ype||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>ype||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!va(u,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(v=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(s[0])||!isFinite(s[1])?4:0)+(!isFinite(a[0])||!isFinite(a[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 w=($v(o[0],d)+$v(a[0],d))/2;b=w-$v(x[0],d)}else b=(o[0]+a[0])/2-x[0];var _=(o[1]+a[1])/2-x[1],S=b*b+_*_;p=S>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var O=[(n[0]+r[0])/2,(n[1]+r[1])/2],k=this.transformInv_(O),E=[(i[0]+e[0])/2,(i[1]+e[1])/2],P=this.transformInv_(E);this.addQuad_(e,n,O,E,o,s,k,P,c-1),this.addQuad_(E,O,r,i,P,k,a,l,c-1)}else{var A=[(e[0]+n[0])/2,(e[1]+n[1])/2],R=this.transformInv_(A),T=[(r[0]+i[0])/2,(r[1]+i[1])/2],M=this.transformInv_(T);this.addQuad_(e,A,T,i,o,R,M,l,c-1),this.addQuad_(A,n,r,T,R,s,a,M,c-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}v&11||this.addTriangle_(e,r,i,o,a,l),v&14||this.addTriangle_(e,r,n,o,a,s),v&&(v&13||this.addTriangle_(n,i,e,s,l,o),v&7||this.addTriangle_(n,i,r,s,l,a))}},t.prototype.calculateSourceExtent=function(){var e=_c();return this.triangles_.forEach(function(n,r,i){var o=n.source;tk(e,o[0]),tk(e,o[1]),tk(e,o[2])}),e},t.prototype.getTriangles=function(){return this.triangles_},t}(),Vq={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Ixt={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},EW,ZRe=[];function xpe(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 TW(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function Lxt(){if(EW===void 0){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",xpe(t,4,5,4,0),xpe(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;EW=TW(e,0)||TW(e,4)||TW(e,8)}return EW}function Gq(t,e,n,r){var i=T4(n,e,t),o=HF(e,r,n),s=e.getMetersPerUnit();s!==void 0&&(o*=s);var a=t.getMetersPerUnit();a!==void 0&&(o/=a);var l=t.getExtent();if(!l||$M(l,i)){var c=HF(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function $xt(t,e,n,r){var i=ty(n),o=Gq(t,e,i,r);return(!isFinite(o)||o<=0)&&cte(n,function(s){return o=Gq(t,e,s,r),isFinite(o)&&o>0}),o}function Fxt(t,e,n,r,i,o,s,a,l,c,u,f){var d=Sc(Math.round(n*t),Math.round(n*e),ZRe);if(f||pi(d,Vq),l.length===0)return d.canvas;d.scale(n,n);function h(b){return Math.round(b*n)/n}d.globalCompositeOperation="lighter";var p=_c();l.forEach(function(b,w,_){eMe(p,b.extent)});var g=ei(p),m=Cu(p),v=Sc(Math.round(n*g/r),Math.round(n*m/r));f||pi(v,Vq);var y=n/r;l.forEach(function(b,w,_){var S=b.extent[0]-p[0],O=-(b.extent[3]-p[3]),k=ei(b.extent),E=Cu(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,S*y,O*y,k*y,E*y)});var x=o1(s);return a.getTriangles().forEach(function(b,w,_){var S=b.source,O=b.target,k=S[0][0],E=S[0][1],P=S[1][0],A=S[1][1],R=S[2][0],T=S[2][1],M=h((O[0][0]-x[0])/o),I=h(-(O[0][1]-x[1])/o),z=h((O[1][0]-x[0])/o),F=h(-(O[1][1]-x[1])/o),N=h((O[2][0]-x[0])/o),L=h(-(O[2][1]-x[1])/o),B=k,$=E;k=0,E=0,P-=B,A-=$,R-=B,T-=$;var j=[[P,A,0,0,z-M],[R,T,0,0,N-M],[0,0,P,A,F-I],[0,0,R,T,L-I]],X=uht(j);if(X){if(d.save(),d.beginPath(),Lxt()||!f){d.moveTo(z,F);for(var V=4,Y=M-z,le=I-F,K=0;K=this.minZoom;){if(this.zoomFactor_===2?(s=Math.floor(s/2),a=Math.floor(a/2),o=X1(s,s,a,a,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(s/a[0],o/a[1]),c=i+1,u=new Array(c),f=0;fi.highWaterMark&&(i.highWaterMark=n)},e.prototype.useTile=function(n,r,i,o){},e}(LRe),Gxt=function(t){nDe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.tile=r,i}return e}(jh);function Hxt(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){if(s)return t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var c=s[0],u=e.getFullTileRange(c);bn(u,55);var f=u.getHeight()-s[2]-1;return f.toString()})}}function qxt(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 s=o.getResolution(n[0]),a=o.getTileCoordExtent(n,this.tmpExtent_),l=ec(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=Ghe(l,c,this.tmpSize),a=lA(a,s*c,a)),r!=1&&(l=xRe(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:SI,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return pi(u,this.params_),this.getRequestUrl_(n,l,a,r,i,u)}},e}(rDe);function iDe(t){return C.jsx(D.Fragment,{children:t.children})}const CI={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var nbt=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)}}(),rbt=function(t){nbt(e,t);function e(n){var r=this,i=n||{},o=pi({},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(CI.PRELOAD)},e.prototype.setPreload=function(n){this.set(CI.PRELOAD,n)},e.prototype.getUseInterimTilesOnError=function(){return this.get(CI.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(n){this.set(CI.USE_INTERIM_TILES_ON_ERROR,n)},e.prototype.getData=function(n){return t.prototype.getData.call(this,n)},e}(I4),ibt=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)}}(),obt=function(t){ibt(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=_c(),r.tmpTileRange_=new Kte(0,0,0,0),r}return e.prototype.isDrawableTile=function(n){var r=this.getLayer(),i=n.getState(),o=r.getUseInterimTilesOnError();return i==Xt.LOADED||i==Xt.EMPTY||i==Xt.ERROR&&!o},e.prototype.getTile=function(n,r,i,o){var s=o.pixelRatio,a=o.viewState.projection,l=this.getLayer(),c=l.getSource(),u=c.getTile(n,r,i,s,a);return u.getState()==Xt.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):u.setState(Xt.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=Bi(r.pixelToCoordinateTransform,n.slice()),s=i.getExtent();if(s&&!$M(s,o))return null;for(var a=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),g=u.getTile(h,p[1],p[2],a,l);if(!(g instanceof Ute||g instanceof JRe))return null;if(g.getState()===Xt.LOADED){var m=f.getOrigin(h),v=ec(f.getTileSize(h)),y=f.getResolution(h),x=Math.floor(d*((o[0]-m[0])/y-p[1]*v[0])),b=Math.floor(d*((m[1]-o[1])/y-p[2]*v[1])),w=Math.round(d*u.getGutterForProjection(c.projection));return this.getImageData(g.getImage(),x+w,b+w)}}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,s=o.projection,a=o.resolution,l=o.center,c=o.rotation,u=n.pixelRatio,f=this.getLayer(),d=f.getSource(),h=d.getRevision(),p=d.getTileGridForProjection(s),g=p.getZForResolution(a,d.zDirection),m=p.getResolution(g),v=n.extent,y=n.viewState.resolution,x=d.getTilePixelRatio(u),b=Math.round(ei(v)/y*u),w=Math.round(Cu(v)/y*u),_=i.extent&&hx(i.extent);_&&(v=nk(v,hx(i.extent)));var S=m*b/2/x,O=m*w/2/x,k=[l[0]-S,l[1]-O,l[0]+S,l[1]+O],E=p.getTileRangeForExtentAndZ(v,g),P={};P[g]={};var A=this.createLoadedTileFinder(d,s,P),R=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var M=c?yq(o.center,y,c,n.size):void 0,I=E.minX;I<=E.maxX;++I)for(var z=E.minY;z<=E.maxY;++z)if(!(c&&!p.tileCoordIntersectsViewport([g,I,z],M))){var F=this.getTile(g,I,z,n);if(this.isDrawableTile(F)){var N=or(this);if(F.getState()==Xt.LOADED){P[g][F.tileCoord.toString()]=F;var L=F.inTransition(N);L&&i.opacity!==1&&(F.endTransition(N),L=!1),!this.newTiles_&&(L||this.renderedTiles.indexOf(F)===-1)&&(this.newTiles_=!0)}if(F.getAlpha(N,n.time)===1)continue}var B=p.getTileCoordChildTileRange(F.tileCoord,T,R),$=!1;B&&($=A(g+1,B)),$||p.forEachTileCoordParentTileRange(F.tileCoord,A,T,R)}var j=m/a*u/x;Ig(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-b/2,-w/2);var X=KPe(this.pixelTransform);this.useContainer(r,X,this.getBackground(n));var V=this.context,Y=V.canvas;ate(this.inversePixelTransform,this.pixelTransform),Ig(this.tempTransform,b/2,w/2,j,j,0,-b/2,-w/2),Y.width!=b||Y.height!=w?(Y.width=b,Y.height=w):this.containerReused||V.clearRect(0,0,b,w),_&&this.clipUnrotated(V,n,_),d.getInterpolate()||pi(V,Vq),this.preRender(V,n),this.renderedTiles.length=0;var le=Object.keys(P).map(Number);le.sort(lb);var K,ee,re;i.opacity===1&&(!this.containerReused||d.getOpaque(n.viewState.projection))?le=le.reverse():(K=[],ee=[]);for(var me=le.length-1;me>=0;--me){var te=le[me],ae=d.getTilePixelSize(te,u,s),U=p.getResolution(te),oe=U/m,ne=ae[0]*oe*j,G=ae[1]*oe*j,q=p.getTileCoordForCoordAndZ(o1(k),te),Z=p.getTileCoordExtent(q),de=Bi(this.tempTransform,[x*(Z[0]-k[0])/m,x*(k[3]-Z[3])/m]),xe=x*d.getGutterForProjection(s),H=P[te];for(var W in H){var F=H[W],J=F.tileCoord,se=q[1]-J[1],ye=Math.round(de[0]-(se-1)*ne),ie=q[2]-J[2],fe=Math.round(de[1]-(ie-1)*G),I=Math.round(de[0]-se*ne),z=Math.round(de[1]-ie*G),Q=ye-I,_e=fe-z,we=g===te,L=we&&F.getAlpha(or(this),n.time)!==1,Ie=!1;if(!L)if(K){re=[I,z,I+Q,z,I+Q,z+_e,I,z+_e];for(var Pe=0,Re=K.length;Pe{const r=this.props.onClick;r&&r(n)});gn(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()});gn(this,"handleRef",n=>{this.contextValue.mapDiv=n});gn(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)}});gn(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 s=this.contextValue.mapObjects[n];s instanceof mpe&&(i=s,i.setTarget(r),this.clickEventsKey&&i.un("click",this.clickEventsKey.listener))}if(!i){const s=this.getMinZoom(r),a=new jd({projection:GPe,center:[0,0],minZoom:s,zoom:s});i=new mpe({view:a,...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=C.jsx(sDe.Provider,{value:this.contextValue,children:this.props.children})),C.jsx("div",{ref:this.handleRef,style:ubt,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 hO extends D.PureComponent{constructor(){super(...arguments);gn(this,"context",{});gn(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}}gn(hO,"contextType",sDe);function aDe(t,e,n){Y1(t,e,n,"visible",!0),Y1(t,e,n,"opacity",1),Y1(t,e,n,"zIndex",void 0),Y1(t,e,n,"extent",void 0),Y1(t,e,n,"minResolution",void 0),Y1(t,e,n,"maxResolution",void 0)}function Y1(t,e,n,r,i){const o=wpe(e[r],i),s=wpe(n[r],i);o!==s&&t.set(r,s)}function wpe(t,e){return t===void 0?e:t}let Ha;Ha=()=>{};class lDe extends hO{addMapObject(e){const n=new oDe(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 s=!0;if(i instanceof Hq&&o instanceof Hq){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(dbt(f,d)){Ha("--> Equal tile grids!");const h=c.getUrls(),p=u.getUrls();h!==p&&p&&(h===null||h[0]!==p[0])&&(c.setUrls(p),s=!1);const g=c.getTileLoadFunction(),m=u.getTileLoadFunction();g!==m&&(c.setTileLoadFunction(m),s=!1);const v=c.getTileUrlFunction(),y=u.getTileUrlFunction();v!==y&&(c.setTileUrlFunction(y),s=!1)}else Ha("--> Tile grids are not equal!")}const a=i==null?void 0:i.getInterpolate(),l=o==null?void 0:o.getInterpolate();a!==l&&(s=!0),s?(n.setSource(o),Ha("--> Replaced source (expect flickering!)")):Ha("--> Updated source (check, is it still flickering?)")}return aDe(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}new dO({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new dO({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 cbt;new dO({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function dbt(t,e){if(t===e)return!0;if(t===null||e===null||(Ha("tile grid:",t,e),Ha("min zoom:",t.getMinZoom(),e.getMinZoom()),Ha("max zoom:",t.getMaxZoom(),e.getMaxZoom()),t.getMinZoom()!==e.getMinZoom()||t.getMaxZoom()!==e.getMaxZoom()))return!1;const n=t.getExtent(),r=e.getExtent();Ha("extent:",n,r);for(let a=0;a=t[i])return i;let o=Math.floor(n/2),s;for(let a=0;as)[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 qn(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 At(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function Ft(t){At(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||Pg(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 uDe(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function fDe(t,e){At(2,arguments);var n=Ft(t),r=qn(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 s=o.getDate();return i>=s?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function j4(t,e){At(2,arguments);var n=Ft(t).getTime(),r=qn(e);return new Date(n+r)}var hbt=36e5;function pbt(t,e){At(2,arguments);var n=qn(e);return j4(t,n*hbt)}var gbt={};function Uh(){return gbt}function bA(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Uh(),f=qn((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.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=Ft(t),h=d.getDay(),p=(h=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Ft(t),h=d.getDay(),p=(h=i.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function Pbt(t){At(1,arguments);var e=gDe(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=DS(n);return r}var Mbt=6048e5;function mDe(t){At(1,arguments);var e=Ft(t),n=DS(e).getTime()-Pbt(e).getTime();return Math.round(n/Mbt)+1}function db(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Uh(),f=qn((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.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=Ft(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 g=db(p,e),m=new Date(0);m.setUTCFullYear(f,0,h),m.setUTCHours(0,0,0,0);var v=db(m,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function Rbt(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Uh(),f=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.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=nne(t,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=db(h,e);return p}var Dbt=6048e5;function vDe(t,e){At(1,arguments);var n=Ft(t),r=db(n,e).getTime()-Rbt(n,e).getTime();return Math.round(r/Dbt)+1}function vr(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?r:1-r;return vr(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):vr(r+1,2)},d:function(e,n){return vr(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 vr(e.getUTCHours()%12||12,n.length)},H:function(e,n){return vr(e.getUTCHours(),n.length)},m:function(e,n){return vr(e.getUTCMinutes(),n.length)},s:function(e,n){return vr(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 vr(o,n.length)}},Q1={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ibt={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 gm.y(e,n)},Y:function(e,n,r,i){var o=nne(e,i),s=o>0?o:1-o;if(n==="YY"){var a=s%100;return vr(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):vr(s,n.length)},R:function(e,n){var r=gDe(e);return vr(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return vr(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 vr(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 vr(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 gm.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 vr(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=vDe(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):vr(o,n.length)},I:function(e,n,r){var i=mDe(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):vr(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):gm.d(e,n)},D:function(e,n,r){var i=Abt(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):vr(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(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return vr(s,2);case"eo":return r.ordinalNumber(s,{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(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return vr(s,n.length);case"co":return r.ordinalNumber(s,{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 vr(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=Q1.noon:i===0?o=Q1.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=Q1.evening:i>=12?o=Q1.afternoon:i>=4?o=Q1.morning:o=Q1.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 gm.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):gm.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):vr(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):vr(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):gm.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):gm.s(e,n)},S:function(e,n){return gm.S(e,n)},X:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return Ope(s);case"XXXX":case"XX":return U0(s);case"XXXXX":case"XXX":default:return U0(s,":")}},x:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"x":return Ope(s);case"xxxx":case"xx":return U0(s);case"xxxxx":case"xxx":default:return U0(s,":")}},O:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Cpe(s,":");case"OOOO":default:return"GMT"+U0(s,":")}},z:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Cpe(s,":");case"zzzz":default:return"GMT"+U0(s,":")}},t:function(e,n,r,i){var o=i._originalDate||e,s=Math.floor(o.getTime()/1e3);return vr(s,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,s=o.getTime();return vr(s,n.length)}};function Cpe(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 s=e;return n+String(i)+s+vr(o,2)}function Ope(t,e){if(t%60===0){var n=t>0?"-":"+";return n+vr(Math.abs(t)/60,2)}return U0(t,e)}function U0(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=vr(Math.floor(i/60),2),s=vr(i%60,2);return r+o+n+s}var Epe=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"})}},yDe=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"})}},Lbt=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return Epe(e,n);var s;switch(i){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Epe(i,n)).replace("{{time}}",yDe(o,n))},Xq={p:yDe,P:Lbt},$bt=["D","DD"],Fbt=["YY","YYYY"];function xDe(t){return $bt.indexOf(t)!==-1}function bDe(t){return Fbt.indexOf(t)!==-1}function aN(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 Nbt={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"}},zbt=function(e,n,r){var i,o=Nbt[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 AW(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 jbt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bbt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ubt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Wbt={date:AW({formats:jbt,defaultWidth:"full"}),time:AW({formats:Bbt,defaultWidth:"full"}),dateTime:AW({formats:Ubt,defaultWidth:"full"})},Vbt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gbt=function(e,n,r,i){return Vbt[e]};function UE(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,s=n!=null&&n.width?String(n.width):o;i=t.formattingValues[s]||t.formattingValues[o]}else{var a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[l]||t.values[a]}var c=t.argumentCallback?t.argumentCallback(e):e;return i[c]}}var Hbt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qbt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xbt={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"]},Ybt={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"]},Qbt={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"}},Kbt={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"}},Zbt=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"},Jbt={ordinalNumber:Zbt,era:UE({values:Hbt,defaultWidth:"wide"}),quarter:UE({values:qbt,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:UE({values:Xbt,defaultWidth:"wide"}),day:UE({values:Ybt,defaultWidth:"wide"}),dayPeriod:UE({values:Qbt,defaultWidth:"wide",formattingValues:Kbt,defaultFormattingWidth:"wide"})};function WE(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 s=o[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?t1t(a,function(f){return f.test(s)}):e1t(a,function(f){return f.test(s)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=e.slice(s.length);return{value:c,rest:u}}}function e1t(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function t1t(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 s=t.valueCallback?t.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;var a=e.slice(i.length);return{value:s,rest:a}}}var r1t=/^(\d+)(th|st|nd|rd)?/i,i1t=/\d+/i,o1t={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},s1t={any:[/^b/i,/^(a|c)/i]},a1t={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},l1t={any:[/1/i,/2/i,/3/i,/4/i]},c1t={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},u1t={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]},f1t={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},d1t={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]},h1t={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},p1t={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}},g1t={ordinalNumber:n1t({matchPattern:r1t,parsePattern:i1t,valueCallback:function(e){return parseInt(e,10)}}),era:WE({matchPatterns:o1t,defaultMatchWidth:"wide",parsePatterns:s1t,defaultParseWidth:"any"}),quarter:WE({matchPatterns:a1t,defaultMatchWidth:"wide",parsePatterns:l1t,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:WE({matchPatterns:c1t,defaultMatchWidth:"wide",parsePatterns:u1t,defaultParseWidth:"any"}),day:WE({matchPatterns:f1t,defaultMatchWidth:"wide",parsePatterns:d1t,defaultParseWidth:"any"}),dayPeriod:WE({matchPatterns:h1t,defaultMatchWidth:"any",parsePatterns:p1t,defaultParseWidth:"any"})},rne={code:"en-US",formatDistance:zbt,formatLong:Wbt,formatRelative:Gbt,localize:Jbt,match:g1t,options:{weekStartsOn:0,firstWeekContainsDate:1}},m1t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,v1t=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,y1t=/^'([^]*?)'?$/,x1t=/''/g,b1t=/[a-zA-Z]/;function w1t(t,e,n){var r,i,o,s,a,l,c,u,f,d,h,p,g,m,v,y,x,b;At(2,arguments);var w=String(e),_=Uh(),S=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:_.locale)!==null&&r!==void 0?r:rne,O=qn((o=(s=(a=(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&&a!==void 0?a:_.firstWeekContainsDate)!==null&&s!==void 0?s:(f=_.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=qn((h=(p=(g=(m=n==null?void 0:n.weekStartsOn)!==null&&m!==void 0?m:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&g!==void 0?g:_.weekStartsOn)!==null&&p!==void 0?p:(x=_.locale)===null||x===void 0||(b=x.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&h!==void 0?h:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var E=Ft(t);if(!hDe(E))throw new RangeError("Invalid time value");var P=dDe(E),A=pDe(E,P),R={firstWeekContainsDate:O,weekStartsOn:k,locale:S,_originalDate:E},T=w.match(v1t).map(function(M){var I=M[0];if(I==="p"||I==="P"){var z=Xq[I];return z(M,S.formatLong)}return M}).join("").match(m1t).map(function(M){if(M==="''")return"'";var I=M[0];if(I==="'")return _1t(M);var z=Ibt[I];if(z)return!(n!=null&&n.useAdditionalWeekYearTokens)&&bDe(M)&&aN(M,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&xDe(M)&&aN(M,e,String(t)),z(A,M,S.localize,R);if(I.match(b1t))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");return M}).join("");return T}function _1t(t){var e=t.match(y1t);return e?e[1].replace(x1t,"'"):t}function S1t(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 C1t(t){At(1,arguments);var e=Ft(t),n=e.getDate();return n}function wDe(t){At(1,arguments);var e=Ft(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 O1t(t){At(1,arguments);var e=Ft(t),n=e.getHours();return n}function E1t(t){At(1,arguments);var e=Ft(t),n=e.getMilliseconds();return n}function T1t(t){At(1,arguments);var e=Ft(t),n=e.getMinutes();return n}function k1t(t){At(1,arguments);var e=Ft(t),n=e.getMonth();return n}function A1t(t){At(1,arguments);var e=Ft(t),n=e.getSeconds();return n}function P1t(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Ft(t),f=u.getFullYear(),d=Uh(),h=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(f+1,0,h),p.setHours(0,0,0,0);var g=bA(p,e),m=new Date(0);m.setFullYear(f,0,h),m.setHours(0,0,0,0);var v=bA(m,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function M1t(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Uh(),f=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.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=P1t(t,e),h=new Date(0);h.setFullYear(d,0,f),h.setHours(0,0,0,0);var p=bA(h,e);return p}var R1t=6048e5;function D1t(t,e){At(1,arguments);var n=Ft(t),r=bA(n,e).getTime()-M1t(n,e).getTime();return Math.round(r/R1t)+1}function I1t(t){return At(1,arguments),Ft(t).getFullYear()}function PW(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getTime()>r.getTime()}function MW(t,e){At(2,arguments);var n=Ft(t),r=Ft(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,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return s=c.done,c},e:function(c){a=!0,o=c},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}function Xn(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&&AF(t,e)}function lN(t){return lN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lN(t)}function SDe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SDe=function(){return!!t})()}function $1t(t,e){if(e&&(Pg(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bt(t)}function Yn(t){var e=SDe();return function(){var n,r=lN(t);if(e){var i=lN(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $1t(this,n)}}function Fn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F1t(t,e){for(var n=0;n0,r=n?e:1-e,i;if(r<=50)i=t||100;else{var o=r+50,s=Math.floor(o/100)*100,a=t>=o%100;i=t+s-(a?100:0)}return n?i:1-i}function TDe(t){return t%400===0||t%4===0&&t%100!==0}var U1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s){var a=i.getUTCFullYear();if(s.isTwoDigitYear){var l=EDe(s.year,a);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),W1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s,a){var l=nne(i,a);if(s.isTwoDigitYear){var c=EDe(s.year,l);return i.setUTCFullYear(c,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),db(i,a)}var u=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(u,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),db(i,a)}}]),n}(ur),V1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),q1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),X1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),Y1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function Q1t(t,e,n){At(2,arguments);var r=Ft(t),i=qn(e),o=vDe(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var K1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s,a){return db(Q1t(i,s,a),a)}}]),n}(ur);function Z1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e),i=mDe(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var J1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s){return DS(Z1t(i,s))}}]),n}(ur),ewt=[31,28,31,30,31,30,31,31,30,31,30,31],twt=[31,29,31,30,31,30,31,31,30,31,30,31],nwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=twt[l]:o>=1&&o<=ewt[l]}},{key:"set",value:function(i,o,s){return i.setUTCDate(s),i.setUTCHours(0,0,0,0),i}}]),n}(ur),rwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,s){return i.setUTCMonth(0,s),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function one(t,e,n){var r,i,o,s,a,l,c,u;At(2,arguments);var f=Uh(),d=qn((r=(i=(o=(s=n==null?void 0:n.weekStartsOn)!==null&&s!==void 0?s:n==null||(a=n.locale)===null||a===void 0||(l=a.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=Ft(t),p=qn(e),g=h.getUTCDay(),m=p%7,v=(m+7)%7,y=(v=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=one(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur),owt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=one(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur),swt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=one(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function awt(t,e){At(2,arguments);var n=qn(e);n%7===0&&(n=n-7);var r=1,i=Ft(t),o=i.getUTCDay(),s=n%7,a=(s+7)%7,l=(a=1&&o<=7}},{key:"set",value:function(i,o,s){return i=awt(i,s),i.setUTCHours(0,0,0,0),i}}]),n}(ur),cwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=12}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):!a&&s===12?i.setUTCHours(0,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n}(ur),hwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=23}},{key:"set",value:function(i,o,s){return i.setUTCHours(s,0,0,0),i}}]),n}(ur),pwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n}(ur),gwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=24}},{key:"set",value:function(i,o,s){var a=s<=24?s%24:s;return i.setUTCHours(a,0,0,0),i}}]),n}(ur),mwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCMinutes(s,0,0),i}}]),n}(ur),vwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCSeconds(s,0),i}}]),n}(ur),ywt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=qn((p=(g=(m=(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&&m!==void 0?m:O.weekStartsOn)!==null&&g!==void 0?g:(b=O.locale)===null||b===void 0||(w=b.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(S==="")return _===""?Ft(n):new Date(NaN);var A={firstWeekContainsDate:E,weekStartsOn:P,locale:k},R=[new j1t],T=S.match(Owt).map(function(K){var ee=K[0];if(ee in Xq){var re=Xq[ee];return re(K,k.formatLong)}return K}).join("").match(Cwt),M=[],I=Tpe(T),z;try{var F=function(){var ee=z.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&bDe(ee)&&aN(ee,S,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&xDe(ee)&&aN(ee,S,t);var re=ee[0],me=Swt[re];if(me){var te=me.incompatibleTokens;if(Array.isArray(te)){var ae=M.find(function(oe){return te.includes(oe.token)||oe.token===re});if(ae)throw new RangeError("The format string mustn't contain `".concat(ae.fullToken,"` and `").concat(ee,"` at the same time"))}else if(me.incompatibleTokens==="*"&&M.length>0)throw new RangeError("The format string mustn't contain `".concat(ee,"` and any other token at the same time"));M.push({token:re,fullToken:ee});var U=me.run(_,ee,k.match,A);if(!U)return{v:new Date(NaN)};R.push(U.setter),_=U.rest}else{if(re.match(Awt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+re+"`");if(ee==="''"?ee="'":re==="'"&&(ee=Mwt(ee)),_.indexOf(ee)===0)_=_.slice(ee.length);else return{v:new Date(NaN)}}};for(I.s();!(z=I.n()).done;){var N=F();if(Pg(N)==="object")return N.v}}catch(K){I.e(K)}finally{I.f()}if(_.length>0&&kwt.test(_))return new Date(NaN);var L=R.map(function(K){return K.priority}).sort(function(K,ee){return ee-K}).filter(function(K,ee,re){return re.indexOf(K)===ee}).map(function(K){return R.filter(function(ee){return ee.priority===K}).sort(function(ee,re){return re.subPriority-ee.subPriority})}).map(function(K){return K[0]}),B=Ft(n);if(isNaN(B.getTime()))return new Date(NaN);var $=pDe(B,dDe(B)),j={},X=Tpe(L),V;try{for(X.s();!(V=X.n()).done;){var Y=V.value;if(!Y.validate($,A))return new Date(NaN);var le=Y.set($,j,A);Array.isArray(le)?($=le[0],S1t(j,le[1])):$=le}}catch(K){X.e(K)}finally{X.f()}return $}function Mwt(t){return t.match(Ewt)[1].replace(Twt,"'")}function kpe(t){At(1,arguments);var e=Ft(t);return e.setMinutes(0,0,0),e}function Rwt(t,e){At(2,arguments);var n=kpe(t),r=kpe(e);return n.getTime()===r.getTime()}function Dwt(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Iwt(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getFullYear()===r.getFullYear()}function Lwt(t,e){At(2,arguments);var n=Ft(t).getTime(),r=Ft(e.start).getTime(),i=Ft(e.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}function $wt(t,e){var n;At(1,arguments);var r=qn((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=jwt(t),o;if(i.date){var s=Bwt(i.date,r);o=Uwt(s.restDateString,s.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var a=o.getTime(),l=0,c;if(i.time&&(l=Wwt(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=Vwt(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+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(a+l+c)}var OI={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fwt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Nwt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,zwt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function jwt(t){var e={},n=t.split(OI.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],OI.timeZoneDelimiter.test(e.date)&&(e.date=t.split(OI.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=OI.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function Bwt(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 Uwt(t,e){if(e===null)return new Date(NaN);var n=t.match(Fwt);if(!n)return new Date(NaN);var r=!!n[4],i=VE(n[1]),o=VE(n[2])-1,s=VE(n[3]),a=VE(n[4]),l=VE(n[5])-1;if(r)return Ywt(e,a,l)?Gwt(e,a,l):new Date(NaN);var c=new Date(0);return!qwt(e,o,s)||!Xwt(e,i)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(i,s)),c)}function VE(t){return t?parseInt(t):1}function Wwt(t){var e=t.match(Nwt);if(!e)return NaN;var n=RW(e[1]),r=RW(e[2]),i=RW(e[3]);return Qwt(n,r,i)?n*tne+r*ene+i*1e3:NaN}function RW(t){return t&&parseFloat(t.replace(",","."))||0}function Vwt(t){if(t==="Z")return 0;var e=t.match(zwt);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return Kwt(r,i)?n*(r*tne+i*ene):NaN}function Gwt(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 Hwt=[31,null,31,30,31,30,31,31,30,31,30,31];function kDe(t){return t%400===0||t%4===0&&t%100!==0}function qwt(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Hwt[e]||(kDe(t)?29:28))}function Xwt(t,e){return e>=1&&e<=(kDe(t)?366:365)}function Ywt(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function Qwt(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function Kwt(t,e){return e>=0&&e<=59}function Zwt(t,e){At(2,arguments);var n=Ft(t),r=qn(e),i=n.getFullYear(),o=n.getDate(),s=new Date(0);s.setFullYear(i,r,15),s.setHours(0,0,0,0);var a=wDe(s);return n.setMonth(r,Math.min(o,a)),n}function Jwt(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setDate(r),n}function e_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setHours(r),n}function t_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setMilliseconds(r),n}function n_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setMinutes(r),n}function r_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setSeconds(r),n}function i_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}const ADe={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 o_t(t,e){return t===e?!0:t!==null&&e!=null?t[0]===e[0]&&t[1]===e[1]:!1}function s_t(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 g=`${f}.${d}.${h}`;n.add(g);let m=null;p&&(m=`${f}.${d}.${p}`,n.add(m)),c.data.forEach(v=>{const y=aO(v.time),x=`${u!==null?u:f}-${y}`,b=i[x];b?i[x]={...b,[g]:v[h]}:i[x]={placeId:u,time:y,[g]:v[h]},m!==null&&(i[x][m]=v[p])})}const o=["placeId","time"].concat(Array.from(n).sort()),s=[];Object.keys(i).forEach(l=>{const c=i[l],u=new Array(o.length);o.forEach((f,d)=>{u[d]=c[f]}),s.push(u)}),s.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 a={};return r.forEach(l=>{a[l]=Rte(e,l)}),{colNames:o,dataRows:s,referencedPlaces:a}}function a_t(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 s=$wt(i).getTime();if(!Number.isNaN(s))for(const a of Object.getOwnPropertyNames(r.properties)){let l=r.properties[a];const c=typeof l;if(c==="boolean"?l=l?1:0:c!=="number"&&(l=Number.NaN),Number.isNaN(l))continue;const u={time:s,countTot:1,mean:l};e===null&&(e={});const f=e[a];f?f.data.push(u):e[a]={source:{datasetId:t.id,datasetTitle:t.title,variableName:a,placeId:null,geometry:null,valueDataKey:"mean",errorDataKey:null},data:[u],dataProgress:1}}}return e===null?null:{placeGroup:t,timeSeries:e}}const qM=t=>t.dataState.datasets||[],l_t=t=>t.dataState.colorBars,PDe=t=>t.dataState.timeSeriesGroups,XM=t=>t.dataState.userPlaceGroups,MDe=t=>t.dataState.userServers||[],c_t=t=>t.dataState.expressionCapabilities,u_t=t=>t.dataState.statistics.loading,f_t=t=>t.dataState.statistics.records,RDe=xt(qM,XM,(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]}),d_t=xt(RDe,t=>{const e=[];return t.forEach(n=>{const r=a_t(n);r!==null&&e.push(r)}),e}),h_t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",DDe=new Image;DDe.src=h_t;const Qq="_alpha",Kq="_r";function p_t(t){let e=t;const n=e.endsWith(Qq);n&&(e=e.slice(0,e.length-Qq.length));const r=e.endsWith(Kq);return r&&(e=e.slice(0,e.length-Kq.length)),{baseName:e,isAlpha:n,isReversed:r}}function uN(t){let e=t.baseName;return t.isReversed&&(e+=Kq),t.isAlpha&&(e+=Qq),e}function g_t(t,e,n){v_t(t,e).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const s=o.createPattern(DDe,"repeat");s!==null?o.fillStyle=s:o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),o.drawImage(i,0,0,n.width,n.height)}})})}function m_t(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=(s,a,l,c,u)=>{r(u)},i.src=`data:image/png;base64,${o}`})}function v_t(t,e){return m_t(t).then(n=>{const r=y_t(t,e,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function y_t(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 s=i.getImageData(0,0,r.width,r.height).data;if(t.isReversed){const a=new Uint8ClampedArray(s.length);for(let l=0;lt.controlState.selectedDatasetId,a1=t=>t.controlState.selectedVariableName,IDe=t=>t.controlState.selectedDataset2Id,sne=t=>t.controlState.selectedVariable2Name,ane=t=>t.controlState.selectedPlaceGroupIds,gO=t=>t.controlState.selectedPlaceId,YM=t=>t.controlState.selectedTime,x_t=t=>t.controlState.selectedServerId,b_t=t=>t.controlState.activities,B4=t=>t.controlState.timeAnimationActive,QM=t=>t.controlState.imageSmoothingEnabled,w_t=t=>t.controlState.userBaseMaps,__t=t=>t.controlState.userOverlays,lne=t=>t.controlState.selectedBaseMapId,cne=t=>t.controlState.selectedOverlayId,S_t=t=>!!t.controlState.layerVisibilities.baseMap,C_t=t=>!!t.controlState.layerVisibilities.datasetBoundary,O_t=t=>!!t.controlState.layerVisibilities.datasetVariable,E_t=t=>!!t.controlState.layerVisibilities.datasetVariable2,T_t=t=>!!t.controlState.layerVisibilities.datasetRgb,k_t=t=>!!t.controlState.layerVisibilities.datasetRgb2,A_t=t=>!!t.controlState.layerVisibilities.datasetPlaces,LDe=t=>!!t.controlState.layerVisibilities.userPlaces,P_t=t=>!!t.controlState.layerVisibilities.overlay,M_t=t=>t.controlState.layerVisibilities,$De=t=>t.controlState.infoCardElementStates,Uy=t=>t.controlState.mapProjection,R_t=t=>t.controlState.timeChunkSize,D_t=t=>t.controlState.userPlacesFormatName,I_t=t=>t.controlState.userPlacesFormatOptions.csv,L_t=t=>t.controlState.userPlacesFormatOptions.geojson,$_t=t=>t.controlState.userPlacesFormatOptions.wkt,l1=t=>t.controlState.userColorBars,F_t=t=>Pn.instance.branding.allowUserVariables,N_t=()=>"variable",z_t=()=>"variable2",j_t=()=>"rgb",B_t=()=>"rgb2",U_t=()=>13,W_t=()=>12,V_t=()=>11,G_t=()=>10,fo=xt(qM,pO,hA),Wy=xt(qM,IDe,hA),H_t=xt(fo,t=>t&&t.variables||[]),q_t=xt(fo,t=>t?Fte(t)[1]:[]),FDe=(t,e)=>!t||!e?null:Lq(t,e),za=xt(fo,a1,FDe),qg=xt(Wy,sne,FDe),NDe=t=>t&&(t.title||t.name),X_t=xt(za,NDe),Y_t=xt(qg,NDe),zDe=t=>t&&t.units||"-",Q_t=xt(za,zDe),K_t=xt(qg,zDe),jDe=t=>t&&t.colorBarName||"viridis",U4=xt(za,jDe),W4=xt(qg,jDe),BDe=t=>t?[t.colorBarMin,t.colorBarMax]:[0,1],UDe=xt(za,BDe),WDe=xt(qg,BDe),VDe=t=>(t&&t.colorBarNorm)==="log"?"log":"lin",GDe=xt(za,VDe),HDe=xt(qg,VDe),V4=xt(l1,l_t,(t,e)=>{const n={title:dRe,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:{}}}),qDe=(t,e,n)=>{const r=p_t(t),{baseName:i}=r,o=e.images[i],s=n.find(a=>a.id===i);if(s){const a=s.type,l=pRe(s.code);return{...r,imageData:o,type:a,colorRecords:l}}else{const a=e.customColorMaps[i];if(a){const l=a.type,c=a.colorRecords;return{...r,imageData:o,type:l,colorRecords:c}}}return{...r,imageData:o}},une=xt(U4,V4,l1,qDe),XDe=xt(W4,V4,l1,qDe),YDe=(t,e,n)=>{const{baseName:r}=t,i=n.find(o=>o.id===r);if(i){const o=pRe(i.code);if(o)return JSON.stringify({name:e,type:i.type,colors:o.map(s=>[s.value,s.color])})}return null},Z_t=xt(une,U4,l1,YDe),J_t=xt(XDe,W4,l1,YDe),QDe=t=>!t||typeof t.opacity!="number"?1:t.opacity,KDe=xt(za,QDe),ZDe=xt(qg,QDe),eSt=xt(fo,t=>t!==null?fRe(t):null),tSt=xt(fo,t=>t!==null&&t.rgbSchema||null),nSt=xt(Wy,t=>t!==null&&t.rgbSchema||null),JDe=xt(fo,t=>t&&t.placeGroups||[]),G4=xt(JDe,XM,(t,e)=>t.concat(e));function eIe(t,e){const n=[];return e!==null&&e.length>0&&t.forEach(r=>{e.indexOf(r.id)>-1&&n.push(r)}),n}const rSt=xt(XM,ane,LDe,(t,e)=>{const n={},r=new Set(e||[]);return t.forEach(i=>{n[i.id]=r.has(i.id)}),n}),tIe=xt(JDe,ane,eIe),mO=xt(G4,ane,eIe),iSt=xt(mO,t=>t.map(e=>e.title||e.id).join(", ")),KM=xt(mO,t=>{const e=t.map(n=>sO(n)?n.features:[]);return[].concat(...e)}),fne=xt(KM,gO,(t,e)=>t.find(n=>n.id===e)||null),oSt=xt(fne,t=>(t==null?void 0:t.geometry)||null),ZM=xt(mO,gO,(t,e)=>t.length===0||e===null?null:dgt(t,e)),sSt=xt(pO,a1,fne,(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}),nIe=xt(PDe,pO,a1,gO,(t,e,n,r)=>{if(!e||!n||!r)return!1;for(const i of t)for(const o of i.timeSeriesArray){const s=o.source;if(s.datasetId===e&&s.variableName===n&&s.placeId===r)return!1}return!0}),aSt=xt(PDe,G4,(t,e)=>{const n={};return Mte(e,(r,i)=>{for(const o of t)if(o.timeSeriesArray.find(s=>s.source.placeId===i.id)){n[i.id]=M4(r,i);break}}),n}),rIe=xt(pO,a1,gO,(t,e,n)=>!!(t&&e&&n)),lSt=xt(f_t,G4,(t,e)=>{const n=[];return t.forEach(r=>{const i=r.source.placeInfo.place.id;Mte(e,(o,s)=>{if(s.id===i){const a=M4(o,s);n.push({...r,source:{...r.source,placeInfo:a}})}})}),n}),cSt=xt(mO,t=>{const e=[];return Mte(t,(n,r)=>{e.push(M4(n,r).label)}),e}),uSt=xt(za,R_t,(t,e)=>{if(t&&t.timeChunkSize){const n=t.timeChunkSize;return n*Math.ceil(e/n)}return e}),iIe=t=>t&&uRe(t)||null,vO=xt(fo,iIe),fSt=xt(Wy,iIe),oIe=t=>t&&t.attributions||null,dne=xt(fo,oIe),dSt=xt(Wy,oIe),sIe=t=>t===null||t.coordinates.length===0?null:t.coordinates,Zq=xt(vO,sIe),hSt=xt(vO,sIe),aIe=(t,e)=>t===null||e===null?-1:cDe(e,t),lIe=xt(YM,Zq,aIe),pSt=xt(YM,hSt,aIe),cIe=(t,e,n)=>t===null?null:n&&e>-1?n.labels[e]:new Date(t).toISOString(),c1=xt(YM,lIe,vO,cIe),gSt=xt(YM,pSt,fSt,cIe);function mSt(t,e){if(t!==ite){const n=typeof e=="number"?e+1:20;return new Zte({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 vSt(t,e,n,r,i,o,s,a,l){return new dO({url:t,projection:e,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:s,maxZoom:l})}function ySt(t){if(t)return(e,n)=>{e instanceof Ute&&(t.getView().getInteracting()?t.once("moveend",function(){e.getImage().src=n}):e.getImage().src=n)}}const xSt=kvt(ySt,{serializer:t=>{const e=t[0];if(e){const n=e.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function bSt(){const t=Hs.map;return xSt(t)}function uIe(t,e,n,r,i,o,s,a,l,c,u,f,d=10){a!==null&&(o=[...o,["time",a]]);const h=By(e,o);typeof i=="number"&&(i+=3);const p=mSt(c,i),g=vSt(h,c,p,u,l,f,bSt(),r,i),m=c===rO?n:aMe(n,"EPSG:4326",c);return C.jsx(lDe,{id:t,source:g,extent:m,zIndex:d,opacity:s})}const wSt=xt(fo,Uy,C_t,(t,e,n)=>{if(!t||!n)return null;let r=t.geometry;if(!r)if(t.bbox){const[s,a,l,c]=t.bbox;r={type:"Polygon",coordinates:[[[s,a],[l,a],[l,c],[s,c],[s,a]]]}}else return console.warn(`Dataset ${t.id} has no bbox!`),null;const i=new GM({features:new s1({dataProjection:rO,featureProjection:e}).readFeatures({type:"Feature",geometry:r})}),o=new Zd({stroke:new ph({color:"orange",width:3,lineDash:[2,4]})});return C.jsx(z4,{id:`${t.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),zi=xt(MDe,x_t,(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}),fIe=(t,e,n,r,i,o,s,a,l,c,u,f,d,h,p,g)=>{if(!e||!i||!u)return null;const m=[["crs",p],["vmin",`${s[0]}`],["vmax",`${s[1]}`],["cmap",l||o]];return a==="log"&&m.push(["norm",a]),uIe(f,hIe(t.url,e,i),e.bbox,i.tileLevelMin,i.tileLevelMax,m,c,n,h,p,r,g,d)},_St=xt(zi,fo,c1,dne,za,U4,UDe,GDe,Z_t,KDe,O_t,N_t,U_t,B4,Uy,QM,fIe),SSt=xt(zi,Wy,gSt,dSt,qg,W4,WDe,HDe,J_t,ZDe,E_t,z_t,W_t,B4,Uy,QM,fIe),dIe=(t,e,n,r,i,o,s,a,l,c,u)=>{if(!e||!n||!r)return null;const f=[["crs",l]];return uIe(i,hIe(t.url,e,"rgb"),e.bbox,n.tileLevelMin,n.tileLevelMax,f,1,s,a,l,c,u,o)},CSt=xt(zi,fo,tSt,T_t,j_t,V_t,c1,B4,Uy,dne,QM,dIe),OSt=xt(zi,Wy,nSt,k_t,B_t,G_t,c1,B4,Uy,dne,QM,dIe);function hIe(t,e,n){return`${t}/tiles/${cO(e)}/${BM(n)}/{z}/{y}/{x}`}function ESt(){return nte()}function TSt(){return new WM({fill:gIe(),stroke:pIe(),radius:6})}function pIe(){return new ph({color:[200,0,0,.75],width:1.25})}function gIe(){return new fb({color:[255,0,0,ESt()]})}function kSt(){return new Zd({image:TSt(),stroke:pIe(),fill:gIe()})}const ASt=xt(tIe,Uy,A_t,(t,e,n)=>{if(!n||t.length===0)return null;const r=[];return t.forEach((i,o)=>{sO(i)&&r.push(C.jsx(z4,{id:`placeGroup.${i.id}`,style:kSt(),zIndex:100,source:new GM({features:new s1({dataProjection:rO,featureProjection:e}).readFeatures(i)})},o))}),C.jsx(iDe,{children:r})}),PSt=xt($De,t=>{const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].visible&&e.push(n)}),e}),MSt=xt($De,t=>{const e={};return Object.getOwnPropertyNames(t).forEach(n=>{e[n]=t[n].viewMode||"text"}),e}),RSt=xt(b_t,t=>Object.keys(t).map(e=>t[e])),hne=xt(w_t,t=>[...t,...VPe]),pne=xt(__t,t=>[...t,...Pdt]),mIe=(t,e,n,r)=>{if(!n||!e)return null;const i=UF(t,e);if(!i)return null;let o=i.attribution;o&&(o.startsWith("http://")||o.startsWith("https://"))&&(o=`© ${i.group}`);let s;if(i.wms){const{layerName:a,styleName:l}=i.wms;s=new tbt({url:i.url,params:{...l?{STYLES:l}:{},LAYERS:a},attributions:o,attributionsCollapsible:!0})}else{const a=Tdt(i.group);s=new dO({url:i.url+(a?`?${a.param}=${a.token}`:""),attributions:o,attributionsCollapsible:!0})}return C.jsx(lDe,{id:i.id,source:s,zIndex:r})},DSt=xt(hne,lne,S_t,()=>0,mIe),ISt=xt(pne,cne,P_t,()=>20,mIe),vIe=(t,e)=>{const n=UF(t,e);return n?BF(n):null},LSt=xt(hne,lne,vIe),$St=xt(pne,cne,vIe),FSt=xt(LSt,$St,lne,cne,fo,Wy,za,qg,M_t,(t,e,n,r,i,o,s,a,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&&s?`${i.title} / ${s.title||s.name}`:void 0,visible:l.datasetVariable,disabled:!(i&&s)},datasetVariable2:{title:"Dataset Variable",subTitle:o&&a?`${o.title} / ${a.title||a.name}`:void 0,visible:l.datasetVariable2,disabled:!(o&&a),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 yIe={exports:{}};/*! +`){I+=M,M=0,A=d*w+P*h,++F;continue}var j=p[L+1]||l.font;j!==N&&(i&&R.push("font",j),r&&T.push("font",j),N=j),M=Math.max(M,x[z]);var X=[$,A+P*y[z]+d*(y[z]-b[F]),.5*(h+M)+I];A+=y[z],i&&R.push("strokeText",X),r&&T.push("fillText",X),++z}return Array.prototype.push.apply(_,R),Array.prototype.push.apply(_,T),this.labels_[o]=k,k},t.prototype.replayTextBackground_=function(e,n,r,i,o,s,a){e.beginPath(),e.moveTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,o),e.lineTo.apply(e,n),s&&(this.alignFill_=s[2],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(e,n,r,i,o,s,a,l,c,u,f,d,h,p,g,m){a*=d[0],l*=d[1];var v=r-a,y=i-l,x=o+c>e?e-c:o,b=s+u>n?n-u:s,w=p[3]+x*d[0]+p[1],_=p[0]+b*d[1]+p[2],S=v-p[3],O=y-p[0];(g||f!==0)&&(um[0]=S,fm[0]=S,um[1]=O,cp[1]=O,cp[0]=S+w,up[0]=cp[0],up[1]=O+_,fm[1]=up[1]);var k;return f!==0?(k=Ig(dh(),r,i,1,1,f,-r,-i),Bi(k,um),Bi(k,cp),Bi(k,up),Bi(k,fm),Bf(Math.min(um[0],cp[0],up[0],fm[0]),Math.min(um[1],cp[1],up[1],fm[1]),Math.max(um[0],cp[0],up[0],fm[0]),Math.max(um[1],cp[1],up[1],fm[1]),q1)):Bf(Math.min(S,S+w),Math.min(O,O+_),Math.max(S,S+w),Math.max(O,O+_),q1),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:q1[0],minY:q1[1],maxX:q1[2],maxY:q1[3],value:m},canvasTransform:k,scale:d}},t.prototype.replayImageOrLabel_=function(e,n,r,i,o,s,a){var l=!!(s||a),c=i.declutterBox,u=e.canvas,f=a?a[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,um,cp,up,fm,s,a),Bvt(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=Bi(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],s=this.createLabel(e,n,i,r),a=this.strokeStates[r],l=this.pixelRatio,c=spe(Array.isArray(e)?e[0]:e,o.textAlign||vA),u=nk[o.textBaseline||nN],f=a&&a.lineWidth?a.lineWidth:0,d=s.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*s.height/l+2*(.5-u)*f;return{label:s,anchorX:h,anchorY:p}},t.prototype.execute_=function(e,n,r,i,o,s,a,l){var c;this.pixelCoordinates_&&r1(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Lx(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),Qdt(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,g,m,v,y,x,b,w,_,S,O,k=0,E=0,P=null,A=null,R=this.coordinateCache_,T=this.viewRotation_,M=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,I={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},z=this.instructions!=i||this.overlaps?0:200,F,N,L,B;uz&&(this.fill_(e),k=0),E>z&&(e.stroke(),E=0),!k&&!E&&(e.beginPath(),m=NaN,v=NaN),++u;break;case Wt.CIRCLE:d=$[1];var X=c[d],V=c[d+1],Y=c[d+2],le=c[d+3],K=Y-X,ee=le-V,re=Math.sqrt(K*K+ee*ee);e.moveTo(X+re,V),e.arc(X,V,re,0,2*Math.PI,!0),++u;break;case Wt.CLOSE_PATH:e.closePath(),++u;break;case Wt.CUSTOM:d=$[1],h=$[2];var me=$[3],te=$[4],ae=$.length==6?$[5]:void 0;I.geometry=me,I.feature=F,u in R||(R[u]=[]);var U=R[u];ae?ae(c,d,h,2,U):(U[0]=c[d],U[1]=c[d+1],U.length=2),te(U,I),++u;break;case Wt.DRAW_IMAGE:d=$[1],h=$[2],b=$[3],p=$[4],g=$[5];var oe=$[6],ne=$[7],G=$[8],q=$[9],Z=$[10],de=$[11],xe=$[12],H=$[13],W=$[14],J=$[15];if(!b&&$.length>=20){w=$[19],_=$[20],S=$[21],O=$[22];var se=this.drawLabelWithPointPlacement_(w,_,S,O);b=se.label,$[3]=b;var ye=$[23];p=(se.anchorX-ye)*this.pixelRatio,$[4]=p;var ie=$[24];g=(se.anchorY-ie)*this.pixelRatio,$[5]=g,oe=b.height,$[6]=oe,H=b.width,$[13]=H}var fe=void 0;$.length>25&&(fe=$[25]);var Q=void 0,_e=void 0,we=void 0;$.length>17?(Q=$[16],_e=$[17],we=$[18]):(Q=gx,_e=!1,we=!1),Z&&M?de+=T:!Z&&!M&&(de-=T);for(var Ie=0;d0){if(!s||h!=="Image"&&h!=="Text"||s.indexOf(_)!==-1){var P=(d[k]-3)/4,A=i-P%a,R=i-(P/a|0),T=o(_,S,A*A+R*R);if(T)return T}u.clearRect(0,0,a,a);break}}var g=Object.keys(this.executorsByZIndex_).map(Number);g.sort(lb);var m,v,y,x,b;for(m=g.length-1;m>=0;--m){var w=g[m].toString();for(y=this.executorsByZIndex_[w],v=vW.length-1;v>=0;--v)if(h=vW[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],s=n[3],a=[r,i,r,s,o,s,o,i];return Lx(a,0,8,2,e,a),a},t.prototype.isEmpty=function(){return PS(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,s,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(lb),this.maxExtent_&&(e.save(),this.clip(e,r));var c=s||vW,u,f,d,h,p,g;for(a&&l.reverse(),u=0,f=l.length;un)break;var a=r[s];a||(a=[],r[s]=a),a.push(((t+i)*e+(t+o))*4+3),i>0&&a.push(((t-i)*e+(t+o))*4+3),o>0&&(a.push(((t+i)*e+(t-o))*4+3),i>0&&a.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=lpe(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=lpe(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function lpe(t,e,n){var r=n?wRe(n):"null";return e+":"+t+":"+r}var oN=new kyt,Ayt=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)}}(),Pyt=function(t){Ayt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.extent=n,s.pixelRatio_=i,s.resolution=r,s.state=o,s}return e.prototype.changed=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return $t()},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(){$t()},e}(rO),Myt=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){Myt(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,i,jr.IDLE)||this;return l.src_=o,l.image_=new Image,s!==null&&(l.image_.crossOrigin=s),l.unlisten_=null,l.state=jr.IDLE,l.imageLoadFunction_=a,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=jr.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Cu(this.extent)/this.image_.height),this.state=jr.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==jr.IDLE||this.state==jr.ERROR)&&(this.state=jr.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Bte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=Cu(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(Pyt);function Bte(t,e,n){var r=t,i=!0,o=!1,s=!1,a=[WF(r,nn.LOAD,function(){s=!0,o||e()})];return r.src&&Xdt?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(s?e():n())})):a.push(WF(r,nn.ERROR,n)),function(){i=!1,a.forEach(si)}}var Ryt=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)}}(),zE=null,Dyt=function(t){Ryt(e,t);function e(n,r,i,o,s,a){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_=a,l.unlisten_=null,l.imageState_=s,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===jr.LOADED){zE||(zE=Sc(1,1)),zE.drawImage(this.image_,0,0);try{zE.getImageData(0,0,1,1),this.tainted_=!1}catch{zE=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=jr.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=jr.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=Sc(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_==jr.IDLE){this.imageState_=jr.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Bte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==jr.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=wRe(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),s=o.data,a=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=s.length;f0,6);var f=i.src!==void 0?jr.IDLE:jr.LOADED;return r.color_=i.color!==void 0?eN(i.color):null,r.iconImage_=Iyt(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:Lc.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_==Gm.FRACTION||this.anchorYUnits_==Gm.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==Gm.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==Gm.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=Lc.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==Lc.TOP_RIGHT||this.anchorOrigin_==Lc.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==Lc.BOTTOM_LEFT||this.anchorOrigin_==Lc.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_!=Lc.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==Lc.TOP_RIGHT||this.offsetOrigin_==Lc.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==Lc.BOTTOM_LEFT||this.offsetOrigin_==Lc.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(nn.CHANGE,n)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(nn.CHANGE,n)},e}(bRe),zd=.5;function Fyt(t,e,n,r,i,o,s){var a=t[0]*zd,l=t[1]*zd,c=Sc(a,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new Tyt(c,zd,i,null,s),d=n.length,h=Math.floor((256*256*256-1)/d),p={},g=1;g<=d;++g){var m=n[g-1],v=m.getStyleFunction()||r;if(r){var y=v(m,o);if(y){Array.isArray(y)||(y=[y]);for(var x=g*h,b="#"+("000000"+x.toString(16)).slice(-6),w=0,_=y.length;w<_;++w){var S=y[w],O=S.getGeometryFunction()(m);if(!(!O||!va(i,O.getExtent()))){var k=S.clone(),E=k.getFill();E&&E.setColor(b);var P=k.getStroke();P&&(P.setColor(b),P.setLineDash(null)),k.setText(void 0);var A=S.getImage();if(A&&A.getOpacity()!==0){var R=A.getImageSize();if(!R)continue;var T=Sc(R[0],R[1],void 0,{alpha:!1}),M=T.canvas;T.fillStyle=b,T.fillRect(0,0,M.width,M.height),k.setImage(new $yt({img:M,imgSize:R,anchor:A.getAnchor(),anchorXUnits:Gm.PIXELS,anchorYUnits:Gm.PIXELS,offset:A.getOrigin(),opacity:1,size:A.getSize(),scale:A.getScale(),rotation:A.getRotation(),rotateWithView:A.getRotateWithView()}))}var I=k.getZIndex()||0,z=p[I];z||(z={},p[I]=z,z.Polygon=[],z.Circle=[],z.LineString=[],z.Point=[]),z[O.getType().replace("Multi","")].push(O,k)}}}}}for(var F=Object.keys(p).map(Number).sort(lb),g=0,N=F.length;gg[2];)++y,x=v*y,f.push(this.getRenderTransform(o,s,a,zd,d,h,x).slice()),m-=v}this.hitDetectionImageData_=Fyt(i,f,this.renderedFeatures_,u.getStyleFunction(),c,s,a)}r(Nyt(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s){var a=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(g,m,v){var y=or(g),x=f[y];if(x){if(x!==!0&&vw[0]&&O[2]>w[2]&&b.push([O[0]-_,O[1],O[2]-_,O[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==m&&l_(this.wrappedRenderedExtent_,y))return r1(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var k=new rpe(jq(d,h),y,d,h),E;this.getLayer().getDeclutter()&&(E=new rpe(jq(d,h),y,d,h));for(var P,A,R,A=0,R=b.length;A=200&&a.status<300){var c=e.getType(),u=void 0;c=="json"||c=="text"?u=a.responseText:c=="xml"?(u=a.responseXML,u||(u=new DOMParser().parseFromString(a.responseText,"application/xml"))):c=="arraybuffer"&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function dpe(t,e){return function(n,r,i,o,s){var a=this;r0t(t,e,n,r,i,function(l,c){a.addFeatures(l),o!==void 0&&o(l)},s||cb)}}var $Re=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)}}(),dm=function(t){$Re(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(jh),GM=function(t){$Re(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_=cb,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&&(bn(r.format_,7),r.loader_=dpe(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:t0t;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new upe:null,r.loadedExtentsRtree_=new upe,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var s,a;return Array.isArray(i.features)?a=i.features:i.features&&(s=i.features,a=s.getArray()),!o&&s===void 0&&(s=new nu(a)),a!==void 0&&r.addFeaturesInternal(a),s!==void 0&&r.bindFeaturesCollection_(s),r}return e.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},e.prototype.addFeatureInternal=function(n){var r=or(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 dm(Hu.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[zn(r,nn.CHANGE,this.handleFeatureChange_,this),zn(r,AS.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&&(bn(!(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=[],s=0,a=n.length;s0},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(lA(o.extent,n))return i=o,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(n){if(n){var r=or(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=or(n),i=this.featureChangeKeys_[r];if(i){i.forEach(si),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new dm(Hu.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){bn(this.format_,7),this.url_=n,this.setLoader(dpe(n,this.format_))},e}(LRe);function hm(t,e){return Bi(t.inversePixelTransform,e.slice(0))}const Xt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function FRe(t){return Math.pow(t,3)}function cO(t){return 1-FRe(1-t)}function i0t(t){return 3*t*t-2*t*t*t}function o0t(t){return t}var s0t=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)}}(),NRe=function(t){s0t(e,t);function e(n,r,i){var o=t.call(this)||this,s=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=s.transition===void 0?250:s.transition,o.transitionStarts_={},o.interpolate=!!s.interpolate,o}return e.prototype.changed=function(){this.dispatchEvent(nn.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()==Xt.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()==Xt.LOADED){n.interimTile=null;break}else n.getState()==Xt.LOADING?r=n:n.getState()==Xt.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!==Xt.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},e.prototype.load=function(){$t()},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:FRe(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}(rO),a0t=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)}}(),Ute=function(t){a0t(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,a)||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_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(n){this.image_=n,this.state=Xt.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=Xt.ERROR,this.unlistenImage_(),this.image_=l0t(),this.changed()},e.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=Xt.LOADED:this.state=Xt.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Xt.ERROR&&(this.state=Xt.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Xt.IDLE&&(this.state=Xt.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Bte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(NRe);function l0t(){var t=Sc(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var c0t=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],s=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(s,o),this.initialVelocity_=Math.sqrt(o*o+s*s)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),u0t=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)}}(),f0t=function(t){u0t(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){$t()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;Ig(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),ate(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s,a,l,c){var u,f=r.viewState;function d(M,I,z,F){return s.call(a,I,M?z:null,F)}var h=f.projection,p=oMe(n.slice(),h),g=[[0,0]];if(h.canWrapX()&&o){var m=h.getExtent(),v=ei(m);g.push([-v,0],[v,0])}for(var y=r.layerStatesArray,x=y.length,b=[],w=[],_=0;_=0;--S){var O=y[S],k=O.layer;if(k.hasRenderer()&&iN(O,f)&&l.call(c,k)){var E=k.getRenderer(),P=k.getSource();if(E&&P){var A=P.getWrapX()?p:n,R=d.bind(null,O.managed);w[0]=A[0]+g[_][0],w[1]=A[1]+g[_][1],u=E.forEachFeatureAtCoordinate(w,r,i,R,b)}if(u)return u}}if(b.length!==0){var T=1/b.length;return b.forEach(function(M,I){return M.distanceSq+=I*T}),b.sort(function(M,I){return M.distanceSq-I.distanceSq}),b.some(function(M){return u=M.callback(M.feature,M.layer,M.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){return $t()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,s,a){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Dx,this,s,a);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){$t()},e.prototype.scheduleExpireIconCache=function(n){oN.canExpireCache()&&n.postRenderFunctions.push(d0t)},e}(ote);function d0t(t,e){oN.expire()}var h0t=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)}}(),p0t=function(t){h0t(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=zn(Cp,AS.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=UM+" 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 MRe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){si(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(Fv.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=[],s=null,a=0,l=r.length;a=0;--a)o[a].renderDeclutter(n);Lvt(this.element_,this.children_),this.dispatchRenderEvent(Fv.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){for(var a=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&iN(f,a)&&s(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var g=o(d,p);if(g)return g}}}},e}(f0t),zRe=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)}}(),Hm=function(t){zRe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(jh),xW={LAYERS:"layers"},$4=function(t){zRe(e,t);function e(n){var r=this,i=n||{},o=pi({},i);delete o.layers;var s=i.layers;return r=t.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(xW.LAYERS,r.handleLayersChanged_),s?Array.isArray(s)?s=new nu(s.slice(),{unique:!0}):bn(typeof s.getArray=="function",43):s=new nu(void 0,{unique:!0}),r.setLayers(s),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(si),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push(zn(n,Ya.ADD,this.handleLayersAdd_,this),zn(n,Ya.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(si);IM(this.listenerKeys_);for(var i=n.getArray(),o=0,s=i.length;othis.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(si(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(nn.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(si(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(si),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(rO);const Mm={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},$s={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var sN=1/0,x0t=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,IM(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){bn(!(this.keyFunction_(e)in this.queuedElements_),31);var n=this.priorityFunction_(e);return n!=sN?(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],s=r[e],a=e;e>1;){var l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=ce;){var a=this.getParentIndex_(n);if(i[a]>s)r[n]=r[a],i[n]=i[a],n=a;else break}r[n]=o,i[n]=s},t.prototype.reprioritize=function(){var e=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,s,a,l;for(a=0;a0;)s=this.dequeue()[0],a=s.getKey(),o=s.getState(),o===Xt.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,s.load())},e}(x0t);function _0t(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return sN;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}const qu={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var S0t=42,Wte=256;function hpe(t,e,n){return function(r,i,o,s,a){if(r){if(!i&&!e)return r;var l=e?0:o[0]*i,c=e?0:o[1]*i,u=a?a[0]:0,f=a?a[1]:0,d=t[0]+l/2+u,h=t[2]-l/2+u,p=t[1]+c/2+f,g=t[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>g&&(p=(g+p)/2,g=p);var m=oo(r[0],d,h),v=oo(r[1],p,g);if(s&&n&&i){var y=30*i;m+=-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]-g)/y)}return[m,v]}}}function C0t(t){return t}function Vte(t,e,n,r){var i=ei(e)/n[0],o=Cu(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function Gte(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),oo(r,n/2,e*2)}function O0t(t,e,n,r){return function(i,o,s,a){if(i!==void 0){var l=t[0],c=t[t.length-1],u=n?Vte(l,n,s,r):l;if(a){var f=e!==void 0?e:!0;return f?Gte(i,u,c):oo(i,c,u)}var d=Math.min(u,i),h=Math.floor(ste(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_[Bs.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(Bs.ANIMATING,-this.hints_[Bs.ANIMATING]);for(var n,r=0,i=this.animations_.length;r=0;--i){for(var o=this.animations_[i],s=!0,a=0,l=o.length;a0?u/c.duration:1;f>=1?(c.complete=!0,f=1):s=!1;var d=c.easing(f);if(c.sourceCenter){var h=c.sourceCenter[0],p=c.sourceCenter[1],g=c.targetCenter[0],m=c.targetCenter[1];this.nextCenter_=c.targetCenter;var v=h+d*(g-h),y=p+d*(m-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()),w=this.constraints_.resolution(x,0,b,!0);this.targetCenter_=this.calculateCenterZoom(w,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=x,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){var _=d===1?$v(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+d*(c.targetRotation-c.sourceRotation);if(c.anchor){var S=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(S,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=_}if(this.applyTargetState_(!0),r=!0,!c.complete)break}}if(s){this.animations_[i]=null,this.setHint(Bs.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var O=o[0].callback;O&&xI(O,!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]],pte(i,n-this.getRotation()),Sht(i,r)),i},e.prototype.calculateCenterZoom=function(n,r){var i,o=this.getCenterInternal(),s=this.getResolution();if(o!==void 0&&s!==void 0){var a=r[0]-n*(r[0]-o[0])/s,l=r[1]-n*(r[1]-o[1])/s;i=[a,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&&wq(n,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(qu.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 lMe(r,this.getProjection())},e.prototype.calculateExtentInternal=function(n){var r=n||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();bn(i,1);var o=this.getResolution();bn(o!==void 0,2);var s=this.getRotation();return bn(s!==void 0,3),vq(i,o,s,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(qu.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(hx(n,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=ei(n)/i[0],s=Cu(n)/i[1];return Math.max(o,s)},e.prototype.getResolutionForValueFunction=function(n){var r=n||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/Math.log(r);return function(a){var l=i/Math.pow(r,a*s);return l}},e.prototype.getRotation=function(){return this.get(qu.ROTATION)},e.prototype.getValueForResolutionFunction=function(n){var r=Math.log(n||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/r;return function(a){var l=Math.log(i/a)/r/s;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(),s=this.padding_;if(s){var a=this.getViewportSizeMinusPadding_();o=wW(o,this.getViewportSize_(),[a[0]/2+s[3],a[1]/2+s[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 s=ste(this.resolutions_,n,1);r=s,i=this.resolutions_[s],s==this.resolutions_.length-1?o=2:o=i/this.resolutions_[s+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=oo(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,oo(n-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,n-this.minZoom_)},e.prototype.fit=function(n,r){var i;if(bn(Array.isArray(n)||typeof n.getSimplifiedGeometry=="function",24),Array.isArray(n)){bn(!hte(n),25);var o=hx(n,this.getProjection());i=Oq(o)}else if(n.getType()==="Circle"){var o=hx(n.getExtent(),this.getProjection());i=Oq(o),i.rotate(this.getRotation(),ty(o))}else{var s=Dht();s?i=n.clone().transform(s,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),s=n.getFlatCoordinates(),a=n.getStride(),l=1/0,c=1/0,u=-1/0,f=-1/0,d=0,h=s.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 s=n.viewHints;if(s[Bs.ANIMATING]||s[Bs.INTERACTING]){var a=Date.now()-n.time>8;i=a?0:8,o=a?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!r1(r,this.renderedAttributions_)){Ivt(this.ulElement_);for(var o=0,s=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:cO}):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 s=this.element.classList.contains(gI);!s&&i===0?this.element.classList.add(gI):s&&i!==0&&this.element.classList.remove(gI)}this.label_.style.transform=o}this.rotation_=i}},e}(F4),U0t=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)}}(),W0t=function(t){U0t(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",s=i.delta!==void 0?i.delta:1,a=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=a,h.setAttribute("type","button"),h.title=f,h.appendChild(typeof c=="string"?document.createTextNode(c):c),h.addEventListener(nn.CLICK,r.handleClick_.bind(r,s),!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(nn.CLICK,r.handleClick_.bind(r,-s),!1);var g=o+" "+UM+" "+jte,m=r.element;return m.className=g,m.appendChild(h),m.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 s=i.getConstrainedZoom(o+n);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:cO})):i.setZoom(s)}}},e}(F4),V0t=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)}}(),_W="units",m0={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},G0t=[1,2,5],jE=25.4/.28,H0t=function(t){V0t(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+" "+UM,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(_W,r.handleUnitsChanged_),r.setUnits(i.units||m0.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(_W)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(n){this.set(_W,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(),s=o==m0.DEGREES?$o.DEGREES:$o.METERS,a=HF(i,n.resolution,r,s),l=this.minWidth_*(this.dpi_||jE)/jE,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||jE)/jE:void 0,u=l*a,f="";if(o==m0.DEGREES){var d=jf[$o.DEGREES];u*=d,u=c){p=v,g=y,m=x;break}else if(g>=l)break;v=p,y=g,x=m,++h}var w;this.scaleBar_?w=this.createScaleBar(g,p,f):w=p.toFixed(m<0?-m:0)+" "+f,this.renderedHTML_!=w&&(this.innerElement_.innerHTML=w,this.renderedHTML_=w),this.renderedWidth_!=g&&(this.innerElement_.style.width=g+"px",this.renderedWidth_=g),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(),s=[],a=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&&s.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+s.join("")+"
";return f},e.prototype.createMarker=function(n,r){var i=n==="absolute"?3:-10;return'
'},e.prototype.createStepText=function(n,r,i,o,s){var a=n===0?0:Math.round(o/this.scaleBarSteps_*n*100)/100,l=a+(n===0?"":" "+s),c=n===0?-3:r/this.scaleBarSteps_*-1,u=n===0?0:r/this.scaleBarSteps_*2;return'
'+l+"
"},e.prototype.getScaleForResolution=function(){var n=HF(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,$o.METERS),r=this.dpi_||jE,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}(F4);function q0t(t){var e={},n=new nu,r=e.zoom!==void 0?e.zoom:!0;r&&n.push(new W0t(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&n.push(new B0t(e.rotateOptions));var o=e.attribution!==void 0?e.attribution:!0;return o&&n.push(new z0t(e.attributionOptions)),n}const Uq={ACTIVE:"active"};var X0t=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)}}(),HM=function(t){X0t(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(Uq.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(n){return!0},e.prototype.setActive=function(n){this.set(Uq.ACTIVE,n)},e.prototype.setMap=function(n){this.map_=n},e}(Bh);function Y0t(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:o0t,center:t.getConstrainedCenter(i)})}}function qte(t,e,n,r){var i=t.getZoom();if(i!==void 0){var o=t.getConstrainedZoom(i+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:r!==void 0?r:250,easing:cO})}}var Q0t=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)}}(),K0t=function(t){Q0t(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==hr.DBLCLICK){var i=n.originalEvent,o=n.map,s=n.coordinate,a=i.shiftKey?-this.delta_:this.delta_,l=o.getView();qte(l,a,s,this.duration_),i.preventDefault(),r=!0}return!r},e}(HM),Z0t=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)}}(),uO=function(t){Z0t(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==hr.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==hr.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==hr.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==hr.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}(HM);function Xte(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}(uO),ixt=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)}}(),oxt=function(t){ixt(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,{stopDown:DM})||this,r.condition_=i.condition?i.condition:J0t,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){if(SW(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==Hte){var o=r.getSize(),s=n.pixel,a=Math.atan2(o[1]/2-s[1],s[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=a-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=a}}},e.prototype.handleUpEvent=function(n){if(!SW(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(n){if(!SW(n))return!1;if(VRe(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(uO),sxt=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)}}(),axt=function(t){sxt(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 ny([o])},e.prototype.getGeometry=function(){return this.geometry_},e}(ote),qRe=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)}}(),bI={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},CW=function(t){qRe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return e}(jh),lxt=function(t){qRe(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new axt(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:VRe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(n,r,i){var o=i[0]-r[0],s=i[1]-r[1];return o*o+s*s>=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 CW(bI.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 CW(r?bI.BOXEND:bI.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 CW(bI.BOXSTART,n.coordinate,n)),!0):!1},e.prototype.onBoxEnd=function(n){},e}(uO),cxt=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)}}(),uxt=function(t){cxt(e,t);function e(n){var r=this,i=n||{},o=i.condition?i.condition:GRe;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 s=i.rotatedExtentForGeometry(o),a=i.getResolutionForExtentInternal(s),l=i.getResolution()/a;o=o.clone(),o.scale(l*l)}i.fitInternal(o,{duration:this.duration_,easing:cO})},e}(lxt);const v0={LEFT:37,UP:38,RIGHT:39,DOWN:40};var fxt=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)}}(),dxt=function(t){fxt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return Yte(o)&&HRe(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==nn.KEYDOWN){var i=n.originalEvent,o=i.keyCode;if(this.condition_(n)&&(o==v0.DOWN||o==v0.LEFT||o==v0.RIGHT||o==v0.UP)){var s=n.map,a=s.getView(),l=a.getResolution()*this.pixelDelta_,c=0,u=0;o==v0.DOWN?u=-l:o==v0.LEFT?c=-l:o==v0.RIGHT?c=l:u=l;var f=[c,u];pte(f,a.getRotation()),Y0t(a,f,this.duration_),i.preventDefault(),r=!0}}return!r},e}(HM),hxt=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)}}(),pxt=function(t){hxt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:HRe,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==nn.KEYDOWN||n.type==nn.KEYPRESS){var i=n.originalEvent,o=i.charCode;if(this.condition_(n)&&(o==43||o==45)){var s=n.map,a=o==43?this.delta_:-this.delta_,l=s.getView();qte(l,a,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(HM),gxt=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)}}(),OW={TRACKPAD:"trackpad",WHEEL:"wheel"},mxt=function(t){gxt(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:WRe;return r.condition_=i.onFocusOnly?Wq(URe,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!==nn.WHEEL)return!0;var i=n.map,o=n.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=n.coordinate);var s;if(n.type==nn.WHEEL&&(s=o.deltaY,Vdt&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=YPe),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;var a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?OW.TRACKPAD:OW.WHEEL);var l=i.getView();if(this.mode_===OW.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(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=s;var c=Math.max(this.timeout_-(a-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=-oo(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),qte(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}(HM),vxt=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)}}(),yxt=function(t){vxt(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=DM),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],s=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(this.lastAngle_!==void 0){var a=s-this.lastAngle_;this.rotationDelta_+=a,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=a}this.lastAngle_=s;var l=n.map,c=l.getView();if(c.getConstraints().rotation!==Hte){var u=l.getViewport().getBoundingClientRect(),f=Xte(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}(uO),xxt=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)}}(),bxt=function(t){xxt(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=DM),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],s=i.clientX-o.clientX,a=i.clientY-o.clientY,l=Math.sqrt(s*s+a*a);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=Xte(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}(uO),wxt=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)}}(),Qte=function(t){wxt(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 s=r||0;o.setCenterAndRadius(n,s,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 s=this.flatCoordinates,a=n-s[0],l=r-s[1],c=a*a+l*l;if(c=i[0]||n[1]<=i[1]&&n[3]>=i[1]?!0:cte(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 s=1;s=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===hr.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===hr.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===hr.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===hr.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===hr.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 Pp(hr.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_===Vn.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],s=r[1]-i[1],a=o*o+s*s;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=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_],s=this.mode_;if(s===Vn.POINT)r=!0;else if(s===Vn.CIRCLE)r=this.sketchCoords_.length===2;else if(s===Vn.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(s===Vn.POLYGON){var a=this.sketchCoords_;i=a[0].length>this.minPoints_,o=[a[0][0],a[0][a[0].length-2]]}if(i)for(var l=this.getMap(),c=0,u=o.length;c=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),this.geometryFunction_(s,r,i)):a===Vn.POLYGON&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),o&&(this.finishCoordinate_=s[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===Vn.LINE_STRING||o===Vn.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var s=this.finishCoordinate_.slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}this.geometryFunction_(i,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o===Vn.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var a=this.sketchLine_.getGeometry();if(i.length>=2){var s=i[i.length-2].slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}a.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_===Vn.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,o)):this.mode_===Vn.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,o),r=i.getCoordinates()),this.type_==="MultiPoint"?n.setGeometry(new P4([r])):this.type_==="MultiLineString"?n.setGeometry(new Ete([r])):this.type_==="MultiPolygon"&&n.setGeometry(new Tte([r])),this.dispatchEvent(new _I(wI.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 _I(wI.DRAWABORT,n))},e.prototype.appendCoordinates=function(n){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(n[0]);var o;if(r===Vn.LINE_STRING||r===Vn.CIRCLE)o=this.sketchCoords_;else if(r===Vn.POLYGON)o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&o.shift(),o.pop();for(var s=0;s0&&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 bn(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 bn(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){bn(!(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 vpe(t,e,n,r){return r!==void 0?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function N4(t,e,n){return t+"/"+e+"/"+n}function YRe(t){return N4(t[0],t[1],t[2])}function kxt(t){return t.split("/").map(Number)}function QRe(t){return(t[1]<n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return o?o.containsXY(r,i):!0}var Pxt=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)}}(),KRe=function(t){Pxt(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=kxt(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(YRe(o.tileCoord)),o.release())}).bind(this))}},e}(Txt),Kte=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 X1(t,e,n,r,i){return i!==void 0?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new Kte(t,e,n,r)}var Mxt=.5,Rxt=10,ype=.25,Dxt=function(){function t(e,n,r,i,o,s){this.sourceProj_=e,this.targetProj_=n;var a={},l=cA(this.targetProj_,this.sourceProj_);this.transformInv_=function(x){var b=x[0]+"/"+x[1];return a[b]||(a[b]=l(x)),a[b]},this.maxSourceExtent_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&ei(i)==ei(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ei(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ei(this.targetProj_.getExtent()):null;var c=o1(r),u=dte(r),f=fte(r),d=ute(r),h=this.transformInv_(c),p=this.transformInv_(u),g=this.transformInv_(f),m=this.transformInv_(d),v=Rxt+(s?Math.max(0,Math.ceil(lht(mq(r)/(s*s*256*256)))):0);if(this.addQuad_(c,u,f,d,h,p,g,m,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(x,b,w){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 w=Math.min(b[0][0],b[1][0],b[2][0]),_=Math.max(b[0][0],b[1][0],b[2][0]);_-w.5&&f<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var g=_he([e,n,r,i]),m=ei(g)/this.targetWorldWidth_;p=m>ype||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>ype||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!va(u,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(v=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(s[0])||!isFinite(s[1])?4:0)+(!isFinite(a[0])||!isFinite(a[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 w=($v(o[0],d)+$v(a[0],d))/2;b=w-$v(x[0],d)}else b=(o[0]+a[0])/2-x[0];var _=(o[1]+a[1])/2-x[1],S=b*b+_*_;p=S>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var O=[(n[0]+r[0])/2,(n[1]+r[1])/2],k=this.transformInv_(O),E=[(i[0]+e[0])/2,(i[1]+e[1])/2],P=this.transformInv_(E);this.addQuad_(e,n,O,E,o,s,k,P,c-1),this.addQuad_(E,O,r,i,P,k,a,l,c-1)}else{var A=[(e[0]+n[0])/2,(e[1]+n[1])/2],R=this.transformInv_(A),T=[(r[0]+i[0])/2,(r[1]+i[1])/2],M=this.transformInv_(T);this.addQuad_(e,A,T,i,o,R,M,l,c-1),this.addQuad_(A,n,r,T,R,s,a,M,c-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}v&11||this.addTriangle_(e,r,i,o,a,l),v&14||this.addTriangle_(e,r,n,o,a,s),v&&(v&13||this.addTriangle_(n,i,e,s,l,o),v&7||this.addTriangle_(n,i,r,s,l,a))}},t.prototype.calculateSourceExtent=function(){var e=_c();return this.triangles_.forEach(function(n,r,i){var o=n.source;ek(e,o[0]),ek(e,o[1]),ek(e,o[2])}),e},t.prototype.getTriangles=function(){return this.triangles_},t}(),Vq={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Ixt={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},EW,ZRe=[];function xpe(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 TW(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function Lxt(){if(EW===void 0){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",xpe(t,4,5,4,0),xpe(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;EW=TW(e,0)||TW(e,4)||TW(e,8)}return EW}function Gq(t,e,n,r){var i=T4(n,e,t),o=HF(e,r,n),s=e.getMetersPerUnit();s!==void 0&&(o*=s);var a=t.getMetersPerUnit();a!==void 0&&(o/=a);var l=t.getExtent();if(!l||$M(l,i)){var c=HF(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function $xt(t,e,n,r){var i=ty(n),o=Gq(t,e,i,r);return(!isFinite(o)||o<=0)&&cte(n,function(s){return o=Gq(t,e,s,r),isFinite(o)&&o>0}),o}function Fxt(t,e,n,r,i,o,s,a,l,c,u,f){var d=Sc(Math.round(n*t),Math.round(n*e),ZRe);if(f||pi(d,Vq),l.length===0)return d.canvas;d.scale(n,n);function h(b){return Math.round(b*n)/n}d.globalCompositeOperation="lighter";var p=_c();l.forEach(function(b,w,_){eMe(p,b.extent)});var g=ei(p),m=Cu(p),v=Sc(Math.round(n*g/r),Math.round(n*m/r));f||pi(v,Vq);var y=n/r;l.forEach(function(b,w,_){var S=b.extent[0]-p[0],O=-(b.extent[3]-p[3]),k=ei(b.extent),E=Cu(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,S*y,O*y,k*y,E*y)});var x=o1(s);return a.getTriangles().forEach(function(b,w,_){var S=b.source,O=b.target,k=S[0][0],E=S[0][1],P=S[1][0],A=S[1][1],R=S[2][0],T=S[2][1],M=h((O[0][0]-x[0])/o),I=h(-(O[0][1]-x[1])/o),z=h((O[1][0]-x[0])/o),F=h(-(O[1][1]-x[1])/o),N=h((O[2][0]-x[0])/o),L=h(-(O[2][1]-x[1])/o),B=k,$=E;k=0,E=0,P-=B,A-=$,R-=B,T-=$;var j=[[P,A,0,0,z-M],[R,T,0,0,N-M],[0,0,P,A,F-I],[0,0,R,T,L-I]],X=uht(j);if(X){if(d.save(),d.beginPath(),Lxt()||!f){d.moveTo(z,F);for(var V=4,Y=M-z,le=I-F,K=0;K=this.minZoom;){if(this.zoomFactor_===2?(s=Math.floor(s/2),a=Math.floor(a/2),o=X1(s,s,a,a,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(s/a[0],o/a[1]),c=i+1,u=new Array(c),f=0;fi.highWaterMark&&(i.highWaterMark=n)},e.prototype.useTile=function(n,r,i,o){},e}(LRe),Gxt=function(t){nDe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.tile=r,i}return e}(jh);function Hxt(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){if(s)return t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var c=s[0],u=e.getFullTileRange(c);bn(u,55);var f=u.getHeight()-s[2]-1;return f.toString()})}}function qxt(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 s=o.getResolution(n[0]),a=o.getTileCoordExtent(n,this.tmpExtent_),l=ec(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=Ghe(l,c,this.tmpSize),a=aA(a,s*c,a)),r!=1&&(l=xRe(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:SI,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return pi(u,this.params_),this.getRequestUrl_(n,l,a,r,i,u)}},e}(rDe);function iDe(t){return C.jsx(D.Fragment,{children:t.children})}const CI={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var nbt=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)}}(),rbt=function(t){nbt(e,t);function e(n){var r=this,i=n||{},o=pi({},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(CI.PRELOAD)},e.prototype.setPreload=function(n){this.set(CI.PRELOAD,n)},e.prototype.getUseInterimTilesOnError=function(){return this.get(CI.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(n){this.set(CI.USE_INTERIM_TILES_ON_ERROR,n)},e.prototype.getData=function(n){return t.prototype.getData.call(this,n)},e}(I4),ibt=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)}}(),obt=function(t){ibt(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=_c(),r.tmpTileRange_=new Kte(0,0,0,0),r}return e.prototype.isDrawableTile=function(n){var r=this.getLayer(),i=n.getState(),o=r.getUseInterimTilesOnError();return i==Xt.LOADED||i==Xt.EMPTY||i==Xt.ERROR&&!o},e.prototype.getTile=function(n,r,i,o){var s=o.pixelRatio,a=o.viewState.projection,l=this.getLayer(),c=l.getSource(),u=c.getTile(n,r,i,s,a);return u.getState()==Xt.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):u.setState(Xt.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=Bi(r.pixelToCoordinateTransform,n.slice()),s=i.getExtent();if(s&&!$M(s,o))return null;for(var a=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),g=u.getTile(h,p[1],p[2],a,l);if(!(g instanceof Ute||g instanceof JRe))return null;if(g.getState()===Xt.LOADED){var m=f.getOrigin(h),v=ec(f.getTileSize(h)),y=f.getResolution(h),x=Math.floor(d*((o[0]-m[0])/y-p[1]*v[0])),b=Math.floor(d*((m[1]-o[1])/y-p[2]*v[1])),w=Math.round(d*u.getGutterForProjection(c.projection));return this.getImageData(g.getImage(),x+w,b+w)}}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,s=o.projection,a=o.resolution,l=o.center,c=o.rotation,u=n.pixelRatio,f=this.getLayer(),d=f.getSource(),h=d.getRevision(),p=d.getTileGridForProjection(s),g=p.getZForResolution(a,d.zDirection),m=p.getResolution(g),v=n.extent,y=n.viewState.resolution,x=d.getTilePixelRatio(u),b=Math.round(ei(v)/y*u),w=Math.round(Cu(v)/y*u),_=i.extent&&hx(i.extent);_&&(v=tk(v,hx(i.extent)));var S=m*b/2/x,O=m*w/2/x,k=[l[0]-S,l[1]-O,l[0]+S,l[1]+O],E=p.getTileRangeForExtentAndZ(v,g),P={};P[g]={};var A=this.createLoadedTileFinder(d,s,P),R=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var M=c?yq(o.center,y,c,n.size):void 0,I=E.minX;I<=E.maxX;++I)for(var z=E.minY;z<=E.maxY;++z)if(!(c&&!p.tileCoordIntersectsViewport([g,I,z],M))){var F=this.getTile(g,I,z,n);if(this.isDrawableTile(F)){var N=or(this);if(F.getState()==Xt.LOADED){P[g][F.tileCoord.toString()]=F;var L=F.inTransition(N);L&&i.opacity!==1&&(F.endTransition(N),L=!1),!this.newTiles_&&(L||this.renderedTiles.indexOf(F)===-1)&&(this.newTiles_=!0)}if(F.getAlpha(N,n.time)===1)continue}var B=p.getTileCoordChildTileRange(F.tileCoord,T,R),$=!1;B&&($=A(g+1,B)),$||p.forEachTileCoordParentTileRange(F.tileCoord,A,T,R)}var j=m/a*u/x;Ig(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-b/2,-w/2);var X=KPe(this.pixelTransform);this.useContainer(r,X,this.getBackground(n));var V=this.context,Y=V.canvas;ate(this.inversePixelTransform,this.pixelTransform),Ig(this.tempTransform,b/2,w/2,j,j,0,-b/2,-w/2),Y.width!=b||Y.height!=w?(Y.width=b,Y.height=w):this.containerReused||V.clearRect(0,0,b,w),_&&this.clipUnrotated(V,n,_),d.getInterpolate()||pi(V,Vq),this.preRender(V,n),this.renderedTiles.length=0;var le=Object.keys(P).map(Number);le.sort(lb);var K,ee,re;i.opacity===1&&(!this.containerReused||d.getOpaque(n.viewState.projection))?le=le.reverse():(K=[],ee=[]);for(var me=le.length-1;me>=0;--me){var te=le[me],ae=d.getTilePixelSize(te,u,s),U=p.getResolution(te),oe=U/m,ne=ae[0]*oe*j,G=ae[1]*oe*j,q=p.getTileCoordForCoordAndZ(o1(k),te),Z=p.getTileCoordExtent(q),de=Bi(this.tempTransform,[x*(Z[0]-k[0])/m,x*(k[3]-Z[3])/m]),xe=x*d.getGutterForProjection(s),H=P[te];for(var W in H){var F=H[W],J=F.tileCoord,se=q[1]-J[1],ye=Math.round(de[0]-(se-1)*ne),ie=q[2]-J[2],fe=Math.round(de[1]-(ie-1)*G),I=Math.round(de[0]-se*ne),z=Math.round(de[1]-ie*G),Q=ye-I,_e=fe-z,we=g===te,L=we&&F.getAlpha(or(this),n.time)!==1,Ie=!1;if(!L)if(K){re=[I,z,I+Q,z,I+Q,z+_e,I,z+_e];for(var Pe=0,Re=K.length;Pe{const r=this.props.onClick;r&&r(n)});gn(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()});gn(this,"handleRef",n=>{this.contextValue.mapDiv=n});gn(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)}});gn(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 s=this.contextValue.mapObjects[n];s instanceof mpe&&(i=s,i.setTarget(r),this.clickEventsKey&&i.un("click",this.clickEventsKey.listener))}if(!i){const s=this.getMinZoom(r),a=new jd({projection:GPe,center:[0,0],minZoom:s,zoom:s});i=new mpe({view:a,...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=C.jsx(sDe.Provider,{value:this.contextValue,children:this.props.children})),C.jsx("div",{ref:this.handleRef,style:ubt,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 dO extends D.PureComponent{constructor(){super(...arguments);gn(this,"context",{});gn(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}}gn(dO,"contextType",sDe);function aDe(t,e,n){Y1(t,e,n,"visible",!0),Y1(t,e,n,"opacity",1),Y1(t,e,n,"zIndex",void 0),Y1(t,e,n,"extent",void 0),Y1(t,e,n,"minResolution",void 0),Y1(t,e,n,"maxResolution",void 0)}function Y1(t,e,n,r,i){const o=wpe(e[r],i),s=wpe(n[r],i);o!==s&&t.set(r,s)}function wpe(t,e){return t===void 0?e:t}let Ha;Ha=()=>{};class lDe extends dO{addMapObject(e){const n=new oDe(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 s=!0;if(i instanceof Hq&&o instanceof Hq){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(dbt(f,d)){Ha("--> Equal tile grids!");const h=c.getUrls(),p=u.getUrls();h!==p&&p&&(h===null||h[0]!==p[0])&&(c.setUrls(p),s=!1);const g=c.getTileLoadFunction(),m=u.getTileLoadFunction();g!==m&&(c.setTileLoadFunction(m),s=!1);const v=c.getTileUrlFunction(),y=u.getTileUrlFunction();v!==y&&(c.setTileUrlFunction(y),s=!1)}else Ha("--> Tile grids are not equal!")}const a=i==null?void 0:i.getInterpolate(),l=o==null?void 0:o.getInterpolate();a!==l&&(s=!0),s?(n.setSource(o),Ha("--> Replaced source (expect flickering!)")):Ha("--> Updated source (check, is it still flickering?)")}return aDe(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}new fO({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new fO({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 cbt;new fO({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function dbt(t,e){if(t===e)return!0;if(t===null||e===null||(Ha("tile grid:",t,e),Ha("min zoom:",t.getMinZoom(),e.getMinZoom()),Ha("max zoom:",t.getMaxZoom(),e.getMaxZoom()),t.getMinZoom()!==e.getMinZoom()||t.getMaxZoom()!==e.getMaxZoom()))return!1;const n=t.getExtent(),r=e.getExtent();Ha("extent:",n,r);for(let a=0;a=t[i])return i;let o=Math.floor(n/2),s;for(let a=0;as)[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 qn(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 At(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function Ft(t){At(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||Pg(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 uDe(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function fDe(t,e){At(2,arguments);var n=Ft(t),r=qn(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 s=o.getDate();return i>=s?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function j4(t,e){At(2,arguments);var n=Ft(t).getTime(),r=qn(e);return new Date(n+r)}var hbt=36e5;function pbt(t,e){At(2,arguments);var n=qn(e);return j4(t,n*hbt)}var gbt={};function Uh(){return gbt}function xA(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Uh(),f=qn((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.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=Ft(t),h=d.getDay(),p=(h=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Ft(t),h=d.getDay(),p=(h=i.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function Pbt(t){At(1,arguments);var e=gDe(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=DS(n);return r}var Mbt=6048e5;function mDe(t){At(1,arguments);var e=Ft(t),n=DS(e).getTime()-Pbt(e).getTime();return Math.round(n/Mbt)+1}function db(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Uh(),f=qn((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.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=Ft(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 g=db(p,e),m=new Date(0);m.setUTCFullYear(f,0,h),m.setUTCHours(0,0,0,0);var v=db(m,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function Rbt(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Uh(),f=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.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=nne(t,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=db(h,e);return p}var Dbt=6048e5;function vDe(t,e){At(1,arguments);var n=Ft(t),r=db(n,e).getTime()-Rbt(n,e).getTime();return Math.round(r/Dbt)+1}function vr(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?r:1-r;return vr(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):vr(r+1,2)},d:function(e,n){return vr(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 vr(e.getUTCHours()%12||12,n.length)},H:function(e,n){return vr(e.getUTCHours(),n.length)},m:function(e,n){return vr(e.getUTCMinutes(),n.length)},s:function(e,n){return vr(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 vr(o,n.length)}},Q1={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ibt={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 gm.y(e,n)},Y:function(e,n,r,i){var o=nne(e,i),s=o>0?o:1-o;if(n==="YY"){var a=s%100;return vr(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):vr(s,n.length)},R:function(e,n){var r=gDe(e);return vr(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return vr(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 vr(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 vr(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 gm.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 vr(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=vDe(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):vr(o,n.length)},I:function(e,n,r){var i=mDe(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):vr(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):gm.d(e,n)},D:function(e,n,r){var i=Abt(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):vr(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(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return vr(s,2);case"eo":return r.ordinalNumber(s,{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(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return vr(s,n.length);case"co":return r.ordinalNumber(s,{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 vr(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=Q1.noon:i===0?o=Q1.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=Q1.evening:i>=12?o=Q1.afternoon:i>=4?o=Q1.morning:o=Q1.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 gm.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):gm.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):vr(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):vr(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):gm.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):gm.s(e,n)},S:function(e,n){return gm.S(e,n)},X:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return Ope(s);case"XXXX":case"XX":return U0(s);case"XXXXX":case"XXX":default:return U0(s,":")}},x:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"x":return Ope(s);case"xxxx":case"xx":return U0(s);case"xxxxx":case"xxx":default:return U0(s,":")}},O:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Cpe(s,":");case"OOOO":default:return"GMT"+U0(s,":")}},z:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Cpe(s,":");case"zzzz":default:return"GMT"+U0(s,":")}},t:function(e,n,r,i){var o=i._originalDate||e,s=Math.floor(o.getTime()/1e3);return vr(s,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,s=o.getTime();return vr(s,n.length)}};function Cpe(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 s=e;return n+String(i)+s+vr(o,2)}function Ope(t,e){if(t%60===0){var n=t>0?"-":"+";return n+vr(Math.abs(t)/60,2)}return U0(t,e)}function U0(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=vr(Math.floor(i/60),2),s=vr(i%60,2);return r+o+n+s}var Epe=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"})}},yDe=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"})}},Lbt=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return Epe(e,n);var s;switch(i){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Epe(i,n)).replace("{{time}}",yDe(o,n))},Xq={p:yDe,P:Lbt},$bt=["D","DD"],Fbt=["YY","YYYY"];function xDe(t){return $bt.indexOf(t)!==-1}function bDe(t){return Fbt.indexOf(t)!==-1}function aN(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 Nbt={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"}},zbt=function(e,n,r){var i,o=Nbt[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 AW(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 jbt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bbt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ubt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Wbt={date:AW({formats:jbt,defaultWidth:"full"}),time:AW({formats:Bbt,defaultWidth:"full"}),dateTime:AW({formats:Ubt,defaultWidth:"full"})},Vbt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gbt=function(e,n,r,i){return Vbt[e]};function BE(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,s=n!=null&&n.width?String(n.width):o;i=t.formattingValues[s]||t.formattingValues[o]}else{var a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[l]||t.values[a]}var c=t.argumentCallback?t.argumentCallback(e):e;return i[c]}}var Hbt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qbt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xbt={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"]},Ybt={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"]},Qbt={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"}},Kbt={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"}},Zbt=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"},Jbt={ordinalNumber:Zbt,era:BE({values:Hbt,defaultWidth:"wide"}),quarter:BE({values:qbt,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:BE({values:Xbt,defaultWidth:"wide"}),day:BE({values:Ybt,defaultWidth:"wide"}),dayPeriod:BE({values:Qbt,defaultWidth:"wide",formattingValues:Kbt,defaultFormattingWidth:"wide"})};function UE(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 s=o[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?t1t(a,function(f){return f.test(s)}):e1t(a,function(f){return f.test(s)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=e.slice(s.length);return{value:c,rest:u}}}function e1t(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function t1t(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 s=t.valueCallback?t.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;var a=e.slice(i.length);return{value:s,rest:a}}}var r1t=/^(\d+)(th|st|nd|rd)?/i,i1t=/\d+/i,o1t={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},s1t={any:[/^b/i,/^(a|c)/i]},a1t={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},l1t={any:[/1/i,/2/i,/3/i,/4/i]},c1t={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},u1t={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]},f1t={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},d1t={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]},h1t={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},p1t={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}},g1t={ordinalNumber:n1t({matchPattern:r1t,parsePattern:i1t,valueCallback:function(e){return parseInt(e,10)}}),era:UE({matchPatterns:o1t,defaultMatchWidth:"wide",parsePatterns:s1t,defaultParseWidth:"any"}),quarter:UE({matchPatterns:a1t,defaultMatchWidth:"wide",parsePatterns:l1t,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:UE({matchPatterns:c1t,defaultMatchWidth:"wide",parsePatterns:u1t,defaultParseWidth:"any"}),day:UE({matchPatterns:f1t,defaultMatchWidth:"wide",parsePatterns:d1t,defaultParseWidth:"any"}),dayPeriod:UE({matchPatterns:h1t,defaultMatchWidth:"any",parsePatterns:p1t,defaultParseWidth:"any"})},rne={code:"en-US",formatDistance:zbt,formatLong:Wbt,formatRelative:Gbt,localize:Jbt,match:g1t,options:{weekStartsOn:0,firstWeekContainsDate:1}},m1t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,v1t=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,y1t=/^'([^]*?)'?$/,x1t=/''/g,b1t=/[a-zA-Z]/;function w1t(t,e,n){var r,i,o,s,a,l,c,u,f,d,h,p,g,m,v,y,x,b;At(2,arguments);var w=String(e),_=Uh(),S=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:_.locale)!==null&&r!==void 0?r:rne,O=qn((o=(s=(a=(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&&a!==void 0?a:_.firstWeekContainsDate)!==null&&s!==void 0?s:(f=_.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=qn((h=(p=(g=(m=n==null?void 0:n.weekStartsOn)!==null&&m!==void 0?m:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&g!==void 0?g:_.weekStartsOn)!==null&&p!==void 0?p:(x=_.locale)===null||x===void 0||(b=x.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&h!==void 0?h:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var E=Ft(t);if(!hDe(E))throw new RangeError("Invalid time value");var P=dDe(E),A=pDe(E,P),R={firstWeekContainsDate:O,weekStartsOn:k,locale:S,_originalDate:E},T=w.match(v1t).map(function(M){var I=M[0];if(I==="p"||I==="P"){var z=Xq[I];return z(M,S.formatLong)}return M}).join("").match(m1t).map(function(M){if(M==="''")return"'";var I=M[0];if(I==="'")return _1t(M);var z=Ibt[I];if(z)return!(n!=null&&n.useAdditionalWeekYearTokens)&&bDe(M)&&aN(M,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&xDe(M)&&aN(M,e,String(t)),z(A,M,S.localize,R);if(I.match(b1t))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");return M}).join("");return T}function _1t(t){var e=t.match(y1t);return e?e[1].replace(x1t,"'"):t}function S1t(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 C1t(t){At(1,arguments);var e=Ft(t),n=e.getDate();return n}function wDe(t){At(1,arguments);var e=Ft(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 O1t(t){At(1,arguments);var e=Ft(t),n=e.getHours();return n}function E1t(t){At(1,arguments);var e=Ft(t),n=e.getMilliseconds();return n}function T1t(t){At(1,arguments);var e=Ft(t),n=e.getMinutes();return n}function k1t(t){At(1,arguments);var e=Ft(t),n=e.getMonth();return n}function A1t(t){At(1,arguments);var e=Ft(t),n=e.getSeconds();return n}function P1t(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Ft(t),f=u.getFullYear(),d=Uh(),h=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(f+1,0,h),p.setHours(0,0,0,0);var g=xA(p,e),m=new Date(0);m.setFullYear(f,0,h),m.setHours(0,0,0,0);var v=xA(m,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function M1t(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Uh(),f=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.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=P1t(t,e),h=new Date(0);h.setFullYear(d,0,f),h.setHours(0,0,0,0);var p=xA(h,e);return p}var R1t=6048e5;function D1t(t,e){At(1,arguments);var n=Ft(t),r=xA(n,e).getTime()-M1t(n,e).getTime();return Math.round(r/R1t)+1}function I1t(t){return At(1,arguments),Ft(t).getFullYear()}function PW(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getTime()>r.getTime()}function MW(t,e){At(2,arguments);var n=Ft(t),r=Ft(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,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return s=c.done,c},e:function(c){a=!0,o=c},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}function Xn(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&&AF(t,e)}function lN(t){return lN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lN(t)}function SDe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SDe=function(){return!!t})()}function $1t(t,e){if(e&&(Pg(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bt(t)}function Yn(t){var e=SDe();return function(){var n,r=lN(t);if(e){var i=lN(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $1t(this,n)}}function Fn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F1t(t,e){for(var n=0;n0,r=n?e:1-e,i;if(r<=50)i=t||100;else{var o=r+50,s=Math.floor(o/100)*100,a=t>=o%100;i=t+s-(a?100:0)}return n?i:1-i}function TDe(t){return t%400===0||t%4===0&&t%100!==0}var U1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s){var a=i.getUTCFullYear();if(s.isTwoDigitYear){var l=EDe(s.year,a);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),W1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s,a){var l=nne(i,a);if(s.isTwoDigitYear){var c=EDe(s.year,l);return i.setUTCFullYear(c,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),db(i,a)}var u=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(u,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),db(i,a)}}]),n}(ur),V1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),q1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),X1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),Y1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function Q1t(t,e,n){At(2,arguments);var r=Ft(t),i=qn(e),o=vDe(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var K1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s,a){return db(Q1t(i,s,a),a)}}]),n}(ur);function Z1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e),i=mDe(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var J1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s){return DS(Z1t(i,s))}}]),n}(ur),ewt=[31,28,31,30,31,30,31,31,30,31,30,31],twt=[31,29,31,30,31,30,31,31,30,31,30,31],nwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=twt[l]:o>=1&&o<=ewt[l]}},{key:"set",value:function(i,o,s){return i.setUTCDate(s),i.setUTCHours(0,0,0,0),i}}]),n}(ur),rwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,s){return i.setUTCMonth(0,s),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function one(t,e,n){var r,i,o,s,a,l,c,u;At(2,arguments);var f=Uh(),d=qn((r=(i=(o=(s=n==null?void 0:n.weekStartsOn)!==null&&s!==void 0?s:n==null||(a=n.locale)===null||a===void 0||(l=a.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=Ft(t),p=qn(e),g=h.getUTCDay(),m=p%7,v=(m+7)%7,y=(v=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=one(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur),owt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=one(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur),swt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=one(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function awt(t,e){At(2,arguments);var n=qn(e);n%7===0&&(n=n-7);var r=1,i=Ft(t),o=i.getUTCDay(),s=n%7,a=(s+7)%7,l=(a=1&&o<=7}},{key:"set",value:function(i,o,s){return i=awt(i,s),i.setUTCHours(0,0,0,0),i}}]),n}(ur),cwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=12}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):!a&&s===12?i.setUTCHours(0,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n}(ur),hwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=23}},{key:"set",value:function(i,o,s){return i.setUTCHours(s,0,0,0),i}}]),n}(ur),pwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n}(ur),gwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=24}},{key:"set",value:function(i,o,s){var a=s<=24?s%24:s;return i.setUTCHours(a,0,0,0),i}}]),n}(ur),mwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCMinutes(s,0,0),i}}]),n}(ur),vwt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCSeconds(s,0),i}}]),n}(ur),ywt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=qn((p=(g=(m=(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&&m!==void 0?m:O.weekStartsOn)!==null&&g!==void 0?g:(b=O.locale)===null||b===void 0||(w=b.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(S==="")return _===""?Ft(n):new Date(NaN);var A={firstWeekContainsDate:E,weekStartsOn:P,locale:k},R=[new j1t],T=S.match(Owt).map(function(K){var ee=K[0];if(ee in Xq){var re=Xq[ee];return re(K,k.formatLong)}return K}).join("").match(Cwt),M=[],I=Tpe(T),z;try{var F=function(){var ee=z.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&bDe(ee)&&aN(ee,S,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&xDe(ee)&&aN(ee,S,t);var re=ee[0],me=Swt[re];if(me){var te=me.incompatibleTokens;if(Array.isArray(te)){var ae=M.find(function(oe){return te.includes(oe.token)||oe.token===re});if(ae)throw new RangeError("The format string mustn't contain `".concat(ae.fullToken,"` and `").concat(ee,"` at the same time"))}else if(me.incompatibleTokens==="*"&&M.length>0)throw new RangeError("The format string mustn't contain `".concat(ee,"` and any other token at the same time"));M.push({token:re,fullToken:ee});var U=me.run(_,ee,k.match,A);if(!U)return{v:new Date(NaN)};R.push(U.setter),_=U.rest}else{if(re.match(Awt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+re+"`");if(ee==="''"?ee="'":re==="'"&&(ee=Mwt(ee)),_.indexOf(ee)===0)_=_.slice(ee.length);else return{v:new Date(NaN)}}};for(I.s();!(z=I.n()).done;){var N=F();if(Pg(N)==="object")return N.v}}catch(K){I.e(K)}finally{I.f()}if(_.length>0&&kwt.test(_))return new Date(NaN);var L=R.map(function(K){return K.priority}).sort(function(K,ee){return ee-K}).filter(function(K,ee,re){return re.indexOf(K)===ee}).map(function(K){return R.filter(function(ee){return ee.priority===K}).sort(function(ee,re){return re.subPriority-ee.subPriority})}).map(function(K){return K[0]}),B=Ft(n);if(isNaN(B.getTime()))return new Date(NaN);var $=pDe(B,dDe(B)),j={},X=Tpe(L),V;try{for(X.s();!(V=X.n()).done;){var Y=V.value;if(!Y.validate($,A))return new Date(NaN);var le=Y.set($,j,A);Array.isArray(le)?($=le[0],S1t(j,le[1])):$=le}}catch(K){X.e(K)}finally{X.f()}return $}function Mwt(t){return t.match(Ewt)[1].replace(Twt,"'")}function kpe(t){At(1,arguments);var e=Ft(t);return e.setMinutes(0,0,0),e}function Rwt(t,e){At(2,arguments);var n=kpe(t),r=kpe(e);return n.getTime()===r.getTime()}function Dwt(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Iwt(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getFullYear()===r.getFullYear()}function Lwt(t,e){At(2,arguments);var n=Ft(t).getTime(),r=Ft(e.start).getTime(),i=Ft(e.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}function $wt(t,e){var n;At(1,arguments);var r=qn((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=jwt(t),o;if(i.date){var s=Bwt(i.date,r);o=Uwt(s.restDateString,s.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var a=o.getTime(),l=0,c;if(i.time&&(l=Wwt(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=Vwt(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+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(a+l+c)}var OI={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fwt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Nwt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,zwt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function jwt(t){var e={},n=t.split(OI.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],OI.timeZoneDelimiter.test(e.date)&&(e.date=t.split(OI.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=OI.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function Bwt(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 Uwt(t,e){if(e===null)return new Date(NaN);var n=t.match(Fwt);if(!n)return new Date(NaN);var r=!!n[4],i=WE(n[1]),o=WE(n[2])-1,s=WE(n[3]),a=WE(n[4]),l=WE(n[5])-1;if(r)return Ywt(e,a,l)?Gwt(e,a,l):new Date(NaN);var c=new Date(0);return!qwt(e,o,s)||!Xwt(e,i)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(i,s)),c)}function WE(t){return t?parseInt(t):1}function Wwt(t){var e=t.match(Nwt);if(!e)return NaN;var n=RW(e[1]),r=RW(e[2]),i=RW(e[3]);return Qwt(n,r,i)?n*tne+r*ene+i*1e3:NaN}function RW(t){return t&&parseFloat(t.replace(",","."))||0}function Vwt(t){if(t==="Z")return 0;var e=t.match(zwt);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return Kwt(r,i)?n*(r*tne+i*ene):NaN}function Gwt(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 Hwt=[31,null,31,30,31,30,31,31,30,31,30,31];function kDe(t){return t%400===0||t%4===0&&t%100!==0}function qwt(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Hwt[e]||(kDe(t)?29:28))}function Xwt(t,e){return e>=1&&e<=(kDe(t)?366:365)}function Ywt(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function Qwt(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function Kwt(t,e){return e>=0&&e<=59}function Zwt(t,e){At(2,arguments);var n=Ft(t),r=qn(e),i=n.getFullYear(),o=n.getDate(),s=new Date(0);s.setFullYear(i,r,15),s.setHours(0,0,0,0);var a=wDe(s);return n.setMonth(r,Math.min(o,a)),n}function Jwt(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setDate(r),n}function e_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setHours(r),n}function t_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setMilliseconds(r),n}function n_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setMinutes(r),n}function r_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setSeconds(r),n}function i_t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}const ADe={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 o_t(t,e){return t===e?!0:t!==null&&e!=null?t[0]===e[0]&&t[1]===e[1]:!1}function s_t(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 g=`${f}.${d}.${h}`;n.add(g);let m=null;p&&(m=`${f}.${d}.${p}`,n.add(m)),c.data.forEach(v=>{const y=sO(v.time),x=`${u!==null?u:f}-${y}`,b=i[x];b?i[x]={...b,[g]:v[h]}:i[x]={placeId:u,time:y,[g]:v[h]},m!==null&&(i[x][m]=v[p])})}const o=["placeId","time"].concat(Array.from(n).sort()),s=[];Object.keys(i).forEach(l=>{const c=i[l],u=new Array(o.length);o.forEach((f,d)=>{u[d]=c[f]}),s.push(u)}),s.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 a={};return r.forEach(l=>{a[l]=Rte(e,l)}),{colNames:o,dataRows:s,referencedPlaces:a}}function a_t(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 s=$wt(i).getTime();if(!Number.isNaN(s))for(const a of Object.getOwnPropertyNames(r.properties)){let l=r.properties[a];const c=typeof l;if(c==="boolean"?l=l?1:0:c!=="number"&&(l=Number.NaN),Number.isNaN(l))continue;const u={time:s,countTot:1,mean:l};e===null&&(e={});const f=e[a];f?f.data.push(u):e[a]={source:{datasetId:t.id,datasetTitle:t.title,variableName:a,placeId:null,geometry:null,valueDataKey:"mean",errorDataKey:null},data:[u],dataProgress:1}}}return e===null?null:{placeGroup:t,timeSeries:e}}const qM=t=>t.dataState.datasets||[],l_t=t=>t.dataState.colorBars,PDe=t=>t.dataState.timeSeriesGroups,XM=t=>t.dataState.userPlaceGroups,MDe=t=>t.dataState.userServers||[],c_t=t=>t.dataState.expressionCapabilities,u_t=t=>t.dataState.statistics.loading,f_t=t=>t.dataState.statistics.records,RDe=xt(qM,XM,(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]}),d_t=xt(RDe,t=>{const e=[];return t.forEach(n=>{const r=a_t(n);r!==null&&e.push(r)}),e}),h_t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",DDe=new Image;DDe.src=h_t;const Qq="_alpha",Kq="_r";function p_t(t){let e=t;const n=e.endsWith(Qq);n&&(e=e.slice(0,e.length-Qq.length));const r=e.endsWith(Kq);return r&&(e=e.slice(0,e.length-Kq.length)),{baseName:e,isAlpha:n,isReversed:r}}function uN(t){let e=t.baseName;return t.isReversed&&(e+=Kq),t.isAlpha&&(e+=Qq),e}function g_t(t,e,n){v_t(t,e).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const s=o.createPattern(DDe,"repeat");s!==null?o.fillStyle=s:o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),o.drawImage(i,0,0,n.width,n.height)}})})}function m_t(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=(s,a,l,c,u)=>{r(u)},i.src=`data:image/png;base64,${o}`})}function v_t(t,e){return m_t(t).then(n=>{const r=y_t(t,e,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function y_t(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 s=i.getImageData(0,0,r.width,r.height).data;if(t.isReversed){const a=new Uint8ClampedArray(s.length);for(let l=0;lt.controlState.selectedDatasetId,a1=t=>t.controlState.selectedVariableName,IDe=t=>t.controlState.selectedDataset2Id,sne=t=>t.controlState.selectedVariable2Name,ane=t=>t.controlState.selectedPlaceGroupIds,pO=t=>t.controlState.selectedPlaceId,YM=t=>t.controlState.selectedTime,x_t=t=>t.controlState.selectedServerId,b_t=t=>t.controlState.activities,B4=t=>t.controlState.timeAnimationActive,QM=t=>t.controlState.imageSmoothingEnabled,w_t=t=>t.controlState.userBaseMaps,__t=t=>t.controlState.userOverlays,lne=t=>t.controlState.selectedBaseMapId,cne=t=>t.controlState.selectedOverlayId,S_t=t=>!!t.controlState.layerVisibilities.baseMap,C_t=t=>!!t.controlState.layerVisibilities.datasetBoundary,O_t=t=>!!t.controlState.layerVisibilities.datasetVariable,E_t=t=>!!t.controlState.layerVisibilities.datasetVariable2,T_t=t=>!!t.controlState.layerVisibilities.datasetRgb,k_t=t=>!!t.controlState.layerVisibilities.datasetRgb2,A_t=t=>!!t.controlState.layerVisibilities.datasetPlaces,LDe=t=>!!t.controlState.layerVisibilities.userPlaces,P_t=t=>!!t.controlState.layerVisibilities.overlay,M_t=t=>t.controlState.layerVisibilities,$De=t=>t.controlState.infoCardElementStates,Uy=t=>t.controlState.mapProjection,R_t=t=>t.controlState.timeChunkSize,D_t=t=>t.controlState.userPlacesFormatName,I_t=t=>t.controlState.userPlacesFormatOptions.csv,L_t=t=>t.controlState.userPlacesFormatOptions.geojson,$_t=t=>t.controlState.userPlacesFormatOptions.wkt,l1=t=>t.controlState.userColorBars,F_t=t=>Pn.instance.branding.allowUserVariables,N_t=()=>"variable",z_t=()=>"variable2",j_t=()=>"rgb",B_t=()=>"rgb2",U_t=()=>13,W_t=()=>12,V_t=()=>11,G_t=()=>10,fo=xt(qM,hO,dA),Wy=xt(qM,IDe,dA),H_t=xt(fo,t=>t&&t.variables||[]),q_t=xt(fo,t=>t?Fte(t)[1]:[]),FDe=(t,e)=>!t||!e?null:Lq(t,e),za=xt(fo,a1,FDe),qg=xt(Wy,sne,FDe),NDe=t=>t&&(t.title||t.name),X_t=xt(za,NDe),Y_t=xt(qg,NDe),zDe=t=>t&&t.units||"-",Q_t=xt(za,zDe),K_t=xt(qg,zDe),jDe=t=>t&&t.colorBarName||"viridis",U4=xt(za,jDe),W4=xt(qg,jDe),BDe=t=>t?[t.colorBarMin,t.colorBarMax]:[0,1],UDe=xt(za,BDe),WDe=xt(qg,BDe),VDe=t=>(t&&t.colorBarNorm)==="log"?"log":"lin",GDe=xt(za,VDe),HDe=xt(qg,VDe),V4=xt(l1,l_t,(t,e)=>{const n={title:dRe,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:{}}}),qDe=(t,e,n)=>{const r=p_t(t),{baseName:i}=r,o=e.images[i],s=n.find(a=>a.id===i);if(s){const a=s.type,l=pRe(s.code);return{...r,imageData:o,type:a,colorRecords:l}}else{const a=e.customColorMaps[i];if(a){const l=a.type,c=a.colorRecords;return{...r,imageData:o,type:l,colorRecords:c}}}return{...r,imageData:o}},une=xt(U4,V4,l1,qDe),XDe=xt(W4,V4,l1,qDe),YDe=(t,e,n)=>{const{baseName:r}=t,i=n.find(o=>o.id===r);if(i){const o=pRe(i.code);if(o)return JSON.stringify({name:e,type:i.type,colors:o.map(s=>[s.value,s.color])})}return null},Z_t=xt(une,U4,l1,YDe),J_t=xt(XDe,W4,l1,YDe),QDe=t=>!t||typeof t.opacity!="number"?1:t.opacity,KDe=xt(za,QDe),ZDe=xt(qg,QDe),eSt=xt(fo,t=>t!==null?fRe(t):null),tSt=xt(fo,t=>t!==null&&t.rgbSchema||null),nSt=xt(Wy,t=>t!==null&&t.rgbSchema||null),JDe=xt(fo,t=>t&&t.placeGroups||[]),G4=xt(JDe,XM,(t,e)=>t.concat(e));function eIe(t,e){const n=[];return e!==null&&e.length>0&&t.forEach(r=>{e.indexOf(r.id)>-1&&n.push(r)}),n}const rSt=xt(XM,ane,LDe,(t,e)=>{const n={},r=new Set(e||[]);return t.forEach(i=>{n[i.id]=r.has(i.id)}),n}),tIe=xt(JDe,ane,eIe),gO=xt(G4,ane,eIe),iSt=xt(gO,t=>t.map(e=>e.title||e.id).join(", ")),KM=xt(gO,t=>{const e=t.map(n=>oO(n)?n.features:[]);return[].concat(...e)}),fne=xt(KM,pO,(t,e)=>t.find(n=>n.id===e)||null),oSt=xt(fne,t=>(t==null?void 0:t.geometry)||null),ZM=xt(gO,pO,(t,e)=>t.length===0||e===null?null:dgt(t,e)),sSt=xt(hO,a1,fne,(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}),nIe=xt(PDe,hO,a1,pO,(t,e,n,r)=>{if(!e||!n||!r)return!1;for(const i of t)for(const o of i.timeSeriesArray){const s=o.source;if(s.datasetId===e&&s.variableName===n&&s.placeId===r)return!1}return!0}),aSt=xt(PDe,G4,(t,e)=>{const n={};return Mte(e,(r,i)=>{for(const o of t)if(o.timeSeriesArray.find(s=>s.source.placeId===i.id)){n[i.id]=M4(r,i);break}}),n}),rIe=xt(hO,a1,pO,(t,e,n)=>!!(t&&e&&n)),lSt=xt(f_t,G4,(t,e)=>{const n=[];return t.forEach(r=>{const i=r.source.placeInfo.place.id;Mte(e,(o,s)=>{if(s.id===i){const a=M4(o,s);n.push({...r,source:{...r.source,placeInfo:a}})}})}),n}),cSt=xt(gO,t=>{const e=[];return Mte(t,(n,r)=>{e.push(M4(n,r).label)}),e}),uSt=xt(za,R_t,(t,e)=>{if(t&&t.timeChunkSize){const n=t.timeChunkSize;return n*Math.ceil(e/n)}return e}),iIe=t=>t&&uRe(t)||null,mO=xt(fo,iIe),fSt=xt(Wy,iIe),oIe=t=>t&&t.attributions||null,dne=xt(fo,oIe),dSt=xt(Wy,oIe),sIe=t=>t===null||t.coordinates.length===0?null:t.coordinates,Zq=xt(mO,sIe),hSt=xt(mO,sIe),aIe=(t,e)=>t===null||e===null?-1:cDe(e,t),lIe=xt(YM,Zq,aIe),pSt=xt(YM,hSt,aIe),cIe=(t,e,n)=>t===null?null:n&&e>-1?n.labels[e]:new Date(t).toISOString(),c1=xt(YM,lIe,mO,cIe),gSt=xt(YM,pSt,fSt,cIe);function mSt(t,e){if(t!==ite){const n=typeof e=="number"?e+1:20;return new Zte({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 vSt(t,e,n,r,i,o,s,a,l){return new fO({url:t,projection:e,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:s,maxZoom:l})}function ySt(t){if(t)return(e,n)=>{e instanceof Ute&&(t.getView().getInteracting()?t.once("moveend",function(){e.getImage().src=n}):e.getImage().src=n)}}const xSt=kvt(ySt,{serializer:t=>{const e=t[0];if(e){const n=e.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function bSt(){const t=Hs.map;return xSt(t)}function uIe(t,e,n,r,i,o,s,a,l,c,u,f,d=10){a!==null&&(o=[...o,["time",a]]);const h=By(e,o);typeof i=="number"&&(i+=3);const p=mSt(c,i),g=vSt(h,c,p,u,l,f,bSt(),r,i),m=c===nO?n:aMe(n,"EPSG:4326",c);return C.jsx(lDe,{id:t,source:g,extent:m,zIndex:d,opacity:s})}const wSt=xt(fo,Uy,C_t,(t,e,n)=>{if(!t||!n)return null;let r=t.geometry;if(!r)if(t.bbox){const[s,a,l,c]=t.bbox;r={type:"Polygon",coordinates:[[[s,a],[l,a],[l,c],[s,c],[s,a]]]}}else return console.warn(`Dataset ${t.id} has no bbox!`),null;const i=new GM({features:new s1({dataProjection:nO,featureProjection:e}).readFeatures({type:"Feature",geometry:r})}),o=new Zd({stroke:new ph({color:"orange",width:3,lineDash:[2,4]})});return C.jsx(z4,{id:`${t.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),zi=xt(MDe,x_t,(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}),fIe=(t,e,n,r,i,o,s,a,l,c,u,f,d,h,p,g)=>{if(!e||!i||!u)return null;const m=[["crs",p],["vmin",`${s[0]}`],["vmax",`${s[1]}`],["cmap",l||o]];return a==="log"&&m.push(["norm",a]),uIe(f,hIe(t.url,e,i),e.bbox,i.tileLevelMin,i.tileLevelMax,m,c,n,h,p,r,g,d)},_St=xt(zi,fo,c1,dne,za,U4,UDe,GDe,Z_t,KDe,O_t,N_t,U_t,B4,Uy,QM,fIe),SSt=xt(zi,Wy,gSt,dSt,qg,W4,WDe,HDe,J_t,ZDe,E_t,z_t,W_t,B4,Uy,QM,fIe),dIe=(t,e,n,r,i,o,s,a,l,c,u)=>{if(!e||!n||!r)return null;const f=[["crs",l]];return uIe(i,hIe(t.url,e,"rgb"),e.bbox,n.tileLevelMin,n.tileLevelMax,f,1,s,a,l,c,u,o)},CSt=xt(zi,fo,tSt,T_t,j_t,V_t,c1,B4,Uy,dne,QM,dIe),OSt=xt(zi,Wy,nSt,k_t,B_t,G_t,c1,B4,Uy,dne,QM,dIe);function hIe(t,e,n){return`${t}/tiles/${lO(e)}/${BM(n)}/{z}/{y}/{x}`}function ESt(){return nte()}function TSt(){return new WM({fill:gIe(),stroke:pIe(),radius:6})}function pIe(){return new ph({color:[200,0,0,.75],width:1.25})}function gIe(){return new fb({color:[255,0,0,ESt()]})}function kSt(){return new Zd({image:TSt(),stroke:pIe(),fill:gIe()})}const ASt=xt(tIe,Uy,A_t,(t,e,n)=>{if(!n||t.length===0)return null;const r=[];return t.forEach((i,o)=>{oO(i)&&r.push(C.jsx(z4,{id:`placeGroup.${i.id}`,style:kSt(),zIndex:100,source:new GM({features:new s1({dataProjection:nO,featureProjection:e}).readFeatures(i)})},o))}),C.jsx(iDe,{children:r})}),PSt=xt($De,t=>{const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].visible&&e.push(n)}),e}),MSt=xt($De,t=>{const e={};return Object.getOwnPropertyNames(t).forEach(n=>{e[n]=t[n].viewMode||"text"}),e}),RSt=xt(b_t,t=>Object.keys(t).map(e=>t[e])),hne=xt(w_t,t=>[...t,...VPe]),pne=xt(__t,t=>[...t,...Pdt]),mIe=(t,e,n,r)=>{if(!n||!e)return null;const i=UF(t,e);if(!i)return null;let o=i.attribution;o&&(o.startsWith("http://")||o.startsWith("https://"))&&(o=`© ${i.group}`);let s;if(i.wms){const{layerName:a,styleName:l}=i.wms;s=new tbt({url:i.url,params:{...l?{STYLES:l}:{},LAYERS:a},attributions:o,attributionsCollapsible:!0})}else{const a=Tdt(i.group);s=new fO({url:i.url+(a?`?${a.param}=${a.token}`:""),attributions:o,attributionsCollapsible:!0})}return C.jsx(lDe,{id:i.id,source:s,zIndex:r})},DSt=xt(hne,lne,S_t,()=>0,mIe),ISt=xt(pne,cne,P_t,()=>20,mIe),vIe=(t,e)=>{const n=UF(t,e);return n?BF(n):null},LSt=xt(hne,lne,vIe),$St=xt(pne,cne,vIe),FSt=xt(LSt,$St,lne,cne,fo,Wy,za,qg,M_t,(t,e,n,r,i,o,s,a,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&&s?`${i.title} / ${s.title||s.name}`:void 0,visible:l.datasetVariable,disabled:!(i&&s)},datasetVariable2:{title:"Dataset Variable",subTitle:o&&a?`${o.title} / ${a.title||a.name}`:void 0,visible:l.datasetVariable2,disabled:!(o&&a),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 yIe={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -302,22 +302,22 @@ 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 s(c,u){if(!i[c]){if(!r[c]){var f=typeof Z2=="function"&&Z2;if(!u&&f)return f(c,!0);if(a)return a(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 g=r[c][1][p];return s(g||p)},h,h.exports,n,r,i,o)}return i[c].exports}for(var a=typeof Z2=="function"&&Z2,l=0;l>2,h=(3&c)<<4|u>>4,p=1>6:64,g=2>4,u=(15&d)<<4|(h=a.indexOf(l.charAt(g++)))>>2,f=(3&h)<<6|(p=a.indexOf(l.charAt(g++))),y[m++]=c,h!==64&&(y[m++]=u),p!==64&&(y[m++]=f);return y}},{"./support":30,"./utils":32}],2:[function(n,r,i){var o=n("./external"),s=n("./stream/DataWorker"),a=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 s(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 s(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 a).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"),s=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u[g])];return-1^c}(0|l,a,a.length,0):function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u.charCodeAt(g))];return-1^c}(0|l,a,a.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",s=n("pako"),a=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",a.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.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 s[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 g,m="";for(g=0;g>>=8;return m}function s(h,p,g,m,v,y){var x,b,w=h.file,_=h.compression,S=y!==c.utf8encode,O=a.transformTo("string",y(w.name)),k=a.transformTo("string",c.utf8encode(w.name)),E=w.comment,P=a.transformTo("string",y(E)),A=a.transformTo("string",c.utf8encode(E)),R=k.length!==w.name.length,T=A.length!==E.length,M="",I="",z="",F=w.dir,N=w.date,L={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(L.crc32=h.crc32,L.compressedSize=h.compressedSize,L.uncompressedSize=h.uncompressedSize);var B=0;p&&(B|=8),S||!R&&!T||(B|=2048);var $=0,j=0;F&&($|=16),v==="UNIX"?(j=798,$|=function(V,Y){var le=V;return V||(le=Y?16893:33204),(65535&le)<<16}(w.unixPermissions,F)):(j=20,$|=function(V){return 63&(V||0)}(w.dosPermissions)),x=N.getUTCHours(),x<<=6,x|=N.getUTCMinutes(),x<<=5,x|=N.getUTCSeconds()/2,b=N.getUTCFullYear()-1980,b<<=4,b|=N.getUTCMonth()+1,b<<=5,b|=N.getUTCDate(),R&&(I=o(1,1)+o(u(O),4)+k,M+="up"+o(I.length,2)+I),T&&(z=o(1,1)+o(u(P),4)+A,M+="uc"+o(z.length,2)+z);var X="";return X+=` +*/(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function s(c,u){if(!i[c]){if(!r[c]){var f=typeof K2=="function"&&K2;if(!u&&f)return f(c,!0);if(a)return a(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 g=r[c][1][p];return s(g||p)},h,h.exports,n,r,i,o)}return i[c].exports}for(var a=typeof K2=="function"&&K2,l=0;l>2,h=(3&c)<<4|u>>4,p=1>6:64,g=2>4,u=(15&d)<<4|(h=a.indexOf(l.charAt(g++)))>>2,f=(3&h)<<6|(p=a.indexOf(l.charAt(g++))),y[m++]=c,h!==64&&(y[m++]=u),p!==64&&(y[m++]=f);return y}},{"./support":30,"./utils":32}],2:[function(n,r,i){var o=n("./external"),s=n("./stream/DataWorker"),a=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 s(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 s(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 a).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"),s=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u[g])];return-1^c}(0|l,a,a.length,0):function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u.charCodeAt(g))];return-1^c}(0|l,a,a.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",s=n("pako"),a=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",a.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.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 s[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 g,m="";for(g=0;g>>=8;return m}function s(h,p,g,m,v,y){var x,b,w=h.file,_=h.compression,S=y!==c.utf8encode,O=a.transformTo("string",y(w.name)),k=a.transformTo("string",c.utf8encode(w.name)),E=w.comment,P=a.transformTo("string",y(E)),A=a.transformTo("string",c.utf8encode(E)),R=k.length!==w.name.length,T=A.length!==E.length,M="",I="",z="",F=w.dir,N=w.date,L={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(L.crc32=h.crc32,L.compressedSize=h.compressedSize,L.uncompressedSize=h.uncompressedSize);var B=0;p&&(B|=8),S||!R&&!T||(B|=2048);var $=0,j=0;F&&($|=16),v==="UNIX"?(j=798,$|=function(V,Y){var le=V;return V||(le=Y?16893:33204),(65535&le)<<16}(w.unixPermissions,F)):(j=20,$|=function(V){return 63&(V||0)}(w.dosPermissions)),x=N.getUTCHours(),x<<=6,x|=N.getUTCMinutes(),x<<=5,x|=N.getUTCSeconds()/2,b=N.getUTCFullYear()-1980,b<<=4,b|=N.getUTCMonth()+1,b<<=5,b|=N.getUTCDate(),R&&(I=o(1,1)+o(u(O),4)+k,M+="up"+o(I.length,2)+I),T&&(z=o(1,1)+o(u(P),4)+A,M+="uc"+o(z.length,2)+z);var X="";return X+=` \0`,X+=o(B,2),X+=_.magic,X+=o(x,2),X+=o(b,2),X+=o(L.crc32,4),X+=o(L.compressedSize,4),X+=o(L.uncompressedSize,4),X+=o(O.length,2),X+=o(M.length,2),{fileRecord:f.LOCAL_FILE_HEADER+X+O+M,dirRecord:f.CENTRAL_FILE_HEADER+o(j,2)+X+o(P.length,2)+"\0\0\0\0"+o($,4)+o(m,4)+O+M+P}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function d(h,p,g,m){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=m,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(d,l),d.prototype.push=function(h){var p=h.meta.percent||0,g=this.entriesCount,m=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:g?(p+100*(g-m-1))/g: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 g=s(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,g=s(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:function(m){return f.DATA_DESCRIPTOR+o(m.crc32,4)+o(m.compressedSize,4)+o(m.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:g.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+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,i){var o=n("./Uint8ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var o=n("./DataReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var o=n("./ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var o=n("../utils"),s=n("../support"),a=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"||s.uint8array?d==="nodebuffer"?new c(f):s.uint8array?new u(o.transformTo("uint8array",f)):new a(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"),s=n("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var o=n("./GenericWorker"),s=n("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.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(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.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=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function o(s){this.name=s||"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(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l "+s:s}},r.exports=o},{}],29:[function(n,r,i){var o=n("../utils"),s=n("./ConvertWorker"),a=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,g){return new u.Promise(function(m,v){var y=[],x=p._internalType,b=p._outputType,w=p._mimeType;p.on("data",function(_,S){y.push(_),g&&g(S)}).on("error",function(_){y=[],v(_)}).on("end",function(){try{var _=function(S,O,k){switch(S){case"blob":return o.newBlob(o.transformTo("arraybuffer",O),k);case"base64":return l.encode(O);default:return o.transformTo(S,O)}}(b,function(S,O){var k,E=0,P=null,A=0;for(k=0;k"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.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"),s=n("./support"),a=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 s.nodebuffer?a.newBufferFrom(h,"utf-8"):function(p){var g,m,v,y,x,b=p.length,w=0;for(y=0;y>>6:(m<65536?g[x++]=224|m>>>12:(g[x++]=240|m>>>18,g[x++]=128|m>>>12&63),g[x++]=128|m>>>6&63),g[x++]=128|63&m);return g}(h)},i.utf8decode=function(h){return s.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):function(p){var g,m,v,y,x=p.length,b=new Array(2*x);for(g=m=0;g>10&1023,b[m++]=56320|1023&v)}return b.length!==m&&(b.subarray?b=b.subarray(0,m):b.length=m),o.applyFromCharCode(b)}(h=o.transformTo(s.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var p=o.transformTo(s.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var m=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;m!==p.length&&(s.uint8array?(v=p.subarray(0,m),this.leftOver=p.subarray(m,p.length)):(v=p.slice(0,m),this.leftOver=p.slice(m,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"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(g){return g}function u(g,m){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===s.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,g,m,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?d[m++]=224|h>>>12:(d[m++]=240|h>>>18,d[m++]=128|h>>>12&63),d[m++]=128|h>>>6&63),d[m++]=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&g)}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,s,a,l){for(var c=65535&o|0,u=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:s>>>1;a[l]=s}return a}();r.exports=function(s,a,l,c){var u=o,f=c+l;s^=-1;for(var d=c;d>>8^u[255&(s^a[d])];return-1^s}},{}],46:[function(n,r,i){var o,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,d=4,h=0,p=-2,g=-1,m=4,v=2,y=8,x=9,b=286,w=30,_=19,S=2*b+1,O=15,k=3,E=258,P=E+k+1,A=42,R=113,T=1,M=2,I=3,z=4;function F(U,oe){return U.msg=u[oe],oe}function N(U){return(U<<1)-(4U.avail_out&&(ne=U.avail_out),ne!==0&&(s.arraySet(U.output,oe.pending_buf,oe.pending_out,ne,U.next_out),U.next_out+=ne,oe.pending_out+=ne,U.total_out+=ne,U.avail_out-=ne,oe.pending-=ne,oe.pending===0&&(oe.pending_out=0))}function $(U,oe){a._tr_flush_block(U,0<=U.block_start?U.block_start:-1,U.strstart-U.block_start,oe),U.block_start=U.strstart,B(U.strm)}function j(U,oe){U.pending_buf[U.pending++]=oe}function X(U,oe){U.pending_buf[U.pending++]=oe>>>8&255,U.pending_buf[U.pending++]=255&oe}function V(U,oe){var ne,G,q=U.max_chain_length,Z=U.strstart,de=U.prev_length,xe=U.nice_match,H=U.strstart>U.w_size-P?U.strstart-(U.w_size-P):0,W=U.window,J=U.w_mask,se=U.prev,ye=U.strstart+E,ie=W[Z+de-1],fe=W[Z+de];U.prev_length>=U.good_match&&(q>>=2),xe>U.lookahead&&(xe=U.lookahead);do if(W[(ne=oe)+de]===fe&&W[ne+de-1]===ie&&W[ne]===W[Z]&&W[++ne]===W[Z+1]){Z+=2,ne++;do;while(W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&ZH&&--q!=0);return de<=U.lookahead?de:U.lookahead}function Y(U){var oe,ne,G,q,Z,de,xe,H,W,J,se=U.w_size;do{if(q=U.window_size-U.lookahead-U.strstart,U.strstart>=se+(se-P)){for(s.arraySet(U.window,U.window,se,se,0),U.match_start-=se,U.strstart-=se,U.block_start-=se,oe=ne=U.hash_size;G=U.head[--oe],U.head[oe]=se<=G?G-se:0,--ne;);for(oe=ne=se;G=U.prev[--oe],U.prev[oe]=se<=G?G-se:0,--ne;);q+=se}if(U.strm.avail_in===0)break;if(de=U.strm,xe=U.window,H=U.strstart+U.lookahead,W=q,J=void 0,J=de.avail_in,W=k)for(Z=U.strstart-U.insert,U.ins_h=U.window[Z],U.ins_h=(U.ins_h<=k&&(U.ins_h=(U.ins_h<=k)if(G=a._tr_tally(U,U.strstart-U.match_start,U.match_length-k),U.lookahead-=U.match_length,U.match_length<=U.max_lazy_match&&U.lookahead>=k){for(U.match_length--;U.strstart++,U.ins_h=(U.ins_h<=k&&(U.ins_h=(U.ins_h<=k&&U.match_length<=U.prev_length){for(q=U.strstart+U.lookahead-k,G=a._tr_tally(U,U.strstart-1-U.prev_match,U.prev_length-k),U.lookahead-=U.prev_length-1,U.prev_length-=2;++U.strstart<=q&&(U.ins_h=(U.ins_h<U.pending_buf_size-5&&(ne=U.pending_buf_size-5);;){if(U.lookahead<=1){if(Y(U),U.lookahead===0&&oe===f)return T;if(U.lookahead===0)break}U.strstart+=U.lookahead,U.lookahead=0;var G=U.block_start+ne;if((U.strstart===0||U.strstart>=G)&&(U.lookahead=U.strstart-G,U.strstart=G,$(U,!1),U.strm.avail_out===0)||U.strstart-U.block_start>=U.w_size-P&&($(U,!1),U.strm.avail_out===0))return T}return U.insert=0,oe===d?($(U,!0),U.strm.avail_out===0?I:z):(U.strstart>U.block_start&&($(U,!1),U.strm.avail_out),T)}),new ee(4,4,8,4,le),new ee(4,5,16,8,le),new ee(4,6,32,32,le),new ee(4,4,16,16,K),new ee(8,16,32,32,K),new ee(8,16,128,128,K),new ee(8,32,128,256,K),new ee(32,128,258,1024,K),new ee(32,258,258,4096,K)],i.deflateInit=function(U,oe){return ae(U,oe,y,15,8,0)},i.deflateInit2=ae,i.deflateReset=te,i.deflateResetKeep=me,i.deflateSetHeader=function(U,oe){return U&&U.state?U.state.wrap!==2?p:(U.state.gzhead=oe,h):p},i.deflate=function(U,oe){var ne,G,q,Z;if(!U||!U.state||5>8&255),j(G,G.gzhead.time>>16&255),j(G,G.gzhead.time>>24&255),j(G,G.level===9?2:2<=G.strategy||G.level<2?4:0),j(G,255&G.gzhead.os),G.gzhead.extra&&G.gzhead.extra.length&&(j(G,255&G.gzhead.extra.length),j(G,G.gzhead.extra.length>>8&255)),G.gzhead.hcrc&&(U.adler=c(U.adler,G.pending_buf,G.pending,0)),G.gzindex=0,G.status=69):(j(G,0),j(G,0),j(G,0),j(G,0),j(G,0),j(G,G.level===9?2:2<=G.strategy||G.level<2?4:0),j(G,3),G.status=R);else{var de=y+(G.w_bits-8<<4)<<8;de|=(2<=G.strategy||G.level<2?0:G.level<6?1:G.level===6?2:3)<<6,G.strstart!==0&&(de|=32),de+=31-de%31,G.status=R,X(G,de),G.strstart!==0&&(X(G,U.adler>>>16),X(G,65535&U.adler)),U.adler=1}if(G.status===69)if(G.gzhead.extra){for(q=G.pending;G.gzindex<(65535&G.gzhead.extra.length)&&(G.pending!==G.pending_buf_size||(G.gzhead.hcrc&&G.pending>q&&(U.adler=c(U.adler,G.pending_buf,G.pending-q,q)),B(U),q=G.pending,G.pending!==G.pending_buf_size));)j(G,255&G.gzhead.extra[G.gzindex]),G.gzindex++;G.gzhead.hcrc&&G.pending>q&&(U.adler=c(U.adler,G.pending_buf,G.pending-q,q)),G.gzindex===G.gzhead.extra.length&&(G.gzindex=0,G.status=73)}else G.status=73;if(G.status===73)if(G.gzhead.name){q=G.pending;do{if(G.pending===G.pending_buf_size&&(G.gzhead.hcrc&&G.pending>q&&(U.adler=c(U.adler,G.pending_buf,G.pending-q,q)),B(U),q=G.pending,G.pending===G.pending_buf_size)){Z=1;break}Z=G.gzindexq&&(U.adler=c(U.adler,G.pending_buf,G.pending-q,q)),Z===0&&(G.gzindex=0,G.status=91)}else G.status=91;if(G.status===91)if(G.gzhead.comment){q=G.pending;do{if(G.pending===G.pending_buf_size&&(G.gzhead.hcrc&&G.pending>q&&(U.adler=c(U.adler,G.pending_buf,G.pending-q,q)),B(U),q=G.pending,G.pending===G.pending_buf_size)){Z=1;break}Z=G.gzindexq&&(U.adler=c(U.adler,G.pending_buf,G.pending-q,q)),Z===0&&(G.status=103)}else G.status=103;if(G.status===103&&(G.gzhead.hcrc?(G.pending+2>G.pending_buf_size&&B(U),G.pending+2<=G.pending_buf_size&&(j(G,255&U.adler),j(G,U.adler>>8&255),U.adler=0,G.status=R)):G.status=R),G.pending!==0){if(B(U),U.avail_out===0)return G.last_flush=-1,h}else if(U.avail_in===0&&N(oe)<=N(ne)&&oe!==d)return F(U,-5);if(G.status===666&&U.avail_in!==0)return F(U,-5);if(U.avail_in!==0||G.lookahead!==0||oe!==f&&G.status!==666){var xe=G.strategy===2?function(H,W){for(var J;;){if(H.lookahead===0&&(Y(H),H.lookahead===0)){if(W===f)return T;break}if(H.match_length=0,J=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,J&&($(H,!1),H.strm.avail_out===0))return T}return H.insert=0,W===d?($(H,!0),H.strm.avail_out===0?I:z):H.last_lit&&($(H,!1),H.strm.avail_out===0)?T:M}(G,oe):G.strategy===3?function(H,W){for(var J,se,ye,ie,fe=H.window;;){if(H.lookahead<=E){if(Y(H),H.lookahead<=E&&W===f)return T;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=k&&0H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=k?(J=a._tr_tally(H,1,H.match_length-k),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(J=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),J&&($(H,!1),H.strm.avail_out===0))return T}return H.insert=0,W===d?($(H,!0),H.strm.avail_out===0?I:z):H.last_lit&&($(H,!1),H.strm.avail_out===0)?T:M}(G,oe):o[G.level].func(G,oe);if(xe!==I&&xe!==z||(G.status=666),xe===T||xe===I)return U.avail_out===0&&(G.last_flush=-1),h;if(xe===M&&(oe===1?a._tr_align(G):oe!==5&&(a._tr_stored_block(G,0,0,!1),oe===3&&(L(G.head),G.lookahead===0&&(G.strstart=0,G.block_start=0,G.insert=0))),B(U),U.avail_out===0))return G.last_flush=-1,h}return oe!==d?h:G.wrap<=0?1:(G.wrap===2?(j(G,255&U.adler),j(G,U.adler>>8&255),j(G,U.adler>>16&255),j(G,U.adler>>24&255),j(G,255&U.total_in),j(G,U.total_in>>8&255),j(G,U.total_in>>16&255),j(G,U.total_in>>24&255)):(X(G,U.adler>>>16),X(G,65535&U.adler)),B(U),0=ne.w_size&&(Z===0&&(L(ne.head),ne.strstart=0,ne.block_start=0,ne.insert=0),W=new s.Buf8(ne.w_size),s.arraySet(W,oe,J-ne.w_size,ne.w_size,0),oe=W,J=ne.w_size),de=U.avail_in,xe=U.next_in,H=U.input,U.avail_in=J,U.next_in=0,U.input=oe,Y(ne);ne.lookahead>=k;){for(G=ne.strstart,q=ne.lookahead-(k-1);ne.ins_h=(ne.ins_h<>>=k=O>>>24,x-=k,(k=O>>>16&255)===0)M[u++]=65535&O;else{if(!(16&k)){if(!(64&k)){O=b[(65535&O)+(y&(1<>>=k,x-=k),x<15&&(y+=T[l++]<>>=k=O>>>24,x-=k,!(16&(k=O>>>16&255))){if(!(64&k)){O=w[(65535&O)+(y&(1<>>=k,x-=k,(k=u-f)>3,y&=(1<<(x-=E<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<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(A){var R;return A&&A.state?(R=A.state,A.total_in=A.total_out=R.total=0,A.msg="",R.wrap&&(A.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(g),R.distcode=R.distdyn=new o.Buf32(m),R.sane=1,R.back=-1,d):h}function b(A){var R;return A&&A.state?((R=A.state).wsize=0,R.whave=0,R.wnext=0,x(A)):h}function w(A,R){var T,M;return A&&A.state?(M=A.state,R<0?(T=0,R=-R):(T=1+(R>>4),R<48&&(R&=15)),R&&(R<8||15=z.wsize?(o.arraySet(z.window,R,T-z.wsize,z.wsize,0),z.wnext=0,z.whave=z.wsize):(M<(I=z.wsize-z.wnext)&&(I=M),o.arraySet(z.window,R,T-M,I,z.wnext),(M-=I)?(o.arraySet(z.window,R,T-M,M,0),z.wnext=M,z.whave=z.wsize):(z.wnext+=I,z.wnext===z.wsize&&(z.wnext=0),z.whave>>8&255,T.check=a(T.check,Z,2,0),$=B=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&B)<<8)+(B>>8))%31){A.msg="incorrect header check",T.mode=30;break}if((15&B)!=8){A.msg="unknown compression method",T.mode=30;break}if($-=4,U=8+(15&(B>>>=4)),T.wbits===0)T.wbits=U;else if(U>T.wbits){A.msg="invalid window size",T.mode=30;break}T.dmax=1<>8&1),512&T.flags&&(Z[0]=255&B,Z[1]=B>>>8&255,T.check=a(T.check,Z,2,0)),$=B=0,T.mode=3;case 3:for(;$<32;){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}T.head&&(T.head.time=B),512&T.flags&&(Z[0]=255&B,Z[1]=B>>>8&255,Z[2]=B>>>16&255,Z[3]=B>>>24&255,T.check=a(T.check,Z,4,0)),$=B=0,T.mode=4;case 4:for(;$<16;){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}T.head&&(T.head.xflags=255&B,T.head.os=B>>8),512&T.flags&&(Z[0]=255&B,Z[1]=B>>>8&255,T.check=a(T.check,Z,2,0)),$=B=0,T.mode=5;case 5:if(1024&T.flags){for(;$<16;){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}T.length=B,T.head&&(T.head.extra_len=B),512&T.flags&&(Z[0]=255&B,Z[1]=B>>>8&255,T.check=a(T.check,Z,2,0)),$=B=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(N<(V=T.length)&&(V=N),V&&(T.head&&(U=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),o.arraySet(T.head.extra,M,z,V,U)),512&T.flags&&(T.check=a(T.check,M,V,z)),N-=V,z+=V,T.length-=V),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(N===0)break e;for(V=0;U=M[z+V++],T.head&&U&&T.length<65536&&(T.head.name+=String.fromCharCode(U)),U&&V>9&1,T.head.done=!0),A.adler=T.check=0,T.mode=12;break;case 10:for(;$<32;){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}A.adler=T.check=v(B),$=B=0,T.mode=11;case 11:if(T.havedict===0)return A.next_out=F,A.avail_out=L,A.next_in=z,A.avail_in=N,T.hold=B,T.bits=$,2;A.adler=T.check=1,T.mode=12;case 12:if(R===5||R===6)break e;case 13:if(T.last){B>>>=7&$,$-=7&$,T.mode=27;break}for(;$<3;){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}switch(T.last=1&B,$-=1,3&(B>>>=1)){case 0:T.mode=14;break;case 1:if(E(T),T.mode=20,R!==6)break;B>>>=2,$-=2;break e;case 2:T.mode=17;break;case 3:A.msg="invalid block type",T.mode=30}B>>>=2,$-=2;break;case 14:for(B>>>=7&$,$-=7&$;$<32;){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}if((65535&B)!=(B>>>16^65535)){A.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&B,$=B=0,T.mode=15,R===6)break e;case 15:T.mode=16;case 16:if(V=T.length){if(N>>=5,$-=5,T.ndist=1+(31&B),B>>>=5,$-=5,T.ncode=4+(15&B),B>>>=4,$-=4,286>>=3,$-=3}for(;T.have<19;)T.lens[de[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,ne={bits:T.lenbits},oe=c(0,T.lens,0,19,T.lencode,0,T.work,ne),T.lenbits=ne.bits,oe){A.msg="invalid code lengths set",T.mode=30;break}T.have=0,T.mode=19;case 19:for(;T.have>>16&255,re=65535&q,!((K=q>>>24)<=$);){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}if(re<16)B>>>=K,$-=K,T.lens[T.have++]=re;else{if(re===16){for(G=K+2;$>>=K,$-=K,T.have===0){A.msg="invalid bit length repeat",T.mode=30;break}U=T.lens[T.have-1],V=3+(3&B),B>>>=2,$-=2}else if(re===17){for(G=K+3;$>>=K)),B>>>=3,$-=3}else{for(G=K+7;$>>=K)),B>>>=7,$-=7}if(T.have+V>T.nlen+T.ndist){A.msg="invalid bit length repeat",T.mode=30;break}for(;V--;)T.lens[T.have++]=U}}if(T.mode===30)break;if(T.lens[256]===0){A.msg="invalid code -- missing end-of-block",T.mode=30;break}if(T.lenbits=9,ne={bits:T.lenbits},oe=c(u,T.lens,0,T.nlen,T.lencode,0,T.work,ne),T.lenbits=ne.bits,oe){A.msg="invalid literal/lengths set",T.mode=30;break}if(T.distbits=6,T.distcode=T.distdyn,ne={bits:T.distbits},oe=c(f,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,ne),T.distbits=ne.bits,oe){A.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<=N&&258<=L){A.next_out=F,A.avail_out=L,A.next_in=z,A.avail_in=N,T.hold=B,T.bits=$,l(A,X),F=A.next_out,I=A.output,L=A.avail_out,z=A.next_in,M=A.input,N=A.avail_in,B=T.hold,$=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;ee=(q=T.lencode[B&(1<>>16&255,re=65535&q,!((K=q>>>24)<=$);){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}if(ee&&!(240&ee)){for(me=K,te=ee,ae=re;ee=(q=T.lencode[ae+((B&(1<>me)])>>>16&255,re=65535&q,!(me+(K=q>>>24)<=$);){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}B>>>=me,$-=me,T.back+=me}if(B>>>=K,$-=K,T.back+=K,T.length=re,ee===0){T.mode=26;break}if(32&ee){T.back=-1,T.mode=12;break}if(64&ee){A.msg="invalid literal/length code",T.mode=30;break}T.extra=15&ee,T.mode=22;case 22:if(T.extra){for(G=T.extra;$>>=T.extra,$-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=23;case 23:for(;ee=(q=T.distcode[B&(1<>>16&255,re=65535&q,!((K=q>>>24)<=$);){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}if(!(240&ee)){for(me=K,te=ee,ae=re;ee=(q=T.distcode[ae+((B&(1<>me)])>>>16&255,re=65535&q,!(me+(K=q>>>24)<=$);){if(N===0)break e;N--,B+=M[z++]<<$,$+=8}B>>>=me,$-=me,T.back+=me}if(B>>>=K,$-=K,T.back+=K,64&ee){A.msg="invalid distance code",T.mode=30;break}T.offset=re,T.extra=15&ee,T.mode=24;case 24:if(T.extra){for(G=T.extra;$>>=T.extra,$-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){A.msg="invalid distance too far back",T.mode=30;break}T.mode=25;case 25:if(L===0)break e;if(V=X-L,T.offset>V){if((V=T.offset-V)>T.whave&&T.sane){A.msg="invalid distance too far back",T.mode=30;break}Y=V>T.wnext?(V-=T.wnext,T.wsize-V):T.wnext-V,V>T.length&&(V=T.length),le=T.window}else le=I,Y=F-T.offset,V=T.length;for(LS?(k=Y[le+m[R]],$[j+m[R]]):(k=96,0),y=1<>F)+(x-=y)]=O<<24|k<<16|E|0,x!==0;);for(y=1<>=1;if(y!==0?(B&=y-1,B+=y):B=0,R++,--X[A]==0){if(A===M)break;A=f[d+m[R]]}if(I>>7)]}function j(q,Z){q.pending_buf[q.pending++]=255&Z,q.pending_buf[q.pending++]=Z>>>8&255}function X(q,Z,de){q.bi_valid>v-de?(q.bi_buf|=Z<>v-q.bi_valid,q.bi_valid+=de-v):(q.bi_buf|=Z<>>=1,de<<=1,0<--Z;);return de>>>1}function le(q,Z,de){var xe,H,W=new Array(m+1),J=0;for(xe=1;xe<=m;xe++)W[xe]=J=J+de[xe-1]<<1;for(H=0;H<=Z;H++){var se=q[2*H+1];se!==0&&(q[2*H]=Y(W[se]++,se))}}function K(q){var Z;for(Z=0;Z>1;1<=de;de--)me(q,W,de);for(H=ye;de=q.heap[1],q.heap[1]=q.heap[q.heap_len--],me(q,W,1),xe=q.heap[1],q.heap[--q.heap_max]=de,q.heap[--q.heap_max]=xe,W[2*H]=W[2*de]+W[2*xe],q.depth[H]=(q.depth[de]>=q.depth[xe]?q.depth[de]:q.depth[xe])+1,W[2*de+1]=W[2*xe+1]=H,q.heap[1]=H++,me(q,W,1),2<=q.heap_len;);q.heap[--q.heap_max]=q.heap[1],function(fe,Q){var _e,we,Ie,Pe,Re,Te,Le=Q.dyn_tree,ue=Q.max_code,$e=Q.stat_desc.static_tree,Se=Q.stat_desc.has_stree,Ye=Q.stat_desc.extra_bits,tt=Q.stat_desc.extra_base,ut=Q.stat_desc.max_length,qt=0;for(Pe=0;Pe<=m;Pe++)fe.bl_count[Pe]=0;for(Le[2*fe.heap[fe.heap_max]+1]=0,_e=fe.heap_max+1;_e>=7;H>>=1)if(1&ie&&se.dyn_ltree[2*ye]!==0)return s;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for(ye=32;ye>>3,(W=q.static_len+3+7>>>3)<=H&&(H=W)):H=W=de+5,de+4<=H&&Z!==-1?G(q,Z,de,xe):q.strategy===4||W===H?(X(q,2+(xe?1:0),3),te(q,P,A)):(X(q,4+(xe?1:0),3),function(se,ye,ie,fe){var Q;for(X(se,ye-257,5),X(se,ie-1,5),X(se,fe-4,4),Q=0;Q>>8&255,q.pending_buf[q.d_buf+2*q.last_lit+1]=255&Z,q.pending_buf[q.l_buf+q.last_lit]=255&de,q.last_lit++,Z===0?q.dyn_ltree[2*de]++:(q.matches++,Z--,q.dyn_ltree[2*(T[de]+f+1)]++,q.dyn_dtree[2*$(Z)]++),q.last_lit===q.lit_bufsize-1},i._tr_align=function(q){X(q,2,3),V(q,x,P),function(Z){Z.bi_valid===16?(j(Z,Z.bi_buf),Z.bi_buf=0,Z.bi_valid=0):8<=Z.bi_valid&&(Z.pending_buf[Z.pending++]=255&Z.bi_buf,Z.bi_buf>>=8,Z.bi_valid-=8)}(q)}},{"../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(s,a){if(!s.setImmediate){var l,c,u,f,d=1,h={},p=!1,g=s.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(s);m=m&&m.setTimeout?m:s,l={}.toString.call(s.process)==="[object process]"?function(b){process.nextTick(function(){y(b)})}:function(){if(s.postMessage&&!s.importScripts){var b=!0,w=s.onmessage;return s.onmessage=function(){b=!1},s.postMessage("","*"),s.onmessage=w,b}}()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",x,!1):s.attachEvent("onmessage",x),function(b){s.postMessage(f+b,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(b){y(b.data)},function(b){u.port2.postMessage(b)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(b){var w=g.createElement("script");w.onreadystatechange=function(){y(b),w.onreadystatechange=null,c.removeChild(w),w=null},c.appendChild(w)}):function(b){setTimeout(y,0,b)},m.setImmediate=function(b){typeof b!="function"&&(b=new Function(""+b));for(var w=new Array(arguments.length-1),_=0;_"u"?o===void 0?this:o:self)}).call(this,typeof ri<"u"?ri:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(yIe);var NSt=yIe.exports;const zSt=sn(NSt);var xIe={exports:{}};(function(t,e){(function(n,r){r()})(ri,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 s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ri=="object"&&ri.global===ri?ri:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,f){var d=s.URL||s.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(s.HTMLElement)||s.safari,g=/CriOS\/[\d]+/.test(navigator.userAgent);if((g||h&&p||a)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var x=m.result;x=g?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=x:location=x,d=null},m.readAsDataURL(c)}else{var v=s.URL||s.webkitURL,y=v.createObjectURL(c);d?d.location=y:location.href=y,d=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});s.saveAs=l.saveAs=l,t.exports=l})})(xIe);var bIe=xIe.exports;const Ape=t=>{let e;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const d=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(h=>h(e,d))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=e=t(r,i,a);return a},jSt=t=>t?Ape(t):Ape,BSt=t=>t;function USt(t,e=BSt){const n=he.useSyncExternalStore(t.subscribe,()=>e(t.getState()),()=>e(t.getInitialState()));return he.useDebugValue(n),n}const Ppe=t=>{const e=jSt(t),n=r=>USt(e,r);return Object.assign(n,e),n},WSt=t=>t?Ppe(t):Ppe,Oo=WSt(()=>({configuration:{},extensions:[],contributionsResult:{},contributionsRecord:{}}));function gh(t){return typeof t=="object"&&t!==null}function JM(t){return typeof t=="string"}function Fx(t){return gh(t)&&JM(t.type)&&t.constructor.name==="Object"&&!t.$$typeof}function wIe(t){return Fx(t)&&Array.isArray(t.children)}var VSt=Object.defineProperty,GSt=(t,e,n)=>e in t?VSt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,HSt=(t,e,n)=>GSt(t,e+"",n);function H4(t,e){e=IS(e);let n=t;for(const r of e)if(gh(n))n=n[r];else return;return n}function Jq(t,e,n){return _Ie(t,IS(e),n)}function _Ie(t,e,n){if(e.length===1){const r=e[0];if(gh(t)){const i=t[r];if(n===i)return t;const o=Array.isArray(t)?[...t]:{...t};return o[r]=n,o}else if(t===void 0){const i=typeof r=="number"?[]:{};return i[r]=n,i}}else if(e.length>1&&gh(t)){const r=e[0],i=t[r];if(gh(i)||i===void 0){const o=_Ie(i,e.slice(1),n);if(i!==o){const s=Array.isArray(t)?[...t]:{...t};return s[r]=o,s}}}return t}function IS(t){if(Array.isArray(t))return t;if(!t||t==="")return[];if(typeof t=="number")return[t];{const e=t.split(".");for(let n=0;ntypeof e=="number"?e.toString():e).join("."):typeof t=="number"?t.toString():""}function qSt(t,e){if(t===e)return!0;const n=IS(t),r=IS(e);return n.length===r.length&&n.every((i,o)=>i===r[o])}function XSt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}const YSt="http://localhost:8888",QSt="chartlets";async function mne(t,...e){try{return{status:"ok",data:await t(...e)}}catch(n){return n instanceof f3?{status:"failed",error:n.apiError}:{status:"failed",error:{message:`${n.message||n}`}}}}async function vne(t,e,n){const r=await fetch(t,e),i=await r.json();if(typeof i=="object"){if(i.error)throw new f3(i.error);if(!r.ok)throw new f3({status:r.status,message:r.statusText});if(XSt(i,"result"))return n?n(i.result):i.result}throw new f3({message:`unexpected response from ${t}`})}let f3=class extends Error{constructor(e){super(e.message),HSt(this,"apiError"),this.apiError=e}};function yne(t,e){const n=(e==null?void 0:e.serverUrl)||YSt,r=(e==null?void 0:e.endpointName)||QSt;return`${n}/${r}/${t}`}function fN(t){return typeof t=="function"}function SIe(t){return!!t.id&&!t.id.startsWith("@")}function CIe(t){return t.id==="@app"}function OIe(t){return t.id==="@container"}function xne(t,e,n){return t.map(r=>KSt(r,e,n))}const eX={};function KSt(t,e,n){let r;const{id:i,property:o}=t;return SIe(t)&&e.component?r=EIe(e.component,i,o):OIe(t)&&e.container?r=ZSt(e.container,o):CIe(t)&&n?r=JSt(n,o):console.warn("input with unknown data source:",t),(r===void 0||r===eX)&&(r=null,console.warn("value is undefined for input",t)),r}function EIe(t,e,n){if(t.id===e)return H4(t,n);if(wIe(t))for(let r=0;r{const o=t[n][r],s=aCt(o.container,i.filter(OIe)),a=oCt(o.component,i.filter(SIe));(s!==o.container||a!==o.component)&&(t={...t,[n]:TIe(t[n],r,{...o,container:s,component:a})})}),t}function oCt(t,e){let n=t;return n&&e.forEach(r=>{n=AIe(n,r)}),n}function AIe(t,e){if(Fx(t)&&t.id===e.id){const n=IS(e.property),r=e.value;if(n.length===0)return Fx(r)?r:t;const i=H4(t,n);if(n[n.length-1]==="children"&&!Array.isArray(r)&&r!==null&&r!==void 0)return Jq(t,n,[r]);if(i!==r)return Jq(t,n,r)}else if(wIe(t)){const n=t;let r=n;for(let i=0;i{n.stateChanges.forEach(r=>{CIe(r)&&e.set(gne(r.property),r.value)})})}function aCt(t,e){return e.forEach(n=>{(!t||H4(t,n.property)!==n.value)&&(t=Jq(t,n.property,n.value))}),t}function PIe(t){var e;const{configuration:n}=Oo.getState(),r=(e=n.logging)==null?void 0:e.enabled,i=cCt();r&&console.info(`chartlets: invokeCallbacks (${i})-->`,t),eCt(t,n.api).then(o=>{o.data?(r&&console.info(`chartlets: invokeCallbacks <--(${i})`,o.data),kIe(o.data)):console.error("callback failed:",o.error,"for call requests:",t)})}let lCt=0;function cCt(){return lCt++}function uCt(t,e,n){if(Oo.getState().extensions.length===0)return;kIe([{contribPoint:t,contribIndex:e,stateChanges:[{id:n.id,property:n.property,value:n.value}]}]);const r=fCt(t,e,n);r&&r.length>0&&PIe(r)}function fCt(t,e,n){const{configuration:r,contributionsRecord:i}=Oo.getState(),{hostStore:o}=r,s=i[t][e],a=[];return(s.callbacks||[]).forEach((l,c)=>{if(l.inputs&&l.inputs.length){const u=l.inputs,f=u.findIndex(d=>!d.noTrigger&&d.id&&!d.id.startsWith("@")&&d.id===n.id&&qSt(d.property,n.property));f>=0&&a.push({contribPoint:t,contribIndex:e,callbackIndex:c,inputIndex:f,inputValues:xne(u,s,o)})}}),a}const dCt=t=>t.contributionsRecord,hCt=t=>t.themeMode,MIe=Oo,RIe=()=>MIe(dCt),pCt=()=>MIe(hCt);var gCt=Object.defineProperty,mCt=(t,e,n)=>e in t?gCt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vCt=(t,e,n)=>mCt(t,e+"",n);let yCt=class{constructor(){vCt(this,"components",new Map)}register(e,n){const r=this.components.get(e);return this.components.set(e,n),()=>{typeof r=="function"?this.components.set(e,r):this.components.delete(e)}}lookup(e){return this.components.get(e)}clear(){this.components.clear()}get types(){return Array.from(this.components.keys())}};const DIe=new yCt;function IIe(t){const{type:e}=t,n=DIe.lookup(e);return typeof n=="function"?C.jsx(n,{...t}):(console.error(`chartlets: invalid component type encountered: ${e}`),null)}function bne({nodes:t,onChange:e}){return!t||t.length===0?null:C.jsx(C.Fragment,{children:t.map((n,r)=>{if(Fx(n)){const i=n.id||r;return C.jsx(IIe,{...n,onChange:e},i)}else{if(typeof n=="string")return n;n&&console.warn("chartlets: invalid child node encountered:",n)}})})}const xCt={Date:!0,RegExp:!0,String:!0,Number:!0};function LIe(t,e,n={cyclesFix:!0},r=[]){var a,l;let i=[];const o=Array.isArray(t);for(const c in t){const u=t[c],f=o?+c:c;if(!(c in e)){i.push({type:"REMOVE",path:[f],oldValue:t[c]});continue}const d=e[c],h=typeof u=="object"&&typeof d=="object"&&Array.isArray(u)===Array.isArray(d);if(u&&d&&h&&!xCt[(l=(a=Object.getPrototypeOf(u))==null?void 0:a.constructor)==null?void 0:l.name]&&(!n.cyclesFix||!r.includes(u))){const p=LIe(u,d,n,n.cyclesFix?r.concat([u]):[]);i.push.apply(i,p.map(g=>(g.path.unshift(f),g)))}else u!==d&&!(Number.isNaN(u)&&Number.isNaN(d))&&!(h&&(isNaN(u)?u+""==d+"":+u==+d))&&i.push({path:[f],type:"CHANGE",value:d,oldValue:u})}const s=Array.isArray(e);for(const c in e)c in t||i.push({type:"CREATE",path:[s?+c:c],value:e[c]});return i}function $Ie(t,e){const n={};return Object.getOwnPropertyNames(t).forEach(r=>{n[r]=e(t[r],r)}),n}async function bCt(t){return mne(wCt,t)}async function wCt(t){return vne(yne("contributions",t),void 0,_Ct)}function _Ct(t){return{...t,contributions:$Ie(t.contributions,e=>e.map(n=>({...n,layout:n.layout?FIe(n.layout):void 0,callbacks:SCt(n.callbacks)})))}}function SCt(t){return t?t.map(FIe):[]}function FIe(t){return{...t,inputs:t.inputs?Mpe(t.inputs):[],outputs:t.outputs?Mpe(t.outputs):[]}}function Mpe(t){return t?t.map(CCt):[]}function CCt(t){return{...t,property:IS(t.property)}}function OCt(t){return!!t&&typeof t=="object"&&typeof t.then=="function"}function ECt(){const{extensions:t,configuration:e,contributionsRecord:n}=Oo.getState(),{hostStore:r}=e;if(!r||(ACt(r),t.length===0))return;const i=kCt();if(!i||i.length===0)return;const o=TCt(i,n,r);o&&o.length>0&&PIe(o)}function TCt(t,e,n){return t.map(r=>{const i=e[r.contribPoint][r.contribIndex],o=i.callbacks[r.callbackIndex],s=xne(o.inputs,i,n);return{...r,inputValues:s}})}function kCt(){const{contributionsRecord:t}=Oo.getState(),e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].forEach((r,i)=>{(r.callbacks||[]).forEach((o,s)=>(o.inputs||[]).forEach((a,l)=>{!a.noTrigger&&a.id==="@app"&&a.property&&e.push({contribPoint:n,contribIndex:i,callbackIndex:s,inputIndex:l,property:gne(a.property)})}),[])})}),e}function ACt(t){const e=t.get("themeMode"),n=Oo.getState().themeMode;(e==="dark"||e==="light"||e==="system")&&e!==n&&Oo.setState({themeMode:e})}const DW="color:light-dark(lightblue, lightblue)",IW="font-weight:bold",LW="color:light-dark(darkgrey, lightgray)";let EI;function PCt(t){EI&&(EI(),EI=void 0),(!t||t.enabled)&&(EI=Oo.subscribe(MCt))}function MCt(t,e){const n=LIe(e,t),r=n.length;console.groupCollapsed(`chartlets: state changed (${r} difference${r===1?"":"s"})`),n.forEach(RCt),console.debug("chartlets: change details:",{prev:e,next:t,delta:n}),console.groupEnd()}function RCt(t,e){const n=`%c${e+1} %c${t.type} %c${t.path.join(".")}`;t.type==="CREATE"?console.debug("chartlets:",n,DW,IW,LW,{value:t.value}):t.type==="CHANGE"?console.debug("chartlets:",n,DW,IW,LW,{value:t.value,oldValue:t.oldValue}):t.type==="REMOVE"&&console.debug("chartlets:",n,DW,IW,LW,{oldValue:t.oldValue})}function DCt(t){t=t||{},t.logging&&PCt(t.logging),t.hostStore&&t.hostStore.subscribe(ECt),Oo.setState({configuration:{...t}}),t.plugins&&t.plugins.forEach(tX)}function tX(t){return OCt(t)?t.then(tX):fN(t)?tX(t()):gh(t)&&t.components?(t.components.forEach(([e,n])=>{DIe.register(e,n)}),Promise.resolve(t)):Promise.resolve(void 0)}function ICt(t){t&&DCt(t);const{configuration:e}=Oo.getState();Oo.setState({contributionsResult:{status:"pending"}}),bCt(e.api).then(LCt)}function LCt(t){let e={contributionsResult:t};if(t.data){const{extensions:n,contributions:r}=t.data;e={...e,extensions:n,contributionsRecord:$Ie(r,i=>i.map($Ct))}}Oo.setState(e)}function $Ct(t){return{...t,container:{...t.initialState},componentResult:{}}}async function FCt(t,e,n,r){return mne(NCt,t,e,n,r)}async function NCt(t,e,n,r){return vne(yne(`layout/${t}/${e}`,r),{body:JSON.stringify({inputValues:n}),method:"post"})}function zCt(t,e,n,r=!0){const{configuration:i,contributionsRecord:o}=Oo.getState(),s=o[t][e];if(s.container===n)return;const a=!!s.componentResult.status;if(!r||a)$W(t,e,{container:n});else if(!a){$W(t,e,{container:n,componentResult:{status:"pending"}});const l=jCt(t,e);FCt(t,e,l,i.api).then(c=>{$W(t,e,{componentResult:c,component:c.data})})}}function jCt(t,e){const{configuration:n,contributionsRecord:r}=Oo.getState(),{hostStore:i}=n,o=r[t][e],s=o.layout.inputs;return s&&s.length>0?xne(s,o,i):[]}function $W(t,e,n){const{contributionsRecord:r}=Oo.getState(),i=r[t],o=i[e],s=n.container?{...n,container:{...o.container,...n.container}}:n;Oo.setState({contributionsRecord:{...r,[t]:TIe(i,e,s)}})}const BCt=({id:t,style:e,color:n,component:r,children:i,onChange:o})=>C.jsx(ot,{id:t,style:e,color:n,component:r||"div",children:C.jsx(bne,{nodes:i,onChange:o})});function q4({title:t,children:e}){return t?C.jsx(Mt,{title:t,children:e}):e}function UCt({type:t,id:e,name:n,style:r,variant:i,color:o,disabled:s,text:a,startIcon:l,endIcon:c,onChange:u}){return C.jsx(q4,{children:C.jsx(Hr,{id:e,name:n,style:r,variant:i,color:o,disabled:s,startIcon:l&&C.jsx(kS,{children:l}),endIcon:c&&C.jsx(kS,{children:c}),onClick:f=>{e&&u({componentType:t,id:e,property:"clicked",value:!0})},children:a})})}function WCt({type:t,id:e,name:n,value:r,disabled:i,style:o,tooltip:s,label:a,onChange:l}){return C.jsx(Mt,{title:s,children:C.jsx(td,{variant:"filled",size:"small",style:o,children:C.jsx(sg,{label:a,control:C.jsx(FF,{id:e,name:n,checked:!!r,disabled:i,onChange:c=>{if(e)return l({componentType:t,id:e,property:"value",value:c.currentTarget.checked})}})})})})}const VCt=({id:t,style:e,size:n,value:r,variant:i})=>C.jsx(Ly,{id:t,style:e,size:n,value:r,variant:i}),GCt=({id:t,style:e,orientation:n,variant:r,flexItem:i,textAlign:o,children:s,onChange:a})=>C.jsx(zf,{id:t,style:e,orientation:n,variant:r,flexItem:i,textAlign:o,children:s&&s.length&&C.jsx(bne,{nodes:s,onChange:a})});function HCt({type:t,id:e,name:n,style:r,tooltip:i,color:o,icon:s,size:a,disabled:l,onChange:c}){return C.jsx(q4,{title:i,children:C.jsx(Gt,{id:e,name:n,style:r,color:o,size:a,disabled:l,onClick:u=>{e&&c({componentType:t,id:e,property:"clicked",value:!0})},children:C.jsx(kS,{children:s})})})}const qCt=({id:t,style:e,value:n,variant:r})=>C.jsx(nct,{id:t,style:e,value:n,variant:r});function XCt({type:t,id:e,name:n,value:r,disabled:i,style:o,label:s,row:a,tooltip:l,dense:c,children:u,onChange:f}){return C.jsx(q4,{title:l,children:C.jsxs(td,{style:o,disabled:i,children:[C.jsx(CPe,{children:s}),C.jsx(_4,{id:e,name:n,row:a,value:r,onChange:(d,h)=>{if(e)return f({componentType:t,id:e,property:"value",value:h})},children:u&&u.map(d=>C.jsx(sg,{value:d.value,label:d.label,disabled:d.disabled,control:C.jsx(F_,{id:d.id,size:c?"small":"medium"})}))})]})})}function YCt({type:t,id:e,name:n,value:r,options:i,disabled:o,style:s,tooltip:a,label:l,onChange:c}){const u=f=>{if(e){let d=f.target.value;typeof r=="number"&&(d=Number.parseInt(d)),c({componentType:t,id:e,property:"value",value:d})}};return C.jsx(q4,{title:a,children:C.jsxs(td,{variant:"filled",size:"small",style:s,children:[l&&C.jsx(Fy,{id:`${e}-label`,children:l}),C.jsx(Hg,{labelId:`${e}-label`,id:e,name:n,value:`${r}`,disabled:o,onChange:u,children:Array.isArray(i)&&i.map(QCt).map(([f,d],h)=>C.jsx(Br,{value:f,children:d},h))})]})})}function QCt(t){return JM(t)?[t,t]:typeof t=="number"?[t,t.toString()]:Array.isArray(t)?t:[t.value,t.label||`${t.value}`]}function KCt({type:t,id:e,name:n,value:r,disabled:i,style:o,label:s,onChange:a}){return C.jsx(td,{variant:"filled",size:"small",style:o,children:C.jsx(sg,{label:s,control:C.jsx(Zee,{id:e,name:n,checked:!!r,disabled:i,onChange:l=>{if(e)return a({componentType:t,id:e,property:"value",value:l.currentTarget.checked})}})})})}function ZCt({type:t,id:e,value:n,children:r,disabled:i,style:o,onChange:s}){return C.jsx(O4,{id:e,style:o,value:n,onChange:(a,l)=>{e&&s({componentType:t,id:e,property:"value",value:l})},children:r==null?void 0:r.map(a=>{const l=Fx(a)?a:void 0;return C.jsx(sb,{label:l?l.label:JM(a)?a:"",icon:l&&l.icon&&C.jsx(kS,{children:l.icon}),disabled:i||l&&l.disabled})})})}const JCt=({id:t,style:e,align:n,gutterBottom:r,noWrap:i,variant:o,children:s,onChange:a})=>C.jsx(Jt,{id:t,style:e,align:n,gutterBottom:r,noWrap:i,variant:o,children:C.jsx(bne,{nodes:s,onChange:a})}),eOt=({type:t,id:e,style:n,defaultValue:r,ariaLabel:i,color:o,disableSwap:s,getAriaValueText:a,min:l,max:c,marks:u,orientation:f,step:d,size:h,track:p,value:g,valueLabelDisplay:m,onChange:v,...y})=>{const{children:x,...b}=y;return C.jsx(t1,{...b,id:e,defaultValue:r,"aria-label":i,color:o,style:n,disableSwap:s,getAriaValueText:a,min:l,max:c,marks:u,orientation:f,step:d,size:h,track:p,value:g??0,valueLabelDisplay:m,onChange:(w,_,S)=>{e&&v({componentType:t,id:e,property:"value",value:_})}})};function tOt(){return{components:[["Box",BCt],["Button",UCt],["Checkbox",WCt],["CircularProgress",VCt],["Divider",GCt],["IconButton",HCt],["LinearProgress",qCt],["RadioGroup",XCt],["Select",YCt],["Slider",eOt],["Switch",KCt],["Tabs",ZCt],["Typography",JCt]]}}const Rpe={};function nX(t,e){t===void 0&&(t=Rpe),e===void 0&&(e=Rpe);const n=Object.keys(t),r=Object.keys(e);return t===e||n.length===r.length&&n.every(i=>t[i]===e[i])}const nOt=/("(?:[^\\"]|\\.)*")|[:,]/g;function FW(t,e={}){const n=JSON.stringify([1],void 0,e.indent===void 0?2:e.indent).slice(2,-3),r=n===""?1/0:e.maxLength===void 0?80:e.maxLength;let{replacer:i}=e;return function o(s,a,l){s&&typeof s.toJSON=="function"&&(s=s.toJSON());const c=JSON.stringify(s,i);if(c===void 0)return c;const u=r-a.length-l;if(c.length<=u){const f=c.replace(nOt,(d,h)=>h||`${d} `);if(f.length<=u)return f}if(i!=null&&(s=JSON.parse(c),i=void 0),typeof s=="object"&&s!==null){const f=a+n,d=[];let h=0,p,g;if(Array.isArray(s)){p="[",g="]";const{length:m}=s;for(;h0)return[p,n+d.join(`, ${f}`),g].join(` -${a}`)}return c}(t,"",0)}function Al(t,e,n){return t.fields=e||[],t.fname=n,t}function Fi(t){return t==null?null:t.fname}function Ks(t){return t==null?null:t.fields}function NIe(t){return t.length===1?rOt(t[0]):iOt(t)}const rOt=t=>function(e){return e[t]},iOt=t=>{const e=t.length;return function(n){for(let r=0;rs?c():s=a+1:l==="["?(a>s&&c(),i=s=a+1):l==="]"&&(i||je("Access path missing open bracket: "+t),i>0&&c(),i=0,s=a+1)}return i&&je("Access path missing closing bracket: "+t),r&&je("Access path missing closing quote: "+t),a>s&&(a++,c()),e}function Ou(t,e,n){const r=Wh(t);return t=r.length===1?r[0]:t,Al((n&&n.get||NIe)(r),[t],e||t)}const eR=Ou("id"),na=Al(t=>t,[],"identity"),rv=Al(()=>0,[],"zero"),yO=Al(()=>1,[],"one"),Eu=Al(()=>!0,[],"true"),Rm=Al(()=>!1,[],"false");function oOt(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const zIe=0,wne=1,_ne=2,jIe=3,BIe=4;function Sne(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oOt,r=t||zIe;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=wne&&n(e||"error","ERROR",arguments),this},warn(){return r>=_ne&&n(e||"warn","WARN",arguments),this},info(){return r>=jIe&&n(e||"log","INFO",arguments),this},debug(){return r>=BIe&&n(e||"log","DEBUG",arguments),this}}}var We=Array.isArray;function ht(t){return t===Object(t)}const Dpe=t=>t!=="__proto__";function xO(){for(var t=arguments.length,e=new Array(t),n=0;n{for(const o in i)if(o==="signals")r.signals=sOt(r.signals,i.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;bO(r,o,i[o],s)}return r},{})}function bO(t,e,n,r){if(!Dpe(e))return;let i,o;if(ht(n)&&!We(n)){o=ht(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?bO(o,i,n[i]):Dpe(i)&&(o[i]=n[i])}else t[e]=n}function sOt(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function $n(t){return t[t.length-1]}function Ys(t){return t==null||t===""?null:+t}const UIe=t=>e=>t*Math.exp(e),WIe=t=>e=>Math.log(t*e),VIe=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),GIe=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,dN=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function X4(t,e,n,r){const i=n(t[0]),o=n($n(t)),s=(o-i)*e;return[r(i-s),r(o-s)]}function HIe(t,e){return X4(t,e,Ys,na)}function qIe(t,e){var n=Math.sign(t[0]);return X4(t,e,WIe(n),UIe(n))}function XIe(t,e,n){return X4(t,e,dN(n),dN(1/n))}function YIe(t,e,n){return X4(t,e,VIe(n),GIe(n))}function Y4(t,e,n,r,i){const o=r(t[0]),s=r($n(t)),a=e!=null?r(e):(o+s)/2;return[i(a+(o-a)*n),i(a+(s-a)*n)]}function Cne(t,e,n){return Y4(t,e,n,Ys,na)}function One(t,e,n){const r=Math.sign(t[0]);return Y4(t,e,n,WIe(r),UIe(r))}function hN(t,e,n,r){return Y4(t,e,n,dN(r),dN(1/r))}function Ene(t,e,n,r){return Y4(t,e,n,VIe(r),GIe(r))}function QIe(t){return 1+~~(new Date(t).getMonth()/3)}function KIe(t){return 1+~~(new Date(t).getUTCMonth()/3)}function pt(t){return t!=null?We(t)?t:[t]:[]}function ZIe(t,e,n){let r=t[0],i=t[1],o;return i=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function fn(t){return typeof t=="function"}const aOt="descending";function Tne(t,e,n){n=n||{},e=pt(e)||[];const r=[],i=[],o={},s=n.comparator||lOt;return pt(t).forEach((a,l)=>{a!=null&&(r.push(e[l]===aOt?-1:1),i.push(a=fn(a)?a:Ou(a,null,n)),(Ks(a)||[]).forEach(c=>o[c]=1))}),i.length===0?null:Al(s(i,r),Object.keys(o))}const Q4=(t,e)=>(te||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),lOt=(t,e)=>t.length===1?cOt(t[0],e[0]):uOt(t,e,t.length),cOt=(t,e)=>function(n,r){return Q4(t(n),t(r))*e},uOt=(t,e,n)=>(e.push(0),function(r,i){let o,s=0,a=-1;for(;s===0&&++at}function kne(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function cn(t){for(let e,n,r=1,i=arguments.length;rs&&(s=i))}else{for(i=e(t[n]);ns&&(s=i))}return[o,s]}function JIe(t,e){const n=t.length;let r=-1,i,o,s,a,l;if(e==null){for(;++r=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s{i.set(o,t[o])}),i}function eLe(t,e,n,r,i,o){if(!n&&n!==0)return o;const s=+n;let a=t[0],l=$n(t),c;lo&&(s=i,i=o,o=s),n=n===void 0||n,r=r===void 0||r,(n?i<=t:ia.replace(/\\(.)/g,"$1")):pt(t));const r=t&&t.length,i=n&&n.get||NIe,o=a=>i(e?[a]:Wh(a));let s;if(!r)s=function(){return""};else if(r===1){const a=o(t[0]);s=function(l){return""+a(l)}}else{const a=t.map(o);s=function(l){let c=""+a[0](l),u=0;for(;++u{e={},n={},r=0},o=(s,a)=>(++r>t&&(n=e,e={},r=1),e[s]=a);return i(),{clear:i,has:s=>vt(e,s)||vt(n,s),get:s=>vt(e,s)?e[s]:vt(n,s)?o(s,n[s]):void 0,set:(s,a)=>vt(e,s)?e[s]=a:o(s,a)}}function oLe(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const s=r||new e.constructor(i+o);let a=0,l=0,c=0;for(;a0?n[l++]:e[a++];for(;a=0;)n+=t;return n}function sLe(t,e,n,r){const i=n||" ",o=t+"",s=e-o.length;return s<=0?o:r==="left"?tT(i,s)+o:r==="center"?tT(i,~~(s/2))+o+tT(i,Math.ceil(s/2)):o+tT(i,s)}function tR(t){return t&&$n(t)-t[0]||0}function rt(t){return We(t)?"["+t.map(rt)+"]":ht(t)||gt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Pne(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const hOt=t=>Jn(t)||Nv(t)?t:Date.parse(t);function Mne(t,e){return e=e||hOt,t==null||t===""?null:e(t)}function Rne(t){return t==null||t===""?null:t+""}function Wf(t){const e={},n=t.length;for(let r=0;r9999?"+"+Va(t,6):Va(t,4)}function mOt(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":gOt(t.getUTCFullYear())+"-"+Va(t.getUTCMonth()+1,2)+"-"+Va(t.getUTCDate(),2)+(i?"T"+Va(e,2)+":"+Va(n,2)+":"+Va(r,2)+"."+Va(i,3)+"Z":r?"T"+Va(e,2)+":"+Va(n,2)+":"+Va(r,2)+"Z":n||e?"T"+Va(e,2)+":"+Va(n,2)+"Z":"")}function vOt(t){var e=new RegExp('["'+t+` -\r]`),n=t.charCodeAt(0);function r(f,d){var h,p,g=i(f,function(m,v){if(h)return h(m,v-1);p=m,h=d?pOt(m,d):lLe(m)});return g.columns=p||[],g}function i(f,d){var h=[],p=f.length,g=0,m=0,v,y=p<=0,x=!1;f.charCodeAt(p-1)===GE&&--p,f.charCodeAt(p-1)===jW&&--p;function b(){if(y)return NW;if(x)return x=!1,Ipe;var _,S=g,O;if(f.charCodeAt(S)===zW){for(;g++=p?y=!0:(O=f.charCodeAt(g++))===GE?x=!0:O===jW&&(x=!0,f.charCodeAt(g)===GE&&++g),f.slice(S+1,_-1).replace(/""/g,'"')}for(;gfunction(e){return e[t]},iOt=t=>{const e=t.length;return function(n){for(let r=0;rs?c():s=a+1:l==="["?(a>s&&c(),i=s=a+1):l==="]"&&(i||je("Access path missing open bracket: "+t),i>0&&c(),i=0,s=a+1)}return i&&je("Access path missing closing bracket: "+t),r&&je("Access path missing closing quote: "+t),a>s&&(a++,c()),e}function Ou(t,e,n){const r=Wh(t);return t=r.length===1?r[0]:t,Al((n&&n.get||NIe)(r),[t],e||t)}const eR=Ou("id"),na=Al(t=>t,[],"identity"),rv=Al(()=>0,[],"zero"),vO=Al(()=>1,[],"one"),Eu=Al(()=>!0,[],"true"),Rm=Al(()=>!1,[],"false");function oOt(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const zIe=0,wne=1,_ne=2,jIe=3,BIe=4;function Sne(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oOt,r=t||zIe;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=wne&&n(e||"error","ERROR",arguments),this},warn(){return r>=_ne&&n(e||"warn","WARN",arguments),this},info(){return r>=jIe&&n(e||"log","INFO",arguments),this},debug(){return r>=BIe&&n(e||"log","DEBUG",arguments),this}}}var We=Array.isArray;function ht(t){return t===Object(t)}const Dpe=t=>t!=="__proto__";function yO(){for(var t=arguments.length,e=new Array(t),n=0;n{for(const o in i)if(o==="signals")r.signals=sOt(r.signals,i.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;xO(r,o,i[o],s)}return r},{})}function xO(t,e,n,r){if(!Dpe(e))return;let i,o;if(ht(n)&&!We(n)){o=ht(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?xO(o,i,n[i]):Dpe(i)&&(o[i]=n[i])}else t[e]=n}function sOt(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function $n(t){return t[t.length-1]}function Ys(t){return t==null||t===""?null:+t}const UIe=t=>e=>t*Math.exp(e),WIe=t=>e=>Math.log(t*e),VIe=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),GIe=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,dN=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function X4(t,e,n,r){const i=n(t[0]),o=n($n(t)),s=(o-i)*e;return[r(i-s),r(o-s)]}function HIe(t,e){return X4(t,e,Ys,na)}function qIe(t,e){var n=Math.sign(t[0]);return X4(t,e,WIe(n),UIe(n))}function XIe(t,e,n){return X4(t,e,dN(n),dN(1/n))}function YIe(t,e,n){return X4(t,e,VIe(n),GIe(n))}function Y4(t,e,n,r,i){const o=r(t[0]),s=r($n(t)),a=e!=null?r(e):(o+s)/2;return[i(a+(o-a)*n),i(a+(s-a)*n)]}function Cne(t,e,n){return Y4(t,e,n,Ys,na)}function One(t,e,n){const r=Math.sign(t[0]);return Y4(t,e,n,WIe(r),UIe(r))}function hN(t,e,n,r){return Y4(t,e,n,dN(r),dN(1/r))}function Ene(t,e,n,r){return Y4(t,e,n,VIe(r),GIe(r))}function QIe(t){return 1+~~(new Date(t).getMonth()/3)}function KIe(t){return 1+~~(new Date(t).getUTCMonth()/3)}function pt(t){return t!=null?We(t)?t:[t]:[]}function ZIe(t,e,n){let r=t[0],i=t[1],o;return i=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function fn(t){return typeof t=="function"}const aOt="descending";function Tne(t,e,n){n=n||{},e=pt(e)||[];const r=[],i=[],o={},s=n.comparator||lOt;return pt(t).forEach((a,l)=>{a!=null&&(r.push(e[l]===aOt?-1:1),i.push(a=fn(a)?a:Ou(a,null,n)),(Ks(a)||[]).forEach(c=>o[c]=1))}),i.length===0?null:Al(s(i,r),Object.keys(o))}const Q4=(t,e)=>(te||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),lOt=(t,e)=>t.length===1?cOt(t[0],e[0]):uOt(t,e,t.length),cOt=(t,e)=>function(n,r){return Q4(t(n),t(r))*e},uOt=(t,e,n)=>(e.push(0),function(r,i){let o,s=0,a=-1;for(;s===0&&++at}function kne(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function cn(t){for(let e,n,r=1,i=arguments.length;rs&&(s=i))}else{for(i=e(t[n]);ns&&(s=i))}return[o,s]}function JIe(t,e){const n=t.length;let r=-1,i,o,s,a,l;if(e==null){for(;++r=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s{i.set(o,t[o])}),i}function eLe(t,e,n,r,i,o){if(!n&&n!==0)return o;const s=+n;let a=t[0],l=$n(t),c;lo&&(s=i,i=o,o=s),n=n===void 0||n,r=r===void 0||r,(n?i<=t:ia.replace(/\\(.)/g,"$1")):pt(t));const r=t&&t.length,i=n&&n.get||NIe,o=a=>i(e?[a]:Wh(a));let s;if(!r)s=function(){return""};else if(r===1){const a=o(t[0]);s=function(l){return""+a(l)}}else{const a=t.map(o);s=function(l){let c=""+a[0](l),u=0;for(;++u{e={},n={},r=0},o=(s,a)=>(++r>t&&(n=e,e={},r=1),e[s]=a);return i(),{clear:i,has:s=>vt(e,s)||vt(n,s),get:s=>vt(e,s)?e[s]:vt(n,s)?o(s,n[s]):void 0,set:(s,a)=>vt(e,s)?e[s]=a:o(s,a)}}function oLe(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const s=r||new e.constructor(i+o);let a=0,l=0,c=0;for(;a0?n[l++]:e[a++];for(;a=0;)n+=t;return n}function sLe(t,e,n,r){const i=n||" ",o=t+"",s=e-o.length;return s<=0?o:r==="left"?eT(i,s)+o:r==="center"?eT(i,~~(s/2))+o+eT(i,Math.ceil(s/2)):o+eT(i,s)}function tR(t){return t&&$n(t)-t[0]||0}function rt(t){return We(t)?"["+t.map(rt)+"]":ht(t)||gt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Pne(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const hOt=t=>Jn(t)||Nv(t)?t:Date.parse(t);function Mne(t,e){return e=e||hOt,t==null||t===""?null:e(t)}function Rne(t){return t==null||t===""?null:t+""}function Wf(t){const e={},n=t.length;for(let r=0;r9999?"+"+Va(t,6):Va(t,4)}function mOt(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":gOt(t.getUTCFullYear())+"-"+Va(t.getUTCMonth()+1,2)+"-"+Va(t.getUTCDate(),2)+(i?"T"+Va(e,2)+":"+Va(n,2)+":"+Va(r,2)+"."+Va(i,3)+"Z":r?"T"+Va(e,2)+":"+Va(n,2)+":"+Va(r,2)+"Z":n||e?"T"+Va(e,2)+":"+Va(n,2)+"Z":"")}function vOt(t){var e=new RegExp('["'+t+` +\r]`),n=t.charCodeAt(0);function r(f,d){var h,p,g=i(f,function(m,v){if(h)return h(m,v-1);p=m,h=d?pOt(m,d):lLe(m)});return g.columns=p||[],g}function i(f,d){var h=[],p=f.length,g=0,m=0,v,y=p<=0,x=!1;f.charCodeAt(p-1)===VE&&--p,f.charCodeAt(p-1)===jW&&--p;function b(){if(y)return NW;if(x)return x=!1,Ipe;var _,S=g,O;if(f.charCodeAt(S)===zW){for(;g++=p?y=!0:(O=f.charCodeAt(g++))===VE?x=!0:O===jW&&(x=!0,f.charCodeAt(g)===VE&&++g),f.slice(S+1,_-1).replace(/""/g,'"')}for(;g1)r=OOt(t,e,n);else for(i=0,r=new Array(o=t.arcs.length);ie?1:t>=e?0:NaN}function EOt(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function _O(t){let e,n,r;t.length!==2?(e=mh,n=(a,l)=>mh(t(a),l),r=(a,l)=>t(a)-l):(e=t===mh||t===EOt?t:TOt,n=t,r=t);function i(a,l,c=0,u=a.length){if(c>>1;n(a[f],l)<0?c=f+1:u=f}while(c>>1;n(a[f],l)<=0?c=f+1:u=f}while(cc&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function TOt(){return 0}function uLe(t){return t===null?NaN:+t}function*kOt(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const fLe=_O(mh),Lg=fLe.right,AOt=fLe.left;_O(uLe).center;function POt(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let s of t)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of t)(a=e(a,++s,t))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function MOt(t,e){const n=POt(t,e);return n&&Math.sqrt(n)}class Ea{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i0){for(s=e[--n];n>0&&(r=s,i=e[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}class Fpe extends Map{constructor(e,n=pLe){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(rX(this,e))}has(e){return super.has(rX(this,e))}set(e,n){return super.set(dLe(this,e),n)}delete(e){return super.delete(hLe(this,e))}}class pN extends Set{constructor(e,n=pLe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const r of e)this.add(r)}has(e){return super.has(rX(this,e))}add(e){return super.add(dLe(this,e))}delete(e){return super.delete(hLe(this,e))}}function rX({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function dLe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function hLe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function pLe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function ROt(t,e){return Array.from(e,n=>t[n])}function DOt(t=mh){if(t===mh)return gLe;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 gLe(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const IOt=Math.sqrt(50),LOt=Math.sqrt(10),$Ot=Math.sqrt(2);function gN(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=IOt?10:o>=LOt?5:o>=$Ot?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(t*c),l=Math.round(e*c),a/ce&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(t/c),l=Math.round(e/c),a*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function sX(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function mLe(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?gLe:DOt(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));mLe(t,e,h,p,i)}const o=t[e];let s=n,a=r;for(HE(t,n,e),i(t[r],o)>0&&HE(t,n,r);s0;)--a}i(t[n],o)===0?HE(t,n,a):(++a,HE(t,a,r)),a<=e&&(n=a+1),e<=a&&(r=a-1)}return t}function HE(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function mN(t,e,n){if(t=Float64Array.from(kOt(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return sX(t);if(e>=1)return Nx(t);var r,i=(r-1)*e,o=Math.floor(i),s=Nx(mLe(t,o).subarray(0,o+1)),a=sX(t.subarray(o+1));return s+(a-s)*(i-o)}}function vLe(t,e,n=uLe){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),s=+n(t[o],o,t),a=+n(t[o+1],o+1,t);return s+(a-s)*(i-o)}}function FOt(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function yLe(t,e){return mN(t,.5,e)}function*NOt(t){for(const e of t)yield*e}function xLe(t){return Array.from(NOt(t))}function sl(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=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function vN(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 LS(t){return t=vN(Math.abs(t)),t?t[1]:NaN}function WOt(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function VOt(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var GOt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function hb(t){if(!(e=GOt.exec(t)))throw new Error("invalid format: "+t);var e;return new Dne({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]})}hb.prototype=Dne.prototype;function Dne(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+""}Dne.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 HOt(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 wLe;function qOt(t,e){var n=vN(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(wLe=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+vN(t,Math.max(0,e+o-1))[0]}function Npe(t,e){var n=vN(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 zpe={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:UOt,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)=>Npe(t*100,e),r:Npe,s:qOt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function jpe(t){return t}var Bpe=Array.prototype.map,Upe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _Le(t){var e=t.grouping===void 0||t.thousands===void 0?jpe:WOt(Bpe.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?jpe:VOt(Bpe.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=hb(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,v=f.width,y=f.comma,x=f.precision,b=f.trim,w=f.type;w==="n"?(y=!0,w="g"):zpe[w]||(x===void 0&&(x=12),b=!0,w="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",S=g==="$"?r:/[%p]/.test(w)?s:"",O=zpe[w],k=/[defgprs%]/.test(w);x=x===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function E(P){var A=_,R=S,T,M,I;if(w==="c")R=O(P)+R,P="";else{P=+P;var z=P<0||1/P<0;if(P=isNaN(P)?l:O(Math.abs(P),x),b&&(P=HOt(P)),z&&+P==0&&p!=="+"&&(z=!1),A=(z?p==="("?p:a:p==="-"||p==="("?"":p)+A,R=(w==="s"?Upe[8+wLe/3]:"")+R+(z&&p==="("?")":""),k){for(T=-1,M=P.length;++TI||I>57){R=(I===46?i+P.slice(T+1):P.slice(T))+R,P=P.slice(0,T);break}}}y&&!m&&(P=e(P,1/0));var F=A.length+P.length+R.length,N=F>1)+A+P+R+N.slice(F);break;default:P=N+A+P+R;break}return o(P)}return E.toString=function(){return f+""},E}function u(f,d){var h=c((f=hb(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(LS(d)/3)))*3,g=Math.pow(10,-p),m=Upe[8+p/3];return function(v){return h(g*v)+m}}return{format:c,formatPrefix:u}}var kI,K4,Ine;XOt({thousands:",",grouping:[3],currency:["$",""]});function XOt(t){return kI=_Le(t),K4=kI.format,Ine=kI.formatPrefix,kI}function SLe(t){return Math.max(0,-LS(Math.abs(t)))}function CLe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(LS(e)/3)))*3-LS(Math.abs(t)))}function OLe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,LS(e)-LS(t))+1}const BW=new Date,UW=new Date;function ko(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 s=i(o),a=i.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,a),t(o);while(cko(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(i.count=(o,s)=>(BW.setTime(+o),UW.setTime(+s),t(BW),t(UW),Math.floor(n(BW,UW))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const $S=ko(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);$S.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ko(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):$S);$S.range;const Yp=1e3,ru=Yp*60,Qp=ru*60,$g=Qp*24,Lne=$g*7,Wpe=$g*30,WW=$g*365,Kp=ko(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Yp)},(t,e)=>(e-t)/Yp,t=>t.getUTCSeconds());Kp.range;const Z4=ko(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Yp)},(t,e)=>{t.setTime(+t+e*ru)},(t,e)=>(e-t)/ru,t=>t.getMinutes());Z4.range;const J4=ko(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ru)},(t,e)=>(e-t)/ru,t=>t.getUTCMinutes());J4.range;const eB=ko(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Yp-t.getMinutes()*ru)},(t,e)=>{t.setTime(+t+e*Qp)},(t,e)=>(e-t)/Qp,t=>t.getHours());eB.range;const tB=ko(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Qp)},(t,e)=>(e-t)/Qp,t=>t.getUTCHours());tB.range;const cg=ko(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ru)/$g,t=>t.getDate()-1);cg.range;const zv=ko(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/$g,t=>t.getUTCDate()-1);zv.range;const ELe=ko(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/$g,t=>Math.floor(t/$g));ELe.range;function u1(t){return ko(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())*ru)/Lne)}const SO=u1(0),yN=u1(1),YOt=u1(2),QOt=u1(3),FS=u1(4),KOt=u1(5),ZOt=u1(6);SO.range;yN.range;YOt.range;QOt.range;FS.range;KOt.range;ZOt.range;function f1(t){return ko(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)/Lne)}const CO=f1(0),xN=f1(1),JOt=f1(2),eEt=f1(3),NS=f1(4),tEt=f1(5),nEt=f1(6);CO.range;xN.range;JOt.range;eEt.range;NS.range;tEt.range;nEt.range;const wA=ko(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());wA.range;const _A=ko(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());_A.range;const Ah=ko(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());Ah.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ko(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)});Ah.range;const Ph=ko(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());Ph.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ko(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)});Ph.range;function TLe(t,e,n,r,i,o){const s=[[Kp,1,Yp],[Kp,5,5*Yp],[Kp,15,15*Yp],[Kp,30,30*Yp],[o,1,ru],[o,5,5*ru],[o,15,15*ru],[o,30,30*ru],[i,1,Qp],[i,3,3*Qp],[i,6,6*Qp],[i,12,12*Qp],[r,1,$g],[r,2,2*$g],[n,1,Lne],[e,1,Wpe],[e,3,3*Wpe],[t,1,WW]];function a(c,u,f){const d=um).right(s,d);if(h===s.length)return t.every(ry(c/WW,u/WW,f));if(h===0)return $S.every(Math.max(ry(c,u,f),1));const[p,g]=s[d/s[h-1][2](t[e]=1+n,t),{});function Fne(t){const e=pt(t).slice(),n={};return e.length||je("Missing time unit."),e.forEach(i=>{vt(VW,i)?n[i]=1:je(`Invalid time unit: ${i}.`)}),(n[wo]||n[qs]?1:0)+(n[wl]||n[Zs]||n[_l]?1:0)+(n[Mh]?1:0)>1&&je(`Incompatible time units: ${t}`),e.sort((i,o)=>VW[i]-VW[o]),e}const aEt={[bs]:"%Y ",[wl]:"Q%q ",[Zs]:"%b ",[_l]:"%d ",[wo]:"W%U ",[qs]:"%a ",[Mh]:"%j ",[Cc]:"%H:00",[Oc]:"00:%M",[Tu]:":%S",[Vf]:".%L",[`${bs}-${Zs}`]:"%Y-%m ",[`${bs}-${Zs}-${_l}`]:"%Y-%m-%d ",[`${Cc}-${Oc}`]:"%H:%M"};function kLe(t,e){const n=cn({},aEt,e),r=Fne(t),i=r.length;let o="",s=0,a,l;for(s=0;ss;--a)if(l=r.slice(s,a).join("-"),n[l]!=null){o+=n[l],s=a;break}return o.trim()}const Z0=new Date;function Nne(t){return Z0.setFullYear(t),Z0.setMonth(0),Z0.setDate(1),Z0.setHours(0,0,0,0),Z0}function ALe(t){return MLe(new Date(t))}function PLe(t){return aX(new Date(t))}function MLe(t){return cg.count(Nne(t.getFullYear())-1,t)}function aX(t){return SO.count(Nne(t.getFullYear())-1,t)}function lX(t){return Nne(t).getDay()}function lEt(t,e,n,r,i,o,s){if(0<=t&&t<100){const a=new Date(-1,e,n,r,i,o,s);return a.setFullYear(t),a}return new Date(t,e,n,r,i,o,s)}function RLe(t){return ILe(new Date(t))}function DLe(t){return cX(new Date(t))}function ILe(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return zv.count(e-1,t)}function cX(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return CO.count(e-1,t)}function uX(t){return Z0.setTime(Date.UTC(t,0,1)),Z0.getUTCDay()}function cEt(t,e,n,r,i,o,s){if(0<=t&&t<100){const a=new Date(Date.UTC(-1,e,n,r,i,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(t,e,n,r,i,o,s))}function LLe(t,e,n,r,i){const o=e||1,s=$n(t),a=(v,y,x)=>(x=x||v,uEt(n[x],r[x],v===s&&o,y)),l=new Date,c=Wf(t),u=c[bs]?a(bs):ra(2012),f=c[Zs]?a(Zs):c[wl]?a(wl):rv,d=c[wo]&&c[qs]?a(qs,1,wo+qs):c[wo]?a(wo,1):c[qs]?a(qs,1):c[_l]?a(_l,1):c[Mh]?a(Mh,1):yO,h=c[Cc]?a(Cc):rv,p=c[Oc]?a(Oc):rv,g=c[Tu]?a(Tu):rv,m=c[Vf]?a(Vf):rv;return function(v){l.setTime(+v);const y=u(l);return i(y,f(l),d(l,y),h(l),p(l),g(l),m(l))}}function uEt(t,e,n,r){const i=n<=1?t:r?(o,s)=>r+n*Math.floor((t(o,s)-r)/n):(o,s)=>n*Math.floor(t(o,s)/n);return e?(o,s)=>e(i(o,s),s):i}function zS(t,e,n){return e+t*7-(n+6)%7}const fEt={[bs]:t=>t.getFullYear(),[wl]:t=>Math.floor(t.getMonth()/3),[Zs]:t=>t.getMonth(),[_l]:t=>t.getDate(),[Cc]:t=>t.getHours(),[Oc]:t=>t.getMinutes(),[Tu]:t=>t.getSeconds(),[Vf]:t=>t.getMilliseconds(),[Mh]:t=>MLe(t),[wo]:t=>aX(t),[wo+qs]:(t,e)=>zS(aX(t),t.getDay(),lX(e)),[qs]:(t,e)=>zS(1,t.getDay(),lX(e))},dEt={[wl]:t=>3*t,[wo]:(t,e)=>zS(t,0,lX(e))};function $Le(t,e){return LLe(t,e||1,fEt,dEt,lEt)}const hEt={[bs]:t=>t.getUTCFullYear(),[wl]:t=>Math.floor(t.getUTCMonth()/3),[Zs]:t=>t.getUTCMonth(),[_l]:t=>t.getUTCDate(),[Cc]:t=>t.getUTCHours(),[Oc]:t=>t.getUTCMinutes(),[Tu]:t=>t.getUTCSeconds(),[Vf]:t=>t.getUTCMilliseconds(),[Mh]:t=>ILe(t),[wo]:t=>cX(t),[qs]:(t,e)=>zS(1,t.getUTCDay(),uX(e)),[wo+qs]:(t,e)=>zS(cX(t),t.getUTCDay(),uX(e))},pEt={[wl]:t=>3*t,[wo]:(t,e)=>zS(t,0,uX(e))};function FLe(t,e){return LLe(t,e||1,hEt,pEt,cEt)}const gEt={[bs]:Ah,[wl]:wA.every(3),[Zs]:wA,[wo]:SO,[_l]:cg,[qs]:cg,[Mh]:cg,[Cc]:eB,[Oc]:Z4,[Tu]:Kp,[Vf]:$S},mEt={[bs]:Ph,[wl]:_A.every(3),[Zs]:_A,[wo]:CO,[_l]:zv,[qs]:zv,[Mh]:zv,[Cc]:tB,[Oc]:J4,[Tu]:Kp,[Vf]:$S};function OO(t){return gEt[t]}function EO(t){return mEt[t]}function NLe(t,e,n){return t?t.offset(e,n):void 0}function zLe(t,e,n){return NLe(OO(t),e,n)}function jLe(t,e,n){return NLe(EO(t),e,n)}function BLe(t,e,n,r){return t?t.range(e,n,r):void 0}function ULe(t,e,n,r){return BLe(OO(t),e,n,r)}function WLe(t,e,n,r){return BLe(EO(t),e,n,r)}const nT=1e3,rT=nT*60,iT=rT*60,nB=iT*24,vEt=nB*7,Vpe=nB*30,fX=nB*365,VLe=[bs,Zs,_l,Cc,Oc,Tu,Vf],oT=VLe.slice(0,-1),sT=oT.slice(0,-1),aT=sT.slice(0,-1),yEt=aT.slice(0,-1),xEt=[bs,wo],Gpe=[bs,Zs],GLe=[bs],qE=[[oT,1,nT],[oT,5,5*nT],[oT,15,15*nT],[oT,30,30*nT],[sT,1,rT],[sT,5,5*rT],[sT,15,15*rT],[sT,30,30*rT],[aT,1,iT],[aT,3,3*iT],[aT,6,6*iT],[aT,12,12*iT],[yEt,1,nB],[xEt,1,vEt],[Gpe,1,Vpe],[Gpe,3,3*Vpe],[GLe,1,fX]];function HLe(t){const e=t.extent,n=t.maxbins||40,r=Math.abs(tR(e))/n;let i=_O(a=>a[2]).right(qE,r),o,s;return i===qE.length?(o=GLe,s=ry(e[0]/fX,e[1]/fX,n)):i?(i=qE[r/qE[i-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(U=HW(XE(te.y,0,1)),oe=U.getUTCDay(),U=oe>4||oe===0?xN.ceil(U):xN(U),U=zv.offset(U,(te.V-1)*7),te.y=U.getUTCFullYear(),te.m=U.getUTCMonth(),te.d=U.getUTCDate()+(te.w+6)%7):(U=GW(XE(te.y,0,1)),oe=U.getDay(),U=oe>4||oe===0?yN.ceil(U):yN(U),U=cg.offset(U,(te.V-1)*7),te.y=U.getFullYear(),te.m=U.getMonth(),te.d=U.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),oe="Z"in te?HW(XE(te.y,0,1)).getUTCDay():GW(XE(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(oe+5)%7:te.w+te.U*7-(oe+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,HW(te)):GW(te)}}function O(ee,re,me,te){for(var ae=0,U=re.length,oe=me.length,ne,G;ae=oe)return-1;if(ne=re.charCodeAt(ae++),ne===37){if(ne=re.charAt(ae++),G=w[ne in Hpe?re.charAt(ae++):ne],!G||(te=G(ee,me,te))<0)return-1}else if(ne!=me.charCodeAt(te++))return-1}return te}function k(ee,re,me){var te=c.exec(re.slice(me));return te?(ee.p=u.get(te[0].toLowerCase()),me+te[0].length):-1}function E(ee,re,me){var te=h.exec(re.slice(me));return te?(ee.w=p.get(te[0].toLowerCase()),me+te[0].length):-1}function P(ee,re,me){var te=f.exec(re.slice(me));return te?(ee.w=d.get(te[0].toLowerCase()),me+te[0].length):-1}function A(ee,re,me){var te=v.exec(re.slice(me));return te?(ee.m=y.get(te[0].toLowerCase()),me+te[0].length):-1}function R(ee,re,me){var te=g.exec(re.slice(me));return te?(ee.m=m.get(te[0].toLowerCase()),me+te[0].length):-1}function T(ee,re,me){return O(ee,e,re,me)}function M(ee,re,me){return O(ee,n,re,me)}function I(ee,re,me){return O(ee,r,re,me)}function z(ee){return s[ee.getDay()]}function F(ee){return o[ee.getDay()]}function N(ee){return l[ee.getMonth()]}function L(ee){return a[ee.getMonth()]}function B(ee){return i[+(ee.getHours()>=12)]}function $(ee){return 1+~~(ee.getMonth()/3)}function j(ee){return s[ee.getUTCDay()]}function X(ee){return o[ee.getUTCDay()]}function V(ee){return l[ee.getUTCMonth()]}function Y(ee){return a[ee.getUTCMonth()]}function le(ee){return i[+(ee.getUTCHours()>=12)]}function K(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var re=_(ee+="",x);return re.toString=function(){return ee},re},parse:function(ee){var re=S(ee+="",!1);return re.toString=function(){return ee},re},utcFormat:function(ee){var re=_(ee+="",b);return re.toString=function(){return ee},re},utcParse:function(ee){var re=S(ee+="",!0);return re.toString=function(){return ee},re}}}var Hpe={"-":"",_:" ",0:"0"},Yo=/^\s*\d+/,bEt=/^%/,wEt=/[\\^$*+?|[\]().{}]/g;function er(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function SEt(t,e,n){var r=Yo.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function CEt(t,e,n){var r=Yo.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function OEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function EEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function TEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function qpe(t,e,n){var r=Yo.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Xpe(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function kEt(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 AEt(t,e,n){var r=Yo.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function PEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Ype(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function MEt(t,e,n){var r=Yo.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Qpe(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function REt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function DEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function IEt(t,e,n){var r=Yo.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function LEt(t,e,n){var r=Yo.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function $Et(t,e,n){var r=bEt.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function FEt(t,e,n){var r=Yo.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function NEt(t,e,n){var r=Yo.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Kpe(t,e){return er(t.getDate(),e,2)}function zEt(t,e){return er(t.getHours(),e,2)}function jEt(t,e){return er(t.getHours()%12||12,e,2)}function BEt(t,e){return er(1+cg.count(Ah(t),t),e,3)}function XLe(t,e){return er(t.getMilliseconds(),e,3)}function UEt(t,e){return XLe(t,e)+"000"}function WEt(t,e){return er(t.getMonth()+1,e,2)}function VEt(t,e){return er(t.getMinutes(),e,2)}function GEt(t,e){return er(t.getSeconds(),e,2)}function HEt(t){var e=t.getDay();return e===0?7:e}function qEt(t,e){return er(SO.count(Ah(t)-1,t),e,2)}function YLe(t){var e=t.getDay();return e>=4||e===0?FS(t):FS.ceil(t)}function XEt(t,e){return t=YLe(t),er(FS.count(Ah(t),t)+(Ah(t).getDay()===4),e,2)}function YEt(t){return t.getDay()}function QEt(t,e){return er(yN.count(Ah(t)-1,t),e,2)}function KEt(t,e){return er(t.getFullYear()%100,e,2)}function ZEt(t,e){return t=YLe(t),er(t.getFullYear()%100,e,2)}function JEt(t,e){return er(t.getFullYear()%1e4,e,4)}function e2t(t,e){var n=t.getDay();return t=n>=4||n===0?FS(t):FS.ceil(t),er(t.getFullYear()%1e4,e,4)}function t2t(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+er(e/60|0,"0",2)+er(e%60,"0",2)}function Zpe(t,e){return er(t.getUTCDate(),e,2)}function n2t(t,e){return er(t.getUTCHours(),e,2)}function r2t(t,e){return er(t.getUTCHours()%12||12,e,2)}function i2t(t,e){return er(1+zv.count(Ph(t),t),e,3)}function QLe(t,e){return er(t.getUTCMilliseconds(),e,3)}function o2t(t,e){return QLe(t,e)+"000"}function s2t(t,e){return er(t.getUTCMonth()+1,e,2)}function a2t(t,e){return er(t.getUTCMinutes(),e,2)}function l2t(t,e){return er(t.getUTCSeconds(),e,2)}function c2t(t){var e=t.getUTCDay();return e===0?7:e}function u2t(t,e){return er(CO.count(Ph(t)-1,t),e,2)}function KLe(t){var e=t.getUTCDay();return e>=4||e===0?NS(t):NS.ceil(t)}function f2t(t,e){return t=KLe(t),er(NS.count(Ph(t),t)+(Ph(t).getUTCDay()===4),e,2)}function d2t(t){return t.getUTCDay()}function h2t(t,e){return er(xN.count(Ph(t)-1,t),e,2)}function p2t(t,e){return er(t.getUTCFullYear()%100,e,2)}function g2t(t,e){return t=KLe(t),er(t.getUTCFullYear()%100,e,2)}function m2t(t,e){return er(t.getUTCFullYear()%1e4,e,4)}function v2t(t,e){var n=t.getUTCDay();return t=n>=4||n===0?NS(t):NS.ceil(t),er(t.getUTCFullYear()%1e4,e,4)}function y2t(){return"+0000"}function Jpe(){return"%"}function ege(t){return+t}function tge(t){return Math.floor(+t/1e3)}var K1,zne,ZLe,jne,JLe;x2t({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 x2t(t){return K1=qLe(t),zne=K1.format,ZLe=K1.parse,jne=K1.utcFormat,JLe=K1.utcParse,K1}function lT(t){const e={};return n=>e[n]||(e[n]=t(n))}function b2t(t,e){return n=>{const r=t(n),i=r.indexOf(e);if(i<0)return r;let o=w2t(r,i);const s=oi;)if(r[o]!=="0"){++o;break}return r.slice(0,o)+s}}function w2t(t,e){let n=t.lastIndexOf("e"),r;if(n>0)return n;for(n=t.length;--n>e;)if(r=t.charCodeAt(n),r>=48&&r<=57)return n+1}function e$e(t){const e=lT(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(r){const i=hb(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return b2t(e(i),e(".1f")(1)[1])}else return e(i)},formatSpan(r,i,o,s){s=hb(s??",f");const a=ry(r,i,o),l=Math.max(Math.abs(r),Math.abs(i));let c;if(s.precision==null)switch(s.type){case"s":return isNaN(c=CLe(a,l))||(s.precision=c),n(s,l);case"":case"e":case"g":case"p":case"r":{isNaN(c=OLe(a,l))||(s.precision=c-(s.type==="e"));break}case"f":case"%":{isNaN(c=SLe(a))||(s.precision=c-(s.type==="%")*2);break}}return e(s)}}}let dX;t$e();function t$e(){return dX=e$e({format:K4,formatPrefix:Ine})}function n$e(t){return e$e(_Le(t))}function bN(t){return arguments.length?dX=n$e(t):dX}function nge(t,e,n){n=n||{},ht(n)||je(`Invalid time multi-format specifier: ${n}`);const r=e(Tu),i=e(Oc),o=e(Cc),s=e(_l),a=e(wo),l=e(Zs),c=e(wl),u=e(bs),f=t(n[Vf]||".%L"),d=t(n[Tu]||":%S"),h=t(n[Oc]||"%I:%M"),p=t(n[Cc]||"%I %p"),g=t(n[_l]||n[qs]||"%a %d"),m=t(n[wo]||"%b %d"),v=t(n[Zs]||"%B"),y=t(n[wl]||"%B"),x=t(n[bs]||"%Y");return b=>(r(b)gt(r)?e(r):nge(e,OO,r),utcFormat:r=>gt(r)?n(r):nge(n,EO,r),timeParse:lT(t.parse),utcParse:lT(t.utcParse)}}let hX;i$e();function i$e(){return hX=r$e({format:zne,parse:ZLe,utcFormat:jne,utcParse:JLe})}function o$e(t){return r$e(qLe(t))}function SA(t){return arguments.length?hX=o$e(t):hX}const pX=(t,e)=>cn({},t,e);function s$e(t,e){const n=t?n$e(t):bN(),r=e?o$e(e):SA();return pX(n,r)}function Bne(t,e){const n=arguments.length;return n&&n!==2&&je("defaultLocale expects either zero or two arguments."),n?pX(bN(t),SA(e)):pX(bN(),SA())}function _2t(){return t$e(),i$e(),Bne()}const S2t=/^(data:|([A-Za-z]+:)?\/\/)/,C2t=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,O2t=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,rge="file://";function E2t(t,e){return n=>({options:n||{},sanitize:k2t,load:T2t,fileAccess:!!e,file:A2t(e),http:M2t(t)})}async function T2t(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function k2t(t,e){e=cn({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,s;const a=C2t.test(t.replace(O2t,""));(t==null||typeof t!="string"||!a)&&je("Sanitize failure, invalid URI: "+rt(t));const l=S2t.test(t);return(s=e.baseURL)&&!l&&(!t.startsWith("/")&&!s.endsWith("/")&&(t="/"+t),t=s+t),o=(i=t.startsWith(rge))||e.mode==="file"||e.mode!=="http"&&!l&&n,i?t=t.slice(rge.length):t.startsWith("//")&&(e.defaultProtocol==="file"?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),e.context==="image"&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function A2t(t){return t?e=>new Promise((n,r)=>{t.readFile(e,(i,o)=>{i?r(i):n(o)})}):P2t}async function P2t(){je("No file system access.")}function M2t(t){return t?async function(e,n){const r=cn({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?fn(o[i])?o[i]():o.text():je(o.status+""+o.statusText)}:R2t}async function R2t(){je("No HTTP fetch method available.")}const D2t=t=>t!=null&&t===t,I2t=t=>t==="true"||t==="false"||t===!0||t===!1,L2t=t=>!Number.isNaN(Date.parse(t)),a$e=t=>!Number.isNaN(+t)&&!(t instanceof Date),$2t=t=>a$e(t)&&Number.isInteger(+t),gX={boolean:Pne,integer:Ys,number:Ys,date:Mne,string:Rne,unknown:na},AI=[I2t,$2t,a$e,L2t],F2t=["boolean","integer","number","date"];function l$e(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=AI.length,i=AI.map((o,s)=>s+1);for(let o=0,s=0,a,l;oo===0?s:o,0)-1]}function c$e(t,e){return e.reduce((n,r)=>(n[r]=l$e(t,r),n),{})}function ige(t){const e=function(n,r){const i={delimiter:t};return Une(n,r?cn(r,i):i)};return e.responseType="text",e}function Une(t,e){return e.header&&(t=e.header.map(rt).join(e.delimiter)+` -`+t),vOt(e.delimiter).parse(t+"")}Une.responseType="text";function N2t(t){return typeof Buffer=="function"&&fn(Buffer.isBuffer)?Buffer.isBuffer(t):!1}function Wne(t,e){const n=e&&e.property?Ou(e.property):na;return ht(t)&&!N2t(t)?z2t(n(t),e):n(JSON.parse(t))}Wne.responseType="json";function z2t(t,e){return!We(t)&&tLe(t)&&(t=[...t]),e&&e.copy?JSON.parse(JSON.stringify(t)):t}const j2t={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function u$e(t,e){let n,r,i,o;return t=Wne(t,e),e&&e.feature?(n=wOt,i=e.feature):e&&e.mesh?(n=SOt,i=e.mesh,o=j2t[e.filter]):je("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):je("Invalid TopoJSON object: "+i),r&&r.features||[r]}u$e.responseType="json";const d3={dsv:Une,csv:ige(","),tsv:ige(" "),json:Wne,topojson:u$e};function Vne(t,e){return arguments.length>1?(d3[t]=e,this):vt(d3,t)?d3[t]:null}function f$e(t){const e=Vne(t);return e&&e.responseType||"text"}function d$e(t,e,n,r){e=e||{};const i=Vne(e.type||"json");return i||je("Unknown data format type: "+e.type),t=i(t,e),e.parse&&B2t(t,e.parse,n,r),vt(t,"columns")&&delete t.columns,t}function B2t(t,e,n,r){if(!t.length)return;const i=SA();n=n||i.timeParse,r=r||i.utcParse;let o=t.columns||Object.keys(t[0]),s,a,l,c,u,f;e==="auto"&&(e=c$e(t,o)),o=Object.keys(e);const d=o.map(h=>{const p=e[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?r:n)(m);if(!gX[p])throw Error("Illegal format pattern: "+h+":"+p);return gX[p]});for(l=0,u=t.length,f=o.length;l{const o=e(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{const o=e(i);if(r[o]){r[o]=0;const s=n.indexOf(i);s>=0&&n.splice(s,1)}return n},n}async function h3(t,e){try{await e(t)}catch(n){t.error(n)}}const h$e=Symbol("vega_id");let U2t=1;function oB(t){return!!(t&&jt(t))}function jt(t){return t[h$e]}function p$e(t,e){return t[h$e]=e,t}function cr(t){const e=t===Object(t)?t:{data:t};return jt(e)?e:p$e(e,U2t++)}function Gne(t){return sB(t,cr({}))}function sB(t,e){for(const n in t)e[n]=t[n];return e}function g$e(t,e){return p$e(e,jt(t))}function d1(t,e){return t?e?(n,r)=>t(n,r)||jt(e(n))-jt(e(r)):(n,r)=>t(n,r)||jt(n)-jt(r):null}function m$e(t){return t&&t.constructor===h1}function h1(){const t=[],e=[],n=[],r=[],i=[];let o=null,s=!1;return{constructor:h1,insert(a){const l=pt(a),c=l.length;for(let u=0;u{p(y)&&(c[jt(y)]=-1)});for(f=0,d=t.length;f0&&(v(g,p,h.value),a.modifies(p));for(f=0,d=i.length;f{p(y)&&c[jt(y)]>0&&v(y,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=e.length||r.length?l.filter(y=>c[jt(y)]>0):l.slice();else for(m in u)a.mod.push(u[m]);return(o||o==null&&(e.length||r.length))&&a.clean(!0),a}}}const p3="_:mod:_";function aB(){Object.defineProperty(this,p3,{writable:!0,value:{}})}aB.prototype={set(t,e,n,r){const i=this,o=i[t],s=i[p3];return e!=null&&e>=0?(o[e]!==n||r)&&(o[e]=n,s[e+":"+t]=-1,s[t]=-1):(o!==n||r)&&(i[t]=n,s[t]=We(n)?1+n.length:-1),i},modified(t,e){const n=this[p3];if(arguments.length){if(We(t)){for(let r=0;r=0?e+1{h instanceof Lr?(h!==this&&(e&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(s in t)if(a=t[s],s===V2t)pt(a).forEach(f=>{f instanceof Lr?f!==this&&(f.targets().add(this),o.push(f)):je("Pulse parameters must be operator instances.")}),this.source=a;else if(We(a))for(r.set(s,-1,Array(l=a.length)),c=0;c{const n=Date.now();return n-e>t?(e=n,1):0})},debounce(t){const e=Dm();return this.targets().add(Dm(null,null,kne(t,n=>{const r=n.dataflow;e.receive(n),r&&r.run&&r.run()}))),e},between(t,e){let n=!1;return t.targets().add(Dm(null,null,()=>n=!0)),e.targets().add(Dm(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Eu,this._targets=null}};function K2t(t,e,n,r){const i=this,o=Dm(n,r),s=function(c){c.dataflow=i;try{o.receive(c)}catch(u){i.error(u)}finally{i.run()}};let a;typeof t=="string"&&typeof document<"u"?a=document.querySelectorAll(t):a=pt(t);const l=a.length;for(let c=0;ce=r);return n.requests=0,n.done=()=>{--n.requests===0&&(t._pending=null,e(t))},t._pending=n}const rTt={skip:!0};function iTt(t,e,n,r,i){return(t instanceof Lr?sTt:oTt)(this,t,e,n,r,i),this}function oTt(t,e,n,r,i,o){const s=cn({},o,rTt);let a,l;fn(n)||(n=ra(n)),r===void 0?a=c=>t.touch(n(c)):fn(r)?(l=new Lr(null,r,i,!1),a=c=>{l.evaluate(c);const u=n(c),f=l.value;m$e(f)?t.pulse(u,f,o):t.update(u,f,s)}):a=c=>t.update(n(c),r,s),e.apply(a)}function sTt(t,e,n,r,i,o){if(r===void 0)e.targets().add(n);else{const s=o||{},a=new Lr(null,aTt(n,r),i,!1);a.modified(s.force),a.rank=e.rank,e.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),t.connect(n,[a]))}}function aTt(t,e){return e=fn(e)?e:ra(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}function lTt(t){t.rank=++this._rank}function cTt(t){const e=[t];let n,r,i;for(;e.length;)if(this.rank(n=e.pop()),r=n._targets)for(i=r.length;--i>=0;)e.push(n=r[i]),n===t&&je("Cycle detected in dataflow graph.")}const wN={},Pd=1,Xm=2,Mp=4,uTt=Pd|Xm,sge=Pd|Mp,Z1=Pd|Xm|Mp,age=8,KE=16,lge=32,cge=64;function jv(t,e,n){this.dataflow=t,this.stamp=e??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function qW(t,e){const n=[];return qm(t,e,r=>n.push(r)),n}function uge(t,e){const n={};return t.visit(e,r=>{n[jt(r)]=1}),r=>n[jt(r)]?null:r}function PI(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}jv.prototype={StopPropagation:wN,ADD:Pd,REM:Xm,MOD:Mp,ADD_REM:uTt,ADD_MOD:sge,ALL:Z1,REFLOW:age,SOURCE:KE,NO_SOURCE:lge,NO_FIELDS:cge,fork(t){return new jv(this.dataflow).init(this,t)},clone(){const t=this.fork(Z1);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(Z1|KE)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new jv(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,t.fields&&!(e&cge)&&(n.fields=t.fields),e&Pd?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),e&Xm?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),e&Mp?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),e&lge?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||Z1;return e&Pd&&this.add.length||e&Xm&&this.rem.length||e&Mp&&this.mod.length},reflow(t){if(t)return this.fork(Z1).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(Mp,uge(this,Pd))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return We(t)?t.forEach(n=>e[n]=!0):e[t]=!0,this},modified(t,e){const n=this.fields;return(e||this.mod.length)&&n?arguments.length?We(t)?t.some(r=>n[r]):n[t]:!!n:!1},filter(t,e){const n=this;return t&Pd&&(n.addF=PI(n.addF,e)),t&Xm&&(n.remF=PI(n.remF,e)),t&Mp&&(n.modF=PI(n.modF,e)),t&KE&&(n.srcF=PI(n.srcF,e)),n},materialize(t){t=t||Z1;const e=this;return t&Pd&&e.addF&&(e.add=qW(e.add,e.addF),e.addF=null),t&Xm&&e.remF&&(e.rem=qW(e.rem,e.remF),e.remF=null),t&Mp&&e.modF&&(e.mod=qW(e.mod,e.modF),e.modF=null),t&KE&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(t&KE)return qm(n.source,n.srcF,r),n;t&Pd&&qm(n.add,n.addF,r),t&Xm&&qm(n.rem,n.remF,r),t&Mp&&qm(n.mod,n.modF,r);const i=n.source;if(t&age&&i){const o=n.add.length+n.mod.length;o===i.length||(o?qm(i,uge(n,sge),r):qm(i,n.srcF,r))}return n}};function Hne(t,e,n,r){const i=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(const s of n)if(s.stamp===e){if(s.fields){const a=i.fields||(i.fields={});for(const l in s.fields)a[l]=1}s.changed(i.ADD)&&(o|=i.ADD),s.changed(i.REM)&&(o|=i.REM),s.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}it(Hne,jv,{fork(t){const e=new jv(this.dataflow).init(this,t&this.NO_FIELDS);return t!==void 0&&(t&e.ADD&&this.visit(e.ADD,n=>e.add.push(n)),t&e.REM&&this.visit(e.REM,n=>e.rem.push(n)),t&e.MOD&&this.visit(e.MOD,n=>e.mod.push(n))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?We(t)?t.some(r=>n[r]):n[t]:0},filter(){je("MultiPulse does not support filtering.")},materialize(){je("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;or._enqueue(u,!0)),r._touched=iB(eR);let s=0,a,l,c;try{for(;r._heap.size()>0;){if(a=r._heap.pop(),a.rank!==a.qrank){r._enqueue(a,!0);continue}l=a.run(r._getPulse(a,t)),l.then?l=await l:l.async&&(i.push(l.async),l=wN),l!==wN&&a._targets&&a._targets.forEach(u=>r._enqueue(u)),++s}}catch(u){r._heap.clear(),c=u}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${s} operators`),c&&(r._postrun=[],r.error(c)),r._postrun.length){const u=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;fr.runAsync(null,()=>{u.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function dTt(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running}function hTt(t,e,n){return this._pulse?v$e(this):(this.evaluate(t,e,n),this)}function pTt(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(r){this.error(r)}}function v$e(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}function gTt(t,e){const n=t.stampi.pulse),e):this._input[t.id]||vTt(this._pulse,n&&n.pulse)}function vTt(t,e){return e&&e.stamp===t.stamp?e:(t=t.fork(),e&&e!==wN&&(t.source=e.source),t)}const qne={skip:!1,force:!1};function yTt(t,e){const n=e||qne;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this}function xTt(t,e,n){const r=n||qne;return(t.set(e)||r.force)&&this.touch(t,r),this}function bTt(t,e,n){this.touch(t,n||qne);const r=new jv(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this}function wTt(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),y$e(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,_Tt(e,0,t)):r=n,r}}}function y$e(t,e,n,r){let i,o;const s=t[n];for(;n>e;){if(o=n-1>>1,i=t[o],r(s,i)<0){t[n]=i,n=o;continue}break}return t[n]=s}function _Tt(t,e,n){const r=e,i=t.length,o=t[e];let s=(e<<1)+1,a;for(;s=0&&(s=a),t[e]=t[s],e=s,s=(e<<1)+1;return t[e]=o,y$e(t,r,e,n)}function z_(){this.logger(Sne()),this.logLevel(wne),this._clock=0,this._rank=0,this._locale=Bne();try{this._loader=rB()}catch{}this._touched=iB(eR),this._input={},this._pulse=null,this._heap=wTt((t,e)=>t.qrank-e.qrank),this._postrun=[]}function ZE(t){return function(){return this._log[t].apply(this,arguments)}}z_.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:ZE("error"),warn:ZE("warn"),info:ZE("info"),debug:ZE("debug"),logLevel:ZE("level"),cleanThreshold:1e4,add:X2t,connect:Y2t,rank:lTt,rerank:cTt,pulse:bTt,touch:yTt,update:xTt,changeset:h1,ingest:J2t,parse:Z2t,preload:tTt,request:eTt,events:K2t,on:iTt,evaluate:fTt,run:hTt,runAsync:dTt,runAfter:pTt,_enqueue:gTt,_getPulse:mTt};function De(t,e){Lr.call(this,t,null,e)}it(De,Lr,{run(t){if(t.stampthis.pulse=n):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const jS={};function x$e(t){const e=b$e(t);return e&&e.Definition||null}function b$e(t){return t=t&&t.toLowerCase(),vt(jS,t)?jS[t]:null}function*w$e(t,e){if(e==null)for(let n of t)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)r=e(r,++n,t),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function Xne(t,e,n){const r=Float64Array.from(w$e(t,n));return r.sort(mh),e.map(i=>vLe(r,i))}function Yne(t,e){return Xne(t,[.25,.5,.75],e)}function Qne(t,e){const n=t.length,r=MOt(t,e),i=Yne(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function _$e(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o=t.extent[0],s=t.extent[1],a,l,c,u,f,d;const h=t.span||s-o||Math.abs(o)||1;if(t.step)a=t.step;else if(t.steps){for(u=h/e,f=0,d=t.steps.length;fe;)a*=n;for(f=0,d=i.length;f=c&&h/u<=e&&(a=u)}u=Math.log(a);const p=u>=0?0:~~(-u/r)+1,g=Math.pow(n,-p-1);return(t.nice||t.nice===void 0)&&(u=Math.floor(o/a+g)*a,o=od);const i=t.length,o=new Float64Array(i);let s=0,a=1,l=r(t[0]),c=l,u=l+e,f;for(;a=u){for(c=(l+c)/2;s>1);si;)t[s--]=t[r]}r=i,i=o}return t}function OTt(t){return function(){return t=(1103515245*t+12345)%2147483647,t/2147483647}}function ETt(t,e){e==null&&(e=t,t=0);let n,r,i;const o={min(s){return arguments.length?(n=s||0,i=r-n,o):n},max(s){return arguments.length?(r=s||0,i=r-n,o):r},sample(){return n+Math.floor(i*ku())},pdf(s){return s===Math.floor(s)&&s>=n&&s=r?1:(a-n+1)/i},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*i):NaN}};return o.min(t).max(e)}const O$e=Math.sqrt(2*Math.PI),TTt=Math.SQRT2;let JE=NaN;function cB(t,e){t=t||0,e=e??1;let n=0,r=0,i,o;if(JE===JE)n=JE,JE=NaN;else{do n=ku()*2-1,r=ku()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,JE=r*o}return t+n*e}function Kne(t,e,n){n=n??1;const r=(t-(e||0))/n;return Math.exp(-.5*r*r)/(n*O$e)}function uB(t,e,n){e=e||0,n=n??1;const r=(t-e)/n,i=Math.abs(r);let o;if(i>37)o=0;else{const s=Math.exp(-i*i/2);let a;i<7.07106781186547?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,o=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,o=o/a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,o=s/a/2.506628274631)}return r>0?1-o:o}function fB(t,e,n){return t<0||t>1?NaN:(e||0)+(n??1)*TTt*kTt(2*t-1)}function kTt(t){let e=-Math.log((1-t)*(1+t)),n;return e<6.25?(e-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*e,n=128584807152564e-32+n*e,n=11157877678025181e-33+n*e,n=-1333171662854621e-31+n*e,n=20972767875968562e-33+n*e,n=6637638134358324e-30+n*e,n=-4054566272975207e-29+n*e,n=-8151934197605472e-29+n*e,n=26335093153082323e-28+n*e,n=-12975133253453532e-27+n*e,n=-5415412054294628e-26+n*e,n=10512122733215323e-25+n*e,n=-4112633980346984e-24+n*e,n=-29070369957882005e-24+n*e,n=42347877827932404e-23+n*e,n=-13654692000834679e-22+n*e,n=-13882523362786469e-21+n*e,n=.00018673420803405714+n*e,n=-.000740702534166267+n*e,n=-.006033670871430149+n*e,n=.24015818242558962+n*e,n=1.6536545626831027+n*e):e<16?(e=Math.sqrt(e)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*e,n=-27517406297064545e-23+n*e,n=18239629214389228e-24+n*e,n=15027403968909828e-22+n*e,n=-4013867526981546e-21+n*e,n=29234449089955446e-22+n*e,n=12475304481671779e-21+n*e,n=-47318229009055734e-21+n*e,n=6828485145957318e-20+n*e,n=24031110387097894e-21+n*e,n=-.0003550375203628475+n*e,n=.0009532893797373805+n*e,n=-.0016882755560235047+n*e,n=.002491442096107851+n*e,n=-.003751208507569241+n*e,n=.005370914553590064+n*e,n=1.0052589676941592+n*e,n=3.0838856104922208+n*e):Number.isFinite(e)?(e=Math.sqrt(e)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*e,n=15076572693500548e-25+n*e,n=-3789465440126737e-24+n*e,n=761570120807834e-23+n*e,n=-1496002662714924e-23+n*e,n=2914795345090108e-23+n*e,n=-6771199775845234e-23+n*e,n=22900482228026655e-23+n*e,n=-99298272942317e-20+n*e,n=4526062597223154e-21+n*e,n=-1968177810553167e-20+n*e,n=7599527703001776e-20+n*e,n=-.00021503011930044477+n*e,n=-.00013871931833623122+n*e,n=1.0103004648645344+n*e,n=4.849906401408584+n*e):n=1/0,n*t}function Zne(t,e){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>cB(n,r),pdf:o=>Kne(o,n,r),cdf:o=>uB(o,n,r),icdf:o=>fB(o,n,r)};return i.mean(t).stdev(e)}function Jne(t,e){const n=Zne();let r=0;const i={data(o){return arguments.length?(t=o,r=o?o.length:0,i.bandwidth(e)):t},bandwidth(o){return arguments.length?(e=o,!e&&t&&(e=Qne(t)),i):e},sample(){return t[~~(ku()*r)]+e*n.sample()},pdf(o){let s=0,a=0;for(;aere(n,r),pdf:o=>tre(o,n,r),cdf:o=>nre(o,n,r),icdf:o=>rre(o,n,r)};return i.mean(t).stdev(e)}function T$e(t,e){let n=0,r;function i(s){const a=[];let l=0,c;for(c=0;c=e&&t<=n?1/(n-e):0}function sre(t,e,n){return n==null&&(n=e??1,e=0),tn?1:(t-e)/(n-e)}function are(t,e,n){return n==null&&(n=e??1,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function k$e(t,e){let n,r;const i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>ire(n,r),pdf:o=>ore(o,n,r),cdf:o=>sre(o,n,r),icdf:o=>are(o,n,r)};return e==null&&(e=t??1,t=0),i.min(t).max(e)}function lre(t,e,n){let r=0,i=0;for(const o of t){const s=n(o);e(o)==null||s==null||isNaN(s)||(r+=(s-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function nR(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function dB(t,e,n,r){t=t.filter(h=>{let p=e(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),r&&t.sort((h,p)=>e(h)-e(p));const i=t.length,o=new Float64Array(i),s=new Float64Array(i);let a=0,l=0,c=0,u,f,d;for(d of t)o[a]=u=+e(d),s[a]=f=+n(d),++a,l+=(u-l)/a,c+=(f-c)/a;for(a=0;a=o&&s!=null&&(s=+s)>=s&&r(o,s,++i)}function TO(t,e,n,r,i){let o=0,s=0;return rR(t,e,n,(a,l)=>{const c=l-i(a),u=l-r;o+=c*c,s+=u*u}),1-o/s}function cre(t,e,n){let r=0,i=0,o=0,s=0,a=0;rR(t,e,n,(u,f)=>{++a,r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=nR(r,i,o,s),c=u=>l[0]+l[1]*u;return{coef:l,predict:c,rSquared:TO(t,e,n,i,c)}}function A$e(t,e,n){let r=0,i=0,o=0,s=0,a=0;rR(t,e,n,(u,f)=>{++a,u=Math.log(u),r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=nR(r,i,o,s),c=u=>l[0]+l[1]*Math.log(u);return{coef:l,predict:c,rSquared:TO(t,e,n,i,c)}}function P$e(t,e,n){const[r,i,o,s]=dB(t,e,n);let a=0,l=0,c=0,u=0,f=0,d,h,p;rR(t,e,n,(y,x)=>{d=r[f++],h=Math.log(x),p=d*x,a+=(x*h-a)/f,l+=(p-l)/f,c+=(p*h-c)/f,u+=(d*p-u)/f});const[g,m]=nR(l/s,a/s,c/s,u/s),v=y=>Math.exp(g+m*(y-o));return{coef:[Math.exp(g-m*o),m],predict:v,rSquared:TO(t,e,n,s,v)}}function M$e(t,e,n){let r=0,i=0,o=0,s=0,a=0,l=0;rR(t,e,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,r+=(h-r)/l,i+=(p-i)/l,o+=(h*p-o)/l,s+=(h*h-s)/l,a+=(d-a)/l});const c=nR(r,i,o,s),u=f=>c[0]*Math.pow(f,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:TO(t,e,n,a,u)}}function ure(t,e,n){const[r,i,o,s]=dB(t,e,n),a=r.length;let l=0,c=0,u=0,f=0,d=0,h,p,g,m;for(h=0;h(S=S-o,x*S*S+b*S+w+s);return{coef:[w-b*o+x*o*o+s,b-2*x*o,x],predict:_,rSquared:TO(t,e,n,s,_)}}function R$e(t,e,n,r){if(r===0)return lre(t,e,n);if(r===1)return cre(t,e,n);if(r===2)return ure(t,e,n);const[i,o,s,a]=dB(t,e,n),l=i.length,c=[],u=[],f=r+1;let d,h,p,g,m;for(d=0;d{x-=s;let b=a+v[0]+v[1]*x+v[2]*x*x;for(d=3;d=0;--o)for(a=e[o],l=1,i[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,i[o-s]+=a*Math.pow(n,s)*l;return i[0]+=r,i}function PTt(t){const e=t.length-1,n=[];let r,i,o,s,a;for(r=0;rMath.abs(t[r][s])&&(s=i);for(o=r;o=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(a=0,o=i+1;oi[x]-v?y:x;let w=0,_=0,S=0,O=0,k=0;const E=1/Math.abs(i[b]-v||1);for(let R=y;R<=x;++R){const T=i[R],M=o[R],I=MTt(Math.abs(v-T)*E)*d[R],z=T*I;w+=I,_+=z,S+=M*I,O+=M*z,k+=T*z}const[P,A]=nR(_/w,S/w,O/w,k/w);u[m]=P+A*v,f[m]=Math.abs(o[m]-u[m]),RTt(i,m+1,p)}if(h===fge)break;const g=yLe(f);if(Math.abs(g)=1?dge:(y=1-v*v)*y}return DTt(i,u,s,a)}function MTt(t){return(t=1-t*t*t)*t*t}function RTt(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}function DTt(t,e,n,r){const i=t.length,o=[];let s=0,a=0,l=[],c;for(;s[g,t(g)],o=e[0],s=e[1],a=s-o,l=a/r,c=[i(o)],u=[];if(n===r){for(let g=1;g0;)u.push(i(o+g/n*a))}let f=c[0],d=u[u.length-1];const h=1/a,p=LTt(f[1],u);for(;d;){const g=i((f[0]+d[0])/2);g[0]-f[0]>=l&&$Tt(f,g,d,h,p)>ITt?u.push(g):(f=d,c.push(d),u.pop()),d=u[u.length-1]}return c}function LTt(t,e){let n=t,r=t;const i=e.length;for(let o=0;or&&(r=s)}return 1/(r-n)}function $Tt(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),s=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-s)}function FTt(t){return e=>{const n=t.length;let r=1,i=String(t[0](e));for(;r{},NTt={init:XW,add:XW,rem:XW,idx:0},CA={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.valid?t.sum:void 0,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||t.max===void 0)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(t,e)=>{t.exp=0,t.exp_r=e},value:t=>t.valid?t.exp*(1-t.exp_r)/(1-t.exp_r**t.valid):void 0,add:(t,e)=>t.exp=t.exp_r*t.exp+e,rem:(t,e)=>t.exp=(t.exp-e/t.exp_r**(t.valid-1))/t.exp_r},exponentialb:{value:t=>t.valid?t.exp*(1-t.exp_r):void 0,req:["exponential"],idx:1}},iR=Object.keys(CA).filter(t=>t!=="__count__");function zTt(t,e){return(n,r)=>cn({name:t,aggregate_param:r,out:n||t},NTt,e)}[...iR,"__count__"].forEach(t=>{CA[t]=zTt(t,CA[t])});function L$e(t,e,n){return CA[t](n,e)}function $$e(t,e){return t.idx-e.idx}function jTt(t){const e={};t.forEach(r=>e[r.name]=r);const n=r=>{r.req&&r.req.forEach(i=>{e[i]||n(e[i]=CA[i]())})};return t.forEach(n),Object.values(e).sort($$e)}function BTt(){this.valid=0,this.missing=0,this._ops.forEach(t=>t.aggregate_param==null?t.init(this):t.init(this,t.aggregate_param))}function UTt(t,e){if(t==null||t===""){++this.missing;return}t===t&&(++this.valid,this._ops.forEach(n=>n.add(this,t,e)))}function WTt(t,e){if(t==null||t===""){--this.missing;return}t===t&&(--this.valid,this._ops.forEach(n=>n.rem(this,t,e)))}function VTt(t){return this._out.forEach(e=>t[e.out]=e.value(this)),t}function F$e(t,e){const n=e||na,r=jTt(t),i=t.slice().sort($$e);function o(s){this._ops=r,this._out=i,this.cell=s,this.init()}return o.prototype.init=BTt,o.prototype.add=UTt,o.prototype.rem=WTt,o.prototype.set=VTt,o.prototype.get=n,o.fields=t.map(s=>s.out),o}function fre(t){this._key=t?Ou(t):jt,this.reset()}const Os=fre.prototype;Os.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Os.add=function(t){this._add.push(t)};Os.rem=function(t){this._rem.push(t)};Os.values=function(){if(this._get=null,this._rem.length===0)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),s={};let a,l,c;for(a=0;a=0;)o=t(e[r])+"",vt(n,o)||(n[o]=1,++i);return i};Os.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=JIe(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext};Os.argmin=function(t){return this.extent(t)[0]||{}};Os.argmax=function(t){return this.extent(t)[1]||{}};Os.min=function(t){const e=this.extent(t)[0];return e!=null?t(e):void 0};Os.max=function(t){const e=this.extent(t)[1];return e!=null?t(e):void 0};Os.quartile=function(t){return(this._get!==t||!this._q)&&(this._q=Yne(this.values(),t),this._get=t),this._q};Os.q1=function(t){return this.quartile(t)[0]};Os.q2=function(t){return this.quartile(t)[1]};Os.q3=function(t){return this.quartile(t)[2]};Os.ci=function(t){return(this._get!==t||!this._ci)&&(this._ci=S$e(this.values(),1e3,.05,t),this._get=t),this._ci};Os.ci0=function(t){return this.ci(t)[0]};Os.ci1=function(t){return this.ci(t)[1]};function iy(t){De.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}iy.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:iR},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};it(iy,De,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):Object.create(null),e.visit(e.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(t),e.visit(e.REM,o=>n.rem(o)),e.visit(e.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=t.drop!==!1,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map(()=>({})),i=n.length;function o(a){let l,c,u,f;for(l in a)for(u=a[l].tuple,c=0;c{const x=Fi(y);return i(y),n.push(x),x}),this.cellkey=t.key?t.key:mX(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],s=t.ops||["count"],a=t.aggregate_params||[null],l=t.as||[],c=o.length,u={};let f,d,h,p,g,m,v;for(c!==s.length&&je("Unmatched number of fields and aggregate ops."),v=0;vF$e(y,y.field)),Object.create(null)},cellkey:mX(),cell(t,e){let n=this.value[t];return n?n.num===0&&this._drop&&n.stamp{const f=r(u);u[a]=f,u[l]=f==null?null:i+o*(1+(f-i)/o)}:u=>u[a]=r(u)),e.modifies(n?s:a)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=_$e(t),r=n.step;let i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,s,a;(s=t.anchor)!=null&&(a=s-(i+r*Math.floor((s-i)/r)),i+=a,o+=a);const l=function(c){let u=Ys(e(c));return u==null?null:uo?1/0:(u=Math.max(i,Math.min(u,o-r)),i+r*Math.floor(GTt+(u-i)/r))};return l.start=i,l.stop=n.stop,l.step=r,this.value=Al(l,Ks(e),t.name||"bin_"+Fi(e))}});function N$e(t,e,n){const r=t;let i=e||[],o=n||[],s={},a=0;return{add:l=>o.push(l),remove:l=>s[r(l)]=++a,size:()=>i.length,data:(l,c)=>(a&&(i=i.filter(u=>!s[r(u)]),s={},a=0),c&&l&&i.sort(l),o.length&&(i=l?oLe(l,i,o.sort(l)):i.concat(o),o=[]),i)}}function hre(t){De.call(this,[],t)}hre.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};it(hre,De,{transform(t,e){const n=e.fork(e.ALL),r=N$e(jt,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(d1(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}});function z$e(t){Lr.call(this,null,HTt,t)}it(z$e,Lr);function HTt(t){return this.value&&!t.modified()?this.value:Tne(t.fields,t.orders)}function pre(t){De.call(this,null,t)}pre.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function qTt(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break}return t.match(n)}it(pre,De,{transform(t,e){const n=f=>d=>{for(var h=qTt(a(d),t.case,o)||[],p,g=0,m=h.length;gi[f]=1+(i[f]||0)),u=n(f=>i[f]-=1);return r?e.visit(e.SOURCE,c):(e.visit(e.ADD,c),e.visit(e.REM,u)),this._finish(e,l)},_parameterCheck(t,e){let n=!1;return(t.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),(t.modified("pattern")||!this._match)&&(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],s=t.fork(t.NO_SOURCE|t.NO_FIELDS);let a,l,c;for(a in n)l=r[a],c=n[a]||0,!l&&c?(r[a]=l=cr({}),l[i]=a,l[o]=c,s.add.push(l)):c===0?(l&&s.rem.push(l),n[a]=null,r[a]=null):l[o]!==c&&(l[o]=c,s.mod.push(l));return s.modifies(e)}});function gre(t){De.call(this,null,t)}gre.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};it(gre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[1],s=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=e.materialize(e.SOURCE).source,n.add=this.value=XTt(a,i,o,t.filter||Eu)):n.mod=a,n.source=this.value,n.modifies(r)}});function XTt(t,e,n,r){for(var i=[],o={},s=t.length,a=0,l,c;aj$e(o,e))):typeof r[i]===pge&&r[i](t[i]);return r}function mre(t){De.call(this,null,t)}const B$e=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],KTt={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:B$e},{name:"weights",type:"number",array:!0}]};mre.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:B$e.concat(KTt)},{name:"as",type:"string",array:!0,default:["value","density"]}]};it(mre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=j$e(t.distribution,ZTt(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let s=t.method||"pdf";s!=="pdf"&&s!=="cdf"&&je("Invalid density method: "+s),!t.extent&&!r.data&&je("Missing density extent parameter."),s=r[s];const a=t.as||["value","density"],l=t.extent||kh(r.data()),c=hB(s,l,i,o).map(u=>{const f={};return f[a[0]]=u[0],f[a[1]]=u[1],cr(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function ZTt(t){return()=>t.materialize(t.SOURCE).source}function U$e(t,e){return t?t.map((n,r)=>e[r]||Fi(n)):null}function vre(t,e,n){const r=[],i=f=>f(l);let o,s,a,l,c,u;if(e==null)r.push(t.map(n));else for(o={},s=0,a=t.length;stR(kh(t,e))/30;it(yre,De,{transform(t,e){if(this.value&&!(t.modified()||e.changed()))return e;const n=e.materialize(e.SOURCE).source,r=vre(e.source,t.groupby,na),i=t.smooth||!1,o=t.field,s=t.step||JTt(n,o),a=d1((p,g)=>o(p)-o(g)),l=t.as||W$e,c=r.length;let u=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:u,stop:f,step:s},e.reflow(!0).modifies(l)}});function V$e(t){Lr.call(this,null,ekt,t),this.modified(!0)}it(V$e,Lr);function ekt(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:Al(n=>e(n,t),Ks(e),Fi(e))}function xre(t){De.call(this,[void 0,void 0],t)}xre.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};it(xre,De,{transform(t,e){const n=this.value,r=t.field,i=e.changed()||e.modified(r.fields)||t.modified("field");let o=n[0],s=n[1];if((i||o==null)&&(o=1/0,s=-1/0),e.visit(i?e.SOURCE:e.ADD,a=>{const l=Ys(r(a));l!=null&&(ls&&(s=l))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Fi(r);a&&(a=` for field "${a}"`),e.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function bre(t,e){Lr.call(this,t),this.parent=e,this.count=0}it(bre,Lr,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}});function pB(t){De.call(this,{},t),this._keys=wO();const e=this._targets=[];e.active=0,e.forEach=n=>{for(let r=0,i=e.active;rr&&r.count>0);this.initTargets(n)}},initTargets(t){const e=this._targets,n=e.length,r=t?t.length:0;let i=0;for(;ithis.subflow(l,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,l=>{const c=jt(l),u=o.get(c);u!==void 0&&(o.delete(c),a(u).rem(l))}),e.visit(e.ADD,l=>{const c=r(l);o.set(jt(l),c),a(c).add(l)}),s||e.modified(r.fields)?e.visit(e.MOD,l=>{const c=jt(l),u=o.get(c),f=r(l);u===f?a(f).mod(l):(o.set(c,f),a(u).rem(l),a(f).add(l))}):e.changed(e.MOD)&&e.visit(e.MOD,l=>{a(o.get(jt(l))).mod(l)}),s&&e.visit(e.REFLOW,l=>{const c=jt(l),u=o.get(c),f=r(l);u!==f&&(o.set(c,f),a(u).rem(l),a(f).add(l))}),e.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}});function G$e(t){Lr.call(this,null,tkt,t)}it(G$e,Lr);function tkt(t){return this.value&&!t.modified()?this.value:We(t.name)?pt(t.name).map(e=>Ou(e)):Ou(t.name,t.as)}function wre(t){De.call(this,wO(),t)}wre.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};it(wre,De,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,s=i.rem,a=i.mod,l=t.expr;let c=!0;e.visit(e.REM,f=>{const d=jt(f);r.has(d)?r.delete(d):s.push(f)}),e.visit(e.ADD,f=>{l(f,t)?o.push(f):r.set(jt(f),1)});function u(f){const d=jt(f),h=l(f,t),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),s.push(f)):c&&h&&!p&&a.push(f)}return e.visit(e.MOD,u),t.modified()&&(c=!1,e.visit(e.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function _re(t){De.call(this,[],t)}_re.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};it(_re,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=U$e(r,t.as||[]),o=t.index||null,s=i.length;return n.rem=this.value,e.visit(e.SOURCE,a=>{const l=r.map(p=>p(a)),c=l.reduce((p,g)=>Math.max(p,g.length),0);let u=0,f,d,h;for(;u{for(let u=0,f;us[r]=n(s,t))}});function H$e(t){De.call(this,[],t)}it(H$e,De,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i=this.value,o=t.size-i.length,s,a,l;if(o>0){for(s=[];--o>=0;)s.push(l=cr(r(t))),i.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,i=i.slice(-o);return n.source=this.value=i,n}});const MI={value:"value",median:yLe,mean:FOt,min:sX,max:Nx},nkt=[];function Ore(t){De.call(this,[],t)}Ore.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function rkt(t){var e=t.method||MI.value,n;if(MI[e]==null)je("Unrecognized imputation method: "+e);else return e===MI.value?(n=t.value!==void 0?t.value:0,()=>n):MI[e]}function ikt(t){const e=t.field;return n=>n?e(n):NaN}it(Ore,De,{transform(t,e){var n=e.fork(e.ALL),r=rkt(t),i=ikt(t),o=Fi(t.field),s=Fi(t.key),a=(t.groupby||[]).map(Fi),l=okt(e.source,t.groupby,t.key,t.keyvals),c=[],u=this.value,f=l.domain.length,d,h,p,g,m,v,y,x,b,w;for(m=0,x=l.length;mv(m),o=[],s=r?r.slice():[],a={},l={},c,u,f,d,h,p,g,m;for(s.forEach((v,y)=>a[v]=y+1),d=0,g=t.length;dn.add(o))):(i=n.value=n.value||this.init(t),e.visit(e.REM,o=>n.rem(o)),e.visit(e.ADD,o=>n.add(o))),n.changes(),e.visit(e.SOURCE,o=>{cn(o,i[n.cellkey(o)].tuple)}),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n{const p=Jne(h,s)[a],g=t.counts?h.length:1,m=u||kh(h);hB(p,m,f,d).forEach(v=>{const y={};for(let x=0;x(this._pending=pt(i.data),o=>o.touch(this)))}:n.request(t.url,t.format).then(r=>YW(this,e,pt(r.data)))}});function akt(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}function YW(t,e,n){n.forEach(cr);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function kre(t){De.call(this,{},t)}kre.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};it(kre,De,{transform(t,e){const n=t.fields,r=t.index,i=t.values,o=t.default==null?null:t.default,s=t.modified(),a=n.length;let l=s?e.SOURCE:e.ADD,c=e,u=t.as,f,d,h;return i?(d=i.length,a>1&&!u&&je('Multi-field lookup requires explicit "as" parameter.'),u&&u.length!==a*d&&je('The "as" parameter has too few output field names.'),u=u||i.map(Fi),f=function(p){for(var g=0,m=0,v,y;ge.modified(p.fields)),l|=h?e.MOD:0),e.visit(l,f),c.modifies(u)}});function Y$e(t){Lr.call(this,null,lkt,t)}it(Y$e,Lr);function lkt(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r=1/0,i=-1/0,o,s;for(o=0;oi&&(i=s[1]);return[r,i]}function Q$e(t){Lr.call(this,null,ckt,t)}it(Q$e,Lr);function ckt(t){return this.value&&!t.modified()?this.value:t.values.reduce((e,n)=>e.concat(n),[])}function K$e(t){De.call(this,null,t)}it(K$e,De,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function Are(t){iy.call(this,t)}Are.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:iR,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};it(Are,iy,{_transform:iy.prototype.transform,transform(t,e){return this._transform(ukt(t,e),e)}});function ukt(t,e){const n=t.field,r=t.value,i=(t.op==="count"?"__count__":t.op)||"sum",o=Ks(n).concat(Ks(r)),s=dkt(n,t.limit||0,e);return e.changed()&&t.set("__pivot__",null,null,!0),{key:t.key,groupby:t.groupby,ops:s.map(()=>i),fields:s.map(a=>fkt(a,n,r,o)),as:s.map(a=>a+""),modified:t.modified.bind(t)}}function fkt(t,e,n,r){return Al(i=>e(i)===t?n(i):NaN,r,t+"")}function dkt(t,e,n){const r={},i=[];return n.visit(n.SOURCE,o=>{const s=t(o);r[s]||(r[s]=1,i.push(s))}),i.sort(Q4),e?i.slice(0,e):i}function Z$e(t){pB.call(this,t)}it(Z$e,pB,{transform(t,e){const n=t.subflow,r=t.field,i=o=>this.subflow(jt(o),n,e,o);return(t.modified("field")||r&&e.modified(Ks(r)))&&je("PreFacet does not support field modification."),this.initTargets(),r?(e.visit(e.MOD,o=>{const s=i(o);r(o).forEach(a=>s.mod(a))}),e.visit(e.ADD,o=>{const s=i(o);r(o).forEach(a=>s.add(cr(a)))}),e.visit(e.REM,o=>{const s=i(o);r(o).forEach(a=>s.rem(a))})):(e.visit(e.MOD,o=>i(o).mod(o)),e.visit(e.ADD,o=>i(o).add(o)),e.visit(e.REM,o=>i(o).rem(o))),e.clean()&&e.runAfter(()=>this.clean()),e}});function Pre(t){De.call(this,null,t)}Pre.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};it(Pre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=U$e(t.fields,t.as||[]),o=r?(a,l)=>hkt(a,l,r,i):sB;let s;return this.value?s=this.value:(e=e.addAll(),s=this.value={}),e.visit(e.REM,a=>{const l=jt(a);n.rem.push(s[l]),s[l]=null}),e.visit(e.ADD,a=>{const l=o(a,cr({}));s[jt(a)]=l,n.add.push(l)}),e.visit(e.MOD,a=>{n.mod.push(o(a,s[jt(a)]))}),n}});function hkt(t,e,n,r){for(let i=0,o=n.length;i{const d=Xne(f,c);for(let h=0;h{const o=jt(i);n.rem.push(r[o]),r[o]=null}),e.visit(e.ADD,i=>{const o=Gne(i);r[jt(i)]=o,n.add.push(o)}),e.visit(e.MOD,i=>{const o=r[jt(i)];for(const s in i)o[s]=i[s],n.modifies(s);n.mod.push(o)})),n}});function Rre(t){De.call(this,[],t),this.count=0}Rre.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};it(Rre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value.reduce((u,f)=>(u[jt(f)]=1,u),{});let s=this.value,a=this.count,l=0;function c(u){let f,d;s.length=l&&(f=s[d],o[jt(f)]&&n.rem.push(f),s[d]=u)),++a}if(e.rem.length&&(e.visit(e.REM,u=>{const f=jt(u);o[f]&&(o[f]=-1,n.rem.push(u)),--a}),s=s.filter(u=>o[jt(u)]!==-1)),(e.rem.length||r)&&s.length{o[jt(u)]||c(u)}),l=-1),r&&s.length>i){const u=s.length-i;for(let f=0;f{o[jt(u)]&&n.mod.push(u)}),e.add.length&&e.visit(e.ADD,c),(e.add.length||l<0)&&(n.add=s.filter(u=>!o[jt(u)])),this.count=a,this.value=n.source=s,n}});function Dre(t){De.call(this,null,t)}Dre.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};it(Dre,De,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=sl(t.start,t.stop,t.step||1).map(i=>{const o={};return o[r]=i,cr(o)}),n.add=e.add.concat(this.value),n}});function t3e(t){De.call(this,null,t),this.modified(!0)}it(t3e,De,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});function Ire(t){De.call(this,null,t)}const n3e=["unit0","unit1"];Ire.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:$ne,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:n3e}]};it(Ire,De,{transform(t,e){const n=t.field,r=t.interval!==!1,i=t.timezone==="utc",o=this._floor(t,e),s=(i?EO:OO)(o.unit).offset,a=t.as||n3e,l=a[0],c=a[1],u=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=e.ADD;return(t.modified()||e.changed(e.REM)||e.modified(Ks(n)))&&(e=e.reflow(!0),h=e.SOURCE,f=1/0,d=-1/0),e.visit(h,p=>{const g=n(p);let m,v;g==null?(p[l]=null,r&&(p[c]=null)):(p[l]=m=v=o(g),r&&(p[c]=v=s(m,u)),md&&(d=v))}),o.start=f,o.stop=d,e.modifies(r?a:l)},_floor(t,e){const n=t.timezone==="utc",{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:HLe({extent:t.extent||kh(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=Fne(r),s=this.value||{},a=(n?FLe:$Le)(o,i);return a.unit=$n(o),a.units=o,a.step=i,a.start=s.start,a.stop=s.stop,this.value=a}});function r3e(t){De.call(this,wO(),t)}it(r3e,De,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=a=>i.set(r(a),a);let s=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,a=>i.delete(r(a))),e.visit(e.ADD,o)):s=!1,this.modified(s),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}});function i3e(t){De.call(this,null,t)}it(i3e,De,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(d1(t.sort)):e.source).map(t.field))}});function gkt(t,e,n,r){const i=OA[t](e,n);return{init:i.init||rv,update:function(o,s){s[r]=i.next(o)}}}const OA={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=OA.rank(),e=t.next;return{init:t.init,next:n=>(e(n)-1)/(n.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,r=e.compare;let i=e.index;if(t0||je("ntile num must be greater than zero.");const n=OA.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(e*r(i))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return rt(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return e=+e,e>0||je("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(e-1);return re=null,next:n=>{const r=t(n.data[n.index]);return r!=null?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=mkt(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};function mkt(t,e,n){for(let r=e.length;nl[g]=1)}h(t.sort),e.forEach((p,g)=>{const m=n[g],v=r[g],y=i[g]||null,x=Fi(m),b=I$e(p,x,o[g]);if(h(m),s.push(b),vt(OA,p))a.push(gkt(p,m,v,b));else{if(m==null&&p!=="count"&&je("Null aggregate field specified."),p==="count"){u.push(b);return}d=!1;let w=c[x];w||(w=c[x]=[],w.field=m,f.push(w)),w.push(L$e(p,y,b))}}),(u.length||f.length)&&(this.cell=ykt(f,u,d)),this.inputs=Object.keys(l)}const s3e=o3e.prototype;s3e.init=function(){this.windows.forEach(t=>t.init()),this.cell&&this.cell.init()};s3e.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let s;if(n){for(s=t.p0;sF$e(l,l.field));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),s=0;sthis.group(i(a));let s=this.state;(!s||n)&&(s=this.state=new o3e(t)),n||e.modified(s.inputs)?(this.value={},e.visit(e.SOURCE,a=>o(a).add(a))):(e.visit(e.REM,a=>o(a).remove(a)),e.visit(e.ADD,a=>o(a).add(a)));for(let a=0,l=this._mlen;a0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r1?0:t<-1?oy:Math.acos(t)}function mge(t){return t>=1?_N:t<=-1?-_N:Math.asin(t)}const vX=Math.PI,yX=2*vX,W0=1e-6,Okt=yX-W0;function a3e(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return a3e;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iW0)if(!(Math.abs(f*l-c*u)>W0)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-s,p=i-a,g=l*l+c*c,m=h*h+p*p,v=Math.sqrt(g),y=Math.sqrt(d),x=o*Math.tan((vX-Math.acos((g+d-m)/(2*v*y)))/2),b=x/y,w=x/v;Math.abs(b-1)>W0&&this._append`L${e+b*u},${n+b*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=e+a,u=n+l,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>W0||Math.abs(this._y1-u)>W0)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%yX+yX),d>Okt?this._append`A${r},${r},0,1,${f},${e-a},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>W0&&this._append`A${r},${r},0,${+(d>=vX)},${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 gB(){return new $re}gB.prototype=$re.prototype;function mB(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 $re(e)}function Tkt(t){return t.innerRadius}function kkt(t){return t.outerRadius}function Akt(t){return t.startAngle}function Pkt(t){return t.endAngle}function Mkt(t){return t&&t.padAngle}function Rkt(t,e,n,r,i,o,s,a){var l=n-t,c=r-e,u=s-i,f=a-o,d=f*l-u*c;if(!(d*dT*T+M*M&&(O=E,k=P),{cx:O,cy:k,x01:-u,y01:-f,x11:O*(i/w-1),y11:k*(i/w-1)}}function Dkt(){var t=Tkt,e=kkt,n=Nn(0),r=null,i=Akt,o=Pkt,s=Mkt,a=null,l=mB(c);function c(){var u,f,d=+t.apply(this,arguments),h=+e.apply(this,arguments),p=i.apply(this,arguments)-_N,g=o.apply(this,arguments)-_N,m=gge(g-p),v=g>p;if(a||(a=u=l()),hFs))a.moveTo(0,0);else if(m>oR-Fs)a.moveTo(h*Rp(p),h*Ga(p)),a.arc(0,0,h,p,g,!v),d>Fs&&(a.moveTo(d*Rp(g),d*Ga(g)),a.arc(0,0,d,g,p,v));else{var y=p,x=g,b=p,w=g,_=m,S=m,O=s.apply(this,arguments)/2,k=O>Fs&&(r?+r.apply(this,arguments):hs(d*d+h*h)),E=QW(gge(h-d)/2,+n.apply(this,arguments)),P=E,A=E,R,T;if(k>Fs){var M=mge(k/d*Ga(O)),I=mge(k/h*Ga(O));(_-=M*2)>Fs?(M*=v?1:-1,b+=M,w-=M):(_=0,b=w=(p+g)/2),(S-=I*2)>Fs?(I*=v?1:-1,y+=I,x-=I):(S=0,y=x=(p+g)/2)}var z=h*Rp(y),F=h*Ga(y),N=d*Rp(w),L=d*Ga(w);if(E>Fs){var B=h*Rp(x),$=h*Ga(x),j=d*Rp(b),X=d*Ga(b),V;if(mFs?A>Fs?(R=RI(j,X,z,F,h,A,v),T=RI(B,$,N,L,h,A,v),a.moveTo(R.cx+R.x01,R.cy+R.y01),AFs)||!(_>Fs)?a.lineTo(N,L):P>Fs?(R=RI(N,L,B,$,d,-P,v),T=RI(z,F,j,X,d,-P,v),a.lineTo(R.cx+R.x01,R.cy+R.y01),P=h;--p)a.point(x[p],b[p]);a.lineEnd(),a.areaEnd()}v&&(x[d]=+t(m,d,f),b[d]=+e(m,d,f),a.point(r?+r(m,d,f):x[d],n?+n(m,d,f):b[d]))}if(y)return a=null,y+""||null}function u(){return Nre().defined(i).curve(s).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:Nn(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Nn(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Nn(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:Nn(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Nn(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Nn(+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:Nn(!!f),c):i},c.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),c):s},c.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),c):o},c}class f3e{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 Ikt(t){return new f3e(t,!0)}function Lkt(t){return new f3e(t,!1)}const zre={draw(t,e){const n=hs(e/oy);t.moveTo(n,0),t.arc(0,0,n,0,oR)}},$kt={draw(t,e){const n=hs(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()}},d3e=hs(1/3),Fkt=d3e*2,Nkt={draw(t,e){const n=hs(e/Fkt),r=n*d3e;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},zkt={draw(t,e){const n=hs(e),r=-n/2;t.rect(r,r,n,n)}},jkt=.8908130915292852,h3e=Ga(oy/10)/Ga(7*oy/10),Bkt=Ga(oR/10)*h3e,Ukt=-Rp(oR/10)*h3e,Wkt={draw(t,e){const n=hs(e*jkt),r=Bkt*n,i=Ukt*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const s=oR*o/5,a=Rp(s),l=Ga(s);t.lineTo(l*n,-a*n),t.lineTo(a*r-l*i,l*r+a*i)}t.closePath()}},KW=hs(3),Vkt={draw(t,e){const n=-hs(e/(KW*3));t.moveTo(0,n*2),t.lineTo(-KW*n,-n),t.lineTo(KW*n,-n),t.closePath()}},$c=-.5,Fc=hs(3)/2,xX=1/hs(12),Gkt=(xX/2+1)*3,Hkt={draw(t,e){const n=hs(e/Gkt),r=n/2,i=n*xX,o=r,s=n*xX+n,a=-o,l=s;t.moveTo(r,i),t.lineTo(o,s),t.lineTo(a,l),t.lineTo($c*r-Fc*i,Fc*r+$c*i),t.lineTo($c*o-Fc*s,Fc*o+$c*s),t.lineTo($c*a-Fc*l,Fc*a+$c*l),t.lineTo($c*r+Fc*i,$c*i-Fc*r),t.lineTo($c*o+Fc*s,$c*s-Fc*o),t.lineTo($c*a+Fc*l,$c*l-Fc*a),t.closePath()}};function p3e(t,e){let n=null,r=mB(i);t=typeof t=="function"?t:Nn(t||zre),e=typeof e=="function"?e:Nn(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:Nn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:Nn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function sy(){}function SN(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 vB(t){this._context=t}vB.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:SN(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:SN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function g3e(t){return new vB(t)}function m3e(t){this._context=t}m3e.prototype={areaStart:sy,areaEnd:sy,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:SN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function v3e(t){return new m3e(t)}function y3e(t){this._context=t}y3e.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:SN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function x3e(t){return new y3e(t)}function b3e(t,e){this._basis=new vB(t),this._beta=e}b3e.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],i=e[0],o=t[n]-r,s=e[n]-i,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(r+l*o),this._beta*e[a]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const qkt=function t(e){function n(r){return e===1?new vB(r):new b3e(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function CN(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function jre(t,e){this._context=t,this._k=(1-e)/6}jre.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:CN(this,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,this._x1=t,this._y1=e;break;case 2:this._point=3;default:CN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Xkt=function t(e){function n(r){return new jre(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Bre(t,e){this._context=t,this._k=(1-e)/6}Bre.prototype={areaStart:sy,areaEnd:sy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:CN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ykt=function t(e){function n(r){return new Bre(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Ure(t,e){this._context=t,this._k=(1-e)/6}Ure.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(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,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:CN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Qkt=function t(e){function n(r){return new Ure(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Wre(t,e,n){var r=t._x1,i=t._y1,o=t._x2,s=t._y2;if(t._l01_a>Fs){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Fs){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,s,t._x2,t._y2)}function w3e(t,e){this._context=t,this._alpha=e}w3e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Wre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Kkt=function t(e){function n(r){return e?new w3e(r,e):new jre(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function _3e(t,e){this._context=t,this._alpha=e}_3e.prototype={areaStart:sy,areaEnd:sy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Wre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Zkt=function t(e){function n(r){return e?new _3e(r,e):new Bre(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function S3e(t,e){this._context=t,this._alpha=e}S3e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Jkt=function t(e){function n(r){return e?new S3e(r,e):new Ure(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function C3e(t){this._context=t}C3e.prototype={areaStart:sy,areaEnd:sy,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 O3e(t){return new C3e(t)}function vge(t){return t<0?-1:1}function yge(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(vge(o)+vge(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function xge(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ZW(t,e,n){var r=t._x0,i=t._y0,o=t._x1,s=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*e,o-a,s-a*n,o,s)}function ON(t){this._context=t}ON.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:ZW(this,this._t0,xge(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,ZW(this,xge(this,n=yge(this,t,e)),n);break;default:ZW(this,this._t0,n=yge(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function E3e(t){this._context=new T3e(t)}(E3e.prototype=Object.create(ON.prototype)).point=function(t,e){ON.prototype.point.call(this,e,t)};function T3e(t){this._context=t}T3e.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 k3e(t){return new ON(t)}function A3e(t){return new E3e(t)}function P3e(t){this._context=t}P3e.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=bge(t),i=bge(e),o=0,s=1;s=0;--e)i[e]=(s[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 R3e(t){return new yB(t,.5)}function D3e(t){return new yB(t,0)}function I3e(t){return new yB(t,1)}function BS(t,e){if((s=t.length)>1)for(var n=1,r,i,o=t[e[0]],s,a=o.length;n=0;)n[e]=e;return n}function eAt(t,e){return t[e]}function tAt(t){const e=[];return e.key=t,e}function nAt(){var t=Nn([]),e=bX,n=BS,r=eAt;function i(o){var s=Array.from(t.apply(this,arguments),tAt),a,l=s.length,c=-1,u;for(const f of o)for(a=0,++c;a0){for(var n,r,i=0,o=t[0].length,s;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,s;rtypeof Image<"u"?Image:null;function Fu(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Xg(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const EN=Symbol("implicit");function aR(){var t=new Fpe,e=[],n=[],r=EN;function i(o){let s=t.get(o);if(s===void 0){if(r!==EN)return r;t.set(o,s=e.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new Fpe;for(const s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return aR(e,n).unknown(r)},Fu.apply(i,arguments),i}function EA(){var t=aR().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete t.unknown;function f(){var d=e().length,h=i>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?DI(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?DI(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=lAt.exec(t))?new Fo(e[1],e[2],e[3],1):(e=cAt.exec(t))?new Fo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=uAt.exec(t))?DI(e[1],e[2],e[3],e[4]):(e=fAt.exec(t))?DI(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=dAt.exec(t))?Tge(e[1],e[2]/100,e[3]/100,1):(e=hAt.exec(t))?Tge(e[1],e[2]/100,e[3]/100,e[4]):wge.hasOwnProperty(t)?Cge(wge[t]):t==="transparent"?new Fo(NaN,NaN,NaN,0):null}function Cge(t){return new Fo(t>>16&255,t>>8&255,t&255,1)}function DI(t,e,n,r){return r<=0&&(t=e=n=NaN),new Fo(t,e,n,r)}function Vre(t){return t instanceof Gy||(t=kA(t)),t?(t=t.rgb(),new Fo(t.r,t.g,t.b,t.opacity)):new Fo}function ay(t,e,n,r){return arguments.length===1?Vre(t):new Fo(t,e,n,r??1)}function Fo(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}kO(Fo,ay,lR(Gy,{brighter(t){return t=t==null?US:Math.pow(US,t),new Fo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?pb:Math.pow(pb,t),new Fo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Fo(zx(this.r),zx(this.g),zx(this.b),TN(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:Oge,formatHex:Oge,formatHex8:mAt,formatRgb:Ege,toString:Ege}));function Oge(){return`#${vx(this.r)}${vx(this.g)}${vx(this.b)}`}function mAt(){return`#${vx(this.r)}${vx(this.g)}${vx(this.b)}${vx((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ege(){const t=TN(this.opacity);return`${t===1?"rgb(":"rgba("}${zx(this.r)}, ${zx(this.g)}, ${zx(this.b)}${t===1?")":`, ${t})`}`}function TN(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function zx(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vx(t){return t=zx(t),(t<16?"0":"")+t.toString(16)}function Tge(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new _f(t,e,n,r)}function $3e(t){if(t instanceof _f)return new _f(t.h,t.s,t.l,t.opacity);if(t instanceof Gy||(t=kA(t)),!t)return new _f;if(t instanceof _f)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),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(n-r)/a+(n0&&l<1?0:s,new _f(s,a,l,t.opacity)}function kN(t,e,n,r){return arguments.length===1?$3e(t):new _f(t,e,n,r??1)}function _f(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}kO(_f,kN,lR(Gy,{brighter(t){return t=t==null?US:Math.pow(US,t),new _f(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?pb:Math.pow(pb,t),new _f(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 Fo(JW(t>=240?t-240:t+120,i,r),JW(t,i,r),JW(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new _f(kge(this.h),II(this.s),II(this.l),TN(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=TN(this.opacity);return`${t===1?"hsl(":"hsla("}${kge(this.h)}, ${II(this.s)*100}%, ${II(this.l)*100}%${t===1?")":`, ${t})`}`}}));function kge(t){return t=(t||0)%360,t<0?t+360:t}function II(t){return Math.max(0,Math.min(1,t||0))}function JW(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 F3e=Math.PI/180,N3e=180/Math.PI,AN=18,z3e=.96422,j3e=1,B3e=.82521,U3e=4/29,B_=6/29,W3e=3*B_*B_,vAt=B_*B_*B_;function V3e(t){if(t instanceof yh)return new yh(t.l,t.a,t.b,t.opacity);if(t instanceof Zp)return G3e(t);t instanceof Fo||(t=Vre(t));var e=rV(t.r),n=rV(t.g),r=rV(t.b),i=eV((.2225045*e+.7168786*n+.0606169*r)/j3e),o,s;return e===n&&n===r?o=s=i:(o=eV((.4360747*e+.3850649*n+.1430804*r)/z3e),s=eV((.0139322*e+.0971045*n+.7141733*r)/B3e)),new yh(116*i-16,500*(o-i),200*(i-s),t.opacity)}function PN(t,e,n,r){return arguments.length===1?V3e(t):new yh(t,e,n,r??1)}function yh(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}kO(yh,PN,lR(Gy,{brighter(t){return new yh(this.l+AN*(t??1),this.a,this.b,this.opacity)},darker(t){return new yh(this.l-AN*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=z3e*tV(e),t=j3e*tV(t),n=B3e*tV(n),new Fo(nV(3.1338561*e-1.6168667*t-.4906146*n),nV(-.9787684*e+1.9161415*t+.033454*n),nV(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function eV(t){return t>vAt?Math.pow(t,1/3):t/W3e+U3e}function tV(t){return t>B_?t*t*t:W3e*(t-U3e)}function nV(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rV(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yAt(t){if(t instanceof Zp)return new Zp(t.h,t.c,t.l,t.opacity);if(t instanceof yh||(t=V3e(t)),t.a===0&&t.b===0)return new Zp(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=r()=>t;function Q3e(t,e){return function(n){return t+n*e}}function bAt(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 wB(t,e){var n=e-t;return n?Q3e(t,n>180||n<-180?n-360*Math.round(n/360):n):bB(isNaN(t)?e:t)}function wAt(t){return(t=+t)==1?No:function(e,n){return n-e?bAt(e,n,t):bB(isNaN(e)?n:e)}}function No(t,e){var n=e-t;return n?Q3e(t,n):bB(isNaN(t)?e:t)}const _X=function t(e){var n=wAt(e);function r(i,o){var s=n((i=ay(i)).r,(o=ay(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=No(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function K3e(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:vf(r,i)})),n=iV.lastIndex;return n180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:vf(c,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(c,u,f,d){c!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:vf(c,u)}):u&&f.push(i(f)+"skewX("+u+r)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:vf(c,f)},{i:g-2,x:vf(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=t(c),u=t(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,d),s(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,g=d.length,m;++pe&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function XAt(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i2?YAt:XAt,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=a(t.map(r),e,n)))(r(s(d)))}return f.invert=function(d){return s(i((c||(c=a(e,t.map(r),vf)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,RN),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=cR,u()},f.clamp=function(d){return arguments.length?(s=d?!0:_a,u()):s!==_a},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 Yre(){return _B()(_a,_a)}function Qre(t,e,n,r){var i=ry(t,e,n),o;switch(r=hb(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=CLe(i,s))&&(r.precision=o),Ine(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=OLe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=SLe(i))&&(r.precision=o-(r.type==="%")*2);break}}return K4(r)}function qy(t){var e=t.domain;return t.ticks=function(n){var r=e();return iX(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Qre(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,s=r[i],a=r[o],l,c,u=10;for(a0;){if(c=oX(s,a,n),c===l)return r[i]=s,r[o]=a,e(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function PA(){var t=Yre();return t.copy=function(){return uR(t,PA())},Fu.apply(t,arguments),qy(t)}function Kre(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,RN),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Kre(t).unknown(e)},t=arguments.length?Array.from(t,RN):[0,1],qy(n)}function lFe(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],s;return oMath.pow(t,e)}function ePt(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 Fge(t){return(e,n)=>-t(-e,n)}function Zre(t){const e=t(Lge,$ge),n=e.domain;let r=10,i,o;function s(){return i=ePt(r),o=JAt(r),n()[0]<0?(i=Fge(i),o=Fge(o),t(QAt,KAt)):t(Lge,$ge),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{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(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(gu)break;v.push(g)}v.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=hb(l)).precision==null&&(l.trim=!0),l=K4(l)),a===1/0)return l;const c=Math.max(1,r*a/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(lFe(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),e}function Jre(){const t=Zre(_B()).domain([1,10]);return t.copy=()=>uR(t,Jre()).base(t.base()),Fu.apply(t,arguments),t}function Nge(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function zge(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function eie(t){var e=1,n=t(Nge(e),zge(e));return n.constant=function(r){return arguments.length?t(Nge(e=+r),zge(e)):e},qy(n)}function tie(){var t=eie(_B());return t.copy=function(){return uR(t,tie()).constant(t.constant())},Fu.apply(t,arguments)}function jge(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function tPt(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function nPt(t){return t<0?-t*t:t*t}function nie(t){var e=t(_a,_a),n=1;function r(){return n===1?t(_a,_a):n===.5?t(tPt,nPt):t(jge(n),jge(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},qy(e)}function SB(){var t=nie(_B());return t.copy=function(){return uR(t,SB()).exponent(t.exponent())},Fu.apply(t,arguments),t}function cFe(){return SB.apply(null,arguments).exponent(.5)}function Bge(t){return Math.sign(t)*t*t}function rPt(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function uFe(){var t=Yre(),e=[0,1],n=!1,r;function i(o){var s=rPt(t(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return t.invert(Bge(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,RN)).map(Bge)),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 uFe(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Fu.apply(i,arguments),qy(i)}function rie(){var t=[],e=[],n=[],r;function i(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s0?n[a-1]:t[0],a=n?[r[n-1],e]:[r[c-1],r[c]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return iie().domain([t,e]).range(i).unknown(o)},Fu.apply(qy(s),arguments)}function oie(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Lg(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 s=e.indexOf(o);return[t[s-1],t[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return oie().domain(t).range(e).unknown(n)},Fu.apply(i,arguments)}function iPt(t){return new Date(t)}function oPt(t){return t instanceof Date?+t:+new Date(+t)}function sie(t,e,n,r,i,o,s,a,l,c){var u=Yre(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),y=c("%b %d"),x=c("%B"),b=c("%Y");function w(_){return(l(_)<_?h:a(_)<_?p:s(_)<_?g:o(_)<_?m:r(_)<_?i(_)<_?v:y:n(_)<_?x:b)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?d(Array.from(_,oPt)):d().map(iPt)},u.ticks=function(_){var S=d();return t(S[0],S[S.length-1],_??10)},u.tickFormat=function(_,S){return S==null?w:c(S)},u.nice=function(_){var S=d();return(!_||typeof _.range!="function")&&(_=e(S[0],S[S.length-1],_??10)),_?d(lFe(S,_)):u},u.copy=function(){return uR(u,sie(t,e,n,r,i,o,s,a,l,c))},u}function fFe(){return Fu.apply(sie(oEt,sEt,Ah,wA,SO,cg,eB,Z4,Kp,zne).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function dFe(){return Fu.apply(sie(rEt,iEt,Ph,_A,CO,zv,tB,J4,Kp,jne).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function CB(){var t=0,e=1,n,r,i,o,s=_a,a=!1,l;function c(f){return f==null||isNaN(f=+f)?l:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),c):[t,e]},c.clamp=function(f){return arguments.length?(a=!!f,c):a},c.interpolator=function(f){return arguments.length?(s=f,c):s};function u(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),c):[s(0),s(1)]}}return c.range=u(Hy),c.rangeRound=u(cR),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),c}}function Xy(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function OB(){var t=qy(CB()(_a));return t.copy=function(){return Xy(t,OB())},Xg.apply(t,arguments)}function aie(){var t=Zre(CB()).domain([1,10]);return t.copy=function(){return Xy(t,aie()).base(t.base())},Xg.apply(t,arguments)}function lie(){var t=eie(CB());return t.copy=function(){return Xy(t,lie()).constant(t.constant())},Xg.apply(t,arguments)}function EB(){var t=nie(CB());return t.copy=function(){return Xy(t,EB()).exponent(t.exponent())},Xg.apply(t,arguments)}function hFe(){return EB.apply(null,arguments).exponent(.5)}function pFe(){var t=[],e=_a;function n(r){if(r!=null&&!isNaN(r=+r))return e((Lg(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(mh),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>mN(t,o/r))},n.copy=function(){return pFe(e).domain(t)},Xg.apply(n,arguments)}function TB(){var t=0,e=.5,n=1,r=1,i,o,s,a,l,c=_a,u,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-o)*(r*g0?r:1:0}const mPt="identity",WS="linear",Fg="log",fR="pow",dR="sqrt",AB="symlog",gb="time",mb="utc",xh="sequential",AO="diverging",VS="quantile",PB="quantize",MB="threshold",hie="ordinal",EX="point",mFe="band",pie="bin-ordinal",Ao="continuous",hR="discrete",pR="discretizing",Nu="interpolating",gie="temporal";function vPt(t){return function(e){let n=e[0],r=e[1],i;return r=r&&n[l]<=i&&(o<0&&(o=l),s=l);if(!(o<0))return r=t.invertExtent(n[o]),i=t.invertExtent(n[s]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function mie(){const t=aR().unknown(void 0),e=t.domain,n=t.range;let r=[0,1],i,o,s=!1,a=0,l=0,c=.5;delete t.unknown;function u(){const f=e().length,d=r[1]g+i*v);return n(d?m.reverse():m)}return t.domain=function(f){return arguments.length?(e(f),u()):e()},t.range=function(f){return arguments.length?(r=[+f[0],+f[1]],u()):r.slice()},t.rangeRound=function(f){return r=[+f[0],+f[1]],s=!0,u()},t.bandwidth=function(){return o},t.step=function(){return i},t.round=function(f){return arguments.length?(s=!!f,u()):s},t.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,u()):a},t.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),u()):a},t.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),u()):l},t.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),u()):c},t.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=r[1]r[1-d])))return v=Math.max(0,Lg(h,g)-1),y=g===m?v:Lg(h,m)-1,g-h[v]>o+1e-10&&++v,d&&(x=v,v=p-y,y=p-x),v>y?void 0:e().slice(v,y+1)},t.invert=function(f){const d=t.invertRange([f,f]);return d&&d[0]},t.copy=function(){return mie().domain(e()).range(r).round(s).paddingInner(a).paddingOuter(l).align(c)},u()}function vFe(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return vFe(e())},t}function xPt(){return vFe(mie().paddingInner(1))}var bPt=Array.prototype.map;function wPt(t){return bPt.call(t,Ys)}const _Pt=Array.prototype.slice;function yFe(){let t=[],e=[];function n(r){return r==null||r!==r?void 0:e[(Lg(t,r)-1)%e.length]}return n.domain=function(r){return arguments.length?(t=wPt(r),n):t.slice()},n.range=function(r){return arguments.length?(e=_Pt.call(r),n):e.slice()},n.tickFormat=function(r,i){return Qre(t[0],$n(t),r??10,i)},n.copy=function(){return yFe().domain(n.domain()).range(n.range())},n}const DN=new Map,xFe=Symbol("vega_scale");function bFe(t){return t[xFe]=!0,t}function SPt(t){return t&&t[xFe]===!0}function CPt(t,e,n){const r=function(){const o=e();return o.invertRange||(o.invertRange=o.invert?vPt(o):o.invertExtent?yPt(o):void 0),o.type=t,bFe(o)};return r.metadata=Wf(pt(n)),r}function tr(t,e,n){return arguments.length>1?(DN.set(t,CPt(t,e,n)),this):wFe(t)?DN.get(t):void 0}tr(mPt,Kre);tr(WS,PA,Ao);tr(Fg,Jre,[Ao,Fg]);tr(fR,SB,Ao);tr(dR,cFe,Ao);tr(AB,tie,Ao);tr(gb,fFe,[Ao,gie]);tr(mb,dFe,[Ao,gie]);tr(xh,OB,[Ao,Nu]);tr(`${xh}-${WS}`,OB,[Ao,Nu]);tr(`${xh}-${Fg}`,aie,[Ao,Nu,Fg]);tr(`${xh}-${fR}`,EB,[Ao,Nu]);tr(`${xh}-${dR}`,hFe,[Ao,Nu]);tr(`${xh}-${AB}`,lie,[Ao,Nu]);tr(`${AO}-${WS}`,cie,[Ao,Nu]);tr(`${AO}-${Fg}`,uie,[Ao,Nu,Fg]);tr(`${AO}-${fR}`,kB,[Ao,Nu]);tr(`${AO}-${dR}`,gFe,[Ao,Nu]);tr(`${AO}-${AB}`,fie,[Ao,Nu]);tr(VS,rie,[pR,VS]);tr(PB,iie,pR);tr(MB,oie,pR);tr(pie,yFe,[hR,pR]);tr(hie,aR,hR);tr(mFe,mie,hR);tr(EX,xPt,hR);function wFe(t){return DN.has(t)}function p1(t,e){const n=DN.get(t);return n&&n.metadata[e]}function vie(t){return p1(t,Ao)}function GS(t){return p1(t,hR)}function TX(t){return p1(t,pR)}function _Fe(t){return p1(t,Fg)}function OPt(t){return p1(t,gie)}function SFe(t){return p1(t,Nu)}function CFe(t){return p1(t,VS)}const EPt=["clamp","base","constant","exponent"];function OFe(t,e){const n=e[0],r=$n(e)-n;return function(i){return t(n+i*r)}}function RB(t,e,n){return Xre(yie(e||"rgb",n),t)}function EFe(t,e){const n=new Array(e),r=e+1;for(let i=0;it[a]?s[a](t[a]()):0),s)}function yie(t,e){const n=GAt[TPt(t)];return e!=null&&n&&n.gamma?n.gamma(e):n}function TPt(t){return"interpolate"+t.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}const kPt={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},APt={accent:aPt,category10:sPt,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:lPt,observable10:cPt,paired:uPt,pastel1:fPt,pastel2:dPt,set1:hPt,set2:pPt,set3:gPt,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function kFe(t){if(We(t))return t;const e=t.length/6|0,n=new Array(e);for(let r=0;rRB(kFe(t)));function xie(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(Uge[t]=e,this):Uge[t]}const g3="symbol",PPt="discrete",MPt="gradient",RPt=t=>We(t)?t.map(e=>String(e)):String(t),DPt=(t,e)=>t[1]-e[1],IPt=(t,e)=>e[1]-t[1];function bie(t,e,n){let r;return Jn(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),n!=null&&(e=Math.min(e,Math.floor(tR(t.domain())/n||1)+1))),ht(e)&&(r=e.step,e=e.interval),gt(e)&&(e=t.type===gb?OO(e):t.type==mb?EO(e):je("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function PFe(t,e,n){let r=t.range(),i=r[0],o=$n(r),s=DPt;if(i>o&&(r=o,o=i,i=r,s=IPt),i=Math.floor(i),o=Math.ceil(o),e=e.map(a=>[a,t(a)]).filter(a=>i<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&e.length>1){const a=[e[0],$n(e)];for(;e.length>n&&e.length>=3;)e=e.filter((l,c)=>!(c%2));e.length<3&&(e=a)}return e}function wie(t,e){return t.bins?PFe(t,t.bins,e):t.ticks?t.ticks(e):t.domain()}function MFe(t,e,n,r,i,o){const s=e.type;let a=RPt;if(s===gb||i===gb)a=t.timeFormat(r);else if(s===mb||i===mb)a=t.utcFormat(r);else if(_Fe(s)){const l=t.formatFloat(r);if(o||e.bins)a=l;else{const c=RFe(e,n,!1);a=u=>c(u)?l(u):""}}else if(e.tickFormat){const l=e.domain();a=t.formatSpan(l[0],l[l.length-1],n,r)}else r&&(a=t.format(r));return a}function RFe(t,e,n){const r=wie(t,e),i=t.base(),o=Math.log(i),s=Math.max(1,i*e/r.length),a=l=>{let c=l/Math.pow(i,Math.round(Math.log(l)/o));return c*i1?r[1]-r[0]:r[0],s;for(s=1;skX[t.type]||t.bins;function LFe(t,e,n,r,i,o,s){const a=DFe[e.type]&&o!==gb&&o!==mb?LPt(t,e,i):MFe(t,e,n,i,o,s);return r===g3&&NPt(e)?zPt(a):r===PPt?jPt(a):BPt(a)}const zPt=t=>(e,n,r)=>{const i=Wge(r[n+1],Wge(r.max,1/0)),o=Vge(e,t),s=Vge(i,t);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},Wge=(t,e)=>t??e,jPt=t=>(e,n)=>n?t(e):null,BPt=t=>e=>t(e),Vge=(t,e)=>Number.isFinite(t)?e(t):null;function UPt(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+$n(e),o=i-r;if(t.type===MB){const s=n?o/n:.1;r-=s,i+=s,o=i-r}return s=>(s-r)/o}function WPt(t,e,n,r){const i=r||e.type;return gt(n)&&OPt(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===gb?t.timeFormat("%A, %d %B %Y, %X"):!n&&i===mb?t.utcFormat("%A, %d %B %Y, %X UTC"):LFe(t,e,5,null,n,r,!0)}function $Fe(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=WPt(t,e,n.format,n.formatType);if(TX(e.type)){const o=IFe(e).slice(1).map(i),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(GS(e.type)){const o=e.domain(),s=o.length,a=s>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=e.domain();return`values from ${i(o[0])} to ${i($n(o))}`}}let FFe=0;function VPt(){FFe=0}const IN="p_";function _ie(t){return t&&t.gradient}function NFe(t,e,n){const r=t.gradient;let i=t.id,o=r==="radial"?IN:"";return i||(i=t.id="gradient_"+FFe++,r==="radial"?(t.x1=yd(t.x1,.5),t.y1=yd(t.y1,.5),t.r1=yd(t.r1,0),t.x2=yd(t.x2,.5),t.y2=yd(t.y2,.5),t.r2=yd(t.r2,.5),o=IN):(t.x1=yd(t.x1,0),t.y1=yd(t.y1,0),t.x2=yd(t.x2,1),t.y2=yd(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function yd(t,e){return t??e}function zFe(t,e){var n=[],r;return r={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:n,stop:function(i,o){return n.push({offset:i,color:o}),r}}}const Gge={basis:{curve:g3e},"basis-closed":{curve:v3e},"basis-open":{curve:x3e},bundle:{curve:qkt,tension:"beta",value:.85},cardinal:{curve:Xkt,tension:"tension",value:0},"cardinal-open":{curve:Qkt,tension:"tension",value:0},"cardinal-closed":{curve:Ykt,tension:"tension",value:0},"catmull-rom":{curve:Kkt,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Zkt,tension:"alpha",value:.5},"catmull-rom-open":{curve:Jkt,tension:"alpha",value:.5},linear:{curve:sR},"linear-closed":{curve:O3e},monotone:{horizontal:A3e,vertical:k3e},natural:{curve:M3e},step:{curve:R3e},"step-after":{curve:I3e},"step-before":{curve:D3e}};function Sie(t,e,n){var r=vt(Gge,t)&&Gge[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}const GPt={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},HPt=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,qPt=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,XPt=/^((\s+,?\s*)|(,\s*))/,YPt=/^[01]/;function HS(t){const e=[];return(t.match(HPt)||[]).forEach(r=>{let i=r[0];const o=i.toLowerCase(),s=GPt[o],a=QPt(o,s,r.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,v=f/n,y=-f/r,x=d/r,b=m*a+v*l,w=y*a+x*l,_=m*t+v*e,S=y*t+x*e;let k=1/((_-b)*(_-b)+(S-w)*(S-w))-.25;k<0&&(k=0);let E=Math.sqrt(k);o==i&&(E=-E);const P=.5*(b+_)-E*(S-w),A=.5*(w+S)+E*(_-b),R=Math.atan2(w-A,b-P);let M=Math.atan2(S-A,_-P)-R;M<0&&o===1?M+=Wd:M>0&&o===0&&(M-=Wd);const I=Math.ceil(Math.abs(M/(J0+.001))),z=[];for(let F=0;F+t}function $I(t,e,n){return Math.max(e,Math.min(t,n))}function UFe(){var t=nMt,e=rMt,n=iMt,r=oMt,i=fp(0),o=i,s=i,a=i,l=null;function c(u,f,d){var h,p=f??+t.call(this,u),g=d??+e.call(this,u),m=+n.call(this,u),v=+r.call(this,u),y=Math.min(m,v)/2,x=$I(+i.call(this,u),0,y),b=$I(+o.call(this,u),0,y),w=$I(+s.call(this,u),0,y),_=$I(+a.call(this,u),0,y);if(l||(l=h=gB()),x<=0&&b<=0&&w<=0&&_<=0)l.rect(p,g,m,v);else{var S=p+m,O=g+v;l.moveTo(p+x,g),l.lineTo(S-b,g),l.bezierCurveTo(S-mm*b,g,S,g+mm*b,S,g+b),l.lineTo(S,O-_),l.bezierCurveTo(S,O-mm*_,S-mm*_,O,S-_,O),l.lineTo(p+w,O),l.bezierCurveTo(p+mm*w,O,p,O-mm*w,p,O-w),l.lineTo(p,g+x),l.bezierCurveTo(p,g+mm*x,p+mm*x,g,p+x,g),l.closePath()}if(h)return l=null,h+""||null}return c.x=function(u){return arguments.length?(t=fp(u),c):t},c.y=function(u){return arguments.length?(e=fp(u),c):e},c.width=function(u){return arguments.length?(n=fp(u),c):n},c.height=function(u){return arguments.length?(r=fp(u),c):r},c.cornerRadius=function(u,f,d,h){return arguments.length?(i=fp(u),o=f!=null?fp(f):i,a=d!=null?fp(d):i,s=h!=null?fp(h):o,c):i},c.context=function(u){return arguments.length?(l=u??null,c):l},c}function WFe(){var t,e,n,r,i=null,o,s,a,l;function c(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var v=Math.hypot(g,m),y=(g/=v)*l,x=(m/=v)*l,b=Math.atan2(m,g);i.moveTo(s-y,a-x),i.lineTo(f-g*p,d-m*p),i.arc(f,d,p,b-Math.PI,b),i.lineTo(s+y,a+x),i.arc(s,a,l,b,b+Math.PI)}else i.arc(f,d,p,0,Wd);i.closePath()}else o=1;s=f,a=d,l=p}function u(f){var d,h=f.length,p,g=!1,m;for(i==null&&(i=m=gB()),d=0;d<=h;++d)!(dt.x||0,vR=t=>t.y||0,sMt=t=>t.width||0,aMt=t=>t.height||0,lMt=t=>(t.x||0)+(t.width||0),cMt=t=>(t.y||0)+(t.height||0),uMt=t=>t.startAngle||0,fMt=t=>t.endAngle||0,dMt=t=>t.padAngle||0,hMt=t=>t.innerRadius||0,pMt=t=>t.outerRadius||0,gMt=t=>t.cornerRadius||0,mMt=t=>gR(t.cornerRadiusTopLeft,t.cornerRadius)||0,vMt=t=>gR(t.cornerRadiusTopRight,t.cornerRadius)||0,yMt=t=>gR(t.cornerRadiusBottomRight,t.cornerRadius)||0,xMt=t=>gR(t.cornerRadiusBottomLeft,t.cornerRadius)||0,bMt=t=>gR(t.size,64),wMt=t=>t.size||1,DB=t=>t.defined!==!1,_Mt=t=>BFe(t.shape||"circle"),SMt=Dkt().startAngle(uMt).endAngle(fMt).padAngle(dMt).innerRadius(hMt).outerRadius(pMt).cornerRadius(gMt),CMt=f_().x(mR).y1(vR).y0(cMt).defined(DB),OMt=f_().y(vR).x1(mR).x0(lMt).defined(DB),EMt=Nre().x(mR).y(vR).defined(DB),TMt=UFe().x(mR).y(vR).width(sMt).height(aMt).cornerRadius(mMt,vMt,yMt,xMt),kMt=p3e().type(_Mt).size(bMt),AMt=WFe().x(mR).y(vR).defined(DB).size(wMt);function Cie(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function PMt(t,e){return SMt.context(t)(e)}function MMt(t,e){const n=e[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?OMt:CMt).curve(Sie(r,n.orient,n.tension)).context(t)(e)}function RMt(t,e){const n=e[0],r=n.interpolate||"linear";return EMt.curve(Sie(r,n.orient,n.tension)).context(t)(e)}function PO(t,e,n,r){return TMt.context(t)(e,n,r)}function DMt(t,e){return(e.mark.shape||e.shape).context(t)(e)}function IMt(t,e){return kMt.context(t)(e)}function LMt(t,e){return AMt.context(t)(e)}var VFe=1;function GFe(){VFe=1}function Oie(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+VFe++),s=i.clipping[o]||(i.clipping[o]={id:o});return fn(r)?s.path=r(null):Cie(n)?s.path=PO(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function uo(t){this.clear(),t&&this.union(t)}uo.prototype={clone(){return new uo(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return nthis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),c=e-e*a+n*l,u=n-e*l-n*a;return[a*r-l*i+c,l*r+a*i+u,a*r-l*s+c,l*r+a*s+u,a*o-l*i+c,l*o+a*i+u,a*o-l*s+c,l*o+a*s+u]},union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)},contains(t,e){return!(tthis.x2||ethis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function IB(t){this.mark=t,this.bounds=this.bounds||new uo}function LB(t){IB.call(this,t),this.items=this.items||[]}it(LB,IB);class HFe{constructor(e){this._pending=0,this._loader=e||rB()}pending(){return this._pending}sanitizeURL(e){const n=this;return Yge(n),n._loader.sanitize(e,{context:"href"}).then(r=>(e2(n),r)).catch(()=>(e2(n),null))}loadImage(e){const n=this,r=sAt();return Yge(n),n._loader.sanitize(e,{context:"image"}).then(i=>{const o=i.href;if(!o||!r)throw{url:o};const s=new r,a=vt(i,"crossOrigin")?i.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>e2(n),s.onerror=()=>e2(n),s.src=o,s}).catch(i=>(e2(n),{complete:!1,width:0,height:0,src:i&&i.url||""}))}ready(){const e=this;return new Promise(n=>{function r(i){e.pending()?setTimeout(()=>{r(!0)},10):n(i)}r(!1)})}}function Yge(t){t._pending+=1}function e2(t){t._pending-=1}function Yg(t,e,n){if(e.stroke&&e.opacity!==0&&e.strokeOpacity!==0){const r=e.strokeWidth!=null?+e.strokeWidth:1;t.expand(r+(n?$Mt(e,r):0))}return t}function $Mt(t,e){return t.strokeJoin&&t.strokeJoin!=="miter"?0:e}const FMt=Wd-1e-8;let $B,m3,v3,yx,AX,y3,PX,MX;const dv=(t,e)=>$B.add(t,e),x3=(t,e)=>dv(m3=t,v3=e),Qge=t=>dv(t,$B.y1),Kge=t=>dv($B.x1,t),ex=(t,e)=>AX*t+PX*e,tx=(t,e)=>y3*t+MX*e,lV=(t,e)=>dv(ex(t,e),tx(t,e)),cV=(t,e)=>x3(ex(t,e),tx(t,e));function yR(t,e){return $B=t,e?(yx=e*ly,AX=MX=Math.cos(yx),y3=Math.sin(yx),PX=-y3):(AX=MX=1,yx=y3=PX=0),NMt}const NMt={beginPath(){},closePath(){},moveTo:cV,lineTo:cV,rect(t,e,n,r){yx?(lV(t+n,e),lV(t+n,e+r),lV(t,e+r),cV(t,e)):(dv(t+n,e+r),x3(t,e))},quadraticCurveTo(t,e,n,r){const i=ex(t,e),o=tx(t,e),s=ex(n,r),a=tx(n,r);Zge(m3,i,s,Qge),Zge(v3,o,a,Kge),x3(s,a)},bezierCurveTo(t,e,n,r,i,o){const s=ex(t,e),a=tx(t,e),l=ex(n,r),c=tx(n,r),u=ex(i,o),f=tx(i,o);Jge(m3,s,l,u,Qge),Jge(v3,a,c,f,Kge),x3(u,f)},arc(t,e,n,r,i,o){if(r+=yx,i+=yx,m3=n*Math.cos(i)+t,v3=n*Math.sin(i)+e,Math.abs(i-r)>FMt)dv(t-n,e-n),dv(t+n,e+n);else{const s=c=>dv(n*Math.cos(c)+t,n*Math.sin(c)+e);let a,l;if(s(r),s(i),i!==r)if(r=r%Wd,r<0&&(r+=Wd),i=i%Wd,i<0&&(i+=Wd),ii;++l,a-=J0)s(a);else for(a=r-r%J0+J0,l=0;l<4&&aKPt?(u=s*s+a*o,u>=0&&(u=Math.sqrt(u),l=(-s+u)/o,c=(-s-u)/o)):l=.5*a/s,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(t.globalAlpha=n,t.fillStyle=YFe(t,e,e.fill),!0):!1}var jMt=[];function XS(t,e,n){var r=(r=e.strokeWidth)!=null?r:1;return r<=0?!1:(n*=e.strokeOpacity==null?1:e.strokeOpacity,n>0?(t.globalAlpha=n,t.strokeStyle=YFe(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||jMt),t.lineDashOffset=e.strokeDashOffset||0),!0):!1)}function BMt(t,e){return t.zindex-e.zindex||t.index-e.index}function kie(t){if(!t.zdirty)return t.zitems;var e=t.items,n=[],r,i,o;for(i=0,o=e.length;i=0;)if(r=e(n[i]))return r;if(n===o){for(n=t.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=e(n[i])))return r}return null}function Aie(t){return function(e,n,r){Gf(n,i=>{(!r||r.intersects(i.bounds))&&QFe(t,e,i,i)})}}function UMt(t){return function(e,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&QFe(t,e,n.items[0],n.items)}}function QFe(t,e,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(t(e,r)||(qS(e,n),n.fill&&LN(e,n,i)&&e.fill(),n.stroke&&XS(e,n,i)&&e.stroke()))}function FB(t){return t=t||Eu,function(e,n,r,i,o,s){return r*=e.pixelRatio,i*=e.pixelRatio,$N(n,a=>{const l=a.bounds;if(!(l&&!l.contains(o,s)||!l)&&t(e,a,r,i,o,s))return a})}}function xR(t,e){return function(n,r,i,o){var s=Array.isArray(r)?r[0]:r,a=e??s.fill,l=s.stroke&&n.isPointInStroke,c,u;return l&&(c=s.strokeWidth,u=s.strokeCap,n.lineWidth=c??1,n.lineCap=u??"butt"),t(n,r)?!1:a&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o)}}function Pie(t){return FB(xR(t))}function Bx(t,e){return"translate("+t+","+e+")"}function Mie(t){return"rotate("+t+")"}function WMt(t,e){return"scale("+t+","+e+")"}function KFe(t){return Bx(t.x||0,t.y||0)}function VMt(t){return Bx(t.x||0,t.y||0)+(t.angle?" "+Mie(t.angle):"")}function GMt(t){return Bx(t.x||0,t.y||0)+(t.angle?" "+Mie(t.angle):"")+(t.scaleX||t.scaleY?" "+WMt(t.scaleX||1,t.scaleY||1):"")}function Rie(t,e,n){function r(s,a){s("transform",VMt(a)),s("d",e(null,a))}function i(s,a){return e(yR(s,a.angle),a),Yg(s,a).translate(a.x||0,a.y||0)}function o(s,a){var l=a.x||0,c=a.y||0,u=a.angle||0;s.translate(l,c),u&&s.rotate(u*=ly),s.beginPath(),e(s,a),u&&s.rotate(-u),s.translate(-l,-c)}return{type:t,tag:"path",nested:!1,attr:r,bound:i,draw:Aie(o),pick:Pie(o),isect:n||Eie(o)}}var HMt=Rie("arc",PMt);function qMt(t,e){for(var n=t[0].orient==="horizontal"?e[1]:e[0],r=t[0].orient==="horizontal"?"y":"x",i=t.length,o=1/0,s,a;--i>=0;)t[i].defined!==!1&&(a=Math.abs(t[i][r]-n),a=0;)if(t[r].defined!==!1&&(i=t[r].x-e[0],o=t[r].y-e[1],s=i*i+o*o,s=0;)if(t[n].defined!==!1&&(r=t[n].x-e[0],i=t[n].y-e[1],o=r*r+i*i,r=t[n].size||1,o.5&&e<1.5?.5-Math.abs(e-1):0}function ZMt(t,e){t("transform",KFe(e))}function eNe(t,e){const n=JFe(e);t("d",PO(null,e,n,n))}function JMt(t,e){t("class","background"),t("aria-hidden",!0),eNe(t,e)}function eRt(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?eNe(t,e):t("d","")}function tRt(t,e,n){const r=e.clip?Oie(n,e,e):null;t("clip-path",r)}function nRt(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let i=0;i{const o=i.x||0,s=i.y||0,a=i.strokeForeground,l=i.opacity==null?1:i.opacity;(i.stroke||i.fill)&&l&&(RA(t,i,o,s),qS(t,i),i.fill&&LN(t,i,l)&&t.fill(),i.stroke&&!a&&XS(t,i,l)&&t.stroke()),t.save(),t.translate(o,s),i.clip&&ZFe(t,i),n&&n.translate(-o,-s),Gf(i,c=>{(c.marktype==="group"||r==null||r.includes(c.marktype))&&this.draw(t,c,n,r)}),n&&n.translate(o,s),t.restore(),a&&i.stroke&&l&&(RA(t,i,o,s),qS(t,i),XS(t,i,l)&&t.stroke())})}function aRt(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const s=n*t.pixelRatio,a=r*t.pixelRatio;return $N(e,l=>{let c,u,f;const d=l.bounds;if(d&&!d.contains(i,o))return;u=l.x||0,f=l.y||0;const h=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(ih||op))return;if(t.save(),t.translate(u,f),u=i-u,f=o-f,g&&Cie(l)&&!oRt(t,l,s,a))return t.restore(),null;const m=l.strokeForeground,v=e.interactive!==!1;return v&&m&&l.stroke&&iRt(t,l,s,a)?(t.restore(),l):(c=$N(l,y=>lRt(y,u,f)?this.pick(y,n,r,u,f):null),!c&&v&&(l.fill||!m&&l.stroke)&&rRt(t,l,s,a)&&(c=l),t.restore(),c||null)})}function lRt(t,e,n){return(t.interactive!==!1||t.marktype==="group")&&t.bounds&&t.bounds.contains(e,n)}var cRt={type:"group",tag:"g",nested:!1,attr:ZMt,bound:nRt,draw:sRt,pick:aRt,isect:qFe,content:tRt,background:JMt,foreground:eRt},DA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Iie(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(r=>{t.image=r,t.image.url=t.url})),n}function Lie(t,e){return t.width!=null?t.width:!e||!e.width?0:t.aspect!==!1&&t.height?t.height*e.width/e.height:e.width}function $ie(t,e){return t.height!=null?t.height:!e||!e.height?0:t.aspect!==!1&&t.width?t.width*e.height/e.width:e.height}function NB(t,e){return t==="center"?e/2:t==="right"?e:0}function zB(t,e){return t==="middle"?e/2:t==="bottom"?e:0}function uRt(t,e,n){const r=Iie(e,n),i=Lie(e,r),o=$ie(e,r),s=(e.x||0)-NB(e.align,i),a=(e.y||0)-zB(e.baseline,o),l=!r.src&&r.toDataURL?r.toDataURL():r.src||"";t("href",l,DA["xmlns:xlink"],"xlink:href"),t("transform",Bx(s,a)),t("width",i),t("height",o),t("preserveAspectRatio",e.aspect===!1?"none":"xMidYMid")}function fRt(t,e){const n=e.image,r=Lie(e,n),i=$ie(e,n),o=(e.x||0)-NB(e.align,r),s=(e.y||0)-zB(e.baseline,i);return t.set(o,s,o+r,s+i)}function dRt(t,e,n){Gf(e,r=>{if(n&&!n.intersects(r.bounds))return;const i=Iie(r,this);let o=Lie(r,i),s=$ie(r,i);if(o===0||s===0)return;let a=(r.x||0)-NB(r.align,o),l=(r.y||0)-zB(r.baseline,s),c,u,f,d;r.aspect!==!1&&(u=i.width/i.height,f=r.width/r.height,u===u&&f===f&&u!==f&&(f{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&tNe(t,r,i)&&(qS(t,r),t.stroke())}})}function CRt(t,e,n,r){return t.isPointInStroke?tNe(t,e,1)&&t.isPointInStroke(n,r):!1}var ORt={type:"rule",tag:"line",nested:!1,attr:wRt,bound:_Rt,draw:SRt,pick:FB(CRt),isect:XFe},ERt=Rie("shape",DMt),TRt=Rie("symbol",IMt,Tie);const rme=iLe();var hc={height:Gh,measureWidth:Fie,estimateWidth:FN,width:FN,canvas:nNe};nNe(!0);function nNe(t){hc.width=t&&Uv?Fie:FN}function FN(t,e){return rNe(uy(t,e),Gh(t))}function rNe(t,e){return~~(.8*t.length*e)}function Fie(t,e){return Gh(t)<=0||!(e=uy(t,e))?0:iNe(e,jB(t))}function iNe(t,e){const n=`(${e}) ${t}`;let r=rme.get(n);return r===void 0&&(Uv.font=e,r=Uv.measureText(t).width,rme.set(n,r)),r}function Gh(t){return t.fontSize!=null?+t.fontSize||0:11}function cy(t){return t.lineHeight!=null?t.lineHeight:Gh(t)+2}function kRt(t){return We(t)?t.length>1?t:t[0]:t}function bR(t){return kRt(t.lineBreak&&t.text&&!We(t.text)?t.text.split(t.lineBreak):t.text)}function Nie(t){const e=bR(t);return(We(e)?e.length-1:0)*cy(t)}function uy(t,e){const n=e==null?"":(e+"").trim();return t.limit>0&&n.length?PRt(t,n):n}function ARt(t){if(hc.width===Fie){const e=jB(t);return n=>iNe(n,e)}else if(hc.width===FN){const e=Gh(t);return n=>rNe(n,e)}else return e=>hc.width(t,e)}function PRt(t,e){var n=+t.limit,r=ARt(t);if(r(e)>>1,r(e.slice(l))>n?s=l+1:a=l;return i+e.slice(s)}else{for(;s>>1),r(e.slice(0,l))Math.max(d,hc.width(e,h)),0)):f=hc.width(e,u),i==="center"?l-=f/2:i==="right"&&(l-=f),t.set(l+=s,c+=a,l+f,c+r),e.angle&&!n)t.rotate(e.angle*ly,s,a);else if(n===2)return t.rotatedPoints(e.angle*ly,s,a);return t}function DRt(t,e,n){Gf(e,r=>{var i=r.opacity==null?1:r.opacity,o,s,a,l,c,u,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(t.font=jB(r),t.textAlign=r.align||"left",o=BB(r),s=o.x1,a=o.y1,r.angle&&(t.save(),t.translate(s,a),t.rotate(r.angle*ly),s=a=0),s+=r.dx||0,a+=(r.dy||0)+zie(r),u=bR(r),qS(t,r),We(u))for(c=cy(r),l=0;le;)t.removeChild(n[--r]);return t}function uNe(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function UB(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function zRt(t,e,n,r){var i=t&&t.mark,o,s;if(i&&(o=Ec[i.marktype]).tip){for(s=UB(e,n),s[0]-=r[0],s[1]-=r[1];t=t.mark.group;)s[0]-=t.x||0,s[1]-=t.y||0;t=o.tip(i.items,s)}return t}let Uie=class{constructor(e,n){this._active=null,this._handlers={},this._loader=e||rB(),this._tooltip=n||jRt}initialize(e,n,r){return this._el=e,this._obj=r||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,n,r){for(let i=e?e.length:0;--i>=0;)if(e[i].type===n&&(!r||e[i].handler===r))return i;return-1}handlers(e){const n=this._handlers,r=[];if(e)r.push(...n[this.eventName(e)]);else for(const i in n)r.push(...n[i]);return r}eventName(e){const n=e.indexOf(".");return n<0?e:e.slice(0,n)}handleHref(e,n,r){this._loader.sanitize(r,{context:"href"}).then(i=>{const o=new MouseEvent(e.type,e),s=hv(null,"a");for(const a in i)s.setAttribute(a,i[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(e,n,r){if(n&&n.tooltip!=null){n=zRt(n,e,this.canvas(),this._origin);const i=r&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,e,n,i)}}getItemBoundingClientRect(e){const n=this.canvas();if(!n)return;const r=n.getBoundingClientRect(),i=this._origin,o=e.bounds,s=o.width(),a=o.height();let l=o.x1+i[0]+r.left,c=o.y1+i[1]+r.top;for(;e.mark&&(e=e.mark.group);)l+=e.x||0,c+=e.y||0;return{x:l,y:c,width:s,height:a,left:l,top:c,right:l+s,bottom:c+a}}};function jRt(t,e,n,r){t.element().setAttribute("title",r||"")}class _R{constructor(e){this._el=null,this._bgcolor=null,this._loader=new HFe(e)}initialize(e,n,r,i,o){return this._el=e,this.resize(n,r,i,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)}resize(e,n,r,i){return this._width=e,this._height=n,this._origin=r||[0,0],this._scale=i||1,this}dirty(){}render(e,n){const r=this;return r._call=function(){r._render(e,n)},r._call(),r._call=null,r}_render(){}renderAsync(e,n){const r=this.render(e,n);return this._ready?this._ready.then(()=>r):Promise.resolve(r)}_load(e,n){var r=this,i=r._loader[e](n);if(!r._ready){const o=r._call;r._ready=r._loader.ready().then(s=>{s&&o(),r._ready=null})}return i}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const BRt="keydown",URt="keypress",WRt="keyup",fNe="dragenter",w3="dragleave",dNe="dragover",IX="pointerdown",VRt="pointerup",NN="pointermove",_3="pointerout",hNe="pointerover",LX="mousedown",GRt="mouseup",pNe="mousemove",zN="mouseout",gNe="mouseover",jN="click",HRt="dblclick",qRt="wheel",mNe="mousewheel",BN="touchstart",UN="touchmove",WN="touchend",XRt=[BRt,URt,WRt,fNe,w3,dNe,IX,VRt,NN,_3,hNe,LX,GRt,pNe,zN,gNe,jN,HRt,qRt,mNe,BN,UN,WN],$X=NN,sk=zN,FX=jN;class SR extends Uie{constructor(e,n){super(e,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=XRt,this.pointermove=ame([NN,pNe],[hNe,gNe],[_3,zN]),this.dragover=ame([dNe],[fNe],[w3]),this.pointerout=lme([_3,zN]),this.dragleave=lme([w3])}initialize(e,n,r){return this._canvas=e&&Bie(e,"canvas"),[jN,LX,IX,NN,_3,w3].forEach(i=>sme(this,i)),super.initialize(e,n,r)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(mNe,e)}pointerdown(e){this._down=this._active,this.fire(IX,e)}mousedown(e){this._down=this._active,this.fire(LX,e)}click(e){this._down===this._active&&(this.fire(jN,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(BN,e,!0)}touchmove(e){this.fire(UN,e,!0)}touchend(e){this.fire(WN,e,!0),this._touch=null}fire(e,n,r){const i=r?this._touch:this._active,o=this._handlers[e];if(n.vegaType=e,e===FX&&i&&i.href?this.handleHref(n,i,i.href):(e===$X||e===sk)&&this.handleTooltip(n,i,e!==sk),o)for(let s=0,a=o.length;s=0&&i.splice(o,1),this}pickEvent(e){const n=UB(e,this._canvas),r=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-r[0],n[1]-r[1])}pick(e,n,r,i,o){const s=this.context();return Ec[e.marktype].pick.call(this,s,e,n,r,i,o)}}const YRt=t=>t===BN||t===UN||t===WN?[BN,UN,WN]:[t];function sme(t,e){YRt(e).forEach(n=>QRt(t,n))}function QRt(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?r=>t[e](r):r=>t.fire(e,r)))}function cT(t,e,n){e.forEach(r=>t.fire(r,n))}function ame(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i?cT(this,t,r):((!i||!i.exit)&&cT(this,n,r),this._active=o,cT(this,e,r),cT(this,t,r))}}function lme(t){return function(e){cT(this,t,e),this._active=null}}function KRt(){return typeof window<"u"&&window.devicePixelRatio||1}function ZRt(t,e,n,r,i,o){const s=typeof HTMLElement<"u"&&t instanceof HTMLElement&&t.parentNode!=null,a=t.getContext("2d"),l=s?KRt():i;t.width=e*l,t.height=n*l;for(const c in o)a[c]=o[c];return s&&l!==1&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*r[0],l*r[1]),t}class VN extends _R{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new uo,this._tempb=new uo}initialize(e,n,r,i,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:Bv(1,1,this._options.type),e&&this._canvas&&(qc(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,n,r,i,o)}resize(e,n,r,i){if(super.resize(e,n,r,i),this._canvas)ZRt(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||je("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(e){const n=this._tempb.clear().union(e.bounds);let r=e.mark.group;for(;r;)n.translate(r.x||0,r.y||0),r=r.mark.group;this._dirty.union(n)}_render(e,n){const r=this.context(),i=this._origin,o=this._width,s=this._height,a=this._dirty,l=JRt(i,o,s);r.save();const c=this._redraw||a.empty()?(this._redraw=!1,l.expand(1)):eDt(r,l.intersect(a),i);return this.clear(-i[0],-i[1],o,s),this.draw(r,e,c,n),r.restore(),a.clear(),this}draw(e,n,r,i){if(n.marktype!=="group"&&i!=null&&!i.includes(n.marktype))return;const o=Ec[n.marktype];n.clip&&KMt(e,n),o.draw.call(this,e,n,r,i),n.clip&&e.restore()}clear(e,n,r,i){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(e,n,r,i),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(e,n,r,i))}}const JRt=(t,e,n)=>new uo().set(0,0,e,n).translate(-t[0],-t[1]);function eDt(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-(n[0]%1),-(n[1]%1)),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}class vNe extends Uie{constructor(e,n){super(e,n);const r=this;r._hrefHandler=uV(r,(i,o)=>{o&&o.href&&r.handleHref(i,o,o.href)}),r._tooltipHandler=uV(r,(i,o)=>{r.handleTooltip(i,o,i.type!==sk)})}initialize(e,n,r){let i=this._svg;return i&&(i.removeEventListener(FX,this._hrefHandler),i.removeEventListener($X,this._tooltipHandler),i.removeEventListener(sk,this._tooltipHandler)),this._svg=i=e&&Bie(e,"svg"),i&&(i.addEventListener(FX,this._hrefHandler),i.addEventListener($X,this._tooltipHandler),i.addEventListener(sk,this._tooltipHandler)),super.initialize(e,n,r)}canvas(){return this._svg}on(e,n){const r=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[r],e,n)<0){const s={type:e,handler:n,listener:uV(this,n)};(i[r]||(i[r]=[])).push(s),this._svg&&this._svg.addEventListener(r,s.listener)}return this}off(e,n){const r=this.eventName(e),i=this._handlers[r],o=this._handlerIndex(i,e,n);return o>=0&&(this._svg&&this._svg.removeEventListener(r,i[o].listener),i.splice(o,1)),this}}const uV=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)},yNe="aria-hidden",Wie="aria-label",Vie="role",Gie="aria-roledescription",xNe="graphics-object",Hie="graphics-symbol",bNe=(t,e,n)=>({[Vie]:t,[Gie]:e,[Wie]:n||void 0}),tDt=Wf(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),cme={axis:{desc:"axis",caption:iDt},legend:{desc:"legend",caption:oDt},"title-text":{desc:"title",caption:t=>`Title text '${fme(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${fme(t)}'`}},ume={ariaRole:Vie,ariaRoleDescription:Gie,description:Wie};function wNe(t,e){const n=e.aria===!1;if(t(yNe,n||void 0),n||e.description==null)for(const r in ume)t(ume[r],void 0);else{const r=e.mark.marktype;t(Wie,e.description),t(Vie,e.ariaRole||(r==="group"?xNe:Hie)),t(Gie,e.ariaRoleDescription||`${r} mark`)}}function _Ne(t){return t.aria===!1?{[yNe]:!0}:tDt[t.role]?null:cme[t.role]?rDt(t,cme[t.role]):nDt(t)}function nDt(t){const e=t.marktype,n=e==="group"||e==="text"||t.items.some(r=>r.description!=null&&r.aria!==!1);return bNe(n?xNe:Hie,`${e} mark container`,t.description)}function rDt(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return bNe(e.role||Hie,e.desc,n.description||r(n))}catch{return null}}function fme(t){return pt(t.text).join(" ")}function iDt(t){const e=t.datum,n=t.orient,r=e.title?SNe(t):null,i=t.context,o=i.scales[e.scale].value,s=i.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${GS(a)?"discrete":a} scale with ${$Fe(s,o,t)}`}function oDt(t){const e=t.datum,n=e.title?SNe(t):null,r=`${e.type||""} legend`.trim(),i=e.scales,o=Object.keys(i),s=t.context,a=s.scales[i[o[0]]].value,l=s.dataflow.locale();return aDt(r)+(n?` titled '${n}'`:"")+` for ${sDt(o)} with ${$Fe(l,a,t)}`}function SNe(t){try{return pt($n(t.items).items[0].text).join(" ")}catch{return null}}function sDt(t){return t=t.map(e=>e+(e==="fill"||e==="stroke"?" color":"")),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+$n(t)}function aDt(t){return t.length?t[0].toUpperCase()+t.slice(1):t}const CNe=t=>(t+"").replace(/&/g,"&").replace(//g,">"),lDt=t=>CNe(t).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function qie(){let t="",e="",n="";const r=[],i=()=>e=n="",o=l=>{e&&(t+=`${e}>${n}`,i()),r.push(l)},s=(l,c)=>(c!=null&&(e+=` ${l}="${lDt(c)}"`),a),a={open(l){o(l),e="<"+l;for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f${n}`:"/>"):t+=``,i(),a},attr:s,text:l=>(n+=CNe(l),a),toString:()=>t};return a}const ONe=t=>ENe(qie(),t)+"";function ENe(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,r=n.length;for(let i=0;i{u.dirty=n})),!i.zdirty){if(r.exit){s.nested&&i.items.length?(c=i.items[0],c._svg&&this._update(s,c._svg,c)):r._svg&&(c=r._svg.parentNode,c&&c.removeChild(r._svg)),r._svg=null;continue}r=s.nested?i.items[0]:r,r._update!==n&&(!r._svg||!r._svg.ownerSVGElement?(this._dirtyAll=!1,hme(r,n)):this._update(s,r._svg,r),r._update=n)}return!this._dirtyAll}mark(e,n,r,i){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Ec[s],l=n.interactive===!1?"none":null,c=a.tag==="g",u=pme(n,e,r,"g",o);if(s!=="group"&&i!=null&&!i.includes(s))return qc(u,0),n._svg;u.setAttribute("class",uNe(n));const f=_Ne(n);for(const g in f)pa(u,g,f[g]);c||pa(u,"pointer-events",l),pa(u,"clip-path",n.clip?Oie(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),v=pme(g,u,d,a.tag,o);m&&(this._update(a,v,g),c&&fDt(this,v,g,i)),d=v,++h};return a.nested?n.items.length&&p(n.items[0]):Gf(n,p),qc(u,h),u}_update(e,n,r){Jp=n,js=n.__values__,wNe(ak,r),e.attr(ak,r,this);const i=hDt[e.type];i&&i.call(this,e,n,r),Jp&&this.style(Jp,r)}style(e,n){if(n!=null){for(const r in GN){let i=r==="font"?wR(n):n[r];if(i===js[r])continue;const o=GN[r];i==null?e.removeAttribute(o):(_ie(i)&&(i=NFe(i,this._defs.gradient,kNe())),e.setAttribute(o,i+"")),js[r]=i}for(const r in HN)S3(e,HN[r],n[r])}}defs(){const e=this._svg,n=this._defs;let r=n.el,i=0;for(const o in n.gradient)r||(n.el=r=xo(e,t2+1,"defs",vo)),i=cDt(r,n.gradient[o],i);for(const o in n.clipping)r||(n.el=r=xo(e,t2+1,"defs",vo)),i=uDt(r,n.clipping[o],i);r&&(i===0?(e.removeChild(r),n.el=null):qc(r,i))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function hme(t,e){for(;t&&t.dirty!==e;t=t.mark.group)if(t.dirty=e,t.mark&&t.mark.dirty!==e)t.mark.dirty=e;else return}function cDt(t,e,n){let r,i,o;if(e.gradient==="radial"){let s=xo(t,n++,"pattern",vo);pv(s,{id:IN+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=xo(s,0,"rect",vo),pv(s,{width:1,height:1,fill:`url(${kNe()}#${e.id})`}),t=xo(t,n++,"radialGradient",vo),pv(t,{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else t=xo(t,n++,"linearGradient",vo),pv(t,{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(r=0,i=e.stops.length;r{i=t.mark(e,s,i,r),++o}),qc(e,1+o)}function pme(t,e,n,r,i){let o=t._svg,s;if(!o&&(s=e.ownerDocument,o=hv(s,r,vo),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},r==="g"))){const a=hv(s,"path",vo);o.appendChild(a),a.__data__=t;const l=hv(s,"g",vo);o.appendChild(l),l.__data__=t;const c=hv(s,"path",vo);o.appendChild(c),c.__data__=t,c.__values__={fill:"default"}}return(o.ownerSVGElement!==i||dDt(o,n))&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}function dDt(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}let Jp=null,js=null;const hDt={group(t,e,n){const r=Jp=e.childNodes[2];js=r.__values__,t.foreground(ak,n,this),js=e.__values__,Jp=e.childNodes[1],t.content(ak,n,this);const i=Jp=e.childNodes[0];t.background(ak,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==js.events&&(pa(r,"pointer-events",o),pa(i,"pointer-events",o),js.events=o),n.strokeForeground&&n.stroke){const s=n.fill;pa(r,"display",null),this.style(i,n),pa(i,"stroke",null),s&&(n.fill=null),js=r.__values__,this.style(r,n),s&&(n.fill=s),Jp=null}else pa(r,"display","none")},image(t,e,n){n.smooth===!1?(S3(e,"image-rendering","optimizeSpeed"),S3(e,"image-rendering","pixelated")):S3(e,"image-rendering",null)},text(t,e,n){const r=bR(n);let i,o,s,a;We(r)?(o=r.map(l=>uy(n,l)),i=o.join(` -`),i!==js.text&&(qc(e,0),s=e.ownerDocument,a=cy(n),o.forEach((l,c)=>{const u=hv(s,"tspan",vo);u.__data__=n,u.textContent=l,c&&(u.setAttribute("x",0),u.setAttribute("dy",a)),e.appendChild(u)}),js.text=i)):(o=uy(n,r),o!==js.text&&(e.textContent=o,js.text=o)),pa(e,"font-family",wR(n)),pa(e,"font-size",Gh(n)+"px"),pa(e,"font-style",n.fontStyle),pa(e,"font-variant",n.fontVariant),pa(e,"font-weight",n.fontWeight)}};function ak(t,e,n){e!==js[t]&&(n?pDt(Jp,t,e,n):pa(Jp,t,e),js[t]=e)}function S3(t,e,n){n!==js[e]&&(n==null?t.style.removeProperty(e):t.style.setProperty(e,n+""),js[e]=n)}function pv(t,e){for(const n in e)pa(t,n,e[n])}function pa(t,e,n){n!=null?t.setAttribute(e,n):t.removeAttribute(e)}function pDt(t,e,n,r){n!=null?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}function kNe(){let t;return typeof window>"u"?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}class ANe extends _R{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const n=qie();n.open("svg",cn({},DA,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const r=this._bgcolor;return r&&r!=="transparent"&&r!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:r}).close(),n.open("g",TNe,{transform:"translate("+this._origin+")"}),this.mark(n,e),n.close(),this.defs(n),this._text=n.close()+"",this}mark(e,n){const r=Ec[n.marktype],i=r.tag,o=[wNe,r.attr];e.open("g",{class:uNe(n),"clip-path":n.clip?Oie(this,n,n.group):null},_Ne(n),{"pointer-events":i!=="g"&&n.interactive===!1?"none":null});const s=a=>{const l=this.href(a);if(l&&e.open("a",l),e.open(i,this.attr(n,a,o,i!=="g"?i:null)),i==="text"){const c=bR(a);if(We(c)){const u={x:0,dy:cy(a)};for(let f=0;fthis.mark(e,d)),e.close(),c&&f?(u&&(a.fill=null),a.stroke=f,e.open("path",this.attr(n,a,r.foreground,"bgrect")).close(),u&&(a.fill=u)):e.open("path",this.attr(n,a,r.foreground,"bgfore")).close()}e.close(),l&&e.close()};return r.nested?n.items&&n.items.length&&s(n.items[0]):Gf(n,s),e.close()}href(e){const n=e.href;let r;if(n){if(r=this._hrefs&&this._hrefs[n])return r;this.sanitizeURL(n).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[n]=i})}return null}attr(e,n,r,i){const o={},s=(a,l,c,u)=>{o[u||a]=l};return Array.isArray(r)?r.forEach(a=>a(s,n,this)):r(s,n,this),i&&gDt(o,n,e,i,this._defs),o}defs(e){const n=this._defs.gradient,r=this._defs.clipping;if(Object.keys(n).length+Object.keys(r).length!==0){e.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(e.open("pattern",{id:IN+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),e.close(),e.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):e.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let l=0;l!ff.svgMarkTypes.includes(o));this._svgRenderer.render(e,ff.svgMarkTypes),this._canvasRenderer.render(e,i)}resize(e,n,r,i){return super.resize(e,n,r,i),this._svgRenderer.resize(e,n,r,i),this._canvasRenderer.resize(e,n,r,i),this}background(e){return ff.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}class PNe extends SR{constructor(e,n){super(e,n)}initialize(e,n,r){const i=xo(xo(e,0,"div"),ff.svgOnTop?0:1,"div");return super.initialize(i,n,r)}}const MNe="canvas",RNe="hybrid",DNe="png",INe="svg",LNe="none",gv={Canvas:MNe,PNG:DNe,SVG:INe,Hybrid:RNe,None:LNe},vb={};vb[MNe]=vb[DNe]={renderer:VN,headless:VN,handler:SR};vb[INe]={renderer:Xie,headless:ANe,handler:vNe};vb[RNe]={renderer:NX,headless:NX,handler:PNe};vb[LNe]={};function WB(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(vb[t]=e,this):vb[t]}function $Ne(t,e,n){const r=[],i=new uo().union(e),o=t.marktype;return o?FNe(t,i,n,r):o==="group"?NNe(t,i,n,r):je("Intersect scene must be mark node or group item.")}function FNe(t,e,n,r){if(vDt(t,e,n)){const i=t.items,o=t.marktype,s=i.length;let a=0;if(o==="group")for(;a=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!Yie(t[i],e[i],i))return!1;return typeof t==typeof e}function bDt(){GFe(),VPt()}const YS="top",Sf="left",Cf="right",fy="bottom",wDt="top-left",_Dt="top-right",SDt="bottom-left",CDt="bottom-right",Qie="start",zX="middle",ma="end",ODt="x",EDt="y",VB="group",Kie="axis",Zie="title",TDt="frame",kDt="scope",Jie="legend",UNe="row-header",WNe="row-footer",VNe="row-title",GNe="column-header",HNe="column-footer",qNe="column-title",ADt="padding",PDt="symbol",XNe="fit",YNe="fit-x",QNe="fit-y",MDt="pad",eoe="none",FI="all",jX="each",toe="flush",mv="column",vv="row";function KNe(t){De.call(this,null,t)}it(KNe,De,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=Ec[i],s=o.bound;let a=r.bounds,l;if(o.nested)r.items.length&&n.dirty(r.items[0]),a=NI(r,s),r.items.forEach(c=>{c.bounds.clear().union(a)});else if(i===VB||t.modified())switch(e.visit(e.MOD,c=>n.dirty(c)),a.clear(),r.items.forEach(c=>a.union(NI(c,s))),r.role){case Kie:case Jie:case Zie:e.reflow()}else l=e.changed(e.REM),e.visit(e.ADD,c=>{a.union(NI(c,s))}),e.visit(e.MOD,c=>{l=l||a.alignsWith(c.bounds),n.dirty(c),a.union(NI(c,s))}),l&&(a.clear(),r.items.forEach(c=>a.union(c.bounds)));return jNe(r),e.modifies("bounds")}});function NI(t,e,n){return e(t.bounds.clear(),t,n)}const gme=":vega_identifier:";function noe(t){De.call(this,0,t)}noe.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};it(noe,De,{transform(t,e){const n=RDt(e.dataflow),r=t.as;let i=n.value;return e.visit(e.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),e}});function RDt(t){return t._signals[gme]||(t._signals[gme]=t.add(0))}function ZNe(t){De.call(this,null,t)}it(ZNe,De,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,DDt(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const r=n.marktype===VB?LB:IB;return e.visit(e.ADD,i=>r.call(i,n)),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});function DDt(t){const e=t.groups,n=t.parent;return e&&e.size===1?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}function JNe(t){De.call(this,null,t)}const mme={parity:t=>t.filter((e,n)=>n%2?e.opacity=0:1),greedy:(t,e)=>{let n;return t.filter((r,i)=>!i||!e5e(n.bounds,r.bounds,e)?(n=r,1):r.opacity=0)}},e5e=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),vme=(t,e)=>{for(var n=1,r=t.length,i=t[0].bounds,o;n{const e=t.bounds;return e.width()>1&&e.height()>1},LDt=(t,e,n)=>{var r=t.range(),i=new uo;return e===YS||e===fy?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},yme=t=>(t.forEach(e=>e.opacity=1),t),xme=(t,e)=>t.reflow(e.modified()).modifies("opacity");it(JNe,De,{transform(t,e){const n=mme[t.method]||mme.parity,r=t.separation||0;let i=e.materialize(e.SOURCE).source,o,s;if(!i||!i.length)return;if(!t.method)return t.modified("method")&&(yme(i),e=xme(e,t)),e;if(i=i.filter(IDt),!i.length)return;if(t.sort&&(i=i.slice().sort(t.sort)),o=yme(i),e=xme(e,t),o.length>=3&&vme(o,r)){do o=n(o,r);while(o.length>=3&&vme(o,r));o.length<3&&!$n(i).opacity&&(o.length>1&&($n(o).opacity=0),$n(i).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(s=LDt(t.boundScale,t.boundOrient,+t.boundTolerance),i.forEach(l=>{s(l)||(l.opacity=0)}));const a=o[0].mark.bounds.clear();return i.forEach(l=>{l.opacity&&a.union(l.bounds)}),e}});function t5e(t){De.call(this,null,t)}it(t5e,De,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,r=>n.dirty(r)),e.fields&&e.fields.zindex){const r=e.source&&e.source[0];r&&(r.mark.zdirty=!0)}}});const Ns=new uo;function h_(t,e,n){return t[e]===n?0:(t[e]=n,1)}function $Dt(t){var e=t.items[0].orient;return e===Sf||e===Cf}function FDt(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}function NDt(t,e,n,r){var i=e.items[0],o=i.datum,s=i.translate!=null?i.translate:.5,a=i.orient,l=FDt(o),c=i.range,u=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[l[2]].items[0],g=i.titlePadding,m=i.bounds,v=p&&Nie(p),y=0,x=0,b,w;switch(Ns.clear().union(m),m.clear(),(b=l[0])>-1&&m.union(i.items[b].bounds),(b=l[1])>-1&&m.union(i.items[b].bounds),a){case YS:y=f||0,x=-u,w=Math.max(d,Math.min(h,-m.y1)),m.add(0,-w).add(c,0),p&&zI(t,p,w,g,v,0,-1,m);break;case Sf:y=-u,x=f||0,w=Math.max(d,Math.min(h,-m.x1)),m.add(-w,0).add(0,c),p&&zI(t,p,w,g,v,1,-1,m);break;case Cf:y=n+u,x=f||0,w=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(w,c),p&&zI(t,p,w,g,v,1,1,m);break;case fy:y=f||0,x=r+u,w=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(c,w),p&&zI(t,p,w,g,0,0,1,m);break;default:y=i.x,x=i.y}return Yg(m.translate(y,x),i),h_(i,"x",y+s)|h_(i,"y",x+s)&&(i.bounds=Ns,t.dirty(i),i.bounds=m,t.dirty(i)),i.mark.bounds.clear().union(m)}function zI(t,e,n,r,i,o,s,a){const l=e.bounds;if(e.auto){const c=s*(n+i+r);let u=0,f=0;t.dirty(e),o?u=(e.x||0)-(e.x=c):f=(e.y||0)-(e.y=c),e.mark.bounds.clear().union(l.translate(-u,-f)),t.dirty(e)}a.union(l)}const bme=(t,e)=>Math.floor(Math.min(t,e)),wme=(t,e)=>Math.ceil(Math.max(t,e));function zDt(t){var e=t.items,n=e.length,r=0,i,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(S=0;S0&&(x[S]+=T/2);if(a&&fi(n.center,vv)&&u!==1)for(S=0;S0&&(b[S]+=M/2);for(S=0;Si&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),g+=o,y=0,b=e.length;y=0&&(S=n[x])==null;x-=d);a?(O=h==null?S.x:Math.round(S.bounds.x1+h*S.bounds.width()),k=g):(O=g,k=h==null?S.y:Math.round(S.bounds.y1+h*S.bounds.height())),w.union(_.bounds.translate(O-(_.x||0),k-(_.y||0))),_.x=O,_.y=k,t.dirty(_),m=s(m,w[c])}return m}function Sme(t,e,n,r,i,o){if(e){t.dirty(e);var s=n,a=n;r?s=Math.round(i.x1+o*i.width()):a=Math.round(i.y1+o*i.height()),e.bounds.translate(s-(e.x||0),a-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=s,e.y=a,t.dirty(e)}}function GDt(t,e){const n=t[e]||{};return(r,i)=>n[r]!=null?n[r]:t[r]!=null?t[r]:i}function HDt(t,e){let n=-1/0;return t.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:e}function qDt(t,e,n,r,i,o,s){const a=GDt(n,e),l=HDt(t,a("offset",0)),c=a("anchor",Qie),u=c===ma?1:c===zX?.5:0,f={align:jX,bounds:a("bounds",toe),columns:a("direction")==="vertical"?1:t.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(e){case Sf:f.anchor={x:Math.floor(r.x1)-l,column:ma,y:u*(s||r.height()+2*r.y1),row:c};break;case Cf:f.anchor={x:Math.ceil(r.x2)+l,y:u*(s||r.height()+2*r.y1),row:c};break;case YS:f.anchor={y:Math.floor(i.y1)-l,row:ma,x:u*(o||i.width()+2*i.x1),column:c};break;case fy:f.anchor={y:Math.ceil(i.y2)+l,x:u*(o||i.width()+2*i.x1),column:c};break;case wDt:f.anchor={x:l,y:l};break;case _Dt:f.anchor={x:o-l,y:l,column:ma};break;case SDt:f.anchor={x:l,y:s-l,row:ma};break;case CDt:f.anchor={x:o-l,y:s-l,column:ma,row:ma};break}return f}function XDt(t,e){var n=e.items[0],r=n.datum,i=n.orient,o=n.bounds,s=n.x,a=n.y,l,c;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),QDt(t,n,n.items[0].items[0]),o=YDt(n,o),l=2*n.padding,c=2*n.padding,o.empty()||(l=Math.ceil(o.width()+l),c=Math.ceil(o.height()+c)),r.type===PDt&&KDt(n.items[0].items[0].items[0].items),i!==eoe&&(n.x=s=0,n.y=a=0),n.width=l,n.height=c,Yg(o.set(s,a,s+l,a+c),n),n.mark.bounds.clear().union(o),n}function YDt(t,e){return t.items.forEach(n=>e.union(n.bounds)),e.x1=t.padding,e.y1=t.padding,e}function QDt(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(!e.datum.title)(i||o)&&n2(t,n,i,o);else{var s=e.items[1].items[0],a=s.anchor,l=e.titlePadding||0,c=r-s.x,u=r-s.y;switch(s.orient){case Sf:i+=Math.ceil(s.bounds.width())+l;break;case Cf:case fy:break;default:o+=s.bounds.height()+l}switch((i||o)&&n2(t,n,i,o),s.orient){case Sf:u+=ew(e,n,s,a,1,1);break;case Cf:c+=ew(e,n,s,ma,0,0)+l,u+=ew(e,n,s,a,1,1);break;case fy:c+=ew(e,n,s,a,0,0),u+=ew(e,n,s,ma,-1,0,1)+l;break;default:c+=ew(e,n,s,a,0,0)}(c||u)&&n2(t,s,c,u),(c=Math.round(s.bounds.x1-r))<0&&(n2(t,n,-c,0),n2(t,s,-c,0))}}function ew(t,e,n,r,i,o,s){const a=t.datum.type!=="symbol",l=n.datum.vgrad,c=a&&(o||!l)&&!s?e.items[0]:e,u=c.bounds[i?"y2":"x2"]-t.padding,f=l&&o?u:0,d=l&&o?0:u,h=i<=0?0:Nie(n);return Math.round(r===Qie?f:r===ma?d-h:.5*(u-h))}function n2(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function KDt(t){const e=t.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});t.forEach(n=>{n.width=e[n.column],n.height=n.bounds.y2-n.y})}function ZDt(t,e,n,r,i){var o=e.items[0],s=o.frame,a=o.orient,l=o.anchor,c=o.offset,u=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===Sf||a===Cf?r:n,p=0,g=0,m=0,v=0,y=0,x;if(s!==VB?a===Sf?(p=i.y2,h=i.y1):a===Cf?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):a===Sf&&(p=r,h=0),x=l===Qie?p:l===ma?h:(p+h)/2,d&&d.text){switch(a){case YS:case fy:y=f.bounds.height()+u;break;case Sf:v=f.bounds.width()+u;break;case Cf:v=-f.bounds.width()-u;break}Ns.clear().union(d.bounds),Ns.translate(v-(d.x||0),y-(d.y||0)),h_(d,"x",v)|h_(d,"y",y)&&(t.dirty(d),d.bounds.clear().union(Ns),d.mark.bounds.clear().union(Ns),t.dirty(d)),Ns.clear().union(d.bounds)}else Ns.clear();switch(Ns.union(f.bounds),a){case YS:g=x,m=i.y1-Ns.height()-c;break;case Sf:g=i.x1-Ns.width()-c,m=x;break;case Cf:g=i.x2+Ns.width()+c,m=x;break;case fy:g=x,m=i.y2+c;break;default:g=o.x,m=o.y}return h_(o,"x",g)|h_(o,"y",m)&&(Ns.translate(g,m),t.dirty(o),o.bounds.clear().union(Ns),e.bounds.clear().union(Ns),t.dirty(o)),o.bounds}function r5e(t){De.call(this,null,t)}it(r5e,De,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach(r=>{t.layout&&UDt(n,r,t.layout),eIt(n,r,t)}),JDt(t.mark.group)?e.reflow():e}});function JDt(t){return t&&t.mark.role!=="legend-entry"}function eIt(t,e,n){var r=e.items,i=Math.max(0,e.width||0),o=Math.max(0,e.height||0),s=new uo().set(0,0,i,o),a=s.clone(),l=s.clone(),c=[],u,f,d,h,p,g;for(p=0,g=r.length;p{d=v.orient||Cf,d!==eoe&&(m[d]||(m[d]=[])).push(v)});for(const v in m){const y=m[v];n5e(t,y,qDt(y,v,n.legends,a,l,i,o))}c.forEach(v=>{const y=v.bounds;if(y.equals(v._bounds)||(v.bounds=v._bounds,t.dirty(v),v.bounds=y,t.dirty(v)),n.autosize&&(n.autosize.type===XNe||n.autosize.type===YNe||n.autosize.type===QNe))switch(v.orient){case Sf:case Cf:s.add(y.x1,0).add(y.x2,0);break;case YS:case fy:s.add(0,y.y1).add(0,y.y2)}else s.union(y)})}s.union(a).union(l),u&&s.union(ZDt(t,u,i,o,s)),e.clip&&s.set(0,0,e.width||0,e.height||0),tIt(t,e,s,n)}function tIt(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let s=t._width,a=t._height,l=Math.max(0,e.width||0),c=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-u));if(i.contains===ADt){const p=t.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===eoe?(c=0,f=0,l=s,u=a):o===XNe?(l=Math.max(0,s-c-d),u=Math.max(0,a-f-h)):o===YNe?(l=Math.max(0,s-c-d),a=u+f+h):o===QNe?(s=l+c+d,u=Math.max(0,a-f-h)):o===MDt&&(s=l+c+d,a=u+f+h),t._resizeView(s,a,l,u,[c,f],i.resize)}const nIt=Object.freeze(Object.defineProperty({__proto__:null,bound:KNe,identifier:noe,mark:ZNe,overlap:JNe,render:t5e,viewlayout:r5e},Symbol.toStringTag,{value:"Module"}));function i5e(t){De.call(this,null,t)}it(i5e,De,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,s=t.count==null?t.values?t.values.length:10:t.count,a=bie(o,s,t.minstep),l=t.format||MFe(n,o,a,t.formatSpecifier,t.formatType,!!t.values),c=t.values?PFe(o,t.values,a):wie(o,a);return i&&(r.rem=i),i=c.map((u,f)=>cr({index:f/(c.length-1||1),value:u,label:l(u)})),t.extra&&i.length&&i.push(cr({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function o5e(t){De.call(this,null,t)}function rIt(){return cr({})}function iIt(t){const e=wO().test(n=>n.exit);return e.lookup=n=>e.get(t(n)),e}it(o5e,De,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||rIt,o=t.key||jt,s=this.value;return We(r.encode)&&(r.encode=null),s&&(t.modified("key")||e.modified(o))&&je("DataJoin does not support modified key function or fields."),s||(e=e.addAll(),this.value=s=iIt(o)),e.visit(e.ADD,a=>{const l=o(a);let c=s.get(l);c?c.exit?(s.empty--,r.add.push(c)):r.mod.push(c):(c=i(a),s.set(l,c),r.add.push(c)),c.datum=a,c.exit=!1}),e.visit(e.MOD,a=>{const l=o(a),c=s.get(l);c&&(c.datum=a,r.mod.push(c))}),e.visit(e.REM,a=>{const l=o(a),c=s.get(l);a===c.datum&&!c.exit&&(r.rem.push(c),c.exit=!0,++s.empty)}),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),r}});function s5e(t){De.call(this,null,t)}it(s5e,De,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(We(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return e.StopPropagation;var s=o==="enter",a=i.update||Rm,l=i.enter||Rm,c=i.exit||Rm,u=(o&&!s?i[o]:a)||Rm;if(e.changed(e.ADD)&&(e.visit(e.ADD,f=>{l(f,t),a(f,t)}),n.modifies(l.output),n.modifies(a.output),u!==Rm&&u!==a&&(e.visit(e.ADD,f=>{u(f,t)}),n.modifies(u.output))),e.changed(e.REM)&&c!==Rm&&(e.visit(e.REM,f=>{c(f,t)}),n.modifies(c.output)),s||u!==Rm){const f=e.MOD|(t.modified()?e.REFLOW:0);s?(e.visit(f,d=>{const h=l(d,t)||r;(u(d,t)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):e.visit(f,d=>{(u(d,t)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)}return n.changed()?n:e.StopPropagation}});function a5e(t){De.call(this,[],t)}it(a5e,De,{transform(t,e){if(this.value!=null&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.type||g3,s=t.scale,a=+t.limit,l=bie(s,t.count==null?5:t.count,t.minstep),c=!!t.values||o===g3,u=t.format||LFe(n,s,l,o,t.formatSpecifier,t.formatType,c),f=t.values||IFe(s,l),d,h,p,g,m;return i&&(r.rem=i),o===g3?(a&&f.length>a?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,a-1),m=!0):i=f,fn(p=t.size)?(!t.values&&s(i[0])===0&&(i=i.slice(1)),g=i.reduce((v,y)=>Math.max(v,p(y,t)),0)):p=ra(g=p||8),i=i.map((v,y)=>cr({index:y,label:u(v,y,i),value:v,offset:g,size:p(v,t)})),m&&(m=f[i.length],i.push(cr({index:i.length,label:`…${f.length-i.length} entries`,value:m,offset:g,size:p(m,t)})))):o===MPt?(d=s.domain(),h=TFe(s,d[0],$n(d)),f.length<3&&!t.values&&d[0]!==$n(d)&&(f=[d[0],$n(d)]),i=f.map((v,y)=>cr({index:y,label:u(v,y,f),value:v,perc:h(v)}))):(p=f.length-1,h=UPt(s),i=f.map((v,y)=>cr({index:y,label:u(v,y,f),value:v,perc:y?h(v):0,perc2:y===p?1:h(f[y+1])}))),r.source=i,r.add=i,this.value=i,r}});const oIt=t=>t.source.x,sIt=t=>t.source.y,aIt=t=>t.target.x,lIt=t=>t.target.y;function roe(t){De.call(this,{},t)}roe.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};it(roe,De,{transform(t,e){var n=t.sourceX||oIt,r=t.sourceY||sIt,i=t.targetX||aIt,o=t.targetY||lIt,s=t.as||"path",a=t.orient||"vertical",l=t.shape||"line",c=Cme.get(l+"-"+a)||Cme.get(l);return c||je("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,u=>{u[s]=c(n(u),r(u),i(u),o(u))}),e.reflow(t.modified()).modifies(s)}});const l5e=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,cIt=(t,e,n,r)=>l5e(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),c5e=(t,e,n,r)=>{var i=n-t,o=r-e,s=Math.hypot(i,o)/2,a=180*Math.atan2(o,i)/Math.PI;return"M"+t+","+e+"A"+s+","+s+" "+a+" 0 1 "+n+","+r},uIt=(t,e,n,r)=>c5e(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),u5e=(t,e,n,r)=>{const i=n-t,o=r-e,s=.2*(i+o),a=.2*(o-i);return"M"+t+","+e+"C"+(t+s)+","+(e+a)+" "+(n+a)+","+(r-s)+" "+n+","+r},fIt=(t,e,n,r)=>u5e(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),dIt=(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,hIt=(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,pIt=(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n),l=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+(l?1:0)+" "+e*s+","+e*a+"L"+r*s+","+r*a},gIt=(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},mIt=(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},vIt=(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n),l=(e+r)/2;return"M"+e*i+","+e*o+"C"+l*i+","+l*o+" "+l*s+","+l*a+" "+r*s+","+r*a},Cme=wO({line:l5e,"line-radial":cIt,arc:c5e,"arc-radial":uIt,curve:u5e,"curve-radial":fIt,"orthogonal-horizontal":dIt,"orthogonal-vertical":hIt,"orthogonal-radial":pIt,"diagonal-horizontal":gIt,"diagonal-vertical":mIt,"diagonal-radial":vIt});function ioe(t){De.call(this,null,t)}ioe.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};it(ioe,De,{transform(t,e){var n=t.as||["startAngle","endAngle"],r=n[0],i=n[1],o=t.field||yO,s=t.startAngle||0,a=t.endAngle!=null?t.endAngle:2*Math.PI,l=e.source,c=l.map(o),u=c.length,f=s,d=(a-s)/bLe(c),h=sl(u),p,g,m;for(t.sort&&h.sort((v,y)=>c[v]-c[y]),p=0;p-1)return r;var i=e.domain,o=t.type,s=e.zero||e.zero===void 0&&xIt(t),a,l;if(!i)return 0;if((s||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(a=(i=i.slice()).length-1||1,s&&(i[0]>0&&(i[0]=0),i[a]<0&&(i[a]=0)),e.domainMin!=null&&(i[0]=e.domainMin),e.domainMax!=null&&(i[a]=e.domainMax),e.domainMid!=null)){l=e.domainMid;const c=l>i[a]?a+1:li+(o<0?-1:o>0?1:0),0));r!==e.length&&n.warn("Log scale domain includes zero: "+rt(e))}return e}function EIt(t,e,n){let r=e.bins;if(r&&!We(r)){const i=t.domain(),o=i[0],s=$n(i),a=r.step;let l=r.start==null?o:r.start,c=r.stop==null?s:r.stop;a||je("Scale bins parameter missing step property."),ls&&(c=a*Math.floor(s/a)),r=sl(l,c+a/2,a)}return r?t.bins=r:t.bins&&delete t.bins,t.type===pie&&(r?!e.domain&&!e.domainRaw&&(t.domain(r),n=r.length):t.bins=t.domain()),n}function TIt(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(e.rangeStep!=null)o=kIt(r,e,n);else if(e.scheme&&(o=AIt(r,e,n),fn(o))){if(t.interpolator)return t.interpolator(o);je(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&SFe(r))return t.interpolator(RB(BX(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(yie(e.interpolate,e.interpolateGamma)):fn(t.round)?t.round(i):fn(t.rangeRound)&&t.interpolate(i?cR:Hy),o&&t.range(BX(o,e.reverse))}function kIt(t,e,n){t!==mFe&&t!==EX&&je("Only band and point scales support rangeStep.");var r=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,i=t===EX?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*die(n,i,r)]}function AIt(t,e,n){var r=e.schemeExtent,i,o;return We(e.scheme)?o=RB(e.scheme,e.interpolate,e.interpolateGamma):(i=e.scheme.toLowerCase(),o=xie(i),o||je(`Unrecognized scheme name: ${e.scheme}`)),n=t===MB?n+1:t===pie?n-1:t===VS||t===PB?+e.schemeCount||yIt:n,SFe(t)?Ome(o,r,e.reverse):fn(o)?EFe(Ome(o,r),n):t===hie?o:o.slice(0,n)}function Ome(t,e,n){return fn(t)&&(e||n)?OFe(t,BX(e||[0,1],n)):t}function BX(t,e){return e?t.slice().reverse():t}function p5e(t){De.call(this,null,t)}it(p5e,De,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(d1(t.sort)),this.modified(n),e}});const Eme="zero",g5e="center",m5e="normalize",v5e=["y0","y1"];function ooe(t){De.call(this,null,t)}ooe.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:Eme,values:[Eme,g5e,m5e]},{name:"as",type:"string",array:!0,length:2,default:v5e}]};it(ooe,De,{transform(t,e){var n=t.as||v5e,r=n[0],i=n[1],o=d1(t.sort),s=t.field||yO,a=t.offset===g5e?PIt:t.offset===m5e?MIt:RIt,l,c,u,f;for(l=DIt(e.source,t.groupby,o,s),c=0,u=l.length,f=l.max;cg(u),s,a,l,c,u,f,d,h,p;if(e==null)i.push(t.slice());else for(s={},a=0,l=t.length;ap&&(p=h),n&&d.sort(n)}return i.max=p,i}const IIt=Object.freeze(Object.defineProperty({__proto__:null,axisticks:i5e,datajoin:o5e,encode:s5e,legendentries:a5e,linkpath:roe,pie:ioe,scale:d5e,sortitems:p5e,stack:ooe},Symbol.toStringTag,{value:"Module"}));var Ut=1e-6,qN=1e-12,xn=Math.PI,Li=xn/2,XN=xn/4,Pa=xn*2,Ui=180/xn,vn=xn/180,Ln=Math.abs,MO=Math.atan,Au=Math.atan2,Vt=Math.cos,BI=Math.ceil,y5e=Math.exp,UX=Math.hypot,YN=Math.log,dV=Math.pow,Bt=Math.sin,iu=Math.sign||function(t){return t>0?1:t<0?-1:0},Ma=Math.sqrt,soe=Math.tan;function x5e(t){return t>1?0:t<-1?xn:Math.acos(t)}function Sl(t){return t>1?Li:t<-1?-Li:Math.asin(t)}function ps(){}function QN(t,e){t&&kme.hasOwnProperty(t.type)&&kme[t.type](t,e)}var Tme={Feature:function(t,e){QN(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Vt(e),s=Bt(e),a=HX*s,l=GX*o+a*Vt(i),c=a*r*Bt(i);KN.add(Au(c,l)),VX=t,GX=o,HX=s}function NIt(t){return ZN=new Ea,Vp(t,Rh),ZN*2}function JN(t){return[Au(t[1],t[0]),Sl(t[2])]}function yb(t){var e=t[0],n=t[1],r=Vt(n);return[r*Vt(e),r*Bt(e),Bt(n)]}function UI(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function QS(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function hV(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function WI(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function e5(t){var e=Ma(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var bi,Qa,Ri,Kl,V0,S5e,C5e,U_,lk,Ym,Ng,Np={point:qX,lineStart:Pme,lineEnd:Mme,polygonStart:function(){Np.point=E5e,Np.lineStart=zIt,Np.lineEnd=jIt,lk=new Ea,Rh.polygonStart()},polygonEnd:function(){Rh.polygonEnd(),Np.point=qX,Np.lineStart=Pme,Np.lineEnd=Mme,KN<0?(bi=-(Ri=180),Qa=-(Kl=90)):lk>Ut?Kl=90:lk<-Ut&&(Qa=-90),Ng[0]=bi,Ng[1]=Ri},sphere:function(){bi=-(Ri=180),Qa=-(Kl=90)}};function qX(t,e){Ym.push(Ng=[bi=t,Ri=t]),eKl&&(Kl=e)}function O5e(t,e){var n=yb([t*vn,e*vn]);if(U_){var r=QS(U_,n),i=[r[1],-r[0],0],o=QS(i,r);e5(o),o=JN(o);var s=t-V0,a=s>0?1:-1,l=o[0]*Ui*a,c,u=Ln(s)>180;u^(a*V0Kl&&(Kl=c)):(l=(l+360)%360-180,u^(a*V0Kl&&(Kl=e))),u?tXl(bi,Ri)&&(Ri=t):Xl(t,Ri)>Xl(bi,Ri)&&(bi=t):Ri>=bi?(tRi&&(Ri=t)):t>V0?Xl(bi,t)>Xl(bi,Ri)&&(Ri=t):Xl(t,Ri)>Xl(bi,Ri)&&(bi=t)}else Ym.push(Ng=[bi=t,Ri=t]);eKl&&(Kl=e),U_=n,V0=t}function Pme(){Np.point=O5e}function Mme(){Ng[0]=bi,Ng[1]=Ri,Np.point=qX,U_=null}function E5e(t,e){if(U_){var n=t-V0;lk.add(Ln(n)>180?n+(n>0?360:-360):n)}else S5e=t,C5e=e;Rh.point(t,e),O5e(t,e)}function zIt(){Rh.lineStart()}function jIt(){E5e(S5e,C5e),Rh.lineEnd(),Ln(lk)>Ut&&(bi=-(Ri=180)),Ng[0]=bi,Ng[1]=Ri,U_=null}function Xl(t,e){return(e-=t)<0?e+360:e}function BIt(t,e){return t[0]-e[0]}function Rme(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eXl(r[0],r[1])&&(r[1]=i[1]),Xl(i[0],r[1])>Xl(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(s=-1/0,n=o.length-1,e=0,r=o[n];e<=n;r=i,++e)i=o[e],(a=Xl(r[1],i[0]))>s&&(s=a,bi=i[0],Ri=r[1])}return Ym=Ng=null,bi===1/0||Qa===1/0?[[NaN,NaN],[NaN,NaN]]:[[bi,Qa],[Ri,Kl]]}var uT,t5,n5,r5,i5,o5,s5,a5,XX,YX,QX,T5e,k5e,ya,xa,ba,Of={sphere:ps,point:aoe,lineStart:Dme,lineEnd:Ime,polygonStart:function(){Of.lineStart=GIt,Of.lineEnd=HIt},polygonEnd:function(){Of.lineStart=Dme,Of.lineEnd=Ime}};function aoe(t,e){t*=vn,e*=vn;var n=Vt(e);CR(n*Vt(t),n*Bt(t),Bt(e))}function CR(t,e,n){++uT,n5+=(t-n5)/uT,r5+=(e-r5)/uT,i5+=(n-i5)/uT}function Dme(){Of.point=WIt}function WIt(t,e){t*=vn,e*=vn;var n=Vt(e);ya=n*Vt(t),xa=n*Bt(t),ba=Bt(e),Of.point=VIt,CR(ya,xa,ba)}function VIt(t,e){t*=vn,e*=vn;var n=Vt(e),r=n*Vt(t),i=n*Bt(t),o=Bt(e),s=Au(Ma((s=xa*o-ba*i)*s+(s=ba*r-ya*o)*s+(s=ya*i-xa*r)*s),ya*r+xa*i+ba*o);t5+=s,o5+=s*(ya+(ya=r)),s5+=s*(xa+(xa=i)),a5+=s*(ba+(ba=o)),CR(ya,xa,ba)}function Ime(){Of.point=aoe}function GIt(){Of.point=qIt}function HIt(){A5e(T5e,k5e),Of.point=aoe}function qIt(t,e){T5e=t,k5e=e,t*=vn,e*=vn,Of.point=A5e;var n=Vt(e);ya=n*Vt(t),xa=n*Bt(t),ba=Bt(e),CR(ya,xa,ba)}function A5e(t,e){t*=vn,e*=vn;var n=Vt(e),r=n*Vt(t),i=n*Bt(t),o=Bt(e),s=xa*o-ba*i,a=ba*r-ya*o,l=ya*i-xa*r,c=UX(s,a,l),u=Sl(c),f=c&&-u/c;XX.add(f*s),YX.add(f*a),QX.add(f*l),t5+=u,o5+=u*(ya+(ya=r)),s5+=u*(xa+(xa=i)),a5+=u*(ba+(ba=o)),CR(ya,xa,ba)}function XIt(t){uT=t5=n5=r5=i5=o5=s5=a5=0,XX=new Ea,YX=new Ea,QX=new Ea,Vp(t,Of);var e=+XX,n=+YX,r=+QX,i=UX(e,n,r);return ixn&&(t-=Math.round(t/Pa)*Pa),[t,e]}ZX.invert=ZX;function P5e(t,e,n){return(t%=Pa)?e||n?KX($me(t),Fme(e,n)):$me(t):e||n?Fme(e,n):ZX}function Lme(t){return function(e,n){return e+=t,Ln(e)>xn&&(e-=Math.round(e/Pa)*Pa),[e,n]}}function $me(t){var e=Lme(t);return e.invert=Lme(-t),e}function Fme(t,e){var n=Vt(t),r=Bt(t),i=Vt(e),o=Bt(e);function s(a,l){var c=Vt(l),u=Vt(a)*c,f=Bt(a)*c,d=Bt(l),h=d*n+u*r;return[Au(f*i-h*o,u*n-d*r),Sl(h*i+f*o)]}return s.invert=function(a,l){var c=Vt(l),u=Vt(a)*c,f=Bt(a)*c,d=Bt(l),h=d*i-f*o;return[Au(f*i+d*o,u*n+h*r),Sl(h*n-u*r)]},s}function YIt(t){t=P5e(t[0]*vn,t[1]*vn,t.length>2?t[2]*vn:0);function e(n){return n=t(n[0]*vn,n[1]*vn),n[0]*=Ui,n[1]*=Ui,n}return e.invert=function(n){return n=t.invert(n[0]*vn,n[1]*vn),n[0]*=Ui,n[1]*=Ui,n},e}function QIt(t,e,n,r,i,o){if(n){var s=Vt(e),a=Bt(e),l=r*n;i==null?(i=e+r*Pa,o=e-l/2):(i=Nme(s,i),o=Nme(s,o),(r>0?io)&&(i+=r*Pa));for(var c,u=i;r>0?u>o:u1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function C3(t,e){return Ln(t[0]-e[0])=0;--a)i.point((f=u[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function zme(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n=0?1:-1,E=k*O,P=E>xn,A=m*_;if(l.add(Au(A*k*Bt(E),v*S+A*Vt(E))),s+=P?O+k*Pa:O,P^p>=n^b>=n){var R=QS(yb(h),yb(x));e5(R);var T=QS(o,R);e5(T);var M=(P^O>=0?-1:1)*Sl(T[2]);(r>M||r===M&&(R[0]||R[1]))&&(a+=P^O>=0?1:-1)}}return(s<-Ut||s0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_1&&b&2&&w.push(w.pop().concat(w.shift())),u.push(w.filter(ZIt))}}return d}}function ZIt(t){return t.length>1}function JIt(t,e){return((t=t.x)[0]<0?t[1]-Li-Ut:Li-t[1])-((e=e.x)[0]<0?e[1]-Li-Ut:Li-e[1])}const jme=D5e(function(){return!0},eLt,nLt,[-xn,-Li]);function eLt(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,s){var a=o>0?xn:-xn,l=Ln(o-e);Ln(l-xn)0?Li:-Li),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(o,n),i=0):r!==a&&l>=xn&&(Ln(e-r)Ut?MO((Bt(e)*(o=Vt(r))*Bt(n)-Bt(r)*(i=Vt(e))*Bt(t))/(i*o*s)):(e+r)/2}function nLt(t,e,n,r){var i;if(t==null)i=n*Li,r.point(-xn,i),r.point(0,i),r.point(xn,i),r.point(xn,0),r.point(xn,-i),r.point(0,-i),r.point(-xn,-i),r.point(-xn,0),r.point(-xn,i);else if(Ln(t[0]-e[0])>Ut){var o=t[0]0,i=Ln(e)>Ut;function o(u,f,d,h){QIt(h,t,n,d,u,f)}function s(u,f){return Vt(u)*Vt(f)>e}function a(u){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,v){var y=[m,v],x,b=s(m,v),w=r?b?0:c(m,v):b?c(m+(m<0?xn:-xn),v):0;if(!f&&(p=h=b)&&u.lineStart(),b!==h&&(x=l(f,y),(!x||C3(f,x)||C3(y,x))&&(y[2]=1)),b!==h)g=0,b?(u.lineStart(),x=l(y,f),u.point(x[0],x[1])):(x=l(f,y),u.point(x[0],x[1],2),u.lineEnd()),f=x;else if(i&&f&&r^b){var _;!(w&d)&&(_=l(y,f,!0))&&(g=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}b&&(!f||!C3(f,y))&&u.point(y[0],y[1]),f=y,h=b,d=w},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(u,f,d){var h=yb(u),p=yb(f),g=[1,0,0],m=QS(h,p),v=UI(m,m),y=m[0],x=v-y*y;if(!x)return!d&&u;var b=e*v/x,w=-e*y/x,_=QS(g,m),S=WI(g,b),O=WI(m,w);hV(S,O);var k=_,E=UI(S,k),P=UI(k,k),A=E*E-P*(UI(S,S)-1);if(!(A<0)){var R=Ma(A),T=WI(k,(-E-R)/P);if(hV(T,S),T=JN(T),!d)return T;var M=u[0],I=f[0],z=u[1],F=f[1],N;I0^T[1]<(Ln(T[0]-M)xn^(M<=T[0]&&T[0]<=I)){var j=WI(k,(-E+R)/P);return hV(j,S),[T,JN(j)]}}}function c(u,f){var d=r?t:xn-t,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return D5e(s,a,o,r?[0,-t]:[-xn,t-xn])}function iLt(t,e,n,r,i,o){var s=t[0],a=t[1],l=e[0],c=e[1],u=0,f=1,d=l-s,h=c-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p0&&(t[0]=s+u*d,t[1]=a+u*h),f<1&&(e[0]=s+f*d,e[1]=a+f*h),!0}}}}}var fT=1e9,GI=-fT;function I5e(t,e,n,r){function i(c,u){return t<=c&&c<=n&&e<=u&&u<=r}function o(c,u,f,d){var h=0,p=0;if(c==null||(h=s(c,f))!==(p=s(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function s(c,u){return Ln(c[0]-t)0?0:3:Ln(c[0]-n)0?2:1:Ln(c[1]-e)0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var f=s(c,1),d=s(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=M5e(),d,h,p,g,m,v,y,x,b,w,_,S={point:O,lineStart:A,lineEnd:R,polygonStart:E,polygonEnd:P};function O(M,I){i(M,I)&&u.point(M,I)}function k(){for(var M=0,I=0,z=h.length;Ir&&(X-$)*(r-j)>(V-j)*(t-$)&&++M:V<=r&&(X-$)*(r-j)<(V-j)*(t-$)&&--M;return M}function E(){u=f,d=[],h=[],_=!0}function P(){var M=k(),I=_&&M,z=(d=xLe(d)).length;(I||z)&&(c.polygonStart(),I&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),z&&R5e(d,a,M,o,c),c.polygonEnd()),u=c,d=h=p=null}function A(){S.point=T,h&&h.push(p=[]),w=!0,b=!1,y=x=NaN}function R(){d&&(T(g,m),v&&b&&f.rejoin(),d.push(f.result())),S.point=O,b&&u.lineEnd()}function T(M,I){var z=i(M,I);if(h&&p.push([M,I]),w)g=M,m=I,v=z,w=!1,z&&(u.lineStart(),u.point(M,I));else if(z&&b)u.point(M,I);else{var F=[y=Math.max(GI,Math.min(fT,y)),x=Math.max(GI,Math.min(fT,x))],N=[M=Math.max(GI,Math.min(fT,M)),I=Math.max(GI,Math.min(fT,I))];iLt(F,N,t,e,n,r)?(b||(u.lineStart(),u.point(F[0],F[1])),u.point(N[0],N[1]),z||u.lineEnd(),_=!1):z&&(u.lineStart(),u.point(M,I),_=!1)}y=M,x=I,b=z}return S}}function Bme(t,e,n){var r=sl(t,e-Ut,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function Ume(t,e,n){var r=sl(t,e-Ut,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function oLt(){var t,e,n,r,i,o,s,a,l=10,c=l,u=90,f=360,d,h,p,g,m=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return sl(BI(r/u)*u,n,u).map(p).concat(sl(BI(a/f)*f,s,f).map(g)).concat(sl(BI(e/l)*l,t,l).filter(function(x){return Ln(x%u)>Ut}).map(d)).concat(sl(BI(o/c)*c,i,c).filter(function(x){return Ln(x%f)>Ut}).map(h))}return v.lines=function(){return y().map(function(x){return{type:"LineString",coordinates:x}})},v.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},v.extent=function(x){return arguments.length?v.extentMajor(x).extentMinor(x):v.extentMinor()},v.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],a=+x[0][1],s=+x[1][1],r>n&&(x=r,r=n,n=x),a>s&&(x=a,a=s,s=x),v.precision(m)):[[r,a],[n,s]]},v.extentMinor=function(x){return arguments.length?(e=+x[0][0],t=+x[1][0],o=+x[0][1],i=+x[1][1],e>t&&(x=e,e=t,t=x),o>i&&(x=o,o=i,i=x),v.precision(m)):[[e,o],[t,i]]},v.step=function(x){return arguments.length?v.stepMajor(x).stepMinor(x):v.stepMinor()},v.stepMajor=function(x){return arguments.length?(u=+x[0],f=+x[1],v):[u,f]},v.stepMinor=function(x){return arguments.length?(l=+x[0],c=+x[1],v):[l,c]},v.precision=function(x){return arguments.length?(m=+x,d=Bme(o,i,90),h=Ume(e,t,m),p=Bme(a,s,90),g=Ume(r,n,m),v):m},v.extentMajor([[-180,-90+Ut],[180,90-Ut]]).extentMinor([[-180,-80-Ut],[180,80+Ut]])}const IA=t=>t;var gV=new Ea,JX=new Ea,L5e,$5e,eY,tY,Gp={point:ps,lineStart:ps,lineEnd:ps,polygonStart:function(){Gp.lineStart=sLt,Gp.lineEnd=lLt},polygonEnd:function(){Gp.lineStart=Gp.lineEnd=Gp.point=ps,gV.add(Ln(JX)),JX=new Ea},result:function(){var t=gV/2;return gV=new Ea,t}};function sLt(){Gp.point=aLt}function aLt(t,e){Gp.point=F5e,L5e=eY=t,$5e=tY=e}function F5e(t,e){JX.add(tY*t-eY*e),eY=t,tY=e}function lLt(){F5e(L5e,$5e)}var KS=1/0,l5=KS,LA=-KS,c5=LA,u5={point:cLt,lineStart:ps,lineEnd:ps,polygonStart:ps,polygonEnd:ps,result:function(){var t=[[KS,l5],[LA,c5]];return LA=c5=-(l5=KS=1/0),t}};function cLt(t,e){tLA&&(LA=t),ec5&&(c5=e)}var nY=0,rY=0,dT=0,f5=0,d5=0,p_=0,iY=0,oY=0,hT=0,N5e,z5e,Vd,Gd,Kc={point:xb,lineStart:Wme,lineEnd:Vme,polygonStart:function(){Kc.lineStart=dLt,Kc.lineEnd=hLt},polygonEnd:function(){Kc.point=xb,Kc.lineStart=Wme,Kc.lineEnd=Vme},result:function(){var t=hT?[iY/hT,oY/hT]:p_?[f5/p_,d5/p_]:dT?[nY/dT,rY/dT]:[NaN,NaN];return nY=rY=dT=f5=d5=p_=iY=oY=hT=0,t}};function xb(t,e){nY+=t,rY+=e,++dT}function Wme(){Kc.point=uLt}function uLt(t,e){Kc.point=fLt,xb(Vd=t,Gd=e)}function fLt(t,e){var n=t-Vd,r=e-Gd,i=Ma(n*n+r*r);f5+=i*(Vd+t)/2,d5+=i*(Gd+e)/2,p_+=i,xb(Vd=t,Gd=e)}function Vme(){Kc.point=xb}function dLt(){Kc.point=pLt}function hLt(){j5e(N5e,z5e)}function pLt(t,e){Kc.point=j5e,xb(N5e=Vd=t,z5e=Gd=e)}function j5e(t,e){var n=t-Vd,r=e-Gd,i=Ma(n*n+r*r);f5+=i*(Vd+t)/2,d5+=i*(Gd+e)/2,p_+=i,i=Gd*t-Vd*e,iY+=i*(Vd+t),oY+=i*(Gd+e),hT+=i*3,xb(Vd=t,Gd=e)}function B5e(t){this._context=t}B5e.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Pa);break}}},result:ps};var sY=new Ea,mV,U5e,W5e,pT,gT,$A={point:ps,lineStart:function(){$A.point=gLt},lineEnd:function(){mV&&V5e(U5e,W5e),$A.point=ps},polygonStart:function(){mV=!0},polygonEnd:function(){mV=null},result:function(){var t=+sY;return sY=new Ea,t}};function gLt(t,e){$A.point=V5e,U5e=pT=t,W5e=gT=e}function V5e(t,e){pT-=t,gT-=e,sY.add(Ma(pT*pT+gT*gT)),pT=t,gT=e}let Gme,h5,Hme,qme;class Xme{constructor(e){this._append=e==null?G5e:mLt(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==Hme||this._append!==h5){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,Hme=r,h5=this._append,qme=this._,this._=i}this._+=qme;break}}}result(){const e=this._;return this._="",e.length?e:null}}function G5e(t){let e=1;this._+=t[0];for(const n=t.length;e=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return G5e;if(e!==Gme){const n=10**e;Gme=e,h5=function(i){let o=1;this._+=i[0];for(const s=i.length;o=0))throw new RangeError(`invalid digits: ${a}`);n=l}return e===null&&(o=new Xme(n)),s},s.projection(t).digits(n).context(e)}function GB(t){return function(e){var n=new aY;for(var r in t)n[r]=t[r];return n.stream=e,n}}function aY(){}aY.prototype={constructor:aY,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function loe(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),Vp(n,t.stream(u5)),e(u5.result()),r!=null&&t.clipExtent(r),t}function HB(t,e,n){return loe(t,function(r){var i=e[1][0]-e[0][0],o=e[1][1]-e[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+e[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(o-s*(r[1][1]+r[0][1]))/2;t.scale(150*s).translate([a,l])},n)}function coe(t,e,n){return HB(t,[[0,0],e],n)}function uoe(t,e,n){return loe(t,function(r){var i=+e,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];t.scale(150*o).translate([s,a])},n)}function foe(t,e,n){return loe(t,function(r){var i=+e,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([s,a])},n)}var Yme=16,vLt=Vt(30*vn);function Qme(t,e){return+e?xLt(t,e):yLt(t)}function yLt(t){return GB({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function xLt(t,e){function n(r,i,o,s,a,l,c,u,f,d,h,p,g,m){var v=c-r,y=u-i,x=v*v+y*y;if(x>4*e&&g--){var b=s+d,w=a+h,_=l+p,S=Ma(b*b+w*w+_*_),O=Sl(_/=S),k=Ln(Ln(_)-1)e||Ln((v*R+y*T)/x-.5)>.3||s*d+a*h+l*p2?M[2]%360*vn:0,R()):[a*Ui,l*Ui,c*Ui]},P.angle=function(M){return arguments.length?(f=M%360*vn,R()):f*Ui},P.reflectX=function(M){return arguments.length?(d=M?-1:1,R()):d<0},P.reflectY=function(M){return arguments.length?(h=M?-1:1,R()):h<0},P.precision=function(M){return arguments.length?(_=Qme(S,w=M*M),T()):Ma(w)},P.fitExtent=function(M,I){return HB(P,M,I)},P.fitSize=function(M,I){return coe(P,M,I)},P.fitWidth=function(M,I){return uoe(P,M,I)},P.fitHeight=function(M,I){return foe(P,M,I)};function R(){var M=Kme(n,0,0,d,h,f).apply(null,e(o,s)),I=Kme(n,r-M[0],i-M[1],d,h,f);return u=P5e(a,l,c),S=KX(e,I),O=KX(u,S),_=Qme(S,w),T()}function T(){return k=E=null,P}return function(){return e=t.apply(this,arguments),P.invert=e.invert&&A,R()}}function doe(t){var e=0,n=xn/3,r=q5e(t),i=r(e,n);return i.parallels=function(o){return arguments.length?r(e=o[0]*vn,n=o[1]*vn):[e*Ui,n*Ui]},i}function SLt(t){var e=Vt(t);function n(r,i){return[r*e,Bt(i)/e]}return n.invert=function(r,i){return[r/e,Sl(i*e)]},n}function CLt(t,e){var n=Bt(t),r=(n+Bt(e))/2;if(Ln(r)=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},u.stream=function(d){return t&&e===d?t:t=OLt([n.stream(e=d),i.stream(d),s.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(c),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+Ut,g+.12*h+Ut],[p-.214*h-Ut,g+.234*h-Ut]]).stream(c),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+Ut,g+.166*h+Ut],[p-.115*h-Ut,g+.234*h-Ut]]).stream(c),f()},u.fitExtent=function(d,h){return HB(u,d,h)},u.fitSize=function(d,h){return coe(u,d,h)},u.fitWidth=function(d,h){return uoe(u,d,h)},u.fitHeight=function(d,h){return foe(u,d,h)};function f(){return t=e=null,u}return u.scale(1070)}function Y5e(t){return function(e,n){var r=Vt(e),i=Vt(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Bt(e),o*Bt(n)]}}function OR(t){return function(e,n){var r=Ma(e*e+n*n),i=t(r),o=Bt(i),s=Vt(i);return[Au(e*o,r*s),Sl(r&&n*o/r)]}}var Q5e=Y5e(function(t){return Ma(2/(1+t))});Q5e.invert=OR(function(t){return 2*Sl(t/2)});function TLt(){return Hh(Q5e).scale(124.75).clipAngle(180-.001)}var K5e=Y5e(function(t){return(t=x5e(t))&&t/Bt(t)});K5e.invert=OR(function(t){return t});function kLt(){return Hh(K5e).scale(79.4188).clipAngle(180-.001)}function qB(t,e){return[t,YN(soe((Li+e)/2))]}qB.invert=function(t,e){return[t,2*MO(y5e(e))-Li]};function ALt(){return Z5e(qB).scale(961/Pa)}function Z5e(t){var e=Hh(t),n=e.center,r=e.scale,i=e.translate,o=e.clipExtent,s=null,a,l,c;e.scale=function(f){return arguments.length?(r(f),u()):r()},e.translate=function(f){return arguments.length?(i(f),u()):i()},e.center=function(f){return arguments.length?(n(f),u()):n()},e.clipExtent=function(f){return arguments.length?(f==null?s=a=l=c=null:(s=+f[0][0],a=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var f=xn*r(),d=e(YIt(e.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:t===qB?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,l),c]]:[[s,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,c)]])}return u()}function HI(t){return soe((Li+t)/2)}function PLt(t,e){var n=Vt(t),r=t===e?Bt(t):YN(n/Vt(e))/YN(HI(e)/HI(t)),i=n*dV(HI(t),r)/r;if(!r)return qB;function o(s,a){i>0?a<-Li+Ut&&(a=-Li+Ut):a>Li-Ut&&(a=Li-Ut);var l=i/dV(HI(a),r);return[l*Bt(r*s),i-l*Vt(r*s)]}return o.invert=function(s,a){var l=i-a,c=iu(r)*Ma(s*s+l*l),u=Au(s,Ln(l))*iu(l);return l*r<0&&(u-=xn*iu(s)*iu(l)),[u/r,2*MO(dV(i/c,1/r))-Li]},o}function MLt(){return doe(PLt).scale(109.5).parallels([30,30])}function g5(t,e){return[t,e]}g5.invert=g5;function RLt(){return Hh(g5).scale(152.63)}function DLt(t,e){var n=Vt(t),r=t===e?Bt(t):(n-Vt(e))/(e-t),i=n/r+t;if(Ln(r)Ut&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function zLt(){return Hh(tze).scale(175.295)}function nze(t,e){return[Vt(e)*Bt(t),Bt(e)]}nze.invert=OR(Sl);function jLt(){return Hh(nze).scale(249.5).clipAngle(90+Ut)}function rze(t,e){var n=Vt(e),r=1+Vt(t)*n;return[n*Bt(t)/r,Bt(e)/r]}rze.invert=OR(function(t){return 2*MO(t)});function BLt(){return Hh(rze).scale(250).clipAngle(142)}function ize(t,e){return[YN(soe((Li+e)/2)),-t]}ize.invert=function(t,e){return[-e,2*MO(y5e(t))-Li]};function ULt(){var t=Z5e(ize),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var WLt=Math.abs,lY=Math.cos,v5=Math.sin,VLt=1e-6,oze=Math.PI,cY=oze/2,Zme=GLt(2);function Jme(t){return t>1?cY:t<-1?-cY:Math.asin(t)}function GLt(t){return t>0?Math.sqrt(t):0}function HLt(t,e){var n=t*v5(e),r=30,i;do e-=i=(e+v5(e)-n)/(1+lY(e));while(WLt(i)>VLt&&--r>0);return e/2}function qLt(t,e,n){function r(i,o){return[t*i*lY(o=HLt(n,o)),e*v5(o)]}return r.invert=function(i,o){return o=Jme(o/e),[i/(t*lY(o)),Jme((2*o+v5(2*o))/n)]},r}var XLt=qLt(Zme/cY,Zme,oze);function YLt(){return Hh(XLt).scale(169.529)}const QLt=H5e(),uY=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function KLt(t,e){return function n(){const r=e();return r.type=t,r.path=H5e().projection(r),r.copy=r.copy||function(){const i=n();return uY.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},bFe(r)}}function hoe(t,e){if(!t||typeof t!="string")throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(y5[t]=KLt(t,e),this):y5[t]||null}function sze(t){return t&&t.path||QLt}const y5={albers:X5e,albersusa:ELt,azimuthalequalarea:TLt,azimuthalequidistant:kLt,conicconformal:MLt,conicequalarea:p5,conicequidistant:ILt,equalEarth:$Lt,equirectangular:RLt,gnomonic:FLt,identity:NLt,mercator:ALt,mollweide:YLt,naturalEarth1:zLt,orthographic:jLt,stereographic:BLt,transversemercator:ULt};for(const t in y5)hoe(t,y5[t]);function ZLt(){}const dp=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function aze(){var t=1,e=1,n=a;function r(l,c){return c.map(u=>i(l,u))}function i(l,c){var u=[],f=[];return o(l,c,d=>{n(d,l,c),JLt(d)>0?u.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=u.length,g;h=c,dp[m<<1].forEach(x);++h=c,dp[g|m<<1].forEach(x);for(dp[m<<0].forEach(x);++p=c,v=l[p*t]>=c,dp[m<<1|v<<2].forEach(x);++h=c,y=v,v=l[p*t+h+1]>=c,dp[g|m<<1|v<<2|y<<3].forEach(x);dp[m|v<<3].forEach(x)}for(h=-1,v=l[p*t]>=c,dp[v<<2].forEach(x);++h=c,dp[v<<2|y<<3].forEach(x);dp[v<<3].forEach(x);function x(b){var w=[b[0][0]+h,b[0][1]+p],_=[b[1][0]+h,b[1][1]+p],S=s(w),O=s(_),k,E;(k=d[S])?(E=f[O])?(delete d[k.end],delete f[E.start],k===E?(k.ring.push(_),u(k.ring)):f[k.start]=d[E.end]={start:k.start,end:E.end,ring:k.ring.concat(E.ring)}):(delete d[k.end],k.ring.push(_),d[k.end=O]=k):(k=f[O])?(E=d[S])?(delete f[k.start],delete d[E.end],k===E?(k.ring.push(_),u(k.ring)):f[E.start]=d[k.end]={start:E.start,end:k.end,ring:E.ring.concat(k.ring)}):(delete f[k.start],k.ring.unshift(w),f[k.start=S]=k):f[S]=d[O]={start:S,end:O,ring:[w,_]}}}function s(l){return l[0]*2+l[1]*(t+1)*4}function a(l,c,u){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,v=c[g*t+p];d>0&&d0&&h=0&&u>=0||je("invalid size"),t=c,e=u,r},r.smooth=function(l){return arguments.length?(n=l?a:ZLt,r):n===a},r}function JLt(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++er!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=-i)}return i}function n$t(t,e,n){var r;return r$t(t,e,n)&&i$t(t[r=+(t[0]===e[0])],n[r],e[r])}function r$t(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function i$t(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function lze(t,e,n){return function(r){var i=kh(r),o=n?Math.min(i[0],0):i[0],s=i[1],a=s-o,l=e?ry(o,s,t):a/(t+1);return sl(o+l,s,l)}}function poe(t){De.call(this,null,t)}poe.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};it(poe,De,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||na,o=aze().smooth(t.smooth!==!1),s=t.thresholds||o$t(r,i,t),a=t.as===null?null:t.as||"contour",l=[];return r.forEach(c=>{const u=i(c),f=o.size([u.width,u.height])(u.values,We(s)?s:s(u.values));s$t(f,u,c,t),f.forEach(d=>{l.push(sB(c,cr(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function o$t(t,e,n){const r=lze(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(t.map(i=>Nx(e(i).values)))}function s$t(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;if(fn(i)&&(i=i(n,r)),fn(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;const s=(Jn(i)?i:i[0])||1,a=(Jn(i)?i:i[1])||1,l=o&&o[0]||0,c=o&&o[1]||0;t.forEach(cze(e,s,a,l,c))}function cze(t,e,n,r,i){const o=t.x1||0,s=t.y1||0,a=e*n<0;function l(f){f.forEach(c)}function c(f){a&&f.reverse(),f.forEach(u)}function u(f){f[0]=(f[0]-o)*e+r,f[1]=(f[1]-s)*n+i}return function(f){return f.coordinates.forEach(l),f}}function eve(t,e,n){const r=t>=0?t:Qne(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function vV(t){return fn(t)?t:ra(+t)}function uze(){var t=l=>l[0],e=l=>l[1],n=yO,r=[-1,-1],i=960,o=500,s=2;function a(l,c){const u=eve(r[0],l,t)>>s,f=eve(r[1],l,e)>>s,d=u?u+2:0,h=f?f+2:0,p=2*d+(i>>s),g=2*h+(o>>s),m=new Float32Array(p*g),v=new Float32Array(p*g);let y=m;l.forEach(b=>{const w=d+(+t(b)>>s),_=h+(+e(b)>>s);w>=0&&w=0&&_0&&f>0?(tw(p,g,m,v,u),nw(p,g,v,m,f),tw(p,g,m,v,u),nw(p,g,v,m,f),tw(p,g,m,v,u),nw(p,g,v,m,f)):u>0?(tw(p,g,m,v,u),tw(p,g,v,m,u),tw(p,g,m,v,u),y=v):f>0&&(nw(p,g,m,v,f),nw(p,g,v,m,f),nw(p,g,m,v,f),y=v);const x=c?Math.pow(2,-2*s):1/bLe(y);for(let b=0,w=p*g;b>s),y2:h+(o>>s)}}return a.x=function(l){return arguments.length?(t=vV(l),a):t},a.y=function(l){return arguments.length?(e=vV(l),a):e},a.weight=function(l){return arguments.length?(n=vV(l),a):n},a.size=function(l){if(!arguments.length)return[i,o];var c=+l[0],u=+l[1];return c>=0&&u>=0||je("invalid size"),i=c,o=u,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||je("invalid cell size"),s=Math.floor(Math.log(l)/Math.LN2),a):1<=i&&(a>=o&&(l-=n[a-o+s*t]),r[a-i+s*t]=l/Math.min(a+1,t-1+o-a,o))}function nw(t,e,n,r,i){const o=(i<<1)+1;for(let s=0;s=i&&(a>=o&&(l-=n[s+(a-o)*t]),r[s+(a-i)*t]=l/Math.min(a+1,e-1+o-a,o))}function goe(t){De.call(this,null,t)}goe.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const a$t=["x","y","weight","size","cellSize","bandwidth"];function fze(t,e){return a$t.forEach(n=>e[n]!=null?t[n](e[n]):0),t}it(goe,De,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=l$t(r,t.groupby),o=(t.groupby||[]).map(Fi),s=fze(uze(),t),a=t.as||"grid",l=[];function c(u,f){for(let d=0;dcr(c({[a]:s(u,t.counts)},u.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function l$t(t,e){var n=[],r=u=>u(a),i,o,s,a,l,c;if(e==null)n.push(t);else for(i={},o=0,s=t.length;on.push(a(u))),o&&s&&(e.visit(l,u=>{var f=o(u),d=s(u);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:fY,geometry:{type:c$t,coordinates:r}})),this.value={type:voe,features:n}}});function xoe(t){De.call(this,null,t)}xoe.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};it(xoe,De,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||na,o=t.as||"path",s=n.SOURCE;!r||t.modified()?(this.value=r=sze(t.projection),n.materialize().reflow()):s=i===na||e.modified(i.fields)?n.ADD_MOD:n.ADD;const a=u$t(r,t.pointRadius);return n.visit(s,l=>l[o]=r(i(l))),r.pointRadius(a),n.modifies(o)}});function u$t(t,e){const n=t.pointRadius();return t.context(null),e!=null&&t.pointRadius(e),n}function boe(t){De.call(this,null,t)}boe.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};it(boe,De,{transform(t,e){var n=t.projection,r=t.fields[0],i=t.fields[1],o=t.as||["x","y"],s=o[0],a=o[1],l;function c(u){const f=n([r(u),i(u)]);f?(u[s]=f[0],u[a]=f[1]):(u[s]=void 0,u[a]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,c):(l=e.modified(r.fields)||e.modified(i.fields),e.visit(l?e.ADD_MOD:e.ADD,c)),e.modifies(o)}});function woe(t){De.call(this,null,t)}woe.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};it(woe,De,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return(!r||t.modified())&&(this.value=r=f$t(sze(t.projection),t.field||Ou("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[i]=r),n.modifies(i)}});function f$t(t,e,n){const r=n==null?i=>t(e(i)):i=>{var o=t.pointRadius(),s=t.pointRadius(n)(e(i));return t.pointRadius(o),s};return r.context=i=>(t.context(i),r),r}function _oe(t){De.call(this,[],t),this.generator=oLt()}_oe.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};it(_oe,De,{transform(t,e){var n=this.value,r=this.generator,i;if(!n.length||t.modified())for(const o in t)fn(r[o])&&r[o](t[o]);return i=r(),n.length?e.mod.push(g$e(n[0],i)):e.add.push(cr(i)),n[0]=i,e}});function Soe(t){De.call(this,null,t)}Soe.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};it(Soe,De,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r=t.resolve==="shared",i=t.field||na,o=h$t(t.opacity,t),s=d$t(t.color,t),a=t.as||"image",l={$x:0,$y:0,$value:0,$max:r?Nx(n.map(c=>Nx(i(c).values))):0};return n.forEach(c=>{const u=i(c),f=cn({},c,l);r||(f.$max=Nx(u.values||[])),c[a]=p$t(u,f,s.dep?s:ra(s(f)),o.dep?o:ra(o(f)))}),e.reflow(!0).modifies(a)}});function d$t(t,e){let n;return fn(t)?(n=r=>ay(t(r,e)),n.dep=dze(t)):n=ra(ay(t||"#888")),n}function h$t(t,e){let n;return fn(t)?(n=r=>t(r,e),n.dep=dze(t)):t?n=ra(t):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function dze(t){if(!fn(t))return!1;const e=Wf(Ks(t));return e.$x||e.$y||e.$value||e.$max}function p$t(t,e,n,r){const i=t.width,o=t.height,s=t.x1||0,a=t.y1||0,l=t.x2||i,c=t.y2||o,u=t.values,f=u?m=>u[m]:rv,d=Bv(l-s,c-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-s,c-a),g=p.data;for(let m=a,v=0;m{t[r]!=null&&tve(n,r,t[r])})):uY.forEach(r=>{t.modified(r)&&tve(n,r,t[r])}),t.pointRadius!=null&&n.path.pointRadius(t.pointRadius),t.fit&&g$t(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function g$t(t,e){const n=v$t(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}function m$t(t){const e=hoe((t||"mercator").toLowerCase());return e||je("Unrecognized projection type: "+t),e()}function tve(t,e,n){fn(t[e])&&t[e](n)}function v$t(t){return t=pt(t),t.length===1?t[0]:{type:voe,features:t.reduce((e,n)=>e.concat(y$t(n)),[])}}function y$t(t){return t.type===voe?t.features:pt(t).filter(e=>e!=null).map(e=>e.type===fY?e:{type:fY,geometry:e})}const x$t=Object.freeze(Object.defineProperty({__proto__:null,contour:moe,geojson:yoe,geopath:xoe,geopoint:boe,geoshape:woe,graticule:_oe,heatmap:Soe,isocontour:poe,kde2d:goe,projection:hze},Symbol.toStringTag,{value:"Module"}));function b$t(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=0);function i(){var o,s=n.length,a,l=0,c=0;for(o=0;o=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d,i=o,!(o=o[v=m<<1|g]))return i[v]=s,t;if(h=+t._x.call(null,o.data),p=+t._y.call(null,o.data),e===h&&n===p)return s.next=o,i?i[v]=s:t._root=s,t;do i=i?i[v]=new Array(4):t._root=new Array(4),(g=e>=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d;while((v=m<<1|g)===(y=(p>=d)<<1|h>=f));return i[y]=o,i[v]=s,t}function _$t(t){var e,n,r=t.length,i,o,s=new Array(r),a=new Array(r),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;nu&&(u=i),of&&(f=o));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;nt||t>=i||r>e||e>=o;)switch(c=(eu||(a=p.y0)>f||(l=p.x1)=v)<<1|t>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var y=t-+this._x.call(null,h.data),x=e-+this._y.call(null,h.data),b=y*y+x*x;if(b=(d=(s+l)/2))?s=d:l=d,(g=f>=(h=(a+c)/2))?a=h:c=h,e=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(r=e,v=m)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):e?(o?e[m]=o:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[v]=n:this._root=n),this):(this._root=o,this)}function k$t(t){for(var e=0,n=t.length;ed.index){var P=h-O.x-O.vx,A=p-O.y-O.vy,R=P*P+A*A;Rh+E||_p+E||Sc.r&&(c.r=c[u].r)}function l(){if(e){var c,u=e.length,f;for(n=new Array(u),c=0;c[e(w,_,s),w])),b;for(m=0,a=new Array(v);m{}};function gze(){for(var t=0,e=arguments.length,n={},r;t=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}O3.prototype=gze.prototype={constructor:O3,on:function(t,e){var n=this._,r=W$t(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&t._call.call(void 0,e),t=t._next;--ZS}function ove(){bb=(b5=FA.now())+XB,ZS=mT=0;try{H$t()}finally{ZS=0,X$t(),bb=0}}function q$t(){var t=FA.now(),e=t-b5;e>mze&&(XB-=e,b5=t)}function X$t(){for(var t,e=x5,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:x5=n);vT=t,dY(r)}function dY(t){if(!ZS){mT&&(mT=clearTimeout(mT));var e=t-bb;e>24?(t<1/0&&(mT=setTimeout(ove,t-FA.now()-XB)),r2&&(r2=clearInterval(r2))):(r2||(b5=FA.now(),r2=setInterval(q$t,mze)),ZS=1,vze(ove))}}function Y$t(t,e,n){var r=new w5,i=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(o,s,a){s=+s,a=a==null?Eoe():+a,r._restart(function l(c){c+=i,r._restart(l,i+=s,a),o(c)},s,a)},r.restart(t,e,n),r)}const Q$t=1664525,K$t=1013904223,sve=4294967296;function Z$t(){let t=1;return()=>(t=(Q$t*t+K$t)%sve)/sve}function J$t(t){return t.x}function e3t(t){return t.y}var t3t=10,n3t=Math.PI*(3-Math.sqrt(5));function r3t(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,a=new Map,l=yze(f),c=gze("tick","end"),u=Z$t();t==null&&(t=[]);function f(){d(),c.call("tick",e),n1?(m==null?a.delete(g):a.set(g,p(m)),e):a.get(g)},find:function(g,m,v){var y=0,x=t.length,b,w,_,S,O;for(v==null?v=1/0:v*=v,y=0;y1?(c.on(g,m),e):c.on(g)}}}function i3t(){var t,e,n,r,i=Sa(-30),o,s=1,a=1/0,l=.81;function c(h){var p,g=t.length,m=Coe(t,J$t,e3t).visitAfter(f);for(r=h,p=0;p=a)return;(h.data!==e||h.next)&&(v===0&&(v=yv(n),b+=v*v),y===0&&(y=yv(n),b+=y*y),b=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return e.StopPropagation}return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let a=this._argops,l=0,c=a.length,u;lt.touch(e).run()}function c3t(t,e){const n=r3t(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),bze(n,e,!0).on("end",()=>o=!0)}function bze(t,e,n,r){var i=pt(e.forces),o,s,a,l;for(o=0,s=hY.length;oe(r,n):e)}const h3t=Object.freeze(Object.defineProperty({__proto__:null,force:Toe},Symbol.toStringTag,{value:"Module"}));function p3t(t,e){return t.parent===e.parent?1:2}function g3t(t){return t.reduce(m3t,0)/t.length}function m3t(t,e){return t+e.x}function v3t(t){return 1+t.reduce(y3t,0)}function y3t(t,e){return Math.max(t,e.y)}function x3t(t){for(var e;e=t.children;)t=e[0];return t}function b3t(t){for(var e;e=t.children;)t=e[e.length-1];return t}function w3t(){var t=p3t,e=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=g3t(h),d.y=v3t(h)):(d.x=s?a+=t(d,s):0,d.y=0,s=d)});var l=x3t(o),c=b3t(o),u=l.x-t(l,c)/2,f=c.x+t(c,l)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*e,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-u)/(f-u)*e,d.y=(1-(o.y?d.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(t=o,i):t},i.size=function(o){return arguments.length?(r=!1,e=+o[0],n=+o[1],i):r?null:[e,n]},i.nodeSize=function(o){return arguments.length?(r=!0,e=+o[0],n=+o[1],i):r?[e,n]:null},i}function _3t(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function S3t(){return this.eachAfter(_3t)}function C3t(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function O3t(t,e){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(t.call(e,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function E3t(t,e){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=r[i].value;e.value=n})}function A3t(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function P3t(t){for(var e=this,n=M3t(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function M3t(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function R3t(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function D3t(){return Array.from(this)}function I3t(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function L3t(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*$3t(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i=0;--a)i.push(o=s[a]=new JS(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(wze)}function F3t(){return koe(this).eachBefore(j3t)}function N3t(t){return t.children}function z3t(t){return Array.isArray(t)?t[1]:null}function j3t(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function wze(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function JS(t){this.data=t,this.depth=this.height=0,this.parent=null}JS.prototype=koe.prototype={constructor:JS,count:S3t,each:C3t,eachAfter:E3t,eachBefore:O3t,find:T3t,sum:k3t,sort:A3t,path:P3t,ancestors:R3t,descendants:D3t,leaves:I3t,links:L3t,copy:F3t,[Symbol.iterator]:$3t};function E3(t){return t==null?null:_ze(t)}function _ze(t){if(typeof t!="function")throw new Error;return t}function nx(){return 0}function Uw(t){return function(){return t}}const B3t=1664525,U3t=1013904223,lve=4294967296;function W3t(){let t=1;return()=>(t=(B3t*t+U3t)%lve)/lve}function V3t(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function G3t(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}function H3t(t,e){for(var n=0,r=(t=G3t(Array.from(t),e)).length,i=[],o,s;n0&&n*n>r*r+i*i}function yV(t,e){for(var n=0;n1e-6?(P+Math.sqrt(P*P-4*E*A))/(2*E):A/P);return{x:r+_+S*R,y:i+O+k*R,r:R}}function cve(t,e,n){var r=t.x-e.x,i,o,s=t.y-e.y,a,l,c=r*r+s*s;c?(o=e.r+n.r,o*=o,l=t.r+n.r,l*=l,o>l?(i=(c+l-o)/(2*c),a=Math.sqrt(Math.max(0,l/c-i*i)),n.x=t.x-i*r-a*s,n.y=t.y-i*s+a*r):(i=(c+o-l)/(2*c),a=Math.sqrt(Math.max(0,o/c-i*i)),n.x=e.x+i*r-a*s,n.y=e.y+i*s+a*r)):(n.x=e.x+n.r,n.y=e.y)}function uve(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function fve(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function XI(t){this._=t,this.next=null,this.previous=null}function Q3t(t,e){if(!(o=(t=V3t(t)).length))return 0;var n,r,i,o,s,a,l,c,u,f,d;if(n=t[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;cve(r,n,i=t[2]),n=new XI(n),r=new XI(r),i=new XI(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;lrFt(n(b,w,i))),y=v.map(mve),x=new Set(v).add("");for(const b of y)x.has(b)||(x.add(b),v.push(b),y.push(mve(b)),o.push(bV));s=(b,w)=>v[w],a=(b,w)=>y[w]}for(u=0,l=o.length;u=0&&(h=o[v],h.data===bV);--v)h.data=null}if(f.parent=eFt,f.eachBefore(function(v){v.depth=v.parent.depth+1,--l}).eachBefore(wze),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=E3(i),r):t},r.parentId=function(i){return arguments.length?(e=E3(i),r):e},r.path=function(i){return arguments.length?(n=E3(i),r):n},r}function rFt(t){t=`${t}`;let e=t.length;return pY(t,e-1)&&!pY(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function mve(t){let e=t.length;if(e<2)return"";for(;--e>1&&!pY(t,e););return t.slice(0,e)}function pY(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function iFt(t,e){return t.parent===e.parent?1:2}function wV(t){var e=t.children;return e?e[0]:t.t}function _V(t){var e=t.children;return e?e[e.length-1]:t.t}function oFt(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function sFt(t){for(var e=0,n=0,r=t.children,i=r.length,o;--i>=0;)o=r[i],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function aFt(t,e,n){return t.a.parent===e.parent?t.a:n}function T3(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}T3.prototype=Object.create(JS.prototype);function lFt(t){for(var e=new T3(t,0),n,r=[e],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new T3(o[s],s)),i.parent=n;return(e.parent=new T3(null,0)).children=[e],e}function cFt(){var t=iFt,e=1,n=1,r=null;function i(c){var u=lFt(c);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var f=c,d=c,h=c;c.eachBefore(function(y){y.xd.x&&(d=y),y.depth>h.depth&&(h=y)});var p=f===d?1:t(f,d)/2,g=p-f.x,m=e/(d.x+p+g),v=n/(h.depth||1);c.eachBefore(function(y){y.x=(y.x+g)*m,y.y=y.depth*v})}return c}function o(c){var u=c.children,f=c.parent.children,d=c.i?f[c.i-1]:null;if(u){sFt(c);var h=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+t(c._,d._),c.m=c.z-h):c.z=h}else d&&(c.z=d.z+t(c._,d._));c.parent.A=a(c,d,c.parent.A||f[0])}function s(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function a(c,u,f){if(u){for(var d=c,h=c,p=u,g=d.parent.children[0],m=d.m,v=h.m,y=p.m,x=g.m,b;p=_V(p),d=wV(d),p&&d;)g=wV(g),h=_V(h),h.a=c,b=p.z+y-d.z-m+t(p._,d._),b>0&&(oFt(aFt(p,c,f),c,b),m+=b,v+=b),y+=p.m,m+=d.m,x+=g.m,v+=h.m;p&&!_V(h)&&(h.t=p,h.m+=y-v),d&&!wV(g)&&(g.t=d,g.m+=m-x,f=c)}return f}function l(c){c.x*=e,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(t=c,i):t},i.size=function(c){return arguments.length?(r=!1,e=+c[0],n=+c[1],i):r?null:[e,n]},i.nodeSize=function(c){return arguments.length?(r=!0,e=+c[0],n=+c[1],i):r?[e,n]:null},i}function YB(t,e,n,r,i){for(var o=t.children,s,a=-1,l=o.length,c=t.value&&(i-n)/t.value;++ay&&(y=c),_=m*m*w,x=Math.max(y/_,_/v),x>b){m-=c;break}b=x}s.push(l={value:m,dice:h1?r:1)},n}(Eze);function uFt(){var t=kze,e=!1,n=1,r=1,i=[0],o=nx,s=nx,a=nx,l=nx,c=nx;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],e&&d.eachBefore(Oze),d}function f(d){var h=i[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,v=d.y1-h;m=d-1){var y=o[f];y.x0=p,y.y0=g,y.x1=m,y.y1=v;return}for(var x=c[f],b=h/2+x,w=f+1,_=d-1;w<_;){var S=w+_>>>1;c[S]v-g){var E=h?(p*k+m*O)/h:m;u(f,w,O,p,g,E,v),u(w,d,k,E,g,m,v)}else{var P=h?(g*k+v*O)/h:v;u(f,w,O,p,g,m,P),u(w,d,k,p,P,m,v)}}}function dFt(t,e,n,r,i){(t.depth&1?YB:ER)(t,e,n,r,i)}const hFt=function t(e){function n(r,i,o,s,a){if((l=r._squarify)&&l.ratio===e)for(var l,c,u,f,d=-1,h,p=l.length,g=r.value;++d1?r:1)},n}(Eze);function gY(t,e,n){const r={};return t.each(i=>{const o=i.data;n(o)&&(r[e(o)]=i)}),t.lookup=r,t}function Aoe(t){De.call(this,null,t)}Aoe.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const pFt=t=>t.values;it(Aoe,De,{transform(t,e){e.source||je("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each(s=>{s.children&&oB(s.data)&&i.rem.push(s.data)}),this.value=o=koe({values:pt(t.keys).reduce((s,a)=>(s.key(a),s),gFt()).entries(i.source)},pFt),n&&o.each(s=>{s.children&&(s=cr(s.data),i.add.push(s),i.source.push(s))}),gY(o,jt,jt)),i.source.root=o,i}});function gFt(){const t=[],e={entries:i=>r(n(i,0),0),key:i=>(t.push(i),e)};function n(i,o){if(o>=t.length)return i;const s=i.length,a=t[o++],l={},c={};let u=-1,f,d,h;for(;++ut.length)return i;const s=[];for(const a in i)s.push({key:a,values:r(i[a],o)});return s}return e}function Qg(t){De.call(this,null,t)}const mFt=(t,e)=>t.parent===e.parent?1:2;it(Qg,De,{transform(t,e){(!e.source||!e.source.root)&&je(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(d1(t.sort,s=>s.data)),vFt(n,this.params,t),n.separation&&n.separation(t.separation!==!1?mFt:yO);try{this.value=n(i)}catch(s){je(s)}return i.each(s=>yFt(s,r,o)),e.reflow(t.modified()).modifies(o).modifies("leaf")}});function vFt(t,e,n){for(let r,i=0,o=e.length;io[jt(s)]=1),r.each(s=>{const a=s.data,l=s.parent&&s.parent.data;l&&o[jt(a)]&&o[jt(l)]&&i.add.push(cr({source:l,target:a}))}),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,s=>o[jt(s)]=1),n.forEach(s=>{(o[jt(s.source)]||o[jt(s.target)])&&i.mod.push(s)})),i}});const yve={binary:fFt,dice:ER,slice:YB,slicedice:dFt,squarify:kze,resquarify:hFt},xY=["x0","y0","x1","y1","depth","children"];function Loe(t){Qg.call(this,t)}Loe.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:xY.length,default:xY}]};it(Loe,Qg,{layout(){const t=uFt();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{vt(yve,e)?t.tile(yve[e]):je("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:xY});const xFt=Object.freeze(Object.defineProperty({__proto__:null,nest:Aoe,pack:Poe,partition:Moe,stratify:Roe,tree:Doe,treelinks:Ioe,treemap:Loe},Symbol.toStringTag,{value:"Module"})),SV=4278190080;function bFt(t,e){const n=t.bitmap();return(e||[]).forEach(r=>n.set(t(r.boundary[0]),t(r.boundary[3]))),[n,void 0]}function wFt(t,e,n,r,i){const o=t.width,s=t.height,a=r||i,l=Bv(o,s).getContext("2d"),c=Bv(o,s).getContext("2d"),u=a&&Bv(o,s).getContext("2d");n.forEach(O=>k3(l,O,!1)),k3(c,e,!1),a&&k3(u,e,!0);const f=CV(l,o,s),d=CV(c,o,s),h=a&&CV(u,o,s),p=t.bitmap(),g=a&&t.bitmap();let m,v,y,x,b,w,_,S;for(v=0;v{i.items.forEach(o=>k3(t,o.items,n))}):Ec[r].draw(t,{items:n?e.map(_Ft):e})}function _Ft(t){const e=sB(t,{});return e.stroke&&e.strokeOpacity!==0||e.fill&&e.fillOpacity!==0?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const hp=5,la=31,NA=32,Qm=new Uint32Array(NA+1),yf=new Uint32Array(NA+1);yf[0]=0;Qm[0]=~yf[0];for(let t=1;t<=NA;++t)yf[t]=yf[t-1]<<1|1,Qm[t]=~yf[t];function SFt(t,e){const n=new Uint32Array(~~((t*e+NA)/NA));function r(o,s){n[o]|=s}function i(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*t+o;return n[a>>>hp]&1<<(a&la)},set:(o,s)=>{const a=s*t+o;r(a>>>hp,1<<(a&la))},clear:(o,s)=>{const a=s*t+o;i(a>>>hp,~(1<<(a&la)))},getRange:(o,s,a,l)=>{let c=l,u,f,d,h;for(;c>=s;--c)if(u=c*t+o,f=c*t+a,d=u>>>hp,h=f>>>hp,d===h){if(n[d]&Qm[u&la]&yf[(f&la)+1])return!0}else{if(n[d]&Qm[u&la]||n[h]&yf[(f&la)+1])return!0;for(let p=d+1;p{let c,u,f,d,h;for(;s<=l;++s)if(c=s*t+o,u=s*t+a,f=c>>>hp,d=u>>>hp,f===d)r(f,Qm[c&la]&yf[(u&la)+1]);else for(r(f,Qm[c&la]),r(d,yf[(u&la)+1]),h=f+1;h{let c,u,f,d,h;for(;s<=l;++s)if(c=s*t+o,u=s*t+a,f=c>>>hp,d=u>>>hp,f===d)i(f,yf[c&la]|Qm[(u&la)+1]);else for(i(f,yf[c&la]),i(d,Qm[(u&la)+1]),h=f+1;ho<0||s<0||l>=e||a>=t}}function CFt(t,e,n){const r=Math.max(1,Math.sqrt(t*e/1e6)),i=~~((t+2*n+r)/r),o=~~((e+2*n+r)/r),s=a=>~~((a+n)/r);return s.invert=a=>a*r-n,s.bitmap=()=>SFt(i,o),s.ratio=r,s.padding=n,s.width=t,s.height=e,s}function OFt(t,e,n,r){const i=t.width,o=t.height;return function(s){const a=s.datum.datum.items[r].items,l=a.length,c=s.datum.fontSize,u=hc.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,v,y;for(let x=0;x=f&&(f=y,s.x=m,s.y=v);return m=u/2,v=c/2,d=s.x-m,h=s.x+m,p=s.y-v,g=s.y+v,s.align="center",d<0&&h<=i?s.align="left":0<=d&&ii||e-(s=r/2)<0||e+s>o}function xv(t,e,n,r,i,o,s,a){const l=i*o/(r*2),c=t(e-l),u=t(e+l),f=t(n-(o=o/2)),d=t(n+o);return s.outOfBounds(c,f,u,d)||s.getRange(c,f,u,d)||a&&a.getRange(c,f,u,d)}function EFt(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1];function l(c,u,f,d,h){const p=t.invert(c),g=t.invert(u);let m=f,v=o,y;if(!_5(p,g,d,h,i,o)&&!xv(t,p,g,h,d,m,s,a)&&!xv(t,p,g,h,d,h,s,null)){for(;v-m>=1;)y=(m+v)/2,xv(t,p,g,h,d,y,s,a)?v=y:m=y;if(m>f)return[p,g,m,!0]}}return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=hc.width(c.datum,c.datum.text);let p=n?d:0,g=!1,m=!1,v=0,y,x,b,w,_,S,O,k,E,P,A,R,T,M,I,z,F;for(let N=0;Nx&&(F=y,y=x,x=F),b>w&&(F=b,b=w,w=F),E=t(y),A=t(x),P=~~((E+A)/2),R=t(b),M=t(w),T=~~((R+M)/2),O=P;O>=E;--O)for(k=T;k>=R;--k)z=l(O,k,p,h,d),z&&([c.x,c.y,p,g]=z);for(O=P;O<=A;++O)for(k=T;k<=M;++k)z=l(O,k,p,h,d),z&&([c.x,c.y,p,g]=z);!g&&!n&&(I=Math.abs(x-y+w-b),_=(y+x)/2,S=(b+w)/2,I>=v&&!_5(_,S,h,d,i,o)&&!xv(t,_,S,d,h,d,s,null)&&(v=I,c.x=_,c.y=S,m=!0))}return g||m?(_=h/2,S=d/2,s.setRange(t(c.x-_),t(c.y-S),t(c.x+_),t(c.y+S)),c.align="center",c.baseline="middle",!0):!1}}const TFt=[-1,-1,1,1],kFt=[-1,1,-1,1];function AFt(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1],l=t.bitmap();return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=hc.width(c.datum,c.datum.text),p=[];let g=n?d:0,m=!1,v=!1,y=0,x,b,w,_,S,O,k,E,P,A,R,T;for(let M=0;M=1;)R=(P+A)/2,xv(t,S,O,d,h,R,s,a)?A=R:P=R;P>g&&(c.x=S,c.y=O,g=P,m=!0)}}!m&&!n&&(T=Math.abs(b-x+_-w),S=(x+b)/2,O=(w+_)/2,T>=y&&!_5(S,O,h,d,i,o)&&!xv(t,S,O,d,h,d,s,null)&&(y=T,c.x=S,c.y=O,v=!0))}return m||v?(S=h/2,O=d/2,s.setRange(t(c.x-S),t(c.y-O),t(c.x+S),t(c.y+O)),c.align="center",c.baseline="middle",!0):!1}}const PFt=["right","center","left"],MFt=["bottom","middle","top"];function RFt(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1],l=r.length;return function(c){const u=c.boundary,f=c.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>i||u[3]>o)return!1;let d=c.textWidth??0,h,p,g,m,v,y,x,b,w,_,S,O,k,E,P;for(let A=0;A>>2&3)-1,g=h===0&&p===0||r[A]<0,m=h&&p?Math.SQRT1_2:1,v=r[A]<0?-1:1,y=u[1+h]+r[A]*h*m,S=u[4+p]+v*f*p/2+r[A]*p*m,b=S-f/2,w=S+f/2,O=t(y),E=t(b),P=t(w),!d)if(xve(O,O,E,P,s,a,y,y,b,w,u,g))d=hc.width(c.datum,c.datum.text);else continue;if(_=y+v*d*h/2,y=_-d/2,x=_+d/2,O=t(y),k=t(x),xve(O,k,E,P,s,a,y,x,b,w,u,g))return c.x=h?h*v<0?x:y:_,c.y=p?p*v<0?w:b:S,c.align=PFt[h*v+1],c.baseline=MFt[p*v+1],s.setRange(O,E,k,P),!0}return!1}}function xve(t,e,n,r,i,o,s,a,l,c,u,f){return!(i.outOfBounds(t,n,e,r)||(f&&o||i).getRange(t,n,e,r))}const OV=0,EV=4,TV=8,kV=0,AV=1,PV=2,DFt={"top-left":OV+kV,top:OV+AV,"top-right":OV+PV,left:EV+kV,middle:EV+AV,right:EV+PV,"bottom-left":TV+kV,bottom:TV+AV,"bottom-right":TV+PV},IFt={naive:OFt,"reduced-search":EFt,floodfill:AFt};function LFt(t,e,n,r,i,o,s,a,l,c,u){if(!t.length)return t;const f=Math.max(r.length,i.length),d=$Ft(r,f),h=FFt(i,f),p=NFt(t[0].datum),g=p==="group"&&t[0].datum.items[l].marktype,m=g==="area",v=zFt(p,g,a,l),y=c===null||c===1/0,x=m&&u==="naive";let b=-1,w=-1;const _=t.map(E=>{const P=y?hc.width(E,E.text):void 0;return b=Math.max(b,P),w=Math.max(w,E.fontSize),{datum:E,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(E),textWidth:P}});c=c===null||c===1/0?Math.max(b,w)+Math.max(...r):c;const S=CFt(e[0],e[1],c);let O;if(!x){n&&_.sort((A,R)=>n(A.datum,R.datum));let E=!1;for(let A=0;AA.datum);O=o.length||P?wFt(S,P||[],o,E,m):bFt(S,s&&_)}const k=m?IFt[u](S,O,s,l):RFt(S,O,h,d);return _.forEach(E=>E.opacity=+k(E)),_}function $Ft(t,e){const n=new Float64Array(e),r=t.length;for(let i=0;i[o.x,o.x,o.x,o.y,o.y,o.y];return t?t==="line"||t==="area"?o=>i(o.datum):e==="line"?o=>{const s=o.datum.items[r].items;return i(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:i}const bY=["x","y","opacity","align","baseline"],Aze=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function $oe(t){De.call(this,null,t)}$oe.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:Aze},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:bY.length,default:bY}]};it($oe,De,{transform(t,e){function n(o){const s=t[o];return fn(s)&&e.modified(s.fields)}const r=t.modified();if(!(r||e.changed(e.ADD_REM)||n("sort")))return;(!t.size||t.size.length!==2)&&je("Size parameter should be specified as a [width, height] array.");const i=t.as||bY;return LFt(e.materialize(e.SOURCE).source||[],t.size,t.sort,pt(t.offset==null?1:t.offset),pt(t.anchor||Aze),t.avoidMarks||[],t.avoidBaseMark!==!1,t.lineAnchor||"end",t.markIndex||0,t.padding===void 0?0:t.padding,t.method||"naive").forEach(o=>{const s=o.datum;s[i[0]]=o.x,s[i[1]]=o.y,s[i[2]]=o.opacity,s[i[3]]=o.align,s[i[4]]=o.baseline}),e.reflow(r).modifies(i)}});const jFt=Object.freeze(Object.defineProperty({__proto__:null,label:$oe},Symbol.toStringTag,{value:"Module"}));function Pze(t,e){var n=[],r=function(u){return u(a)},i,o,s,a,l,c;if(e==null)n.push(t);else for(i={},o=0,s=t.length;o{D$e(c,t.x,t.y,t.bandwidth||.3).forEach(u=>{const f={};for(let d=0;dt==="poly"?e:t==="quad"?2:1;function Noe(t){De.call(this,null,t)}Noe.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(wY)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};it(Noe,De,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=Pze(r,t.groupby),o=(t.groupby||[]).map(Fi),s=t.method||"linear",a=t.order==null?3:t.order,l=BFt(s,a),c=t.as||[Fi(t.x),Fi(t.y)],u=wY[s],f=[];let d=t.extent;vt(wY,s)||je("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=l){e.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=u(h,t.x,t.y,a);if(t.params){f.push(cr({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||kh(h,t.x),v=y=>{const x={};for(let b=0;bv([y,g.predict(y)])):hB(g.predict,m,25,200).forEach(v)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const UFt=Object.freeze(Object.defineProperty({__proto__:null,loess:Foe,regression:Noe},Symbol.toStringTag,{value:"Module"})),ug=11102230246251565e-32,Ms=134217729,WFt=(3+8*ug)*ug;function MV(t,e,n,r,i){let o,s,a,l,c=e[0],u=r[0],f=0,d=0;u>c==u>-c?(o=c,c=e[++f]):(o=u,u=r[++d]);let h=0;if(fc==u>-c?(s=c+o,a=o-(s-c),c=e[++f]):(s=u+o,a=o-(s-u),u=r[++d]),o=s,a!==0&&(i[h++]=a);fc==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=e[++f]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=r[++d]),o=s,a!==0&&(i[h++]=a);for(;f=T||-R>=T||(f=t-k,a=t-(k+f)+(f-i),f=n-E,c=n-(E+f)+(f-i),f=e-P,l=e-(P+f)+(f-o),f=r-A,u=r-(A+f)+(f-o),a===0&&l===0&&c===0&&u===0)||(T=qFt*s+WFt*Math.abs(R),R+=k*u+A*a-(P*c+E*l),R>=T||-R>=T))return R;b=a*A,d=Ms*a,h=d-(d-a),p=a-h,d=Ms*A,g=d-(d-A),m=A-g,w=p*m-(b-h*g-p*g-h*m),_=l*E,d=Ms*l,h=d-(d-l),p=l-h,d=Ms*E,g=d-(d-E),m=E-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,ca[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,ca[1]=x-(v+f)+(f-_),O=y+v,f=O-y,ca[2]=y-(O-f)+(v-f),ca[3]=O;const M=MV(4,rw,4,ca,bve);b=k*u,d=Ms*k,h=d-(d-k),p=k-h,d=Ms*u,g=d-(d-u),m=u-g,w=p*m-(b-h*g-p*g-h*m),_=P*c,d=Ms*P,h=d-(d-P),p=P-h,d=Ms*c,g=d-(d-c),m=c-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,ca[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,ca[1]=x-(v+f)+(f-_),O=y+v,f=O-y,ca[2]=y-(O-f)+(v-f),ca[3]=O;const I=MV(M,bve,4,ca,wve);b=a*u,d=Ms*a,h=d-(d-a),p=a-h,d=Ms*u,g=d-(d-u),m=u-g,w=p*m-(b-h*g-p*g-h*m),_=l*c,d=Ms*l,h=d-(d-l),p=l-h,d=Ms*c,g=d-(d-c),m=c-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,ca[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,ca[1]=x-(v+f)+(f-_),O=y+v,f=O-y,ca[2]=y-(O-f)+(v-f),ca[3]=O;const z=MV(I,wve,4,ca,_ve);return _ve[z-1]}function YI(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=GFt*c?l:-XFt(t,e,n,r,i,o,c)}const Sve=Math.pow(2,-52),QI=new Uint32Array(512);class S5{static from(e,n=JFt,r=eNt){const i=e.length,o=new Float64Array(i*2);for(let s=0;s>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:e,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=e.length>>1;let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let k=0;kc&&(c=E),P>u&&(u=P),this._ids[k]=k}const f=(a+c)/2,d=(l+u)/2;let h,p,g;for(let k=0,E=1/0;k0&&(p=k,E=P)}let y=e[2*p],x=e[2*p+1],b=1/0;for(let k=0;kA&&(k[E++]=R,A=T)}this.hull=k.subarray(0,E),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(YI(m,v,y,x,w,_)<0){const k=p,E=y,P=x;p=g,y=w,x=_,g=k,w=E,_=P}const S=ZFt(m,v,y,x,w,_);this._cx=S.x,this._cy=S.y;for(let k=0;k0&&Math.abs(R-E)<=Sve&&Math.abs(T-P)<=Sve||(E=R,P=T,A===h||A===p||A===g))continue;let M=0;for(let L=0,B=this._hashKey(R,T);L=0;)if(I=z,I===M){I=-1;break}if(I===-1)continue;let F=this._addTriangle(I,A,r[I],-1,-1,i[I]);i[A]=this._legalize(F+2),i[I]=F,O++;let N=r[I];for(;z=r[N],YI(R,T,e[2*N],e[2*N+1],e[2*z],e[2*z+1])<0;)F=this._addTriangle(N,A,z,i[A],-1,i[N]),i[A]=this._legalize(F+2),r[N]=N,O--,N=z;if(I===M)for(;z=n[I],YI(R,T,e[2*z],e[2*z+1],e[2*I],e[2*I+1])<0;)F=this._addTriangle(z,A,I,-1,i[I],i[z]),this._legalize(F+2),i[z]=F,r[I]=I,O--,I=z;this._hullStart=n[A]=I,r[I]=n[N]=A,r[A]=N,o[this._hashKey(R,T)]=A,o[this._hashKey(e[2*I],e[2*I+1])]=I}this.hull=new Uint32Array(O);for(let k=0,E=this._hullStart;k0?3-n:1+n)/4}function RV(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function QFt(t,e,n,r,i,o,s,a){const l=t-s,c=e-a,u=n-s,f=r-a,d=i-s,h=o-a,p=l*l+c*c,g=u*u+f*f,m=d*d+h*h;return l*(f*m-g*h)-c*(u*m-g*d)+p*(u*h-f*d)<0}function KFt(t,e,n,r,i,o){const s=n-t,a=r-e,l=i-t,c=o-e,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=(c*u-a*f)*d,p=(s*f-l*u)*d;return h*h+p*p}function ZFt(t,e,n,r,i,o){const s=n-t,a=r-e,l=i-t,c=o-e,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=t+(c*u-a*f)*d,p=e+(s*f-l*u)*d;return{x:h,y:p}}function g_(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=t[i],s=e[o];let a=i-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=o}else{const i=n+r>>1;let o=n+1,s=r;i2(t,i,o),e[t[n]]>e[t[r]]&&i2(t,n,r),e[t[o]]>e[t[r]]&&i2(t,o,r),e[t[n]]>e[t[o]]&&i2(t,n,o);const a=t[o],l=e[a];for(;;){do o++;while(e[t[o]]l);if(s=s-n?(g_(t,e,o,r),g_(t,e,n,s-1)):(g_(t,e,n,s-1),g_(t,e,o,r))}}function i2(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function JFt(t){return t[0]}function eNt(t){return t[1]}const Cve=1e-6;class xx{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;const i=e+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>Cve||Math.abs(this._y1-o)>Cve)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(e,n,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class _Y{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}let tNt=class{constructor(e,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:n,triangles:r},vectors:i}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,v=r.length,y,x;g1;)o-=2;for(let s=2;s0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)0){if(e>=this.xmax)return null;(s=(this.xmax-e)/r)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n1e-10)return!1}return!0}function sNt(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class zoe{static from(e,n=rNt,r=iNt,i){return new zoe("length"in e?aNt(e,n,r,i):Float64Array.from(lNt(e,n,r,i)))}constructor(e){this._delaunator=new S5(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&oNt(e)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new tNt(this,e)}*neighbors(e){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(e);f>0&&(yield a[f-1]),f=0&&o!==r&&o!==i;)r=o;return o}_step(e,n,r){const{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:l,points:c}=this;if(i[e]===-1||!c.length)return(e+1)%(c.length>>1);let u=e,f=iw(n-c[e*2],2)+iw(r-c[e*2+1],2);const d=i[e];let h=d;do{let p=l[h];const g=iw(n-c[p*2],2)+iw(r-c[p*2+1],2);if(g>5)*t[1]),m=null,v=c.length,y=-1,x=[],b=c.map(_=>({text:e(_),font:n(_),style:i(_),weight:o(_),rotate:s(_),size:~~(r(_)+1e-14),padding:a(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,S)=>S.size-_.size);++y>1,w.y=t[1]*(u()+.5)>>1,pNt(p,w,b,y),w.hasText&&h(g,w,m)&&(x.push(w),m?mNt(m,w):m=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=t[0]>>1,w.y-=t[1]>>1)}return x};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(bT<<5)/g,p.height=A3/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var v=g.x,y=g.y,x=Math.hypot(t[0],t[1]),b=l(t),w=u()<.5?1:-1,_=-w,S,O,k;(S=b(_+=w))&&(O=~~S[0],k=~~S[1],!(Math.min(Math.abs(O),Math.abs(k))>=x));)if(g.x=v+O,g.y=y+k,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>t[0]||g.y+g.y1>t[1])&&(!m||!gNt(g,p,t[0]))&&(!m||vNt(g,m))){for(var E=g.sprite,P=g.width>>5,A=t[0]>>5,R=g.x-(P<<4),T=R&127,M=32-T,I=g.y1-g.y0,z=(g.y+g.y0)*A+(R>>5),F,N=0;N>>T:0);z+=A}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(c=p,f):c},f.size=function(p){return arguments.length?(t=[+p[0],+p[1]],f):t},f.font=function(p){return arguments.length?(n=y0(p),f):n},f.fontStyle=function(p){return arguments.length?(i=y0(p),f):i},f.fontWeight=function(p){return arguments.length?(o=y0(p),f):o},f.rotate=function(p){return arguments.length?(s=y0(p),f):s},f.text=function(p){return arguments.length?(e=y0(p),f):e},f.spiral=function(p){return arguments.length?(l=bNt[p]||p,f):l},f.fontSize=function(p){return arguments.length?(r=y0(p),f):r},f.padding=function(p){return arguments.length?(a=y0(p),f):a},f.random=function(p){return arguments.length?(u=p,f):u},f}function pNt(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,(bT<<5)/o,A3/o);var s=0,a=0,l=0,c=n.length,u,f,d,h,p;for(--r;++r>5<<5,d=~~Math.max(Math.abs(y+x),Math.abs(y-x))}else u=u+31>>5<<5;if(d>l&&(l=d),s+u>=bT<<5&&(s=0,a+=l,l=0),a+d>=A3)break;i.translate((s+(u>>1))/o,(a+(d>>1))/o),e.rotate&&i.rotate(e.rotate*DV),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=u,e.height=d,e.xoff=s,e.yoff=a,e.x1=u>>1,e.y1=d>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,s+=u}for(var w=i.getImageData(0,0,(bT<<5)/o,A3/o).data,_=[];--r>=0;)if(e=n[r],!!e.hasText){for(u=e.width,f=u>>5,d=e.y1-e.y0,h=0;h>5),E=w[(a+p)*(bT<<5)+(s+h)<<2]?1<<31-h%32:0;_[k]|=E,S|=E}S?O=p:(e.y0++,d--,p--,a++)}e.y1=e.y0+O,e.sprite=_.slice(0,(e.y1-e.y0)*f)}}}function gNt(t,e,n){n>>=5;for(var r=t.sprite,i=t.width>>5,o=t.x-(i<<4),s=o&127,a=32-s,l=t.y1-t.y0,c=(t.y+t.y0)*n+(o>>5),u,f=0;f>>s:0))&e[c+d])return!0;c+=n}return!1}function mNt(t,e){var n=t[0],r=t[1];e.x+e.x0r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function vNt(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0g(p(m))}i.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const c=o.words(i).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(a).random(ku).layout(),u=o.size(),f=u[0]>>1,d=u[1]>>1,h=c.length;for(let p=0,g,m;pnew Uint8Array(t),CNt=t=>new Uint16Array(t),hk=t=>new Uint32Array(t);function ONt(){let t=8,e=[],n=hk(0),r=KI(0,t),i=KI(0,t);return{data:()=>e,seen:()=>n=ENt(n,e.length),add(o){for(let s=0,a=e.length,l=o.length,c;se.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>t<257?255:t<65537?65535:4294967295,set(o,s){r[o]|=s},clear(o,s){r[o]&=~s},resize(o,s){const a=r.length;(o>a||s>t)&&(t=Math.max(s,t),r=KI(o,t,r),i=KI(o,t))}}}function ENt(t,e,n){return t.length>=e?t:(n=n||new t.constructor(e),n.set(t),n)}function KI(t,e,n){const r=(e<257?SNt:e<65537?CNt:hk)(t);return n&&r.set(n),r}function Ove(t,e,n){const r=1<0)for(m=0;mt,size:()=>n}}function TNt(t,e){return t.sort.call(e,(n,r)=>{const i=t[n],o=t[r];return io?1:0}),ROt(t,e)}function kNt(t,e,n,r,i,o,s,a,l){let c=0,u=0,f;for(f=0;ce.modified(r.fields));return n?this.reinit(t,e):this.eval(t,e)}else return this.init(t,e)},init(t,e){const n=t.fields,r=t.query,i=this._indices={},o=this._dims=[],s=r.length;let a=0,l,c;for(;a{const o=i.remove(e,n);for(const s in r)r[s].reindex(o)})},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,s=r.length;let a=0,l,c;for(n.filters=0,c=0;ch)for(m=h,v=Math.min(f,p);mp)for(m=Math.max(f,p),v=d;mf)for(p=f,g=Math.min(c,d);pd)for(p=Math.max(c,d),g=u;pa[u]&n?null:s[u];return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,u=>{const f=a[u]&n;return!f&&f^l[u]&n?s[u]:null}),o.filter(o.REM,u=>{const f=a[u]&n;return f&&!(f^(f^l[u]&n))?s[u]:null})):(o.filter(o.ADD,c),o.filter(o.REM,u=>(a[u]&n)===i?s[u]:null)),o.filter(o.SOURCE,u=>c(u._index))}});const ANt=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:Uoe,resolvefilter:Woe},Symbol.toStringTag,{value:"Module"})),PNt="RawCode",wb="Literal",MNt="Property",RNt="Identifier",DNt="ArrayExpression",INt="BinaryExpression",Dze="CallExpression",LNt="ConditionalExpression",$Nt="LogicalExpression",FNt="MemberExpression",NNt="ObjectExpression",zNt="UnaryExpression";function rd(t){this.type=t}rd.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=jNt(this),n=0,r=e.length;n";qh[_b]="Identifier";qh[Yy]="Keyword";qh[KB]="Null";qh[g1]="Numeric";qh[qa]="Punctuator";qh[AR]="String";qh[BNt]="RegularExpression";var UNt="ArrayExpression",WNt="BinaryExpression",VNt="CallExpression",GNt="ConditionalExpression",Ize="Identifier",HNt="Literal",qNt="LogicalExpression",XNt="MemberExpression",YNt="ObjectExpression",QNt="Property",KNt="UnaryExpression",zo="Unexpected token %0",ZNt="Unexpected number",JNt="Unexpected string",e5t="Unexpected identifier",t5t="Unexpected reserved word",n5t="Unexpected end of input",SY="Invalid regular expression",IV="Invalid regular expression: missing /",Lze="Octal literals are not allowed in strict mode.",r5t="Duplicate data property in object literal not allowed in strict mode",gs="ILLEGAL",zA="Disabled.",i5t=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),o5t=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function ZB(t,e){if(!t)throw new Error("ASSERT: "+e)}function zp(t){return t>=48&&t<=57}function Voe(t){return"0123456789abcdefABCDEF".includes(t)}function pk(t){return"01234567".includes(t)}function s5t(t){return t===32||t===9||t===11||t===12||t===160||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function jA(t){return t===10||t===13||t===8232||t===8233}function PR(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t===92||t>=128&&i5t.test(String.fromCharCode(t))}function C5(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===92||t>=128&&o5t.test(String.fromCharCode(t))}const a5t={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function $ze(){for(;ze1114111||t!=="}")&&Zn({},zo,gs),e<=65535?String.fromCharCode(e):(n=(e-65536>>10)+55296,r=(e-65536&1023)+56320,String.fromCharCode(n,r))}function Fze(){var t,e;for(t=Pt.charCodeAt(ze++),e=String.fromCharCode(t),t===92&&(Pt.charCodeAt(ze)!==117&&Zn({},zo,gs),++ze,t=CY("u"),(!t||t==="\\"||!PR(t.charCodeAt(0)))&&Zn({},zo,gs),e=t);ze>>=")return ze+=4,{type:qa,value:s,start:t,end:ze};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return ze+=3,{type:qa,value:o,start:t,end:ze};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".includes(r)||i==="=>")return ze+=2,{type:qa,value:i,start:t,end:ze};if(i==="//"&&Zn({},zo,gs),"<>=!+-*%&|^/".includes(r))return++ze,{type:qa,value:r,start:t,end:ze};Zn({},zo,gs)}function f5t(t){let e="";for(;ze{if(parseInt(i,16)<=1114111)return"x";Zn({},SY)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Zn({},SY)}try{return new RegExp(t,e)}catch{return null}}function g5t(){var t,e,n,r,i;for(t=Pt[ze],ZB(t==="/","Regular expression literal must start with a slash"),e=Pt[ze++],n=!1,r=!1;ze=0&&Zn({},SY,n),{value:n,literal:e}}function v5t(){var t,e,n,r;return br=null,$ze(),t=ze,e=g5t(),n=m5t(),r=p5t(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:ze}}function y5t(t){return t.type===_b||t.type===Yy||t.type===QB||t.type===KB}function Nze(){if($ze(),ze>=Js)return{type:kR,start:ze,end:ze};const t=Pt.charCodeAt(ze);return PR(t)?u5t():t===40||t===41||t===59?LV():t===39||t===34?h5t():t===46?zp(Pt.charCodeAt(ze+1))?Tve():LV():zp(t)?Tve():LV()}function rl(){const t=br;return ze=t.end,br=Nze(),ze=t.end,t}function zze(){const t=ze;br=Nze(),ze=t}function x5t(t){const e=new rd(UNt);return e.elements=t,e}function kve(t,e,n){const r=new rd(t==="||"||t==="&&"?qNt:WNt);return r.operator=t,r.left=e,r.right=n,r}function b5t(t,e){const n=new rd(VNt);return n.callee=t,n.arguments=e,n}function w5t(t,e,n){const r=new rd(GNt);return r.test=t,r.consequent=e,r.alternate=n,r}function Goe(t){const e=new rd(Ize);return e.name=t,e}function wT(t){const e=new rd(HNt);return e.value=t.value,e.raw=Pt.slice(t.start,t.end),t.regex&&(e.raw==="//"&&(e.raw="/(?:)/"),e.regex=t.regex),e}function Ave(t,e,n){const r=new rd(XNt);return r.computed=t==="[",r.object=e,r.property=n,r.computed||(n.member=!0),r}function _5t(t){const e=new rd(YNt);return e.properties=t,e}function Pve(t,e,n){const r=new rd(QNt);return r.key=e,r.value=n,r.kind=t,r}function S5t(t,e){const n=new rd(KNt);return n.operator=t,n.argument=e,n.prefix=!0,n}function Zn(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,(o,s)=>(ZB(s":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function L5t(){var t,e,n,r,i,o,s,a,l,c;if(t=br,l=P3(),r=br,i=Dve(r),i===0)return l;for(r.prec=i,rl(),e=[t,br],s=P3(),o=[l,r,s];(i=Dve(br))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),e.pop(),n=kve(a,l,s),o.push(n);r=rl(),r.prec=i,o.push(r),e.push(br),n=P3(),o.push(n)}for(c=o.length-1,n=o[c],e.pop();c>1;)e.pop(),n=kve(o[c-1].value,o[c-2],n),c-=2;return n}function Sb(){var t,e,n;return t=L5t(),ti("?")&&(rl(),e=Sb(),ea(":"),n=Sb(),t=w5t(t,e,n)),t}function Hoe(){const t=Sb();if(ti(","))throw new Error(zA);return t}function qoe(t){Pt=t,ze=0,Js=Pt.length,br=null,zze();const e=Hoe();if(br.type!==kR)throw new Error("Unexpect token after expression.");return e}var jze={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function Bze(t){function e(s,a,l,c){let u=t(a[0]);return l&&(u=l+"("+u+")",l.lastIndexOf("new ",0)===0&&(u="("+u+")")),u+"."+s+(c<0?"":c===0?"()":"("+a.slice(1).map(t).join(",")+")")}function n(s,a,l){return c=>e(s,c,a,l)}const r="new Date",i="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&je("Missing arguments to clamp function."),s.length>3&&je("Too many arguments to clamp function.");const a=s.map(t);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&je("Missing arguments to if function."),s.length>3&&je("Too many arguments to if function.");const a=s.map(t);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function $5t(t){const e=t&&t.length-1;return e&&(t[0]==='"'&&t[e]==='"'||t[0]==="'"&&t[e]==="'")?t.slice(1,-1):t}function Uze(t){t=t||{};const e=t.allowed?Wf(t.allowed):{},n=t.forbidden?Wf(t.forbidden):{},r=t.constants||jze,i=(t.functions||Bze)(f),o=t.globalvar,s=t.fieldvar,a=fn(o)?o:p=>`${o}["${p}"]`;let l={},c={},u=0;function f(p){if(gt(p))return p;const g=d[p.type];return g==null&&je("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return u>0?g:vt(n,g)?je("Illegal identifier: "+g):vt(r,g)?r[g]:vt(e,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(u+=1);const v=f(p.property);return m===s&&(c[$5t(v)]=1),g&&(u-=1),m+(g?"."+v:"["+v+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&je("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,v=vt(i,g)&&i[g];return v||je("Unrecognized function: "+g),fn(v)?v(m):v+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{u+=1;const g=f(p.key);return u-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},g}return h.functions=i,h.constants=r,h}const Ive=Symbol("vega_selection_getter");function Wze(t){return(!t.getter||!t.getter[Ive])&&(t.getter=Ou(t.field),t.getter[Ive]=!0),t.getter}const Xoe="intersect",Lve="union",F5t="vlMulti",N5t="vlPoint",$ve="or",z5t="and",Ld="_vgsid_",BA=Ou(Ld),j5t="E",B5t="R",U5t="R-E",W5t="R-LE",V5t="R-RE",O5="index:unit";function Fve(t,e){for(var n=e.fields,r=e.values,i=n.length,o=0,s,a;ocn(e.fields?{values:e.fields.map(r=>Wze(r)(n.datum))}:{[Ld]:BA(n.datum)},e))}function Q5t(t,e,n,r){for(var i=this.context.data[t],o=i?i.values.value:[],s={},a={},l={},c,u,f,d,h,p,g,m,v,y,x=o.length,b=0,w,_;b(S[u[k].field]=O,S),{})))}else h=Ld,p=BA(c),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Ld]:p}));if(e=e||Lve,s[Ld]?s[Ld]=FV[`${Ld}_${e}`](...Object.values(s[Ld])):Object.keys(s).forEach(S=>{s[S]=Object.keys(s[S]).map(O=>s[S][O]).reduce((O,k)=>O===void 0?k:FV[`${l[S]}_${e}`](O,k))}),o=Object.keys(a),n&&o.length){const S=r?N5t:F5t;s[S]=e===Lve?{[$ve]:o.reduce((O,k)=>(O.push(...a[k]),O),[])}:{[z5t]:o.map(O=>({[$ve]:a[O]}))}}return s}var FV={[`${Ld}_union`]:BOt,[`${Ld}_intersect`]:zOt,E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;ne.indexOf(n)>=0):e},R_union:function(t,e){var n=Ys(e[0]),r=Ys(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]r&&(n=e[1],r=e[0]),t.length?rr&&(t[1]=r),t):[n,r]}};const K5t=":",Z5t="@";function Yoe(t,e,n,r){e[0].type!==wb&&je("First argument to selection functions must be a string literal.");const i=e[0].value,o=e.length>=2&&$n(e).value,s="unit",a=Z5t+s,l=K5t+i;o===Xoe&&!vt(r,a)&&(r[a]=n.getData(i).indataRef(n,s)),vt(r,l)||(r[l]=n.getData(i).tuplesRef())}function Gze(t){const e=this.context.data[t];return e?e.values.value:[]}function J5t(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i&&i.count}function ezt(t,e){const n=this.context.dataflow,r=this.context.data[t],i=r.input;return n.pulse(i,n.changeset().remove(Eu).insert(e)),1}function tzt(t,e,n){if(t){const r=this.context.dataflow,i=t.mark.source;r.pulse(i,r.changeset().encode(t,e))}return n!==void 0?n:t}const MR=t=>function(e,n){const r=this.context.dataflow.locale();return e===null?"null":r[t](n)(e)},nzt=MR("format"),Hze=MR("timeFormat"),rzt=MR("utcFormat"),izt=MR("timeParse"),ozt=MR("utcParse"),ZI=new Date(2e3,0,1);function e6(t,e,n){return!Number.isInteger(t)||!Number.isInteger(e)?"":(ZI.setYear(2e3),ZI.setMonth(t),ZI.setDate(e),Hze.call(this,ZI,n))}function szt(t){return e6.call(this,t,1,"%B")}function azt(t){return e6.call(this,t,1,"%b")}function lzt(t){return e6.call(this,0,2+t,"%A")}function czt(t){return e6.call(this,0,2+t,"%a")}const uzt=":",fzt="@",OY="%",qze="$";function Qoe(t,e,n,r){e[0].type!==wb&&je("First argument to data functions must be a string literal.");const i=e[0].value,o=uzt+i;if(!vt(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function dzt(t,e,n,r){e[0].type!==wb&&je("First argument to indata must be a string literal."),e[1].type!==wb&&je("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,s=fzt+o;vt(s,r)||(r[s]=n.getData(i).indataRef(n,o))}function Ta(t,e,n,r){if(e[0].type===wb)Nve(n,r,e[0].value);else for(t in n.scales)Nve(n,r,t)}function Nve(t,e,n){const r=OY+n;if(!vt(e,r))try{e[r]=t.scaleRef(n)}catch{}}function Xh(t,e){if(fn(t))return t;if(gt(t)){const n=e.scales[t];return n&&SPt(n.value)?n.value:void 0}}function hzt(t,e,n){e.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=Ta,n._range=Ta,n._scale=Ta;const r=i=>"_["+(i.type===wb?rt(OY+i.value):rt(OY)+"+"+t(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${t(i[1])})`}}function Koe(t,e){return function(n,r,i){if(n){const o=Xh(n,(i||this).context);return o&&o.path[t](r)}else return e(r)}}const pzt=Koe("area",NIt),gzt=Koe("bounds",UIt),mzt=Koe("centroid",XIt);function vzt(t,e){const n=Xh(t,(e||this).context);return n&&n.scale()}function yzt(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n}function Zoe(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}function xzt(){return Zoe(this.context.dataflow,"warn",arguments)}function bzt(){return Zoe(this.context.dataflow,"info",arguments)}function wzt(){return Zoe(this.context.dataflow,"debug",arguments)}function NV(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function EY(t){const e=ay(t),n=NV(e.r),r=NV(e.g),i=NV(e.b);return .2126*n+.7152*r+.0722*i}function _zt(t,e){const n=EY(t),r=EY(e),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function Szt(){const t=[].slice.call(arguments);return t.unshift({}),cn(...t)}function Xze(t,e){return t===e||t!==t&&e!==e?!0:We(t)?We(e)&&t.length===e.length?Czt(t,e):!1:ht(t)&&ht(e)?Yze(t,e):!1}function Czt(t,e){for(let n=0,r=t.length;nYze(t,e)}function Ozt(t,e,n,r,i,o){const s=this.context.dataflow,a=this.context.data[t],l=a.input,c=s.stamp();let u=a.changes,f,d;if(s._trigger===!1||!(l.value.length||e||r))return 0;if((!u||u.stamp{a.modified=!0,s.pulse(l,u).run()},!0,1)),n&&(f=n===!0?Eu:We(n)||oB(n)?n:zve(n),u.remove(f)),e&&u.insert(e),r&&(f=zve(r),l.value.some(f)?u.remove(f):u.insert(r)),i)for(d in o)u.modify(i,d,o[d]);return 1}function Ezt(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.hypot(n,r)}function Tzt(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}const jve={};function kzt(t,e){const n=jve[e]||(jve[e]=Ou(e));return We(t)?t.map(n):n(t)}function Joe(t){return We(t)||ArrayBuffer.isView(t)?t:null}function ese(t){return Joe(t)||(gt(t)?t:null)}function Azt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;ro.stop(c(u),t(u))),o}function Wzt(t,e,n){const r=Xh(t,(n||this).context);return function(i){return r?r.path.context(i)(e):""}}function Vzt(t){let e=null;return function(n){return n?MA(n,e=e||HS(t)):t}}const Qze=t=>t.data;function Kze(t,e){const n=Gze.call(e,t);return n.root&&n.root.lookup||{}}function Gzt(t,e,n){const r=Kze(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(Qze):void 0}function Hzt(t,e){const n=Kze(t,this)[e];return n?n.ancestors().map(Qze):void 0}const Zze=()=>typeof window<"u"&&window||null;function qzt(){const t=Zze();return t?t.screen:{}}function Xzt(){const t=Zze();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]}function Yzt(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]}function Jze(t,e,n){if(!t)return[];const[r,i]=t,o=new uo().set(r[0],r[1],i[0],i[1]),s=n||this.context.dataflow.scenegraph().root;return $Ne(s,o,Qzt(e))}function Qzt(t){let e=null;if(t){const n=pt(t.marktype),r=pt(t.markname);e=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return e}function Kzt(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;t=pt(t);const i=t[t.length-1];return i===void 0||Math.hypot(i[0]-e,i[1]-n)>r?[...t,[e,n]]:t}function Zzt(t){return pt(t).reduce((e,n,r)=>{let[i,o]=n;return e+=r==0?`M ${i},${o} `:r===t.length-1?" Z":`L ${i},${o} `},"")}function Jzt(t,e,n){const{x:r,y:i,mark:o}=n,s=new uo().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,c]of e)ls.x2&&(s.x2=l),cs.y2&&(s.y2=c);return s.translate(r,i),Jze([[s.x1,s.y1],[s.x2,s.y2]],t,o).filter(l=>ejt(l.x,l.y,e))}function ejt(t,e,n){let r=0;for(let i=0,o=n.length-1;ie!=a>e&&t<(s-l)*(e-c)/(a-c)+l&&r++}return r&1}const UA={random(){return ku()},cumulativeNormal:uB,cumulativeLogNormal:nre,cumulativeUniform:sre,densityNormal:Kne,densityLogNormal:tre,densityUniform:ore,quantileNormal:fB,quantileLogNormal:rre,quantileUniform:are,sampleNormal:cB,sampleLogNormal:ere,sampleUniform:ire,isArray:We,isBoolean:Vy,isDate:Nv,isDefined(t){return t!==void 0},isNumber:Jn,isObject:ht,isRegExp:nLe,isString:gt,isTuple:oB,isValid(t){return t!=null&&t===t},toBoolean:Pne,toDate(t){return Mne(t)},toNumber:Ys,toString:Rne,indexof:Pzt,join:Azt,lastindexof:Mzt,replace:Dzt,reverse:Izt,slice:Rzt,flush:eLe,lerp:rLe,merge:Szt,pad:sLe,peek:$n,pluck:kzt,span:tR,inrange:u_,truncate:aLe,rgb:ay,lab:PN,hcl:MN,hsl:kN,luminance:EY,contrast:_zt,sequence:sl,format:nzt,utcFormat:rzt,utcParse:ozt,utcOffset:jLe,utcSequence:WLe,timeFormat:Hze,timeParse:izt,timeOffset:zLe,timeSequence:ULe,timeUnitSpecifier:kLe,monthFormat:szt,monthAbbrevFormat:azt,dayFormat:lzt,dayAbbrevFormat:czt,quarter:QIe,utcquarter:KIe,week:PLe,utcweek:DLe,dayofyear:ALe,utcdayofyear:RLe,warn:xzt,info:bzt,debug:wzt,extent(t){return kh(t)},inScope:yzt,intersect:Jze,clampRange:ZIe,pinchDistance:Ezt,pinchAngle:Tzt,screen:qzt,containerSize:Yzt,windowSize:Xzt,bandspace:Lzt,setdata:ezt,pathShape:Vzt,panLinear:HIe,panLog:qIe,panPow:XIe,panSymlog:YIe,zoomLinear:Cne,zoomLog:One,zoomPow:hN,zoomSymlog:Ene,encode:tzt,modify:Ozt,lassoAppend:Kzt,lassoPath:Zzt,intersectLasso:Jzt},tjt=["view","item","group","xy","x","y"],njt="event.vega.",eje="this.",tse={},tje={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>`_[${rt(qze+t)}]`,functions:rjt,constants:jze,visitors:tse},TY=Uze(tje);function rjt(t){const e=Bze(t);tjt.forEach(n=>e[n]=njt+n);for(const n in UA)e[n]=eje+n;return cn(e,hzt(t,UA,tse)),e}function Ki(t,e,n){return arguments.length===1?UA[t]:(UA[t]=e,n&&(tse[t]=n),TY&&(TY.functions[t]=eje+t),this)}Ki("bandwidth",$zt,Ta);Ki("copy",Fzt,Ta);Ki("domain",Nzt,Ta);Ki("range",jzt,Ta);Ki("invert",zzt,Ta);Ki("scale",Bzt,Ta);Ki("gradient",Uzt,Ta);Ki("geoArea",pzt,Ta);Ki("geoBounds",gzt,Ta);Ki("geoCentroid",mzt,Ta);Ki("geoShape",Wzt,Ta);Ki("geoScale",vzt,Ta);Ki("indata",J5t,dzt);Ki("data",Gze,Qoe);Ki("treePath",Gzt,Qoe);Ki("treeAncestors",Hzt,Qoe);Ki("vlSelectionTest",G5t,Yoe);Ki("vlSelectionIdTest",X5t,Yoe);Ki("vlSelectionResolve",Q5t,Yoe);Ki("vlSelectionTuples",Y5t);function Dh(t,e){const n={};let r;try{t=gt(t)?t:rt(t)+"",r=qoe(t)}catch{je("Expression parse error: "+t)}r.visit(o=>{if(o.type!==Dze)return;const s=o.callee.name,a=tje.visitors[s];a&&a(s,o.arguments,e,n)});const i=TY(r);return i.globals.forEach(o=>{const s=qze+o;!vt(n,s)&&e.getSignal(o)&&(n[s]=e.signalRef(o))}),{$expr:cn({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function ijt(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach(r=>e.parseOperator(r)),n.forEach(r=>e.parseOperatorParameters(r)),(t.streams||[]).forEach(r=>e.parseStream(r)),(t.updates||[]).forEach(r=>e.parseUpdate(r)),e.resolve()}const ojt=Wf(["rule"]),Bve=Wf(["group","image","rect"]);function sjt(t,e){let n="";return ojt[e]||(t.x2&&(t.x?(Bve[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(Bve[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function nse(t){return(t+"").toLowerCase()}function ajt(t){return nse(t)==="operator"}function ljt(t){return nse(t)==="collect"}function o2(t,e,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}function cjt(t,e,n,r){return`((u = ${t}) < (v = ${e}) || u == null) && v != null ? ${n} +`)}function c(f){return f.map(u).join(t)}function u(f){return f==null?"":f instanceof Date?mOt(f):e.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:s,formatBody:a,formatRows:l,formatRow:c,formatValue:u}}function yOt(t){return t}function xOt(t){if(t==null)return yOt;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(a,l){l||(e=n=0);var c=2,u=a.length,f=new Array(u);for(f[0]=(e+=a[0])*r+o,f[1]=(n+=a[1])*i+s;c1)r=OOt(t,e,n);else for(i=0,r=new Array(o=t.arcs.length);ie?1:t>=e?0:NaN}function EOt(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function wO(t){let e,n,r;t.length!==2?(e=mh,n=(a,l)=>mh(t(a),l),r=(a,l)=>t(a)-l):(e=t===mh||t===EOt?t:TOt,n=t,r=t);function i(a,l,c=0,u=a.length){if(c>>1;n(a[f],l)<0?c=f+1:u=f}while(c>>1;n(a[f],l)<=0?c=f+1:u=f}while(cc&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function TOt(){return 0}function uLe(t){return t===null?NaN:+t}function*kOt(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const fLe=wO(mh),Lg=fLe.right,AOt=fLe.left;wO(uLe).center;function POt(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let s of t)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of t)(a=e(a,++s,t))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function MOt(t,e){const n=POt(t,e);return n&&Math.sqrt(n)}class Ea{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i0){for(s=e[--n];n>0&&(r=s,i=e[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}class Fpe extends Map{constructor(e,n=pLe){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(rX(this,e))}has(e){return super.has(rX(this,e))}set(e,n){return super.set(dLe(this,e),n)}delete(e){return super.delete(hLe(this,e))}}class pN extends Set{constructor(e,n=pLe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const r of e)this.add(r)}has(e){return super.has(rX(this,e))}add(e){return super.add(dLe(this,e))}delete(e){return super.delete(hLe(this,e))}}function rX({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function dLe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function hLe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function pLe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function ROt(t,e){return Array.from(e,n=>t[n])}function DOt(t=mh){if(t===mh)return gLe;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 gLe(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const IOt=Math.sqrt(50),LOt=Math.sqrt(10),$Ot=Math.sqrt(2);function gN(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=IOt?10:o>=LOt?5:o>=$Ot?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(t*c),l=Math.round(e*c),a/ce&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(t/c),l=Math.round(e/c),a*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function sX(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function mLe(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?gLe:DOt(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));mLe(t,e,h,p,i)}const o=t[e];let s=n,a=r;for(GE(t,n,e),i(t[r],o)>0&&GE(t,n,r);s0;)--a}i(t[n],o)===0?GE(t,n,a):(++a,GE(t,a,r)),a<=e&&(n=a+1),e<=a&&(r=a-1)}return t}function GE(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function mN(t,e,n){if(t=Float64Array.from(kOt(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return sX(t);if(e>=1)return Nx(t);var r,i=(r-1)*e,o=Math.floor(i),s=Nx(mLe(t,o).subarray(0,o+1)),a=sX(t.subarray(o+1));return s+(a-s)*(i-o)}}function vLe(t,e,n=uLe){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),s=+n(t[o],o,t),a=+n(t[o+1],o+1,t);return s+(a-s)*(i-o)}}function FOt(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function yLe(t,e){return mN(t,.5,e)}function*NOt(t){for(const e of t)yield*e}function xLe(t){return Array.from(NOt(t))}function sl(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=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function vN(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 LS(t){return t=vN(Math.abs(t)),t?t[1]:NaN}function WOt(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function VOt(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var GOt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function hb(t){if(!(e=GOt.exec(t)))throw new Error("invalid format: "+t);var e;return new Dne({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]})}hb.prototype=Dne.prototype;function Dne(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+""}Dne.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 HOt(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 wLe;function qOt(t,e){var n=vN(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(wLe=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+vN(t,Math.max(0,e+o-1))[0]}function Npe(t,e){var n=vN(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 zpe={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:UOt,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)=>Npe(t*100,e),r:Npe,s:qOt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function jpe(t){return t}var Bpe=Array.prototype.map,Upe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _Le(t){var e=t.grouping===void 0||t.thousands===void 0?jpe:WOt(Bpe.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?jpe:VOt(Bpe.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=hb(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,v=f.width,y=f.comma,x=f.precision,b=f.trim,w=f.type;w==="n"?(y=!0,w="g"):zpe[w]||(x===void 0&&(x=12),b=!0,w="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",S=g==="$"?r:/[%p]/.test(w)?s:"",O=zpe[w],k=/[defgprs%]/.test(w);x=x===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function E(P){var A=_,R=S,T,M,I;if(w==="c")R=O(P)+R,P="";else{P=+P;var z=P<0||1/P<0;if(P=isNaN(P)?l:O(Math.abs(P),x),b&&(P=HOt(P)),z&&+P==0&&p!=="+"&&(z=!1),A=(z?p==="("?p:a:p==="-"||p==="("?"":p)+A,R=(w==="s"?Upe[8+wLe/3]:"")+R+(z&&p==="("?")":""),k){for(T=-1,M=P.length;++TI||I>57){R=(I===46?i+P.slice(T+1):P.slice(T))+R,P=P.slice(0,T);break}}}y&&!m&&(P=e(P,1/0));var F=A.length+P.length+R.length,N=F>1)+A+P+R+N.slice(F);break;default:P=N+A+P+R;break}return o(P)}return E.toString=function(){return f+""},E}function u(f,d){var h=c((f=hb(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(LS(d)/3)))*3,g=Math.pow(10,-p),m=Upe[8+p/3];return function(v){return h(g*v)+m}}return{format:c,formatPrefix:u}}var kI,K4,Ine;XOt({thousands:",",grouping:[3],currency:["$",""]});function XOt(t){return kI=_Le(t),K4=kI.format,Ine=kI.formatPrefix,kI}function SLe(t){return Math.max(0,-LS(Math.abs(t)))}function CLe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(LS(e)/3)))*3-LS(Math.abs(t)))}function OLe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,LS(e)-LS(t))+1}const BW=new Date,UW=new Date;function ko(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 s=i(o),a=i.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,a),t(o);while(cko(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(i.count=(o,s)=>(BW.setTime(+o),UW.setTime(+s),t(BW),t(UW),Math.floor(n(BW,UW))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const $S=ko(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);$S.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ko(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):$S);$S.range;const Yp=1e3,ru=Yp*60,Qp=ru*60,$g=Qp*24,Lne=$g*7,Wpe=$g*30,WW=$g*365,Kp=ko(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Yp)},(t,e)=>(e-t)/Yp,t=>t.getUTCSeconds());Kp.range;const Z4=ko(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Yp)},(t,e)=>{t.setTime(+t+e*ru)},(t,e)=>(e-t)/ru,t=>t.getMinutes());Z4.range;const J4=ko(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ru)},(t,e)=>(e-t)/ru,t=>t.getUTCMinutes());J4.range;const eB=ko(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Yp-t.getMinutes()*ru)},(t,e)=>{t.setTime(+t+e*Qp)},(t,e)=>(e-t)/Qp,t=>t.getHours());eB.range;const tB=ko(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Qp)},(t,e)=>(e-t)/Qp,t=>t.getUTCHours());tB.range;const cg=ko(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ru)/$g,t=>t.getDate()-1);cg.range;const zv=ko(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/$g,t=>t.getUTCDate()-1);zv.range;const ELe=ko(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/$g,t=>Math.floor(t/$g));ELe.range;function u1(t){return ko(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())*ru)/Lne)}const _O=u1(0),yN=u1(1),YOt=u1(2),QOt=u1(3),FS=u1(4),KOt=u1(5),ZOt=u1(6);_O.range;yN.range;YOt.range;QOt.range;FS.range;KOt.range;ZOt.range;function f1(t){return ko(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)/Lne)}const SO=f1(0),xN=f1(1),JOt=f1(2),eEt=f1(3),NS=f1(4),tEt=f1(5),nEt=f1(6);SO.range;xN.range;JOt.range;eEt.range;NS.range;tEt.range;nEt.range;const bA=ko(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());bA.range;const wA=ko(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());wA.range;const Ah=ko(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());Ah.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ko(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)});Ah.range;const Ph=ko(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());Ph.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ko(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)});Ph.range;function TLe(t,e,n,r,i,o){const s=[[Kp,1,Yp],[Kp,5,5*Yp],[Kp,15,15*Yp],[Kp,30,30*Yp],[o,1,ru],[o,5,5*ru],[o,15,15*ru],[o,30,30*ru],[i,1,Qp],[i,3,3*Qp],[i,6,6*Qp],[i,12,12*Qp],[r,1,$g],[r,2,2*$g],[n,1,Lne],[e,1,Wpe],[e,3,3*Wpe],[t,1,WW]];function a(c,u,f){const d=um).right(s,d);if(h===s.length)return t.every(ry(c/WW,u/WW,f));if(h===0)return $S.every(Math.max(ry(c,u,f),1));const[p,g]=s[d/s[h-1][2](t[e]=1+n,t),{});function Fne(t){const e=pt(t).slice(),n={};return e.length||je("Missing time unit."),e.forEach(i=>{vt(VW,i)?n[i]=1:je(`Invalid time unit: ${i}.`)}),(n[wo]||n[qs]?1:0)+(n[wl]||n[Zs]||n[_l]?1:0)+(n[Mh]?1:0)>1&&je(`Incompatible time units: ${t}`),e.sort((i,o)=>VW[i]-VW[o]),e}const aEt={[bs]:"%Y ",[wl]:"Q%q ",[Zs]:"%b ",[_l]:"%d ",[wo]:"W%U ",[qs]:"%a ",[Mh]:"%j ",[Cc]:"%H:00",[Oc]:"00:%M",[Tu]:":%S",[Vf]:".%L",[`${bs}-${Zs}`]:"%Y-%m ",[`${bs}-${Zs}-${_l}`]:"%Y-%m-%d ",[`${Cc}-${Oc}`]:"%H:%M"};function kLe(t,e){const n=cn({},aEt,e),r=Fne(t),i=r.length;let o="",s=0,a,l;for(s=0;ss;--a)if(l=r.slice(s,a).join("-"),n[l]!=null){o+=n[l],s=a;break}return o.trim()}const Z0=new Date;function Nne(t){return Z0.setFullYear(t),Z0.setMonth(0),Z0.setDate(1),Z0.setHours(0,0,0,0),Z0}function ALe(t){return MLe(new Date(t))}function PLe(t){return aX(new Date(t))}function MLe(t){return cg.count(Nne(t.getFullYear())-1,t)}function aX(t){return _O.count(Nne(t.getFullYear())-1,t)}function lX(t){return Nne(t).getDay()}function lEt(t,e,n,r,i,o,s){if(0<=t&&t<100){const a=new Date(-1,e,n,r,i,o,s);return a.setFullYear(t),a}return new Date(t,e,n,r,i,o,s)}function RLe(t){return ILe(new Date(t))}function DLe(t){return cX(new Date(t))}function ILe(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return zv.count(e-1,t)}function cX(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return SO.count(e-1,t)}function uX(t){return Z0.setTime(Date.UTC(t,0,1)),Z0.getUTCDay()}function cEt(t,e,n,r,i,o,s){if(0<=t&&t<100){const a=new Date(Date.UTC(-1,e,n,r,i,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(t,e,n,r,i,o,s))}function LLe(t,e,n,r,i){const o=e||1,s=$n(t),a=(v,y,x)=>(x=x||v,uEt(n[x],r[x],v===s&&o,y)),l=new Date,c=Wf(t),u=c[bs]?a(bs):ra(2012),f=c[Zs]?a(Zs):c[wl]?a(wl):rv,d=c[wo]&&c[qs]?a(qs,1,wo+qs):c[wo]?a(wo,1):c[qs]?a(qs,1):c[_l]?a(_l,1):c[Mh]?a(Mh,1):vO,h=c[Cc]?a(Cc):rv,p=c[Oc]?a(Oc):rv,g=c[Tu]?a(Tu):rv,m=c[Vf]?a(Vf):rv;return function(v){l.setTime(+v);const y=u(l);return i(y,f(l),d(l,y),h(l),p(l),g(l),m(l))}}function uEt(t,e,n,r){const i=n<=1?t:r?(o,s)=>r+n*Math.floor((t(o,s)-r)/n):(o,s)=>n*Math.floor(t(o,s)/n);return e?(o,s)=>e(i(o,s),s):i}function zS(t,e,n){return e+t*7-(n+6)%7}const fEt={[bs]:t=>t.getFullYear(),[wl]:t=>Math.floor(t.getMonth()/3),[Zs]:t=>t.getMonth(),[_l]:t=>t.getDate(),[Cc]:t=>t.getHours(),[Oc]:t=>t.getMinutes(),[Tu]:t=>t.getSeconds(),[Vf]:t=>t.getMilliseconds(),[Mh]:t=>MLe(t),[wo]:t=>aX(t),[wo+qs]:(t,e)=>zS(aX(t),t.getDay(),lX(e)),[qs]:(t,e)=>zS(1,t.getDay(),lX(e))},dEt={[wl]:t=>3*t,[wo]:(t,e)=>zS(t,0,lX(e))};function $Le(t,e){return LLe(t,e||1,fEt,dEt,lEt)}const hEt={[bs]:t=>t.getUTCFullYear(),[wl]:t=>Math.floor(t.getUTCMonth()/3),[Zs]:t=>t.getUTCMonth(),[_l]:t=>t.getUTCDate(),[Cc]:t=>t.getUTCHours(),[Oc]:t=>t.getUTCMinutes(),[Tu]:t=>t.getUTCSeconds(),[Vf]:t=>t.getUTCMilliseconds(),[Mh]:t=>ILe(t),[wo]:t=>cX(t),[qs]:(t,e)=>zS(1,t.getUTCDay(),uX(e)),[wo+qs]:(t,e)=>zS(cX(t),t.getUTCDay(),uX(e))},pEt={[wl]:t=>3*t,[wo]:(t,e)=>zS(t,0,uX(e))};function FLe(t,e){return LLe(t,e||1,hEt,pEt,cEt)}const gEt={[bs]:Ah,[wl]:bA.every(3),[Zs]:bA,[wo]:_O,[_l]:cg,[qs]:cg,[Mh]:cg,[Cc]:eB,[Oc]:Z4,[Tu]:Kp,[Vf]:$S},mEt={[bs]:Ph,[wl]:wA.every(3),[Zs]:wA,[wo]:SO,[_l]:zv,[qs]:zv,[Mh]:zv,[Cc]:tB,[Oc]:J4,[Tu]:Kp,[Vf]:$S};function CO(t){return gEt[t]}function OO(t){return mEt[t]}function NLe(t,e,n){return t?t.offset(e,n):void 0}function zLe(t,e,n){return NLe(CO(t),e,n)}function jLe(t,e,n){return NLe(OO(t),e,n)}function BLe(t,e,n,r){return t?t.range(e,n,r):void 0}function ULe(t,e,n,r){return BLe(CO(t),e,n,r)}function WLe(t,e,n,r){return BLe(OO(t),e,n,r)}const tT=1e3,nT=tT*60,rT=nT*60,nB=rT*24,vEt=nB*7,Vpe=nB*30,fX=nB*365,VLe=[bs,Zs,_l,Cc,Oc,Tu,Vf],iT=VLe.slice(0,-1),oT=iT.slice(0,-1),sT=oT.slice(0,-1),yEt=sT.slice(0,-1),xEt=[bs,wo],Gpe=[bs,Zs],GLe=[bs],HE=[[iT,1,tT],[iT,5,5*tT],[iT,15,15*tT],[iT,30,30*tT],[oT,1,nT],[oT,5,5*nT],[oT,15,15*nT],[oT,30,30*nT],[sT,1,rT],[sT,3,3*rT],[sT,6,6*rT],[sT,12,12*rT],[yEt,1,nB],[xEt,1,vEt],[Gpe,1,Vpe],[Gpe,3,3*Vpe],[GLe,1,fX]];function HLe(t){const e=t.extent,n=t.maxbins||40,r=Math.abs(tR(e))/n;let i=wO(a=>a[2]).right(HE,r),o,s;return i===HE.length?(o=GLe,s=ry(e[0]/fX,e[1]/fX,n)):i?(i=HE[r/HE[i-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(U=HW(qE(te.y,0,1)),oe=U.getUTCDay(),U=oe>4||oe===0?xN.ceil(U):xN(U),U=zv.offset(U,(te.V-1)*7),te.y=U.getUTCFullYear(),te.m=U.getUTCMonth(),te.d=U.getUTCDate()+(te.w+6)%7):(U=GW(qE(te.y,0,1)),oe=U.getDay(),U=oe>4||oe===0?yN.ceil(U):yN(U),U=cg.offset(U,(te.V-1)*7),te.y=U.getFullYear(),te.m=U.getMonth(),te.d=U.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),oe="Z"in te?HW(qE(te.y,0,1)).getUTCDay():GW(qE(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(oe+5)%7:te.w+te.U*7-(oe+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,HW(te)):GW(te)}}function O(ee,re,me,te){for(var ae=0,U=re.length,oe=me.length,ne,G;ae=oe)return-1;if(ne=re.charCodeAt(ae++),ne===37){if(ne=re.charAt(ae++),G=w[ne in Hpe?re.charAt(ae++):ne],!G||(te=G(ee,me,te))<0)return-1}else if(ne!=me.charCodeAt(te++))return-1}return te}function k(ee,re,me){var te=c.exec(re.slice(me));return te?(ee.p=u.get(te[0].toLowerCase()),me+te[0].length):-1}function E(ee,re,me){var te=h.exec(re.slice(me));return te?(ee.w=p.get(te[0].toLowerCase()),me+te[0].length):-1}function P(ee,re,me){var te=f.exec(re.slice(me));return te?(ee.w=d.get(te[0].toLowerCase()),me+te[0].length):-1}function A(ee,re,me){var te=v.exec(re.slice(me));return te?(ee.m=y.get(te[0].toLowerCase()),me+te[0].length):-1}function R(ee,re,me){var te=g.exec(re.slice(me));return te?(ee.m=m.get(te[0].toLowerCase()),me+te[0].length):-1}function T(ee,re,me){return O(ee,e,re,me)}function M(ee,re,me){return O(ee,n,re,me)}function I(ee,re,me){return O(ee,r,re,me)}function z(ee){return s[ee.getDay()]}function F(ee){return o[ee.getDay()]}function N(ee){return l[ee.getMonth()]}function L(ee){return a[ee.getMonth()]}function B(ee){return i[+(ee.getHours()>=12)]}function $(ee){return 1+~~(ee.getMonth()/3)}function j(ee){return s[ee.getUTCDay()]}function X(ee){return o[ee.getUTCDay()]}function V(ee){return l[ee.getUTCMonth()]}function Y(ee){return a[ee.getUTCMonth()]}function le(ee){return i[+(ee.getUTCHours()>=12)]}function K(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var re=_(ee+="",x);return re.toString=function(){return ee},re},parse:function(ee){var re=S(ee+="",!1);return re.toString=function(){return ee},re},utcFormat:function(ee){var re=_(ee+="",b);return re.toString=function(){return ee},re},utcParse:function(ee){var re=S(ee+="",!0);return re.toString=function(){return ee},re}}}var Hpe={"-":"",_:" ",0:"0"},Yo=/^\s*\d+/,bEt=/^%/,wEt=/[\\^$*+?|[\]().{}]/g;function er(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function SEt(t,e,n){var r=Yo.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function CEt(t,e,n){var r=Yo.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function OEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function EEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function TEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function qpe(t,e,n){var r=Yo.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Xpe(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function kEt(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 AEt(t,e,n){var r=Yo.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function PEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Ype(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function MEt(t,e,n){var r=Yo.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Qpe(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function REt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function DEt(t,e,n){var r=Yo.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function IEt(t,e,n){var r=Yo.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function LEt(t,e,n){var r=Yo.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function $Et(t,e,n){var r=bEt.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function FEt(t,e,n){var r=Yo.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function NEt(t,e,n){var r=Yo.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Kpe(t,e){return er(t.getDate(),e,2)}function zEt(t,e){return er(t.getHours(),e,2)}function jEt(t,e){return er(t.getHours()%12||12,e,2)}function BEt(t,e){return er(1+cg.count(Ah(t),t),e,3)}function XLe(t,e){return er(t.getMilliseconds(),e,3)}function UEt(t,e){return XLe(t,e)+"000"}function WEt(t,e){return er(t.getMonth()+1,e,2)}function VEt(t,e){return er(t.getMinutes(),e,2)}function GEt(t,e){return er(t.getSeconds(),e,2)}function HEt(t){var e=t.getDay();return e===0?7:e}function qEt(t,e){return er(_O.count(Ah(t)-1,t),e,2)}function YLe(t){var e=t.getDay();return e>=4||e===0?FS(t):FS.ceil(t)}function XEt(t,e){return t=YLe(t),er(FS.count(Ah(t),t)+(Ah(t).getDay()===4),e,2)}function YEt(t){return t.getDay()}function QEt(t,e){return er(yN.count(Ah(t)-1,t),e,2)}function KEt(t,e){return er(t.getFullYear()%100,e,2)}function ZEt(t,e){return t=YLe(t),er(t.getFullYear()%100,e,2)}function JEt(t,e){return er(t.getFullYear()%1e4,e,4)}function e2t(t,e){var n=t.getDay();return t=n>=4||n===0?FS(t):FS.ceil(t),er(t.getFullYear()%1e4,e,4)}function t2t(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+er(e/60|0,"0",2)+er(e%60,"0",2)}function Zpe(t,e){return er(t.getUTCDate(),e,2)}function n2t(t,e){return er(t.getUTCHours(),e,2)}function r2t(t,e){return er(t.getUTCHours()%12||12,e,2)}function i2t(t,e){return er(1+zv.count(Ph(t),t),e,3)}function QLe(t,e){return er(t.getUTCMilliseconds(),e,3)}function o2t(t,e){return QLe(t,e)+"000"}function s2t(t,e){return er(t.getUTCMonth()+1,e,2)}function a2t(t,e){return er(t.getUTCMinutes(),e,2)}function l2t(t,e){return er(t.getUTCSeconds(),e,2)}function c2t(t){var e=t.getUTCDay();return e===0?7:e}function u2t(t,e){return er(SO.count(Ph(t)-1,t),e,2)}function KLe(t){var e=t.getUTCDay();return e>=4||e===0?NS(t):NS.ceil(t)}function f2t(t,e){return t=KLe(t),er(NS.count(Ph(t),t)+(Ph(t).getUTCDay()===4),e,2)}function d2t(t){return t.getUTCDay()}function h2t(t,e){return er(xN.count(Ph(t)-1,t),e,2)}function p2t(t,e){return er(t.getUTCFullYear()%100,e,2)}function g2t(t,e){return t=KLe(t),er(t.getUTCFullYear()%100,e,2)}function m2t(t,e){return er(t.getUTCFullYear()%1e4,e,4)}function v2t(t,e){var n=t.getUTCDay();return t=n>=4||n===0?NS(t):NS.ceil(t),er(t.getUTCFullYear()%1e4,e,4)}function y2t(){return"+0000"}function Jpe(){return"%"}function ege(t){return+t}function tge(t){return Math.floor(+t/1e3)}var K1,zne,ZLe,jne,JLe;x2t({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 x2t(t){return K1=qLe(t),zne=K1.format,ZLe=K1.parse,jne=K1.utcFormat,JLe=K1.utcParse,K1}function aT(t){const e={};return n=>e[n]||(e[n]=t(n))}function b2t(t,e){return n=>{const r=t(n),i=r.indexOf(e);if(i<0)return r;let o=w2t(r,i);const s=oi;)if(r[o]!=="0"){++o;break}return r.slice(0,o)+s}}function w2t(t,e){let n=t.lastIndexOf("e"),r;if(n>0)return n;for(n=t.length;--n>e;)if(r=t.charCodeAt(n),r>=48&&r<=57)return n+1}function e$e(t){const e=aT(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(r){const i=hb(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return b2t(e(i),e(".1f")(1)[1])}else return e(i)},formatSpan(r,i,o,s){s=hb(s??",f");const a=ry(r,i,o),l=Math.max(Math.abs(r),Math.abs(i));let c;if(s.precision==null)switch(s.type){case"s":return isNaN(c=CLe(a,l))||(s.precision=c),n(s,l);case"":case"e":case"g":case"p":case"r":{isNaN(c=OLe(a,l))||(s.precision=c-(s.type==="e"));break}case"f":case"%":{isNaN(c=SLe(a))||(s.precision=c-(s.type==="%")*2);break}}return e(s)}}}let dX;t$e();function t$e(){return dX=e$e({format:K4,formatPrefix:Ine})}function n$e(t){return e$e(_Le(t))}function bN(t){return arguments.length?dX=n$e(t):dX}function nge(t,e,n){n=n||{},ht(n)||je(`Invalid time multi-format specifier: ${n}`);const r=e(Tu),i=e(Oc),o=e(Cc),s=e(_l),a=e(wo),l=e(Zs),c=e(wl),u=e(bs),f=t(n[Vf]||".%L"),d=t(n[Tu]||":%S"),h=t(n[Oc]||"%I:%M"),p=t(n[Cc]||"%I %p"),g=t(n[_l]||n[qs]||"%a %d"),m=t(n[wo]||"%b %d"),v=t(n[Zs]||"%B"),y=t(n[wl]||"%B"),x=t(n[bs]||"%Y");return b=>(r(b)gt(r)?e(r):nge(e,CO,r),utcFormat:r=>gt(r)?n(r):nge(n,OO,r),timeParse:aT(t.parse),utcParse:aT(t.utcParse)}}let hX;i$e();function i$e(){return hX=r$e({format:zne,parse:ZLe,utcFormat:jne,utcParse:JLe})}function o$e(t){return r$e(qLe(t))}function _A(t){return arguments.length?hX=o$e(t):hX}const pX=(t,e)=>cn({},t,e);function s$e(t,e){const n=t?n$e(t):bN(),r=e?o$e(e):_A();return pX(n,r)}function Bne(t,e){const n=arguments.length;return n&&n!==2&&je("defaultLocale expects either zero or two arguments."),n?pX(bN(t),_A(e)):pX(bN(),_A())}function _2t(){return t$e(),i$e(),Bne()}const S2t=/^(data:|([A-Za-z]+:)?\/\/)/,C2t=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,O2t=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,rge="file://";function E2t(t,e){return n=>({options:n||{},sanitize:k2t,load:T2t,fileAccess:!!e,file:A2t(e),http:M2t(t)})}async function T2t(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function k2t(t,e){e=cn({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,s;const a=C2t.test(t.replace(O2t,""));(t==null||typeof t!="string"||!a)&&je("Sanitize failure, invalid URI: "+rt(t));const l=S2t.test(t);return(s=e.baseURL)&&!l&&(!t.startsWith("/")&&!s.endsWith("/")&&(t="/"+t),t=s+t),o=(i=t.startsWith(rge))||e.mode==="file"||e.mode!=="http"&&!l&&n,i?t=t.slice(rge.length):t.startsWith("//")&&(e.defaultProtocol==="file"?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),e.context==="image"&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function A2t(t){return t?e=>new Promise((n,r)=>{t.readFile(e,(i,o)=>{i?r(i):n(o)})}):P2t}async function P2t(){je("No file system access.")}function M2t(t){return t?async function(e,n){const r=cn({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?fn(o[i])?o[i]():o.text():je(o.status+""+o.statusText)}:R2t}async function R2t(){je("No HTTP fetch method available.")}const D2t=t=>t!=null&&t===t,I2t=t=>t==="true"||t==="false"||t===!0||t===!1,L2t=t=>!Number.isNaN(Date.parse(t)),a$e=t=>!Number.isNaN(+t)&&!(t instanceof Date),$2t=t=>a$e(t)&&Number.isInteger(+t),gX={boolean:Pne,integer:Ys,number:Ys,date:Mne,string:Rne,unknown:na},AI=[I2t,$2t,a$e,L2t],F2t=["boolean","integer","number","date"];function l$e(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=AI.length,i=AI.map((o,s)=>s+1);for(let o=0,s=0,a,l;oo===0?s:o,0)-1]}function c$e(t,e){return e.reduce((n,r)=>(n[r]=l$e(t,r),n),{})}function ige(t){const e=function(n,r){const i={delimiter:t};return Une(n,r?cn(r,i):i)};return e.responseType="text",e}function Une(t,e){return e.header&&(t=e.header.map(rt).join(e.delimiter)+` +`+t),vOt(e.delimiter).parse(t+"")}Une.responseType="text";function N2t(t){return typeof Buffer=="function"&&fn(Buffer.isBuffer)?Buffer.isBuffer(t):!1}function Wne(t,e){const n=e&&e.property?Ou(e.property):na;return ht(t)&&!N2t(t)?z2t(n(t),e):n(JSON.parse(t))}Wne.responseType="json";function z2t(t,e){return!We(t)&&tLe(t)&&(t=[...t]),e&&e.copy?JSON.parse(JSON.stringify(t)):t}const j2t={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function u$e(t,e){let n,r,i,o;return t=Wne(t,e),e&&e.feature?(n=wOt,i=e.feature):e&&e.mesh?(n=SOt,i=e.mesh,o=j2t[e.filter]):je("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):je("Invalid TopoJSON object: "+i),r&&r.features||[r]}u$e.responseType="json";const d3={dsv:Une,csv:ige(","),tsv:ige(" "),json:Wne,topojson:u$e};function Vne(t,e){return arguments.length>1?(d3[t]=e,this):vt(d3,t)?d3[t]:null}function f$e(t){const e=Vne(t);return e&&e.responseType||"text"}function d$e(t,e,n,r){e=e||{};const i=Vne(e.type||"json");return i||je("Unknown data format type: "+e.type),t=i(t,e),e.parse&&B2t(t,e.parse,n,r),vt(t,"columns")&&delete t.columns,t}function B2t(t,e,n,r){if(!t.length)return;const i=_A();n=n||i.timeParse,r=r||i.utcParse;let o=t.columns||Object.keys(t[0]),s,a,l,c,u,f;e==="auto"&&(e=c$e(t,o)),o=Object.keys(e);const d=o.map(h=>{const p=e[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?r:n)(m);if(!gX[p])throw Error("Illegal format pattern: "+h+":"+p);return gX[p]});for(l=0,u=t.length,f=o.length;l{const o=e(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{const o=e(i);if(r[o]){r[o]=0;const s=n.indexOf(i);s>=0&&n.splice(s,1)}return n},n}async function h3(t,e){try{await e(t)}catch(n){t.error(n)}}const h$e=Symbol("vega_id");let U2t=1;function oB(t){return!!(t&&jt(t))}function jt(t){return t[h$e]}function p$e(t,e){return t[h$e]=e,t}function cr(t){const e=t===Object(t)?t:{data:t};return jt(e)?e:p$e(e,U2t++)}function Gne(t){return sB(t,cr({}))}function sB(t,e){for(const n in t)e[n]=t[n];return e}function g$e(t,e){return p$e(e,jt(t))}function d1(t,e){return t?e?(n,r)=>t(n,r)||jt(e(n))-jt(e(r)):(n,r)=>t(n,r)||jt(n)-jt(r):null}function m$e(t){return t&&t.constructor===h1}function h1(){const t=[],e=[],n=[],r=[],i=[];let o=null,s=!1;return{constructor:h1,insert(a){const l=pt(a),c=l.length;for(let u=0;u{p(y)&&(c[jt(y)]=-1)});for(f=0,d=t.length;f0&&(v(g,p,h.value),a.modifies(p));for(f=0,d=i.length;f{p(y)&&c[jt(y)]>0&&v(y,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=e.length||r.length?l.filter(y=>c[jt(y)]>0):l.slice();else for(m in u)a.mod.push(u[m]);return(o||o==null&&(e.length||r.length))&&a.clean(!0),a}}}const p3="_:mod:_";function aB(){Object.defineProperty(this,p3,{writable:!0,value:{}})}aB.prototype={set(t,e,n,r){const i=this,o=i[t],s=i[p3];return e!=null&&e>=0?(o[e]!==n||r)&&(o[e]=n,s[e+":"+t]=-1,s[t]=-1):(o!==n||r)&&(i[t]=n,s[t]=We(n)?1+n.length:-1),i},modified(t,e){const n=this[p3];if(arguments.length){if(We(t)){for(let r=0;r=0?e+1{h instanceof Lr?(h!==this&&(e&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(s in t)if(a=t[s],s===V2t)pt(a).forEach(f=>{f instanceof Lr?f!==this&&(f.targets().add(this),o.push(f)):je("Pulse parameters must be operator instances.")}),this.source=a;else if(We(a))for(r.set(s,-1,Array(l=a.length)),c=0;c{const n=Date.now();return n-e>t?(e=n,1):0})},debounce(t){const e=Dm();return this.targets().add(Dm(null,null,kne(t,n=>{const r=n.dataflow;e.receive(n),r&&r.run&&r.run()}))),e},between(t,e){let n=!1;return t.targets().add(Dm(null,null,()=>n=!0)),e.targets().add(Dm(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Eu,this._targets=null}};function K2t(t,e,n,r){const i=this,o=Dm(n,r),s=function(c){c.dataflow=i;try{o.receive(c)}catch(u){i.error(u)}finally{i.run()}};let a;typeof t=="string"&&typeof document<"u"?a=document.querySelectorAll(t):a=pt(t);const l=a.length;for(let c=0;ce=r);return n.requests=0,n.done=()=>{--n.requests===0&&(t._pending=null,e(t))},t._pending=n}const rTt={skip:!0};function iTt(t,e,n,r,i){return(t instanceof Lr?sTt:oTt)(this,t,e,n,r,i),this}function oTt(t,e,n,r,i,o){const s=cn({},o,rTt);let a,l;fn(n)||(n=ra(n)),r===void 0?a=c=>t.touch(n(c)):fn(r)?(l=new Lr(null,r,i,!1),a=c=>{l.evaluate(c);const u=n(c),f=l.value;m$e(f)?t.pulse(u,f,o):t.update(u,f,s)}):a=c=>t.update(n(c),r,s),e.apply(a)}function sTt(t,e,n,r,i,o){if(r===void 0)e.targets().add(n);else{const s=o||{},a=new Lr(null,aTt(n,r),i,!1);a.modified(s.force),a.rank=e.rank,e.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),t.connect(n,[a]))}}function aTt(t,e){return e=fn(e)?e:ra(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}function lTt(t){t.rank=++this._rank}function cTt(t){const e=[t];let n,r,i;for(;e.length;)if(this.rank(n=e.pop()),r=n._targets)for(i=r.length;--i>=0;)e.push(n=r[i]),n===t&&je("Cycle detected in dataflow graph.")}const wN={},Pd=1,Xm=2,Mp=4,uTt=Pd|Xm,sge=Pd|Mp,Z1=Pd|Xm|Mp,age=8,QE=16,lge=32,cge=64;function jv(t,e,n){this.dataflow=t,this.stamp=e??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function qW(t,e){const n=[];return qm(t,e,r=>n.push(r)),n}function uge(t,e){const n={};return t.visit(e,r=>{n[jt(r)]=1}),r=>n[jt(r)]?null:r}function PI(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}jv.prototype={StopPropagation:wN,ADD:Pd,REM:Xm,MOD:Mp,ADD_REM:uTt,ADD_MOD:sge,ALL:Z1,REFLOW:age,SOURCE:QE,NO_SOURCE:lge,NO_FIELDS:cge,fork(t){return new jv(this.dataflow).init(this,t)},clone(){const t=this.fork(Z1);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(Z1|QE)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new jv(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,t.fields&&!(e&cge)&&(n.fields=t.fields),e&Pd?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),e&Xm?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),e&Mp?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),e&lge?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||Z1;return e&Pd&&this.add.length||e&Xm&&this.rem.length||e&Mp&&this.mod.length},reflow(t){if(t)return this.fork(Z1).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(Mp,uge(this,Pd))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return We(t)?t.forEach(n=>e[n]=!0):e[t]=!0,this},modified(t,e){const n=this.fields;return(e||this.mod.length)&&n?arguments.length?We(t)?t.some(r=>n[r]):n[t]:!!n:!1},filter(t,e){const n=this;return t&Pd&&(n.addF=PI(n.addF,e)),t&Xm&&(n.remF=PI(n.remF,e)),t&Mp&&(n.modF=PI(n.modF,e)),t&QE&&(n.srcF=PI(n.srcF,e)),n},materialize(t){t=t||Z1;const e=this;return t&Pd&&e.addF&&(e.add=qW(e.add,e.addF),e.addF=null),t&Xm&&e.remF&&(e.rem=qW(e.rem,e.remF),e.remF=null),t&Mp&&e.modF&&(e.mod=qW(e.mod,e.modF),e.modF=null),t&QE&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(t&QE)return qm(n.source,n.srcF,r),n;t&Pd&&qm(n.add,n.addF,r),t&Xm&&qm(n.rem,n.remF,r),t&Mp&&qm(n.mod,n.modF,r);const i=n.source;if(t&age&&i){const o=n.add.length+n.mod.length;o===i.length||(o?qm(i,uge(n,sge),r):qm(i,n.srcF,r))}return n}};function Hne(t,e,n,r){const i=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(const s of n)if(s.stamp===e){if(s.fields){const a=i.fields||(i.fields={});for(const l in s.fields)a[l]=1}s.changed(i.ADD)&&(o|=i.ADD),s.changed(i.REM)&&(o|=i.REM),s.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}it(Hne,jv,{fork(t){const e=new jv(this.dataflow).init(this,t&this.NO_FIELDS);return t!==void 0&&(t&e.ADD&&this.visit(e.ADD,n=>e.add.push(n)),t&e.REM&&this.visit(e.REM,n=>e.rem.push(n)),t&e.MOD&&this.visit(e.MOD,n=>e.mod.push(n))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?We(t)?t.some(r=>n[r]):n[t]:0},filter(){je("MultiPulse does not support filtering.")},materialize(){je("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;or._enqueue(u,!0)),r._touched=iB(eR);let s=0,a,l,c;try{for(;r._heap.size()>0;){if(a=r._heap.pop(),a.rank!==a.qrank){r._enqueue(a,!0);continue}l=a.run(r._getPulse(a,t)),l.then?l=await l:l.async&&(i.push(l.async),l=wN),l!==wN&&a._targets&&a._targets.forEach(u=>r._enqueue(u)),++s}}catch(u){r._heap.clear(),c=u}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${s} operators`),c&&(r._postrun=[],r.error(c)),r._postrun.length){const u=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;fr.runAsync(null,()=>{u.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function dTt(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running}function hTt(t,e,n){return this._pulse?v$e(this):(this.evaluate(t,e,n),this)}function pTt(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(r){this.error(r)}}function v$e(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}function gTt(t,e){const n=t.stampi.pulse),e):this._input[t.id]||vTt(this._pulse,n&&n.pulse)}function vTt(t,e){return e&&e.stamp===t.stamp?e:(t=t.fork(),e&&e!==wN&&(t.source=e.source),t)}const qne={skip:!1,force:!1};function yTt(t,e){const n=e||qne;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this}function xTt(t,e,n){const r=n||qne;return(t.set(e)||r.force)&&this.touch(t,r),this}function bTt(t,e,n){this.touch(t,n||qne);const r=new jv(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this}function wTt(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),y$e(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,_Tt(e,0,t)):r=n,r}}}function y$e(t,e,n,r){let i,o;const s=t[n];for(;n>e;){if(o=n-1>>1,i=t[o],r(s,i)<0){t[n]=i,n=o;continue}break}return t[n]=s}function _Tt(t,e,n){const r=e,i=t.length,o=t[e];let s=(e<<1)+1,a;for(;s=0&&(s=a),t[e]=t[s],e=s,s=(e<<1)+1;return t[e]=o,y$e(t,r,e,n)}function z_(){this.logger(Sne()),this.logLevel(wne),this._clock=0,this._rank=0,this._locale=Bne();try{this._loader=rB()}catch{}this._touched=iB(eR),this._input={},this._pulse=null,this._heap=wTt((t,e)=>t.qrank-e.qrank),this._postrun=[]}function KE(t){return function(){return this._log[t].apply(this,arguments)}}z_.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:KE("error"),warn:KE("warn"),info:KE("info"),debug:KE("debug"),logLevel:KE("level"),cleanThreshold:1e4,add:X2t,connect:Y2t,rank:lTt,rerank:cTt,pulse:bTt,touch:yTt,update:xTt,changeset:h1,ingest:J2t,parse:Z2t,preload:tTt,request:eTt,events:K2t,on:iTt,evaluate:fTt,run:hTt,runAsync:dTt,runAfter:pTt,_enqueue:gTt,_getPulse:mTt};function De(t,e){Lr.call(this,t,null,e)}it(De,Lr,{run(t){if(t.stampthis.pulse=n):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const jS={};function x$e(t){const e=b$e(t);return e&&e.Definition||null}function b$e(t){return t=t&&t.toLowerCase(),vt(jS,t)?jS[t]:null}function*w$e(t,e){if(e==null)for(let n of t)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)r=e(r,++n,t),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function Xne(t,e,n){const r=Float64Array.from(w$e(t,n));return r.sort(mh),e.map(i=>vLe(r,i))}function Yne(t,e){return Xne(t,[.25,.5,.75],e)}function Qne(t,e){const n=t.length,r=MOt(t,e),i=Yne(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function _$e(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o=t.extent[0],s=t.extent[1],a,l,c,u,f,d;const h=t.span||s-o||Math.abs(o)||1;if(t.step)a=t.step;else if(t.steps){for(u=h/e,f=0,d=t.steps.length;fe;)a*=n;for(f=0,d=i.length;f=c&&h/u<=e&&(a=u)}u=Math.log(a);const p=u>=0?0:~~(-u/r)+1,g=Math.pow(n,-p-1);return(t.nice||t.nice===void 0)&&(u=Math.floor(o/a+g)*a,o=od);const i=t.length,o=new Float64Array(i);let s=0,a=1,l=r(t[0]),c=l,u=l+e,f;for(;a=u){for(c=(l+c)/2;s>1);si;)t[s--]=t[r]}r=i,i=o}return t}function OTt(t){return function(){return t=(1103515245*t+12345)%2147483647,t/2147483647}}function ETt(t,e){e==null&&(e=t,t=0);let n,r,i;const o={min(s){return arguments.length?(n=s||0,i=r-n,o):n},max(s){return arguments.length?(r=s||0,i=r-n,o):r},sample(){return n+Math.floor(i*ku())},pdf(s){return s===Math.floor(s)&&s>=n&&s=r?1:(a-n+1)/i},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*i):NaN}};return o.min(t).max(e)}const O$e=Math.sqrt(2*Math.PI),TTt=Math.SQRT2;let ZE=NaN;function cB(t,e){t=t||0,e=e??1;let n=0,r=0,i,o;if(ZE===ZE)n=ZE,ZE=NaN;else{do n=ku()*2-1,r=ku()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,ZE=r*o}return t+n*e}function Kne(t,e,n){n=n??1;const r=(t-(e||0))/n;return Math.exp(-.5*r*r)/(n*O$e)}function uB(t,e,n){e=e||0,n=n??1;const r=(t-e)/n,i=Math.abs(r);let o;if(i>37)o=0;else{const s=Math.exp(-i*i/2);let a;i<7.07106781186547?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,o=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,o=o/a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,o=s/a/2.506628274631)}return r>0?1-o:o}function fB(t,e,n){return t<0||t>1?NaN:(e||0)+(n??1)*TTt*kTt(2*t-1)}function kTt(t){let e=-Math.log((1-t)*(1+t)),n;return e<6.25?(e-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*e,n=128584807152564e-32+n*e,n=11157877678025181e-33+n*e,n=-1333171662854621e-31+n*e,n=20972767875968562e-33+n*e,n=6637638134358324e-30+n*e,n=-4054566272975207e-29+n*e,n=-8151934197605472e-29+n*e,n=26335093153082323e-28+n*e,n=-12975133253453532e-27+n*e,n=-5415412054294628e-26+n*e,n=10512122733215323e-25+n*e,n=-4112633980346984e-24+n*e,n=-29070369957882005e-24+n*e,n=42347877827932404e-23+n*e,n=-13654692000834679e-22+n*e,n=-13882523362786469e-21+n*e,n=.00018673420803405714+n*e,n=-.000740702534166267+n*e,n=-.006033670871430149+n*e,n=.24015818242558962+n*e,n=1.6536545626831027+n*e):e<16?(e=Math.sqrt(e)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*e,n=-27517406297064545e-23+n*e,n=18239629214389228e-24+n*e,n=15027403968909828e-22+n*e,n=-4013867526981546e-21+n*e,n=29234449089955446e-22+n*e,n=12475304481671779e-21+n*e,n=-47318229009055734e-21+n*e,n=6828485145957318e-20+n*e,n=24031110387097894e-21+n*e,n=-.0003550375203628475+n*e,n=.0009532893797373805+n*e,n=-.0016882755560235047+n*e,n=.002491442096107851+n*e,n=-.003751208507569241+n*e,n=.005370914553590064+n*e,n=1.0052589676941592+n*e,n=3.0838856104922208+n*e):Number.isFinite(e)?(e=Math.sqrt(e)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*e,n=15076572693500548e-25+n*e,n=-3789465440126737e-24+n*e,n=761570120807834e-23+n*e,n=-1496002662714924e-23+n*e,n=2914795345090108e-23+n*e,n=-6771199775845234e-23+n*e,n=22900482228026655e-23+n*e,n=-99298272942317e-20+n*e,n=4526062597223154e-21+n*e,n=-1968177810553167e-20+n*e,n=7599527703001776e-20+n*e,n=-.00021503011930044477+n*e,n=-.00013871931833623122+n*e,n=1.0103004648645344+n*e,n=4.849906401408584+n*e):n=1/0,n*t}function Zne(t,e){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>cB(n,r),pdf:o=>Kne(o,n,r),cdf:o=>uB(o,n,r),icdf:o=>fB(o,n,r)};return i.mean(t).stdev(e)}function Jne(t,e){const n=Zne();let r=0;const i={data(o){return arguments.length?(t=o,r=o?o.length:0,i.bandwidth(e)):t},bandwidth(o){return arguments.length?(e=o,!e&&t&&(e=Qne(t)),i):e},sample(){return t[~~(ku()*r)]+e*n.sample()},pdf(o){let s=0,a=0;for(;aere(n,r),pdf:o=>tre(o,n,r),cdf:o=>nre(o,n,r),icdf:o=>rre(o,n,r)};return i.mean(t).stdev(e)}function T$e(t,e){let n=0,r;function i(s){const a=[];let l=0,c;for(c=0;c=e&&t<=n?1/(n-e):0}function sre(t,e,n){return n==null&&(n=e??1,e=0),tn?1:(t-e)/(n-e)}function are(t,e,n){return n==null&&(n=e??1,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function k$e(t,e){let n,r;const i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>ire(n,r),pdf:o=>ore(o,n,r),cdf:o=>sre(o,n,r),icdf:o=>are(o,n,r)};return e==null&&(e=t??1,t=0),i.min(t).max(e)}function lre(t,e,n){let r=0,i=0;for(const o of t){const s=n(o);e(o)==null||s==null||isNaN(s)||(r+=(s-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function nR(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function dB(t,e,n,r){t=t.filter(h=>{let p=e(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),r&&t.sort((h,p)=>e(h)-e(p));const i=t.length,o=new Float64Array(i),s=new Float64Array(i);let a=0,l=0,c=0,u,f,d;for(d of t)o[a]=u=+e(d),s[a]=f=+n(d),++a,l+=(u-l)/a,c+=(f-c)/a;for(a=0;a=o&&s!=null&&(s=+s)>=s&&r(o,s,++i)}function EO(t,e,n,r,i){let o=0,s=0;return rR(t,e,n,(a,l)=>{const c=l-i(a),u=l-r;o+=c*c,s+=u*u}),1-o/s}function cre(t,e,n){let r=0,i=0,o=0,s=0,a=0;rR(t,e,n,(u,f)=>{++a,r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=nR(r,i,o,s),c=u=>l[0]+l[1]*u;return{coef:l,predict:c,rSquared:EO(t,e,n,i,c)}}function A$e(t,e,n){let r=0,i=0,o=0,s=0,a=0;rR(t,e,n,(u,f)=>{++a,u=Math.log(u),r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=nR(r,i,o,s),c=u=>l[0]+l[1]*Math.log(u);return{coef:l,predict:c,rSquared:EO(t,e,n,i,c)}}function P$e(t,e,n){const[r,i,o,s]=dB(t,e,n);let a=0,l=0,c=0,u=0,f=0,d,h,p;rR(t,e,n,(y,x)=>{d=r[f++],h=Math.log(x),p=d*x,a+=(x*h-a)/f,l+=(p-l)/f,c+=(p*h-c)/f,u+=(d*p-u)/f});const[g,m]=nR(l/s,a/s,c/s,u/s),v=y=>Math.exp(g+m*(y-o));return{coef:[Math.exp(g-m*o),m],predict:v,rSquared:EO(t,e,n,s,v)}}function M$e(t,e,n){let r=0,i=0,o=0,s=0,a=0,l=0;rR(t,e,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,r+=(h-r)/l,i+=(p-i)/l,o+=(h*p-o)/l,s+=(h*h-s)/l,a+=(d-a)/l});const c=nR(r,i,o,s),u=f=>c[0]*Math.pow(f,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:EO(t,e,n,a,u)}}function ure(t,e,n){const[r,i,o,s]=dB(t,e,n),a=r.length;let l=0,c=0,u=0,f=0,d=0,h,p,g,m;for(h=0;h(S=S-o,x*S*S+b*S+w+s);return{coef:[w-b*o+x*o*o+s,b-2*x*o,x],predict:_,rSquared:EO(t,e,n,s,_)}}function R$e(t,e,n,r){if(r===0)return lre(t,e,n);if(r===1)return cre(t,e,n);if(r===2)return ure(t,e,n);const[i,o,s,a]=dB(t,e,n),l=i.length,c=[],u=[],f=r+1;let d,h,p,g,m;for(d=0;d{x-=s;let b=a+v[0]+v[1]*x+v[2]*x*x;for(d=3;d=0;--o)for(a=e[o],l=1,i[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,i[o-s]+=a*Math.pow(n,s)*l;return i[0]+=r,i}function PTt(t){const e=t.length-1,n=[];let r,i,o,s,a;for(r=0;rMath.abs(t[r][s])&&(s=i);for(o=r;o=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(a=0,o=i+1;oi[x]-v?y:x;let w=0,_=0,S=0,O=0,k=0;const E=1/Math.abs(i[b]-v||1);for(let R=y;R<=x;++R){const T=i[R],M=o[R],I=MTt(Math.abs(v-T)*E)*d[R],z=T*I;w+=I,_+=z,S+=M*I,O+=M*z,k+=T*z}const[P,A]=nR(_/w,S/w,O/w,k/w);u[m]=P+A*v,f[m]=Math.abs(o[m]-u[m]),RTt(i,m+1,p)}if(h===fge)break;const g=yLe(f);if(Math.abs(g)=1?dge:(y=1-v*v)*y}return DTt(i,u,s,a)}function MTt(t){return(t=1-t*t*t)*t*t}function RTt(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}function DTt(t,e,n,r){const i=t.length,o=[];let s=0,a=0,l=[],c;for(;s[g,t(g)],o=e[0],s=e[1],a=s-o,l=a/r,c=[i(o)],u=[];if(n===r){for(let g=1;g0;)u.push(i(o+g/n*a))}let f=c[0],d=u[u.length-1];const h=1/a,p=LTt(f[1],u);for(;d;){const g=i((f[0]+d[0])/2);g[0]-f[0]>=l&&$Tt(f,g,d,h,p)>ITt?u.push(g):(f=d,c.push(d),u.pop()),d=u[u.length-1]}return c}function LTt(t,e){let n=t,r=t;const i=e.length;for(let o=0;or&&(r=s)}return 1/(r-n)}function $Tt(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),s=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-s)}function FTt(t){return e=>{const n=t.length;let r=1,i=String(t[0](e));for(;r{},NTt={init:XW,add:XW,rem:XW,idx:0},SA={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.valid?t.sum:void 0,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||t.max===void 0)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(t,e)=>{t.exp=0,t.exp_r=e},value:t=>t.valid?t.exp*(1-t.exp_r)/(1-t.exp_r**t.valid):void 0,add:(t,e)=>t.exp=t.exp_r*t.exp+e,rem:(t,e)=>t.exp=(t.exp-e/t.exp_r**(t.valid-1))/t.exp_r},exponentialb:{value:t=>t.valid?t.exp*(1-t.exp_r):void 0,req:["exponential"],idx:1}},iR=Object.keys(SA).filter(t=>t!=="__count__");function zTt(t,e){return(n,r)=>cn({name:t,aggregate_param:r,out:n||t},NTt,e)}[...iR,"__count__"].forEach(t=>{SA[t]=zTt(t,SA[t])});function L$e(t,e,n){return SA[t](n,e)}function $$e(t,e){return t.idx-e.idx}function jTt(t){const e={};t.forEach(r=>e[r.name]=r);const n=r=>{r.req&&r.req.forEach(i=>{e[i]||n(e[i]=SA[i]())})};return t.forEach(n),Object.values(e).sort($$e)}function BTt(){this.valid=0,this.missing=0,this._ops.forEach(t=>t.aggregate_param==null?t.init(this):t.init(this,t.aggregate_param))}function UTt(t,e){if(t==null||t===""){++this.missing;return}t===t&&(++this.valid,this._ops.forEach(n=>n.add(this,t,e)))}function WTt(t,e){if(t==null||t===""){--this.missing;return}t===t&&(--this.valid,this._ops.forEach(n=>n.rem(this,t,e)))}function VTt(t){return this._out.forEach(e=>t[e.out]=e.value(this)),t}function F$e(t,e){const n=e||na,r=jTt(t),i=t.slice().sort($$e);function o(s){this._ops=r,this._out=i,this.cell=s,this.init()}return o.prototype.init=BTt,o.prototype.add=UTt,o.prototype.rem=WTt,o.prototype.set=VTt,o.prototype.get=n,o.fields=t.map(s=>s.out),o}function fre(t){this._key=t?Ou(t):jt,this.reset()}const Os=fre.prototype;Os.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Os.add=function(t){this._add.push(t)};Os.rem=function(t){this._rem.push(t)};Os.values=function(){if(this._get=null,this._rem.length===0)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),s={};let a,l,c;for(a=0;a=0;)o=t(e[r])+"",vt(n,o)||(n[o]=1,++i);return i};Os.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=JIe(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext};Os.argmin=function(t){return this.extent(t)[0]||{}};Os.argmax=function(t){return this.extent(t)[1]||{}};Os.min=function(t){const e=this.extent(t)[0];return e!=null?t(e):void 0};Os.max=function(t){const e=this.extent(t)[1];return e!=null?t(e):void 0};Os.quartile=function(t){return(this._get!==t||!this._q)&&(this._q=Yne(this.values(),t),this._get=t),this._q};Os.q1=function(t){return this.quartile(t)[0]};Os.q2=function(t){return this.quartile(t)[1]};Os.q3=function(t){return this.quartile(t)[2]};Os.ci=function(t){return(this._get!==t||!this._ci)&&(this._ci=S$e(this.values(),1e3,.05,t),this._get=t),this._ci};Os.ci0=function(t){return this.ci(t)[0]};Os.ci1=function(t){return this.ci(t)[1]};function iy(t){De.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}iy.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:iR},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};it(iy,De,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):Object.create(null),e.visit(e.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(t),e.visit(e.REM,o=>n.rem(o)),e.visit(e.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=t.drop!==!1,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map(()=>({})),i=n.length;function o(a){let l,c,u,f;for(l in a)for(u=a[l].tuple,c=0;c{const x=Fi(y);return i(y),n.push(x),x}),this.cellkey=t.key?t.key:mX(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],s=t.ops||["count"],a=t.aggregate_params||[null],l=t.as||[],c=o.length,u={};let f,d,h,p,g,m,v;for(c!==s.length&&je("Unmatched number of fields and aggregate ops."),v=0;vF$e(y,y.field)),Object.create(null)},cellkey:mX(),cell(t,e){let n=this.value[t];return n?n.num===0&&this._drop&&n.stamp{const f=r(u);u[a]=f,u[l]=f==null?null:i+o*(1+(f-i)/o)}:u=>u[a]=r(u)),e.modifies(n?s:a)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=_$e(t),r=n.step;let i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,s,a;(s=t.anchor)!=null&&(a=s-(i+r*Math.floor((s-i)/r)),i+=a,o+=a);const l=function(c){let u=Ys(e(c));return u==null?null:uo?1/0:(u=Math.max(i,Math.min(u,o-r)),i+r*Math.floor(GTt+(u-i)/r))};return l.start=i,l.stop=n.stop,l.step=r,this.value=Al(l,Ks(e),t.name||"bin_"+Fi(e))}});function N$e(t,e,n){const r=t;let i=e||[],o=n||[],s={},a=0;return{add:l=>o.push(l),remove:l=>s[r(l)]=++a,size:()=>i.length,data:(l,c)=>(a&&(i=i.filter(u=>!s[r(u)]),s={},a=0),c&&l&&i.sort(l),o.length&&(i=l?oLe(l,i,o.sort(l)):i.concat(o),o=[]),i)}}function hre(t){De.call(this,[],t)}hre.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};it(hre,De,{transform(t,e){const n=e.fork(e.ALL),r=N$e(jt,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(d1(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}});function z$e(t){Lr.call(this,null,HTt,t)}it(z$e,Lr);function HTt(t){return this.value&&!t.modified()?this.value:Tne(t.fields,t.orders)}function pre(t){De.call(this,null,t)}pre.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function qTt(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break}return t.match(n)}it(pre,De,{transform(t,e){const n=f=>d=>{for(var h=qTt(a(d),t.case,o)||[],p,g=0,m=h.length;gi[f]=1+(i[f]||0)),u=n(f=>i[f]-=1);return r?e.visit(e.SOURCE,c):(e.visit(e.ADD,c),e.visit(e.REM,u)),this._finish(e,l)},_parameterCheck(t,e){let n=!1;return(t.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),(t.modified("pattern")||!this._match)&&(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],s=t.fork(t.NO_SOURCE|t.NO_FIELDS);let a,l,c;for(a in n)l=r[a],c=n[a]||0,!l&&c?(r[a]=l=cr({}),l[i]=a,l[o]=c,s.add.push(l)):c===0?(l&&s.rem.push(l),n[a]=null,r[a]=null):l[o]!==c&&(l[o]=c,s.mod.push(l));return s.modifies(e)}});function gre(t){De.call(this,null,t)}gre.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};it(gre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[1],s=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=e.materialize(e.SOURCE).source,n.add=this.value=XTt(a,i,o,t.filter||Eu)):n.mod=a,n.source=this.value,n.modifies(r)}});function XTt(t,e,n,r){for(var i=[],o={},s=t.length,a=0,l,c;aj$e(o,e))):typeof r[i]===pge&&r[i](t[i]);return r}function mre(t){De.call(this,null,t)}const B$e=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],KTt={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:B$e},{name:"weights",type:"number",array:!0}]};mre.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:B$e.concat(KTt)},{name:"as",type:"string",array:!0,default:["value","density"]}]};it(mre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=j$e(t.distribution,ZTt(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let s=t.method||"pdf";s!=="pdf"&&s!=="cdf"&&je("Invalid density method: "+s),!t.extent&&!r.data&&je("Missing density extent parameter."),s=r[s];const a=t.as||["value","density"],l=t.extent||kh(r.data()),c=hB(s,l,i,o).map(u=>{const f={};return f[a[0]]=u[0],f[a[1]]=u[1],cr(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function ZTt(t){return()=>t.materialize(t.SOURCE).source}function U$e(t,e){return t?t.map((n,r)=>e[r]||Fi(n)):null}function vre(t,e,n){const r=[],i=f=>f(l);let o,s,a,l,c,u;if(e==null)r.push(t.map(n));else for(o={},s=0,a=t.length;stR(kh(t,e))/30;it(yre,De,{transform(t,e){if(this.value&&!(t.modified()||e.changed()))return e;const n=e.materialize(e.SOURCE).source,r=vre(e.source,t.groupby,na),i=t.smooth||!1,o=t.field,s=t.step||JTt(n,o),a=d1((p,g)=>o(p)-o(g)),l=t.as||W$e,c=r.length;let u=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:u,stop:f,step:s},e.reflow(!0).modifies(l)}});function V$e(t){Lr.call(this,null,ekt,t),this.modified(!0)}it(V$e,Lr);function ekt(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:Al(n=>e(n,t),Ks(e),Fi(e))}function xre(t){De.call(this,[void 0,void 0],t)}xre.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};it(xre,De,{transform(t,e){const n=this.value,r=t.field,i=e.changed()||e.modified(r.fields)||t.modified("field");let o=n[0],s=n[1];if((i||o==null)&&(o=1/0,s=-1/0),e.visit(i?e.SOURCE:e.ADD,a=>{const l=Ys(r(a));l!=null&&(ls&&(s=l))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Fi(r);a&&(a=` for field "${a}"`),e.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function bre(t,e){Lr.call(this,t),this.parent=e,this.count=0}it(bre,Lr,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}});function pB(t){De.call(this,{},t),this._keys=bO();const e=this._targets=[];e.active=0,e.forEach=n=>{for(let r=0,i=e.active;rr&&r.count>0);this.initTargets(n)}},initTargets(t){const e=this._targets,n=e.length,r=t?t.length:0;let i=0;for(;ithis.subflow(l,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,l=>{const c=jt(l),u=o.get(c);u!==void 0&&(o.delete(c),a(u).rem(l))}),e.visit(e.ADD,l=>{const c=r(l);o.set(jt(l),c),a(c).add(l)}),s||e.modified(r.fields)?e.visit(e.MOD,l=>{const c=jt(l),u=o.get(c),f=r(l);u===f?a(f).mod(l):(o.set(c,f),a(u).rem(l),a(f).add(l))}):e.changed(e.MOD)&&e.visit(e.MOD,l=>{a(o.get(jt(l))).mod(l)}),s&&e.visit(e.REFLOW,l=>{const c=jt(l),u=o.get(c),f=r(l);u!==f&&(o.set(c,f),a(u).rem(l),a(f).add(l))}),e.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}});function G$e(t){Lr.call(this,null,tkt,t)}it(G$e,Lr);function tkt(t){return this.value&&!t.modified()?this.value:We(t.name)?pt(t.name).map(e=>Ou(e)):Ou(t.name,t.as)}function wre(t){De.call(this,bO(),t)}wre.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};it(wre,De,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,s=i.rem,a=i.mod,l=t.expr;let c=!0;e.visit(e.REM,f=>{const d=jt(f);r.has(d)?r.delete(d):s.push(f)}),e.visit(e.ADD,f=>{l(f,t)?o.push(f):r.set(jt(f),1)});function u(f){const d=jt(f),h=l(f,t),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),s.push(f)):c&&h&&!p&&a.push(f)}return e.visit(e.MOD,u),t.modified()&&(c=!1,e.visit(e.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function _re(t){De.call(this,[],t)}_re.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};it(_re,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=U$e(r,t.as||[]),o=t.index||null,s=i.length;return n.rem=this.value,e.visit(e.SOURCE,a=>{const l=r.map(p=>p(a)),c=l.reduce((p,g)=>Math.max(p,g.length),0);let u=0,f,d,h;for(;u{for(let u=0,f;us[r]=n(s,t))}});function H$e(t){De.call(this,[],t)}it(H$e,De,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i=this.value,o=t.size-i.length,s,a,l;if(o>0){for(s=[];--o>=0;)s.push(l=cr(r(t))),i.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,i=i.slice(-o);return n.source=this.value=i,n}});const MI={value:"value",median:yLe,mean:FOt,min:sX,max:Nx},nkt=[];function Ore(t){De.call(this,[],t)}Ore.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function rkt(t){var e=t.method||MI.value,n;if(MI[e]==null)je("Unrecognized imputation method: "+e);else return e===MI.value?(n=t.value!==void 0?t.value:0,()=>n):MI[e]}function ikt(t){const e=t.field;return n=>n?e(n):NaN}it(Ore,De,{transform(t,e){var n=e.fork(e.ALL),r=rkt(t),i=ikt(t),o=Fi(t.field),s=Fi(t.key),a=(t.groupby||[]).map(Fi),l=okt(e.source,t.groupby,t.key,t.keyvals),c=[],u=this.value,f=l.domain.length,d,h,p,g,m,v,y,x,b,w;for(m=0,x=l.length;mv(m),o=[],s=r?r.slice():[],a={},l={},c,u,f,d,h,p,g,m;for(s.forEach((v,y)=>a[v]=y+1),d=0,g=t.length;dn.add(o))):(i=n.value=n.value||this.init(t),e.visit(e.REM,o=>n.rem(o)),e.visit(e.ADD,o=>n.add(o))),n.changes(),e.visit(e.SOURCE,o=>{cn(o,i[n.cellkey(o)].tuple)}),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n{const p=Jne(h,s)[a],g=t.counts?h.length:1,m=u||kh(h);hB(p,m,f,d).forEach(v=>{const y={};for(let x=0;x(this._pending=pt(i.data),o=>o.touch(this)))}:n.request(t.url,t.format).then(r=>YW(this,e,pt(r.data)))}});function akt(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}function YW(t,e,n){n.forEach(cr);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function kre(t){De.call(this,{},t)}kre.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};it(kre,De,{transform(t,e){const n=t.fields,r=t.index,i=t.values,o=t.default==null?null:t.default,s=t.modified(),a=n.length;let l=s?e.SOURCE:e.ADD,c=e,u=t.as,f,d,h;return i?(d=i.length,a>1&&!u&&je('Multi-field lookup requires explicit "as" parameter.'),u&&u.length!==a*d&&je('The "as" parameter has too few output field names.'),u=u||i.map(Fi),f=function(p){for(var g=0,m=0,v,y;ge.modified(p.fields)),l|=h?e.MOD:0),e.visit(l,f),c.modifies(u)}});function Y$e(t){Lr.call(this,null,lkt,t)}it(Y$e,Lr);function lkt(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r=1/0,i=-1/0,o,s;for(o=0;oi&&(i=s[1]);return[r,i]}function Q$e(t){Lr.call(this,null,ckt,t)}it(Q$e,Lr);function ckt(t){return this.value&&!t.modified()?this.value:t.values.reduce((e,n)=>e.concat(n),[])}function K$e(t){De.call(this,null,t)}it(K$e,De,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function Are(t){iy.call(this,t)}Are.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:iR,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};it(Are,iy,{_transform:iy.prototype.transform,transform(t,e){return this._transform(ukt(t,e),e)}});function ukt(t,e){const n=t.field,r=t.value,i=(t.op==="count"?"__count__":t.op)||"sum",o=Ks(n).concat(Ks(r)),s=dkt(n,t.limit||0,e);return e.changed()&&t.set("__pivot__",null,null,!0),{key:t.key,groupby:t.groupby,ops:s.map(()=>i),fields:s.map(a=>fkt(a,n,r,o)),as:s.map(a=>a+""),modified:t.modified.bind(t)}}function fkt(t,e,n,r){return Al(i=>e(i)===t?n(i):NaN,r,t+"")}function dkt(t,e,n){const r={},i=[];return n.visit(n.SOURCE,o=>{const s=t(o);r[s]||(r[s]=1,i.push(s))}),i.sort(Q4),e?i.slice(0,e):i}function Z$e(t){pB.call(this,t)}it(Z$e,pB,{transform(t,e){const n=t.subflow,r=t.field,i=o=>this.subflow(jt(o),n,e,o);return(t.modified("field")||r&&e.modified(Ks(r)))&&je("PreFacet does not support field modification."),this.initTargets(),r?(e.visit(e.MOD,o=>{const s=i(o);r(o).forEach(a=>s.mod(a))}),e.visit(e.ADD,o=>{const s=i(o);r(o).forEach(a=>s.add(cr(a)))}),e.visit(e.REM,o=>{const s=i(o);r(o).forEach(a=>s.rem(a))})):(e.visit(e.MOD,o=>i(o).mod(o)),e.visit(e.ADD,o=>i(o).add(o)),e.visit(e.REM,o=>i(o).rem(o))),e.clean()&&e.runAfter(()=>this.clean()),e}});function Pre(t){De.call(this,null,t)}Pre.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};it(Pre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=U$e(t.fields,t.as||[]),o=r?(a,l)=>hkt(a,l,r,i):sB;let s;return this.value?s=this.value:(e=e.addAll(),s=this.value={}),e.visit(e.REM,a=>{const l=jt(a);n.rem.push(s[l]),s[l]=null}),e.visit(e.ADD,a=>{const l=o(a,cr({}));s[jt(a)]=l,n.add.push(l)}),e.visit(e.MOD,a=>{n.mod.push(o(a,s[jt(a)]))}),n}});function hkt(t,e,n,r){for(let i=0,o=n.length;i{const d=Xne(f,c);for(let h=0;h{const o=jt(i);n.rem.push(r[o]),r[o]=null}),e.visit(e.ADD,i=>{const o=Gne(i);r[jt(i)]=o,n.add.push(o)}),e.visit(e.MOD,i=>{const o=r[jt(i)];for(const s in i)o[s]=i[s],n.modifies(s);n.mod.push(o)})),n}});function Rre(t){De.call(this,[],t),this.count=0}Rre.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};it(Rre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value.reduce((u,f)=>(u[jt(f)]=1,u),{});let s=this.value,a=this.count,l=0;function c(u){let f,d;s.length=l&&(f=s[d],o[jt(f)]&&n.rem.push(f),s[d]=u)),++a}if(e.rem.length&&(e.visit(e.REM,u=>{const f=jt(u);o[f]&&(o[f]=-1,n.rem.push(u)),--a}),s=s.filter(u=>o[jt(u)]!==-1)),(e.rem.length||r)&&s.length{o[jt(u)]||c(u)}),l=-1),r&&s.length>i){const u=s.length-i;for(let f=0;f{o[jt(u)]&&n.mod.push(u)}),e.add.length&&e.visit(e.ADD,c),(e.add.length||l<0)&&(n.add=s.filter(u=>!o[jt(u)])),this.count=a,this.value=n.source=s,n}});function Dre(t){De.call(this,null,t)}Dre.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};it(Dre,De,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=sl(t.start,t.stop,t.step||1).map(i=>{const o={};return o[r]=i,cr(o)}),n.add=e.add.concat(this.value),n}});function t3e(t){De.call(this,null,t),this.modified(!0)}it(t3e,De,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});function Ire(t){De.call(this,null,t)}const n3e=["unit0","unit1"];Ire.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:$ne,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:n3e}]};it(Ire,De,{transform(t,e){const n=t.field,r=t.interval!==!1,i=t.timezone==="utc",o=this._floor(t,e),s=(i?OO:CO)(o.unit).offset,a=t.as||n3e,l=a[0],c=a[1],u=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=e.ADD;return(t.modified()||e.changed(e.REM)||e.modified(Ks(n)))&&(e=e.reflow(!0),h=e.SOURCE,f=1/0,d=-1/0),e.visit(h,p=>{const g=n(p);let m,v;g==null?(p[l]=null,r&&(p[c]=null)):(p[l]=m=v=o(g),r&&(p[c]=v=s(m,u)),md&&(d=v))}),o.start=f,o.stop=d,e.modifies(r?a:l)},_floor(t,e){const n=t.timezone==="utc",{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:HLe({extent:t.extent||kh(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=Fne(r),s=this.value||{},a=(n?FLe:$Le)(o,i);return a.unit=$n(o),a.units=o,a.step=i,a.start=s.start,a.stop=s.stop,this.value=a}});function r3e(t){De.call(this,bO(),t)}it(r3e,De,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=a=>i.set(r(a),a);let s=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,a=>i.delete(r(a))),e.visit(e.ADD,o)):s=!1,this.modified(s),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}});function i3e(t){De.call(this,null,t)}it(i3e,De,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(d1(t.sort)):e.source).map(t.field))}});function gkt(t,e,n,r){const i=CA[t](e,n);return{init:i.init||rv,update:function(o,s){s[r]=i.next(o)}}}const CA={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=CA.rank(),e=t.next;return{init:t.init,next:n=>(e(n)-1)/(n.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,r=e.compare;let i=e.index;if(t0||je("ntile num must be greater than zero.");const n=CA.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(e*r(i))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return rt(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return e=+e,e>0||je("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(e-1);return re=null,next:n=>{const r=t(n.data[n.index]);return r!=null?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=mkt(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};function mkt(t,e,n){for(let r=e.length;nl[g]=1)}h(t.sort),e.forEach((p,g)=>{const m=n[g],v=r[g],y=i[g]||null,x=Fi(m),b=I$e(p,x,o[g]);if(h(m),s.push(b),vt(CA,p))a.push(gkt(p,m,v,b));else{if(m==null&&p!=="count"&&je("Null aggregate field specified."),p==="count"){u.push(b);return}d=!1;let w=c[x];w||(w=c[x]=[],w.field=m,f.push(w)),w.push(L$e(p,y,b))}}),(u.length||f.length)&&(this.cell=ykt(f,u,d)),this.inputs=Object.keys(l)}const s3e=o3e.prototype;s3e.init=function(){this.windows.forEach(t=>t.init()),this.cell&&this.cell.init()};s3e.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let s;if(n){for(s=t.p0;sF$e(l,l.field));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),s=0;sthis.group(i(a));let s=this.state;(!s||n)&&(s=this.state=new o3e(t)),n||e.modified(s.inputs)?(this.value={},e.visit(e.SOURCE,a=>o(a).add(a))):(e.visit(e.REM,a=>o(a).remove(a)),e.visit(e.ADD,a=>o(a).add(a)));for(let a=0,l=this._mlen;a0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r1?0:t<-1?oy:Math.acos(t)}function mge(t){return t>=1?_N:t<=-1?-_N:Math.asin(t)}const vX=Math.PI,yX=2*vX,W0=1e-6,Okt=yX-W0;function a3e(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return a3e;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iW0)if(!(Math.abs(f*l-c*u)>W0)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-s,p=i-a,g=l*l+c*c,m=h*h+p*p,v=Math.sqrt(g),y=Math.sqrt(d),x=o*Math.tan((vX-Math.acos((g+d-m)/(2*v*y)))/2),b=x/y,w=x/v;Math.abs(b-1)>W0&&this._append`L${e+b*u},${n+b*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=e+a,u=n+l,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>W0||Math.abs(this._y1-u)>W0)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%yX+yX),d>Okt?this._append`A${r},${r},0,1,${f},${e-a},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>W0&&this._append`A${r},${r},0,${+(d>=vX)},${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 gB(){return new $re}gB.prototype=$re.prototype;function mB(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 $re(e)}function Tkt(t){return t.innerRadius}function kkt(t){return t.outerRadius}function Akt(t){return t.startAngle}function Pkt(t){return t.endAngle}function Mkt(t){return t&&t.padAngle}function Rkt(t,e,n,r,i,o,s,a){var l=n-t,c=r-e,u=s-i,f=a-o,d=f*l-u*c;if(!(d*dT*T+M*M&&(O=E,k=P),{cx:O,cy:k,x01:-u,y01:-f,x11:O*(i/w-1),y11:k*(i/w-1)}}function Dkt(){var t=Tkt,e=kkt,n=Nn(0),r=null,i=Akt,o=Pkt,s=Mkt,a=null,l=mB(c);function c(){var u,f,d=+t.apply(this,arguments),h=+e.apply(this,arguments),p=i.apply(this,arguments)-_N,g=o.apply(this,arguments)-_N,m=gge(g-p),v=g>p;if(a||(a=u=l()),hFs))a.moveTo(0,0);else if(m>oR-Fs)a.moveTo(h*Rp(p),h*Ga(p)),a.arc(0,0,h,p,g,!v),d>Fs&&(a.moveTo(d*Rp(g),d*Ga(g)),a.arc(0,0,d,g,p,v));else{var y=p,x=g,b=p,w=g,_=m,S=m,O=s.apply(this,arguments)/2,k=O>Fs&&(r?+r.apply(this,arguments):hs(d*d+h*h)),E=QW(gge(h-d)/2,+n.apply(this,arguments)),P=E,A=E,R,T;if(k>Fs){var M=mge(k/d*Ga(O)),I=mge(k/h*Ga(O));(_-=M*2)>Fs?(M*=v?1:-1,b+=M,w-=M):(_=0,b=w=(p+g)/2),(S-=I*2)>Fs?(I*=v?1:-1,y+=I,x-=I):(S=0,y=x=(p+g)/2)}var z=h*Rp(y),F=h*Ga(y),N=d*Rp(w),L=d*Ga(w);if(E>Fs){var B=h*Rp(x),$=h*Ga(x),j=d*Rp(b),X=d*Ga(b),V;if(mFs?A>Fs?(R=RI(j,X,z,F,h,A,v),T=RI(B,$,N,L,h,A,v),a.moveTo(R.cx+R.x01,R.cy+R.y01),AFs)||!(_>Fs)?a.lineTo(N,L):P>Fs?(R=RI(N,L,B,$,d,-P,v),T=RI(z,F,j,X,d,-P,v),a.lineTo(R.cx+R.x01,R.cy+R.y01),P=h;--p)a.point(x[p],b[p]);a.lineEnd(),a.areaEnd()}v&&(x[d]=+t(m,d,f),b[d]=+e(m,d,f),a.point(r?+r(m,d,f):x[d],n?+n(m,d,f):b[d]))}if(y)return a=null,y+""||null}function u(){return Nre().defined(i).curve(s).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:Nn(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Nn(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Nn(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:Nn(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Nn(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Nn(+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:Nn(!!f),c):i},c.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),c):s},c.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),c):o},c}class f3e{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 Ikt(t){return new f3e(t,!0)}function Lkt(t){return new f3e(t,!1)}const zre={draw(t,e){const n=hs(e/oy);t.moveTo(n,0),t.arc(0,0,n,0,oR)}},$kt={draw(t,e){const n=hs(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()}},d3e=hs(1/3),Fkt=d3e*2,Nkt={draw(t,e){const n=hs(e/Fkt),r=n*d3e;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},zkt={draw(t,e){const n=hs(e),r=-n/2;t.rect(r,r,n,n)}},jkt=.8908130915292852,h3e=Ga(oy/10)/Ga(7*oy/10),Bkt=Ga(oR/10)*h3e,Ukt=-Rp(oR/10)*h3e,Wkt={draw(t,e){const n=hs(e*jkt),r=Bkt*n,i=Ukt*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const s=oR*o/5,a=Rp(s),l=Ga(s);t.lineTo(l*n,-a*n),t.lineTo(a*r-l*i,l*r+a*i)}t.closePath()}},KW=hs(3),Vkt={draw(t,e){const n=-hs(e/(KW*3));t.moveTo(0,n*2),t.lineTo(-KW*n,-n),t.lineTo(KW*n,-n),t.closePath()}},$c=-.5,Fc=hs(3)/2,xX=1/hs(12),Gkt=(xX/2+1)*3,Hkt={draw(t,e){const n=hs(e/Gkt),r=n/2,i=n*xX,o=r,s=n*xX+n,a=-o,l=s;t.moveTo(r,i),t.lineTo(o,s),t.lineTo(a,l),t.lineTo($c*r-Fc*i,Fc*r+$c*i),t.lineTo($c*o-Fc*s,Fc*o+$c*s),t.lineTo($c*a-Fc*l,Fc*a+$c*l),t.lineTo($c*r+Fc*i,$c*i-Fc*r),t.lineTo($c*o+Fc*s,$c*s-Fc*o),t.lineTo($c*a+Fc*l,$c*l-Fc*a),t.closePath()}};function p3e(t,e){let n=null,r=mB(i);t=typeof t=="function"?t:Nn(t||zre),e=typeof e=="function"?e:Nn(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:Nn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:Nn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function sy(){}function SN(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 vB(t){this._context=t}vB.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:SN(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:SN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function g3e(t){return new vB(t)}function m3e(t){this._context=t}m3e.prototype={areaStart:sy,areaEnd:sy,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:SN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function v3e(t){return new m3e(t)}function y3e(t){this._context=t}y3e.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:SN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function x3e(t){return new y3e(t)}function b3e(t,e){this._basis=new vB(t),this._beta=e}b3e.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],i=e[0],o=t[n]-r,s=e[n]-i,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(r+l*o),this._beta*e[a]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const qkt=function t(e){function n(r){return e===1?new vB(r):new b3e(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function CN(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function jre(t,e){this._context=t,this._k=(1-e)/6}jre.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:CN(this,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,this._x1=t,this._y1=e;break;case 2:this._point=3;default:CN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Xkt=function t(e){function n(r){return new jre(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Bre(t,e){this._context=t,this._k=(1-e)/6}Bre.prototype={areaStart:sy,areaEnd:sy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:CN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ykt=function t(e){function n(r){return new Bre(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Ure(t,e){this._context=t,this._k=(1-e)/6}Ure.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(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,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:CN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Qkt=function t(e){function n(r){return new Ure(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Wre(t,e,n){var r=t._x1,i=t._y1,o=t._x2,s=t._y2;if(t._l01_a>Fs){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Fs){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,s,t._x2,t._y2)}function w3e(t,e){this._context=t,this._alpha=e}w3e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Wre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Kkt=function t(e){function n(r){return e?new w3e(r,e):new jre(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function _3e(t,e){this._context=t,this._alpha=e}_3e.prototype={areaStart:sy,areaEnd:sy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Wre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Zkt=function t(e){function n(r){return e?new _3e(r,e):new Bre(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function S3e(t,e){this._context=t,this._alpha=e}S3e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Jkt=function t(e){function n(r){return e?new S3e(r,e):new Ure(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function C3e(t){this._context=t}C3e.prototype={areaStart:sy,areaEnd:sy,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 O3e(t){return new C3e(t)}function vge(t){return t<0?-1:1}function yge(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(vge(o)+vge(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function xge(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ZW(t,e,n){var r=t._x0,i=t._y0,o=t._x1,s=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*e,o-a,s-a*n,o,s)}function ON(t){this._context=t}ON.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:ZW(this,this._t0,xge(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,ZW(this,xge(this,n=yge(this,t,e)),n);break;default:ZW(this,this._t0,n=yge(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function E3e(t){this._context=new T3e(t)}(E3e.prototype=Object.create(ON.prototype)).point=function(t,e){ON.prototype.point.call(this,e,t)};function T3e(t){this._context=t}T3e.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 k3e(t){return new ON(t)}function A3e(t){return new E3e(t)}function P3e(t){this._context=t}P3e.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=bge(t),i=bge(e),o=0,s=1;s=0;--e)i[e]=(s[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 R3e(t){return new yB(t,.5)}function D3e(t){return new yB(t,0)}function I3e(t){return new yB(t,1)}function BS(t,e){if((s=t.length)>1)for(var n=1,r,i,o=t[e[0]],s,a=o.length;n=0;)n[e]=e;return n}function eAt(t,e){return t[e]}function tAt(t){const e=[];return e.key=t,e}function nAt(){var t=Nn([]),e=bX,n=BS,r=eAt;function i(o){var s=Array.from(t.apply(this,arguments),tAt),a,l=s.length,c=-1,u;for(const f of o)for(a=0,++c;a0){for(var n,r,i=0,o=t[0].length,s;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,s;rtypeof Image<"u"?Image:null;function Fu(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Xg(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const EN=Symbol("implicit");function aR(){var t=new Fpe,e=[],n=[],r=EN;function i(o){let s=t.get(o);if(s===void 0){if(r!==EN)return r;t.set(o,s=e.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new Fpe;for(const s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return aR(e,n).unknown(r)},Fu.apply(i,arguments),i}function OA(){var t=aR().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete t.unknown;function f(){var d=e().length,h=i>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?DI(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?DI(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=lAt.exec(t))?new Fo(e[1],e[2],e[3],1):(e=cAt.exec(t))?new Fo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=uAt.exec(t))?DI(e[1],e[2],e[3],e[4]):(e=fAt.exec(t))?DI(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=dAt.exec(t))?Tge(e[1],e[2]/100,e[3]/100,1):(e=hAt.exec(t))?Tge(e[1],e[2]/100,e[3]/100,e[4]):wge.hasOwnProperty(t)?Cge(wge[t]):t==="transparent"?new Fo(NaN,NaN,NaN,0):null}function Cge(t){return new Fo(t>>16&255,t>>8&255,t&255,1)}function DI(t,e,n,r){return r<=0&&(t=e=n=NaN),new Fo(t,e,n,r)}function Vre(t){return t instanceof Gy||(t=TA(t)),t?(t=t.rgb(),new Fo(t.r,t.g,t.b,t.opacity)):new Fo}function ay(t,e,n,r){return arguments.length===1?Vre(t):new Fo(t,e,n,r??1)}function Fo(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}TO(Fo,ay,lR(Gy,{brighter(t){return t=t==null?US:Math.pow(US,t),new Fo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?pb:Math.pow(pb,t),new Fo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Fo(zx(this.r),zx(this.g),zx(this.b),TN(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:Oge,formatHex:Oge,formatHex8:mAt,formatRgb:Ege,toString:Ege}));function Oge(){return`#${vx(this.r)}${vx(this.g)}${vx(this.b)}`}function mAt(){return`#${vx(this.r)}${vx(this.g)}${vx(this.b)}${vx((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ege(){const t=TN(this.opacity);return`${t===1?"rgb(":"rgba("}${zx(this.r)}, ${zx(this.g)}, ${zx(this.b)}${t===1?")":`, ${t})`}`}function TN(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function zx(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vx(t){return t=zx(t),(t<16?"0":"")+t.toString(16)}function Tge(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new _f(t,e,n,r)}function $3e(t){if(t instanceof _f)return new _f(t.h,t.s,t.l,t.opacity);if(t instanceof Gy||(t=TA(t)),!t)return new _f;if(t instanceof _f)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),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(n-r)/a+(n0&&l<1?0:s,new _f(s,a,l,t.opacity)}function kN(t,e,n,r){return arguments.length===1?$3e(t):new _f(t,e,n,r??1)}function _f(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}TO(_f,kN,lR(Gy,{brighter(t){return t=t==null?US:Math.pow(US,t),new _f(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?pb:Math.pow(pb,t),new _f(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 Fo(JW(t>=240?t-240:t+120,i,r),JW(t,i,r),JW(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new _f(kge(this.h),II(this.s),II(this.l),TN(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=TN(this.opacity);return`${t===1?"hsl(":"hsla("}${kge(this.h)}, ${II(this.s)*100}%, ${II(this.l)*100}%${t===1?")":`, ${t})`}`}}));function kge(t){return t=(t||0)%360,t<0?t+360:t}function II(t){return Math.max(0,Math.min(1,t||0))}function JW(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 F3e=Math.PI/180,N3e=180/Math.PI,AN=18,z3e=.96422,j3e=1,B3e=.82521,U3e=4/29,B_=6/29,W3e=3*B_*B_,vAt=B_*B_*B_;function V3e(t){if(t instanceof yh)return new yh(t.l,t.a,t.b,t.opacity);if(t instanceof Zp)return G3e(t);t instanceof Fo||(t=Vre(t));var e=rV(t.r),n=rV(t.g),r=rV(t.b),i=eV((.2225045*e+.7168786*n+.0606169*r)/j3e),o,s;return e===n&&n===r?o=s=i:(o=eV((.4360747*e+.3850649*n+.1430804*r)/z3e),s=eV((.0139322*e+.0971045*n+.7141733*r)/B3e)),new yh(116*i-16,500*(o-i),200*(i-s),t.opacity)}function PN(t,e,n,r){return arguments.length===1?V3e(t):new yh(t,e,n,r??1)}function yh(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}TO(yh,PN,lR(Gy,{brighter(t){return new yh(this.l+AN*(t??1),this.a,this.b,this.opacity)},darker(t){return new yh(this.l-AN*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=z3e*tV(e),t=j3e*tV(t),n=B3e*tV(n),new Fo(nV(3.1338561*e-1.6168667*t-.4906146*n),nV(-.9787684*e+1.9161415*t+.033454*n),nV(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function eV(t){return t>vAt?Math.pow(t,1/3):t/W3e+U3e}function tV(t){return t>B_?t*t*t:W3e*(t-U3e)}function nV(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rV(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yAt(t){if(t instanceof Zp)return new Zp(t.h,t.c,t.l,t.opacity);if(t instanceof yh||(t=V3e(t)),t.a===0&&t.b===0)return new Zp(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=r()=>t;function Q3e(t,e){return function(n){return t+n*e}}function bAt(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 wB(t,e){var n=e-t;return n?Q3e(t,n>180||n<-180?n-360*Math.round(n/360):n):bB(isNaN(t)?e:t)}function wAt(t){return(t=+t)==1?No:function(e,n){return n-e?bAt(e,n,t):bB(isNaN(e)?n:e)}}function No(t,e){var n=e-t;return n?Q3e(t,n):bB(isNaN(t)?e:t)}const _X=function t(e){var n=wAt(e);function r(i,o){var s=n((i=ay(i)).r,(o=ay(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=No(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function K3e(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:vf(r,i)})),n=iV.lastIndex;return n180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:vf(c,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(c,u,f,d){c!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:vf(c,u)}):u&&f.push(i(f)+"skewX("+u+r)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:vf(c,f)},{i:g-2,x:vf(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=t(c),u=t(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,d),s(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,g=d.length,m;++pe&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function XAt(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i2?YAt:XAt,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=a(t.map(r),e,n)))(r(s(d)))}return f.invert=function(d){return s(i((c||(c=a(e,t.map(r),vf)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,RN),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=cR,u()},f.clamp=function(d){return arguments.length?(s=d?!0:_a,u()):s!==_a},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 Yre(){return _B()(_a,_a)}function Qre(t,e,n,r){var i=ry(t,e,n),o;switch(r=hb(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=CLe(i,s))&&(r.precision=o),Ine(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=OLe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=SLe(i))&&(r.precision=o-(r.type==="%")*2);break}}return K4(r)}function qy(t){var e=t.domain;return t.ticks=function(n){var r=e();return iX(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Qre(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,s=r[i],a=r[o],l,c,u=10;for(a0;){if(c=oX(s,a,n),c===l)return r[i]=s,r[o]=a,e(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function AA(){var t=Yre();return t.copy=function(){return uR(t,AA())},Fu.apply(t,arguments),qy(t)}function Kre(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,RN),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Kre(t).unknown(e)},t=arguments.length?Array.from(t,RN):[0,1],qy(n)}function lFe(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],s;return oMath.pow(t,e)}function ePt(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 Fge(t){return(e,n)=>-t(-e,n)}function Zre(t){const e=t(Lge,$ge),n=e.domain;let r=10,i,o;function s(){return i=ePt(r),o=JAt(r),n()[0]<0?(i=Fge(i),o=Fge(o),t(QAt,KAt)):t(Lge,$ge),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{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(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(gu)break;v.push(g)}v.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=hb(l)).precision==null&&(l.trim=!0),l=K4(l)),a===1/0)return l;const c=Math.max(1,r*a/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(lFe(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),e}function Jre(){const t=Zre(_B()).domain([1,10]);return t.copy=()=>uR(t,Jre()).base(t.base()),Fu.apply(t,arguments),t}function Nge(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function zge(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function eie(t){var e=1,n=t(Nge(e),zge(e));return n.constant=function(r){return arguments.length?t(Nge(e=+r),zge(e)):e},qy(n)}function tie(){var t=eie(_B());return t.copy=function(){return uR(t,tie()).constant(t.constant())},Fu.apply(t,arguments)}function jge(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function tPt(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function nPt(t){return t<0?-t*t:t*t}function nie(t){var e=t(_a,_a),n=1;function r(){return n===1?t(_a,_a):n===.5?t(tPt,nPt):t(jge(n),jge(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},qy(e)}function SB(){var t=nie(_B());return t.copy=function(){return uR(t,SB()).exponent(t.exponent())},Fu.apply(t,arguments),t}function cFe(){return SB.apply(null,arguments).exponent(.5)}function Bge(t){return Math.sign(t)*t*t}function rPt(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function uFe(){var t=Yre(),e=[0,1],n=!1,r;function i(o){var s=rPt(t(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return t.invert(Bge(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,RN)).map(Bge)),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 uFe(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Fu.apply(i,arguments),qy(i)}function rie(){var t=[],e=[],n=[],r;function i(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s0?n[a-1]:t[0],a=n?[r[n-1],e]:[r[c-1],r[c]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return iie().domain([t,e]).range(i).unknown(o)},Fu.apply(qy(s),arguments)}function oie(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Lg(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 s=e.indexOf(o);return[t[s-1],t[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return oie().domain(t).range(e).unknown(n)},Fu.apply(i,arguments)}function iPt(t){return new Date(t)}function oPt(t){return t instanceof Date?+t:+new Date(+t)}function sie(t,e,n,r,i,o,s,a,l,c){var u=Yre(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),y=c("%b %d"),x=c("%B"),b=c("%Y");function w(_){return(l(_)<_?h:a(_)<_?p:s(_)<_?g:o(_)<_?m:r(_)<_?i(_)<_?v:y:n(_)<_?x:b)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?d(Array.from(_,oPt)):d().map(iPt)},u.ticks=function(_){var S=d();return t(S[0],S[S.length-1],_??10)},u.tickFormat=function(_,S){return S==null?w:c(S)},u.nice=function(_){var S=d();return(!_||typeof _.range!="function")&&(_=e(S[0],S[S.length-1],_??10)),_?d(lFe(S,_)):u},u.copy=function(){return uR(u,sie(t,e,n,r,i,o,s,a,l,c))},u}function fFe(){return Fu.apply(sie(oEt,sEt,Ah,bA,_O,cg,eB,Z4,Kp,zne).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function dFe(){return Fu.apply(sie(rEt,iEt,Ph,wA,SO,zv,tB,J4,Kp,jne).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function CB(){var t=0,e=1,n,r,i,o,s=_a,a=!1,l;function c(f){return f==null||isNaN(f=+f)?l:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),c):[t,e]},c.clamp=function(f){return arguments.length?(a=!!f,c):a},c.interpolator=function(f){return arguments.length?(s=f,c):s};function u(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),c):[s(0),s(1)]}}return c.range=u(Hy),c.rangeRound=u(cR),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),c}}function Xy(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function OB(){var t=qy(CB()(_a));return t.copy=function(){return Xy(t,OB())},Xg.apply(t,arguments)}function aie(){var t=Zre(CB()).domain([1,10]);return t.copy=function(){return Xy(t,aie()).base(t.base())},Xg.apply(t,arguments)}function lie(){var t=eie(CB());return t.copy=function(){return Xy(t,lie()).constant(t.constant())},Xg.apply(t,arguments)}function EB(){var t=nie(CB());return t.copy=function(){return Xy(t,EB()).exponent(t.exponent())},Xg.apply(t,arguments)}function hFe(){return EB.apply(null,arguments).exponent(.5)}function pFe(){var t=[],e=_a;function n(r){if(r!=null&&!isNaN(r=+r))return e((Lg(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(mh),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>mN(t,o/r))},n.copy=function(){return pFe(e).domain(t)},Xg.apply(n,arguments)}function TB(){var t=0,e=.5,n=1,r=1,i,o,s,a,l,c=_a,u,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-o)*(r*g0?r:1:0}const mPt="identity",WS="linear",Fg="log",fR="pow",dR="sqrt",AB="symlog",gb="time",mb="utc",xh="sequential",kO="diverging",VS="quantile",PB="quantize",MB="threshold",hie="ordinal",EX="point",mFe="band",pie="bin-ordinal",Ao="continuous",hR="discrete",pR="discretizing",Nu="interpolating",gie="temporal";function vPt(t){return function(e){let n=e[0],r=e[1],i;return r=r&&n[l]<=i&&(o<0&&(o=l),s=l);if(!(o<0))return r=t.invertExtent(n[o]),i=t.invertExtent(n[s]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function mie(){const t=aR().unknown(void 0),e=t.domain,n=t.range;let r=[0,1],i,o,s=!1,a=0,l=0,c=.5;delete t.unknown;function u(){const f=e().length,d=r[1]g+i*v);return n(d?m.reverse():m)}return t.domain=function(f){return arguments.length?(e(f),u()):e()},t.range=function(f){return arguments.length?(r=[+f[0],+f[1]],u()):r.slice()},t.rangeRound=function(f){return r=[+f[0],+f[1]],s=!0,u()},t.bandwidth=function(){return o},t.step=function(){return i},t.round=function(f){return arguments.length?(s=!!f,u()):s},t.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,u()):a},t.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),u()):a},t.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),u()):l},t.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),u()):c},t.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=r[1]r[1-d])))return v=Math.max(0,Lg(h,g)-1),y=g===m?v:Lg(h,m)-1,g-h[v]>o+1e-10&&++v,d&&(x=v,v=p-y,y=p-x),v>y?void 0:e().slice(v,y+1)},t.invert=function(f){const d=t.invertRange([f,f]);return d&&d[0]},t.copy=function(){return mie().domain(e()).range(r).round(s).paddingInner(a).paddingOuter(l).align(c)},u()}function vFe(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return vFe(e())},t}function xPt(){return vFe(mie().paddingInner(1))}var bPt=Array.prototype.map;function wPt(t){return bPt.call(t,Ys)}const _Pt=Array.prototype.slice;function yFe(){let t=[],e=[];function n(r){return r==null||r!==r?void 0:e[(Lg(t,r)-1)%e.length]}return n.domain=function(r){return arguments.length?(t=wPt(r),n):t.slice()},n.range=function(r){return arguments.length?(e=_Pt.call(r),n):e.slice()},n.tickFormat=function(r,i){return Qre(t[0],$n(t),r??10,i)},n.copy=function(){return yFe().domain(n.domain()).range(n.range())},n}const DN=new Map,xFe=Symbol("vega_scale");function bFe(t){return t[xFe]=!0,t}function SPt(t){return t&&t[xFe]===!0}function CPt(t,e,n){const r=function(){const o=e();return o.invertRange||(o.invertRange=o.invert?vPt(o):o.invertExtent?yPt(o):void 0),o.type=t,bFe(o)};return r.metadata=Wf(pt(n)),r}function tr(t,e,n){return arguments.length>1?(DN.set(t,CPt(t,e,n)),this):wFe(t)?DN.get(t):void 0}tr(mPt,Kre);tr(WS,AA,Ao);tr(Fg,Jre,[Ao,Fg]);tr(fR,SB,Ao);tr(dR,cFe,Ao);tr(AB,tie,Ao);tr(gb,fFe,[Ao,gie]);tr(mb,dFe,[Ao,gie]);tr(xh,OB,[Ao,Nu]);tr(`${xh}-${WS}`,OB,[Ao,Nu]);tr(`${xh}-${Fg}`,aie,[Ao,Nu,Fg]);tr(`${xh}-${fR}`,EB,[Ao,Nu]);tr(`${xh}-${dR}`,hFe,[Ao,Nu]);tr(`${xh}-${AB}`,lie,[Ao,Nu]);tr(`${kO}-${WS}`,cie,[Ao,Nu]);tr(`${kO}-${Fg}`,uie,[Ao,Nu,Fg]);tr(`${kO}-${fR}`,kB,[Ao,Nu]);tr(`${kO}-${dR}`,gFe,[Ao,Nu]);tr(`${kO}-${AB}`,fie,[Ao,Nu]);tr(VS,rie,[pR,VS]);tr(PB,iie,pR);tr(MB,oie,pR);tr(pie,yFe,[hR,pR]);tr(hie,aR,hR);tr(mFe,mie,hR);tr(EX,xPt,hR);function wFe(t){return DN.has(t)}function p1(t,e){const n=DN.get(t);return n&&n.metadata[e]}function vie(t){return p1(t,Ao)}function GS(t){return p1(t,hR)}function TX(t){return p1(t,pR)}function _Fe(t){return p1(t,Fg)}function OPt(t){return p1(t,gie)}function SFe(t){return p1(t,Nu)}function CFe(t){return p1(t,VS)}const EPt=["clamp","base","constant","exponent"];function OFe(t,e){const n=e[0],r=$n(e)-n;return function(i){return t(n+i*r)}}function RB(t,e,n){return Xre(yie(e||"rgb",n),t)}function EFe(t,e){const n=new Array(e),r=e+1;for(let i=0;it[a]?s[a](t[a]()):0),s)}function yie(t,e){const n=GAt[TPt(t)];return e!=null&&n&&n.gamma?n.gamma(e):n}function TPt(t){return"interpolate"+t.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}const kPt={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},APt={accent:aPt,category10:sPt,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:lPt,observable10:cPt,paired:uPt,pastel1:fPt,pastel2:dPt,set1:hPt,set2:pPt,set3:gPt,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function kFe(t){if(We(t))return t;const e=t.length/6|0,n=new Array(e);for(let r=0;rRB(kFe(t)));function xie(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(Uge[t]=e,this):Uge[t]}const g3="symbol",PPt="discrete",MPt="gradient",RPt=t=>We(t)?t.map(e=>String(e)):String(t),DPt=(t,e)=>t[1]-e[1],IPt=(t,e)=>e[1]-t[1];function bie(t,e,n){let r;return Jn(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),n!=null&&(e=Math.min(e,Math.floor(tR(t.domain())/n||1)+1))),ht(e)&&(r=e.step,e=e.interval),gt(e)&&(e=t.type===gb?CO(e):t.type==mb?OO(e):je("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function PFe(t,e,n){let r=t.range(),i=r[0],o=$n(r),s=DPt;if(i>o&&(r=o,o=i,i=r,s=IPt),i=Math.floor(i),o=Math.ceil(o),e=e.map(a=>[a,t(a)]).filter(a=>i<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&e.length>1){const a=[e[0],$n(e)];for(;e.length>n&&e.length>=3;)e=e.filter((l,c)=>!(c%2));e.length<3&&(e=a)}return e}function wie(t,e){return t.bins?PFe(t,t.bins,e):t.ticks?t.ticks(e):t.domain()}function MFe(t,e,n,r,i,o){const s=e.type;let a=RPt;if(s===gb||i===gb)a=t.timeFormat(r);else if(s===mb||i===mb)a=t.utcFormat(r);else if(_Fe(s)){const l=t.formatFloat(r);if(o||e.bins)a=l;else{const c=RFe(e,n,!1);a=u=>c(u)?l(u):""}}else if(e.tickFormat){const l=e.domain();a=t.formatSpan(l[0],l[l.length-1],n,r)}else r&&(a=t.format(r));return a}function RFe(t,e,n){const r=wie(t,e),i=t.base(),o=Math.log(i),s=Math.max(1,i*e/r.length),a=l=>{let c=l/Math.pow(i,Math.round(Math.log(l)/o));return c*i1?r[1]-r[0]:r[0],s;for(s=1;skX[t.type]||t.bins;function LFe(t,e,n,r,i,o,s){const a=DFe[e.type]&&o!==gb&&o!==mb?LPt(t,e,i):MFe(t,e,n,i,o,s);return r===g3&&NPt(e)?zPt(a):r===PPt?jPt(a):BPt(a)}const zPt=t=>(e,n,r)=>{const i=Wge(r[n+1],Wge(r.max,1/0)),o=Vge(e,t),s=Vge(i,t);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},Wge=(t,e)=>t??e,jPt=t=>(e,n)=>n?t(e):null,BPt=t=>e=>t(e),Vge=(t,e)=>Number.isFinite(t)?e(t):null;function UPt(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+$n(e),o=i-r;if(t.type===MB){const s=n?o/n:.1;r-=s,i+=s,o=i-r}return s=>(s-r)/o}function WPt(t,e,n,r){const i=r||e.type;return gt(n)&&OPt(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===gb?t.timeFormat("%A, %d %B %Y, %X"):!n&&i===mb?t.utcFormat("%A, %d %B %Y, %X UTC"):LFe(t,e,5,null,n,r,!0)}function $Fe(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=WPt(t,e,n.format,n.formatType);if(TX(e.type)){const o=IFe(e).slice(1).map(i),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(GS(e.type)){const o=e.domain(),s=o.length,a=s>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=e.domain();return`values from ${i(o[0])} to ${i($n(o))}`}}let FFe=0;function VPt(){FFe=0}const IN="p_";function _ie(t){return t&&t.gradient}function NFe(t,e,n){const r=t.gradient;let i=t.id,o=r==="radial"?IN:"";return i||(i=t.id="gradient_"+FFe++,r==="radial"?(t.x1=yd(t.x1,.5),t.y1=yd(t.y1,.5),t.r1=yd(t.r1,0),t.x2=yd(t.x2,.5),t.y2=yd(t.y2,.5),t.r2=yd(t.r2,.5),o=IN):(t.x1=yd(t.x1,0),t.y1=yd(t.y1,0),t.x2=yd(t.x2,1),t.y2=yd(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function yd(t,e){return t??e}function zFe(t,e){var n=[],r;return r={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:n,stop:function(i,o){return n.push({offset:i,color:o}),r}}}const Gge={basis:{curve:g3e},"basis-closed":{curve:v3e},"basis-open":{curve:x3e},bundle:{curve:qkt,tension:"beta",value:.85},cardinal:{curve:Xkt,tension:"tension",value:0},"cardinal-open":{curve:Qkt,tension:"tension",value:0},"cardinal-closed":{curve:Ykt,tension:"tension",value:0},"catmull-rom":{curve:Kkt,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Zkt,tension:"alpha",value:.5},"catmull-rom-open":{curve:Jkt,tension:"alpha",value:.5},linear:{curve:sR},"linear-closed":{curve:O3e},monotone:{horizontal:A3e,vertical:k3e},natural:{curve:M3e},step:{curve:R3e},"step-after":{curve:I3e},"step-before":{curve:D3e}};function Sie(t,e,n){var r=vt(Gge,t)&&Gge[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}const GPt={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},HPt=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,qPt=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,XPt=/^((\s+,?\s*)|(,\s*))/,YPt=/^[01]/;function HS(t){const e=[];return(t.match(HPt)||[]).forEach(r=>{let i=r[0];const o=i.toLowerCase(),s=GPt[o],a=QPt(o,s,r.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,v=f/n,y=-f/r,x=d/r,b=m*a+v*l,w=y*a+x*l,_=m*t+v*e,S=y*t+x*e;let k=1/((_-b)*(_-b)+(S-w)*(S-w))-.25;k<0&&(k=0);let E=Math.sqrt(k);o==i&&(E=-E);const P=.5*(b+_)-E*(S-w),A=.5*(w+S)+E*(_-b),R=Math.atan2(w-A,b-P);let M=Math.atan2(S-A,_-P)-R;M<0&&o===1?M+=Wd:M>0&&o===0&&(M-=Wd);const I=Math.ceil(Math.abs(M/(J0+.001))),z=[];for(let F=0;F+t}function $I(t,e,n){return Math.max(e,Math.min(t,n))}function UFe(){var t=nMt,e=rMt,n=iMt,r=oMt,i=fp(0),o=i,s=i,a=i,l=null;function c(u,f,d){var h,p=f??+t.call(this,u),g=d??+e.call(this,u),m=+n.call(this,u),v=+r.call(this,u),y=Math.min(m,v)/2,x=$I(+i.call(this,u),0,y),b=$I(+o.call(this,u),0,y),w=$I(+s.call(this,u),0,y),_=$I(+a.call(this,u),0,y);if(l||(l=h=gB()),x<=0&&b<=0&&w<=0&&_<=0)l.rect(p,g,m,v);else{var S=p+m,O=g+v;l.moveTo(p+x,g),l.lineTo(S-b,g),l.bezierCurveTo(S-mm*b,g,S,g+mm*b,S,g+b),l.lineTo(S,O-_),l.bezierCurveTo(S,O-mm*_,S-mm*_,O,S-_,O),l.lineTo(p+w,O),l.bezierCurveTo(p+mm*w,O,p,O-mm*w,p,O-w),l.lineTo(p,g+x),l.bezierCurveTo(p,g+mm*x,p+mm*x,g,p+x,g),l.closePath()}if(h)return l=null,h+""||null}return c.x=function(u){return arguments.length?(t=fp(u),c):t},c.y=function(u){return arguments.length?(e=fp(u),c):e},c.width=function(u){return arguments.length?(n=fp(u),c):n},c.height=function(u){return arguments.length?(r=fp(u),c):r},c.cornerRadius=function(u,f,d,h){return arguments.length?(i=fp(u),o=f!=null?fp(f):i,a=d!=null?fp(d):i,s=h!=null?fp(h):o,c):i},c.context=function(u){return arguments.length?(l=u??null,c):l},c}function WFe(){var t,e,n,r,i=null,o,s,a,l;function c(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var v=Math.hypot(g,m),y=(g/=v)*l,x=(m/=v)*l,b=Math.atan2(m,g);i.moveTo(s-y,a-x),i.lineTo(f-g*p,d-m*p),i.arc(f,d,p,b-Math.PI,b),i.lineTo(s+y,a+x),i.arc(s,a,l,b,b+Math.PI)}else i.arc(f,d,p,0,Wd);i.closePath()}else o=1;s=f,a=d,l=p}function u(f){var d,h=f.length,p,g=!1,m;for(i==null&&(i=m=gB()),d=0;d<=h;++d)!(dt.x||0,vR=t=>t.y||0,sMt=t=>t.width||0,aMt=t=>t.height||0,lMt=t=>(t.x||0)+(t.width||0),cMt=t=>(t.y||0)+(t.height||0),uMt=t=>t.startAngle||0,fMt=t=>t.endAngle||0,dMt=t=>t.padAngle||0,hMt=t=>t.innerRadius||0,pMt=t=>t.outerRadius||0,gMt=t=>t.cornerRadius||0,mMt=t=>gR(t.cornerRadiusTopLeft,t.cornerRadius)||0,vMt=t=>gR(t.cornerRadiusTopRight,t.cornerRadius)||0,yMt=t=>gR(t.cornerRadiusBottomRight,t.cornerRadius)||0,xMt=t=>gR(t.cornerRadiusBottomLeft,t.cornerRadius)||0,bMt=t=>gR(t.size,64),wMt=t=>t.size||1,DB=t=>t.defined!==!1,_Mt=t=>BFe(t.shape||"circle"),SMt=Dkt().startAngle(uMt).endAngle(fMt).padAngle(dMt).innerRadius(hMt).outerRadius(pMt).cornerRadius(gMt),CMt=f_().x(mR).y1(vR).y0(cMt).defined(DB),OMt=f_().y(vR).x1(mR).x0(lMt).defined(DB),EMt=Nre().x(mR).y(vR).defined(DB),TMt=UFe().x(mR).y(vR).width(sMt).height(aMt).cornerRadius(mMt,vMt,yMt,xMt),kMt=p3e().type(_Mt).size(bMt),AMt=WFe().x(mR).y(vR).defined(DB).size(wMt);function Cie(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function PMt(t,e){return SMt.context(t)(e)}function MMt(t,e){const n=e[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?OMt:CMt).curve(Sie(r,n.orient,n.tension)).context(t)(e)}function RMt(t,e){const n=e[0],r=n.interpolate||"linear";return EMt.curve(Sie(r,n.orient,n.tension)).context(t)(e)}function AO(t,e,n,r){return TMt.context(t)(e,n,r)}function DMt(t,e){return(e.mark.shape||e.shape).context(t)(e)}function IMt(t,e){return kMt.context(t)(e)}function LMt(t,e){return AMt.context(t)(e)}var VFe=1;function GFe(){VFe=1}function Oie(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+VFe++),s=i.clipping[o]||(i.clipping[o]={id:o});return fn(r)?s.path=r(null):Cie(n)?s.path=AO(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function uo(t){this.clear(),t&&this.union(t)}uo.prototype={clone(){return new uo(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return nthis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),c=e-e*a+n*l,u=n-e*l-n*a;return[a*r-l*i+c,l*r+a*i+u,a*r-l*s+c,l*r+a*s+u,a*o-l*i+c,l*o+a*i+u,a*o-l*s+c,l*o+a*s+u]},union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)},contains(t,e){return!(tthis.x2||ethis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function IB(t){this.mark=t,this.bounds=this.bounds||new uo}function LB(t){IB.call(this,t),this.items=this.items||[]}it(LB,IB);class HFe{constructor(e){this._pending=0,this._loader=e||rB()}pending(){return this._pending}sanitizeURL(e){const n=this;return Yge(n),n._loader.sanitize(e,{context:"href"}).then(r=>(JE(n),r)).catch(()=>(JE(n),null))}loadImage(e){const n=this,r=sAt();return Yge(n),n._loader.sanitize(e,{context:"image"}).then(i=>{const o=i.href;if(!o||!r)throw{url:o};const s=new r,a=vt(i,"crossOrigin")?i.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>JE(n),s.onerror=()=>JE(n),s.src=o,s}).catch(i=>(JE(n),{complete:!1,width:0,height:0,src:i&&i.url||""}))}ready(){const e=this;return new Promise(n=>{function r(i){e.pending()?setTimeout(()=>{r(!0)},10):n(i)}r(!1)})}}function Yge(t){t._pending+=1}function JE(t){t._pending-=1}function Yg(t,e,n){if(e.stroke&&e.opacity!==0&&e.strokeOpacity!==0){const r=e.strokeWidth!=null?+e.strokeWidth:1;t.expand(r+(n?$Mt(e,r):0))}return t}function $Mt(t,e){return t.strokeJoin&&t.strokeJoin!=="miter"?0:e}const FMt=Wd-1e-8;let $B,m3,v3,yx,AX,y3,PX,MX;const dv=(t,e)=>$B.add(t,e),x3=(t,e)=>dv(m3=t,v3=e),Qge=t=>dv(t,$B.y1),Kge=t=>dv($B.x1,t),ex=(t,e)=>AX*t+PX*e,tx=(t,e)=>y3*t+MX*e,lV=(t,e)=>dv(ex(t,e),tx(t,e)),cV=(t,e)=>x3(ex(t,e),tx(t,e));function yR(t,e){return $B=t,e?(yx=e*ly,AX=MX=Math.cos(yx),y3=Math.sin(yx),PX=-y3):(AX=MX=1,yx=y3=PX=0),NMt}const NMt={beginPath(){},closePath(){},moveTo:cV,lineTo:cV,rect(t,e,n,r){yx?(lV(t+n,e),lV(t+n,e+r),lV(t,e+r),cV(t,e)):(dv(t+n,e+r),x3(t,e))},quadraticCurveTo(t,e,n,r){const i=ex(t,e),o=tx(t,e),s=ex(n,r),a=tx(n,r);Zge(m3,i,s,Qge),Zge(v3,o,a,Kge),x3(s,a)},bezierCurveTo(t,e,n,r,i,o){const s=ex(t,e),a=tx(t,e),l=ex(n,r),c=tx(n,r),u=ex(i,o),f=tx(i,o);Jge(m3,s,l,u,Qge),Jge(v3,a,c,f,Kge),x3(u,f)},arc(t,e,n,r,i,o){if(r+=yx,i+=yx,m3=n*Math.cos(i)+t,v3=n*Math.sin(i)+e,Math.abs(i-r)>FMt)dv(t-n,e-n),dv(t+n,e+n);else{const s=c=>dv(n*Math.cos(c)+t,n*Math.sin(c)+e);let a,l;if(s(r),s(i),i!==r)if(r=r%Wd,r<0&&(r+=Wd),i=i%Wd,i<0&&(i+=Wd),ii;++l,a-=J0)s(a);else for(a=r-r%J0+J0,l=0;l<4&&aKPt?(u=s*s+a*o,u>=0&&(u=Math.sqrt(u),l=(-s+u)/o,c=(-s-u)/o)):l=.5*a/s,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(t.globalAlpha=n,t.fillStyle=YFe(t,e,e.fill),!0):!1}var jMt=[];function XS(t,e,n){var r=(r=e.strokeWidth)!=null?r:1;return r<=0?!1:(n*=e.strokeOpacity==null?1:e.strokeOpacity,n>0?(t.globalAlpha=n,t.strokeStyle=YFe(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||jMt),t.lineDashOffset=e.strokeDashOffset||0),!0):!1)}function BMt(t,e){return t.zindex-e.zindex||t.index-e.index}function kie(t){if(!t.zdirty)return t.zitems;var e=t.items,n=[],r,i,o;for(i=0,o=e.length;i=0;)if(r=e(n[i]))return r;if(n===o){for(n=t.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=e(n[i])))return r}return null}function Aie(t){return function(e,n,r){Gf(n,i=>{(!r||r.intersects(i.bounds))&&QFe(t,e,i,i)})}}function UMt(t){return function(e,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&QFe(t,e,n.items[0],n.items)}}function QFe(t,e,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(t(e,r)||(qS(e,n),n.fill&&LN(e,n,i)&&e.fill(),n.stroke&&XS(e,n,i)&&e.stroke()))}function FB(t){return t=t||Eu,function(e,n,r,i,o,s){return r*=e.pixelRatio,i*=e.pixelRatio,$N(n,a=>{const l=a.bounds;if(!(l&&!l.contains(o,s)||!l)&&t(e,a,r,i,o,s))return a})}}function xR(t,e){return function(n,r,i,o){var s=Array.isArray(r)?r[0]:r,a=e??s.fill,l=s.stroke&&n.isPointInStroke,c,u;return l&&(c=s.strokeWidth,u=s.strokeCap,n.lineWidth=c??1,n.lineCap=u??"butt"),t(n,r)?!1:a&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o)}}function Pie(t){return FB(xR(t))}function Bx(t,e){return"translate("+t+","+e+")"}function Mie(t){return"rotate("+t+")"}function WMt(t,e){return"scale("+t+","+e+")"}function KFe(t){return Bx(t.x||0,t.y||0)}function VMt(t){return Bx(t.x||0,t.y||0)+(t.angle?" "+Mie(t.angle):"")}function GMt(t){return Bx(t.x||0,t.y||0)+(t.angle?" "+Mie(t.angle):"")+(t.scaleX||t.scaleY?" "+WMt(t.scaleX||1,t.scaleY||1):"")}function Rie(t,e,n){function r(s,a){s("transform",VMt(a)),s("d",e(null,a))}function i(s,a){return e(yR(s,a.angle),a),Yg(s,a).translate(a.x||0,a.y||0)}function o(s,a){var l=a.x||0,c=a.y||0,u=a.angle||0;s.translate(l,c),u&&s.rotate(u*=ly),s.beginPath(),e(s,a),u&&s.rotate(-u),s.translate(-l,-c)}return{type:t,tag:"path",nested:!1,attr:r,bound:i,draw:Aie(o),pick:Pie(o),isect:n||Eie(o)}}var HMt=Rie("arc",PMt);function qMt(t,e){for(var n=t[0].orient==="horizontal"?e[1]:e[0],r=t[0].orient==="horizontal"?"y":"x",i=t.length,o=1/0,s,a;--i>=0;)t[i].defined!==!1&&(a=Math.abs(t[i][r]-n),a=0;)if(t[r].defined!==!1&&(i=t[r].x-e[0],o=t[r].y-e[1],s=i*i+o*o,s=0;)if(t[n].defined!==!1&&(r=t[n].x-e[0],i=t[n].y-e[1],o=r*r+i*i,r=t[n].size||1,o.5&&e<1.5?.5-Math.abs(e-1):0}function ZMt(t,e){t("transform",KFe(e))}function eNe(t,e){const n=JFe(e);t("d",AO(null,e,n,n))}function JMt(t,e){t("class","background"),t("aria-hidden",!0),eNe(t,e)}function eRt(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?eNe(t,e):t("d","")}function tRt(t,e,n){const r=e.clip?Oie(n,e,e):null;t("clip-path",r)}function nRt(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let i=0;i{const o=i.x||0,s=i.y||0,a=i.strokeForeground,l=i.opacity==null?1:i.opacity;(i.stroke||i.fill)&&l&&(MA(t,i,o,s),qS(t,i),i.fill&&LN(t,i,l)&&t.fill(),i.stroke&&!a&&XS(t,i,l)&&t.stroke()),t.save(),t.translate(o,s),i.clip&&ZFe(t,i),n&&n.translate(-o,-s),Gf(i,c=>{(c.marktype==="group"||r==null||r.includes(c.marktype))&&this.draw(t,c,n,r)}),n&&n.translate(o,s),t.restore(),a&&i.stroke&&l&&(MA(t,i,o,s),qS(t,i),XS(t,i,l)&&t.stroke())})}function aRt(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const s=n*t.pixelRatio,a=r*t.pixelRatio;return $N(e,l=>{let c,u,f;const d=l.bounds;if(d&&!d.contains(i,o))return;u=l.x||0,f=l.y||0;const h=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(ih||op))return;if(t.save(),t.translate(u,f),u=i-u,f=o-f,g&&Cie(l)&&!oRt(t,l,s,a))return t.restore(),null;const m=l.strokeForeground,v=e.interactive!==!1;return v&&m&&l.stroke&&iRt(t,l,s,a)?(t.restore(),l):(c=$N(l,y=>lRt(y,u,f)?this.pick(y,n,r,u,f):null),!c&&v&&(l.fill||!m&&l.stroke)&&rRt(t,l,s,a)&&(c=l),t.restore(),c||null)})}function lRt(t,e,n){return(t.interactive!==!1||t.marktype==="group")&&t.bounds&&t.bounds.contains(e,n)}var cRt={type:"group",tag:"g",nested:!1,attr:ZMt,bound:nRt,draw:sRt,pick:aRt,isect:qFe,content:tRt,background:JMt,foreground:eRt},RA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Iie(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(r=>{t.image=r,t.image.url=t.url})),n}function Lie(t,e){return t.width!=null?t.width:!e||!e.width?0:t.aspect!==!1&&t.height?t.height*e.width/e.height:e.width}function $ie(t,e){return t.height!=null?t.height:!e||!e.height?0:t.aspect!==!1&&t.width?t.width*e.height/e.width:e.height}function NB(t,e){return t==="center"?e/2:t==="right"?e:0}function zB(t,e){return t==="middle"?e/2:t==="bottom"?e:0}function uRt(t,e,n){const r=Iie(e,n),i=Lie(e,r),o=$ie(e,r),s=(e.x||0)-NB(e.align,i),a=(e.y||0)-zB(e.baseline,o),l=!r.src&&r.toDataURL?r.toDataURL():r.src||"";t("href",l,RA["xmlns:xlink"],"xlink:href"),t("transform",Bx(s,a)),t("width",i),t("height",o),t("preserveAspectRatio",e.aspect===!1?"none":"xMidYMid")}function fRt(t,e){const n=e.image,r=Lie(e,n),i=$ie(e,n),o=(e.x||0)-NB(e.align,r),s=(e.y||0)-zB(e.baseline,i);return t.set(o,s,o+r,s+i)}function dRt(t,e,n){Gf(e,r=>{if(n&&!n.intersects(r.bounds))return;const i=Iie(r,this);let o=Lie(r,i),s=$ie(r,i);if(o===0||s===0)return;let a=(r.x||0)-NB(r.align,o),l=(r.y||0)-zB(r.baseline,s),c,u,f,d;r.aspect!==!1&&(u=i.width/i.height,f=r.width/r.height,u===u&&f===f&&u!==f&&(f{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&tNe(t,r,i)&&(qS(t,r),t.stroke())}})}function CRt(t,e,n,r){return t.isPointInStroke?tNe(t,e,1)&&t.isPointInStroke(n,r):!1}var ORt={type:"rule",tag:"line",nested:!1,attr:wRt,bound:_Rt,draw:SRt,pick:FB(CRt),isect:XFe},ERt=Rie("shape",DMt),TRt=Rie("symbol",IMt,Tie);const rme=iLe();var hc={height:Gh,measureWidth:Fie,estimateWidth:FN,width:FN,canvas:nNe};nNe(!0);function nNe(t){hc.width=t&&Uv?Fie:FN}function FN(t,e){return rNe(uy(t,e),Gh(t))}function rNe(t,e){return~~(.8*t.length*e)}function Fie(t,e){return Gh(t)<=0||!(e=uy(t,e))?0:iNe(e,jB(t))}function iNe(t,e){const n=`(${e}) ${t}`;let r=rme.get(n);return r===void 0&&(Uv.font=e,r=Uv.measureText(t).width,rme.set(n,r)),r}function Gh(t){return t.fontSize!=null?+t.fontSize||0:11}function cy(t){return t.lineHeight!=null?t.lineHeight:Gh(t)+2}function kRt(t){return We(t)?t.length>1?t:t[0]:t}function bR(t){return kRt(t.lineBreak&&t.text&&!We(t.text)?t.text.split(t.lineBreak):t.text)}function Nie(t){const e=bR(t);return(We(e)?e.length-1:0)*cy(t)}function uy(t,e){const n=e==null?"":(e+"").trim();return t.limit>0&&n.length?PRt(t,n):n}function ARt(t){if(hc.width===Fie){const e=jB(t);return n=>iNe(n,e)}else if(hc.width===FN){const e=Gh(t);return n=>rNe(n,e)}else return e=>hc.width(t,e)}function PRt(t,e){var n=+t.limit,r=ARt(t);if(r(e)>>1,r(e.slice(l))>n?s=l+1:a=l;return i+e.slice(s)}else{for(;s>>1),r(e.slice(0,l))Math.max(d,hc.width(e,h)),0)):f=hc.width(e,u),i==="center"?l-=f/2:i==="right"&&(l-=f),t.set(l+=s,c+=a,l+f,c+r),e.angle&&!n)t.rotate(e.angle*ly,s,a);else if(n===2)return t.rotatedPoints(e.angle*ly,s,a);return t}function DRt(t,e,n){Gf(e,r=>{var i=r.opacity==null?1:r.opacity,o,s,a,l,c,u,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(t.font=jB(r),t.textAlign=r.align||"left",o=BB(r),s=o.x1,a=o.y1,r.angle&&(t.save(),t.translate(s,a),t.rotate(r.angle*ly),s=a=0),s+=r.dx||0,a+=(r.dy||0)+zie(r),u=bR(r),qS(t,r),We(u))for(c=cy(r),l=0;le;)t.removeChild(n[--r]);return t}function uNe(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function UB(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function zRt(t,e,n,r){var i=t&&t.mark,o,s;if(i&&(o=Ec[i.marktype]).tip){for(s=UB(e,n),s[0]-=r[0],s[1]-=r[1];t=t.mark.group;)s[0]-=t.x||0,s[1]-=t.y||0;t=o.tip(i.items,s)}return t}let Uie=class{constructor(e,n){this._active=null,this._handlers={},this._loader=e||rB(),this._tooltip=n||jRt}initialize(e,n,r){return this._el=e,this._obj=r||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,n,r){for(let i=e?e.length:0;--i>=0;)if(e[i].type===n&&(!r||e[i].handler===r))return i;return-1}handlers(e){const n=this._handlers,r=[];if(e)r.push(...n[this.eventName(e)]);else for(const i in n)r.push(...n[i]);return r}eventName(e){const n=e.indexOf(".");return n<0?e:e.slice(0,n)}handleHref(e,n,r){this._loader.sanitize(r,{context:"href"}).then(i=>{const o=new MouseEvent(e.type,e),s=hv(null,"a");for(const a in i)s.setAttribute(a,i[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(e,n,r){if(n&&n.tooltip!=null){n=zRt(n,e,this.canvas(),this._origin);const i=r&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,e,n,i)}}getItemBoundingClientRect(e){const n=this.canvas();if(!n)return;const r=n.getBoundingClientRect(),i=this._origin,o=e.bounds,s=o.width(),a=o.height();let l=o.x1+i[0]+r.left,c=o.y1+i[1]+r.top;for(;e.mark&&(e=e.mark.group);)l+=e.x||0,c+=e.y||0;return{x:l,y:c,width:s,height:a,left:l,top:c,right:l+s,bottom:c+a}}};function jRt(t,e,n,r){t.element().setAttribute("title",r||"")}class _R{constructor(e){this._el=null,this._bgcolor=null,this._loader=new HFe(e)}initialize(e,n,r,i,o){return this._el=e,this.resize(n,r,i,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)}resize(e,n,r,i){return this._width=e,this._height=n,this._origin=r||[0,0],this._scale=i||1,this}dirty(){}render(e,n){const r=this;return r._call=function(){r._render(e,n)},r._call(),r._call=null,r}_render(){}renderAsync(e,n){const r=this.render(e,n);return this._ready?this._ready.then(()=>r):Promise.resolve(r)}_load(e,n){var r=this,i=r._loader[e](n);if(!r._ready){const o=r._call;r._ready=r._loader.ready().then(s=>{s&&o(),r._ready=null})}return i}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const BRt="keydown",URt="keypress",WRt="keyup",fNe="dragenter",w3="dragleave",dNe="dragover",IX="pointerdown",VRt="pointerup",NN="pointermove",_3="pointerout",hNe="pointerover",LX="mousedown",GRt="mouseup",pNe="mousemove",zN="mouseout",gNe="mouseover",jN="click",HRt="dblclick",qRt="wheel",mNe="mousewheel",BN="touchstart",UN="touchmove",WN="touchend",XRt=[BRt,URt,WRt,fNe,w3,dNe,IX,VRt,NN,_3,hNe,LX,GRt,pNe,zN,gNe,jN,HRt,qRt,mNe,BN,UN,WN],$X=NN,ok=zN,FX=jN;class SR extends Uie{constructor(e,n){super(e,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=XRt,this.pointermove=ame([NN,pNe],[hNe,gNe],[_3,zN]),this.dragover=ame([dNe],[fNe],[w3]),this.pointerout=lme([_3,zN]),this.dragleave=lme([w3])}initialize(e,n,r){return this._canvas=e&&Bie(e,"canvas"),[jN,LX,IX,NN,_3,w3].forEach(i=>sme(this,i)),super.initialize(e,n,r)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(mNe,e)}pointerdown(e){this._down=this._active,this.fire(IX,e)}mousedown(e){this._down=this._active,this.fire(LX,e)}click(e){this._down===this._active&&(this.fire(jN,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(BN,e,!0)}touchmove(e){this.fire(UN,e,!0)}touchend(e){this.fire(WN,e,!0),this._touch=null}fire(e,n,r){const i=r?this._touch:this._active,o=this._handlers[e];if(n.vegaType=e,e===FX&&i&&i.href?this.handleHref(n,i,i.href):(e===$X||e===ok)&&this.handleTooltip(n,i,e!==ok),o)for(let s=0,a=o.length;s=0&&i.splice(o,1),this}pickEvent(e){const n=UB(e,this._canvas),r=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-r[0],n[1]-r[1])}pick(e,n,r,i,o){const s=this.context();return Ec[e.marktype].pick.call(this,s,e,n,r,i,o)}}const YRt=t=>t===BN||t===UN||t===WN?[BN,UN,WN]:[t];function sme(t,e){YRt(e).forEach(n=>QRt(t,n))}function QRt(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?r=>t[e](r):r=>t.fire(e,r)))}function lT(t,e,n){e.forEach(r=>t.fire(r,n))}function ame(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i?lT(this,t,r):((!i||!i.exit)&&lT(this,n,r),this._active=o,lT(this,e,r),lT(this,t,r))}}function lme(t){return function(e){lT(this,t,e),this._active=null}}function KRt(){return typeof window<"u"&&window.devicePixelRatio||1}function ZRt(t,e,n,r,i,o){const s=typeof HTMLElement<"u"&&t instanceof HTMLElement&&t.parentNode!=null,a=t.getContext("2d"),l=s?KRt():i;t.width=e*l,t.height=n*l;for(const c in o)a[c]=o[c];return s&&l!==1&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*r[0],l*r[1]),t}class VN extends _R{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new uo,this._tempb=new uo}initialize(e,n,r,i,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:Bv(1,1,this._options.type),e&&this._canvas&&(qc(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,n,r,i,o)}resize(e,n,r,i){if(super.resize(e,n,r,i),this._canvas)ZRt(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||je("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(e){const n=this._tempb.clear().union(e.bounds);let r=e.mark.group;for(;r;)n.translate(r.x||0,r.y||0),r=r.mark.group;this._dirty.union(n)}_render(e,n){const r=this.context(),i=this._origin,o=this._width,s=this._height,a=this._dirty,l=JRt(i,o,s);r.save();const c=this._redraw||a.empty()?(this._redraw=!1,l.expand(1)):eDt(r,l.intersect(a),i);return this.clear(-i[0],-i[1],o,s),this.draw(r,e,c,n),r.restore(),a.clear(),this}draw(e,n,r,i){if(n.marktype!=="group"&&i!=null&&!i.includes(n.marktype))return;const o=Ec[n.marktype];n.clip&&KMt(e,n),o.draw.call(this,e,n,r,i),n.clip&&e.restore()}clear(e,n,r,i){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(e,n,r,i),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(e,n,r,i))}}const JRt=(t,e,n)=>new uo().set(0,0,e,n).translate(-t[0],-t[1]);function eDt(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-(n[0]%1),-(n[1]%1)),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}class vNe extends Uie{constructor(e,n){super(e,n);const r=this;r._hrefHandler=uV(r,(i,o)=>{o&&o.href&&r.handleHref(i,o,o.href)}),r._tooltipHandler=uV(r,(i,o)=>{r.handleTooltip(i,o,i.type!==ok)})}initialize(e,n,r){let i=this._svg;return i&&(i.removeEventListener(FX,this._hrefHandler),i.removeEventListener($X,this._tooltipHandler),i.removeEventListener(ok,this._tooltipHandler)),this._svg=i=e&&Bie(e,"svg"),i&&(i.addEventListener(FX,this._hrefHandler),i.addEventListener($X,this._tooltipHandler),i.addEventListener(ok,this._tooltipHandler)),super.initialize(e,n,r)}canvas(){return this._svg}on(e,n){const r=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[r],e,n)<0){const s={type:e,handler:n,listener:uV(this,n)};(i[r]||(i[r]=[])).push(s),this._svg&&this._svg.addEventListener(r,s.listener)}return this}off(e,n){const r=this.eventName(e),i=this._handlers[r],o=this._handlerIndex(i,e,n);return o>=0&&(this._svg&&this._svg.removeEventListener(r,i[o].listener),i.splice(o,1)),this}}const uV=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)},yNe="aria-hidden",Wie="aria-label",Vie="role",Gie="aria-roledescription",xNe="graphics-object",Hie="graphics-symbol",bNe=(t,e,n)=>({[Vie]:t,[Gie]:e,[Wie]:n||void 0}),tDt=Wf(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),cme={axis:{desc:"axis",caption:iDt},legend:{desc:"legend",caption:oDt},"title-text":{desc:"title",caption:t=>`Title text '${fme(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${fme(t)}'`}},ume={ariaRole:Vie,ariaRoleDescription:Gie,description:Wie};function wNe(t,e){const n=e.aria===!1;if(t(yNe,n||void 0),n||e.description==null)for(const r in ume)t(ume[r],void 0);else{const r=e.mark.marktype;t(Wie,e.description),t(Vie,e.ariaRole||(r==="group"?xNe:Hie)),t(Gie,e.ariaRoleDescription||`${r} mark`)}}function _Ne(t){return t.aria===!1?{[yNe]:!0}:tDt[t.role]?null:cme[t.role]?rDt(t,cme[t.role]):nDt(t)}function nDt(t){const e=t.marktype,n=e==="group"||e==="text"||t.items.some(r=>r.description!=null&&r.aria!==!1);return bNe(n?xNe:Hie,`${e} mark container`,t.description)}function rDt(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return bNe(e.role||Hie,e.desc,n.description||r(n))}catch{return null}}function fme(t){return pt(t.text).join(" ")}function iDt(t){const e=t.datum,n=t.orient,r=e.title?SNe(t):null,i=t.context,o=i.scales[e.scale].value,s=i.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${GS(a)?"discrete":a} scale with ${$Fe(s,o,t)}`}function oDt(t){const e=t.datum,n=e.title?SNe(t):null,r=`${e.type||""} legend`.trim(),i=e.scales,o=Object.keys(i),s=t.context,a=s.scales[i[o[0]]].value,l=s.dataflow.locale();return aDt(r)+(n?` titled '${n}'`:"")+` for ${sDt(o)} with ${$Fe(l,a,t)}`}function SNe(t){try{return pt($n(t.items).items[0].text).join(" ")}catch{return null}}function sDt(t){return t=t.map(e=>e+(e==="fill"||e==="stroke"?" color":"")),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+$n(t)}function aDt(t){return t.length?t[0].toUpperCase()+t.slice(1):t}const CNe=t=>(t+"").replace(/&/g,"&").replace(//g,">"),lDt=t=>CNe(t).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function qie(){let t="",e="",n="";const r=[],i=()=>e=n="",o=l=>{e&&(t+=`${e}>${n}`,i()),r.push(l)},s=(l,c)=>(c!=null&&(e+=` ${l}="${lDt(c)}"`),a),a={open(l){o(l),e="<"+l;for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f${n}`:"/>"):t+=``,i(),a},attr:s,text:l=>(n+=CNe(l),a),toString:()=>t};return a}const ONe=t=>ENe(qie(),t)+"";function ENe(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,r=n.length;for(let i=0;i{u.dirty=n})),!i.zdirty){if(r.exit){s.nested&&i.items.length?(c=i.items[0],c._svg&&this._update(s,c._svg,c)):r._svg&&(c=r._svg.parentNode,c&&c.removeChild(r._svg)),r._svg=null;continue}r=s.nested?i.items[0]:r,r._update!==n&&(!r._svg||!r._svg.ownerSVGElement?(this._dirtyAll=!1,hme(r,n)):this._update(s,r._svg,r),r._update=n)}return!this._dirtyAll}mark(e,n,r,i){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Ec[s],l=n.interactive===!1?"none":null,c=a.tag==="g",u=pme(n,e,r,"g",o);if(s!=="group"&&i!=null&&!i.includes(s))return qc(u,0),n._svg;u.setAttribute("class",uNe(n));const f=_Ne(n);for(const g in f)pa(u,g,f[g]);c||pa(u,"pointer-events",l),pa(u,"clip-path",n.clip?Oie(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),v=pme(g,u,d,a.tag,o);m&&(this._update(a,v,g),c&&fDt(this,v,g,i)),d=v,++h};return a.nested?n.items.length&&p(n.items[0]):Gf(n,p),qc(u,h),u}_update(e,n,r){Jp=n,js=n.__values__,wNe(sk,r),e.attr(sk,r,this);const i=hDt[e.type];i&&i.call(this,e,n,r),Jp&&this.style(Jp,r)}style(e,n){if(n!=null){for(const r in GN){let i=r==="font"?wR(n):n[r];if(i===js[r])continue;const o=GN[r];i==null?e.removeAttribute(o):(_ie(i)&&(i=NFe(i,this._defs.gradient,kNe())),e.setAttribute(o,i+"")),js[r]=i}for(const r in HN)S3(e,HN[r],n[r])}}defs(){const e=this._svg,n=this._defs;let r=n.el,i=0;for(const o in n.gradient)r||(n.el=r=xo(e,e2+1,"defs",vo)),i=cDt(r,n.gradient[o],i);for(const o in n.clipping)r||(n.el=r=xo(e,e2+1,"defs",vo)),i=uDt(r,n.clipping[o],i);r&&(i===0?(e.removeChild(r),n.el=null):qc(r,i))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function hme(t,e){for(;t&&t.dirty!==e;t=t.mark.group)if(t.dirty=e,t.mark&&t.mark.dirty!==e)t.mark.dirty=e;else return}function cDt(t,e,n){let r,i,o;if(e.gradient==="radial"){let s=xo(t,n++,"pattern",vo);pv(s,{id:IN+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=xo(s,0,"rect",vo),pv(s,{width:1,height:1,fill:`url(${kNe()}#${e.id})`}),t=xo(t,n++,"radialGradient",vo),pv(t,{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else t=xo(t,n++,"linearGradient",vo),pv(t,{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(r=0,i=e.stops.length;r{i=t.mark(e,s,i,r),++o}),qc(e,1+o)}function pme(t,e,n,r,i){let o=t._svg,s;if(!o&&(s=e.ownerDocument,o=hv(s,r,vo),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},r==="g"))){const a=hv(s,"path",vo);o.appendChild(a),a.__data__=t;const l=hv(s,"g",vo);o.appendChild(l),l.__data__=t;const c=hv(s,"path",vo);o.appendChild(c),c.__data__=t,c.__values__={fill:"default"}}return(o.ownerSVGElement!==i||dDt(o,n))&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}function dDt(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}let Jp=null,js=null;const hDt={group(t,e,n){const r=Jp=e.childNodes[2];js=r.__values__,t.foreground(sk,n,this),js=e.__values__,Jp=e.childNodes[1],t.content(sk,n,this);const i=Jp=e.childNodes[0];t.background(sk,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==js.events&&(pa(r,"pointer-events",o),pa(i,"pointer-events",o),js.events=o),n.strokeForeground&&n.stroke){const s=n.fill;pa(r,"display",null),this.style(i,n),pa(i,"stroke",null),s&&(n.fill=null),js=r.__values__,this.style(r,n),s&&(n.fill=s),Jp=null}else pa(r,"display","none")},image(t,e,n){n.smooth===!1?(S3(e,"image-rendering","optimizeSpeed"),S3(e,"image-rendering","pixelated")):S3(e,"image-rendering",null)},text(t,e,n){const r=bR(n);let i,o,s,a;We(r)?(o=r.map(l=>uy(n,l)),i=o.join(` +`),i!==js.text&&(qc(e,0),s=e.ownerDocument,a=cy(n),o.forEach((l,c)=>{const u=hv(s,"tspan",vo);u.__data__=n,u.textContent=l,c&&(u.setAttribute("x",0),u.setAttribute("dy",a)),e.appendChild(u)}),js.text=i)):(o=uy(n,r),o!==js.text&&(e.textContent=o,js.text=o)),pa(e,"font-family",wR(n)),pa(e,"font-size",Gh(n)+"px"),pa(e,"font-style",n.fontStyle),pa(e,"font-variant",n.fontVariant),pa(e,"font-weight",n.fontWeight)}};function sk(t,e,n){e!==js[t]&&(n?pDt(Jp,t,e,n):pa(Jp,t,e),js[t]=e)}function S3(t,e,n){n!==js[e]&&(n==null?t.style.removeProperty(e):t.style.setProperty(e,n+""),js[e]=n)}function pv(t,e){for(const n in e)pa(t,n,e[n])}function pa(t,e,n){n!=null?t.setAttribute(e,n):t.removeAttribute(e)}function pDt(t,e,n,r){n!=null?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}function kNe(){let t;return typeof window>"u"?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}class ANe extends _R{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const n=qie();n.open("svg",cn({},RA,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const r=this._bgcolor;return r&&r!=="transparent"&&r!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:r}).close(),n.open("g",TNe,{transform:"translate("+this._origin+")"}),this.mark(n,e),n.close(),this.defs(n),this._text=n.close()+"",this}mark(e,n){const r=Ec[n.marktype],i=r.tag,o=[wNe,r.attr];e.open("g",{class:uNe(n),"clip-path":n.clip?Oie(this,n,n.group):null},_Ne(n),{"pointer-events":i!=="g"&&n.interactive===!1?"none":null});const s=a=>{const l=this.href(a);if(l&&e.open("a",l),e.open(i,this.attr(n,a,o,i!=="g"?i:null)),i==="text"){const c=bR(a);if(We(c)){const u={x:0,dy:cy(a)};for(let f=0;fthis.mark(e,d)),e.close(),c&&f?(u&&(a.fill=null),a.stroke=f,e.open("path",this.attr(n,a,r.foreground,"bgrect")).close(),u&&(a.fill=u)):e.open("path",this.attr(n,a,r.foreground,"bgfore")).close()}e.close(),l&&e.close()};return r.nested?n.items&&n.items.length&&s(n.items[0]):Gf(n,s),e.close()}href(e){const n=e.href;let r;if(n){if(r=this._hrefs&&this._hrefs[n])return r;this.sanitizeURL(n).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[n]=i})}return null}attr(e,n,r,i){const o={},s=(a,l,c,u)=>{o[u||a]=l};return Array.isArray(r)?r.forEach(a=>a(s,n,this)):r(s,n,this),i&&gDt(o,n,e,i,this._defs),o}defs(e){const n=this._defs.gradient,r=this._defs.clipping;if(Object.keys(n).length+Object.keys(r).length!==0){e.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(e.open("pattern",{id:IN+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),e.close(),e.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):e.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let l=0;l!ff.svgMarkTypes.includes(o));this._svgRenderer.render(e,ff.svgMarkTypes),this._canvasRenderer.render(e,i)}resize(e,n,r,i){return super.resize(e,n,r,i),this._svgRenderer.resize(e,n,r,i),this._canvasRenderer.resize(e,n,r,i),this}background(e){return ff.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}class PNe extends SR{constructor(e,n){super(e,n)}initialize(e,n,r){const i=xo(xo(e,0,"div"),ff.svgOnTop?0:1,"div");return super.initialize(i,n,r)}}const MNe="canvas",RNe="hybrid",DNe="png",INe="svg",LNe="none",gv={Canvas:MNe,PNG:DNe,SVG:INe,Hybrid:RNe,None:LNe},vb={};vb[MNe]=vb[DNe]={renderer:VN,headless:VN,handler:SR};vb[INe]={renderer:Xie,headless:ANe,handler:vNe};vb[RNe]={renderer:NX,headless:NX,handler:PNe};vb[LNe]={};function WB(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(vb[t]=e,this):vb[t]}function $Ne(t,e,n){const r=[],i=new uo().union(e),o=t.marktype;return o?FNe(t,i,n,r):o==="group"?NNe(t,i,n,r):je("Intersect scene must be mark node or group item.")}function FNe(t,e,n,r){if(vDt(t,e,n)){const i=t.items,o=t.marktype,s=i.length;let a=0;if(o==="group")for(;a=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!Yie(t[i],e[i],i))return!1;return typeof t==typeof e}function bDt(){GFe(),VPt()}const YS="top",Sf="left",Cf="right",fy="bottom",wDt="top-left",_Dt="top-right",SDt="bottom-left",CDt="bottom-right",Qie="start",zX="middle",ma="end",ODt="x",EDt="y",VB="group",Kie="axis",Zie="title",TDt="frame",kDt="scope",Jie="legend",UNe="row-header",WNe="row-footer",VNe="row-title",GNe="column-header",HNe="column-footer",qNe="column-title",ADt="padding",PDt="symbol",XNe="fit",YNe="fit-x",QNe="fit-y",MDt="pad",eoe="none",FI="all",jX="each",toe="flush",mv="column",vv="row";function KNe(t){De.call(this,null,t)}it(KNe,De,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=Ec[i],s=o.bound;let a=r.bounds,l;if(o.nested)r.items.length&&n.dirty(r.items[0]),a=NI(r,s),r.items.forEach(c=>{c.bounds.clear().union(a)});else if(i===VB||t.modified())switch(e.visit(e.MOD,c=>n.dirty(c)),a.clear(),r.items.forEach(c=>a.union(NI(c,s))),r.role){case Kie:case Jie:case Zie:e.reflow()}else l=e.changed(e.REM),e.visit(e.ADD,c=>{a.union(NI(c,s))}),e.visit(e.MOD,c=>{l=l||a.alignsWith(c.bounds),n.dirty(c),a.union(NI(c,s))}),l&&(a.clear(),r.items.forEach(c=>a.union(c.bounds)));return jNe(r),e.modifies("bounds")}});function NI(t,e,n){return e(t.bounds.clear(),t,n)}const gme=":vega_identifier:";function noe(t){De.call(this,0,t)}noe.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};it(noe,De,{transform(t,e){const n=RDt(e.dataflow),r=t.as;let i=n.value;return e.visit(e.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),e}});function RDt(t){return t._signals[gme]||(t._signals[gme]=t.add(0))}function ZNe(t){De.call(this,null,t)}it(ZNe,De,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,DDt(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const r=n.marktype===VB?LB:IB;return e.visit(e.ADD,i=>r.call(i,n)),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});function DDt(t){const e=t.groups,n=t.parent;return e&&e.size===1?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}function JNe(t){De.call(this,null,t)}const mme={parity:t=>t.filter((e,n)=>n%2?e.opacity=0:1),greedy:(t,e)=>{let n;return t.filter((r,i)=>!i||!e5e(n.bounds,r.bounds,e)?(n=r,1):r.opacity=0)}},e5e=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),vme=(t,e)=>{for(var n=1,r=t.length,i=t[0].bounds,o;n{const e=t.bounds;return e.width()>1&&e.height()>1},LDt=(t,e,n)=>{var r=t.range(),i=new uo;return e===YS||e===fy?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},yme=t=>(t.forEach(e=>e.opacity=1),t),xme=(t,e)=>t.reflow(e.modified()).modifies("opacity");it(JNe,De,{transform(t,e){const n=mme[t.method]||mme.parity,r=t.separation||0;let i=e.materialize(e.SOURCE).source,o,s;if(!i||!i.length)return;if(!t.method)return t.modified("method")&&(yme(i),e=xme(e,t)),e;if(i=i.filter(IDt),!i.length)return;if(t.sort&&(i=i.slice().sort(t.sort)),o=yme(i),e=xme(e,t),o.length>=3&&vme(o,r)){do o=n(o,r);while(o.length>=3&&vme(o,r));o.length<3&&!$n(i).opacity&&(o.length>1&&($n(o).opacity=0),$n(i).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(s=LDt(t.boundScale,t.boundOrient,+t.boundTolerance),i.forEach(l=>{s(l)||(l.opacity=0)}));const a=o[0].mark.bounds.clear();return i.forEach(l=>{l.opacity&&a.union(l.bounds)}),e}});function t5e(t){De.call(this,null,t)}it(t5e,De,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,r=>n.dirty(r)),e.fields&&e.fields.zindex){const r=e.source&&e.source[0];r&&(r.mark.zdirty=!0)}}});const Ns=new uo;function h_(t,e,n){return t[e]===n?0:(t[e]=n,1)}function $Dt(t){var e=t.items[0].orient;return e===Sf||e===Cf}function FDt(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}function NDt(t,e,n,r){var i=e.items[0],o=i.datum,s=i.translate!=null?i.translate:.5,a=i.orient,l=FDt(o),c=i.range,u=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[l[2]].items[0],g=i.titlePadding,m=i.bounds,v=p&&Nie(p),y=0,x=0,b,w;switch(Ns.clear().union(m),m.clear(),(b=l[0])>-1&&m.union(i.items[b].bounds),(b=l[1])>-1&&m.union(i.items[b].bounds),a){case YS:y=f||0,x=-u,w=Math.max(d,Math.min(h,-m.y1)),m.add(0,-w).add(c,0),p&&zI(t,p,w,g,v,0,-1,m);break;case Sf:y=-u,x=f||0,w=Math.max(d,Math.min(h,-m.x1)),m.add(-w,0).add(0,c),p&&zI(t,p,w,g,v,1,-1,m);break;case Cf:y=n+u,x=f||0,w=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(w,c),p&&zI(t,p,w,g,v,1,1,m);break;case fy:y=f||0,x=r+u,w=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(c,w),p&&zI(t,p,w,g,0,0,1,m);break;default:y=i.x,x=i.y}return Yg(m.translate(y,x),i),h_(i,"x",y+s)|h_(i,"y",x+s)&&(i.bounds=Ns,t.dirty(i),i.bounds=m,t.dirty(i)),i.mark.bounds.clear().union(m)}function zI(t,e,n,r,i,o,s,a){const l=e.bounds;if(e.auto){const c=s*(n+i+r);let u=0,f=0;t.dirty(e),o?u=(e.x||0)-(e.x=c):f=(e.y||0)-(e.y=c),e.mark.bounds.clear().union(l.translate(-u,-f)),t.dirty(e)}a.union(l)}const bme=(t,e)=>Math.floor(Math.min(t,e)),wme=(t,e)=>Math.ceil(Math.max(t,e));function zDt(t){var e=t.items,n=e.length,r=0,i,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(S=0;S0&&(x[S]+=T/2);if(a&&fi(n.center,vv)&&u!==1)for(S=0;S0&&(b[S]+=M/2);for(S=0;Si&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),g+=o,y=0,b=e.length;y=0&&(S=n[x])==null;x-=d);a?(O=h==null?S.x:Math.round(S.bounds.x1+h*S.bounds.width()),k=g):(O=g,k=h==null?S.y:Math.round(S.bounds.y1+h*S.bounds.height())),w.union(_.bounds.translate(O-(_.x||0),k-(_.y||0))),_.x=O,_.y=k,t.dirty(_),m=s(m,w[c])}return m}function Sme(t,e,n,r,i,o){if(e){t.dirty(e);var s=n,a=n;r?s=Math.round(i.x1+o*i.width()):a=Math.round(i.y1+o*i.height()),e.bounds.translate(s-(e.x||0),a-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=s,e.y=a,t.dirty(e)}}function GDt(t,e){const n=t[e]||{};return(r,i)=>n[r]!=null?n[r]:t[r]!=null?t[r]:i}function HDt(t,e){let n=-1/0;return t.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:e}function qDt(t,e,n,r,i,o,s){const a=GDt(n,e),l=HDt(t,a("offset",0)),c=a("anchor",Qie),u=c===ma?1:c===zX?.5:0,f={align:jX,bounds:a("bounds",toe),columns:a("direction")==="vertical"?1:t.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(e){case Sf:f.anchor={x:Math.floor(r.x1)-l,column:ma,y:u*(s||r.height()+2*r.y1),row:c};break;case Cf:f.anchor={x:Math.ceil(r.x2)+l,y:u*(s||r.height()+2*r.y1),row:c};break;case YS:f.anchor={y:Math.floor(i.y1)-l,row:ma,x:u*(o||i.width()+2*i.x1),column:c};break;case fy:f.anchor={y:Math.ceil(i.y2)+l,x:u*(o||i.width()+2*i.x1),column:c};break;case wDt:f.anchor={x:l,y:l};break;case _Dt:f.anchor={x:o-l,y:l,column:ma};break;case SDt:f.anchor={x:l,y:s-l,row:ma};break;case CDt:f.anchor={x:o-l,y:s-l,column:ma,row:ma};break}return f}function XDt(t,e){var n=e.items[0],r=n.datum,i=n.orient,o=n.bounds,s=n.x,a=n.y,l,c;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),QDt(t,n,n.items[0].items[0]),o=YDt(n,o),l=2*n.padding,c=2*n.padding,o.empty()||(l=Math.ceil(o.width()+l),c=Math.ceil(o.height()+c)),r.type===PDt&&KDt(n.items[0].items[0].items[0].items),i!==eoe&&(n.x=s=0,n.y=a=0),n.width=l,n.height=c,Yg(o.set(s,a,s+l,a+c),n),n.mark.bounds.clear().union(o),n}function YDt(t,e){return t.items.forEach(n=>e.union(n.bounds)),e.x1=t.padding,e.y1=t.padding,e}function QDt(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(!e.datum.title)(i||o)&&t2(t,n,i,o);else{var s=e.items[1].items[0],a=s.anchor,l=e.titlePadding||0,c=r-s.x,u=r-s.y;switch(s.orient){case Sf:i+=Math.ceil(s.bounds.width())+l;break;case Cf:case fy:break;default:o+=s.bounds.height()+l}switch((i||o)&&t2(t,n,i,o),s.orient){case Sf:u+=ew(e,n,s,a,1,1);break;case Cf:c+=ew(e,n,s,ma,0,0)+l,u+=ew(e,n,s,a,1,1);break;case fy:c+=ew(e,n,s,a,0,0),u+=ew(e,n,s,ma,-1,0,1)+l;break;default:c+=ew(e,n,s,a,0,0)}(c||u)&&t2(t,s,c,u),(c=Math.round(s.bounds.x1-r))<0&&(t2(t,n,-c,0),t2(t,s,-c,0))}}function ew(t,e,n,r,i,o,s){const a=t.datum.type!=="symbol",l=n.datum.vgrad,c=a&&(o||!l)&&!s?e.items[0]:e,u=c.bounds[i?"y2":"x2"]-t.padding,f=l&&o?u:0,d=l&&o?0:u,h=i<=0?0:Nie(n);return Math.round(r===Qie?f:r===ma?d-h:.5*(u-h))}function t2(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function KDt(t){const e=t.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});t.forEach(n=>{n.width=e[n.column],n.height=n.bounds.y2-n.y})}function ZDt(t,e,n,r,i){var o=e.items[0],s=o.frame,a=o.orient,l=o.anchor,c=o.offset,u=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===Sf||a===Cf?r:n,p=0,g=0,m=0,v=0,y=0,x;if(s!==VB?a===Sf?(p=i.y2,h=i.y1):a===Cf?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):a===Sf&&(p=r,h=0),x=l===Qie?p:l===ma?h:(p+h)/2,d&&d.text){switch(a){case YS:case fy:y=f.bounds.height()+u;break;case Sf:v=f.bounds.width()+u;break;case Cf:v=-f.bounds.width()-u;break}Ns.clear().union(d.bounds),Ns.translate(v-(d.x||0),y-(d.y||0)),h_(d,"x",v)|h_(d,"y",y)&&(t.dirty(d),d.bounds.clear().union(Ns),d.mark.bounds.clear().union(Ns),t.dirty(d)),Ns.clear().union(d.bounds)}else Ns.clear();switch(Ns.union(f.bounds),a){case YS:g=x,m=i.y1-Ns.height()-c;break;case Sf:g=i.x1-Ns.width()-c,m=x;break;case Cf:g=i.x2+Ns.width()+c,m=x;break;case fy:g=x,m=i.y2+c;break;default:g=o.x,m=o.y}return h_(o,"x",g)|h_(o,"y",m)&&(Ns.translate(g,m),t.dirty(o),o.bounds.clear().union(Ns),e.bounds.clear().union(Ns),t.dirty(o)),o.bounds}function r5e(t){De.call(this,null,t)}it(r5e,De,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach(r=>{t.layout&&UDt(n,r,t.layout),eIt(n,r,t)}),JDt(t.mark.group)?e.reflow():e}});function JDt(t){return t&&t.mark.role!=="legend-entry"}function eIt(t,e,n){var r=e.items,i=Math.max(0,e.width||0),o=Math.max(0,e.height||0),s=new uo().set(0,0,i,o),a=s.clone(),l=s.clone(),c=[],u,f,d,h,p,g;for(p=0,g=r.length;p{d=v.orient||Cf,d!==eoe&&(m[d]||(m[d]=[])).push(v)});for(const v in m){const y=m[v];n5e(t,y,qDt(y,v,n.legends,a,l,i,o))}c.forEach(v=>{const y=v.bounds;if(y.equals(v._bounds)||(v.bounds=v._bounds,t.dirty(v),v.bounds=y,t.dirty(v)),n.autosize&&(n.autosize.type===XNe||n.autosize.type===YNe||n.autosize.type===QNe))switch(v.orient){case Sf:case Cf:s.add(y.x1,0).add(y.x2,0);break;case YS:case fy:s.add(0,y.y1).add(0,y.y2)}else s.union(y)})}s.union(a).union(l),u&&s.union(ZDt(t,u,i,o,s)),e.clip&&s.set(0,0,e.width||0,e.height||0),tIt(t,e,s,n)}function tIt(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let s=t._width,a=t._height,l=Math.max(0,e.width||0),c=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-u));if(i.contains===ADt){const p=t.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===eoe?(c=0,f=0,l=s,u=a):o===XNe?(l=Math.max(0,s-c-d),u=Math.max(0,a-f-h)):o===YNe?(l=Math.max(0,s-c-d),a=u+f+h):o===QNe?(s=l+c+d,u=Math.max(0,a-f-h)):o===MDt&&(s=l+c+d,a=u+f+h),t._resizeView(s,a,l,u,[c,f],i.resize)}const nIt=Object.freeze(Object.defineProperty({__proto__:null,bound:KNe,identifier:noe,mark:ZNe,overlap:JNe,render:t5e,viewlayout:r5e},Symbol.toStringTag,{value:"Module"}));function i5e(t){De.call(this,null,t)}it(i5e,De,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,s=t.count==null?t.values?t.values.length:10:t.count,a=bie(o,s,t.minstep),l=t.format||MFe(n,o,a,t.formatSpecifier,t.formatType,!!t.values),c=t.values?PFe(o,t.values,a):wie(o,a);return i&&(r.rem=i),i=c.map((u,f)=>cr({index:f/(c.length-1||1),value:u,label:l(u)})),t.extra&&i.length&&i.push(cr({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function o5e(t){De.call(this,null,t)}function rIt(){return cr({})}function iIt(t){const e=bO().test(n=>n.exit);return e.lookup=n=>e.get(t(n)),e}it(o5e,De,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||rIt,o=t.key||jt,s=this.value;return We(r.encode)&&(r.encode=null),s&&(t.modified("key")||e.modified(o))&&je("DataJoin does not support modified key function or fields."),s||(e=e.addAll(),this.value=s=iIt(o)),e.visit(e.ADD,a=>{const l=o(a);let c=s.get(l);c?c.exit?(s.empty--,r.add.push(c)):r.mod.push(c):(c=i(a),s.set(l,c),r.add.push(c)),c.datum=a,c.exit=!1}),e.visit(e.MOD,a=>{const l=o(a),c=s.get(l);c&&(c.datum=a,r.mod.push(c))}),e.visit(e.REM,a=>{const l=o(a),c=s.get(l);a===c.datum&&!c.exit&&(r.rem.push(c),c.exit=!0,++s.empty)}),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),r}});function s5e(t){De.call(this,null,t)}it(s5e,De,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(We(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return e.StopPropagation;var s=o==="enter",a=i.update||Rm,l=i.enter||Rm,c=i.exit||Rm,u=(o&&!s?i[o]:a)||Rm;if(e.changed(e.ADD)&&(e.visit(e.ADD,f=>{l(f,t),a(f,t)}),n.modifies(l.output),n.modifies(a.output),u!==Rm&&u!==a&&(e.visit(e.ADD,f=>{u(f,t)}),n.modifies(u.output))),e.changed(e.REM)&&c!==Rm&&(e.visit(e.REM,f=>{c(f,t)}),n.modifies(c.output)),s||u!==Rm){const f=e.MOD|(t.modified()?e.REFLOW:0);s?(e.visit(f,d=>{const h=l(d,t)||r;(u(d,t)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):e.visit(f,d=>{(u(d,t)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)}return n.changed()?n:e.StopPropagation}});function a5e(t){De.call(this,[],t)}it(a5e,De,{transform(t,e){if(this.value!=null&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.type||g3,s=t.scale,a=+t.limit,l=bie(s,t.count==null?5:t.count,t.minstep),c=!!t.values||o===g3,u=t.format||LFe(n,s,l,o,t.formatSpecifier,t.formatType,c),f=t.values||IFe(s,l),d,h,p,g,m;return i&&(r.rem=i),o===g3?(a&&f.length>a?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,a-1),m=!0):i=f,fn(p=t.size)?(!t.values&&s(i[0])===0&&(i=i.slice(1)),g=i.reduce((v,y)=>Math.max(v,p(y,t)),0)):p=ra(g=p||8),i=i.map((v,y)=>cr({index:y,label:u(v,y,i),value:v,offset:g,size:p(v,t)})),m&&(m=f[i.length],i.push(cr({index:i.length,label:`…${f.length-i.length} entries`,value:m,offset:g,size:p(m,t)})))):o===MPt?(d=s.domain(),h=TFe(s,d[0],$n(d)),f.length<3&&!t.values&&d[0]!==$n(d)&&(f=[d[0],$n(d)]),i=f.map((v,y)=>cr({index:y,label:u(v,y,f),value:v,perc:h(v)}))):(p=f.length-1,h=UPt(s),i=f.map((v,y)=>cr({index:y,label:u(v,y,f),value:v,perc:y?h(v):0,perc2:y===p?1:h(f[y+1])}))),r.source=i,r.add=i,this.value=i,r}});const oIt=t=>t.source.x,sIt=t=>t.source.y,aIt=t=>t.target.x,lIt=t=>t.target.y;function roe(t){De.call(this,{},t)}roe.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};it(roe,De,{transform(t,e){var n=t.sourceX||oIt,r=t.sourceY||sIt,i=t.targetX||aIt,o=t.targetY||lIt,s=t.as||"path",a=t.orient||"vertical",l=t.shape||"line",c=Cme.get(l+"-"+a)||Cme.get(l);return c||je("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,u=>{u[s]=c(n(u),r(u),i(u),o(u))}),e.reflow(t.modified()).modifies(s)}});const l5e=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,cIt=(t,e,n,r)=>l5e(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),c5e=(t,e,n,r)=>{var i=n-t,o=r-e,s=Math.hypot(i,o)/2,a=180*Math.atan2(o,i)/Math.PI;return"M"+t+","+e+"A"+s+","+s+" "+a+" 0 1 "+n+","+r},uIt=(t,e,n,r)=>c5e(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),u5e=(t,e,n,r)=>{const i=n-t,o=r-e,s=.2*(i+o),a=.2*(o-i);return"M"+t+","+e+"C"+(t+s)+","+(e+a)+" "+(n+a)+","+(r-s)+" "+n+","+r},fIt=(t,e,n,r)=>u5e(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),dIt=(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,hIt=(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,pIt=(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n),l=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+(l?1:0)+" "+e*s+","+e*a+"L"+r*s+","+r*a},gIt=(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},mIt=(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},vIt=(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n),l=(e+r)/2;return"M"+e*i+","+e*o+"C"+l*i+","+l*o+" "+l*s+","+l*a+" "+r*s+","+r*a},Cme=bO({line:l5e,"line-radial":cIt,arc:c5e,"arc-radial":uIt,curve:u5e,"curve-radial":fIt,"orthogonal-horizontal":dIt,"orthogonal-vertical":hIt,"orthogonal-radial":pIt,"diagonal-horizontal":gIt,"diagonal-vertical":mIt,"diagonal-radial":vIt});function ioe(t){De.call(this,null,t)}ioe.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};it(ioe,De,{transform(t,e){var n=t.as||["startAngle","endAngle"],r=n[0],i=n[1],o=t.field||vO,s=t.startAngle||0,a=t.endAngle!=null?t.endAngle:2*Math.PI,l=e.source,c=l.map(o),u=c.length,f=s,d=(a-s)/bLe(c),h=sl(u),p,g,m;for(t.sort&&h.sort((v,y)=>c[v]-c[y]),p=0;p-1)return r;var i=e.domain,o=t.type,s=e.zero||e.zero===void 0&&xIt(t),a,l;if(!i)return 0;if((s||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(a=(i=i.slice()).length-1||1,s&&(i[0]>0&&(i[0]=0),i[a]<0&&(i[a]=0)),e.domainMin!=null&&(i[0]=e.domainMin),e.domainMax!=null&&(i[a]=e.domainMax),e.domainMid!=null)){l=e.domainMid;const c=l>i[a]?a+1:li+(o<0?-1:o>0?1:0),0));r!==e.length&&n.warn("Log scale domain includes zero: "+rt(e))}return e}function EIt(t,e,n){let r=e.bins;if(r&&!We(r)){const i=t.domain(),o=i[0],s=$n(i),a=r.step;let l=r.start==null?o:r.start,c=r.stop==null?s:r.stop;a||je("Scale bins parameter missing step property."),ls&&(c=a*Math.floor(s/a)),r=sl(l,c+a/2,a)}return r?t.bins=r:t.bins&&delete t.bins,t.type===pie&&(r?!e.domain&&!e.domainRaw&&(t.domain(r),n=r.length):t.bins=t.domain()),n}function TIt(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(e.rangeStep!=null)o=kIt(r,e,n);else if(e.scheme&&(o=AIt(r,e,n),fn(o))){if(t.interpolator)return t.interpolator(o);je(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&SFe(r))return t.interpolator(RB(BX(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(yie(e.interpolate,e.interpolateGamma)):fn(t.round)?t.round(i):fn(t.rangeRound)&&t.interpolate(i?cR:Hy),o&&t.range(BX(o,e.reverse))}function kIt(t,e,n){t!==mFe&&t!==EX&&je("Only band and point scales support rangeStep.");var r=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,i=t===EX?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*die(n,i,r)]}function AIt(t,e,n){var r=e.schemeExtent,i,o;return We(e.scheme)?o=RB(e.scheme,e.interpolate,e.interpolateGamma):(i=e.scheme.toLowerCase(),o=xie(i),o||je(`Unrecognized scheme name: ${e.scheme}`)),n=t===MB?n+1:t===pie?n-1:t===VS||t===PB?+e.schemeCount||yIt:n,SFe(t)?Ome(o,r,e.reverse):fn(o)?EFe(Ome(o,r),n):t===hie?o:o.slice(0,n)}function Ome(t,e,n){return fn(t)&&(e||n)?OFe(t,BX(e||[0,1],n)):t}function BX(t,e){return e?t.slice().reverse():t}function p5e(t){De.call(this,null,t)}it(p5e,De,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(d1(t.sort)),this.modified(n),e}});const Eme="zero",g5e="center",m5e="normalize",v5e=["y0","y1"];function ooe(t){De.call(this,null,t)}ooe.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:Eme,values:[Eme,g5e,m5e]},{name:"as",type:"string",array:!0,length:2,default:v5e}]};it(ooe,De,{transform(t,e){var n=t.as||v5e,r=n[0],i=n[1],o=d1(t.sort),s=t.field||vO,a=t.offset===g5e?PIt:t.offset===m5e?MIt:RIt,l,c,u,f;for(l=DIt(e.source,t.groupby,o,s),c=0,u=l.length,f=l.max;cg(u),s,a,l,c,u,f,d,h,p;if(e==null)i.push(t.slice());else for(s={},a=0,l=t.length;ap&&(p=h),n&&d.sort(n)}return i.max=p,i}const IIt=Object.freeze(Object.defineProperty({__proto__:null,axisticks:i5e,datajoin:o5e,encode:s5e,legendentries:a5e,linkpath:roe,pie:ioe,scale:d5e,sortitems:p5e,stack:ooe},Symbol.toStringTag,{value:"Module"}));var Ut=1e-6,qN=1e-12,xn=Math.PI,Li=xn/2,XN=xn/4,Pa=xn*2,Ui=180/xn,vn=xn/180,Ln=Math.abs,PO=Math.atan,Au=Math.atan2,Vt=Math.cos,BI=Math.ceil,y5e=Math.exp,UX=Math.hypot,YN=Math.log,dV=Math.pow,Bt=Math.sin,iu=Math.sign||function(t){return t>0?1:t<0?-1:0},Ma=Math.sqrt,soe=Math.tan;function x5e(t){return t>1?0:t<-1?xn:Math.acos(t)}function Sl(t){return t>1?Li:t<-1?-Li:Math.asin(t)}function ps(){}function QN(t,e){t&&kme.hasOwnProperty(t.type)&&kme[t.type](t,e)}var Tme={Feature:function(t,e){QN(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Vt(e),s=Bt(e),a=HX*s,l=GX*o+a*Vt(i),c=a*r*Bt(i);KN.add(Au(c,l)),VX=t,GX=o,HX=s}function NIt(t){return ZN=new Ea,Vp(t,Rh),ZN*2}function JN(t){return[Au(t[1],t[0]),Sl(t[2])]}function yb(t){var e=t[0],n=t[1],r=Vt(n);return[r*Vt(e),r*Bt(e),Bt(n)]}function UI(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function QS(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function hV(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function WI(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function e5(t){var e=Ma(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var bi,Qa,Ri,Kl,V0,S5e,C5e,U_,ak,Ym,Ng,Np={point:qX,lineStart:Pme,lineEnd:Mme,polygonStart:function(){Np.point=E5e,Np.lineStart=zIt,Np.lineEnd=jIt,ak=new Ea,Rh.polygonStart()},polygonEnd:function(){Rh.polygonEnd(),Np.point=qX,Np.lineStart=Pme,Np.lineEnd=Mme,KN<0?(bi=-(Ri=180),Qa=-(Kl=90)):ak>Ut?Kl=90:ak<-Ut&&(Qa=-90),Ng[0]=bi,Ng[1]=Ri},sphere:function(){bi=-(Ri=180),Qa=-(Kl=90)}};function qX(t,e){Ym.push(Ng=[bi=t,Ri=t]),eKl&&(Kl=e)}function O5e(t,e){var n=yb([t*vn,e*vn]);if(U_){var r=QS(U_,n),i=[r[1],-r[0],0],o=QS(i,r);e5(o),o=JN(o);var s=t-V0,a=s>0?1:-1,l=o[0]*Ui*a,c,u=Ln(s)>180;u^(a*V0Kl&&(Kl=c)):(l=(l+360)%360-180,u^(a*V0Kl&&(Kl=e))),u?tXl(bi,Ri)&&(Ri=t):Xl(t,Ri)>Xl(bi,Ri)&&(bi=t):Ri>=bi?(tRi&&(Ri=t)):t>V0?Xl(bi,t)>Xl(bi,Ri)&&(Ri=t):Xl(t,Ri)>Xl(bi,Ri)&&(bi=t)}else Ym.push(Ng=[bi=t,Ri=t]);eKl&&(Kl=e),U_=n,V0=t}function Pme(){Np.point=O5e}function Mme(){Ng[0]=bi,Ng[1]=Ri,Np.point=qX,U_=null}function E5e(t,e){if(U_){var n=t-V0;ak.add(Ln(n)>180?n+(n>0?360:-360):n)}else S5e=t,C5e=e;Rh.point(t,e),O5e(t,e)}function zIt(){Rh.lineStart()}function jIt(){E5e(S5e,C5e),Rh.lineEnd(),Ln(ak)>Ut&&(bi=-(Ri=180)),Ng[0]=bi,Ng[1]=Ri,U_=null}function Xl(t,e){return(e-=t)<0?e+360:e}function BIt(t,e){return t[0]-e[0]}function Rme(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eXl(r[0],r[1])&&(r[1]=i[1]),Xl(i[0],r[1])>Xl(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(s=-1/0,n=o.length-1,e=0,r=o[n];e<=n;r=i,++e)i=o[e],(a=Xl(r[1],i[0]))>s&&(s=a,bi=i[0],Ri=r[1])}return Ym=Ng=null,bi===1/0||Qa===1/0?[[NaN,NaN],[NaN,NaN]]:[[bi,Qa],[Ri,Kl]]}var cT,t5,n5,r5,i5,o5,s5,a5,XX,YX,QX,T5e,k5e,ya,xa,ba,Of={sphere:ps,point:aoe,lineStart:Dme,lineEnd:Ime,polygonStart:function(){Of.lineStart=GIt,Of.lineEnd=HIt},polygonEnd:function(){Of.lineStart=Dme,Of.lineEnd=Ime}};function aoe(t,e){t*=vn,e*=vn;var n=Vt(e);CR(n*Vt(t),n*Bt(t),Bt(e))}function CR(t,e,n){++cT,n5+=(t-n5)/cT,r5+=(e-r5)/cT,i5+=(n-i5)/cT}function Dme(){Of.point=WIt}function WIt(t,e){t*=vn,e*=vn;var n=Vt(e);ya=n*Vt(t),xa=n*Bt(t),ba=Bt(e),Of.point=VIt,CR(ya,xa,ba)}function VIt(t,e){t*=vn,e*=vn;var n=Vt(e),r=n*Vt(t),i=n*Bt(t),o=Bt(e),s=Au(Ma((s=xa*o-ba*i)*s+(s=ba*r-ya*o)*s+(s=ya*i-xa*r)*s),ya*r+xa*i+ba*o);t5+=s,o5+=s*(ya+(ya=r)),s5+=s*(xa+(xa=i)),a5+=s*(ba+(ba=o)),CR(ya,xa,ba)}function Ime(){Of.point=aoe}function GIt(){Of.point=qIt}function HIt(){A5e(T5e,k5e),Of.point=aoe}function qIt(t,e){T5e=t,k5e=e,t*=vn,e*=vn,Of.point=A5e;var n=Vt(e);ya=n*Vt(t),xa=n*Bt(t),ba=Bt(e),CR(ya,xa,ba)}function A5e(t,e){t*=vn,e*=vn;var n=Vt(e),r=n*Vt(t),i=n*Bt(t),o=Bt(e),s=xa*o-ba*i,a=ba*r-ya*o,l=ya*i-xa*r,c=UX(s,a,l),u=Sl(c),f=c&&-u/c;XX.add(f*s),YX.add(f*a),QX.add(f*l),t5+=u,o5+=u*(ya+(ya=r)),s5+=u*(xa+(xa=i)),a5+=u*(ba+(ba=o)),CR(ya,xa,ba)}function XIt(t){cT=t5=n5=r5=i5=o5=s5=a5=0,XX=new Ea,YX=new Ea,QX=new Ea,Vp(t,Of);var e=+XX,n=+YX,r=+QX,i=UX(e,n,r);return ixn&&(t-=Math.round(t/Pa)*Pa),[t,e]}ZX.invert=ZX;function P5e(t,e,n){return(t%=Pa)?e||n?KX($me(t),Fme(e,n)):$me(t):e||n?Fme(e,n):ZX}function Lme(t){return function(e,n){return e+=t,Ln(e)>xn&&(e-=Math.round(e/Pa)*Pa),[e,n]}}function $me(t){var e=Lme(t);return e.invert=Lme(-t),e}function Fme(t,e){var n=Vt(t),r=Bt(t),i=Vt(e),o=Bt(e);function s(a,l){var c=Vt(l),u=Vt(a)*c,f=Bt(a)*c,d=Bt(l),h=d*n+u*r;return[Au(f*i-h*o,u*n-d*r),Sl(h*i+f*o)]}return s.invert=function(a,l){var c=Vt(l),u=Vt(a)*c,f=Bt(a)*c,d=Bt(l),h=d*i-f*o;return[Au(f*i+d*o,u*n+h*r),Sl(h*n-u*r)]},s}function YIt(t){t=P5e(t[0]*vn,t[1]*vn,t.length>2?t[2]*vn:0);function e(n){return n=t(n[0]*vn,n[1]*vn),n[0]*=Ui,n[1]*=Ui,n}return e.invert=function(n){return n=t.invert(n[0]*vn,n[1]*vn),n[0]*=Ui,n[1]*=Ui,n},e}function QIt(t,e,n,r,i,o){if(n){var s=Vt(e),a=Bt(e),l=r*n;i==null?(i=e+r*Pa,o=e-l/2):(i=Nme(s,i),o=Nme(s,o),(r>0?io)&&(i+=r*Pa));for(var c,u=i;r>0?u>o:u1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function C3(t,e){return Ln(t[0]-e[0])=0;--a)i.point((f=u[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function zme(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n=0?1:-1,E=k*O,P=E>xn,A=m*_;if(l.add(Au(A*k*Bt(E),v*S+A*Vt(E))),s+=P?O+k*Pa:O,P^p>=n^b>=n){var R=QS(yb(h),yb(x));e5(R);var T=QS(o,R);e5(T);var M=(P^O>=0?-1:1)*Sl(T[2]);(r>M||r===M&&(R[0]||R[1]))&&(a+=P^O>=0?1:-1)}}return(s<-Ut||s0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_1&&b&2&&w.push(w.pop().concat(w.shift())),u.push(w.filter(ZIt))}}return d}}function ZIt(t){return t.length>1}function JIt(t,e){return((t=t.x)[0]<0?t[1]-Li-Ut:Li-t[1])-((e=e.x)[0]<0?e[1]-Li-Ut:Li-e[1])}const jme=D5e(function(){return!0},eLt,nLt,[-xn,-Li]);function eLt(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,s){var a=o>0?xn:-xn,l=Ln(o-e);Ln(l-xn)0?Li:-Li),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(o,n),i=0):r!==a&&l>=xn&&(Ln(e-r)Ut?PO((Bt(e)*(o=Vt(r))*Bt(n)-Bt(r)*(i=Vt(e))*Bt(t))/(i*o*s)):(e+r)/2}function nLt(t,e,n,r){var i;if(t==null)i=n*Li,r.point(-xn,i),r.point(0,i),r.point(xn,i),r.point(xn,0),r.point(xn,-i),r.point(0,-i),r.point(-xn,-i),r.point(-xn,0),r.point(-xn,i);else if(Ln(t[0]-e[0])>Ut){var o=t[0]0,i=Ln(e)>Ut;function o(u,f,d,h){QIt(h,t,n,d,u,f)}function s(u,f){return Vt(u)*Vt(f)>e}function a(u){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,v){var y=[m,v],x,b=s(m,v),w=r?b?0:c(m,v):b?c(m+(m<0?xn:-xn),v):0;if(!f&&(p=h=b)&&u.lineStart(),b!==h&&(x=l(f,y),(!x||C3(f,x)||C3(y,x))&&(y[2]=1)),b!==h)g=0,b?(u.lineStart(),x=l(y,f),u.point(x[0],x[1])):(x=l(f,y),u.point(x[0],x[1],2),u.lineEnd()),f=x;else if(i&&f&&r^b){var _;!(w&d)&&(_=l(y,f,!0))&&(g=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}b&&(!f||!C3(f,y))&&u.point(y[0],y[1]),f=y,h=b,d=w},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(u,f,d){var h=yb(u),p=yb(f),g=[1,0,0],m=QS(h,p),v=UI(m,m),y=m[0],x=v-y*y;if(!x)return!d&&u;var b=e*v/x,w=-e*y/x,_=QS(g,m),S=WI(g,b),O=WI(m,w);hV(S,O);var k=_,E=UI(S,k),P=UI(k,k),A=E*E-P*(UI(S,S)-1);if(!(A<0)){var R=Ma(A),T=WI(k,(-E-R)/P);if(hV(T,S),T=JN(T),!d)return T;var M=u[0],I=f[0],z=u[1],F=f[1],N;I0^T[1]<(Ln(T[0]-M)xn^(M<=T[0]&&T[0]<=I)){var j=WI(k,(-E+R)/P);return hV(j,S),[T,JN(j)]}}}function c(u,f){var d=r?t:xn-t,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return D5e(s,a,o,r?[0,-t]:[-xn,t-xn])}function iLt(t,e,n,r,i,o){var s=t[0],a=t[1],l=e[0],c=e[1],u=0,f=1,d=l-s,h=c-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p0&&(t[0]=s+u*d,t[1]=a+u*h),f<1&&(e[0]=s+f*d,e[1]=a+f*h),!0}}}}}var uT=1e9,GI=-uT;function I5e(t,e,n,r){function i(c,u){return t<=c&&c<=n&&e<=u&&u<=r}function o(c,u,f,d){var h=0,p=0;if(c==null||(h=s(c,f))!==(p=s(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function s(c,u){return Ln(c[0]-t)0?0:3:Ln(c[0]-n)0?2:1:Ln(c[1]-e)0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var f=s(c,1),d=s(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=M5e(),d,h,p,g,m,v,y,x,b,w,_,S={point:O,lineStart:A,lineEnd:R,polygonStart:E,polygonEnd:P};function O(M,I){i(M,I)&&u.point(M,I)}function k(){for(var M=0,I=0,z=h.length;Ir&&(X-$)*(r-j)>(V-j)*(t-$)&&++M:V<=r&&(X-$)*(r-j)<(V-j)*(t-$)&&--M;return M}function E(){u=f,d=[],h=[],_=!0}function P(){var M=k(),I=_&&M,z=(d=xLe(d)).length;(I||z)&&(c.polygonStart(),I&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),z&&R5e(d,a,M,o,c),c.polygonEnd()),u=c,d=h=p=null}function A(){S.point=T,h&&h.push(p=[]),w=!0,b=!1,y=x=NaN}function R(){d&&(T(g,m),v&&b&&f.rejoin(),d.push(f.result())),S.point=O,b&&u.lineEnd()}function T(M,I){var z=i(M,I);if(h&&p.push([M,I]),w)g=M,m=I,v=z,w=!1,z&&(u.lineStart(),u.point(M,I));else if(z&&b)u.point(M,I);else{var F=[y=Math.max(GI,Math.min(uT,y)),x=Math.max(GI,Math.min(uT,x))],N=[M=Math.max(GI,Math.min(uT,M)),I=Math.max(GI,Math.min(uT,I))];iLt(F,N,t,e,n,r)?(b||(u.lineStart(),u.point(F[0],F[1])),u.point(N[0],N[1]),z||u.lineEnd(),_=!1):z&&(u.lineStart(),u.point(M,I),_=!1)}y=M,x=I,b=z}return S}}function Bme(t,e,n){var r=sl(t,e-Ut,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function Ume(t,e,n){var r=sl(t,e-Ut,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function oLt(){var t,e,n,r,i,o,s,a,l=10,c=l,u=90,f=360,d,h,p,g,m=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return sl(BI(r/u)*u,n,u).map(p).concat(sl(BI(a/f)*f,s,f).map(g)).concat(sl(BI(e/l)*l,t,l).filter(function(x){return Ln(x%u)>Ut}).map(d)).concat(sl(BI(o/c)*c,i,c).filter(function(x){return Ln(x%f)>Ut}).map(h))}return v.lines=function(){return y().map(function(x){return{type:"LineString",coordinates:x}})},v.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},v.extent=function(x){return arguments.length?v.extentMajor(x).extentMinor(x):v.extentMinor()},v.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],a=+x[0][1],s=+x[1][1],r>n&&(x=r,r=n,n=x),a>s&&(x=a,a=s,s=x),v.precision(m)):[[r,a],[n,s]]},v.extentMinor=function(x){return arguments.length?(e=+x[0][0],t=+x[1][0],o=+x[0][1],i=+x[1][1],e>t&&(x=e,e=t,t=x),o>i&&(x=o,o=i,i=x),v.precision(m)):[[e,o],[t,i]]},v.step=function(x){return arguments.length?v.stepMajor(x).stepMinor(x):v.stepMinor()},v.stepMajor=function(x){return arguments.length?(u=+x[0],f=+x[1],v):[u,f]},v.stepMinor=function(x){return arguments.length?(l=+x[0],c=+x[1],v):[l,c]},v.precision=function(x){return arguments.length?(m=+x,d=Bme(o,i,90),h=Ume(e,t,m),p=Bme(a,s,90),g=Ume(r,n,m),v):m},v.extentMajor([[-180,-90+Ut],[180,90-Ut]]).extentMinor([[-180,-80-Ut],[180,80+Ut]])}const DA=t=>t;var gV=new Ea,JX=new Ea,L5e,$5e,eY,tY,Gp={point:ps,lineStart:ps,lineEnd:ps,polygonStart:function(){Gp.lineStart=sLt,Gp.lineEnd=lLt},polygonEnd:function(){Gp.lineStart=Gp.lineEnd=Gp.point=ps,gV.add(Ln(JX)),JX=new Ea},result:function(){var t=gV/2;return gV=new Ea,t}};function sLt(){Gp.point=aLt}function aLt(t,e){Gp.point=F5e,L5e=eY=t,$5e=tY=e}function F5e(t,e){JX.add(tY*t-eY*e),eY=t,tY=e}function lLt(){F5e(L5e,$5e)}var KS=1/0,l5=KS,IA=-KS,c5=IA,u5={point:cLt,lineStart:ps,lineEnd:ps,polygonStart:ps,polygonEnd:ps,result:function(){var t=[[KS,l5],[IA,c5]];return IA=c5=-(l5=KS=1/0),t}};function cLt(t,e){tIA&&(IA=t),ec5&&(c5=e)}var nY=0,rY=0,fT=0,f5=0,d5=0,p_=0,iY=0,oY=0,dT=0,N5e,z5e,Vd,Gd,Kc={point:xb,lineStart:Wme,lineEnd:Vme,polygonStart:function(){Kc.lineStart=dLt,Kc.lineEnd=hLt},polygonEnd:function(){Kc.point=xb,Kc.lineStart=Wme,Kc.lineEnd=Vme},result:function(){var t=dT?[iY/dT,oY/dT]:p_?[f5/p_,d5/p_]:fT?[nY/fT,rY/fT]:[NaN,NaN];return nY=rY=fT=f5=d5=p_=iY=oY=dT=0,t}};function xb(t,e){nY+=t,rY+=e,++fT}function Wme(){Kc.point=uLt}function uLt(t,e){Kc.point=fLt,xb(Vd=t,Gd=e)}function fLt(t,e){var n=t-Vd,r=e-Gd,i=Ma(n*n+r*r);f5+=i*(Vd+t)/2,d5+=i*(Gd+e)/2,p_+=i,xb(Vd=t,Gd=e)}function Vme(){Kc.point=xb}function dLt(){Kc.point=pLt}function hLt(){j5e(N5e,z5e)}function pLt(t,e){Kc.point=j5e,xb(N5e=Vd=t,z5e=Gd=e)}function j5e(t,e){var n=t-Vd,r=e-Gd,i=Ma(n*n+r*r);f5+=i*(Vd+t)/2,d5+=i*(Gd+e)/2,p_+=i,i=Gd*t-Vd*e,iY+=i*(Vd+t),oY+=i*(Gd+e),dT+=i*3,xb(Vd=t,Gd=e)}function B5e(t){this._context=t}B5e.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Pa);break}}},result:ps};var sY=new Ea,mV,U5e,W5e,hT,pT,LA={point:ps,lineStart:function(){LA.point=gLt},lineEnd:function(){mV&&V5e(U5e,W5e),LA.point=ps},polygonStart:function(){mV=!0},polygonEnd:function(){mV=null},result:function(){var t=+sY;return sY=new Ea,t}};function gLt(t,e){LA.point=V5e,U5e=hT=t,W5e=pT=e}function V5e(t,e){hT-=t,pT-=e,sY.add(Ma(hT*hT+pT*pT)),hT=t,pT=e}let Gme,h5,Hme,qme;class Xme{constructor(e){this._append=e==null?G5e:mLt(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==Hme||this._append!==h5){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,Hme=r,h5=this._append,qme=this._,this._=i}this._+=qme;break}}}result(){const e=this._;return this._="",e.length?e:null}}function G5e(t){let e=1;this._+=t[0];for(const n=t.length;e=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return G5e;if(e!==Gme){const n=10**e;Gme=e,h5=function(i){let o=1;this._+=i[0];for(const s=i.length;o=0))throw new RangeError(`invalid digits: ${a}`);n=l}return e===null&&(o=new Xme(n)),s},s.projection(t).digits(n).context(e)}function GB(t){return function(e){var n=new aY;for(var r in t)n[r]=t[r];return n.stream=e,n}}function aY(){}aY.prototype={constructor:aY,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function loe(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),Vp(n,t.stream(u5)),e(u5.result()),r!=null&&t.clipExtent(r),t}function HB(t,e,n){return loe(t,function(r){var i=e[1][0]-e[0][0],o=e[1][1]-e[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+e[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(o-s*(r[1][1]+r[0][1]))/2;t.scale(150*s).translate([a,l])},n)}function coe(t,e,n){return HB(t,[[0,0],e],n)}function uoe(t,e,n){return loe(t,function(r){var i=+e,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];t.scale(150*o).translate([s,a])},n)}function foe(t,e,n){return loe(t,function(r){var i=+e,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([s,a])},n)}var Yme=16,vLt=Vt(30*vn);function Qme(t,e){return+e?xLt(t,e):yLt(t)}function yLt(t){return GB({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function xLt(t,e){function n(r,i,o,s,a,l,c,u,f,d,h,p,g,m){var v=c-r,y=u-i,x=v*v+y*y;if(x>4*e&&g--){var b=s+d,w=a+h,_=l+p,S=Ma(b*b+w*w+_*_),O=Sl(_/=S),k=Ln(Ln(_)-1)e||Ln((v*R+y*T)/x-.5)>.3||s*d+a*h+l*p2?M[2]%360*vn:0,R()):[a*Ui,l*Ui,c*Ui]},P.angle=function(M){return arguments.length?(f=M%360*vn,R()):f*Ui},P.reflectX=function(M){return arguments.length?(d=M?-1:1,R()):d<0},P.reflectY=function(M){return arguments.length?(h=M?-1:1,R()):h<0},P.precision=function(M){return arguments.length?(_=Qme(S,w=M*M),T()):Ma(w)},P.fitExtent=function(M,I){return HB(P,M,I)},P.fitSize=function(M,I){return coe(P,M,I)},P.fitWidth=function(M,I){return uoe(P,M,I)},P.fitHeight=function(M,I){return foe(P,M,I)};function R(){var M=Kme(n,0,0,d,h,f).apply(null,e(o,s)),I=Kme(n,r-M[0],i-M[1],d,h,f);return u=P5e(a,l,c),S=KX(e,I),O=KX(u,S),_=Qme(S,w),T()}function T(){return k=E=null,P}return function(){return e=t.apply(this,arguments),P.invert=e.invert&&A,R()}}function doe(t){var e=0,n=xn/3,r=q5e(t),i=r(e,n);return i.parallels=function(o){return arguments.length?r(e=o[0]*vn,n=o[1]*vn):[e*Ui,n*Ui]},i}function SLt(t){var e=Vt(t);function n(r,i){return[r*e,Bt(i)/e]}return n.invert=function(r,i){return[r/e,Sl(i*e)]},n}function CLt(t,e){var n=Bt(t),r=(n+Bt(e))/2;if(Ln(r)=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},u.stream=function(d){return t&&e===d?t:t=OLt([n.stream(e=d),i.stream(d),s.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(c),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+Ut,g+.12*h+Ut],[p-.214*h-Ut,g+.234*h-Ut]]).stream(c),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+Ut,g+.166*h+Ut],[p-.115*h-Ut,g+.234*h-Ut]]).stream(c),f()},u.fitExtent=function(d,h){return HB(u,d,h)},u.fitSize=function(d,h){return coe(u,d,h)},u.fitWidth=function(d,h){return uoe(u,d,h)},u.fitHeight=function(d,h){return foe(u,d,h)};function f(){return t=e=null,u}return u.scale(1070)}function Y5e(t){return function(e,n){var r=Vt(e),i=Vt(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Bt(e),o*Bt(n)]}}function OR(t){return function(e,n){var r=Ma(e*e+n*n),i=t(r),o=Bt(i),s=Vt(i);return[Au(e*o,r*s),Sl(r&&n*o/r)]}}var Q5e=Y5e(function(t){return Ma(2/(1+t))});Q5e.invert=OR(function(t){return 2*Sl(t/2)});function TLt(){return Hh(Q5e).scale(124.75).clipAngle(180-.001)}var K5e=Y5e(function(t){return(t=x5e(t))&&t/Bt(t)});K5e.invert=OR(function(t){return t});function kLt(){return Hh(K5e).scale(79.4188).clipAngle(180-.001)}function qB(t,e){return[t,YN(soe((Li+e)/2))]}qB.invert=function(t,e){return[t,2*PO(y5e(e))-Li]};function ALt(){return Z5e(qB).scale(961/Pa)}function Z5e(t){var e=Hh(t),n=e.center,r=e.scale,i=e.translate,o=e.clipExtent,s=null,a,l,c;e.scale=function(f){return arguments.length?(r(f),u()):r()},e.translate=function(f){return arguments.length?(i(f),u()):i()},e.center=function(f){return arguments.length?(n(f),u()):n()},e.clipExtent=function(f){return arguments.length?(f==null?s=a=l=c=null:(s=+f[0][0],a=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var f=xn*r(),d=e(YIt(e.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:t===qB?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,l),c]]:[[s,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,c)]])}return u()}function HI(t){return soe((Li+t)/2)}function PLt(t,e){var n=Vt(t),r=t===e?Bt(t):YN(n/Vt(e))/YN(HI(e)/HI(t)),i=n*dV(HI(t),r)/r;if(!r)return qB;function o(s,a){i>0?a<-Li+Ut&&(a=-Li+Ut):a>Li-Ut&&(a=Li-Ut);var l=i/dV(HI(a),r);return[l*Bt(r*s),i-l*Vt(r*s)]}return o.invert=function(s,a){var l=i-a,c=iu(r)*Ma(s*s+l*l),u=Au(s,Ln(l))*iu(l);return l*r<0&&(u-=xn*iu(s)*iu(l)),[u/r,2*PO(dV(i/c,1/r))-Li]},o}function MLt(){return doe(PLt).scale(109.5).parallels([30,30])}function g5(t,e){return[t,e]}g5.invert=g5;function RLt(){return Hh(g5).scale(152.63)}function DLt(t,e){var n=Vt(t),r=t===e?Bt(t):(n-Vt(e))/(e-t),i=n/r+t;if(Ln(r)Ut&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function zLt(){return Hh(tze).scale(175.295)}function nze(t,e){return[Vt(e)*Bt(t),Bt(e)]}nze.invert=OR(Sl);function jLt(){return Hh(nze).scale(249.5).clipAngle(90+Ut)}function rze(t,e){var n=Vt(e),r=1+Vt(t)*n;return[n*Bt(t)/r,Bt(e)/r]}rze.invert=OR(function(t){return 2*PO(t)});function BLt(){return Hh(rze).scale(250).clipAngle(142)}function ize(t,e){return[YN(soe((Li+e)/2)),-t]}ize.invert=function(t,e){return[-e,2*PO(y5e(t))-Li]};function ULt(){var t=Z5e(ize),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var WLt=Math.abs,lY=Math.cos,v5=Math.sin,VLt=1e-6,oze=Math.PI,cY=oze/2,Zme=GLt(2);function Jme(t){return t>1?cY:t<-1?-cY:Math.asin(t)}function GLt(t){return t>0?Math.sqrt(t):0}function HLt(t,e){var n=t*v5(e),r=30,i;do e-=i=(e+v5(e)-n)/(1+lY(e));while(WLt(i)>VLt&&--r>0);return e/2}function qLt(t,e,n){function r(i,o){return[t*i*lY(o=HLt(n,o)),e*v5(o)]}return r.invert=function(i,o){return o=Jme(o/e),[i/(t*lY(o)),Jme((2*o+v5(2*o))/n)]},r}var XLt=qLt(Zme/cY,Zme,oze);function YLt(){return Hh(XLt).scale(169.529)}const QLt=H5e(),uY=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function KLt(t,e){return function n(){const r=e();return r.type=t,r.path=H5e().projection(r),r.copy=r.copy||function(){const i=n();return uY.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},bFe(r)}}function hoe(t,e){if(!t||typeof t!="string")throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(y5[t]=KLt(t,e),this):y5[t]||null}function sze(t){return t&&t.path||QLt}const y5={albers:X5e,albersusa:ELt,azimuthalequalarea:TLt,azimuthalequidistant:kLt,conicconformal:MLt,conicequalarea:p5,conicequidistant:ILt,equalEarth:$Lt,equirectangular:RLt,gnomonic:FLt,identity:NLt,mercator:ALt,mollweide:YLt,naturalEarth1:zLt,orthographic:jLt,stereographic:BLt,transversemercator:ULt};for(const t in y5)hoe(t,y5[t]);function ZLt(){}const dp=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function aze(){var t=1,e=1,n=a;function r(l,c){return c.map(u=>i(l,u))}function i(l,c){var u=[],f=[];return o(l,c,d=>{n(d,l,c),JLt(d)>0?u.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=u.length,g;h=c,dp[m<<1].forEach(x);++h=c,dp[g|m<<1].forEach(x);for(dp[m<<0].forEach(x);++p=c,v=l[p*t]>=c,dp[m<<1|v<<2].forEach(x);++h=c,y=v,v=l[p*t+h+1]>=c,dp[g|m<<1|v<<2|y<<3].forEach(x);dp[m|v<<3].forEach(x)}for(h=-1,v=l[p*t]>=c,dp[v<<2].forEach(x);++h=c,dp[v<<2|y<<3].forEach(x);dp[v<<3].forEach(x);function x(b){var w=[b[0][0]+h,b[0][1]+p],_=[b[1][0]+h,b[1][1]+p],S=s(w),O=s(_),k,E;(k=d[S])?(E=f[O])?(delete d[k.end],delete f[E.start],k===E?(k.ring.push(_),u(k.ring)):f[k.start]=d[E.end]={start:k.start,end:E.end,ring:k.ring.concat(E.ring)}):(delete d[k.end],k.ring.push(_),d[k.end=O]=k):(k=f[O])?(E=d[S])?(delete f[k.start],delete d[E.end],k===E?(k.ring.push(_),u(k.ring)):f[E.start]=d[k.end]={start:E.start,end:k.end,ring:E.ring.concat(k.ring)}):(delete f[k.start],k.ring.unshift(w),f[k.start=S]=k):f[S]=d[O]={start:S,end:O,ring:[w,_]}}}function s(l){return l[0]*2+l[1]*(t+1)*4}function a(l,c,u){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,v=c[g*t+p];d>0&&d0&&h=0&&u>=0||je("invalid size"),t=c,e=u,r},r.smooth=function(l){return arguments.length?(n=l?a:ZLt,r):n===a},r}function JLt(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++er!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=-i)}return i}function n$t(t,e,n){var r;return r$t(t,e,n)&&i$t(t[r=+(t[0]===e[0])],n[r],e[r])}function r$t(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function i$t(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function lze(t,e,n){return function(r){var i=kh(r),o=n?Math.min(i[0],0):i[0],s=i[1],a=s-o,l=e?ry(o,s,t):a/(t+1);return sl(o+l,s,l)}}function poe(t){De.call(this,null,t)}poe.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};it(poe,De,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||na,o=aze().smooth(t.smooth!==!1),s=t.thresholds||o$t(r,i,t),a=t.as===null?null:t.as||"contour",l=[];return r.forEach(c=>{const u=i(c),f=o.size([u.width,u.height])(u.values,We(s)?s:s(u.values));s$t(f,u,c,t),f.forEach(d=>{l.push(sB(c,cr(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function o$t(t,e,n){const r=lze(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(t.map(i=>Nx(e(i).values)))}function s$t(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;if(fn(i)&&(i=i(n,r)),fn(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;const s=(Jn(i)?i:i[0])||1,a=(Jn(i)?i:i[1])||1,l=o&&o[0]||0,c=o&&o[1]||0;t.forEach(cze(e,s,a,l,c))}function cze(t,e,n,r,i){const o=t.x1||0,s=t.y1||0,a=e*n<0;function l(f){f.forEach(c)}function c(f){a&&f.reverse(),f.forEach(u)}function u(f){f[0]=(f[0]-o)*e+r,f[1]=(f[1]-s)*n+i}return function(f){return f.coordinates.forEach(l),f}}function eve(t,e,n){const r=t>=0?t:Qne(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function vV(t){return fn(t)?t:ra(+t)}function uze(){var t=l=>l[0],e=l=>l[1],n=vO,r=[-1,-1],i=960,o=500,s=2;function a(l,c){const u=eve(r[0],l,t)>>s,f=eve(r[1],l,e)>>s,d=u?u+2:0,h=f?f+2:0,p=2*d+(i>>s),g=2*h+(o>>s),m=new Float32Array(p*g),v=new Float32Array(p*g);let y=m;l.forEach(b=>{const w=d+(+t(b)>>s),_=h+(+e(b)>>s);w>=0&&w=0&&_0&&f>0?(tw(p,g,m,v,u),nw(p,g,v,m,f),tw(p,g,m,v,u),nw(p,g,v,m,f),tw(p,g,m,v,u),nw(p,g,v,m,f)):u>0?(tw(p,g,m,v,u),tw(p,g,v,m,u),tw(p,g,m,v,u),y=v):f>0&&(nw(p,g,m,v,f),nw(p,g,v,m,f),nw(p,g,m,v,f),y=v);const x=c?Math.pow(2,-2*s):1/bLe(y);for(let b=0,w=p*g;b>s),y2:h+(o>>s)}}return a.x=function(l){return arguments.length?(t=vV(l),a):t},a.y=function(l){return arguments.length?(e=vV(l),a):e},a.weight=function(l){return arguments.length?(n=vV(l),a):n},a.size=function(l){if(!arguments.length)return[i,o];var c=+l[0],u=+l[1];return c>=0&&u>=0||je("invalid size"),i=c,o=u,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||je("invalid cell size"),s=Math.floor(Math.log(l)/Math.LN2),a):1<=i&&(a>=o&&(l-=n[a-o+s*t]),r[a-i+s*t]=l/Math.min(a+1,t-1+o-a,o))}function nw(t,e,n,r,i){const o=(i<<1)+1;for(let s=0;s=i&&(a>=o&&(l-=n[s+(a-o)*t]),r[s+(a-i)*t]=l/Math.min(a+1,e-1+o-a,o))}function goe(t){De.call(this,null,t)}goe.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const a$t=["x","y","weight","size","cellSize","bandwidth"];function fze(t,e){return a$t.forEach(n=>e[n]!=null?t[n](e[n]):0),t}it(goe,De,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=l$t(r,t.groupby),o=(t.groupby||[]).map(Fi),s=fze(uze(),t),a=t.as||"grid",l=[];function c(u,f){for(let d=0;dcr(c({[a]:s(u,t.counts)},u.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function l$t(t,e){var n=[],r=u=>u(a),i,o,s,a,l,c;if(e==null)n.push(t);else for(i={},o=0,s=t.length;on.push(a(u))),o&&s&&(e.visit(l,u=>{var f=o(u),d=s(u);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:fY,geometry:{type:c$t,coordinates:r}})),this.value={type:voe,features:n}}});function xoe(t){De.call(this,null,t)}xoe.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};it(xoe,De,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||na,o=t.as||"path",s=n.SOURCE;!r||t.modified()?(this.value=r=sze(t.projection),n.materialize().reflow()):s=i===na||e.modified(i.fields)?n.ADD_MOD:n.ADD;const a=u$t(r,t.pointRadius);return n.visit(s,l=>l[o]=r(i(l))),r.pointRadius(a),n.modifies(o)}});function u$t(t,e){const n=t.pointRadius();return t.context(null),e!=null&&t.pointRadius(e),n}function boe(t){De.call(this,null,t)}boe.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};it(boe,De,{transform(t,e){var n=t.projection,r=t.fields[0],i=t.fields[1],o=t.as||["x","y"],s=o[0],a=o[1],l;function c(u){const f=n([r(u),i(u)]);f?(u[s]=f[0],u[a]=f[1]):(u[s]=void 0,u[a]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,c):(l=e.modified(r.fields)||e.modified(i.fields),e.visit(l?e.ADD_MOD:e.ADD,c)),e.modifies(o)}});function woe(t){De.call(this,null,t)}woe.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};it(woe,De,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return(!r||t.modified())&&(this.value=r=f$t(sze(t.projection),t.field||Ou("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[i]=r),n.modifies(i)}});function f$t(t,e,n){const r=n==null?i=>t(e(i)):i=>{var o=t.pointRadius(),s=t.pointRadius(n)(e(i));return t.pointRadius(o),s};return r.context=i=>(t.context(i),r),r}function _oe(t){De.call(this,[],t),this.generator=oLt()}_oe.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};it(_oe,De,{transform(t,e){var n=this.value,r=this.generator,i;if(!n.length||t.modified())for(const o in t)fn(r[o])&&r[o](t[o]);return i=r(),n.length?e.mod.push(g$e(n[0],i)):e.add.push(cr(i)),n[0]=i,e}});function Soe(t){De.call(this,null,t)}Soe.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};it(Soe,De,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r=t.resolve==="shared",i=t.field||na,o=h$t(t.opacity,t),s=d$t(t.color,t),a=t.as||"image",l={$x:0,$y:0,$value:0,$max:r?Nx(n.map(c=>Nx(i(c).values))):0};return n.forEach(c=>{const u=i(c),f=cn({},c,l);r||(f.$max=Nx(u.values||[])),c[a]=p$t(u,f,s.dep?s:ra(s(f)),o.dep?o:ra(o(f)))}),e.reflow(!0).modifies(a)}});function d$t(t,e){let n;return fn(t)?(n=r=>ay(t(r,e)),n.dep=dze(t)):n=ra(ay(t||"#888")),n}function h$t(t,e){let n;return fn(t)?(n=r=>t(r,e),n.dep=dze(t)):t?n=ra(t):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function dze(t){if(!fn(t))return!1;const e=Wf(Ks(t));return e.$x||e.$y||e.$value||e.$max}function p$t(t,e,n,r){const i=t.width,o=t.height,s=t.x1||0,a=t.y1||0,l=t.x2||i,c=t.y2||o,u=t.values,f=u?m=>u[m]:rv,d=Bv(l-s,c-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-s,c-a),g=p.data;for(let m=a,v=0;m{t[r]!=null&&tve(n,r,t[r])})):uY.forEach(r=>{t.modified(r)&&tve(n,r,t[r])}),t.pointRadius!=null&&n.path.pointRadius(t.pointRadius),t.fit&&g$t(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function g$t(t,e){const n=v$t(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}function m$t(t){const e=hoe((t||"mercator").toLowerCase());return e||je("Unrecognized projection type: "+t),e()}function tve(t,e,n){fn(t[e])&&t[e](n)}function v$t(t){return t=pt(t),t.length===1?t[0]:{type:voe,features:t.reduce((e,n)=>e.concat(y$t(n)),[])}}function y$t(t){return t.type===voe?t.features:pt(t).filter(e=>e!=null).map(e=>e.type===fY?e:{type:fY,geometry:e})}const x$t=Object.freeze(Object.defineProperty({__proto__:null,contour:moe,geojson:yoe,geopath:xoe,geopoint:boe,geoshape:woe,graticule:_oe,heatmap:Soe,isocontour:poe,kde2d:goe,projection:hze},Symbol.toStringTag,{value:"Module"}));function b$t(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=0);function i(){var o,s=n.length,a,l=0,c=0;for(o=0;o=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d,i=o,!(o=o[v=m<<1|g]))return i[v]=s,t;if(h=+t._x.call(null,o.data),p=+t._y.call(null,o.data),e===h&&n===p)return s.next=o,i?i[v]=s:t._root=s,t;do i=i?i[v]=new Array(4):t._root=new Array(4),(g=e>=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d;while((v=m<<1|g)===(y=(p>=d)<<1|h>=f));return i[y]=o,i[v]=s,t}function _$t(t){var e,n,r=t.length,i,o,s=new Array(r),a=new Array(r),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;nu&&(u=i),of&&(f=o));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;nt||t>=i||r>e||e>=o;)switch(c=(eu||(a=p.y0)>f||(l=p.x1)=v)<<1|t>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var y=t-+this._x.call(null,h.data),x=e-+this._y.call(null,h.data),b=y*y+x*x;if(b=(d=(s+l)/2))?s=d:l=d,(g=f>=(h=(a+c)/2))?a=h:c=h,e=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(r=e,v=m)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):e?(o?e[m]=o:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[v]=n:this._root=n),this):(this._root=o,this)}function k$t(t){for(var e=0,n=t.length;ed.index){var P=h-O.x-O.vx,A=p-O.y-O.vy,R=P*P+A*A;Rh+E||_p+E||Sc.r&&(c.r=c[u].r)}function l(){if(e){var c,u=e.length,f;for(n=new Array(u),c=0;c[e(w,_,s),w])),b;for(m=0,a=new Array(v);m{}};function gze(){for(var t=0,e=arguments.length,n={},r;t=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}O3.prototype=gze.prototype={constructor:O3,on:function(t,e){var n=this._,r=W$t(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&t._call.call(void 0,e),t=t._next;--ZS}function ove(){bb=(b5=$A.now())+XB,ZS=gT=0;try{H$t()}finally{ZS=0,X$t(),bb=0}}function q$t(){var t=$A.now(),e=t-b5;e>mze&&(XB-=e,b5=t)}function X$t(){for(var t,e=x5,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:x5=n);mT=t,dY(r)}function dY(t){if(!ZS){gT&&(gT=clearTimeout(gT));var e=t-bb;e>24?(t<1/0&&(gT=setTimeout(ove,t-$A.now()-XB)),n2&&(n2=clearInterval(n2))):(n2||(b5=$A.now(),n2=setInterval(q$t,mze)),ZS=1,vze(ove))}}function Y$t(t,e,n){var r=new w5,i=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(o,s,a){s=+s,a=a==null?Eoe():+a,r._restart(function l(c){c+=i,r._restart(l,i+=s,a),o(c)},s,a)},r.restart(t,e,n),r)}const Q$t=1664525,K$t=1013904223,sve=4294967296;function Z$t(){let t=1;return()=>(t=(Q$t*t+K$t)%sve)/sve}function J$t(t){return t.x}function e3t(t){return t.y}var t3t=10,n3t=Math.PI*(3-Math.sqrt(5));function r3t(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,a=new Map,l=yze(f),c=gze("tick","end"),u=Z$t();t==null&&(t=[]);function f(){d(),c.call("tick",e),n1?(m==null?a.delete(g):a.set(g,p(m)),e):a.get(g)},find:function(g,m,v){var y=0,x=t.length,b,w,_,S,O;for(v==null?v=1/0:v*=v,y=0;y1?(c.on(g,m),e):c.on(g)}}}function i3t(){var t,e,n,r,i=Sa(-30),o,s=1,a=1/0,l=.81;function c(h){var p,g=t.length,m=Coe(t,J$t,e3t).visitAfter(f);for(r=h,p=0;p=a)return;(h.data!==e||h.next)&&(v===0&&(v=yv(n),b+=v*v),y===0&&(y=yv(n),b+=y*y),b=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return e.StopPropagation}return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let a=this._argops,l=0,c=a.length,u;lt.touch(e).run()}function c3t(t,e){const n=r3t(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),bze(n,e,!0).on("end",()=>o=!0)}function bze(t,e,n,r){var i=pt(e.forces),o,s,a,l;for(o=0,s=hY.length;oe(r,n):e)}const h3t=Object.freeze(Object.defineProperty({__proto__:null,force:Toe},Symbol.toStringTag,{value:"Module"}));function p3t(t,e){return t.parent===e.parent?1:2}function g3t(t){return t.reduce(m3t,0)/t.length}function m3t(t,e){return t+e.x}function v3t(t){return 1+t.reduce(y3t,0)}function y3t(t,e){return Math.max(t,e.y)}function x3t(t){for(var e;e=t.children;)t=e[0];return t}function b3t(t){for(var e;e=t.children;)t=e[e.length-1];return t}function w3t(){var t=p3t,e=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=g3t(h),d.y=v3t(h)):(d.x=s?a+=t(d,s):0,d.y=0,s=d)});var l=x3t(o),c=b3t(o),u=l.x-t(l,c)/2,f=c.x+t(c,l)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*e,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-u)/(f-u)*e,d.y=(1-(o.y?d.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(t=o,i):t},i.size=function(o){return arguments.length?(r=!1,e=+o[0],n=+o[1],i):r?null:[e,n]},i.nodeSize=function(o){return arguments.length?(r=!0,e=+o[0],n=+o[1],i):r?[e,n]:null},i}function _3t(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function S3t(){return this.eachAfter(_3t)}function C3t(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function O3t(t,e){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(t.call(e,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function E3t(t,e){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=r[i].value;e.value=n})}function A3t(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function P3t(t){for(var e=this,n=M3t(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function M3t(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function R3t(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function D3t(){return Array.from(this)}function I3t(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function L3t(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*$3t(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i=0;--a)i.push(o=s[a]=new JS(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(wze)}function F3t(){return koe(this).eachBefore(j3t)}function N3t(t){return t.children}function z3t(t){return Array.isArray(t)?t[1]:null}function j3t(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function wze(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function JS(t){this.data=t,this.depth=this.height=0,this.parent=null}JS.prototype=koe.prototype={constructor:JS,count:S3t,each:C3t,eachAfter:E3t,eachBefore:O3t,find:T3t,sum:k3t,sort:A3t,path:P3t,ancestors:R3t,descendants:D3t,leaves:I3t,links:L3t,copy:F3t,[Symbol.iterator]:$3t};function E3(t){return t==null?null:_ze(t)}function _ze(t){if(typeof t!="function")throw new Error;return t}function nx(){return 0}function Uw(t){return function(){return t}}const B3t=1664525,U3t=1013904223,lve=4294967296;function W3t(){let t=1;return()=>(t=(B3t*t+U3t)%lve)/lve}function V3t(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function G3t(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}function H3t(t,e){for(var n=0,r=(t=G3t(Array.from(t),e)).length,i=[],o,s;n0&&n*n>r*r+i*i}function yV(t,e){for(var n=0;n1e-6?(P+Math.sqrt(P*P-4*E*A))/(2*E):A/P);return{x:r+_+S*R,y:i+O+k*R,r:R}}function cve(t,e,n){var r=t.x-e.x,i,o,s=t.y-e.y,a,l,c=r*r+s*s;c?(o=e.r+n.r,o*=o,l=t.r+n.r,l*=l,o>l?(i=(c+l-o)/(2*c),a=Math.sqrt(Math.max(0,l/c-i*i)),n.x=t.x-i*r-a*s,n.y=t.y-i*s+a*r):(i=(c+o-l)/(2*c),a=Math.sqrt(Math.max(0,o/c-i*i)),n.x=e.x+i*r-a*s,n.y=e.y+i*s+a*r)):(n.x=e.x+n.r,n.y=e.y)}function uve(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function fve(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function XI(t){this._=t,this.next=null,this.previous=null}function Q3t(t,e){if(!(o=(t=V3t(t)).length))return 0;var n,r,i,o,s,a,l,c,u,f,d;if(n=t[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;cve(r,n,i=t[2]),n=new XI(n),r=new XI(r),i=new XI(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;lrFt(n(b,w,i))),y=v.map(mve),x=new Set(v).add("");for(const b of y)x.has(b)||(x.add(b),v.push(b),y.push(mve(b)),o.push(bV));s=(b,w)=>v[w],a=(b,w)=>y[w]}for(u=0,l=o.length;u=0&&(h=o[v],h.data===bV);--v)h.data=null}if(f.parent=eFt,f.eachBefore(function(v){v.depth=v.parent.depth+1,--l}).eachBefore(wze),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=E3(i),r):t},r.parentId=function(i){return arguments.length?(e=E3(i),r):e},r.path=function(i){return arguments.length?(n=E3(i),r):n},r}function rFt(t){t=`${t}`;let e=t.length;return pY(t,e-1)&&!pY(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function mve(t){let e=t.length;if(e<2)return"";for(;--e>1&&!pY(t,e););return t.slice(0,e)}function pY(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function iFt(t,e){return t.parent===e.parent?1:2}function wV(t){var e=t.children;return e?e[0]:t.t}function _V(t){var e=t.children;return e?e[e.length-1]:t.t}function oFt(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function sFt(t){for(var e=0,n=0,r=t.children,i=r.length,o;--i>=0;)o=r[i],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function aFt(t,e,n){return t.a.parent===e.parent?t.a:n}function T3(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}T3.prototype=Object.create(JS.prototype);function lFt(t){for(var e=new T3(t,0),n,r=[e],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new T3(o[s],s)),i.parent=n;return(e.parent=new T3(null,0)).children=[e],e}function cFt(){var t=iFt,e=1,n=1,r=null;function i(c){var u=lFt(c);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var f=c,d=c,h=c;c.eachBefore(function(y){y.xd.x&&(d=y),y.depth>h.depth&&(h=y)});var p=f===d?1:t(f,d)/2,g=p-f.x,m=e/(d.x+p+g),v=n/(h.depth||1);c.eachBefore(function(y){y.x=(y.x+g)*m,y.y=y.depth*v})}return c}function o(c){var u=c.children,f=c.parent.children,d=c.i?f[c.i-1]:null;if(u){sFt(c);var h=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+t(c._,d._),c.m=c.z-h):c.z=h}else d&&(c.z=d.z+t(c._,d._));c.parent.A=a(c,d,c.parent.A||f[0])}function s(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function a(c,u,f){if(u){for(var d=c,h=c,p=u,g=d.parent.children[0],m=d.m,v=h.m,y=p.m,x=g.m,b;p=_V(p),d=wV(d),p&&d;)g=wV(g),h=_V(h),h.a=c,b=p.z+y-d.z-m+t(p._,d._),b>0&&(oFt(aFt(p,c,f),c,b),m+=b,v+=b),y+=p.m,m+=d.m,x+=g.m,v+=h.m;p&&!_V(h)&&(h.t=p,h.m+=y-v),d&&!wV(g)&&(g.t=d,g.m+=m-x,f=c)}return f}function l(c){c.x*=e,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(t=c,i):t},i.size=function(c){return arguments.length?(r=!1,e=+c[0],n=+c[1],i):r?null:[e,n]},i.nodeSize=function(c){return arguments.length?(r=!0,e=+c[0],n=+c[1],i):r?[e,n]:null},i}function YB(t,e,n,r,i){for(var o=t.children,s,a=-1,l=o.length,c=t.value&&(i-n)/t.value;++ay&&(y=c),_=m*m*w,x=Math.max(y/_,_/v),x>b){m-=c;break}b=x}s.push(l={value:m,dice:h1?r:1)},n}(Eze);function uFt(){var t=kze,e=!1,n=1,r=1,i=[0],o=nx,s=nx,a=nx,l=nx,c=nx;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],e&&d.eachBefore(Oze),d}function f(d){var h=i[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,v=d.y1-h;m=d-1){var y=o[f];y.x0=p,y.y0=g,y.x1=m,y.y1=v;return}for(var x=c[f],b=h/2+x,w=f+1,_=d-1;w<_;){var S=w+_>>>1;c[S]v-g){var E=h?(p*k+m*O)/h:m;u(f,w,O,p,g,E,v),u(w,d,k,E,g,m,v)}else{var P=h?(g*k+v*O)/h:v;u(f,w,O,p,g,m,P),u(w,d,k,p,P,m,v)}}}function dFt(t,e,n,r,i){(t.depth&1?YB:ER)(t,e,n,r,i)}const hFt=function t(e){function n(r,i,o,s,a){if((l=r._squarify)&&l.ratio===e)for(var l,c,u,f,d=-1,h,p=l.length,g=r.value;++d1?r:1)},n}(Eze);function gY(t,e,n){const r={};return t.each(i=>{const o=i.data;n(o)&&(r[e(o)]=i)}),t.lookup=r,t}function Aoe(t){De.call(this,null,t)}Aoe.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const pFt=t=>t.values;it(Aoe,De,{transform(t,e){e.source||je("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each(s=>{s.children&&oB(s.data)&&i.rem.push(s.data)}),this.value=o=koe({values:pt(t.keys).reduce((s,a)=>(s.key(a),s),gFt()).entries(i.source)},pFt),n&&o.each(s=>{s.children&&(s=cr(s.data),i.add.push(s),i.source.push(s))}),gY(o,jt,jt)),i.source.root=o,i}});function gFt(){const t=[],e={entries:i=>r(n(i,0),0),key:i=>(t.push(i),e)};function n(i,o){if(o>=t.length)return i;const s=i.length,a=t[o++],l={},c={};let u=-1,f,d,h;for(;++ut.length)return i;const s=[];for(const a in i)s.push({key:a,values:r(i[a],o)});return s}return e}function Qg(t){De.call(this,null,t)}const mFt=(t,e)=>t.parent===e.parent?1:2;it(Qg,De,{transform(t,e){(!e.source||!e.source.root)&&je(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(d1(t.sort,s=>s.data)),vFt(n,this.params,t),n.separation&&n.separation(t.separation!==!1?mFt:vO);try{this.value=n(i)}catch(s){je(s)}return i.each(s=>yFt(s,r,o)),e.reflow(t.modified()).modifies(o).modifies("leaf")}});function vFt(t,e,n){for(let r,i=0,o=e.length;io[jt(s)]=1),r.each(s=>{const a=s.data,l=s.parent&&s.parent.data;l&&o[jt(a)]&&o[jt(l)]&&i.add.push(cr({source:l,target:a}))}),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,s=>o[jt(s)]=1),n.forEach(s=>{(o[jt(s.source)]||o[jt(s.target)])&&i.mod.push(s)})),i}});const yve={binary:fFt,dice:ER,slice:YB,slicedice:dFt,squarify:kze,resquarify:hFt},xY=["x0","y0","x1","y1","depth","children"];function Loe(t){Qg.call(this,t)}Loe.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:xY.length,default:xY}]};it(Loe,Qg,{layout(){const t=uFt();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{vt(yve,e)?t.tile(yve[e]):je("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:xY});const xFt=Object.freeze(Object.defineProperty({__proto__:null,nest:Aoe,pack:Poe,partition:Moe,stratify:Roe,tree:Doe,treelinks:Ioe,treemap:Loe},Symbol.toStringTag,{value:"Module"})),SV=4278190080;function bFt(t,e){const n=t.bitmap();return(e||[]).forEach(r=>n.set(t(r.boundary[0]),t(r.boundary[3]))),[n,void 0]}function wFt(t,e,n,r,i){const o=t.width,s=t.height,a=r||i,l=Bv(o,s).getContext("2d"),c=Bv(o,s).getContext("2d"),u=a&&Bv(o,s).getContext("2d");n.forEach(O=>k3(l,O,!1)),k3(c,e,!1),a&&k3(u,e,!0);const f=CV(l,o,s),d=CV(c,o,s),h=a&&CV(u,o,s),p=t.bitmap(),g=a&&t.bitmap();let m,v,y,x,b,w,_,S;for(v=0;v{i.items.forEach(o=>k3(t,o.items,n))}):Ec[r].draw(t,{items:n?e.map(_Ft):e})}function _Ft(t){const e=sB(t,{});return e.stroke&&e.strokeOpacity!==0||e.fill&&e.fillOpacity!==0?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const hp=5,la=31,FA=32,Qm=new Uint32Array(FA+1),yf=new Uint32Array(FA+1);yf[0]=0;Qm[0]=~yf[0];for(let t=1;t<=FA;++t)yf[t]=yf[t-1]<<1|1,Qm[t]=~yf[t];function SFt(t,e){const n=new Uint32Array(~~((t*e+FA)/FA));function r(o,s){n[o]|=s}function i(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*t+o;return n[a>>>hp]&1<<(a&la)},set:(o,s)=>{const a=s*t+o;r(a>>>hp,1<<(a&la))},clear:(o,s)=>{const a=s*t+o;i(a>>>hp,~(1<<(a&la)))},getRange:(o,s,a,l)=>{let c=l,u,f,d,h;for(;c>=s;--c)if(u=c*t+o,f=c*t+a,d=u>>>hp,h=f>>>hp,d===h){if(n[d]&Qm[u&la]&yf[(f&la)+1])return!0}else{if(n[d]&Qm[u&la]||n[h]&yf[(f&la)+1])return!0;for(let p=d+1;p{let c,u,f,d,h;for(;s<=l;++s)if(c=s*t+o,u=s*t+a,f=c>>>hp,d=u>>>hp,f===d)r(f,Qm[c&la]&yf[(u&la)+1]);else for(r(f,Qm[c&la]),r(d,yf[(u&la)+1]),h=f+1;h{let c,u,f,d,h;for(;s<=l;++s)if(c=s*t+o,u=s*t+a,f=c>>>hp,d=u>>>hp,f===d)i(f,yf[c&la]|Qm[(u&la)+1]);else for(i(f,yf[c&la]),i(d,Qm[(u&la)+1]),h=f+1;ho<0||s<0||l>=e||a>=t}}function CFt(t,e,n){const r=Math.max(1,Math.sqrt(t*e/1e6)),i=~~((t+2*n+r)/r),o=~~((e+2*n+r)/r),s=a=>~~((a+n)/r);return s.invert=a=>a*r-n,s.bitmap=()=>SFt(i,o),s.ratio=r,s.padding=n,s.width=t,s.height=e,s}function OFt(t,e,n,r){const i=t.width,o=t.height;return function(s){const a=s.datum.datum.items[r].items,l=a.length,c=s.datum.fontSize,u=hc.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,v,y;for(let x=0;x=f&&(f=y,s.x=m,s.y=v);return m=u/2,v=c/2,d=s.x-m,h=s.x+m,p=s.y-v,g=s.y+v,s.align="center",d<0&&h<=i?s.align="left":0<=d&&ii||e-(s=r/2)<0||e+s>o}function xv(t,e,n,r,i,o,s,a){const l=i*o/(r*2),c=t(e-l),u=t(e+l),f=t(n-(o=o/2)),d=t(n+o);return s.outOfBounds(c,f,u,d)||s.getRange(c,f,u,d)||a&&a.getRange(c,f,u,d)}function EFt(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1];function l(c,u,f,d,h){const p=t.invert(c),g=t.invert(u);let m=f,v=o,y;if(!_5(p,g,d,h,i,o)&&!xv(t,p,g,h,d,m,s,a)&&!xv(t,p,g,h,d,h,s,null)){for(;v-m>=1;)y=(m+v)/2,xv(t,p,g,h,d,y,s,a)?v=y:m=y;if(m>f)return[p,g,m,!0]}}return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=hc.width(c.datum,c.datum.text);let p=n?d:0,g=!1,m=!1,v=0,y,x,b,w,_,S,O,k,E,P,A,R,T,M,I,z,F;for(let N=0;Nx&&(F=y,y=x,x=F),b>w&&(F=b,b=w,w=F),E=t(y),A=t(x),P=~~((E+A)/2),R=t(b),M=t(w),T=~~((R+M)/2),O=P;O>=E;--O)for(k=T;k>=R;--k)z=l(O,k,p,h,d),z&&([c.x,c.y,p,g]=z);for(O=P;O<=A;++O)for(k=T;k<=M;++k)z=l(O,k,p,h,d),z&&([c.x,c.y,p,g]=z);!g&&!n&&(I=Math.abs(x-y+w-b),_=(y+x)/2,S=(b+w)/2,I>=v&&!_5(_,S,h,d,i,o)&&!xv(t,_,S,d,h,d,s,null)&&(v=I,c.x=_,c.y=S,m=!0))}return g||m?(_=h/2,S=d/2,s.setRange(t(c.x-_),t(c.y-S),t(c.x+_),t(c.y+S)),c.align="center",c.baseline="middle",!0):!1}}const TFt=[-1,-1,1,1],kFt=[-1,1,-1,1];function AFt(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1],l=t.bitmap();return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=hc.width(c.datum,c.datum.text),p=[];let g=n?d:0,m=!1,v=!1,y=0,x,b,w,_,S,O,k,E,P,A,R,T;for(let M=0;M=1;)R=(P+A)/2,xv(t,S,O,d,h,R,s,a)?A=R:P=R;P>g&&(c.x=S,c.y=O,g=P,m=!0)}}!m&&!n&&(T=Math.abs(b-x+_-w),S=(x+b)/2,O=(w+_)/2,T>=y&&!_5(S,O,h,d,i,o)&&!xv(t,S,O,d,h,d,s,null)&&(y=T,c.x=S,c.y=O,v=!0))}return m||v?(S=h/2,O=d/2,s.setRange(t(c.x-S),t(c.y-O),t(c.x+S),t(c.y+O)),c.align="center",c.baseline="middle",!0):!1}}const PFt=["right","center","left"],MFt=["bottom","middle","top"];function RFt(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1],l=r.length;return function(c){const u=c.boundary,f=c.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>i||u[3]>o)return!1;let d=c.textWidth??0,h,p,g,m,v,y,x,b,w,_,S,O,k,E,P;for(let A=0;A>>2&3)-1,g=h===0&&p===0||r[A]<0,m=h&&p?Math.SQRT1_2:1,v=r[A]<0?-1:1,y=u[1+h]+r[A]*h*m,S=u[4+p]+v*f*p/2+r[A]*p*m,b=S-f/2,w=S+f/2,O=t(y),E=t(b),P=t(w),!d)if(xve(O,O,E,P,s,a,y,y,b,w,u,g))d=hc.width(c.datum,c.datum.text);else continue;if(_=y+v*d*h/2,y=_-d/2,x=_+d/2,O=t(y),k=t(x),xve(O,k,E,P,s,a,y,x,b,w,u,g))return c.x=h?h*v<0?x:y:_,c.y=p?p*v<0?w:b:S,c.align=PFt[h*v+1],c.baseline=MFt[p*v+1],s.setRange(O,E,k,P),!0}return!1}}function xve(t,e,n,r,i,o,s,a,l,c,u,f){return!(i.outOfBounds(t,n,e,r)||(f&&o||i).getRange(t,n,e,r))}const OV=0,EV=4,TV=8,kV=0,AV=1,PV=2,DFt={"top-left":OV+kV,top:OV+AV,"top-right":OV+PV,left:EV+kV,middle:EV+AV,right:EV+PV,"bottom-left":TV+kV,bottom:TV+AV,"bottom-right":TV+PV},IFt={naive:OFt,"reduced-search":EFt,floodfill:AFt};function LFt(t,e,n,r,i,o,s,a,l,c,u){if(!t.length)return t;const f=Math.max(r.length,i.length),d=$Ft(r,f),h=FFt(i,f),p=NFt(t[0].datum),g=p==="group"&&t[0].datum.items[l].marktype,m=g==="area",v=zFt(p,g,a,l),y=c===null||c===1/0,x=m&&u==="naive";let b=-1,w=-1;const _=t.map(E=>{const P=y?hc.width(E,E.text):void 0;return b=Math.max(b,P),w=Math.max(w,E.fontSize),{datum:E,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(E),textWidth:P}});c=c===null||c===1/0?Math.max(b,w)+Math.max(...r):c;const S=CFt(e[0],e[1],c);let O;if(!x){n&&_.sort((A,R)=>n(A.datum,R.datum));let E=!1;for(let A=0;AA.datum);O=o.length||P?wFt(S,P||[],o,E,m):bFt(S,s&&_)}const k=m?IFt[u](S,O,s,l):RFt(S,O,h,d);return _.forEach(E=>E.opacity=+k(E)),_}function $Ft(t,e){const n=new Float64Array(e),r=t.length;for(let i=0;i[o.x,o.x,o.x,o.y,o.y,o.y];return t?t==="line"||t==="area"?o=>i(o.datum):e==="line"?o=>{const s=o.datum.items[r].items;return i(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:i}const bY=["x","y","opacity","align","baseline"],Aze=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function $oe(t){De.call(this,null,t)}$oe.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:Aze},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:bY.length,default:bY}]};it($oe,De,{transform(t,e){function n(o){const s=t[o];return fn(s)&&e.modified(s.fields)}const r=t.modified();if(!(r||e.changed(e.ADD_REM)||n("sort")))return;(!t.size||t.size.length!==2)&&je("Size parameter should be specified as a [width, height] array.");const i=t.as||bY;return LFt(e.materialize(e.SOURCE).source||[],t.size,t.sort,pt(t.offset==null?1:t.offset),pt(t.anchor||Aze),t.avoidMarks||[],t.avoidBaseMark!==!1,t.lineAnchor||"end",t.markIndex||0,t.padding===void 0?0:t.padding,t.method||"naive").forEach(o=>{const s=o.datum;s[i[0]]=o.x,s[i[1]]=o.y,s[i[2]]=o.opacity,s[i[3]]=o.align,s[i[4]]=o.baseline}),e.reflow(r).modifies(i)}});const jFt=Object.freeze(Object.defineProperty({__proto__:null,label:$oe},Symbol.toStringTag,{value:"Module"}));function Pze(t,e){var n=[],r=function(u){return u(a)},i,o,s,a,l,c;if(e==null)n.push(t);else for(i={},o=0,s=t.length;o{D$e(c,t.x,t.y,t.bandwidth||.3).forEach(u=>{const f={};for(let d=0;dt==="poly"?e:t==="quad"?2:1;function Noe(t){De.call(this,null,t)}Noe.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(wY)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};it(Noe,De,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=Pze(r,t.groupby),o=(t.groupby||[]).map(Fi),s=t.method||"linear",a=t.order==null?3:t.order,l=BFt(s,a),c=t.as||[Fi(t.x),Fi(t.y)],u=wY[s],f=[];let d=t.extent;vt(wY,s)||je("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=l){e.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=u(h,t.x,t.y,a);if(t.params){f.push(cr({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||kh(h,t.x),v=y=>{const x={};for(let b=0;bv([y,g.predict(y)])):hB(g.predict,m,25,200).forEach(v)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const UFt=Object.freeze(Object.defineProperty({__proto__:null,loess:Foe,regression:Noe},Symbol.toStringTag,{value:"Module"})),ug=11102230246251565e-32,Ms=134217729,WFt=(3+8*ug)*ug;function MV(t,e,n,r,i){let o,s,a,l,c=e[0],u=r[0],f=0,d=0;u>c==u>-c?(o=c,c=e[++f]):(o=u,u=r[++d]);let h=0;if(fc==u>-c?(s=c+o,a=o-(s-c),c=e[++f]):(s=u+o,a=o-(s-u),u=r[++d]),o=s,a!==0&&(i[h++]=a);fc==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=e[++f]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=r[++d]),o=s,a!==0&&(i[h++]=a);for(;f=T||-R>=T||(f=t-k,a=t-(k+f)+(f-i),f=n-E,c=n-(E+f)+(f-i),f=e-P,l=e-(P+f)+(f-o),f=r-A,u=r-(A+f)+(f-o),a===0&&l===0&&c===0&&u===0)||(T=qFt*s+WFt*Math.abs(R),R+=k*u+A*a-(P*c+E*l),R>=T||-R>=T))return R;b=a*A,d=Ms*a,h=d-(d-a),p=a-h,d=Ms*A,g=d-(d-A),m=A-g,w=p*m-(b-h*g-p*g-h*m),_=l*E,d=Ms*l,h=d-(d-l),p=l-h,d=Ms*E,g=d-(d-E),m=E-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,ca[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,ca[1]=x-(v+f)+(f-_),O=y+v,f=O-y,ca[2]=y-(O-f)+(v-f),ca[3]=O;const M=MV(4,rw,4,ca,bve);b=k*u,d=Ms*k,h=d-(d-k),p=k-h,d=Ms*u,g=d-(d-u),m=u-g,w=p*m-(b-h*g-p*g-h*m),_=P*c,d=Ms*P,h=d-(d-P),p=P-h,d=Ms*c,g=d-(d-c),m=c-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,ca[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,ca[1]=x-(v+f)+(f-_),O=y+v,f=O-y,ca[2]=y-(O-f)+(v-f),ca[3]=O;const I=MV(M,bve,4,ca,wve);b=a*u,d=Ms*a,h=d-(d-a),p=a-h,d=Ms*u,g=d-(d-u),m=u-g,w=p*m-(b-h*g-p*g-h*m),_=l*c,d=Ms*l,h=d-(d-l),p=l-h,d=Ms*c,g=d-(d-c),m=c-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,ca[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,ca[1]=x-(v+f)+(f-_),O=y+v,f=O-y,ca[2]=y-(O-f)+(v-f),ca[3]=O;const z=MV(I,wve,4,ca,_ve);return _ve[z-1]}function YI(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=GFt*c?l:-XFt(t,e,n,r,i,o,c)}const Sve=Math.pow(2,-52),QI=new Uint32Array(512);class S5{static from(e,n=JFt,r=eNt){const i=e.length,o=new Float64Array(i*2);for(let s=0;s>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:e,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=e.length>>1;let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let k=0;kc&&(c=E),P>u&&(u=P),this._ids[k]=k}const f=(a+c)/2,d=(l+u)/2;let h,p,g;for(let k=0,E=1/0;k0&&(p=k,E=P)}let y=e[2*p],x=e[2*p+1],b=1/0;for(let k=0;kA&&(k[E++]=R,A=T)}this.hull=k.subarray(0,E),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(YI(m,v,y,x,w,_)<0){const k=p,E=y,P=x;p=g,y=w,x=_,g=k,w=E,_=P}const S=ZFt(m,v,y,x,w,_);this._cx=S.x,this._cy=S.y;for(let k=0;k0&&Math.abs(R-E)<=Sve&&Math.abs(T-P)<=Sve||(E=R,P=T,A===h||A===p||A===g))continue;let M=0;for(let L=0,B=this._hashKey(R,T);L=0;)if(I=z,I===M){I=-1;break}if(I===-1)continue;let F=this._addTriangle(I,A,r[I],-1,-1,i[I]);i[A]=this._legalize(F+2),i[I]=F,O++;let N=r[I];for(;z=r[N],YI(R,T,e[2*N],e[2*N+1],e[2*z],e[2*z+1])<0;)F=this._addTriangle(N,A,z,i[A],-1,i[N]),i[A]=this._legalize(F+2),r[N]=N,O--,N=z;if(I===M)for(;z=n[I],YI(R,T,e[2*z],e[2*z+1],e[2*I],e[2*I+1])<0;)F=this._addTriangle(z,A,I,-1,i[I],i[z]),this._legalize(F+2),i[z]=F,r[I]=I,O--,I=z;this._hullStart=n[A]=I,r[I]=n[N]=A,r[A]=N,o[this._hashKey(R,T)]=A,o[this._hashKey(e[2*I],e[2*I+1])]=I}this.hull=new Uint32Array(O);for(let k=0,E=this._hullStart;k0?3-n:1+n)/4}function RV(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function QFt(t,e,n,r,i,o,s,a){const l=t-s,c=e-a,u=n-s,f=r-a,d=i-s,h=o-a,p=l*l+c*c,g=u*u+f*f,m=d*d+h*h;return l*(f*m-g*h)-c*(u*m-g*d)+p*(u*h-f*d)<0}function KFt(t,e,n,r,i,o){const s=n-t,a=r-e,l=i-t,c=o-e,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=(c*u-a*f)*d,p=(s*f-l*u)*d;return h*h+p*p}function ZFt(t,e,n,r,i,o){const s=n-t,a=r-e,l=i-t,c=o-e,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=t+(c*u-a*f)*d,p=e+(s*f-l*u)*d;return{x:h,y:p}}function g_(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=t[i],s=e[o];let a=i-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=o}else{const i=n+r>>1;let o=n+1,s=r;r2(t,i,o),e[t[n]]>e[t[r]]&&r2(t,n,r),e[t[o]]>e[t[r]]&&r2(t,o,r),e[t[n]]>e[t[o]]&&r2(t,n,o);const a=t[o],l=e[a];for(;;){do o++;while(e[t[o]]l);if(s=s-n?(g_(t,e,o,r),g_(t,e,n,s-1)):(g_(t,e,n,s-1),g_(t,e,o,r))}}function r2(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function JFt(t){return t[0]}function eNt(t){return t[1]}const Cve=1e-6;class xx{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;const i=e+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>Cve||Math.abs(this._y1-o)>Cve)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(e,n,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class _Y{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}let tNt=class{constructor(e,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:n,triangles:r},vectors:i}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,v=r.length,y,x;g1;)o-=2;for(let s=2;s0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)0){if(e>=this.xmax)return null;(s=(this.xmax-e)/r)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n1e-10)return!1}return!0}function sNt(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class zoe{static from(e,n=rNt,r=iNt,i){return new zoe("length"in e?aNt(e,n,r,i):Float64Array.from(lNt(e,n,r,i)))}constructor(e){this._delaunator=new S5(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&oNt(e)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new tNt(this,e)}*neighbors(e){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(e);f>0&&(yield a[f-1]),f=0&&o!==r&&o!==i;)r=o;return o}_step(e,n,r){const{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:l,points:c}=this;if(i[e]===-1||!c.length)return(e+1)%(c.length>>1);let u=e,f=iw(n-c[e*2],2)+iw(r-c[e*2+1],2);const d=i[e];let h=d;do{let p=l[h];const g=iw(n-c[p*2],2)+iw(r-c[p*2+1],2);if(g>5)*t[1]),m=null,v=c.length,y=-1,x=[],b=c.map(_=>({text:e(_),font:n(_),style:i(_),weight:o(_),rotate:s(_),size:~~(r(_)+1e-14),padding:a(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,S)=>S.size-_.size);++y>1,w.y=t[1]*(u()+.5)>>1,pNt(p,w,b,y),w.hasText&&h(g,w,m)&&(x.push(w),m?mNt(m,w):m=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=t[0]>>1,w.y-=t[1]>>1)}return x};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(xT<<5)/g,p.height=A3/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var v=g.x,y=g.y,x=Math.hypot(t[0],t[1]),b=l(t),w=u()<.5?1:-1,_=-w,S,O,k;(S=b(_+=w))&&(O=~~S[0],k=~~S[1],!(Math.min(Math.abs(O),Math.abs(k))>=x));)if(g.x=v+O,g.y=y+k,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>t[0]||g.y+g.y1>t[1])&&(!m||!gNt(g,p,t[0]))&&(!m||vNt(g,m))){for(var E=g.sprite,P=g.width>>5,A=t[0]>>5,R=g.x-(P<<4),T=R&127,M=32-T,I=g.y1-g.y0,z=(g.y+g.y0)*A+(R>>5),F,N=0;N>>T:0);z+=A}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(c=p,f):c},f.size=function(p){return arguments.length?(t=[+p[0],+p[1]],f):t},f.font=function(p){return arguments.length?(n=y0(p),f):n},f.fontStyle=function(p){return arguments.length?(i=y0(p),f):i},f.fontWeight=function(p){return arguments.length?(o=y0(p),f):o},f.rotate=function(p){return arguments.length?(s=y0(p),f):s},f.text=function(p){return arguments.length?(e=y0(p),f):e},f.spiral=function(p){return arguments.length?(l=bNt[p]||p,f):l},f.fontSize=function(p){return arguments.length?(r=y0(p),f):r},f.padding=function(p){return arguments.length?(a=y0(p),f):a},f.random=function(p){return arguments.length?(u=p,f):u},f}function pNt(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,(xT<<5)/o,A3/o);var s=0,a=0,l=0,c=n.length,u,f,d,h,p;for(--r;++r>5<<5,d=~~Math.max(Math.abs(y+x),Math.abs(y-x))}else u=u+31>>5<<5;if(d>l&&(l=d),s+u>=xT<<5&&(s=0,a+=l,l=0),a+d>=A3)break;i.translate((s+(u>>1))/o,(a+(d>>1))/o),e.rotate&&i.rotate(e.rotate*DV),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=u,e.height=d,e.xoff=s,e.yoff=a,e.x1=u>>1,e.y1=d>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,s+=u}for(var w=i.getImageData(0,0,(xT<<5)/o,A3/o).data,_=[];--r>=0;)if(e=n[r],!!e.hasText){for(u=e.width,f=u>>5,d=e.y1-e.y0,h=0;h>5),E=w[(a+p)*(xT<<5)+(s+h)<<2]?1<<31-h%32:0;_[k]|=E,S|=E}S?O=p:(e.y0++,d--,p--,a++)}e.y1=e.y0+O,e.sprite=_.slice(0,(e.y1-e.y0)*f)}}}function gNt(t,e,n){n>>=5;for(var r=t.sprite,i=t.width>>5,o=t.x-(i<<4),s=o&127,a=32-s,l=t.y1-t.y0,c=(t.y+t.y0)*n+(o>>5),u,f=0;f>>s:0))&e[c+d])return!0;c+=n}return!1}function mNt(t,e){var n=t[0],r=t[1];e.x+e.x0r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function vNt(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0g(p(m))}i.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const c=o.words(i).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(a).random(ku).layout(),u=o.size(),f=u[0]>>1,d=u[1]>>1,h=c.length;for(let p=0,g,m;pnew Uint8Array(t),CNt=t=>new Uint16Array(t),dk=t=>new Uint32Array(t);function ONt(){let t=8,e=[],n=dk(0),r=KI(0,t),i=KI(0,t);return{data:()=>e,seen:()=>n=ENt(n,e.length),add(o){for(let s=0,a=e.length,l=o.length,c;se.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>t<257?255:t<65537?65535:4294967295,set(o,s){r[o]|=s},clear(o,s){r[o]&=~s},resize(o,s){const a=r.length;(o>a||s>t)&&(t=Math.max(s,t),r=KI(o,t,r),i=KI(o,t))}}}function ENt(t,e,n){return t.length>=e?t:(n=n||new t.constructor(e),n.set(t),n)}function KI(t,e,n){const r=(e<257?SNt:e<65537?CNt:dk)(t);return n&&r.set(n),r}function Ove(t,e,n){const r=1<0)for(m=0;mt,size:()=>n}}function TNt(t,e){return t.sort.call(e,(n,r)=>{const i=t[n],o=t[r];return io?1:0}),ROt(t,e)}function kNt(t,e,n,r,i,o,s,a,l){let c=0,u=0,f;for(f=0;ce.modified(r.fields));return n?this.reinit(t,e):this.eval(t,e)}else return this.init(t,e)},init(t,e){const n=t.fields,r=t.query,i=this._indices={},o=this._dims=[],s=r.length;let a=0,l,c;for(;a{const o=i.remove(e,n);for(const s in r)r[s].reindex(o)})},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,s=r.length;let a=0,l,c;for(n.filters=0,c=0;ch)for(m=h,v=Math.min(f,p);mp)for(m=Math.max(f,p),v=d;mf)for(p=f,g=Math.min(c,d);pd)for(p=Math.max(c,d),g=u;pa[u]&n?null:s[u];return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,u=>{const f=a[u]&n;return!f&&f^l[u]&n?s[u]:null}),o.filter(o.REM,u=>{const f=a[u]&n;return f&&!(f^(f^l[u]&n))?s[u]:null})):(o.filter(o.ADD,c),o.filter(o.REM,u=>(a[u]&n)===i?s[u]:null)),o.filter(o.SOURCE,u=>c(u._index))}});const ANt=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:Uoe,resolvefilter:Woe},Symbol.toStringTag,{value:"Module"})),PNt="RawCode",wb="Literal",MNt="Property",RNt="Identifier",DNt="ArrayExpression",INt="BinaryExpression",Dze="CallExpression",LNt="ConditionalExpression",$Nt="LogicalExpression",FNt="MemberExpression",NNt="ObjectExpression",zNt="UnaryExpression";function rd(t){this.type=t}rd.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=jNt(this),n=0,r=e.length;n";qh[_b]="Identifier";qh[Yy]="Keyword";qh[KB]="Null";qh[g1]="Numeric";qh[qa]="Punctuator";qh[AR]="String";qh[BNt]="RegularExpression";var UNt="ArrayExpression",WNt="BinaryExpression",VNt="CallExpression",GNt="ConditionalExpression",Ize="Identifier",HNt="Literal",qNt="LogicalExpression",XNt="MemberExpression",YNt="ObjectExpression",QNt="Property",KNt="UnaryExpression",zo="Unexpected token %0",ZNt="Unexpected number",JNt="Unexpected string",e5t="Unexpected identifier",t5t="Unexpected reserved word",n5t="Unexpected end of input",SY="Invalid regular expression",IV="Invalid regular expression: missing /",Lze="Octal literals are not allowed in strict mode.",r5t="Duplicate data property in object literal not allowed in strict mode",gs="ILLEGAL",NA="Disabled.",i5t=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),o5t=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function ZB(t,e){if(!t)throw new Error("ASSERT: "+e)}function zp(t){return t>=48&&t<=57}function Voe(t){return"0123456789abcdefABCDEF".includes(t)}function hk(t){return"01234567".includes(t)}function s5t(t){return t===32||t===9||t===11||t===12||t===160||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function zA(t){return t===10||t===13||t===8232||t===8233}function PR(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t===92||t>=128&&i5t.test(String.fromCharCode(t))}function C5(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===92||t>=128&&o5t.test(String.fromCharCode(t))}const a5t={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function $ze(){for(;ze1114111||t!=="}")&&Zn({},zo,gs),e<=65535?String.fromCharCode(e):(n=(e-65536>>10)+55296,r=(e-65536&1023)+56320,String.fromCharCode(n,r))}function Fze(){var t,e;for(t=Pt.charCodeAt(ze++),e=String.fromCharCode(t),t===92&&(Pt.charCodeAt(ze)!==117&&Zn({},zo,gs),++ze,t=CY("u"),(!t||t==="\\"||!PR(t.charCodeAt(0)))&&Zn({},zo,gs),e=t);ze>>=")return ze+=4,{type:qa,value:s,start:t,end:ze};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return ze+=3,{type:qa,value:o,start:t,end:ze};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".includes(r)||i==="=>")return ze+=2,{type:qa,value:i,start:t,end:ze};if(i==="//"&&Zn({},zo,gs),"<>=!+-*%&|^/".includes(r))return++ze,{type:qa,value:r,start:t,end:ze};Zn({},zo,gs)}function f5t(t){let e="";for(;ze{if(parseInt(i,16)<=1114111)return"x";Zn({},SY)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Zn({},SY)}try{return new RegExp(t,e)}catch{return null}}function g5t(){var t,e,n,r,i;for(t=Pt[ze],ZB(t==="/","Regular expression literal must start with a slash"),e=Pt[ze++],n=!1,r=!1;ze=0&&Zn({},SY,n),{value:n,literal:e}}function v5t(){var t,e,n,r;return br=null,$ze(),t=ze,e=g5t(),n=m5t(),r=p5t(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:ze}}function y5t(t){return t.type===_b||t.type===Yy||t.type===QB||t.type===KB}function Nze(){if($ze(),ze>=Js)return{type:kR,start:ze,end:ze};const t=Pt.charCodeAt(ze);return PR(t)?u5t():t===40||t===41||t===59?LV():t===39||t===34?h5t():t===46?zp(Pt.charCodeAt(ze+1))?Tve():LV():zp(t)?Tve():LV()}function rl(){const t=br;return ze=t.end,br=Nze(),ze=t.end,t}function zze(){const t=ze;br=Nze(),ze=t}function x5t(t){const e=new rd(UNt);return e.elements=t,e}function kve(t,e,n){const r=new rd(t==="||"||t==="&&"?qNt:WNt);return r.operator=t,r.left=e,r.right=n,r}function b5t(t,e){const n=new rd(VNt);return n.callee=t,n.arguments=e,n}function w5t(t,e,n){const r=new rd(GNt);return r.test=t,r.consequent=e,r.alternate=n,r}function Goe(t){const e=new rd(Ize);return e.name=t,e}function bT(t){const e=new rd(HNt);return e.value=t.value,e.raw=Pt.slice(t.start,t.end),t.regex&&(e.raw==="//"&&(e.raw="/(?:)/"),e.regex=t.regex),e}function Ave(t,e,n){const r=new rd(XNt);return r.computed=t==="[",r.object=e,r.property=n,r.computed||(n.member=!0),r}function _5t(t){const e=new rd(YNt);return e.properties=t,e}function Pve(t,e,n){const r=new rd(QNt);return r.key=e,r.value=n,r.kind=t,r}function S5t(t,e){const n=new rd(KNt);return n.operator=t,n.argument=e,n.prefix=!0,n}function Zn(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,(o,s)=>(ZB(s":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function L5t(){var t,e,n,r,i,o,s,a,l,c;if(t=br,l=P3(),r=br,i=Dve(r),i===0)return l;for(r.prec=i,rl(),e=[t,br],s=P3(),o=[l,r,s];(i=Dve(br))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),e.pop(),n=kve(a,l,s),o.push(n);r=rl(),r.prec=i,o.push(r),e.push(br),n=P3(),o.push(n)}for(c=o.length-1,n=o[c],e.pop();c>1;)e.pop(),n=kve(o[c-1].value,o[c-2],n),c-=2;return n}function Sb(){var t,e,n;return t=L5t(),ti("?")&&(rl(),e=Sb(),ea(":"),n=Sb(),t=w5t(t,e,n)),t}function Hoe(){const t=Sb();if(ti(","))throw new Error(NA);return t}function qoe(t){Pt=t,ze=0,Js=Pt.length,br=null,zze();const e=Hoe();if(br.type!==kR)throw new Error("Unexpect token after expression.");return e}var jze={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function Bze(t){function e(s,a,l,c){let u=t(a[0]);return l&&(u=l+"("+u+")",l.lastIndexOf("new ",0)===0&&(u="("+u+")")),u+"."+s+(c<0?"":c===0?"()":"("+a.slice(1).map(t).join(",")+")")}function n(s,a,l){return c=>e(s,c,a,l)}const r="new Date",i="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&je("Missing arguments to clamp function."),s.length>3&&je("Too many arguments to clamp function.");const a=s.map(t);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&je("Missing arguments to if function."),s.length>3&&je("Too many arguments to if function.");const a=s.map(t);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function $5t(t){const e=t&&t.length-1;return e&&(t[0]==='"'&&t[e]==='"'||t[0]==="'"&&t[e]==="'")?t.slice(1,-1):t}function Uze(t){t=t||{};const e=t.allowed?Wf(t.allowed):{},n=t.forbidden?Wf(t.forbidden):{},r=t.constants||jze,i=(t.functions||Bze)(f),o=t.globalvar,s=t.fieldvar,a=fn(o)?o:p=>`${o}["${p}"]`;let l={},c={},u=0;function f(p){if(gt(p))return p;const g=d[p.type];return g==null&&je("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return u>0?g:vt(n,g)?je("Illegal identifier: "+g):vt(r,g)?r[g]:vt(e,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(u+=1);const v=f(p.property);return m===s&&(c[$5t(v)]=1),g&&(u-=1),m+(g?"."+v:"["+v+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&je("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,v=vt(i,g)&&i[g];return v||je("Unrecognized function: "+g),fn(v)?v(m):v+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{u+=1;const g=f(p.key);return u-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},g}return h.functions=i,h.constants=r,h}const Ive=Symbol("vega_selection_getter");function Wze(t){return(!t.getter||!t.getter[Ive])&&(t.getter=Ou(t.field),t.getter[Ive]=!0),t.getter}const Xoe="intersect",Lve="union",F5t="vlMulti",N5t="vlPoint",$ve="or",z5t="and",Ld="_vgsid_",jA=Ou(Ld),j5t="E",B5t="R",U5t="R-E",W5t="R-LE",V5t="R-RE",O5="index:unit";function Fve(t,e){for(var n=e.fields,r=e.values,i=n.length,o=0,s,a;ocn(e.fields?{values:e.fields.map(r=>Wze(r)(n.datum))}:{[Ld]:jA(n.datum)},e))}function Q5t(t,e,n,r){for(var i=this.context.data[t],o=i?i.values.value:[],s={},a={},l={},c,u,f,d,h,p,g,m,v,y,x=o.length,b=0,w,_;b(S[u[k].field]=O,S),{})))}else h=Ld,p=jA(c),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Ld]:p}));if(e=e||Lve,s[Ld]?s[Ld]=FV[`${Ld}_${e}`](...Object.values(s[Ld])):Object.keys(s).forEach(S=>{s[S]=Object.keys(s[S]).map(O=>s[S][O]).reduce((O,k)=>O===void 0?k:FV[`${l[S]}_${e}`](O,k))}),o=Object.keys(a),n&&o.length){const S=r?N5t:F5t;s[S]=e===Lve?{[$ve]:o.reduce((O,k)=>(O.push(...a[k]),O),[])}:{[z5t]:o.map(O=>({[$ve]:a[O]}))}}return s}var FV={[`${Ld}_union`]:BOt,[`${Ld}_intersect`]:zOt,E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;ne.indexOf(n)>=0):e},R_union:function(t,e){var n=Ys(e[0]),r=Ys(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]r&&(n=e[1],r=e[0]),t.length?rr&&(t[1]=r),t):[n,r]}};const K5t=":",Z5t="@";function Yoe(t,e,n,r){e[0].type!==wb&&je("First argument to selection functions must be a string literal.");const i=e[0].value,o=e.length>=2&&$n(e).value,s="unit",a=Z5t+s,l=K5t+i;o===Xoe&&!vt(r,a)&&(r[a]=n.getData(i).indataRef(n,s)),vt(r,l)||(r[l]=n.getData(i).tuplesRef())}function Gze(t){const e=this.context.data[t];return e?e.values.value:[]}function J5t(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i&&i.count}function ezt(t,e){const n=this.context.dataflow,r=this.context.data[t],i=r.input;return n.pulse(i,n.changeset().remove(Eu).insert(e)),1}function tzt(t,e,n){if(t){const r=this.context.dataflow,i=t.mark.source;r.pulse(i,r.changeset().encode(t,e))}return n!==void 0?n:t}const MR=t=>function(e,n){const r=this.context.dataflow.locale();return e===null?"null":r[t](n)(e)},nzt=MR("format"),Hze=MR("timeFormat"),rzt=MR("utcFormat"),izt=MR("timeParse"),ozt=MR("utcParse"),ZI=new Date(2e3,0,1);function e6(t,e,n){return!Number.isInteger(t)||!Number.isInteger(e)?"":(ZI.setYear(2e3),ZI.setMonth(t),ZI.setDate(e),Hze.call(this,ZI,n))}function szt(t){return e6.call(this,t,1,"%B")}function azt(t){return e6.call(this,t,1,"%b")}function lzt(t){return e6.call(this,0,2+t,"%A")}function czt(t){return e6.call(this,0,2+t,"%a")}const uzt=":",fzt="@",OY="%",qze="$";function Qoe(t,e,n,r){e[0].type!==wb&&je("First argument to data functions must be a string literal.");const i=e[0].value,o=uzt+i;if(!vt(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function dzt(t,e,n,r){e[0].type!==wb&&je("First argument to indata must be a string literal."),e[1].type!==wb&&je("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,s=fzt+o;vt(s,r)||(r[s]=n.getData(i).indataRef(n,o))}function Ta(t,e,n,r){if(e[0].type===wb)Nve(n,r,e[0].value);else for(t in n.scales)Nve(n,r,t)}function Nve(t,e,n){const r=OY+n;if(!vt(e,r))try{e[r]=t.scaleRef(n)}catch{}}function Xh(t,e){if(fn(t))return t;if(gt(t)){const n=e.scales[t];return n&&SPt(n.value)?n.value:void 0}}function hzt(t,e,n){e.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=Ta,n._range=Ta,n._scale=Ta;const r=i=>"_["+(i.type===wb?rt(OY+i.value):rt(OY)+"+"+t(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${t(i[1])})`}}function Koe(t,e){return function(n,r,i){if(n){const o=Xh(n,(i||this).context);return o&&o.path[t](r)}else return e(r)}}const pzt=Koe("area",NIt),gzt=Koe("bounds",UIt),mzt=Koe("centroid",XIt);function vzt(t,e){const n=Xh(t,(e||this).context);return n&&n.scale()}function yzt(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n}function Zoe(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}function xzt(){return Zoe(this.context.dataflow,"warn",arguments)}function bzt(){return Zoe(this.context.dataflow,"info",arguments)}function wzt(){return Zoe(this.context.dataflow,"debug",arguments)}function NV(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function EY(t){const e=ay(t),n=NV(e.r),r=NV(e.g),i=NV(e.b);return .2126*n+.7152*r+.0722*i}function _zt(t,e){const n=EY(t),r=EY(e),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function Szt(){const t=[].slice.call(arguments);return t.unshift({}),cn(...t)}function Xze(t,e){return t===e||t!==t&&e!==e?!0:We(t)?We(e)&&t.length===e.length?Czt(t,e):!1:ht(t)&&ht(e)?Yze(t,e):!1}function Czt(t,e){for(let n=0,r=t.length;nYze(t,e)}function Ozt(t,e,n,r,i,o){const s=this.context.dataflow,a=this.context.data[t],l=a.input,c=s.stamp();let u=a.changes,f,d;if(s._trigger===!1||!(l.value.length||e||r))return 0;if((!u||u.stamp{a.modified=!0,s.pulse(l,u).run()},!0,1)),n&&(f=n===!0?Eu:We(n)||oB(n)?n:zve(n),u.remove(f)),e&&u.insert(e),r&&(f=zve(r),l.value.some(f)?u.remove(f):u.insert(r)),i)for(d in o)u.modify(i,d,o[d]);return 1}function Ezt(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.hypot(n,r)}function Tzt(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}const jve={};function kzt(t,e){const n=jve[e]||(jve[e]=Ou(e));return We(t)?t.map(n):n(t)}function Joe(t){return We(t)||ArrayBuffer.isView(t)?t:null}function ese(t){return Joe(t)||(gt(t)?t:null)}function Azt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;ro.stop(c(u),t(u))),o}function Wzt(t,e,n){const r=Xh(t,(n||this).context);return function(i){return r?r.path.context(i)(e):""}}function Vzt(t){let e=null;return function(n){return n?PA(n,e=e||HS(t)):t}}const Qze=t=>t.data;function Kze(t,e){const n=Gze.call(e,t);return n.root&&n.root.lookup||{}}function Gzt(t,e,n){const r=Kze(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(Qze):void 0}function Hzt(t,e){const n=Kze(t,this)[e];return n?n.ancestors().map(Qze):void 0}const Zze=()=>typeof window<"u"&&window||null;function qzt(){const t=Zze();return t?t.screen:{}}function Xzt(){const t=Zze();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]}function Yzt(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]}function Jze(t,e,n){if(!t)return[];const[r,i]=t,o=new uo().set(r[0],r[1],i[0],i[1]),s=n||this.context.dataflow.scenegraph().root;return $Ne(s,o,Qzt(e))}function Qzt(t){let e=null;if(t){const n=pt(t.marktype),r=pt(t.markname);e=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return e}function Kzt(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;t=pt(t);const i=t[t.length-1];return i===void 0||Math.hypot(i[0]-e,i[1]-n)>r?[...t,[e,n]]:t}function Zzt(t){return pt(t).reduce((e,n,r)=>{let[i,o]=n;return e+=r==0?`M ${i},${o} `:r===t.length-1?" Z":`L ${i},${o} `},"")}function Jzt(t,e,n){const{x:r,y:i,mark:o}=n,s=new uo().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,c]of e)ls.x2&&(s.x2=l),cs.y2&&(s.y2=c);return s.translate(r,i),Jze([[s.x1,s.y1],[s.x2,s.y2]],t,o).filter(l=>ejt(l.x,l.y,e))}function ejt(t,e,n){let r=0;for(let i=0,o=n.length-1;ie!=a>e&&t<(s-l)*(e-c)/(a-c)+l&&r++}return r&1}const BA={random(){return ku()},cumulativeNormal:uB,cumulativeLogNormal:nre,cumulativeUniform:sre,densityNormal:Kne,densityLogNormal:tre,densityUniform:ore,quantileNormal:fB,quantileLogNormal:rre,quantileUniform:are,sampleNormal:cB,sampleLogNormal:ere,sampleUniform:ire,isArray:We,isBoolean:Vy,isDate:Nv,isDefined(t){return t!==void 0},isNumber:Jn,isObject:ht,isRegExp:nLe,isString:gt,isTuple:oB,isValid(t){return t!=null&&t===t},toBoolean:Pne,toDate(t){return Mne(t)},toNumber:Ys,toString:Rne,indexof:Pzt,join:Azt,lastindexof:Mzt,replace:Dzt,reverse:Izt,slice:Rzt,flush:eLe,lerp:rLe,merge:Szt,pad:sLe,peek:$n,pluck:kzt,span:tR,inrange:u_,truncate:aLe,rgb:ay,lab:PN,hcl:MN,hsl:kN,luminance:EY,contrast:_zt,sequence:sl,format:nzt,utcFormat:rzt,utcParse:ozt,utcOffset:jLe,utcSequence:WLe,timeFormat:Hze,timeParse:izt,timeOffset:zLe,timeSequence:ULe,timeUnitSpecifier:kLe,monthFormat:szt,monthAbbrevFormat:azt,dayFormat:lzt,dayAbbrevFormat:czt,quarter:QIe,utcquarter:KIe,week:PLe,utcweek:DLe,dayofyear:ALe,utcdayofyear:RLe,warn:xzt,info:bzt,debug:wzt,extent(t){return kh(t)},inScope:yzt,intersect:Jze,clampRange:ZIe,pinchDistance:Ezt,pinchAngle:Tzt,screen:qzt,containerSize:Yzt,windowSize:Xzt,bandspace:Lzt,setdata:ezt,pathShape:Vzt,panLinear:HIe,panLog:qIe,panPow:XIe,panSymlog:YIe,zoomLinear:Cne,zoomLog:One,zoomPow:hN,zoomSymlog:Ene,encode:tzt,modify:Ozt,lassoAppend:Kzt,lassoPath:Zzt,intersectLasso:Jzt},tjt=["view","item","group","xy","x","y"],njt="event.vega.",eje="this.",tse={},tje={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>`_[${rt(qze+t)}]`,functions:rjt,constants:jze,visitors:tse},TY=Uze(tje);function rjt(t){const e=Bze(t);tjt.forEach(n=>e[n]=njt+n);for(const n in BA)e[n]=eje+n;return cn(e,hzt(t,BA,tse)),e}function Ki(t,e,n){return arguments.length===1?BA[t]:(BA[t]=e,n&&(tse[t]=n),TY&&(TY.functions[t]=eje+t),this)}Ki("bandwidth",$zt,Ta);Ki("copy",Fzt,Ta);Ki("domain",Nzt,Ta);Ki("range",jzt,Ta);Ki("invert",zzt,Ta);Ki("scale",Bzt,Ta);Ki("gradient",Uzt,Ta);Ki("geoArea",pzt,Ta);Ki("geoBounds",gzt,Ta);Ki("geoCentroid",mzt,Ta);Ki("geoShape",Wzt,Ta);Ki("geoScale",vzt,Ta);Ki("indata",J5t,dzt);Ki("data",Gze,Qoe);Ki("treePath",Gzt,Qoe);Ki("treeAncestors",Hzt,Qoe);Ki("vlSelectionTest",G5t,Yoe);Ki("vlSelectionIdTest",X5t,Yoe);Ki("vlSelectionResolve",Q5t,Yoe);Ki("vlSelectionTuples",Y5t);function Dh(t,e){const n={};let r;try{t=gt(t)?t:rt(t)+"",r=qoe(t)}catch{je("Expression parse error: "+t)}r.visit(o=>{if(o.type!==Dze)return;const s=o.callee.name,a=tje.visitors[s];a&&a(s,o.arguments,e,n)});const i=TY(r);return i.globals.forEach(o=>{const s=qze+o;!vt(n,s)&&e.getSignal(o)&&(n[s]=e.signalRef(o))}),{$expr:cn({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function ijt(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach(r=>e.parseOperator(r)),n.forEach(r=>e.parseOperatorParameters(r)),(t.streams||[]).forEach(r=>e.parseStream(r)),(t.updates||[]).forEach(r=>e.parseUpdate(r)),e.resolve()}const ojt=Wf(["rule"]),Bve=Wf(["group","image","rect"]);function sjt(t,e){let n="";return ojt[e]||(t.x2&&(t.x?(Bve[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(Bve[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function nse(t){return(t+"").toLowerCase()}function ajt(t){return nse(t)==="operator"}function ljt(t){return nse(t)==="collect"}function i2(t,e,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}function cjt(t,e,n,r){return`((u = ${t}) < (v = ${e}) || u == null) && v != null ? ${n} : (u > v || v == null) && u != null ? ${r} : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} - : v !== v && u === u ? ${r} : `}var ujt={operator:(t,e)=>o2(t,["_"],e.code),parameter:(t,e)=>o2(t,["datum","_"],e.code),event:(t,e)=>o2(t,["event"],e.code),handler:(t,e)=>{const n=`var datum=event.item&&event.item.datum;return ${e.code};`;return o2(t,["_","event"],n)},encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const s="o["+rt(o)+"]";i+=`$=${r[o].code};if(${s}!==$)${s}=$,m=1;`}return i+=sjt(r,n),i+="return m;",o2(t,["item","_"],i)},codegen:{get(t){const e=`[${t.map(rt).join("][")}]`,n=Function("_",`return _${e};`);return n.path=e,n},comparator(t,e){let n;const r=(o,s)=>{const a=e[s];let l,c;return o.path?(l=`a${o.path}`,c=`b${o.path}`):((n=n||{})["f"+s]=o,l=`this.f${s}(a)`,c=`this.f${s}(b)`),cjt(l,c,-a,a)},i=Function("a","b","var u, v; return "+t.map(r).join("")+"0;");return n?i.bind(n):i}}};function fjt(t){const e=this;ajt(t.type)||!t.type?e.operator(t,t.update?e.operatorExpression(t.update):null):e.transform(t,t.type)}function djt(t){const e=this;if(t.params){const n=e.get(t.id);n||je("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}}function hjt(t,e){e=e||{};const n=this;for(const r in t){const i=t[r];e[r]=We(i)?i.map(o=>Uve(o,n,e)):Uve(i,n,e)}return e}function Uve(t,e,n){if(!t||!ht(t))return t;for(let r=0,i=Wve.length,o;ri&&i.$tupleid?jt:i);return e.fn[n]||(e.fn[n]=Tne(r,t.$order,e.expr.codegen))}function xjt(t,e){const n=t.$encode,r={};for(const i in n){const o=n[i];r[i]=Al(e.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}function bjt(t,e){return e}function wjt(t,e){const n=t.$subflow;return function(r,i,o){const s=e.fork().parse(n),a=s.get(n.operators[0].id),l=s.signals.parent;return l&&l.set(o),a.detachSubflow=()=>e.detach(s),a}}function _jt(){return jt}function Sjt(t){var e=this,n=t.filter!=null?e.eventExpression(t.filter):void 0,r=t.stream!=null?e.get(t.stream):void 0,i;t.source?r=e.events(t.source,t.type,n):t.merge&&(i=t.merge.map(o=>e.get(o)),r=i[0].merge.apply(i[0],i.slice(1))),t.between&&(i=t.between.map(o=>e.get(o)),r=r.between(i[0],i[1])),t.filter&&(r=r.filter(n)),t.throttle!=null&&(r=r.throttle(+t.throttle)),t.debounce!=null&&(r=r.debounce(+t.debounce)),r==null&&je("Invalid stream definition: "+JSON.stringify(t)),t.consume&&r.consume(!0),e.stream(t,r)}function Cjt(t){var e=this,n=ht(n=t.source)?n.$ref:n,r=e.get(n),i=null,o=t.update,s=void 0;r||je("Source not defined: "+t.source),i=t.target&&t.target.$expr?e.eventExpression(t.target.$expr):e.get(t.target),o&&o.$expr&&(o.$params&&(s=e.parseParameters(o.$params)),o=e.handlerExpression(o.$expr)),e.update(t,r,i,o,s)}const Ojt={skip:!0};function Ejt(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach(o=>{const s=e.signals[o];t.signals(o,s)&&(r[o]=s.value)})}if(t.data){var i=n.data={};Object.keys(e.data).forEach(o=>{const s=e.data[o];t.data(o,s)&&(i[o]=s.input.value)})}return e.subcontext&&t.recurse!==!1&&(n.subcontext=e.subcontext.map(o=>o.getState(t))),n}function Tjt(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach(o=>{n.update(e.signals[o],i[o],Ojt)}),Object.keys(r||{}).forEach(o=>{n.pulse(e.data[o].input,n.changeset().remove(Eu).insert(r[o]))}),(t.subcontext||[]).forEach((o,s)=>{const a=e.subcontext[s];a&&a.setState(o)})}function nje(t,e,n,r){return new rje(t,e,n,r)}function rje(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||ujt,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function Vve(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}rje.prototype=Vve.prototype={fork(){const t=new Vve(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter(n=>n!==t);const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),ljt(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let o=n.get(t.parent.$ref);o?(r.connect(o,[e]),e.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(t.parent.$ref),r.connect(o,[e]),e.targets().add(o)})}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const o in t.data){const s=n.data[o]||(n.data[o]={});t.data[o].forEach(a=>s[a]=e)}},resolve(){return(this.unresolved||[]).forEach(t=>t()),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[nse(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:ijt,parseOperator:fjt,parseOperatorParameters:djt,parseParameters:hjt,parseStream:Sjt,parseUpdate:Cjt,getState:Ejt,setState:Tjt};function kjt(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),ije(e,t.description()))}function ije(t,e){t&&(e==null?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}function Ajt(t){t.add(null,e=>(t._background=e.bg,t._resize=1,e.bg),{bg:t._signals.background})}const zV="default";function Pjt(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:zV,item:null}));t.on(t.events("view","pointermove"),e,(n,r)=>{const i=e.value,o=i?gt(i)?i:i.user:zV,s=r.item&&r.item.cursor||null;return i&&o===i.user&&s==i.item?i:{user:o,item:s}}),t.add(null,function(n){let r=n.cursor,i=this.value;return gt(r)||(i=r.item,r=r.user),kY(t,r&&r!==zV?r:i||r),i},{cursor:e})}function kY(t,e){const n=t.globalCursor()?typeof document<"u"&&document.body:t.container();if(n)return e==null?n.style.removeProperty("cursor"):n.style.cursor=e}function E5(t,e){var n=t._runtime.data;return vt(n,e)||je("Unrecognized data set: "+e),n[e]}function Mjt(t,e){return arguments.length<2?E5(this,t).values.value:t6.call(this,t,h1().remove(Eu).insert(e))}function t6(t,e){m$e(e)||je("Second argument to changes must be a changeset.");const n=E5(this,t);return n.modified=!0,this.pulse(n.input,e)}function Rjt(t,e){return t6.call(this,t,h1().insert(e))}function Djt(t,e){return t6.call(this,t,h1().remove(e))}function oje(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function sje(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function n6(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function Ijt(t){var e=n6(t),n=oje(t),r=sje(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach(i=>{try{i(n,r)}catch(o){t.error(o)}})}function Ljt(t,e,n){var r=t._renderer,i=r&&r.canvas(),o,s,a;return i&&(a=n6(t),s=e.changedTouches?e.changedTouches[0]:e,o=UB(s,i),o[0]-=a[0],o[1]-=a[1]),e.dataflow=t,e.item=n,e.vega=$jt(t,n,o),e}function $jt(t,e,n){const r=e?e.mark.marktype==="group"?e:e.mark.group:null;function i(s){var a=r,l;if(s){for(l=e;l;l=l.mark.group)if(l.mark.name===s){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;gt(s)&&(s=i(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:ra(t),item:ra(e||{}),group:i,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const Gve="view",Fjt="timer",Njt="window",zjt={trap:!1};function jjt(t){const e=cn({defaults:{}},t),n=(r,i)=>{i.forEach(o=>{We(r[o])&&(r[o]=Wf(r[o]))})};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}function aje(t,e,n,r){t._eventListeners.push({type:n,sources:pt(e),handler:r})}function Bjt(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[e]:i?!i[e]:t.preventDefault()}function JI(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return r===!1||ht(r)&&!r[n]?(t.warn(`Blocked ${e} ${n} event listener.`),!1):!0}function Ujt(t,e,n){var r=this,i=new lB(n),o=function(c,u){r.runAsync(null,()=>{t===Gve&&Bjt(r,e)&&c.preventDefault(),i.receive(Ljt(r,c,u))})},s;if(t===Fjt)JI(r,"timer",e)&&r.timer(o,e);else if(t===Gve)JI(r,"view",e)&&r.addEventListener(e,o,zjt);else if(t===Njt?JI(r,"window",e)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&JI(r,"selector",e)&&(s=Array.from(document.querySelectorAll(t))),!s)r.warn("Can not resolve event source: "+t);else{for(var a=0,l=s.length;a=0;)e[i].stop();for(i=r.length;--i>=0;)for(s=r[i],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(t&&t.call(this,this._handler,null,null,null),i=n.length;--i>=0;)l=n[i].type,a=n[i].handler,this._handler.off(l,a);return this}function pc(t,e,n){const r=document.createElement(t);for(const i in e)r.setAttribute(i,e[i]);return n!=null&&(r.textContent=n),r}const Gjt="vega-bind",Hjt="vega-bind-name",qjt="vega-bind-radio";function Xjt(t,e,n){if(!e)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:s=>{s!=t.signal(r.signal)&&t.runAsync(null,()=>{i.source=!0,t.signal(r.signal,s)})}},r.debounce&&(i.update=kne(r.debounce,i.update))),(r.input==null&&r.element?Yjt:Kjt)(i,e,r,t),i.active||(t.on(t._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(t.signal(r.signal))}),i.active=!0),i}function Yjt(t,e,n,r){const i=n.event||"input",o=()=>t.update(e.value);r.signal(n.signal,e.value),e.addEventListener(i,o),aje(r,e,i,o),t.set=s=>{e.value=s,e.dispatchEvent(Qjt(i))}}function Qjt(t){return typeof Event<"u"?new Event(t):{type:t}}function Kjt(t,e,n,r){const i=r.signal(n.signal),o=pc("div",{class:Gjt}),s=n.input==="radio"?o:o.appendChild(pc("label"));s.appendChild(pc("span",{class:Hjt},n.name||n.signal)),e.appendChild(o);let a=Zjt;switch(n.input){case"checkbox":a=Jjt;break;case"select":a=e4t;break;case"radio":a=t4t;break;case"range":a=n4t;break}a(t,s,n,i)}function Zjt(t,e,n,r){const i=pc("input");for(const o in n)o!=="signal"&&o!=="element"&&i.setAttribute(o==="input"?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",()=>t.update(i.value)),t.elements=[i],t.set=o=>i.value=o}function Jjt(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=pc("input",i);e.appendChild(o),o.addEventListener("change",()=>t.update(o.checked)),t.elements=[o],t.set=s=>o.checked=!!s||null}function e4t(t,e,n,r){const i=pc("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const l={value:s};T5(s,r)&&(l.selected=!0),i.appendChild(pc("option",l,(o[a]||s)+""))}),e.appendChild(i),i.addEventListener("change",()=>{t.update(n.options[i.selectedIndex])}),t.elements=[i],t.set=s=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:s};T5(s,r)&&(l.checked=!0);const c=pc("input",l);c.addEventListener("change",()=>t.update(s));const u=pc("label",{},(o[a]||s)+"");return u.prepend(c),i.appendChild(u),c}),t.set=s=>{const a=t.elements,l=a.length;for(let c=0;c{l.textContent=a.value,t.update(+a.value)};a.addEventListener("input",c),a.addEventListener("change",c),t.elements=[a],t.set=u=>{a.value=u,l.textContent=u}}function T5(t,e){return t===e||t+""==e+""}function lje(t,e,n,r,i,o){return e=e||new r(t.loader()),e.initialize(n,oje(t),sje(t),n6(t),i,o).background(t.background())}function rse(t,e){return e?function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}:null}function r4t(t,e,n,r){const i=new r(t.loader(),rse(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,n6(t),t);return e&&e.handlers().forEach(o=>{i.on(o.type,o.handler)}),i}function i4t(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,o=WB(r);t=n._el=t?jV(n,t,!0):null,kjt(n),o||n.error("Unrecognized renderer type: "+r);const s=o.handler||SR,a=t?o.renderer:o.headless;return n._renderer=a?lje(n,n._renderer,t,a):null,n._handler=r4t(n,n._handler,t,s),n._redraw=!0,t&&i!=="none"&&(e=e?n._elBind=jV(n,e,!0):t.appendChild(pc("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&i!=="container"&&(l.element=jV(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{Xjt(n,l.element||e,l)})),n}function jV(t,e,n){if(typeof e=="string")if(typeof document<"u"){if(e=document.querySelector(e),!e)return t.error("Signal bind element not found: "+e),null}else return t.error("DOM document instance not found."),null;if(e&&n)try{e.textContent=""}catch(r){e=null,t.error(r)}return e}const s2=t=>+t||0,o4t=t=>({top:t,bottom:t,left:t,right:t});function Yve(t){return ht(t)?{top:s2(t.top),bottom:s2(t.bottom),left:s2(t.left),right:s2(t.right)}:o4t(s2(t))}async function ise(t,e,n,r){const i=WB(e),o=i&&i.headless;return o||je("Unrecognized renderer type: "+e),await t.runAsync(),lje(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}async function s4t(t,e){t!==gv.Canvas&&t!==gv.SVG&&t!==gv.PNG&&je("Unrecognized image type: "+t);const n=await ise(this,t,e);return t===gv.SVG?a4t(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function a4t(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}async function l4t(t,e){return(await ise(this,gv.Canvas,t,e)).canvas()}async function c4t(t){return(await ise(this,gv.SVG,t)).svg()}function u4t(t,e,n){return nje(t,jS,UA,n).parse(e)}function f4t(t){var e=this._runtime.scales;return vt(e,t)||je("Unrecognized scale or projection: "+t),e[t].value}var cje="width",uje="height",ose="padding",Qve={skip:!0};function fje(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===ose?r.left+r.right:0)}function dje(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===ose?r.top+r.bottom:0)}function d4t(t){var e=t._signals,n=e[cje],r=e[uje],i=e[ose];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,a=>{t._width=a.size,t._viewWidth=fje(t,a.size),o()},{size:n}),t._resizeHeight=t.add(null,a=>{t._height=a.size,t._viewHeight=dje(t,a.size),o()},{size:r});const s=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,s.rank=i.rank+1}function h4t(t,e,n,r,i,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(cje,n,Qve),s._resizeWidth.skip(!0)),s.height()!==r&&(a=1,s.signal(uje,r,Qve),s._resizeHeight.skip(!0)),s._viewWidth!==t&&(s._resize=1,s._viewWidth=t),s._viewHeight!==e&&(s._resize=1,s._viewHeight=e),(s._origin[0]!==i[0]||s._origin[1]!==i[1])&&(s._resize=1,s._origin=i),a&&s.run("enter"),o&&s.runAfter(l=>l.resize())},!1,1)}function p4t(t){return this._runtime.getState(t||{data:g4t,signals:m4t,recurse:!0})}function g4t(t,e){return e.modified&&We(e.input.value)&&!t.startsWith("_:vega:_")}function m4t(t,e){return!(t==="parent"||e instanceof jS.proxy)}function v4t(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},e=>{e._trigger=!0}),this}function y4t(t,e){function n(r){t({timestamp:Date.now(),elapsed:r})}this._timers.push(Y$t(n,e))}function x4t(t,e,n,r){const i=t.element();i&&i.setAttribute("title",b4t(r))}function b4t(t){return t==null?"":We(t)?hje(t):ht(t)&&!Nv(t)?w4t(t):t+""}function w4t(t){return Object.keys(t).map(e=>{const n=t[e];return e+": "+(We(n)?hje(n):pje(n))}).join(` -`)}function hje(t){return"["+t.map(pje).join(", ")+"]"}function pje(t){return We(t)?"[…]":ht(t)&&!Nv(t)?"{…}":t}function _4t(){if(this.renderer()==="canvas"&&this._renderer._canvas){let t=null;const e=()=>{t!=null&&t();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",e),t=()=>{n.removeEventListener("change",e)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};e()}}function gje(t,e){const n=this;if(e=e||{},z_.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),e.logLevel!=null&&n.logLevel(e.logLevel),e.locale||t.locale){const o=cn({},t.locale,e.locale);n.locale(s$e(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||gv.Canvas,n._scenegraph=new cNe;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||x4t,n._redraw=!0,n._handler=new SR().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=jjt(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=u4t(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map(o=>({state:null,param:cn({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=fje(n,n._width),n._viewHeight=dje(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,d4t(n),Ajt(n),Pjt(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind),e.watchPixelRatio&&n._watchPixelRatio()}function eL(t,e){return vt(t._signals,e)?t._signals[e]:je("Unrecognized signal name: "+rt(e))}function mje(t,e){const n=(t._targets||[]).filter(r=>r._update&&r._update.handler===e);return n.length?n[0]:null}function Kve(t,e,n,r){let i=mje(n,r);return i||(i=rse(t,()=>r(e,n.value)),i.handler=r,t.on(n,null,i)),t}function Zve(t,e,n){const r=mje(e,n);return r&&e._targets.remove(r),t}it(gje,z_,{async evaluate(t,e,n){if(await z_.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,Ijt(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&h3(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=t!=null?t+"":null;return e!==this._desc&&ije(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const r=eL(this,t);return arguments.length===1?r.value:this.update(r,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",Yve(t)):Yve(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(WB(t)||je("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(z_.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(eL(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:h4t,addEventListener(t,e,n){let r=e;return n&&n.trap===!1||(r=rse(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n=this._handler.handlers(t),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,t===o&&(e===i||e===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.includes(t)||e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return Kve(this,t,eL(this,t),e)},removeSignalListener(t,e){return Zve(this,eL(this,t),e)},addDataListener(t,e){return Kve(this,t,E5(this,t).values,e)},removeDataListener(t,e){return Zve(this,E5(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=kY(this,null);this._globalCursor=!!t,e&&kY(this,e)}return this}else return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:y4t,events:Ujt,finalize:Vjt,hover:Wjt,data:Mjt,change:t6,insert:Rjt,remove:Djt,scale:f4t,initialize:i4t,toImageURL:s4t,toCanvas:l4t,toSVG:c4t,getState:p4t,setState:v4t,_watchPixelRatio:_4t});const S4t="view",k5="[",A5="]",vje="{",yje="}",C4t=":",xje=",",O4t="@",E4t=">",T4t=/[[\]{}]/,k4t={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let bje,wje;function Qy(t,e,n){return bje=e||S4t,wje=n||k4t,_je(t.trim()).map(AY)}function A4t(t){return wje[t]}function gk(t,e,n,r,i){const o=t.length;let s=0,a;for(;e=0?--s:r&&r.indexOf(a)>=0&&++s}return e}function _je(t){const e=[],n=t.length;let r=0,i=0;for(;i' after between selector: "+t;r=r.map(AY);const i=AY(t.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function M4t(t){const e={source:bje},n=[];let r=[0,0],i=0,o=0,s=t.length,a=0,l,c;if(t[s-1]===yje){if(a=t.lastIndexOf(vje),a>=0){try{r=R4t(t.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+t}t=t.slice(0,a).trim(),s=t.length}else throw"Unmatched right brace: "+t;a=0}if(!s)throw t;if(t[0]===O4t&&(i=++a),l=gk(t,a,C4t),l1?(e.type=n[1],i?e.markname=n[0].slice(1):A4t(n[0])?e.marktype=n[0]:e.source=n[0]):e.type=n[0],e.type.slice(-1)==="!"&&(e.consume=!0,e.type=e.type.slice(0,-1)),c!=null&&(e.filter=c),r[0]&&(e.throttle=r[0]),r[1]&&(e.debounce=r[1]),e}function R4t(t){const e=t.split(xje);if(!t.length||e.length>2)throw t;return e.map(n=>{const r=+n;if(r!==r)throw t;return r})}function D4t(t){return ht(t)?t:{type:t||"pad"}}const a2=t=>+t||0,I4t=t=>({top:t,bottom:t,left:t,right:t});function L4t(t){return ht(t)?t.signal?t:{top:a2(t.top),bottom:a2(t.bottom),left:a2(t.left),right:a2(t.right)}:I4t(a2(t))}const jo=t=>ht(t)&&!We(t)?cn({},t):{value:t};function Jve(t,e,n,r){return n!=null?(ht(n)&&!We(n)||We(n)&&n.length&&ht(n[0])?t.update[e]=n:t[r||"enter"][e]={value:n},1):0}function Cs(t,e,n){for(const r in e)Jve(t,r,e[r]);for(const r in n)Jve(t,r,n[r],"update")}function RO(t,e,n){for(const r in e)n&&vt(n,r)||(t[r]=cn(t[r]||{},e[r]));return t}function Ww(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const sse="mark",ase="frame",lse="scope",$4t="axis",F4t="axis-domain",N4t="axis-grid",z4t="axis-label",j4t="axis-tick",B4t="axis-title",U4t="legend",W4t="legend-band",V4t="legend-entry",G4t="legend-gradient",Sje="legend-label",H4t="legend-symbol",q4t="legend-title",X4t="title",Y4t="title-text",Q4t="title-subtitle";function K4t(t,e,n,r,i){const o={},s={};let a,l,c,u;l="lineBreak",e==="text"&&i[l]!=null&&!Ww(l,t)&&BV(o,l,i[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),u=n===ase?i.group:n===sse?cn({},i.mark,i[e]):null;for(l in u)c=Ww(l,t)||(l==="fill"||l==="stroke")&&(Ww("fill",t)||Ww("stroke",t)),c||BV(o,l,u[l]);pt(r).forEach(f=>{const d=i.style&&i.style[f];for(const h in d)Ww(h,t)||BV(o,h,d[h])}),t=cn({},t);for(l in o)u=o[l],u.signal?(a=a||{})[l]=u:s[l]=u;return t.enter=cn(s,t.enter),a&&(t.update=cn(a,t.update)),t}function BV(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const Cje=t=>gt(t)?rt(t):t.signal?`(${t.signal})`:Oje(t);function r6(t){if(t.gradient!=null)return J4t(t);let e=t.signal?`(${t.signal})`:t.color?Z4t(t.color):t.field!=null?Oje(t.field):t.value!==void 0?rt(t.value):void 0;return t.scale!=null&&(e=eBt(t,e)),e===void 0&&(e=null),t.exponent!=null&&(e=`pow(${e},${M3(t.exponent)})`),t.mult!=null&&(e+=`*${M3(t.mult)}`),t.offset!=null&&(e+=`+${M3(t.offset)}`),t.round&&(e=`round(${e})`),e}const tL=(t,e,n,r)=>`(${t}(${[e,n,r].map(r6).join(",")})+'')`;function Z4t(t){return t.c?tL("hcl",t.h,t.c,t.l):t.h||t.s?tL("hsl",t.h,t.s,t.l):t.l||t.a?tL("lab",t.l,t.a,t.b):t.r||t.g||t.b?tL("rgb",t.r,t.g,t.b):null}function J4t(t){const e=[t.start,t.stop,t.count].map(n=>n==null?null:rt(n));for(;e.length&&$n(e)==null;)e.pop();return e.unshift(Cje(t.gradient)),`gradient(${e.join(",")})`}function M3(t){return ht(t)?"("+r6(t)+")":t}function Oje(t){return Eje(ht(t)?t:{datum:t})}function Eje(t){let e,n,r;if(t.signal)e="datum",r=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(r=t.parent,e+=".datum"):r=t.group}else t.datum?(e="datum",r=t.datum):je("Invalid field reference: "+rt(t));return t.signal||(r=gt(r)?Wh(r).map(rt).join("]["):Eje(r)),e+"["+r+"]"}function eBt(t,e){const n=Cje(t.scale);return t.range!=null?e=`lerp(_range(${n}), ${+t.range})`:(e!==void 0&&(e=`_scale(${n}, ${e})`),t.band&&(e=(e?e+"+":"")+`_bandwidth(${n})`+(+t.band==1?"":"*"+M3(t.band)),t.extra&&(e=`(datum.extra ? _scale(${n}, datum.extra.value) : ${e})`)),e==null&&(e="0")),e}function tBt(t){let e="";return t.forEach(n=>{const r=r6(n);e+=n.test?`(${n.test})?${r}:`:r}),$n(e)===":"&&(e+="null"),e}function Tje(t,e,n,r,i,o){const s={};o=o||{},o.encoders={$encode:s},t=K4t(t,e,n,r,i.config);for(const a in t)s[a]=nBt(t[a],e,o,i);return o}function nBt(t,e,n,r){const i={},o={};for(const s in t)t[s]!=null&&(i[s]=iBt(rBt(t[s]),r,n,o));return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function rBt(t){return We(t)?tBt(t):r6(t)}function iBt(t,e,n,r){const i=Dh(t,e);return i.$fields.forEach(o=>r[o]=1),cn(n,i.$params),i.$expr}const oBt="outer",sBt=["value","update","init","react","bind"];function eye(t,e){je(t+' for "outer" push: '+rt(e))}function kje(t,e){const n=t.name;if(t.push===oBt)e.signals[n]||eye("No prior signal definition",n),sBt.forEach(r=>{t[r]!==void 0&&eye("Invalid property ",r)});else{const r=e.addSignal(n,t.value);t.react===!1&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function PY(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function i6(t,e,n,r){return new PY(t,e,n,r)}function P5(t,e){return i6("operator",t,e)}function zt(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function WA(t,e){return e?{$field:t,$name:e}:{$field:t}}const MY=WA("key");function tye(t,e){return{$compare:t,$order:e}}function aBt(t,e){const n={$key:t};return e&&(n.$flat=!0),n}const lBt="ascending",cBt="descending";function uBt(t){return ht(t)?(t.order===cBt?"-":"+")+o6(t.op,t.field):""}function o6(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const cse="scope",RY="view";function Co(t){return t&&t.signal}function fBt(t){return t&&t.expr}function R3(t){if(Co(t))return!0;if(ht(t)){for(const e in t)if(R3(t[e]))return!0}return!1}function df(t,e){return t??e}function Ux(t){return t&&t.signal||t}const nye="timer";function VA(t,e){return(t.merge?hBt:t.stream?pBt:t.type?gBt:je("Invalid stream specification: "+rt(t)))(t,e)}function dBt(t){return t===cse?RY:t||RY}function hBt(t,e){const n=t.merge.map(i=>VA(i,e)),r=use({merge:n},t,e);return e.addStream(r).id}function pBt(t,e){const n=VA(t.stream,e),r=use({stream:n},t,e);return e.addStream(r).id}function gBt(t,e){let n;t.type===nye?(n=e.event(nye,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(dBt(t.source),t.type);const r=use({stream:n},t,e);return Object.keys(r).length===1?n:e.addStream(r).id}function use(t,e,n){let r=e.between;return r&&(r.length!==2&&je('Stream "between" parameter must have 2 entries: '+rt(e)),t.between=[VA(r[0],n),VA(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(mBt(e.marktype,e.markname,e.markrole)),e.source===cse&&r.push("inScope(event.item)"),r.length&&(t.filter=Dh("("+r.join(")&&(")+")",n).$expr),(r=e.throttle)!=null&&(t.throttle=+r),(r=e.debounce)!=null&&(t.debounce=+r),e.consume&&(t.consume=!0),t}function mBt(t,e,n){const r="event.item";return r+(t&&t!=="*"?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}const vBt={code:"_.$value",ast:{type:"Identifier",value:"value"}};function yBt(t,e,n){const r=t.encode,i={target:n};let o=t.events,s=t.update,a=[];o||je("Signal update missing events specification."),gt(o)&&(o=Qy(o,e.isSubscope()?cse:RY)),o=pt(o).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[bBt(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),r!=null&&(s&&je("Signal encode and update are mutually exclusive."),s="encode(item(),"+rt(r)+")"),i.update=gt(s)?Dh(s,e):s.expr!=null?Dh(s.expr,e):s.value!=null?s.value:s.signal!=null?{$expr:vBt,$params:{$value:e.signalRef(s.signal)}}:je("Invalid signal update specification."),t.force&&(i.options={force:!0}),a.forEach(l=>e.addUpdate(cn(xBt(l,e),i)))}function xBt(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):VA(t,e)}}function bBt(t){return{signal:"["+t.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}function wBt(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?je("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=Dh(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach(i=>yBt(i,e,n.id))}const Pr=t=>(e,n,r)=>i6(t,n,e||void 0,r),Aje=Pr("aggregate"),_Bt=Pr("axisticks"),Pje=Pr("bound"),id=Pr("collect"),rye=Pr("compare"),SBt=Pr("datajoin"),Mje=Pr("encode"),CBt=Pr("expression"),OBt=Pr("facet"),EBt=Pr("field"),TBt=Pr("key"),kBt=Pr("legendentries"),ABt=Pr("load"),PBt=Pr("mark"),MBt=Pr("multiextent"),RBt=Pr("multivalues"),DBt=Pr("overlap"),IBt=Pr("params"),Rje=Pr("prefacet"),LBt=Pr("projection"),$Bt=Pr("proxy"),FBt=Pr("relay"),Dje=Pr("render"),NBt=Pr("scale"),m1=Pr("sieve"),zBt=Pr("sortitems"),Ije=Pr("viewlayout"),jBt=Pr("values");let BBt=0;const Lje={min:"min",max:"max",count:"sum"};function UBt(t,e){const n=t.type||"linear";wFe(n)||je("Unrecognized scale type: "+rt(n)),e.addScale(t.name,{type:n,domain:void 0})}function WBt(t,e){const n=e.getScale(t.name).params;let r;n.domain=$je(t.domain,t,e),t.range!=null&&(n.range=Nje(t,e,n)),t.interpolate!=null&&JBt(t.interpolate,n),t.nice!=null&&(n.nice=ZBt(t.nice,e)),t.bins!=null&&(n.bins=KBt(t.bins,e));for(r in t)vt(n,r)||r==="name"||(n[r]=ou(t[r],e))}function ou(t,e){return ht(t)?t.signal?e.signalRef(t.signal):je("Unsupported object: "+rt(t)):t}function D3(t,e){return t.signal?e.signalRef(t.signal):t.map(n=>ou(n,e))}function s6(t){je("Can not find data set: "+rt(t))}function $je(t,e,n){if(!t){(e.domainMin!=null||e.domainMax!=null)&&je("No scale domain defined for domainMin/domainMax to override.");return}return t.signal?n.signalRef(t.signal):(We(t)?VBt:t.fields?HBt:GBt)(t,e,n)}function VBt(t,e,n){return t.map(r=>ou(r,n))}function GBt(t,e,n){const r=n.getData(t.data);return r||s6(t.data),GS(e.type)?r.valuesRef(n,t.field,Fje(t.sort,!1)):CFe(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function HBt(t,e,n){const r=t.data,i=t.fields.reduce((o,s)=>(s=gt(s)?{data:r,field:s}:We(s)||s.signal?qBt(s,n):s,o.push(s),o),[]);return(GS(e.type)?XBt:CFe(e.type)?YBt:QBt)(t,n,i)}function qBt(t,e){const n="_:vega:_"+BBt++,r=id({});if(We(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+rt(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,m1({})]),{data:n,field:"data"}}function XBt(t,e,n){const r=Fje(t.sort,!0);let i,o;const s=n.map(c=>{const u=e.getData(c.data);return u||s6(c.data),u.countsRef(e,c.field,r)}),a={groupby:MY,pulse:s};r&&(i=r.op||"count",o=r.field?o6(i,r.field):"count",a.ops=[Lje[i]],a.fields=[e.fieldRef(o)],a.as=[o]),i=e.add(Aje(a));const l=e.add(id({pulse:zt(i)}));return o=e.add(jBt({field:MY,sort:e.sortRef(r),pulse:zt(l)})),zt(o)}function Fje(t,e){return t&&(!t.field&&!t.op?ht(t)?t.field="key":t={field:"key"}:!t.field&&t.op!=="count"?je("No field provided for sort aggregate op: "+t.op):e&&t.field&&t.op&&!Lje[t.op]&&je("Multiple domain scales can not be sorted using "+t.op)),t}function YBt(t,e,n){const r=n.map(i=>{const o=e.getData(i.data);return o||s6(i.data),o.domainRef(e,i.field)});return zt(e.add(RBt({values:r})))}function QBt(t,e,n){const r=n.map(i=>{const o=e.getData(i.data);return o||s6(i.data),o.extentRef(e,i.field)});return zt(e.add(MBt({extents:r})))}function KBt(t,e){return t.signal||We(t)?D3(t,e):e.objectProperty(t)}function ZBt(t,e){return t.signal?e.signalRef(t.signal):ht(t)?{interval:ou(t.interval),step:ou(t.step)}:ou(t)}function JBt(t,e){e.interpolate=ou(t.type||t),t.gamma!=null&&(e.interpolateGamma=ou(t.gamma))}function Nje(t,e,n){const r=e.config.range;let i=t.range;if(i.signal)return e.signalRef(i.signal);if(gt(i)){if(r&&vt(r,i))return t=cn({},t,{range:r[i]}),Nje(t,e,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=GS(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:je("Unrecognized scale range value: "+rt(i))}else if(i.scheme){n.scheme=We(i.scheme)?D3(i.scheme,e):ou(i.scheme,e),i.extent&&(n.schemeExtent=D3(i.extent,e)),i.count&&(n.schemeCount=ou(i.count,e));return}else if(i.step){n.rangeStep=ou(i.step,e);return}else{if(GS(t.type)&&!We(i))return $je(i,t,e);We(i)||je("Unsupported range type: "+rt(i))}return i.map(o=>(We(o)?D3:ou)(o,e))}function e6t(t,e){const n=e.config.projection||{},r={};for(const i in t)i!=="name"&&(r[i]=DY(t[i],i,e));for(const i in n)r[i]==null&&(r[i]=DY(n[i],i,e));e.addProjection(t.name,r)}function DY(t,e,n){return We(t)?t.map(r=>DY(r,e,n)):ht(t)?t.signal?n.signalRef(t.signal):e==="fit"?t:je("Unsupported parameter object: "+rt(t)):t}const od="top",DO="left",IO="right",dy="bottom",zje="center",t6t="vertical",n6t="start",r6t="middle",i6t="end",IY="index",fse="label",o6t="offset",eC="perc",s6t="perc2",hu="value",RR="guide-label",dse="guide-title",a6t="group-title",l6t="group-subtitle",iye="symbol",I3="gradient",LY="discrete",$Y="size",c6t="shape",u6t="fill",f6t="stroke",d6t="strokeWidth",h6t="strokeDash",p6t="opacity",hse=[$Y,c6t,u6t,f6t,d6t,h6t,p6t],DR={name:1,style:1,interactive:1},jn={value:0},pu={value:1},a6="group",jje="rect",pse="rule",g6t="symbol",v1="text";function GA(t){return t.type=a6,t.interactive=t.interactive||!1,t}function Pl(t,e){const n=(r,i)=>df(t[r],df(e[r],i));return n.isVertical=r=>t6t===df(t.direction,e.direction||(r?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>df(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>df(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>df(t.columns,df(e.columns,+n.isVertical(!0))),n}function Bje(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function m6t(t,e,n){const r=e.config.style[n];return r&&r[t]}function l6(t,e,n){return`item.anchor === '${n6t}' ? ${t} : item.anchor === '${i6t}' ? ${e} : ${n}`}const gse=l6(rt(DO),rt(IO),rt(zje));function v6t(t){const e=t("tickBand");let n=t("tickOffset"),r,i;return e?e.signal?(r={signal:`(${e.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${e.signal}) === 'extent'`},ht(n)||(n={signal:`(${e.signal}) === 'extent' ? 0 : ${n}`})):e==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=t("bandPosition"),i=t("tickExtra")),{extra:i,band:r,offset:n}}function Uje(t,e){return e?t?ht(t)?Object.assign({},t,{offset:Uje(t.offset,e)}):{value:t,offset:e}:e:t}function Tc(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=RO(t.encode,e,DR)):t.interactive=!1,t}function y6t(t,e,n,r){const i=Pl(t,n),o=i.isVertical(),s=i.gradientThickness(),a=i.gradientLength();let l,c,u,f,d;o?(c=[0,1],u=[0,0],f=s,d=a):(c=[0,0],u=[1,0],f=a,d=s);const h={enter:l={opacity:jn,x:jn,y:jn,width:jo(f),height:jo(d)},update:cn({},l,{opacity:pu,fill:{gradient:e,start:c,stop:u}}),exit:{opacity:jn}};return Cs(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),Tc({type:jje,role:G4t,encode:h},r)}function x6t(t,e,n,r,i){const o=Pl(t,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let c,u,f,d,h="";s?(c="y",f="y2",u="x",d="width",h="1-"):(c="x",f="x2",u="y",d="height");const p={opacity:jn,fill:{scale:e,field:hu}};p[c]={signal:h+"datum."+eC,mult:l},p[u]=jn,p[f]={signal:h+"datum."+s6t,mult:l},p[d]=jo(a);const g={enter:p,update:cn({},p,{opacity:pu}),exit:{opacity:jn}};return Cs(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Tc({type:jje,role:W4t,key:hu,from:i,encode:g},r)}const b6t=`datum.${eC}<=0?"${DO}":datum.${eC}>=1?"${IO}":"${zje}"`,w6t=`datum.${eC}<=0?"${dy}":datum.${eC}>=1?"${od}":"${r6t}"`;function oye(t,e,n,r){const i=Pl(t,e),o=i.isVertical(),s=jo(i.gradientThickness()),a=i.gradientLength();let l=i("labelOverlap"),c,u,f,d,h="";const p={enter:c={opacity:jn},update:u={opacity:pu,text:{field:fse}},exit:{opacity:jn}};return Cs(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:df(t.labelLimit,e.gradientLabelLimit)}),o?(c.align={value:"left"},c.baseline=u.baseline={signal:w6t},f="y",d="x",h="1-"):(c.align=u.align={signal:b6t},c.baseline={value:"top"},f="x",d="y"),c[f]=u[f]={signal:h+"datum."+eC,mult:a},c[d]=u[d]=s,s.offset=df(t.labelOffset,e.gradientLabelOffset)||0,l=l?{separation:i("labelSeparation"),method:l,order:"datum."+IY}:void 0,Tc({type:v1,role:Sje,style:RR,key:hu,from:r,encode:p,overlap:l},n)}function _6t(t,e,n,r,i){const o=Pl(t,e),s=n.entries,a=!!(s&&s.interactive),l=s?s.name:void 0,c=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${o6t} : datum.${$Y}`,h=c?jo(c):{field:$Y},p=`datum.${IY}`,g=`max(1, ${i})`;let m,v,y,x,b;h.mult=.5,m={enter:v={opacity:jn,x:{signal:d,mult:.5,offset:u},y:h},update:y={opacity:pu,x:v.x,y:v.y},exit:{opacity:jn}};let w=null,_=null;t.fill||(w=e.symbolBaseFillColor,_=e.symbolBaseStrokeColor),Cs(m,{fill:o("symbolFillColor",w),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",_),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),hse.forEach(E=>{t[E]&&(y[E]=v[E]={scale:t[E],field:hu})});const S=Tc({type:g6t,role:H4t,key:hu,from:f,clip:c?!0:void 0,encode:m},n.symbols),O=jo(u);O.offset=o("labelOffset"),m={enter:v={opacity:jn,x:{signal:d,offset:O},y:h},update:y={opacity:pu,text:{field:fse},x:v.x,y:v.y},exit:{opacity:jn}},Cs(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const k=Tc({type:v1,role:Sje,style:RR,key:hu,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!c},width:jn,height:c?jo(c):jn,opacity:jn},exit:{opacity:jn},update:y={opacity:pu,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(x=`ceil(item.mark.items.length / ${g})`,y.row.signal=`${p}%${x}`,y.column.signal=`floor(${p} / ${x})`,b={field:["row",p]}):(y.row.signal=`floor(${p} / ${g})`,y.column.signal=`${p} % ${g}`,b={field:p}),y.column.signal=`(${i})?${y.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:IY}},GA({role:lse,from:r,encode:RO(m,s,DR),marks:[S,k],name:l,interactive:a,sort:b})}function S6t(t,e){const n=Pl(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const mse='item.orient === "left"',vse='item.orient === "right"',c6=`(${mse} || ${vse})`,C6t=`datum.vgrad && ${c6}`,O6t=l6('"top"','"bottom"','"middle"'),E6t=l6('"right"','"left"','"center"'),T6t=`datum.vgrad && ${vse} ? (${E6t}) : (${c6} && !(datum.vgrad && ${mse})) ? "left" : ${gse}`,k6t=`item._anchor || (${c6} ? "middle" : "start")`,A6t=`${C6t} ? (${mse} ? -90 : 90) : 0`,P6t=`${c6} ? (datum.vgrad ? (${vse} ? "bottom" : "top") : ${O6t}) : "top"`;function M6t(t,e,n,r){const i=Pl(t,e),o={enter:{opacity:jn},update:{opacity:pu,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:jn}};return Cs(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:k6t},angle:{signal:A6t},align:{signal:T6t},baseline:{signal:P6t},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),Tc({type:v1,role:q4t,style:dse,from:r,encode:o},n)}function R6t(t,e){let n;return ht(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+sye(t.path)+")":t.sphere&&(n="geoShape("+sye(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function sye(t){return ht(t)&&t.signal?t.signal:rt(t)}function Wje(t){const e=t.role||"";return e.startsWith("axis")||e.startsWith("legend")||e.startsWith("title")?e:t.type===a6?lse:e||sse}function D6t(t){return{marktype:t.type,name:t.name||void 0,role:t.role||Wje(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function I6t(t,e){return t&&t.signal?e.signalRef(t.signal):t!==!1}function yse(t,e){const n=x$e(t.type);n||je("Unrecognized transform type: "+rt(t.type));const r=i6(n.type.toLowerCase(),null,Vje(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function Vje(t,e,n){const r={},i=t.params.length;for(let o=0;oaye(t,o,n)):aye(t,i,n)}function aye(t,e,n){const r=t.type;if(Co(e))return cye(r)?je("Expression references can not be signals."):UV(r)?n.fieldRef(e):uye(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||UV(r);return i&&N6t(e)?n.exprRef(e.expr,e.as):i&&z6t(e)?WA(e.field,e.as):cye(r)?Dh(e,n):j6t(r)?zt(n.getData(e).values):UV(r)?WA(e):uye(r)?n.compareRef(e):e}}function $6t(t,e,n){return gt(e.from)||je('Lookup "from" parameter must be a string literal.'),n.getData(e.from).lookupRef(n,e.key)}function F6t(t,e,n){const r=e[t.name];return t.array?(We(r)||je("Expected an array of sub-parameters. Instead: "+rt(r)),r.map(i=>lye(t,i,n))):lye(t,r,n)}function lye(t,e,n){const r=t.params.length;let i;for(let s=0;st&&t.expr,z6t=t=>t&&t.field,j6t=t=>t==="data",cye=t=>t==="expr",UV=t=>t==="field",uye=t=>t==="compare";function B6t(t,e,n){let r,i,o,s,a;return t?(r=t.facet)&&(e||je("Only group marks can be faceted."),r.field!=null?s=a=L3(r,n):(t.data?a=zt(n.getData(t.data).aggregate):(o=yse(cn({type:"aggregate",groupby:pt(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=L3(r,n),s=a=zt(n.add(o))),i=n.keyRef(r.groupby,!0))):s=zt(n.add(id(null,[{}]))),s||(s=L3(t,n)),{key:i,pulse:s,parent:a}}function L3(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:zt(e.getData(t.data).output)}function Cb(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}Cb.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=e[n-2];let o=e[0],s=null,a=1;for(o&&o.type==="load"&&(o=e[1]),t.add(e[0]);af??"null").join(",")+"),0)",u=Dh(c,e);l.update=u.$expr,l.params=u.$params}function u6(t,e){const n=Wje(t),r=t.type===a6,i=t.from&&t.from.facet,o=t.overlap;let s=t.layout||n===lse||n===ase,a,l,c,u,f,d,h;const p=n===sse||s||i,g=B6t(t.from,r,e);l=e.add(SBt({key:g.key||(t.key?WA(t.key):void 0),pulse:g.pulse,clean:!r}));const m=zt(l);l=c=e.add(id({pulse:m})),l=e.add(PBt({markdef:D6t(t),interactive:I6t(t.interactive,e),clip:R6t(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:zt(l)}));const v=zt(l);l=u=e.add(Mje(Tje(t.encode,t.type,n,t.style,e,{mod:!1,pulse:v}))),l.params.parent=e.encode(),t.transform&&t.transform.forEach(_=>{const S=yse(_,e),O=S.metadata;(O.generates||O.changes)&&je("Mark transforms should not generate new data."),O.nomod||(u.params.mod=!0),S.params.pulse=zt(l),e.add(l=S)}),t.sort&&(l=e.add(zBt({sort:e.compareRef(t.sort),pulse:zt(l)})));const y=zt(l);(i||s)&&(s=e.add(Ije({layout:e.objectProperty(t.layout),legends:e.legends,mark:v,pulse:y})),d=zt(s));const x=e.add(Pje({mark:v,pulse:d||y}));h=zt(x),r&&(p&&(a=e.operators,a.pop(),s&&a.pop()),e.pushState(y,d||h,m),i?U6t(t,e,g):p?W6t(t,e,g):e.parse(t),e.popState(),p&&(s&&a.push(s),a.push(x))),o&&(h=V6t(o,h,e));const b=e.add(Dje({pulse:h})),w=e.add(m1({pulse:zt(b)},void 0,e.parent()));t.name!=null&&(f=t.name,e.addData(f,new Cb(e,c,b,w)),t.on&&t.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&je("Marks only support modify triggers."),Hje(_,e,f)}))}function V6t(t,e,n){const r=t.method,i=t.bound,o=t.separation,s={separation:Co(o)?n.signalRef(o.signal):o,method:Co(r)?n.signalRef(r.signal):r,pulse:e};if(t.order&&(s.sort=n.compareRef({field:t.order})),i){const a=i.tolerance;s.boundTolerance=Co(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(i.scale),s.boundOrient=i.orient}return zt(n.add(DBt(s)))}function G6t(t,e){const n=e.config.legend,r=t.encode||{},i=Pl(t,n),o=r.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,c={};let u=0,f,d,h;hse.forEach(x=>t[x]?(c[x]=t[x],u=u||t[x]):0),u||je("Missing valid scale for legend.");const p=H6t(t,e.scaleType(u)),g={title:t.title!=null,scales:c,type:p,vgrad:p!=="symbol"&&i.isVertical()},m=zt(e.add(id(null,[g]))),v={enter:{x:{value:0},y:{value:0}}},y=zt(e.add(kBt(d={type:p,scale:e.scaleRef(u),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return p===I3?(h=[y6t(t,u,n,r.gradient),oye(t,n,r.labels,y)],d.count=d.count||e.signalRef(`max(2,2*floor((${Ux(i.gradientLength())})/100))`)):p===LY?h=[x6t(t,u,n,r.gradient,y),oye(t,n,r.labels,y)]:(f=S6t(t,n),h=[_6t(t,n,r,y,Ux(f.columns))],d.size=Y6t(t,e,h[0].marks)),h=[GA({role:V4t,from:m,encode:v,marks:h,layout:f,interactive:a})],g.title&&h.push(M6t(t,n,r.title,m)),u6(GA({role:U4t,from:m,encode:RO(X6t(i,t,n),o,DR),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:s,interactive:a,style:l}),e)}function H6t(t,e){let n=t.type||iye;return!t.type&&q6t(t)===1&&(t.fill||t.stroke)&&(n=vie(e)?I3:TX(e)?LY:iye),n!==I3?n:TX(e)?LY:I3}function q6t(t){return hse.reduce((e,n)=>e+(t[n]?1:0),0)}function X6t(t,e,n){const r={enter:{},update:{}};return Cs(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}function Y6t(t,e,n){const r=Ux(dye("size",t,n)),i=Ux(dye("strokeWidth",t,n)),o=Ux(Q6t(n[1].encode,e,RR));return Dh(`max(ceil(sqrt(${r})+${i}),${o})`,e)}function dye(t,e,n){return e[t]?`scale("${e[t]}",datum)`:Bje(t,n[0].encode)}function Q6t(t,e,n){return Bje("fontSize",t)||m6t("fontSize",e,n)}const K6t=`item.orient==="${DO}"?-90:item.orient==="${IO}"?90:0`;function Z6t(t,e){t=gt(t)?{text:t}:t;const n=Pl(t,e.config.title),r=t.encode||{},i=r.group||{},o=i.name||void 0,s=i.interactive,a=i.style,l=[],c={},u=zt(e.add(id(null,[c])));return l.push(tUt(t,n,J6t(t),u)),t.subtitle&&l.push(nUt(t,n,r.subtitle,u)),u6(GA({role:X4t,from:u,encode:eUt(n,i),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),e)}function J6t(t){const e=t.encode;return e&&e.title||cn({name:t.name,interactive:t.interactive,style:t.style},e)}function eUt(t,e){const n={enter:{},update:{}};return Cs(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:gse},angle:{signal:K6t},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),RO(n,e,DR)}function tUt(t,e,n,r){const i={value:0},o=t.text,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Cs(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),Tc({type:v1,role:Y4t,style:a6t,from:r,encode:s},n)}function nUt(t,e,n,r){const i={value:0},o=t.subtitle,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Cs(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),Tc({type:v1,role:Q4t,style:l6t,from:r,encode:s},n)}function rUt(t,e){const n=[];t.transform&&t.transform.forEach(r=>{n.push(yse(r,e))}),t.on&&t.on.forEach(r=>{Hje(r,e,t.name)}),e.addDataPipeline(t.name,iUt(t,e,n))}function iUt(t,e,n){const r=[];let i=null,o=!1,s=!1,a,l,c,u,f;for(t.values?Co(t.values)||R3(t.format)?(r.push(hye(e,t)),r.push(i=x0())):r.push(i=x0({$ingest:t.values,$format:t.format})):t.url?R3(t.url)||R3(t.format)?(r.push(hye(e,t)),r.push(i=x0())):r.push(i=x0({$request:t.url,$format:t.format})):t.source&&(i=a=pt(t.source).map(d=>zt(e.getData(d).output)),r.push(null)),l=0,c=n.length;lt===dy||t===od,f6=(t,e,n)=>Co(t)?lUt(t.signal,e,n):t===DO||t===od?e:n,Bo=(t,e,n)=>Co(t)?sUt(t.signal,e,n):qje(t)?e:n,If=(t,e,n)=>Co(t)?aUt(t.signal,e,n):qje(t)?n:e,Xje=(t,e,n)=>Co(t)?cUt(t.signal,e,n):t===od?{value:e}:{value:n},oUt=(t,e,n)=>Co(t)?uUt(t.signal,e,n):t===IO?{value:e}:{value:n},sUt=(t,e,n)=>Yje(`${t} === '${od}' || ${t} === '${dy}'`,e,n),aUt=(t,e,n)=>Yje(`${t} !== '${od}' && ${t} !== '${dy}'`,e,n),lUt=(t,e,n)=>xse(`${t} === '${DO}' || ${t} === '${od}'`,e,n),cUt=(t,e,n)=>xse(`${t} === '${od}'`,e,n),uUt=(t,e,n)=>xse(`${t} === '${IO}'`,e,n),Yje=(t,e,n)=>(e=e!=null?jo(e):e,n=n!=null?jo(n):n,pye(e)&&pye(n)?(e=e?e.signal||rt(e.value):null,n=n?n.signal||rt(n.value):null,{signal:`${t} ? (${e}) : (${n})`}):[cn({test:t},e)].concat(n||[])),pye=t=>t==null||Object.keys(t).length===1,xse=(t,e,n)=>({signal:`${t} ? (${m_(e)}) : (${m_(n)})`}),fUt=(t,e,n,r,i)=>({signal:(r!=null?`${t} === '${DO}' ? (${m_(r)}) : `:"")+(n!=null?`${t} === '${dy}' ? (${m_(n)}) : `:"")+(i!=null?`${t} === '${IO}' ? (${m_(i)}) : `:"")+(e!=null?`${t} === '${od}' ? (${m_(e)}) : `:"")+"(null)"}),m_=t=>Co(t)?t.signal:t==null?null:rt(t),dUt=(t,e)=>e===0?0:Co(t)?{signal:`(${t.signal}) * ${e}`}:{value:t*e},W_=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function ow(t,e,n,r){let i;if(e&&vt(e,t))return e[t];if(vt(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r[dse][i]}else if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r[RR][i]}return null}function gye(t){const e={};for(const n of t)if(n)for(const r in n)e[r]=1;return Object.keys(e)}function hUt(t,e){var n=e.config,r=n.style,i=n.axis,o=e.scaleType(t.scale)==="band"&&n.axisBand,s=t.orient,a,l,c;if(Co(s)){const f=gye([n.axisX,n.axisY]),d=gye([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(c of f)a[c]=Bo(s,ow(c,n.axisX,i,r),ow(c,n.axisY,i,r));l={};for(c of d)l[c]=fUt(s.signal,ow(c,n.axisTop,i,r),ow(c,n.axisBottom,i,r),ow(c,n.axisLeft,i,r),ow(c,n.axisRight,i,r))}else a=s===od||s===dy?n.axisX:n.axisY,l=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||l||o?cn({},i,a,l,o):i}function pUt(t,e,n,r){const i=Pl(t,e),o=t.orient;let s,a;const l={enter:s={opacity:jn},update:a={opacity:pu},exit:{opacity:jn}};Cs(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const c=mye(t,0),u=mye(t,1);return s.x=a.x=Bo(o,c,jn),s.x2=a.x2=Bo(o,u),s.y=a.y=If(o,c,jn),s.y2=a.y2=If(o,u),Tc({type:pse,role:F4t,from:r,encode:l},n)}function mye(t,e){return{scale:t.scale,range:e}}function gUt(t,e,n,r,i){const o=Pl(t,e),s=t.orient,a=t.gridScale,l=f6(s,1,-1),c=mUt(t.offset,l);let u,f,d;const h={enter:u={opacity:jn},update:d={opacity:pu},exit:f={opacity:jn}};Cs(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:hu,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=Bo(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:c}:{value:0,offset:c},v=a?{scale:a,range:1,mult:l,offset:c}:cn(g,{mult:l,offset:c});return u.x=d.x=Bo(s,p,m),u.y=d.y=If(s,p,m),u.x2=d.x2=If(s,v),u.y2=d.y2=Bo(s,v),f.x=Bo(s,p),f.y=If(s,p),Tc({type:pse,role:N4t,key:hu,from:r,encode:h},n)}function mUt(t,e){if(e!==1)if(!ht(t))t=Co(e)?{signal:`(${e.signal}) * (${t||0})`}:e*(t||0);else{let n=t=cn({},t);for(;n.mult!=null;)if(ht(n.mult))n=n.mult=cn({},n.mult);else return n.mult=Co(e)?{signal:`(${n.mult}) * (${e.signal})`}:n.mult*e,t;n.mult=e}return t}function vUt(t,e,n,r,i,o){const s=Pl(t,e),a=t.orient,l=f6(a,-1,1);let c,u,f;const d={enter:c={opacity:jn},update:f={opacity:pu},exit:u={opacity:jn}};Cs(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=jo(i);h.mult=l;const p={scale:t.scale,field:hu,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=c.y=Bo(a,jn,p),f.y2=c.y2=Bo(a,h),u.x=Bo(a,p),f.x=c.x=If(a,jn,p),f.x2=c.x2=If(a,h),u.y=If(a,p),Tc({type:pse,role:j4t,key:hu,from:r,encode:d},n)}function WV(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function yUt(t,e,n,r,i,o){const s=Pl(t,e),a=t.orient,l=t.scale,c=f6(a,-1,1),u=Ux(s("labelFlush")),f=Ux(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=u===0||!!u,g;const m=jo(i);m.mult=c,m.offset=jo(s("labelPadding")||0),m.offset.mult=c;const v={scale:l,field:hu,band:.5,offset:Uje(o.offset,s("labelOffset"))},y=Bo(a,p?WV(l,u,'"left"','"right"','"center"'):{value:"center"},oUt(a,"left","right")),x=Bo(a,Xje(a,"bottom","top"),p?WV(l,u,'"top"','"bottom"','"middle"'):{value:"middle"}),b=WV(l,u,`-(${f})`,f,0);p=p&&f;const w={opacity:jn,x:Bo(a,v,m),y:If(a,v,m)},_={enter:w,update:g={opacity:pu,text:{field:fse},x:w.x,y:w.y,align:y,baseline:x},exit:{opacity:jn,x:w.x,y:w.y}};Cs(_,{dx:!d&&p?Bo(a,b):null,dy:!h&&p?If(a,b):null}),Cs(_,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const S=s("labelBound");let O=s("labelOverlap");return O=O||S?{separation:s("labelSeparation"),method:O,order:"datum.index",bound:S?{scale:l,orient:a,tolerance:S}:null}:void 0,g.align!==y&&(g.align=W_(g.align,y)),g.baseline!==x&&(g.baseline=W_(g.baseline,x)),Tc({type:v1,role:z4t,style:RR,key:hu,from:r,encode:_,overlap:O},n)}function xUt(t,e,n,r){const i=Pl(t,e),o=t.orient,s=f6(o,-1,1);let a,l;const c={enter:a={opacity:jn,anchor:jo(i("titleAnchor",null)),align:{signal:gse}},update:l=cn({},a,{opacity:pu,text:jo(t.title)}),exit:{opacity:jn}},u={signal:`lerp(range("${t.scale}"), ${l6(0,1,.5)})`};return l.x=Bo(o,u),l.y=If(o,u),a.angle=Bo(o,jn,dUt(s,90)),a.baseline=Bo(o,Xje(o,dy,od),{value:dy}),l.angle=a.angle,l.baseline=a.baseline,Cs(c,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),bUt(i,o,c,n),c.update.align=W_(c.update.align,a.align),c.update.angle=W_(c.update.angle,a.angle),c.update.baseline=W_(c.update.baseline,a.baseline),Tc({type:v1,role:B4t,style:dse,from:r,encode:c},n)}function bUt(t,e,n,r){const i=(a,l)=>a!=null?(n.update[l]=W_(jo(a),n.update[l]),!1):!Ww(l,r),o=i(t("titleX"),"x"),s=i(t("titleY"),"y");n.enter.auto=s===o?jo(s):Bo(e,jo(s),jo(o))}function wUt(t,e){const n=hUt(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,s=i.interactive,a=i.style,l=Pl(t,n),c=v6t(l),u={scale:t.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:t.title!=null},f=zt(e.add(id({},[u]))),d=zt(e.add(_Bt({scale:e.scaleRef(t.scale),extra:e.property(c.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),h=[];let p;return u.grid&&h.push(gUt(t,n,r.grid,d,c)),u.ticks&&(p=l("tickSize"),h.push(vUt(t,n,r.ticks,d,p,c))),u.labels&&(p=u.ticks?p:0,h.push(yUt(t,n,r.labels,d,p,c))),u.domain&&h.push(pUt(t,n,r.domain,f)),u.title&&h.push(xUt(t,n,r.title,f)),u6(GA({role:$4t,from:f,encode:RO(_Ut(l,t),i,DR),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),e)}function _Ut(t,e){const n={enter:{},update:{}};return Cs(n,{orient:t("orient"),offset:t("offset")||0,position:df(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:`abs(span(range("${e.scale}")))`},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function Qje(t,e,n){const r=pt(t.signals),i=pt(t.scales);return n||r.forEach(o=>kje(o,e)),pt(t.projections).forEach(o=>e6t(o,e)),i.forEach(o=>UBt(o,e)),pt(t.data).forEach(o=>rUt(o,e)),i.forEach(o=>WBt(o,e)),(n||r).forEach(o=>wBt(o,e)),pt(t.axes).forEach(o=>wUt(o,e)),pt(t.marks).forEach(o=>u6(o,e)),pt(t.legends).forEach(o=>G6t(o,e)),t.title&&Z6t(t.title,e),e.parseLambdas(),e}const SUt=t=>RO({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function CUt(t,e){const n=e.config,r=zt(e.root=e.add(P5())),i=OUt(t,n);i.forEach(c=>kje(c,e)),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(id()),s=e.add(Mje(Tje(SUt(t.encode),a6,ase,t.style,e,{pulse:zt(o)}))),a=e.add(Ije({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:zt(s)}));e.operators.pop(),e.pushState(zt(s),zt(a),null),Qje(t,e,i),e.operators.push(a);let l=e.add(Pje({mark:r,pulse:zt(a)}));return l=e.add(Dje({pulse:zt(l)})),l=e.add(m1({pulse:zt(l)})),e.addData("root",new Cb(e,o,o,l)),e}function c2(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function OUt(t,e){const n=s=>df(t[s],e[s]),r=[c2("background",n("background")),c2("autosize",D4t(n("autosize"))),c2("padding",L4t(n("padding"))),c2("width",n("width")||0),c2("height",n("height")||0)],i=r.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return pt(t.signals).forEach(s=>{vt(i,s.name)?s=cn(i[s.name],s):r.push(s),o[s.name]=s}),pt(e.signals).forEach(s=>{!vt(o,s.name)&&!vt(i,s.name)&&r.push(s)}),r}function Kje(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function vye(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}Kje.prototype=vye.prototype={parse(t){return Qje(t,this)},fork(){return new vye(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(e=>{e.$ref=t.id}),t.refs=null),t},proxy(t){const e=t instanceof PY?zt(t):t;return this.add($Bt({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;this.root&&(this.root.root=!0);for(t in this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(r,i,o){let s,a;r&&(s=r.data||(r.data={}),a=s[i]||(s[i]=[]),a.push(o))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(zt(this.add(m1({pulse:t})))),this._parent.push(e),this._lookup.push(n?zt(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return $n(this._parent)},encode(){return $n(this._encode)},lookup(){return $n(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if(gt(t))return WA(t,e);t.signal||je("Unsupported field reference: "+rt(t));const n=t.signal;let r=this.field[n];if(!r){const i={name:this.signalRef(n)};e&&(i.as=e),this.field[n]=r=zt(this.add(EBt(i)))}return r},compareRef(t){let e=!1;const n=o=>Co(o)?(e=!0,this.signalRef(o.signal)):fBt(o)?(e=!0,this.exprRef(o.expr)):o,r=pt(t.field).map(n),i=pt(t.order).map(n);return e?zt(this.add(rye({fields:r,orders:i}))):tye(r,i)},keyRef(t,e){let n=!1;const r=o=>Co(o)?(n=!0,zt(i[o.signal])):o,i=this.signals;return t=pt(t).map(r),n?zt(this.add(TBt({fields:t,flat:e}))):aBt(t,e)},sortRef(t){if(!t)return t;const e=o6(t.op,t.field),n=t.order||lBt;return n.signal?zt(this.add(rye({fields:e,orders:this.signalRef(n.signal)}))):tye(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},hasOwnSignal(t){return vt(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&je("Duplicate signal name: "+rt(t));const n=e instanceof PY?e:this.add(P5(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||je("Unrecognized signal name: "+rt(t)),this.signals[t]},signalRef(t){return this.signals[t]?zt(this.signals[t]):(vt(this.lambdas,t)||(this.lambdas[t]=this.add(P5(null))),zt(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e0?",":"")+(ht(i)?i.signal||bse(i):rt(i))}return n+"]"}function TUt(t){let e="{",n=0,r,i;for(r in t)i=t[r],e+=(++n>1?",":"")+rt(r)+":"+(ht(i)?i.signal||bse(i):rt(i));return e+"}"}function kUt(){const t="sans-serif",r="#4c78a8",i="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:t,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:t,fontSize:10},"guide-title":{fill:i,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:t,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function AUt(t,e,n){return ht(t)||je("Input Vega specification must be an object."),e=xO(kUt(),e,t.config),CUt(t,new Kje(e,n)).toRuntime()}var PUt="5.30.0";cn(jS,_kt,nIt,IIt,x$t,h3t,jFt,xFt,UFt,dNt,_Nt,ANt);const MUt=Object.freeze(Object.defineProperty({__proto__:null,Bounds:uo,CanvasHandler:SR,CanvasRenderer:VN,DATE:_l,DAY:qs,DAYOFYEAR:Mh,Dataflow:z_,Debug:BIe,Error:wne,EventStream:lB,Gradient:zFe,GroupItem:LB,HOURS:Cc,Handler:Uie,HybridHandler:PNe,HybridRenderer:NX,Info:jIe,Item:IB,MILLISECONDS:Vf,MINUTES:Oc,MONTH:Zs,Marks:Ec,MultiPulse:Hne,None:zIe,Operator:Lr,Parameters:aB,Pulse:jv,QUARTER:wl,RenderType:gv,Renderer:_R,ResourceLoader:HFe,SECONDS:Tu,SVGHandler:vNe,SVGRenderer:Xie,SVGStringRenderer:ANe,Scenegraph:cNe,TIME_UNITS:$ne,Transform:De,View:gje,WEEK:wo,Warn:_ne,YEAR:bs,accessor:Al,accessorFields:Ks,accessorName:Fi,array:pt,ascending:Q4,bandwidthNRD:Qne,bin:_$e,bootstrapCI:S$e,boundClip:jNe,boundContext:yR,boundItem:DX,boundMark:oNe,boundStroke:Yg,changeset:h1,clampRange:ZIe,codegenExpression:Uze,compare:Tne,constant:ra,cumulativeLogNormal:nre,cumulativeNormal:uB,cumulativeUniform:sre,dayofyear:ALe,debounce:kne,defaultLocale:Bne,definition:x$e,densityLogNormal:tre,densityNormal:Kne,densityUniform:ore,domChild:xo,domClear:qc,domCreate:hv,domFind:Bie,dotbin:C$e,error:je,expressionFunction:Ki,extend:cn,extent:kh,extentIndex:JIe,falsy:Rm,fastmap:wO,field:Ou,flush:eLe,font:jB,fontFamily:wR,fontSize:Gh,format:d3,formatLocale:bN,formats:Vne,hasOwnProperty:vt,id:eR,identity:na,inferType:l$e,inferTypes:c$e,ingest:cr,inherits:it,inrange:u_,interpolate:yie,interpolateColors:RB,interpolateRange:OFe,intersect:$Ne,intersectBoxLine:d_,intersectPath:Eie,intersectPoint:Tie,intersectRule:XFe,isArray:We,isBoolean:Vy,isDate:Nv,isFunction:fn,isIterable:tLe,isNumber:Jn,isObject:ht,isRegExp:nLe,isString:gt,isTuple:oB,key:Ane,lerp:rLe,lineHeight:cy,loader:rB,locale:s$e,logger:Sne,lruCache:iLe,markup:qie,merge:oLe,mergeConfig:xO,multiLineOffset:Nie,one:yO,pad:sLe,panLinear:HIe,panLog:qIe,panPow:XIe,panSymlog:YIe,parse:AUt,parseExpression:qoe,parseSelector:Qy,path:gB,pathCurves:Sie,pathEqual:BNe,pathParse:HS,pathRectangle:UFe,pathRender:MA,pathSymbols:BFe,pathTrail:WFe,peek:$n,point:UB,projection:hoe,quantileLogNormal:rre,quantileNormal:fB,quantileUniform:are,quantiles:Xne,quantizeInterpolator:EFe,quarter:QIe,quartiles:Yne,get random(){return ku},randomInteger:ETt,randomKDE:Jne,randomLCG:OTt,randomLogNormal:E$e,randomMixture:T$e,randomNormal:Zne,randomUniform:k$e,read:d$e,regressionConstant:lre,regressionExp:P$e,regressionLinear:cre,regressionLoess:D$e,regressionLog:A$e,regressionPoly:R$e,regressionPow:M$e,regressionQuad:ure,renderModule:WB,repeat:tT,resetDefaultLocale:_2t,resetSVGClipId:GFe,resetSVGDefIds:bDt,responseType:f$e,runtimeContext:nje,sampleCurve:hB,sampleLogNormal:ere,sampleNormal:cB,sampleUniform:ire,scale:tr,sceneEqual:Yie,sceneFromJSON:aNe,scenePickVisit:$N,sceneToJSON:sNe,sceneVisit:Gf,sceneZOrder:kie,scheme:xie,serializeXML:ONe,setHybridRendererOptions:mDt,setRandom:STt,span:tR,splitAccessPath:Wh,stringValue:rt,textMetrics:hc,timeBin:HLe,timeFloor:$Le,timeFormatLocale:SA,timeInterval:OO,timeOffset:zLe,timeSequence:ULe,timeUnitSpecifier:kLe,timeUnits:Fne,toBoolean:Pne,toDate:Mne,toNumber:Ys,toSet:Wf,toString:Rne,transform:b$e,transforms:jS,truncate:aLe,truthy:Eu,tupleid:jt,typeParsers:gX,utcFloor:FLe,utcInterval:EO,utcOffset:jLe,utcSequence:WLe,utcdayofyear:RLe,utcquarter:KIe,utcweek:DLe,version:PUt,visitArray:qm,week:PLe,writeConfig:bO,zero:rv,zoomLinear:Cne,zoomLog:One,zoomPow:hN,zoomSymlog:Ene},Symbol.toStringTag,{value:"Module"}));function RUt(t,e,n){let r;e.x2&&(e.x?(n&&t.x>t.x2&&(r=t.x,t.x=t.x2,t.x2=r),t.width=t.x2-t.x):t.x=t.x2-(t.width||0)),e.xc&&(t.x=t.xc-(t.width||0)/2),e.y2&&(e.y?(n&&t.y>t.y2&&(r=t.y,t.y=t.y2,t.y2=r),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),e.yc&&(t.y=t.yc-(t.height||0)/2)}var DUt={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},IUt={"*":(t,e)=>t*e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,">":(t,e)=>t>e,"<":(t,e)=>tt<=e,">=":(t,e)=>t>=e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"&":(t,e)=>t&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"<<":(t,e)=>t<>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e},LUt={"+":t=>+t,"-":t=>-t,"~":t=>~t,"!":t=>!t};const $Ut=Array.prototype.slice,b0=(t,e,n)=>{const r=n?n(e[0]):e[0];return r[t].apply(r,$Ut.call(e,1))},FUt=(t,e,n,r,i,o,s)=>new Date(t,e||0,n??1,r||0,i||0,o||0,s||0);var NUt={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(t,e,n)=>Math.max(e,Math.min(n,t)),now:Date.now,utc:Date.UTC,datetime:FUt,date:t=>new Date(t).getDate(),day:t=>new Date(t).getDay(),year:t=>new Date(t).getFullYear(),month:t=>new Date(t).getMonth(),hours:t=>new Date(t).getHours(),minutes:t=>new Date(t).getMinutes(),seconds:t=>new Date(t).getSeconds(),milliseconds:t=>new Date(t).getMilliseconds(),time:t=>new Date(t).getTime(),timezoneoffset:t=>new Date(t).getTimezoneOffset(),utcdate:t=>new Date(t).getUTCDate(),utcday:t=>new Date(t).getUTCDay(),utcyear:t=>new Date(t).getUTCFullYear(),utcmonth:t=>new Date(t).getUTCMonth(),utchours:t=>new Date(t).getUTCHours(),utcminutes:t=>new Date(t).getUTCMinutes(),utcseconds:t=>new Date(t).getUTCSeconds(),utcmilliseconds:t=>new Date(t).getUTCMilliseconds(),length:t=>t.length,join:function(){return b0("join",arguments)},indexof:function(){return b0("indexOf",arguments)},lastindexof:function(){return b0("lastIndexOf",arguments)},slice:function(){return b0("slice",arguments)},reverse:t=>t.slice().reverse(),parseFloat,parseInt,upper:t=>String(t).toUpperCase(),lower:t=>String(t).toLowerCase(),substring:function(){return b0("substring",arguments,String)},split:function(){return b0("split",arguments,String)},replace:function(){return b0("replace",arguments,String)},trim:t=>String(t).trim(),regexp:RegExp,test:(t,e)=>RegExp(t).test(e)};const zUt=["view","item","group","xy","x","y"],FY=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&FY.add(setImmediate);const jUt={Literal:(t,e)=>e.value,Identifier:(t,e)=>{const n=e.name;return t.memberDepth>0?n:n==="datum"?t.datum:n==="event"?t.event:n==="item"?t.item:DUt[n]||t.params["$"+n]},MemberExpression:(t,e)=>{const n=!e.computed,r=t(e.object);n&&(t.memberDepth+=1);const i=t(e.property);if(n&&(t.memberDepth-=1),FY.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(t,e)=>{const n=e.arguments;let r=e.callee.name;return r.startsWith("_")&&(r=r.slice(1)),r==="if"?t(n[0])?t(n[1]):t(n[2]):(t.fn[r]||NUt[r]).apply(t.fn,n.map(t))},ArrayExpression:(t,e)=>e.elements.map(t),BinaryExpression:(t,e)=>IUt[e.operator](t(e.left),t(e.right)),UnaryExpression:(t,e)=>LUt[e.operator](t(e.argument)),ConditionalExpression:(t,e)=>t(e.test)?t(e.consequent):t(e.alternate),LogicalExpression:(t,e)=>e.operator==="&&"?t(e.left)&&t(e.right):t(e.left)||t(e.right),ObjectExpression:(t,e)=>e.properties.reduce((n,r)=>{t.memberDepth+=1;const i=t(r.key);return t.memberDepth-=1,FY.has(t(r.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):n[i]=t(r.value),n},{})};function u2(t,e,n,r,i,o){const s=a=>jUt[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(e),s.params=n,s.datum=r,s.event=i,s.item=o,zUt.forEach(a=>s.fn[a]=function(){return i.vega[a](...arguments)}),s(t)}var BUt={operator(t,e){const n=e.ast,r=t.functions;return i=>u2(n,r,i)},parameter(t,e){const n=e.ast,r=t.functions;return(i,o)=>u2(n,r,o,i)},event(t,e){const n=e.ast,r=t.functions;return i=>u2(n,r,void 0,void 0,i)},handler(t,e){const n=e.ast,r=t.functions;return(i,o)=>{const s=o.item&&o.item.datum;return u2(n,r,i,s,o)}},encode(t,e){const{marktype:n,channels:r}=e,i=t.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const l=s.datum;let c=0,u;for(const f in r)u=u2(r[f].ast,i,a,l,void 0,s),s[f]!==u&&(s[f]=u,c=1);return n!=="rule"&&RUt(s,r,o),c}}};const UUt="vega-lite",WUt='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',VUt="5.21.0",GUt=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],HUt="https://vega.github.io/vega-lite/",qUt="Vega-Lite is a concise high-level language for interactive visualization.",XUt=["vega","chart","visualization"],YUt="build/vega-lite.js",QUt="build/vega-lite.min.js",KUt="build/vega-lite.min.js",ZUt="build/src/index",JUt="build/src/index.d.ts",e8t={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},t8t=["bin","build","src","vega-lite*","tsconfig.json"],n8t={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},r8t={type:"git",url:"https://github.com/vega/vega-lite.git"},i8t="BSD-3-Clause",o8t={url:"https://github.com/vega/vega-lite/issues"},s8t={"@babel/core":"^7.24.9","@babel/preset-env":"^7.25.0","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.12","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^7.17.0","@typescript-eslint/parser":"^7.17.0",ajv:"^8.17.1","ajv-formats":"^3.0.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^5.0.0",d3:"^7.9.0","del-cli":"^5.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.9.0","eslint-plugin-prettier":"^5.2.1","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.10.0",jest:"^29.7.0","jest-dev-server":"^10.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.3.3",puppeteer:"^15.0.0","release-it":"17.6.0",rollup:"^4.19.1","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.3",terser:"^5.31.3","ts-jest":"^29.2.3","ts-json-schema-generator":"^2.3.0",typescript:"~5.5.4","vega-cli":"^5.28.0","vega-datasets":"^2.8.1","vega-embed":"^6.26.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},a8t={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.3","vega-event-selector":"~3.0.1","vega-expression":"~5.1.1","vega-util":"~1.17.2",yargs:"~17.7.2"},l8t={vega:"^5.24.0"},c8t={node:">=18"},u8t="yarn@1.22.19",f8t={name:UUt,author:WUt,version:VUt,collaborators:GUt,homepage:HUt,description:qUt,keywords:XUt,main:YUt,unpkg:QUt,jsdelivr:KUt,module:ZUt,types:JUt,bin:e8t,files:t8t,scripts:n8t,repository:r8t,license:i8t,bugs:o8t,devDependencies:s8t,dependencies:a8t,peerDependencies:l8t,engines:c8t,packageManager:u8t};function wse(t){return Ke(t,"or")}function _se(t){return Ke(t,"and")}function Sse(t){return Ke(t,"not")}function $3(t,e){if(Sse(t))$3(t.not,e);else if(_se(t))for(const n of t.and)$3(n,e);else if(wse(t))for(const n of t.or)$3(n,e);else e(t)}function V_(t,e){return Sse(t)?{not:V_(t.not,e)}:_se(t)?{and:t.and.map(n=>V_(n,e))}:wse(t)?{or:t.or.map(n=>V_(n,e))}:e(t)}const Kt=structuredClone;function Zje(t){throw new Error(t)}function tC(t,e){const n={};for(const r of e)vt(t,r)&&(n[r]=t[r]);return n}function pl(t,e){const n={...t};for(const r of e)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(t=>kr(t)).join(",")})`};function Mn(t){if(Jn(t))return t;const e=gt(t)?t:kr(t);if(e.length<250)return e;let n=0;for(let r=0;ra===0?s:`[${s}]`),o=i.map((s,a)=>i.slice(0,a+1).join(""));for(const s of o)e.add(s)}return e}function Ese(t,e){return t===void 0||e===void 0?!0:Ose(zY(t),zY(e))}function Tr(t){return Qe(t).length===0}const Qe=Object.keys,ws=Object.values,hy=Object.entries;function HA(t){return t===!0||t===!1}function gi(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function mk(t,e){return Sse(t)?`!(${mk(t.not,e)})`:_se(t)?`(${t.and.map(n=>mk(n,e)).join(") && (")})`:wse(t)?`(${t.or.map(n=>mk(n,e)).join(") || (")})`:e(t)}function M5(t,e){if(e.length===0)return!0;const n=e.shift();return n in t&&M5(t[n],e)&&delete t[n],Tr(t)}function IR(t){return t.charAt(0).toUpperCase()+t.substr(1)}function Tse(t,e="datum"){const n=Wh(t),r=[];for(let i=1;i<=n.length;i++){const o=`[${n.slice(0,i).map(rt).join("][")}]`;r.push(`${e}${o}`)}return r.join(" && ")}function t4e(t,e="datum"){return`${e}[${rt(Wh(t).join("."))}]`}function p8t(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Pu(t){return`${Wh(t).map(p8t).join("\\.")}`}function Ob(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function LO(t){return`${Wh(t).join(".")}`}function rC(t){return t?Wh(t).length:0}function qi(...t){return t.find(e=>e!==void 0)}let n4e=42;function r4e(t){const e=++n4e;return t?String(t)+e:e}function g8t(){n4e=42}function i4e(t){return o4e(t)?t:`__${t}`}function o4e(t){return t.startsWith("__")}function qA(t){if(t!==void 0)return(t%360+360)%360}function d6(t){return Jn(t)?!0:!isNaN(t)&&!isNaN(parseFloat(t))}const yye=Object.getPrototypeOf(structuredClone({}));function sc(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor.name!==e.constructor.name)return!1;let n,r;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!sc(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const o of t.entries())if(!e.has(o[0]))return!1;for(const o of t.entries())if(!sc(o[1],e.get(o[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t.entries())if(!e.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&t.valueOf!==yye.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&t.toString!==yye.toString)return t.toString()===e.toString();const i=Object.keys(t);if(n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!sc(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function kr(t){const e=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;ib6(t[e])?gi(`_${e}_${hy(t[e])}`):gi(`_${e}_${t[e]}`)).join("")}function qr(t){return t===!0||b1(t)&&!t.binned}function rs(t){return t==="binned"||b1(t)&&t.binned===!0}function b1(t){return ht(t)}function b6(t){return Ke(t,"param")}function xye(t){switch(t){case fg:case dg:case Jg:case Cl:case Qh:case Kh:case e0:case em:case Zy:case Jy:case Ol:return 6;case t0:return 4;default:return 10}}function NR(t){return Ke(t,"expr")}function os(t,{level:e}={level:0}){const n=Qe(t||{}),r={};for(const i of n)r[i]=e===0?tc(t[i]):os(t[i],{level:e-1});return r}function x4e(t){const{anchor:e,frame:n,offset:r,orient:i,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:c,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=t,m={...g,...a?{fill:a}:{}},v={...e?{anchor:e}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},y={...l?{subtitleColor:l}:{},...c?{subtitleFont:c}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},x=tC(t,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:x,nonMarkTitleProperties:v,subtitle:y}}function Km(t){return gt(t)||We(t)&>(t[0])}function Rt(t){return Ke(t,"signal")}function w1(t){return Ke(t,"step")}function z8t(t){return We(t)?!1:Ke(t,"fields")&&!Ke(t,"data")}function j8t(t){return We(t)?!1:Ke(t,"fields")&&Ke(t,"data")}function eg(t){return We(t)?!1:Ke(t,"field")&&Ke(t,"data")}const B8t={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},U8t=Qe(B8t),W8t={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},jY=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function b4e(t){const e=We(t.condition)?t.condition.map(bye):bye(t.condition);return{...tc(t),condition:e}}function tc(t){if(NR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function bye(t){if(NR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function ni(t){if(NR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return Rt(t)?t:t!==void 0?{value:t}:void 0}function V8t(t){return Rt(t)?t.signal:rt(t)}function wye(t){return Rt(t)?t.signal:rt(t.value)}function Ef(t){return Rt(t)?t.signal:t==null?null:rt(t)}function G8t(t,e,n){for(const r of n){const i=Ih(r,e.markDef,e.config);i!==void 0&&(t[r]=ni(i))}return t}function w4e(t){return[].concat(t.type,t.style??[])}function Er(t,e,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&Ke(e,i)?e[i]:e[t]!==void 0?e[t]:o&&(!i||i===t)?void 0:Ih(t,e,n,r)}function Ih(t,e,n,{vgChannel:r}={}){const i=BY(t,e,n.style);return qi(r?i:void 0,i,r?n[e.type][r]:void 0,n[e.type][t],r?n.mark[r]:n.mark[t])}function BY(t,e,n){return _4e(t,w4e(e),n)}function _4e(t,e,n){e=pt(e);let r;for(const i of e){const o=n[i];Ke(o,t)&&(r=o[t])}return r}function S4e(t,e){return pt(t).reduce((n,r)=>(n.field.push(ct(r,e)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function C4e(t,e){const n=[...t];return e.forEach(r=>{for(const i of n)if(sc(i,r))return;n.push(r)}),n}function O4e(t,e){return sc(t,e)||!e?t:t?[...pt(t),...pt(e)].join(", "):e}function E4e(t,e){const n=t.value,r=e.value;if(n==null||r===null)return{explicit:t.explicit,value:null};if((Km(n)||Rt(n))&&(Km(r)||Rt(r)))return{explicit:t.explicit,value:O4e(n,r)};if(Km(n)||Rt(n))return{explicit:t.explicit,value:n};if(Km(r)||Rt(r))return{explicit:t.explicit,value:r};if(!Km(n)&&!Rt(n)&&!Km(r)&&!Rt(r))return{explicit:t.explicit,value:C4e(n,r)};throw new Error("It should never reach here")}function Fse(t){return`Invalid specification ${kr(t)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const H8t='Autosize "fit" only works for single views and layered views.';function _ye(t){return`${t=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function Sye(t){const e=t=="width"?"Width":"Height",n=t=="width"?"x":"y";return`${e} "container" only works well with autosize "fit" or "fit-${n}".`}function Cye(t){return t?`Dropping "fit-${t}" because spec has discrete ${El(t)}.`:'Dropping "fit" because spec has discrete size.'}function Nse(t){return`Unknown field for ${t}. Cannot calculate view size.`}function Oye(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function q8t(t,e){return`Cannot project a selection on encoding channel "${t}" as it uses an aggregate function ("${e}").`}function X8t(t){return`The "nearest" transform is not supported for ${t} marks.`}function T4e(t){return`Selection not supported for ${t} yet.`}function Y8t(t){return`Cannot find a selection named "${t}".`}const Q8t="Scale bindings are currently only supported for scales with unbinned, continuous domains.",K8t="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Z8t="Legend bindings are only supported for selections over an individual field or encoding channel.";function J8t(t){return`Lookups can only be performed on selection parameters. "${t}" is a variable parameter.`}function eWt(t){return`Cannot define and lookup the "${t}" selection in the same view. Try moving the lookup into a second, layered view?`}const tWt="The same selection must be used to override scale domains in a layered view.",nWt='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function rWt(t){return`Unknown repeated value "${t}".`}function Eye(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}const iWt="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function oWt(t){return`Unrecognized parse "${t}".`}function Tye(t,e,n){return`An ancestor parsed field "${t}" as ${n} but a child wants to parse the field as ${e}.`}const sWt="Attempt to add the same child twice.";function aWt(t){return`Ignoring an invalid transform: ${kr(t)}.`}const lWt='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function kye(t){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${t} are dropped.`}function cWt(t){const{parentProjection:e,projection:n}=t;return`Layer's shared projection ${kr(e)} is overridden by a child projection ${kr(n)}.`}const uWt="Arc marks uses theta channel rather than angle, replacing angle with theta.";function fWt(t){return`${t}Offset dropped because ${t} is continuous`}function dWt(t,e,n){return`Channel ${t} is a ${e}. Converted to {value: ${kr(n)}}.`}function k4e(t){return`Invalid field type "${t}".`}function hWt(t,e){return`Invalid field type "${t}" for aggregate: "${e}", using "quantitative" instead.`}function pWt(t){return`Invalid aggregation operator "${t}".`}function A4e(t,e){const{fill:n,stroke:r}=e;return`Dropping color ${t} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function gWt(t){return`Position range does not support relative band size for ${t}.`}function UY(t,e){return`Dropping ${kr(t)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`}const mWt="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function w6(t,e,n){return`${t} dropped as it is incompatible with "${e}".`}function vWt(t){return`${t}-encoding is dropped as ${t} is not a valid encoding channel.`}function yWt(t){return`${t} encoding should be discrete (ordinal / nominal / binned).`}function xWt(t){return`${t} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function bWt(t){return`Facet encoding dropped as ${t.join(" and ")} ${t.length>1?"are":"is"} also specified.`}function GV(t,e){return`Using discrete channel "${t}" to encode "${e}" field can be misleading as it does not encode ${e==="ordinal"?"order":"magnitude"}.`}function wWt(t){return`The ${t} for range marks cannot be an expression`}function _Wt(t,e){return`Line mark is for continuous lines and thus cannot be used with ${t&&e?"x2 and y2":t?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function SWt(t,e){return`Specified orient "${t}" overridden with "${e}".`}function CWt(t){return`Cannot use the scale property "${t}" with non-color channel.`}function OWt(t){return`Cannot use the relative band size with ${t} scale.`}function EWt(t){return`Using unaggregated domain with raw field has no effect (${kr(t)}).`}function TWt(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function kWt(t){return`Unaggregated domain is currently unsupported for log scale (${kr(t)}).`}function AWt(t){return`Cannot apply size to non-oriented mark "${t}".`}function PWt(t,e,n){return`Channel "${t}" does not work with "${e}" scale. We are using "${n}" scale instead.`}function MWt(t,e){return`FieldDef does not work with "${t}" scale. We are using "${e}" scale instead.`}function P4e(t,e,n){return`${n}-scale's "${e}" is dropped as it does not work with ${t} scale.`}function M4e(t){return`The step for "${t}" is dropped because the ${t==="width"?"x":"y"} is continuous.`}function RWt(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${kr(n)} and ${kr(r)}). Using ${kr(n)}.`}function DWt(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${kr(n)} and ${kr(r)}). Using the union of the two domains.`}function IWt(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}function LWt(t){return`Dropping sort property ${kr(t)} as unioned domains only support boolean or op "count", "min", and "max".`}const Aye="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",$Wt="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",FWt="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",NWt="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function zWt(t){return`Cannot stack "${t}" if there is already "${t}2".`}function jWt(t){return`Stack is applied to a non-linear scale (${t}).`}function BWt(t){return`Stacking is applied even though the aggregate function is non-summative ("${t}").`}function R5(t,e){return`Invalid ${t}: ${kr(e)}.`}function UWt(t){return`Dropping day from datetime ${kr(t)} as day cannot be combined with other units.`}function WWt(t,e){return`${e?"extent ":""}${e&&t?"and ":""}${t?"center ":""}${e&&t?"are ":"is "}not needed when data are aggregated.`}function VWt(t,e,n){return`${t} is not usually used with ${e} for ${n}.`}function GWt(t,e){return`Continuous axis should not have customized aggregation function ${t}; ${e} already agregates the axis.`}function Pye(t){return`1D error band does not support ${t}.`}function R4e(t){return`Channel ${t} is required for "binned" bin.`}function HWt(t){return`Channel ${t} should not be used with "binned" bin.`}function qWt(t){return`Domain for ${t} is required for threshold scale.`}const D4e=Sne(_ne);let oC=D4e;function XWt(t){return oC=t,oC}function YWt(){return oC=D4e,oC}function Ze(...t){oC.warn(...t)}function QWt(...t){oC.debug(...t)}function _1(t){if(t&&ht(t)){for(const e of jse)if(Ke(t,e))return!0}return!1}const I4e=["january","february","march","april","may","june","july","august","september","october","november","december"],KWt=I4e.map(t=>t.substr(0,3)),L4e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],ZWt=L4e.map(t=>t.substr(0,3));function JWt(t){if(d6(t)&&(t=+t),Jn(t))return t>4&&Ze(R5("quarter",t)),t-1;throw new Error(R5("quarter",t))}function eVt(t){if(d6(t)&&(t=+t),Jn(t))return t-1;{const e=t.toLowerCase(),n=I4e.indexOf(e);if(n!==-1)return n;const r=e.substr(0,3),i=KWt.indexOf(r);if(i!==-1)return i;throw new Error(R5("month",t))}}function tVt(t){if(d6(t)&&(t=+t),Jn(t))return t%7;{const e=t.toLowerCase(),n=L4e.indexOf(e);if(n!==-1)return n;const r=e.substr(0,3),i=ZWt.indexOf(r);if(i!==-1)return i;throw new Error(R5("day",t))}}function zse(t,e){const n=[];if(e&&t.day!==void 0&&Qe(t).length>1&&(Ze(UWt(t)),t=Kt(t),delete t.day),t.year!==void 0?n.push(t.year):n.push(2012),t.month!==void 0){const r=e?eVt(t.month):t.month;n.push(r)}else if(t.quarter!==void 0){const r=e?JWt(t.quarter):t.quarter;n.push(Jn(r)?r*3:`${r}*3`)}else n.push(0);if(t.date!==void 0)n.push(t.date);else if(t.day!==void 0){const r=e?tVt(t.day):t.day;n.push(Jn(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const i=t[r];n.push(typeof i>"u"?0:i)}return n}function Tb(t){const n=zse(t,!0).join(", ");return t.utc?`utc(${n})`:`datetime(${n})`}function nVt(t){const n=zse(t,!1).join(", ");return t.utc?`utc(${n})`:`datetime(${n})`}function rVt(t){const e=zse(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}const $4e={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},jse=Qe($4e);function iVt(t){return vt($4e,t)}function S1(t){return ht(t)?t.binned:F4e(t)}function F4e(t){return t&&t.startsWith("binned")}function Bse(t){return t.startsWith("utc")}function oVt(t){return t.substring(3)}const sVt={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function _6(t){return jse.filter(e=>z4e(t,e))}function N4e(t){const e=_6(t);return e[e.length-1]}function z4e(t,e){const n=t.indexOf(e);return!(n<0||n>0&&e==="seconds"&&t.charAt(n-1)==="i"||t.length>n+3&&e==="day"&&t.charAt(n+3)==="o"||n>0&&e==="year"&&t.charAt(n-1)==="f")}function aVt(t,e,{end:n}={end:!1}){const r=Tse(e),i=Bse(t)?"utc":"";function o(l){return l==="quarter"?`(${i}quarter(${r})-1)`:`${i}${l}(${r})`}let s;const a={};for(const l of jse)z4e(t,l)&&(a[l]=o(l),s=l);return n&&(a[s]+="+1"),nVt(a)}function j4e(t){if(!t)return;const e=_6(t);return`timeUnitSpecifier(${kr(e)}, ${kr(sVt)})`}function lVt(t,e,n){if(!t)return;const r=j4e(t);return`${n||Bse(t)?"utc":"time"}Format(${e}, ${r})`}function Vo(t){if(!t)return;let e;return gt(t)?F4e(t)?e={unit:t.substring(6),binned:!0}:e={unit:t}:ht(t)&&(e={...t,...t.unit?{unit:t.unit}:{}}),Bse(e.unit)&&(e.utc=!0,e.unit=oVt(e.unit)),e}function cVt(t){const{utc:e,...n}=Vo(t);return n.unit?(e?"utc":"")+Qe(n).map(r=>gi(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):(e?"utc":"")+"timeunit"+Qe(n).map(r=>gi(`_${r}_${n[r]}`)).join("")}function B4e(t,e=n=>n){const n=Vo(t),r=N4e(n.unit);if(r&&r!=="day"){const i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=U4e(r,n.step),a={...i,[s]:+i[s]+o};return`${e(Tb(a))} - ${e(Tb(i))}`}}const uVt={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function fVt(t){return vt(uVt,t)}function U4e(t,e=1){if(fVt(t))return{part:t,step:e};switch(t){case"day":case"dayofyear":return{part:"date",step:e};case"quarter":return{part:"month",step:e*3};case"week":return{part:"date",step:e*7}}}function dVt(t){return Ke(t,"param")}function Use(t){return!!(t!=null&&t.field)&&t.equal!==void 0}function Wse(t){return!!(t!=null&&t.field)&&t.lt!==void 0}function Vse(t){return!!(t!=null&&t.field)&&t.lte!==void 0}function Gse(t){return!!(t!=null&&t.field)&&t.gt!==void 0}function Hse(t){return!!(t!=null&&t.field)&&t.gte!==void 0}function qse(t){if(t!=null&&t.field){if(We(t.range)&&t.range.length===2)return!0;if(Rt(t.range))return!0}return!1}function Xse(t){return!!(t!=null&&t.field)&&(We(t.oneOf)||We(t.in))}function hVt(t){return!!(t!=null&&t.field)&&t.valid!==void 0}function W4e(t){return Xse(t)||Use(t)||qse(t)||Wse(t)||Gse(t)||Vse(t)||Hse(t)}function _d(t,e){return R6(t,{timeUnit:e,wrapTime:!0})}function pVt(t,e){return t.map(n=>_d(n,e))}function V4e(t,e=!0){const{field:n}=t,r=Vo(t.timeUnit),{unit:i,binned:o}=r||{},s=ct(t,{expr:"datum"}),a=i?`time(${o?s:aVt(i,n)})`:s;if(Use(t))return`${a}===${_d(t.equal,i)}`;if(Wse(t)){const l=t.lt;return`${a}<${_d(l,i)}`}else if(Gse(t)){const l=t.gt;return`${a}>${_d(l,i)}`}else if(Vse(t)){const l=t.lte;return`${a}<=${_d(l,i)}`}else if(Hse(t)){const l=t.gte;return`${a}>=${_d(l,i)}`}else{if(Xse(t))return`indexof([${pVt(t.oneOf,i).join(",")}], ${a}) !== -1`;if(hVt(t))return S6(a,t.valid);if(qse(t)){const{range:l}=os(t),c=Rt(l)?{signal:`${l.signal}[0]`}:l[0],u=Rt(l)?{signal:`${l.signal}[1]`}:l[1];if(c!==null&&u!==null&&e)return"inrange("+a+", ["+_d(c,i)+", "+_d(u,i)+"])";const f=[];return c!==null&&f.push(`${a} >= ${_d(c,i)}`),u!==null&&f.push(`${a} <= ${_d(u,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${kr(t)}`)}function S6(t,e=!0){return e?`isValid(${t}) && isFinite(+${t})`:`!isValid(${t}) || !isFinite(+${t})`}function gVt(t){return W4e(t)&&t.timeUnit?{...t,timeUnit:Vo(t.timeUnit)}:t}const zR={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function mVt(t){return t==="quantitative"||t==="temporal"}function G4e(t){return t==="ordinal"||t==="nominal"}const kb=zR.quantitative,Yse=zR.ordinal,sC=zR.temporal,Qse=zR.nominal,FO=zR.geojson;function vVt(t){if(t)switch(t=t.toLowerCase(),t){case"q":case kb:return"quantitative";case"t":case sC:return"temporal";case"o":case Yse:return"ordinal";case"n":case Qse:return"nominal";case FO:return"geojson"}}const ss={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},WY={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function yVt(t,e){const n=WY[t],r=WY[e];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}const xVt={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function Mye(t){return xVt[t]}const H4e=new Set(["linear","log","pow","sqrt","symlog"]),q4e=new Set([...H4e,"time","utc"]);function X4e(t){return H4e.has(t)}const Y4e=new Set(["quantile","quantize","threshold"]),bVt=new Set([...q4e,...Y4e,"sequential","identity"]),wVt=new Set(["ordinal","bin-ordinal","point","band"]);function Go(t){return wVt.has(t)}function Hf(t){return bVt.has(t)}function eh(t){return q4e.has(t)}function aC(t){return Y4e.has(t)}const _Vt={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function SVt(t){return!gt(t)&&Ke(t,"name")}function Q4e(t){return Ke(t,"param")}function CVt(t){return Ke(t,"unionWith")}function OVt(t){return ht(t)&&"field"in t}const EVt={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:MYn,domain:RYn,range:DYn,rangeMax:IYn,rangeMin:LYn,scheme:$Yn,...TVt}=EVt,kVt=Qe(TVt);function VY(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(t);case"bins":return!["point","band","identity","ordinal"].includes(t);case"round":return eh(t)||t==="band"||t==="point";case"padding":case"rangeMin":case"rangeMax":return eh(t)||["point","band"].includes(t);case"paddingOuter":case"align":return["point","band"].includes(t);case"paddingInner":return t==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return eh(t);case"nice":return eh(t)||t==="quantize"||t==="threshold";case"exponent":return t==="pow";case"base":return t==="log";case"constant":return t==="symlog";case"zero":return Hf(t)&&!En(["log","time","utc","threshold","quantile"],t)}}function K4e(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return G_(t)?void 0:CWt(e);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function AVt(t,e){return En([Yse,Qse],e)?t===void 0||Go(t):e===sC?En([ss.TIME,ss.UTC,void 0],t):e===kb?X4e(t)||aC(t)||t===void 0:!0}function PVt(t,e,n=!1){if(!Jh(t))return!1;switch(t){case xi:case Qo:case Ky:case $O:case zu:case ad:return eh(e)||e==="band"?!0:e==="point"?!n:!1;case Jg:case e0:case em:case Zy:case Jy:case y1:return eh(e)||aC(e)||En(["band","point","ordinal"],e);case Cl:case Qh:case Kh:return e!=="band";case t0:case Ol:return e==="ordinal"||aC(e)}}function MVt(t){return ht(t)&&"value"in t}const Ba={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},Z4e=Ba.arc,C6=Ba.area,O6=Ba.bar,RVt=Ba.image,E6=Ba.line,T6=Ba.point,DVt=Ba.rect,D5=Ba.rule,J4e=Ba.text,Kse=Ba.tick,IVt=Ba.trail,Zse=Ba.circle,Jse=Ba.square,eBe=Ba.geoshape;function r0(t){return["line","area","trail"].includes(t)}function XA(t){return["rect","bar","image","arc","tick"].includes(t)}const LVt=new Set(Qe(Ba));function Lh(t){return Ke(t,"type")}const $Vt=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],FVt=["fill","fillOpacity"],NVt=[...$Vt,...FVt],zVt={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},Rye=Qe(zVt),HV=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],jVt={area:["line","point"],bar:HV,rect:HV,line:["point"],tick:["bandSize","thickness",...HV]},BVt={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},UVt={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},tBe=Qe(UVt);function Ab(t){return Ke(t,"band")}const WVt={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},VVt=5,eae={binSpacing:0,continuousBandSize:VVt,minBandSize:.25,timeUnitBandPosition:.5},GVt={...eae,binSpacing:1},HVt={...eae,thickness:1};function qVt(t){return Lh(t)?t.type:t}function nBe(t,{isPath:e}){return t===void 0||t==="break-paths-show-path-domains"?e?"break-paths-show-domains":"filter":t===null?"show":t}function tae({markDef:t,config:e,scaleChannel:n,scaleType:r,isCountAggregate:i}){var a,l;if(!r||!Hf(r)||i)return"always-valid";const o=nBe(Er("invalid",t,e),{isPath:r0(t.type)});return((l=(a=e.scale)==null?void 0:a.invalid)==null?void 0:l[n])!==void 0?"show":o}function XVt(t){return t==="break-paths-filter-domains"||t==="break-paths-show-domains"}function rBe({scaleName:t,scale:e,mode:n}){const r=`domain('${t}')`;if(!e||!t)return;const i=`${r}[0]`,o=`peek(${r})`,s=e.domainHasZero();return s==="definitely"?{scale:t,value:0}:s==="maybe"?{signal:`scale('${t}', inrange(0, ${r}) ? 0 : ${n==="zeroOrMin"?i:o})`}:{signal:`scale('${t}', ${n==="zeroOrMin"?i:o})`}}function iBe({scaleChannel:t,channelDef:e,scale:n,scaleName:r,markDef:i,config:o}){var u;const s=n==null?void 0:n.get("type"),a=Xf(e),l=x6(a==null?void 0:a.aggregate),c=tae({scaleChannel:t,markDef:i,config:o,scaleType:s,isCountAggregate:l});if(a&&c==="show"){const f=((u=o.scale.invalid)==null?void 0:u[t])??"zero-or-min";return{test:S6(ct(a,{expr:"datum"}),!1),...YVt(f,n,r)}}}function YVt(t,e,n){if(MVt(t)){const{value:r}=t;return Rt(r)?{signal:r.signal}:{value:r}}return rBe({scale:e,scaleName:n,mode:"zeroOrMin"})}function nae(t){const{channel:e,channelDef:n,markDef:r,scale:i,scaleName:o,config:s}=t,a=x1(e),l=rae(t),c=iBe({scaleChannel:a,channelDef:n,scale:i,scaleName:o,markDef:r,config:s});return c!==void 0?[c,l]:l}function QVt(t){const{datum:e}=t;return _1(e)?Tb(e):`${kr(e)}`}function Wx(t,e,n,r){const i={};if(e&&(i.scale=e),ep(t)){const{datum:o}=t;_1(o)?i.signal=Tb(o):Rt(o)?i.signal=o.signal:NR(o)?i.signal=o.expr:i.value=o}else i.field=ct(t,n);if(r){const{offset:o,band:s}=r;o&&(i.offset=o),s&&(i.band=s)}return i}function I5({scaleName:t,fieldOrDatumDef:e,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:s=.5}){const a=!Rt(s)&&0{switch(e.fieldTitle){case"plain":return t.field;case"functional":return f9t(t);default:return u9t(t,e)}};let vBe=mBe;function yBe(t){vBe=t}function d9t(){yBe(mBe)}function H_(t,e,{allowDisabling:n,includeDefault:r=!0}){var a;const i=(a=aae(t))==null?void 0:a.title;if(!Je(t))return i??t.title;const o=t,s=r?lae(o,e):void 0;return n?qi(i,o.title,s):i??o.title??s}function aae(t){if(cC(t)&&t.axis)return t.axis;if(pBe(t)&&t.legend)return t.legend;if(oae(t)&&t.header)return t.header}function lae(t,e){return vBe(t,e)}function F5(t){if(gBe(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}else{const e=aae(t)??{},{format:n,formatType:r}=e;return{format:n,formatType:r}}}function h9t(t,e){var o;switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(sae(t)&&We(t.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=t;if(i)return"temporal";if(r||n&&!n0(n)&&!zg(n))return"quantitative";if(C1(t)&&((o=t.scale)!=null&&o.type))switch(WY[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Xf(t){if(Je(t))return t;if(P6(t))return t.condition}function _o(t){if(en(t))return t;if(WR(t))return t.condition}function xBe(t,e,n,r={}){if(gt(t)||Jn(t)||Vy(t)){const i=gt(t)?"string":Jn(t)?"number":"boolean";return Ze(dWt(e,i,t)),{value:t}}return en(t)?N5(t,e,n,r):WR(t)?{...t,condition:N5(t.condition,e,n,r)}:t}function N5(t,e,n,r){if(gBe(t)){const{format:i,formatType:o,...s}=t;if(Pb(o)&&!n.customFormatTypes)return Ze(kye(e)),N5(s,e,n,r)}else{const i=cC(t)?"axis":pBe(t)?"legend":oae(t)?"header":null;if(i&&t[i]){const{format:o,formatType:s,...a}=t[i];if(Pb(s)&&!n.customFormatTypes)return Ze(kye(e)),N5({...t,[i]:a},e,n,r)}}return Je(t)?cae(t,e,r):p9t(t)}function p9t(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=Jn(n)?"quantitative":gt(n)?"nominal":_1(n)?"temporal":void 0,{...t,type:e}}function cae(t,e,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:s}=t,a={...t};if(!n&&r&&!$se(r)&&!n0(r)&&!zg(r)&&(Ze(pWt(r)),delete a.aggregate),i&&(a.timeUnit=Vo(i)),s&&(a.field=`${s}`),qr(o)&&(a.bin=M6(o,e)),rs(o)&&!Xi(e)&&Ze(HWt(e)),Ra(a)){const{type:l}=a,c=vVt(l);l!==c&&(a.type=c),l!=="quantitative"&&x6(r)&&(Ze(hWt(l,r)),a.type="quantitative")}else if(!d4e(e)){const l=h9t(a,e);a.type=l}if(Ra(a)){const{compatible:l,warning:c}=g9t(a,e)||{};l===!1&&Ze(c)}if(sae(a)&>(a.sort)){const{sort:l}=a;if(Iye(l))return{...a,sort:{encoding:l}};const c=l.substring(1);if(l.charAt(0)==="-"&&Iye(c))return{...a,sort:{encoding:c,order:"descending"}}}if(oae(a)){const{header:l}=a;if(l){const{orient:c,...u}=l;if(c)return{...a,header:{...u,labelOrient:l.labelOrient||c,titleOrient:l.titleOrient||c}}}}return a}function M6(t,e){return Vy(t)?{maxbins:xye(e)}:t==="binned"?{binned:!0}:!t.maxbins&&!t.step?{...t,maxbins:xye(e)}:t}const sw={compatible:!0};function g9t(t,e){const n=t.type;if(n==="geojson"&&e!=="shape")return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case fg:case dg:case h6:return $5(t)?sw:{compatible:!1,warning:yWt(e)};case xi:case Qo:case Ky:case $O:case Cl:case Qh:case Kh:case LR:case $R:case p6:case Eb:case g6:case m6:case y1:case zu:case ad:case v6:return sw;case cd:case Mu:case ld:case ud:return n!==kb?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${t.type} field.`}:sw;case em:case Zy:case Jy:case e0:case Jg:case Zg:case Kg:case sd:case Yh:return n==="nominal"&&!t.sort?{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`}:sw;case Ol:case t0:return!$5(t)&&!l9t(t)?{compatible:!1,warning:xWt(e)}:sw;case iC:return t.type==="nominal"&&!("sort"in t)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:sw}}function uC(t){const{formatType:e}=F5(t);return e==="time"||!e&&m9t(t)}function m9t(t){return t&&(t.type==="temporal"||Je(t)&&!!t.timeUnit)}function R6(t,{timeUnit:e,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var l;const o=e&&((l=Vo(e))==null?void 0:l.unit);let s=o||n==="temporal",a;return NR(t)?a=t.expr:Rt(t)?a=t.signal:_1(t)?(s=!0,a=Tb(t)):(gt(t)||Jn(t))&&s&&(a=`datetime(${kr(t)})`,iVt(o)&&(Jn(t)&&t<1e4||gt(t)&&isNaN(Date.parse(t)))&&(a=Tb({[o]:t}))),a?r&&s?`time(${a})`:a:i?void 0:kr(t)}function bBe(t,e){const{type:n}=t;return e.map(r=>{const i=Je(t)&&!S1(t.timeUnit)?t.timeUnit:void 0,o=R6(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function VR(t,e){return qr(t.bin)?Jh(e)&&["ordinal","nominal"].includes(t.type):(console.warn("Only call this method for binned field defs."),!1)}const Fye={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function GR(t){return t==null?void 0:t.condition}const wBe=["domain","grid","labels","ticks","title"],v9t={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},_Be={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},y9t={..._Be,style:1,labelExpr:1,encoding:1};function Nye(t){return vt(y9t,t)}const x9t={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},SBe=Qe(x9t);function nm(t){return Ke(t,"mark")}class D6{constructor(e,n){this.name=e,this.run=n}hasMatchingType(e){return nm(e)?qVt(e.mark)===this.name:!1}}function Vx(t,e){const n=t&&t[e];return n?We(n)?nC(n,r=>!!r.field):Je(n)||P6(n):!1}function CBe(t,e){const n=t&&t[e];return n?We(n)?nC(n,r=>!!r.field):Je(n)||ep(n)||WR(n):!1}function OBe(t,e){if(Xi(e)){const n=t[e];if((Je(n)||ep(n))&&(G4e(n.type)||Je(n)&&n.timeUnit)){const r=Mse(e);return CBe(t,r)}}return!1}function EBe(t){return nC(y8t,e=>{if(Vx(t,e)){const n=t[e];if(We(n))return nC(n,r=>!!r.aggregate);{const r=Xf(n);return r&&!!r.aggregate}}return!1})}function TBe(t,e){const n=[],r=[],i=[],o=[],s={};return uae(t,(a,l)=>{if(Je(a)){const{field:c,aggregate:u,bin:f,timeUnit:d,...h}=a;if(u||d||f){const p=aae(a),g=p==null?void 0:p.title;let m=ct(a,{forAs:!0});const v={...g?[]:{title:H_(a,e,{allowDisabling:!0})},...h,field:m};if(u){let y;if(n0(u)?(y="argmax",m=ct({op:"argmax",field:u.argmax},{forAs:!0}),v.field=`${m}.${c}`):zg(u)?(y="argmin",m=ct({op:"argmin",field:u.argmin},{forAs:!0}),v.field=`${m}.${c}`):u!=="boxplot"&&u!=="errorbar"&&u!=="errorband"&&(y=u),y){const x={op:y,as:m};c&&(x.field=c),o.push(x)}}else if(n.push(m),Ra(a)&&qr(f)){if(r.push({bin:f,field:c,as:m}),n.push(ct(a,{binSuffix:"end"})),VR(a,l)&&n.push(ct(a,{binSuffix:"range"})),Xi(l)){const y={field:`${m}_end`};s[`${l}2`]=y}v.bin="binned",d4e(l)||(v.type=kb)}else if(d&&!S1(d)){i.push({timeUnit:d,field:c,as:m});const y=Ra(a)&&a.type!==sC&&"time";y&&(l===LR||l===Eb?v.formatType=y:k8t(l)?v.legend={formatType:y,...v.legend}:Xi(l)&&(v.axis={formatType:y,...v.axis}))}s[l]=v}else n.push(c),s[l]=t[l]}else s[l]=t[l]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:s}}function b9t(t,e,n){const r=P8t(e,n);if(r){if(r==="binned"){const i=t[e===sd?xi:Qo];return!!(Je(i)&&Je(t[e])&&rs(i.bin))}}else return!1;return!0}function w9t(t,e,n,r){const i={};for(const o of Qe(t))f4e(o)||Ze(vWt(o));for(let o of C8t){if(!t[o])continue;const s=t[o];if(FR(o)){const a=S8t(o),l=i[a];if(Je(l)&&mVt(l.type)&&Je(s)&&!l.timeUnit){Ze(fWt(a));continue}}if(o==="angle"&&e==="arc"&&!t.theta&&(Ze(uWt),o=zu),!b9t(t,o,e)){Ze(w6(o,e));continue}if(o===Jg&&e==="line"){const a=Xf(t[o]);if(a!=null&&a.aggregate){Ze(mWt);continue}}if(o===Cl&&(n?"fill"in t:"stroke"in t)){Ze(A4e("encoding",{fill:"fill"in t,stroke:"stroke"in t}));continue}if(o===$R||o===iC&&!We(s)&&!qf(s)||o===Eb&&We(s)){if(s){if(o===iC){const a=t[o];if(hBe(a)){i[o]=a;continue}}i[o]=pt(s).reduce((a,l)=>(Je(l)?a.push(cae(l,o)):Ze(UY(l,o)),a),[])}}else{if(o===Eb&&s===null)i[o]=null;else if(!Je(s)&&!ep(s)&&!qf(s)&&!UR(s)&&!Rt(s)){Ze(UY(s,o));continue}i[o]=xBe(s,o,r)}}return i}function I6(t,e){const n={};for(const r of Qe(t)){const i=xBe(t[r],r,e,{compositeMark:!0});n[r]=i}return n}function _9t(t){const e=[];for(const n of Qe(t))if(Vx(t,n)){const r=t[n],i=pt(r);for(const o of i)Je(o)?e.push(o):P6(o)&&e.push(o.condition)}return e}function uae(t,e,n){if(t)for(const r of Qe(t)){const i=t[r];if(We(i))for(const o of i)e.call(n,o,r);else e.call(n,i,r)}}function S9t(t,e,n,r){return t?Qe(t).reduce((i,o)=>{const s=t[o];return We(s)?s.reduce((a,l)=>e.call(r,a,l,o),i):e.call(r,i,s,o)},n):n}function kBe(t,e){return Qe(e).reduce((n,r)=>{switch(r){case xi:case Qo:case g6:case v6:case m6:case sd:case Yh:case Ky:case $O:case zu:case Zg:case ad:case Kg:case ld:case cd:case ud:case Mu:case LR:case Ol:case y1:case Eb:return n;case iC:if(t==="line"||t==="trail")return n;case $R:case p6:{const i=e[r];if(We(i)||Je(i))for(const o of pt(i))o.aggregate||n.push(ct(o,{}));return n}case Jg:if(t==="trail")return n;case Cl:case Qh:case Kh:case em:case Zy:case Jy:case t0:case e0:{const i=Xf(e[r]);return i&&!i.aggregate&&n.push(ct(i,{})),n}}},[])}function C9t(t){const{tooltip:e,...n}=t;if(!e)return{filteredEncoding:n};let r,i;if(We(e)){for(const o of e)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else e.aggregate?n.tooltip=e:i=e;return We(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function HY(t,e,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=t.map(({fieldPrefix:s,titlePrefix:a})=>{const l=r?` of ${fae(e)}`:"";return{field:s+e.field,type:e.type,title:Rt(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),o=_9t(n).map(s9t);return{tooltip:[...i,...Jd(o,Mn)]}}function fae(t){const{title:e,field:n}=t;return qi(e,n)}function dae(t,e,n,r,i){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:c,endPositionPrefix:u=void 0,extraEncoding:f={}})=>{const d=fae(n);return ABe(t,a,i,{mark:l,encoding:{[e]:{field:`${c}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...gt(u)?{[`${e}2`]:{field:`${u}_${n.field}`}}:{},...r,...f}})}}function ABe(t,e,n,r){const{clip:i,color:o,opacity:s}=t,a=t.type;return t[e]||t[e]===void 0&&n[e]?[{...r,mark:{...n[e],...i?{clip:i}:{},...o?{color:o}:{},...s?{opacity:s}:{},...Lh(r.mark)?r.mark:{type:r.mark},style:`${a}-${String(e)}`,...Vy(t[e])?{}:t[e]}}]:[]}function PBe(t,e,n){const{encoding:r}=t,i=e==="vertical"?"y":"x",o=r[i],s=r[`${i}2`],a=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:nL(o,n),continuousAxisChannelDef2:nL(s,n),continuousAxisChannelDefError:nL(a,n),continuousAxisChannelDefError2:nL(l,n),continuousAxis:i}}function nL(t,e){if(t!=null&&t.aggregate){const{aggregate:n,...r}=t;return n!==e&&Ze(GWt(n,e)),r}else return t}function MBe(t,e){const{mark:n,encoding:r}=t,{x:i,y:o}=r;if(Lh(n)&&n.orient)return n.orient;if(bv(i)){if(bv(o)){const s=Je(i)&&i.aggregate,a=Je(o)&&o.aggregate;if(!s&&a===e)return"vertical";if(!a&&s===e)return"horizontal";if(s===e&&a===e)throw new Error("Both x and y cannot have aggregate");return uC(o)&&!uC(i)?"horizontal":"vertical"}return"horizontal"}else{if(bv(o))return"vertical";throw new Error(`Need a valid continuous axis for ${e}s`)}}const z5="boxplot",O9t=["box","median","outliers","rule","ticks"],E9t=new D6(z5,DBe);function RBe(t){return Jn(t)?"tukey":t}function DBe(t,{config:e}){t={...t,encoding:I6(t.encoding,e)};const{mark:n,encoding:r,params:i,projection:o,...s}=t,a=Lh(n)?n:{type:n};i&&Ze(T4e("boxplot"));const l=a.extent??e.boxplot.extent,c=Er("size",a,e),u=a.invalid,f=RBe(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:v,aggregate:y,encodingWithoutContinuousAxis:x,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:_}=T9t(t,l,e),S=LO(g.field),{color:O,size:k,...E}=x,P=q=>dae(a,m,g,q,e.boxplot),A=P(E),R=P(x),T=(ht(e.boxplot.box)?e.boxplot.box.color:e.mark.color)||"#4c78a8",M=P({...E,...k?{size:k}:{},color:{condition:{test:`datum['lower_box_${g.field}'] >= datum['upper_box_${g.field}']`,...O||{value:T}}}}),I=HY([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,x),z={type:"tick",color:"black",opacity:1,orient:b,invalid:u,aria:!1},F=f==="min-max"?I:HY([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,x),N=[...A({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:F}),...A({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:F}),...A({partName:"ticks",mark:z,positionPrefix:"lower_whisker",extraEncoding:F}),...A({partName:"ticks",mark:z,positionPrefix:"upper_whisker",extraEncoding:F})],L=[...f!=="tukey"?N:[],...R({partName:"box",mark:{type:"bar",...c?{size:c}:{},orient:w,invalid:u,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:I}),...M({partName:"median",mark:{type:"tick",invalid:u,...ht(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{},...c?{size:c}:{},orient:b,aria:!1},positionPrefix:"mid_box",extraEncoding:I})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:L};const B=`datum["lower_box_${g.field}"]`,$=`datum["upper_box_${g.field}"]`,j=`(${$} - ${B})`,X=`${B} - ${l} * ${j}`,V=`${$} + ${l} * ${j}`,Y=`datum["${g.field}"]`,le={joinaggregate:IBe(g.field),groupby:v},K={transform:[{filter:`(${X} <= ${Y}) && (${Y} <= ${V})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${S}`},{op:"max",field:g.field,as:`upper_whisker_${S}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${S}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${S}`},...y],groupby:v}],layer:N},{tooltip:ee,...re}=E,{scale:me,axis:te}=g,ae=fae(g),U=pl(te,["title"]),oe=ABe(a,"outliers",e.boxplot,{transform:[{filter:`(${Y} < ${X}) || (${Y} > ${V})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...ae!==void 0?{title:ae}:{},...me!==void 0?{scale:me}:{},...Tr(U)?{}:{axis:U}},...re,...O?{color:O}:{},..._?{tooltip:_}:{}}})[0];let ne;const G=[...d,...h,le];return oe?ne={transform:G,layer:[oe,K]}:(ne=K,ne.transform.unshift(...G)),{...s,layer:[ne,{transform:p,layer:L}]}}function IBe(t){const e=LO(t);return[{op:"q1",field:t,as:`lower_box_${e}`},{op:"q3",field:t,as:`upper_box_${e}`}]}function T9t(t,e,n){const r=MBe(t,z5),{continuousAxisChannelDef:i,continuousAxis:o}=PBe(t,r,z5),s=i.field,a=LO(s),l=RBe(e),c=[...IBe(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(l==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(l==="min-max"?"upper_whisker_":"max_")+a}],u=l==="min-max"||l==="tukey"?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${e}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${e}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[o]:f,...d}=t.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=C9t(d),{bins:g,timeUnits:m,aggregate:v,groupby:y,encoding:x}=TBe(p,n),b=r==="vertical"?"horizontal":"vertical",w=r,_=[...g,...m,{aggregate:[...v,...c],groupby:y},...u];return{bins:g,timeUnits:m,transform:_,groupby:y,aggregate:v,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:x,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:h}}const hae="errorbar",k9t=["ticks","rule"],A9t=new D6(hae,LBe);function LBe(t,{config:e}){t={...t,encoding:I6(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:c}=$Be(t,hae,e);delete o.size;const u=dae(a,i,r,o,e.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...u({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:c}),...u({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:c}),...u({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function P9t(t,e){const{encoding:n}=t;if(M9t(n))return{orient:MBe(t,e),inputType:"raw"};const r=R9t(n),i=D9t(n),o=n.x,s=n.y;if(r){if(i)throw new Error(`${e} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(en(a)&&en(l))throw new Error(`${e} cannot have both x2 and y2`);if(en(a)){if(bv(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${e}`)}else if(en(l)){if(bv(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${e}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,c=n.yError,u=n.yError2;if(en(l)&&!en(a))throw new Error(`${e} cannot have xError2 without xError`);if(en(u)&&!en(c))throw new Error(`${e} cannot have yError2 without yError`);if(en(a)&&en(c))throw new Error(`${e} cannot have both xError and yError with both are quantiative`);if(en(a)){if(bv(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(en(c)){if(bv(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function M9t(t){return(en(t.x)||en(t.y))&&!en(t.x2)&&!en(t.y2)&&!en(t.xError)&&!en(t.xError2)&&!en(t.yError)&&!en(t.yError2)}function R9t(t){return en(t.x2)||en(t.y2)}function D9t(t){return en(t.xError)||en(t.xError2)||en(t.yError)||en(t.yError2)}function $Be(t,e,n){const{mark:r,encoding:i,params:o,projection:s,...a}=t,l=Lh(r)?r:{type:r};o&&Ze(T4e(e));const{orient:c,inputType:u}=P9t(t,e),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=PBe(t,c,e),{errorBarSpecificAggregate:m,postAggregateCalculates:v,tooltipSummary:y,tooltipTitleWithFieldName:x}=I9t(l,f,d,h,p,u,e,n),{[g]:b,[g==="x"?"x2":"y2"]:w,[g==="x"?"xError":"yError"]:_,[g==="x"?"xError2":"yError2"]:S,...O}=i,{bins:k,timeUnits:E,aggregate:P,groupby:A,encoding:R}=TBe(O,n),T=[...P,...m],M=u!=="raw"?[]:A,I=HY(y,f,R,x);return{transform:[...a.transform??[],...k,...E,...T.length===0?[]:[{aggregate:T,groupby:M}],...v],groupby:M,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:R,ticksOrient:c==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:I}}function I9t(t,e,n,r,i,o,s,a){let l=[],c=[];const u=e.field;let f,d=!1;if(o==="raw"){const h=t.center?t.center:t.extent?t.extent==="iqr"?"median":"mean":a.errorbar.center,p=t.extent?t.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Ze(VWt(h,p,s)),p==="stderr"||p==="stdev")l=[{op:p,field:u,as:`extent_${u}`},{op:h,field:u,as:`center_${u}`}],c=[{calculate:`datum["center_${u}"] + datum["extent_${u}"]`,as:`upper_${u}`},{calculate:`datum["center_${u}"] - datum["extent_${u}"]`,as:`lower_${u}`}],f=[{fieldPrefix:"center_",titlePrefix:IR(h)},{fieldPrefix:"upper_",titlePrefix:zye(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:zye(h,p,"-")}],d=!0;else{let g,m,v;p==="ci"?(g="mean",m="ci0",v="ci1"):(g="median",m="q1",v="q3"),l=[{op:m,field:u,as:`lower_${u}`},{op:v,field:u,as:`upper_${u}`},{op:g,field:u,as:`center_${u}`}],f=[{fieldPrefix:"upper_",titlePrefix:H_({field:u,aggregate:v,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:H_({field:u,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:H_({field:u,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&Ze(WWt(t.center,t.extent)),o==="aggregated-upper-lower"?(f=[],c=[{calculate:`datum["${n.field}"]`,as:`upper_${u}`},{calculate:`datum["${u}"]`,as:`lower_${u}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:u}],c=[{calculate:`datum["${u}"] + datum["${r.field}"]`,as:`upper_${u}`}],i?c.push({calculate:`datum["${u}"] + datum["${i.field}"]`,as:`lower_${u}`}):c.push({calculate:`datum["${u}"] - datum["${r.field}"]`,as:`lower_${u}`}));for(const h of c)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:Ob(Ob(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function zye(t,e,n){return`${IR(t)} ${n} ${e}`}const pae="errorband",L9t=["band","borders"],$9t=new D6(pae,FBe);function FBe(t,{config:e}){t={...t,encoding:I6(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=$Be(t,pae,e),c=s,u=dae(c,i,r,o,e.errorband),f=t.encoding.x!==void 0&&t.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...c.interpolate?{interpolate:c.interpolate}:{},...c.tension&&c.interpolate?{tension:c.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):c.interpolate?Ze(Pye("interpolate")):c.tension&&Ze(Pye("tension")),{...a,transform:n,layer:[...u({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const NBe={};function gae(t,e,n){const r=new D6(t,e);NBe[t]={normalizer:r,parts:n}}function F9t(){return Qe(NBe)}gae(z5,DBe,O9t);gae(hae,LBe,k9t);gae(pae,FBe,L9t);const N9t=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],zBe={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},jBe={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},z9t=Qe(zBe),j9t=Qe(jBe),B9t={header:1,headerRow:1,headerColumn:1,headerFacet:1},BBe=Qe(B9t),UBe=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],U9t={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},W9t={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Yf="_vgsid_",V9t={point:{on:"click",fields:[Yf],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function mae(t){return t==="legend"||!!(t!=null&&t.legend)}function qV(t){return mae(t)&&ht(t)}function vae(t){return!!(t!=null&&t.select)}function WBe(t){const e=[];for(const n of t||[]){if(vae(n))continue;const{expr:r,bind:i,...o}=n;if(i&&r){const s={...o,bind:i,init:r};e.push(s)}else{const s={...o,...r?{update:r}:{},...i?{bind:i}:{}};e.push(s)}}return e}function G9t(t){return L6(t)||xae(t)||yae(t)}function yae(t){return Ke(t,"concat")}function L6(t){return Ke(t,"vconcat")}function xae(t){return Ke(t,"hconcat")}function VBe({step:t,offsetIsDiscrete:e}){return e?t.for??"offset":"position"}function $h(t){return Ke(t,"step")}function jye(t){return Ke(t,"view")||Ke(t,"width")||Ke(t,"height")}const Bye=20,H9t={align:1,bounds:1,center:1,columns:1,spacing:1},q9t=Qe(H9t);function X9t(t,e,n){const r=n[e],i={},{spacing:o,columns:s}=r;o!==void 0&&(i.spacing=o),s!==void 0&&(A6(t)&&!BR(t.facet)||yae(t))&&(i.columns=s),L6(t)&&(i.columns=1);for(const a of q9t)if(t[a]!==void 0)if(a==="spacing"){const l=t[a];i[a]=Jn(l)?l:{row:l.row??o,column:l.column??o}}else i[a]=t[a];return i}function qY(t,e){return t[e]??t[e==="width"?"continuousWidth":"continuousHeight"]}function XY(t,e){const n=j5(t,e);return $h(n)?n.step:GBe}function j5(t,e){const n=t[e]??t[e==="width"?"discreteWidth":"discreteHeight"];return qi(n,{step:t.step})}const GBe=20,Y9t={continuousWidth:200,continuousHeight:200,step:GBe},Q9t={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:Y9t,mark:BVt,arc:{},area:{},bar:GVt,circle:{},geoshape:{},image:{},line:{},point:{},rect:eae,rule:{color:"black"},square:{},text:{color:"black"},tick:HVt,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:_Vt,projection:{},legend:U9t,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:V9t,style:{},title:{},facet:{spacing:Bye},concat:{spacing:Bye},normalizedNumberFormat:".0%"},pp=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Uye={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Wye={blue:pp[0],orange:pp[1],red:pp[2],teal:pp[3],green:pp[4],yellow:pp[5],purple:pp[6],pink:pp[7],brown:pp[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function K9t(t={}){return{signals:[{name:"color",value:ht(t)?{...Wye,...t}:Wye}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Z9t(t){return{signals:[{name:"fontSize",value:ht(t)?{...Uye,...t}:Uye}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function J9t(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}function HBe(t){const e=Qe(t||{}),n={};for(const r of e){const i=t[r];n[r]=GR(i)?b4e(i):tc(i)}return n}function e7t(t){const e=Qe(t),n={};for(const r of e)n[r]=HBe(t[r]);return n}const t7t=[...tBe,...SBe,...BBe,"background","padding","legend","lineBreak","scale","style","title","view"];function qBe(t={}){const{color:e,font:n,fontSize:r,selection:i,...o}=t,s=xO({},Kt(Q9t),n?J9t(n):{},e?K9t(e):{},r?Z9t(r):{},o||{});i&&bO(s,"selection",i,!0);const a=pl(s,t7t);for(const l of["background","lineBreak","padding"])s[l]&&(a[l]=tc(s[l]));for(const l of tBe)s[l]&&(a[l]=os(s[l]));for(const l of SBe)s[l]&&(a[l]=HBe(s[l]));for(const l of BBe)s[l]&&(a[l]=os(s[l]));if(s.legend&&(a.legend=os(s.legend)),s.scale){const{invalid:l,...c}=s.scale,u=os(l,{level:1});a.scale={...os(c),...Qe(u).length>0?{invalid:u}:{}}}return s.style&&(a.style=e7t(s.style)),s.title&&(a.title=os(s.title)),s.view&&(a.view=os(s.view)),a}const n7t=new Set(["view",...LVt]),r7t=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],i7t={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...jVt};function o7t(t){t=Kt(t);for(const e of r7t)delete t[e];if(t.axis)for(const e in t.axis)GR(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of N9t)delete t.legend[e];if(t.mark){for(const e of Rye)delete t.mark[e];t.mark.tooltip&&ht(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(WBe(t.params)),delete t.params);for(const e of n7t){for(const r of Rye)delete t[e][r];const n=i7t[e];if(n)for(const r of n)delete t[e][r];a7t(t,e)}for(const e of F9t())delete t[e];s7t(t);for(const e in t)ht(t[e])&&Tr(t[e])&&delete t[e];return Tr(t)?void 0:t}function s7t(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:r}=x4e(t.title);Tr(e)||(t.style["group-title"]={...t.style["group-title"],...e}),Tr(n)||(t.style["group-subtitle"]={...t.style["group-subtitle"],...n}),Tr(r)?delete t.title:t.title=r}function a7t(t,e,n,r){const i=t[e];e==="view"&&(n="cell");const o={...i,...t.style[n??e]};Tr(o)||(t.style[n??e]=o),delete t[e]}function $6(t){return Ke(t,"layer")}function l7t(t){return Ke(t,"repeat")}function c7t(t){return!We(t.repeat)&&Ke(t.repeat,"layer")}class bae{map(e,n){return A6(e)?this.mapFacet(e,n):l7t(e)?this.mapRepeat(e,n):xae(e)?this.mapHConcat(e,n):L6(e)?this.mapVConcat(e,n):yae(e)?this.mapConcat(e,n):this.mapLayerOrUnit(e,n)}mapLayerOrUnit(e,n){if($6(e))return this.mapLayer(e,n);if(nm(e))return this.mapUnit(e,n);throw new Error(Fse(e))}mapLayer(e,n){return{...e,layer:e.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(e,n){return{...e,hconcat:e.hconcat.map(r=>this.map(r,n))}}mapVConcat(e,n){return{...e,vconcat:e.vconcat.map(r=>this.map(r,n))}}mapConcat(e,n){const{concat:r,...i}=e;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(e,n){return{...e,spec:this.map(e.spec,n)}}mapRepeat(e,n){return{...e,spec:this.map(e.spec,n)}}}const u7t={zero:1,center:1,normalize:1};function f7t(t){return vt(u7t,t)}const d7t=new Set([Z4e,O6,C6,D5,T6,Zse,Jse,E6,J4e,Kse]),h7t=new Set([O6,C6,Z4e]);function aw(t){return Je(t)&&lC(t)==="quantitative"&&!t.bin}function Vye(t,e,{orient:n,type:r}){const i=e==="x"?"y":"radius",o=e==="x"&&["bar","area"].includes(r),s=t[e],a=t[i];if(Je(s)&&Je(a))if(aw(s)&&aw(a)){if(s.stack)return e;if(a.stack)return i;const l=Je(s)&&!!s.aggregate,c=Je(a)&&!!a.aggregate;if(l!==c)return l?e:i;if(o){if(n==="vertical")return i;if(n==="horizontal")return e}}else{if(aw(s))return e;if(aw(a))return i}else{if(aw(s))return o&&n==="vertical"?void 0:e;if(aw(a))return o&&n==="horizontal"?void 0:i}}function p7t(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function XBe(t,e){var g,m;const n=Lh(t)?t:{type:t},r=n.type;if(!d7t.has(r))return null;const i=Vye(e,"x",n)||Vye(e,"theta",n);if(!i)return null;const o=e[i],s=Je(o)?ct(o,{}):void 0,a=p7t(i),l=[],c=new Set;if(e[a]){const v=e[a],y=Je(v)?ct(v,{}):void 0;y&&y!==s&&(l.push(a),c.add(y))}const u=a==="x"?"xOffset":"yOffset",f=e[u],d=Je(f)?ct(f,{}):void 0;d&&d!==s&&(l.push(u),c.add(d));const h=O8t.reduce((v,y)=>{if(y!=="tooltip"&&Vx(e,y)){const x=e[y];for(const b of pt(x)){const w=Xf(b);if(w.aggregate)continue;const _=ct(w,{});(!_||!c.has(_))&&v.push({channel:y,fieldDef:w})}}return v},[]);let p;return o.stack!==void 0?Vy(o.stack)?p=o.stack?"zero":null:p=o.stack:h7t.has(r)&&(p="zero"),!p||!f7t(p)||EBe(e)&&h.length===0?null:((g=o==null?void 0:o.scale)!=null&&g.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==ss.LINEAR&&o!=null&&o.stack&&Ze(jWt(o.scale.type)),en(e[Zh(i)])?(o.stack!==void 0&&Ze(zWt(i)),null):(Je(o)&&o.aggregate&&!F8t.has(o.aggregate)&&Ze(BWt(o.aggregate)),{groupbyChannels:l,groupbyFields:c,fieldChannel:i,impute:o.impute===null?!1:r0(r),stackBy:h,offset:p}))}function YBe(t,e,n){const r=os(t),i=Er("orient",r,n);if(r.orient=y7t(r.type,e,i),i!==void 0&&i!==r.orient&&Ze(SWt(r.orient,i)),r.type==="bar"&&r.orient){const l=Er("cornerRadiusEnd",r,n);if(l!==void 0){const c=r.orient==="horizontal"&&e.x2||r.orient==="vertical"&&e.y2?["cornerRadius"]:WVt[r.orient];for(const u of c)r[u]=l;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}const o=Er("opacity",r,n),s=Er("fillOpacity",r,n);return o===void 0&&s===void 0&&(r.opacity=m7t(r.type,e)),Er("cursor",r,n)===void 0&&(r.cursor=g7t(r,e,n)),r}function g7t(t,e,n){return e.href||t.href||Er("href",t,n)?"pointer":t.cursor}function m7t(t,e){if(En([T6,Kse,Zse,Jse],t)&&!EBe(e))return .7}function v7t(t,e,{graticule:n}){if(n)return!1;const r=Ih("filled",t,e),i=t.type;return qi(r,i!==T6&&i!==E6&&i!==D5)}function y7t(t,e,n){switch(t){case T6:case Zse:case Jse:case J4e:case DVt:case RVt:return}const{x:r,y:i,x2:o,y2:s}=e;switch(t){case O6:if(Je(r)&&(rs(r.bin)||Je(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Je(i)&&(rs(i.bin)||Je(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(Je(r)&&r.type===kb&&!qr(r.bin)||L5(r))&&Je(i)&&rs(i.bin)?"horizontal":"vertical";if(!s)return(Je(i)&&i.type===kb&&!qr(i.bin)||L5(i))&&Je(r)&&rs(r.bin)?"vertical":"horizontal"}case D5:if(o&&!(Je(r)&&rs(r.bin))&&s&&!(Je(i)&&rs(i.bin)))return;case C6:if(s)return Je(i)&&rs(i.bin)?"horizontal":"vertical";if(o)return Je(r)&&rs(r.bin)?"vertical":"horizontal";if(t===D5){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case E6:case Kse:{const a=$ye(r),l=$ye(i);if(n)return n;if(a&&!l)return t!=="tick"?"horizontal":"vertical";if(!a&&l)return t!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const c=Ra(r)&&r.type===sC,u=Ra(i)&&i.type===sC;if(c&&!u)return"vertical";if(!c&&u)return"horizontal"}return}}return"vertical"}function x7t(t){const{point:e,line:n,...r}=t;return Qe(r).length>1?r:r.type}function b7t(t){for(const e of["line","area","rule","trail"])t[e]&&(t={...t,[e]:pl(t[e],["point","line"])});return t}function XV(t,e={},n){return t.point==="transparent"?{opacity:0}:t.point?ht(t.point)?t.point:{}:t.point!==void 0?null:e.point||n.shape?ht(e.point)?e.point:{}:void 0}function Gye(t,e={}){return t.line?t.line===!0?{}:t.line:t.line!==void 0?null:e.line?e.line===!0?{}:e.line:void 0}class w7t{constructor(){this.name="path-overlay"}hasMatchingType(e,n){if(nm(e)){const{mark:r,encoding:i}=e,o=Lh(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!XV(o,n[o.type],i);case"area":return!!XV(o,n[o.type],i)||!!Gye(o,n[o.type])}}return!1}run(e,n,r){const{config:i}=n,{params:o,projection:s,mark:a,name:l,encoding:c,...u}=e,f=I6(c,i),d=Lh(a)?a:{type:a},h=XV(d,i[d.type],f),p=d.type==="area"&&Gye(d,i[d.type]),g=[{name:l,...o?{params:o}:{},mark:x7t({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:pl(f,["shape"])}],m=XBe(YBe(d,f,i),f);let v=f;if(m){const{fieldChannel:y,offset:x}=m;v={...f,[y]:{...f[y],...x?{stack:x}:{}}}}return v=pl(v,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...tC(d,["clip","interpolate","tension","tooltip"]),...p},encoding:v}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...tC(d,["clip","tooltip"]),...h},encoding:v}),r({...u,layer:g},{...n,config:b7t(i)})}}function _7t(t,e){return e?BR(t)?KBe(t,e):QBe(t,e):t}function YV(t,e){return e?KBe(t,e):t}function YY(t,e,n){const r=e[t];if(i9t(r)){if(r.repeat in n)return{...e,[t]:n[r.repeat]};Ze(rWt(r.repeat));return}return e}function QBe(t,e){if(t=YY("field",t,e),t!==void 0){if(t===null)return null;if(sae(t)&&hg(t.sort)){const n=YY("field",t.sort,e);t={...t,...n?{sort:n}:{}}}return t}}function Hye(t,e){if(Je(t))return QBe(t,e);{const n=YY("datum",t,e);return n!==t&&!n.type&&(n.type="nominal"),n}}function qye(t,e){if(en(t)){const n=Hye(t,e);if(n)return n;if(UR(t))return{condition:t.condition}}else{if(WR(t)){const n=Hye(t.condition,e);if(n)return{...t,condition:n};{const{condition:r,...i}=t;return i}}return t}}function KBe(t,e){const n={};for(const r in t)if(Ke(t,r)){const i=t[r];if(We(i))n[r]=i.map(o=>qye(o,e)).filter(o=>o);else{const o=qye(i,e);o!==void 0&&(n[r]=o)}}return n}class S7t{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(nm(e)){const{encoding:n,mark:r}=e;if(r==="line"||Lh(r)&&r.type==="line")for(const i of _8t){const o=x1(i),s=n[o];if(n[i]&&(Je(s)&&!rs(s.bin)||ep(s)))return!0}}return!1}run(e,n,r){const{encoding:i,mark:o}=e;return Ze(_Wt(!!i.x2,!!i.y2)),r({...e,mark:ht(o)?{...o,type:"rule"}:"rule"},n)}}class C7t extends bae{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[E9t,A9t,$9t,new w7t,new S7t]}map(e,n){if(nm(e)){const r=Vx(e.encoding,fg),i=Vx(e.encoding,dg),o=Vx(e.encoding,h6);if(r||i||o)return this.mapFacetedUnit(e,n)}return super.map(e,n)}mapUnit(e,n){const{parentEncoding:r,parentProjection:i}=n,o=YV(e.encoding,n.repeater),s={...e,...e.name?{name:[n.repeaterPrefix,e.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(s,n.config))return l.run(s,n,a);return s}mapRepeat(e,n){return c7t(e)?this.mapLayerRepeat(e,n):this.mapNonLayerRepeat(e,n)}mapLayerRepeat(e,n){const{repeat:r,spec:i,...o}=e,{row:s,column:a,layer:l}=r,{repeater:c={},repeaterPrefix:u=""}=n;return s||a?this.mapRepeat({...e,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:i}},n):{...o,layer:l.map(f=>{const d={...c,layer:f},h=`${(i.name?`${i.name}_`:"")+u}child__layer_${gi(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(e,n){const{repeat:r,spec:i,data:o,...s}=e;!We(r)&&e.columns&&(e=pl(e,["columns"]),Ze(Eye("repeat")));const a=[],{repeater:l={},repeaterPrefix:c=""}=n,u=!We(r)&&r.row||[l?l.row:null],f=!We(r)&&r.column||[l?l.column:null],d=We(r)&&r||[l?l.repeat:null];for(const p of d)for(const g of u)for(const m of f){const v={repeat:p,row:g,column:m,layer:l.layer},y=(i.name?`${i.name}_`:"")+c+"child__"+(We(r)?`${gi(p)}`:(r.row?`row_${gi(g)}`:"")+(r.column?`column_${gi(m)}`:"")),x=this.map(i,{...n,repeater:v,repeaterPrefix:y});x.name=y,a.push(pl(x,["data"]))}const h=We(r)?e.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(e,n){const{facet:r}=e;return BR(r)&&e.columns&&(e=pl(e,["columns"]),Ze(Eye("facet"))),super.mapFacet(e,n)}mapUnitWithParentEncodingOrProjection(e,n){const{encoding:r,projection:i}=e,{parentEncoding:o,parentProjection:s,config:a}=n,l=Yye({parentProjection:s,projection:i}),c=Xye({parentEncoding:o,encoding:YV(r,n.repeater)});return this.mapUnit({...e,...l?{projection:l}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(e,n){const{row:r,column:i,facet:o,...s}=e.encoding,{mark:a,width:l,projection:c,height:u,view:f,params:d,encoding:h,...p}=e,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),v=YV(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...u?{height:u}:{},...f?{view:f}:{},...c?{projection:c}:{},mark:a,encoding:v,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(e,n){const{row:r,column:i,facet:o}=e;if(r||i){o&&Ze(bWt([...r?[fg]:[],...i?[dg]:[]]));const s={},a={};for(const l of[fg,dg]){const c=e[l];if(c){const{align:u,center:f,spacing:d,columns:h,...p}=c;s[l]=p;for(const g of["align","center","spacing"])c[g]!==void 0&&(a[g]??(a[g]={}),a[g][l]=c[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:l,columns:c,...u}=o;return{facetMapping:_7t(u,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...l?{spacing:l}:{},...c?{columns:c}:{}}}}}mapLayer(e,{parentEncoding:n,parentProjection:r,...i}){const{encoding:o,projection:s,...a}=e,l={...i,parentEncoding:Xye({parentEncoding:n,encoding:o,layer:!0}),parentProjection:Yye({parentProjection:r,projection:s})};return super.mapLayer({...a,...e.name?{name:[l.repeaterPrefix,e.name].filter(c=>c).join("_")}:{}},l)}}function Xye({parentEncoding:t,encoding:e={},layer:n}){let r={};if(t){const i=new Set([...Qe(t),...Qe(e)]);for(const o of i){const s=e[o],a=t[o];if(en(s)){const l={...a,...s};r[o]=l}else WR(s)?r[o]={...s,condition:{...a,...s.condition}}:s||s===null?r[o]=s:(n||qf(a)||Rt(a)||en(a)||We(a))&&(r[o]=a)}}else r=e;return!r||Tr(r)?void 0:r}function Yye(t){const{parentProjection:e,projection:n}=t;return e&&n&&Ze(cWt({parentProjection:e,projection:n})),n??e}function wae(t){return Ke(t,"filter")}function O7t(t){return Ke(t,"stop")}function ZBe(t){return Ke(t,"lookup")}function E7t(t){return Ke(t,"data")}function T7t(t){return Ke(t,"param")}function k7t(t){return Ke(t,"pivot")}function A7t(t){return Ke(t,"density")}function P7t(t){return Ke(t,"quantile")}function M7t(t){return Ke(t,"regression")}function R7t(t){return Ke(t,"loess")}function D7t(t){return Ke(t,"sample")}function I7t(t){return Ke(t,"window")}function L7t(t){return Ke(t,"joinaggregate")}function $7t(t){return Ke(t,"flatten")}function F7t(t){return Ke(t,"calculate")}function JBe(t){return Ke(t,"bin")}function N7t(t){return Ke(t,"impute")}function z7t(t){return Ke(t,"timeUnit")}function j7t(t){return Ke(t,"aggregate")}function B7t(t){return Ke(t,"stack")}function U7t(t){return Ke(t,"fold")}function W7t(t){return Ke(t,"extent")&&!Ke(t,"density")&&!Ke(t,"regression")}function V7t(t){return t.map(e=>wae(e)?{filter:V_(e.filter,gVt)}:e)}class G7t extends bae{map(e,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),e=Qye(e,n),super.map(e,n)}mapLayerOrUnit(e,n){if(e=Qye(e,n),e.encoding){const r={};for(const[i,o]of hy(e.encoding))r[i]=e6e(o,n);e={...e,encoding:r}}return super.mapLayerOrUnit(e,n)}mapUnit(e,n){const{selection:r,...i}=e;return r?{...i,params:hy(r).map(([o,s])=>{const{init:a,bind:l,empty:c,...u}=s;u.type==="single"?(u.type="point",u.toggle=!1):u.type==="multi"&&(u.type="point"),n.emptySelections[o]=c!=="none";for(const f of ws(n.selectionPredicates[o]??{}))f.empty=c!=="none";return{name:o,value:a,select:u,bind:l}})}:e}}function Qye(t,e){const{transform:n,...r}=t;if(n){const i=n.map(o=>{if(wae(o))return{filter:QY(o,e)};if(JBe(o)&&b1(o.bin))return{...o,bin:t6e(o.bin)};if(ZBe(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...r,transform:i}}return t}function e6e(t,e){var r,i;const n=Kt(t);if(Je(n)&&b1(n.bin)&&(n.bin=t6e(n.bin)),C1(n)&&((i=(r=n.scale)==null?void 0:r.domain)!=null&&i.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(UR(n))if(We(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:l,...c}=o;return a?o:{...c,test:QY(o,e)}});else{const{selection:o,param:s,test:a,...l}=e6e(n.condition,e);n.condition=s?n.condition:{...l,test:QY(n.condition,e)}}return n}function t6e(t){const e=t.extent;if(e!=null&&e.selection){const{selection:n,...r}=e;return{...t,extent:{...r,param:n}}}return t}function QY(t,e){const n=r=>V_(r,i=>{var o;const s=e.emptySelections[i]??!0,a={param:i,empty:s};return(o=e.selectionPredicates)[i]??(o[i]=[]),e.selectionPredicates[i].push(a),a});return t.selection?n(t.selection):V_(t.test||t.filter,r=>r.selection?n(r.selection):r)}class KY extends bae{map(e,n){const r=n.selections??[];if(e.params&&!nm(e)){const i=[];for(const o of e.params)vae(o)?r.push(o):i.push(o);e.params=i}return n.selections=r,super.map(e,n)}mapUnit(e,n){const r=n.selections;if(!r||!r.length)return e;const i=(n.path??[]).concat(e.name),o=[];for(const s of r)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(gt(a)&&(a===e.name||i.includes(a))||We(a)&&a.map(l=>i.indexOf(l)).every((l,c,u)=>l!==-1&&(c===0||l>u[c-1])))&&o.push(s);return o.length&&(e.params=o),e}}for(const t of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const e=KY.prototype[t];KY.prototype[t]=function(n,r){return e.call(this,n,H7t(n,r))}}function H7t(t,e){return t.name?{...e,path:(e.path??[]).concat(t.name)}:e}function n6e(t,e){e===void 0&&(e=qBe(t.config));const n=Q7t(t,e),{width:r,height:i}=t,o=K7t(n,{width:r,height:i,autosize:t.autosize},e);return{...n,...o?{autosize:o}:{}}}const q7t=new C7t,X7t=new G7t,Y7t=new KY;function Q7t(t,e={}){const n={config:e};return Y7t.map(q7t.map(X7t.map(t,n),n),n)}function Kye(t){return gt(t)?{type:t}:t??{}}function K7t(t,e,n){let{width:r,height:i}=e;const o=nm(t)||$6(t),s={};o?r=="container"&&i=="container"?(s.type="fit",s.contains="padding"):r=="container"?(s.type="fit-x",s.contains="padding"):i=="container"&&(s.type="fit-y",s.contains="padding"):(r=="container"&&(Ze(_ye("width")),r=void 0),i=="container"&&(Ze(_ye("height")),i=void 0));const a={type:"pad",...s,...n?Kye(n.autosize):{},...Kye(t.autosize)};if(a.type==="fit"&&!o&&(Ze(H8t),a.type="pad"),r=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Ze(Sye("width")),i=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Ze(Sye("height")),!sc(a,{type:"pad"}))return a}function Z7t(t){return["fit","fit-x","fit-y"].includes(t)}function J7t(t){return t?`fit-${y6(t)}`:"fit"}const eGt=["background","padding"];function Zye(t,e){const n={};for(const r of eGt)t&&t[r]!==void 0&&(n[r]=tc(t[r]));return e&&(n.params=t.params),n}class rm{constructor(e={},n={}){this.explicit=e,this.implicit=n}clone(){return new rm(Kt(this.explicit),Kt(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return qi(this.explicit[e],this.implicit[e])}getWithExplicit(e){return this.explicit[e]!==void 0?{explicit:!0,value:this.explicit[e]}:this.implicit[e]!==void 0?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,{value:n,explicit:r}){n!==void 0&&this.set(e,n,r)}set(e,n,r){return delete this[r?"implicit":"explicit"][e],this[r?"explicit":"implicit"][e]=n,this}copyKeyFromSplit(e,{explicit:n,implicit:r}){n[e]!==void 0?this.set(e,n[e],!0):r[e]!==void 0&&this.set(e,r[e],!1)}copyKeyFromObject(e,n){n[e]!==void 0&&this.set(e,n[e],!0)}copyAll(e){for(const n of Qe(e.combine())){const r=e.getWithExplicit(n);this.setWithExplicit(n,r)}}}function Md(t){return{explicit:!0,value:t}}function Vl(t){return{explicit:!1,value:t}}function r6e(t){return(e,n,r,i)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:F6(e,n,r,i)}}function F6(t,e,n,r){return t.explicit&&e.explicit&&Ze(RWt(n,r,t.value,e.value)),t}function my(t,e,n,r,i=F6){return t===void 0||t.value===void 0?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:sc(t.value,e.value)?t:i(t,e,n,r)}class tGt extends rm{constructor(e={},n={},r=!1){super(e,n),this.explicit=e,this.implicit=n,this.parseNothing=r}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function fC(t){return Ke(t,"url")}function YA(t){return Ke(t,"values")}function i6e(t){return Ke(t,"name")&&!fC(t)&&!YA(t)&&!Wv(t)}function Wv(t){return t&&(o6e(t)||s6e(t)||_ae(t))}function o6e(t){return Ke(t,"sequence")}function s6e(t){return Ke(t,"sphere")}function _ae(t){return Ke(t,"graticule")}var $i;(function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup",t[t.PreFilterInvalid=5]="PreFilterInvalid",t[t.PostFilterInvalid=6]="PostFilterInvalid"})($i||($i={}));function a6e({invalid:t,isPath:e}){switch(nBe(t,{isPath:e})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:e?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:e?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function nGt(t){const{marks:e,scales:n}=a6e(t);return e===n?$i.Main:n==="include-invalid-values"?$i.PreFilterInvalid:$i.PostFilterInvalid}function l6e(t){const{signals:e,hasLegend:n,index:r,...i}=t;return i.field=Pu(i.field),i}function Mb(t,e=!0,n=na){if(We(t)){const r=t.map(i=>Mb(i,e,n));return e?`[${r.join(", ")}]`:r}else if(_1(t))return n(e?Tb(t):rVt(t));return e?n(kr(t)):t}function rGt(t,e){for(const n of ws(t.component.selection??{})){const r=n.name;let i=`${r}${vy}, ${n.resolve==="global"?"true":`{unit: ${Gx(t)}}`}`;for(const o of B6)o.defined(n)&&(o.signals&&(e=o.signals(t,n,e)),o.modifyExpr&&(i=o.modifyExpr(t,n,i)));e.push({name:r+DGt,on:[{events:{signal:n.name+vy},update:`modify(${rt(n.name+Rb)}, ${i})`}]})}return Sae(e)}function iGt(t,e){if(t.component.selection&&Qe(t.component.selection).length){const n=rt(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:Qy("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Sae(e)}function oGt(t,e){let n=!1;for(const r of ws(t.component.selection??{})){const i=r.name,o=rt(i+Rb);if(e.filter(a=>a.name===i).length===0){const a=r.resolve==="global"?"union":r.resolve,l=r.type==="point"?", true, true)":")";e.push({name:r.name,update:`${E6e}(${o}, ${rt(a)}${l}`})}n=!0;for(const a of B6)a.defined(r)&&a.topLevelSignals&&(e=a.topLevelSignals(t,r,e))}return n&&e.filter(i=>i.name==="unit").length===0&&e.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Sae(e)}function sGt(t,e){const n=[...e],r=Gx(t,{escape:!1});for(const i of ws(t.component.selection??{})){const o={name:i.name+Rb};if(i.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Yf}}]),i.init){const a=i.project.items.map(l6e);o.values=i.project.hasSelectionId?i.init.map(l=>({unit:r,[Yf]:Mb(l,!1)[0]})):i.init.map(l=>({unit:r,fields:a,values:Mb(l,!1)}))}n.filter(a=>a.name===i.name+Rb).length||n.push(o)}return n}function c6e(t,e){for(const n of ws(t.component.selection??{}))for(const r of B6)r.defined(n)&&r.marks&&(e=r.marks(t,n,e));return e}function aGt(t,e){for(const n of t.children)_i(n)&&(e=c6e(n,e));return e}function lGt(t,e,n,r){const i=M6e(t,e.param,e);return{signal:Hf(n.get("type"))&&We(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function Sae(t){return t.map(e=>(e.on&&!e.on.length&&delete e.on,e))}class Sr{constructor(e,n){this.debugName=n,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,n){if(this._children.includes(e)){Ze(sWt);return}n!==void 0?this._children.splice(n,0,e):this._children.push(e)}removeChild(e){const n=this._children.indexOf(e);return this._children.splice(n,1),n}remove(){let e=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,e++)}insertAsParentOf(e){const n=e.parent;n.removeChild(this),this.parent=n,e.parent=this}swapWithParent(){const e=this._parent,n=e.parent;for(const i of this._children)i.parent=e;this._children=[],e.removeChild(this);const r=e.parent.removeChild(e);this._parent=n,n.addChild(this,r),e.parent=this}}class gl extends Sr{clone(){const e=new this.constructor;return e.debugName=`clone_${this.debugName}`,e._source=this._source,e._name=`clone_${this._name}`,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,n,r,i){super(e,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${r4e()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}function QV(t){return t.as!==void 0}function Jye(t){return`${t}_end`}class bh extends Sr{clone(){return new bh(null,Kt(this.timeUnits))}constructor(e,n){super(e),this.timeUnits=n}static makeFromEncoding(e,n){const r=n.reduceFieldDef((i,o,s)=>{const{field:a,timeUnit:l}=o;if(l){let c;if(S1(l)){if(_i(n)){const{mark:u,markDef:f,config:d}=n,h=gy({fieldDef:o,markDef:f,config:d});(XA(u)||h)&&(c={timeUnit:Vo(l),field:a})}}else c={as:ct(o,{forAs:!0}),field:a,timeUnit:l};if(_i(n)){const{mark:u,markDef:f,config:d}=n,h=gy({fieldDef:o,markDef:f,config:d});XA(u)&&Xi(s)&&h!==.5&&(c.rectBandPosition=h)}c&&(i[Mn(c)]=c)}return i},{});return Tr(r)?null:new bh(e,r)}static makeFromTransform(e,n){const{timeUnit:r,...i}={...n},o=Vo(r),s={...i,timeUnit:o};return new bh(e,{[Mn(s)]:s})}merge(e){this.timeUnits={...this.timeUnits};for(const n in e.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=e.timeUnits[n]);for(const n of e.children)e.removeChild(n),n.parent=this;e.remove()}removeFormulas(e){const n={};for(const[r,i]of hy(this.timeUnits)){const o=QV(i)?i.as:`${i.field}_end`;e.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(ws(this.timeUnits).map(e=>QV(e)?e.as:Jye(e.field)))}dependentFields(){return new Set(ws(this.timeUnits).map(e=>e.field))}hash(){return`TimeUnit ${Mn(this.timeUnits)}`}assemble(){const e=[];for(const n of ws(this.timeUnits)){const{rectBandPosition:r}=n,i=Vo(n.timeUnit);if(QV(n)){const{field:o,as:s}=n,{unit:a,utc:l,...c}=i,u=[s,`${s}_end`];e.push({field:Pu(o),type:"timeunit",...a?{units:_6(a)}:{},...l?{timezone:"utc"}:{},...c,as:u}),e.push(...e0e(u,r,i))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=u6e({timeUnit:i,field:s}),l=Jye(s);e.push({type:"formula",expr:a,as:l}),e.push(...e0e([s,l],r,i))}}return e}}const N6="offsetted_rect_start",z6="offsetted_rect_end";function u6e({timeUnit:t,field:e,reverse:n}){const{unit:r,utc:i}=t,o=N4e(r),{part:s,step:a}=U4e(o,t.step);return`${i?"utcOffset":"timeOffset"}('${s}', datum['${e}'], ${n?-a:a})`}function e0e([t,e],n,r){if(n!==void 0&&n!==.5){const i=`datum['${t}']`,o=`datum['${e}']`;return[{type:"formula",expr:t0e([u6e({timeUnit:r,field:t,reverse:!0}),i],n+.5),as:`${t}_${N6}`},{type:"formula",expr:t0e([i,o],n+.5),as:`${t}_${z6}`}]}return[]}function t0e([t,e],n){return`${1-n} * ${t} + ${n} * ${e}`}const HR="_tuple_fields";class cGt{constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const uGt={defined:()=>!0,parse:(t,e,n)=>{const r=e.name,i=e.project??(e.project=new cGt),o={},s={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let v=gi(`${r}_${m}`);for(let y=1;a.has(v);y++)v=gi(`${r}_${m}_${y}`);return a.add(v),{[g]:v}},c=e.type,u=t.config.selection[c],f=n.value!==void 0?pt(n.value):null;let{fields:d,encodings:h}=ht(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ht(p))for(const g of Qe(p))w8t(g)?(h||(h=[])).push(g):c==="interval"?(Ze(nWt),h=u.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=u.encodings,"fields"in u&&(d=u.fields));for(const p of h??[]){const g=t.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Ze(q8t(p,g.aggregate));continue}else if(!m){Ze(Oye(p));continue}if(g.timeUnit&&!S1(g.timeUnit)){m=t.vgField(p);const v={timeUnit:g.timeUnit,as:m,field:g.field};s[Mn(v)]=v}if(!o[m]){const v=c==="interval"&&Jh(p)&&Hf(t.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",y={field:m,channel:p,type:v,index:i.items.length};y.signals={...l(y,"data"),...l(y,"visual")},i.items.push(o[m]=y),i.hasField[m]=o[m],i.hasSelectionId=i.hasSelectionId||m===Yf,c4e(p)?(y.geoChannel=p,y.channel=l4e(p),i.hasChannel[y.channel]=o[m]):i.hasChannel[p]=o[m]}}else Ze(Oye(p))}for(const p of d??[]){if(i.hasField[p])continue;const g={type:"E",field:p,index:i.items.length};g.signals={...l(g,"data")},i.items.push(g),i.hasField[p]=g,i.hasSelectionId=i.hasSelectionId||p===Yf}f&&(e.init=f.map(p=>i.items.map(g=>ht(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Tr(s)||(i.timeUnit=new bh(null,s))},signals:(t,e,n)=>{const r=e.name+HR;return n.filter(o=>o.name===r).length>0||e.project.hasSelectionId?n:n.concat({name:r,value:e.project.items.map(l6e)})}},pg={defined:t=>t.type==="interval"&&t.resolve==="global"&&t.bind&&t.bind==="scales",parse:(t,e)=>{const n=e.scales=[];for(const r of e.project.items){const i=r.channel;if(!Jh(i))continue;const o=t.getScaleComponent(i),s=o?o.get("type"):void 0;if(s=="sequential"&&Ze(K8t),!o||!Hf(s)){Ze(Q8t);continue}o.set("selectionExtent",{param:e.name,field:r.field},!0),n.push(r)}},topLevelSignals:(t,e,n)=>{const r=e.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!t.parent||n0e(t)||r.length===0)return n;const i=n.find(s=>s.name===e.name);let o=i.update;if(o.includes(E6e))i.update=`{${r.map(s=>`${rt(Pu(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of r){const a=`${rt(Pu(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}i.update=o}return n.concat(r.map(s=>({name:s.signals.data})))},signals:(t,e,n)=>{if(t.parent&&!n0e(t))for(const r of e.scales){const i=n.find(o=>o.name===r.signals.data);i.push="outer",delete i.value,delete i.update}return n}};function ZY(t,e){return`domain(${rt(t.scaleName(e))})`}function n0e(t){return t.parent&&UO(t.parent)&&!t.parent.parent}const q_="_brush",f6e="_scale_trigger",f2="geo_interval_init_tick",d6e="_init",fGt="_center",dGt={defined:t=>t.type==="interval",parse:(t,e,n)=>{var r;if(t.hasProjection){const i={...ht(n.select)?n.select:{}};i.fields=[Yf],i.encodings||(i.encodings=n.value?Qe(n.value):[cd,ld]),n.select={type:"interval",...i}}if(e.translate&&!pg.defined(e)){const i=`!event.item || event.item.mark.name !== ${rt(e.name+q_)}`;for(const o of e.events){if(!o.between){Ze(`${o} is not an ordered event stream for interval selections.`);continue}const s=pt((r=o.between[0]).filter??(r.filter=[]));s.includes(i)||s.push(i)}}},signals:(t,e,n)=>{const r=e.name,i=r+vy,o=ws(e.project.hasChannel).filter(a=>a.channel===xi||a.channel===Qo),s=e.init?e.init[0]:null;if(n.push(...o.reduce((a,l)=>a.concat(hGt(t,e,l,s&&s[l.index])),[])),t.hasProjection){const a=rt(t.projectionName()),l=t.projectionName()+fGt,{x:c,y:u}=e.project.hasChannel,f=c&&c.signals.visual,d=u&&u.signals.visual,h=c?s&&s[c.index]:`${l}[0]`,p=u?s&&s[u.index]:`${l}[1]`,g=w=>t.getSizeSignalRef(w).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;s&&(n.unshift({name:r+d6e,init:`[scale(${a}, [${c?h[0]:h}, ${u?p[0]:p}]), scale(${a}, [${c?h[1]:h}, ${u?p[1]:p}])]`}),(!c||!u)&&(n.find(_=>_.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const v=`intersect(${m}, {markname: ${rt(t.getName("marks"))}}, unit.mark)`,y=`{unit: ${Gx(t)}}`,x=`vlSelectionTuples(${v}, ${y})`,b=o.map(w=>w.signals.visual);return n.concat({name:i,on:[{events:[...b.length?[{signal:b.join(" || ")}]:[],...s?[{signal:f2}]:[]],update:x}]})}else{if(!pg.defined(e)){const c=r+f6e,u=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=rt(t.scaleName(d)),m=t.getScaleComponent(d).get("type"),v=Hf(m)?"+":"";return`(!isArray(${h}) || (${v}invert(${g}, ${p})[0] === ${v}${h}[0] && ${v}invert(${g}, ${p})[1] === ${v}${h}[1]))`});u.length&&n.push({name:c,value:{},on:[{events:o.map(f=>({scale:t.scaleName(f.channel)})),update:u.join(" && ")+` ? ${c} : {}`}]})}const a=o.map(c=>c.signals.data),l=`unit: ${Gx(t)}, fields: ${r+HR}, values`;return n.concat({name:i,...s?{init:`{${l}: ${Mb(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(t,e,n)=>(_i(t)&&t.hasProjection&&e.init&&(n.filter(i=>i.name===f2).length||n.unshift({name:f2,value:null,on:[{events:"timer{1}",update:`${f2} === null ? {} : ${f2}`}]})),n),marks:(t,e,n)=>{const r=e.name,{x:i,y:o}=e.project.hasChannel,s=i==null?void 0:i.signals.visual,a=o==null?void 0:o.signals.visual,l=`data(${rt(e.name+Rb)})`;if(pg.defined(e)||!i&&!o)return n;const c={x:i!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:i!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(e.resolve==="global")for(const m of Qe(c))c[m]=[{test:`${l}.length && ${l}[0].unit === ${Gx(t)}`,...c[m]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=e.mark,p=Qe(h).reduce((m,v)=>(m[v]=[{test:[i!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[v]},{value:null}],m),{}),g=d??(e.translate?"move":null);return[{name:`${r+q_}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:c}},...n,{name:r+q_,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}};function hGt(t,e,n,r){const i=!t.hasProjection,o=n.channel,s=n.signals.visual,a=rt(i?t.scaleName(o):t.projectionName()),l=d=>`scale(${a}, ${d})`,c=t.getSizeSignalRef(o===xi?"width":"height").signal,u=`${o}(unit)`,f=e.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${u}, ${u}]`},{events:h,update:`[${s}[0], clamp(${u}, 0, ${c})]`}],[]);if(i){const d=n.signals.data,h=pg.defined(e),p=t.getScaleComponent(o),g=p?p.get("type"):void 0,m=r?{init:Mb(r,!0,l)}:{value:[]};return f.push({events:{signal:e.name+f6e},update:Hf(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...r?{init:Mb(r)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===xi?0:1,h=e.name+d6e,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}const pGt={defined:t=>t.type==="point",signals:(t,e,n)=>{const r=e.name,i=r+HR,o=e.project,s="(item().isVoronoi ? datum.datum : datum)",a=ws(t.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+q_):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let c=`unit: ${Gx(t)}, `;if(e.project.hasSelectionId)c+=`${Yf}: ${s}[${rt(Yf)}]`;else{const f=o.items.map(d=>{const h=t.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${rt(t.vgField(d.channel,{}))}], ${s}[${rt(t.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${rt(d.field)}]`}).join(", ");c+=`fields: ${i}, values: [${f}]`}const u=e.events;return n.concat([{name:r+vy,on:u?[{events:u,update:`${l} ? {${c}} : null`,force:!0}]:[]}])}};function NO({model:t,channelDef:e,vgChannel:n,invalidValueRef:r,mainRefFn:i}){const o=UR(e)&&e.condition;let s=[];o&&(s=pt(o).map(c=>{const u=i(c);if(r9t(c)){const{param:f,empty:d}=c;return{test:P6e(t,{param:f,empty:d}),...u}}else return{test:W5(t,c.test),...u}})),r!==void 0&&s.push(r);const a=i(e);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function Cae(t,e="text"){const n=t.encoding[e];return NO({model:t,channelDef:n,vgChannel:e,mainRefFn:r=>j6(r,t.config),invalidValueRef:void 0})}function j6(t,e,n="datum"){if(t){if(qf(t))return ni(t.value);if(en(t)){const{format:r,formatType:i}=F5(t);return iae({fieldOrDatumDef:t,format:r,formatType:i,expr:n,config:e})}}}function h6e(t,e={}){const{encoding:n,markDef:r,config:i,stack:o}=t,s=n.tooltip;if(We(s))return{tooltip:r0e({tooltip:s},o,i,e)};{const a=e.reactiveGeom?"datum.datum":"datum";return NO({model:t,channelDef:s,vgChannel:"tooltip",mainRefFn:c=>{const u=j6(c,i,a);if(u)return u;if(c===null)return;let f=Er("tooltip",r,i);if(f===!0&&(f={content:"encoding"}),gt(f))return{value:f};if(ht(f))return Rt(f)?f:f.content==="encoding"?r0e(n,o,i,e):{signal:a}},invalidValueRef:void 0})}}function p6e(t,e,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o=new Set,s=r?"datum.datum":"datum",a=[];function l(u,f){const d=x1(f),h=Ra(u)?u:{...u,type:t[d].type},p=h.title||lae(h,i),g=pt(p).join(", ").replaceAll(/"/g,'\\"');let m;if(Xi(f)){const v=f==="x"?"x2":"y2",y=Xf(t[v]);if(rs(h.bin)&&y){const x=ct(h,{expr:s}),b=ct(y,{expr:s}),{format:w,formatType:_}=F5(h);m=jR(x,b,w,_,i),o.add(v)}}if((Xi(f)||f===zu||f===ad)&&e&&e.fieldChannel===f&&e.offset==="normalize"){const{format:v,formatType:y}=F5(h);m=iae({fieldOrDatumDef:h,format:v,formatType:y,expr:s,config:i,normalizeStack:!0}).signal}m??(m=j6(h,i,s).signal),a.push({channel:f,key:g,value:m})}uae(t,(u,f)=>{Je(u)?l(u,f):P6(u)&&l(u.condition,f)});const c={};for(const{channel:u,key:f,value:d}of a)!o.has(u)&&!c[f]&&(c[f]=d);return c}function r0e(t,e,n,{reactiveGeom:r}={}){const i=p6e(t,e,n,{reactiveGeom:r}),o=hy(i).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function gGt(t){const{markDef:e,config:n}=t,r=Er("aria",e,n);return r===!1?{}:{...r?{aria:r}:{},...mGt(t),...vGt(t)}}function mGt(t){const{mark:e,markDef:n,config:r}=t;if(r.aria===!1)return{};const i=Er("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:vt(W8t,e)?{}:{ariaRoleDescription:{value:e}}}function vGt(t){const{encoding:e,markDef:n,config:r,stack:i}=t,o=e.description;if(o)return NO({model:t,channelDef:o,vgChannel:"description",mainRefFn:l=>j6(l,t.config),invalidValueRef:void 0});const s=Er("description",n,r);if(s!=null)return{description:ni(s)};if(r.aria===!1)return{};const a=p6e(e,i,r);if(!Tr(a))return{description:{signal:hy(a).map(([l,c],u)=>`"${u>0?"; ":""}${l}: " + (${c})`).join(" + ")}}}function us(t,e,n={}){const{markDef:r,encoding:i,config:o}=e,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;const c=i[t];a===void 0&&(l??(l=Er(t,r,o,{vgChannel:s,ignoreVgConfig:!UR(c)})),l!==void 0&&(a=ni(l)));const u={markDef:r,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t)},f=iBe({...u,scaleChannel:t,channelDef:c});return NO({model:e,channelDef:c,vgChannel:s??t,invalidValueRef:f,mainRefFn:h=>rae({...u,channel:t,channelDef:h,stack:null,defaultRef:a})})}function g6e(t,e={filled:void 0}){const{markDef:n,encoding:r,config:i}=t,{type:o}=n,s=e.filled??Er("filled",n,i),a=En(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=Er(s===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[s===!0&&"color"]??a,c=Er(s===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[s===!1&&"color"],u=s?"fill":"stroke",f={...l?{fill:ni(l)}:{},...c?{stroke:ni(c)}:{}};return n.color&&(s?n.fill:n.stroke)&&Ze(A4e("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...us("color",t,{vgChannel:u,defaultValue:s?l:c}),...us("fill",t,{defaultValue:r.fill?l:void 0}),...us("stroke",t,{defaultValue:r.stroke?c:void 0})}}function yGt(t){const{encoding:e,mark:n}=t,r=e.order;return!r0(n)&&qf(r)?NO({model:t,channelDef:r,vgChannel:"zindex",mainRefFn:i=>ni(i.value),invalidValueRef:void 0}):{}}function dC({channel:t,markDef:e,encoding:n={},model:r,bandPosition:i}){const o=`${t}Offset`,s=e[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:rae({channel:o,channelDef:a,markDef:e,config:r==null?void 0:r.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:ni(s),bandPosition:i})};const l=e[o];return l?{offsetType:"visual",offset:l}:{}}function Ca(t,e,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:s,stack:a}=e,l=i[t],c=i[Zh(t)],u=e.scaleName(t),f=e.getScaleComponent(t),{offset:d,offsetType:h}=dC({channel:t,markDef:o,encoding:i,model:e,bandPosition:.5}),p=Oae({model:e,defaultPos:n,channel:t,scaleName:u,scale:f}),g=!l&&Xi(t)&&(i.latitude||i.longitude)?{field:e.getName(t)}:xGt({channel:t,channelDef:l,channel2Def:c,markDef:o,config:s,scaleName:u,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[r||t]:g}:void 0}function xGt(t){const{channel:e,channelDef:n,scaleName:r,stack:i,offset:o,markDef:s}=t;if(en(n)&&i&&e===i.fieldChannel){if(Je(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(e==="radius"||e==="theta")&&(a=.5),a!==void 0)return I5({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Wx(n,r,{suffix:"end"},{offset:o})}return nae(t)}function Oae({model:t,defaultPos:e,channel:n,scaleName:r,scale:i}){const{markDef:o,config:s}=t;return()=>{const a=x1(n),l=py(n),c=Er(n,o,s,{vgChannel:l});if(c!==void 0)return vk(n,c);switch(e){case"zeroOrMin":return i0e({scaleName:r,scale:i,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return i0e({scaleName:r,scale:i,mode:{zeroOrMax:{widthSignal:t.width.signal,heightSignal:t.height.signal}},mainChannel:a,config:s});case"mid":return{...t[El(n)],mult:.5}}}}function i0e({mainChannel:t,config:e,...n}){const r=rBe(n),{mode:i}=n;if(r)return r;switch(t){case"radius":{if(i==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=i.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return i==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return i==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return i==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const bGt={left:"x",center:"xc",right:"x2"},wGt={top:"y",middle:"yc",bottom:"y2"};function m6e(t,e,n,r="middle"){if(t==="radius"||t==="theta")return py(t);const i=t==="x"?"align":"baseline",o=Er(i,e,n);let s;return Rt(o)?(Ze(wWt(i)),s=void 0):s=o,t==="x"?bGt[s||(r==="top"?"left":"center")]:wGt[s||r]}function B5(t,e,{defaultPos:n,defaultPos2:r,range:i}){return i?v6e(t,e,{defaultPos:n,defaultPos2:r}):Ca(t,e,{defaultPos:n})}function v6e(t,e,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=e,s=Zh(t),a=El(t),l=_Gt(e,r,s),c=l[a]?m6e(t,i,o):py(t);return{...Ca(t,e,{defaultPos:n,vgChannel:c}),...l}}function _Gt(t,e,n){const{encoding:r,mark:i,markDef:o,stack:s,config:a}=t,l=x1(n),c=El(n),u=py(n),f=r[l],d=t.scaleName(l),h=t.getScaleComponent(l),{offset:p}=n in r||n in o?dC({channel:n,markDef:o,encoding:r,model:t}):dC({channel:l,markDef:o,encoding:r,model:t});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){const m=El(n),v=t.markDef[m];return v!=null?{[m]:{value:v}}:{[u]:{field:t.getName(n)}}}const g=SGt({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[u]:g}:rL(n,o)||rL(n,{[n]:BY(n,o,a.style),[c]:BY(c,o,a.style)})||rL(n,a[i])||rL(n,a.mark)||{[u]:Oae({model:t,defaultPos:e,channel:n,scaleName:d,scale:h})()}}function SGt({channel:t,channelDef:e,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:c}){return en(e)&&a&&t.charAt(0)===a.fieldChannel.charAt(0)?Wx(e,o,{suffix:"start"},{offset:l}):nae({channel:t,channelDef:n,scaleName:o,scale:s,stack:a,markDef:r,config:i,offset:l,defaultRef:c})}function rL(t,e){const n=El(t),r=py(t);if(e[r]!==void 0)return{[r]:vk(t,e[r])};if(e[t]!==void 0)return{[r]:vk(t,e[t])};if(e[n]){const i=e[n];if(Ab(i))Ze(gWt(n));else return{[n]:vk(t,i)}}}function jg(t,e){const{config:n,encoding:r,markDef:i}=t,o=i.type,s=Zh(e),a=El(e),l=r[e],c=r[s],u=t.getScaleComponent(e),f=u?u.get("type"):void 0,d=i.orient,h=r[a]??r.size??Er("size",i,n,{vgChannel:a}),p=h4e(e),g=o==="bar"&&(e==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(e==="y"?d==="vertical":d==="horizontal");return Je(l)&&(qr(l.bin)||rs(l.bin)||l.timeUnit&&!c)&&!(h&&!Ab(h))&&!r[p]&&!Go(f)?EGt({fieldDef:l,fieldDef2:c,channel:e,model:t}):(en(l)&&Go(f)||g)&&!c?OGt(l,e,t):v6e(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function CGt(t,e,n,r,i,o,s){if(Ab(i))if(n){const l=n.get("type");if(l==="band"){let c=`bandwidth('${e}')`;i.band!==1&&(c=`${i.band} * ${c}`);const u=Ih("minBandSize",{type:s},r);return{signal:u?`max(${Ef(u)}, ${c})`:c}}else i.band!==1&&(Ze(OWt(l)),i=void 0)}else return{mult:i.band,field:{group:t}};else{if(Rt(i))return i;if(i)return{value:i}}if(n){const l=n.get("range");if(w1(l)&&Jn(l.step))return{value:l.step-2}}if(!o){const{bandPaddingInner:l,barBandPaddingInner:c,rectBandPaddingInner:u,tickBandPaddingInner:f}=r.scale,d=qi(l,s==="tick"?f:s==="bar"?c:u);if(Rt(d))return{signal:`(1 - (${d.signal})) * ${t}`};if(Jn(d))return{signal:`${1-d} * ${t}`}}return{value:XY(r.view,t)-2}}function OGt(t,e,n){var k,E;const{markDef:r,encoding:i,config:o,stack:s}=n,a=r.orient,l=n.scaleName(e),c=n.getScaleComponent(e),u=El(e),f=Zh(e),d=h4e(e),h=n.scaleName(d),p=n.getScaleComponent(Mse(e)),g=r.type==="tick"||a==="horizontal"&&e==="y"||a==="vertical"&&e==="x";let m;(i.size||r.size)&&(g?m=us("size",n,{vgChannel:u,defaultRef:ni(r.size)}):Ze(AWt(r.type)));const v=!!m,y=fBe({channel:e,fieldDef:t,markDef:r,config:o,scaleType:(k=c||p)==null?void 0:k.get("type"),useVlSizeChannel:g});m=m||{[u]:CGt(u,h||l,p||c,o,y,!!t,r.type)};const x=((E=c||p)==null?void 0:E.get("type"))==="band"&&Ab(y)&&!v?"top":"middle",b=m6e(e,r,o,x),w=b==="xc"||b==="yc",{offset:_,offsetType:S}=dC({channel:e,markDef:r,encoding:i,model:n,bandPosition:w?.5:0}),O=nae({channel:e,channelDef:t,markDef:r,config:o,scaleName:l,scale:c,stack:s,offset:_,defaultRef:Oae({model:n,defaultPos:"mid",channel:e,scaleName:l,scale:c}),bandPosition:w?S==="encoding"?0:.5:Rt(y)?{signal:`(1-${y})/2`}:Ab(y)?(1-y.band)/2:0});if(u)return{[b]:O,...m};{const P=py(f),A=m[u],R=_?{...A,offset:_}:A;return{[b]:O,[P]:We(O)?[O[0],{...O[1],offset:R}]:{...O,offset:R}}}}function o0e(t,e,n,r,i,o,s){if(a4e(t))return 0;const a=t==="x"||t==="y2",l=a?-e/2:e/2;if(Rt(n)||Rt(i)||Rt(r)||o){const c=Ef(n),u=Ef(i),f=Ef(r),d=Ef(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${l})`:l,g=f?`${f} + `:"",m=c?`(${c} ? -1 : 1) * `:"",v=u?`(${u} + ${p})`:p;return{signal:g+m+v}}else return i=i||0,r+(n?-i-l:+i+l)}function EGt({fieldDef:t,fieldDef2:e,channel:n,model:r}){var E;const{config:i,markDef:o,encoding:s}=r,a=r.getScaleComponent(n),l=r.scaleName(n),c=a?a.get("type"):void 0,u=a.get("reverse"),f=fBe({channel:n,fieldDef:t,markDef:o,config:i,scaleType:c}),d=(E=r.component.axes[n])==null?void 0:E[0],h=(d==null?void 0:d.get("translate"))??.5,p=Xi(n)?Er("binSpacing",o,i)??0:0,g=Zh(n),m=py(n),v=py(g),y=Ih("minBandSize",o,i),{offset:x}=dC({channel:n,markDef:o,encoding:s,model:r,bandPosition:0}),{offset:b}=dC({channel:g,markDef:o,encoding:s,model:r,bandPosition:0}),w=KVt({fieldDef:t,scaleName:l}),_=o0e(n,p,u,h,x,y,w),S=o0e(g,p,u,h,b??x,y,w),O=Rt(f)?{signal:`(1-${f.signal})/2`}:Ab(f)?(1-f.band)/2:.5,k=gy({fieldDef:t,fieldDef2:e,markDef:o,config:i});if(qr(t.bin)||t.timeUnit){const P=t.timeUnit&&k!==.5;return{[v]:s0e({fieldDef:t,scaleName:l,bandPosition:O,offset:S,useRectOffsetField:P}),[m]:s0e({fieldDef:t,scaleName:l,bandPosition:Rt(O)?{signal:`1-${O.signal}`}:1-O,offset:_,useRectOffsetField:P})}}else if(rs(t.bin)){const P=Wx(t,l,{},{offset:S});if(Je(e))return{[v]:P,[m]:Wx(e,l,{},{offset:_})};if(b1(t.bin)&&t.bin.step)return{[v]:P,[m]:{signal:`scale("${l}", ${ct(t,{expr:"datum"})} + ${t.bin.step})`,offset:_}}}Ze(R4e(g))}function s0e({fieldDef:t,scaleName:e,bandPosition:n,offset:r,useRectOffsetField:i}){return I5({scaleName:e,fieldOrDatumDef:t,bandPosition:n,offset:r,...i?{startSuffix:N6,endSuffix:z6}:{}})}const TGt=new Set(["aria","width","height"]);function ju(t,e){const{fill:n=void 0,stroke:r=void 0}=e.color==="include"?g6e(t):{};return{...kGt(t.markDef,e),...a0e("fill",n),...a0e("stroke",r),...us("opacity",t),...us("fillOpacity",t),...us("strokeOpacity",t),...us("strokeWidth",t),...us("strokeDash",t),...yGt(t),...h6e(t),...Cae(t,"href"),...gGt(t)}}function a0e(t,e){return e?{[t]:e}:{}}function kGt(t,e){return U8t.reduce((n,r)=>(!TGt.has(r)&&Ke(t,r)&&e[r]!=="ignore"&&(n[r]=ni(t[r])),n),{})}function Eae(t){const{config:e,markDef:n}=t,r=new Set;if(t.forEachFieldDef((i,o)=>{var c;let s;if(!Jh(o)||!(s=t.getScaleType(o)))return;const a=x6(i.aggregate),l=tae({scaleChannel:o,markDef:n,config:e,scaleType:s,isCountAggregate:a});if(XVt(l)){const u=t.vgField(o,{expr:"datum",binSuffix:(c=t.stack)!=null&&c.impute?"mid":void 0});u&&r.add(u)}}),r.size>0)return{defined:{signal:[...r].map(o=>S6(o,!0)).join(" && ")}}}function l0e(t,e){if(e!==void 0)return{[t]:ni(e)}}const KV="voronoi",y6e={defined:t=>t.type==="point"&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName(KV)},marks:(t,e,n)=>{const{x:r,y:i}=e.project.hasChannel,o=t.mark;if(r0(o))return Ze(X8t(o)),n;const s={name:t.getName(KV),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...h6e(t,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((c,u)=>{const f=c.name??"";f===t.component.mark[0].name?a=u:f.includes(KV)&&(l=!0)}),l||n.splice(a+1,0,s),n}},x6e={defined:t=>t.type==="point"&&t.resolve==="global"&&t.bind&&t.bind!=="scales"&&!mae(t.bind),parse:(t,e,n)=>T6e(e,n),topLevelSignals:(t,e,n)=>{const r=e.name,i=e.project,o=e.bind,s=e.init&&e.init[0],a=y6e.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((l,c)=>{const u=gi(`${r}_${l.field}`);n.filter(d=>d.name===u).length||n.unshift({name:u,...s?{init:Mb(s[c])}:{value:null},on:e.events?[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${rt(l.field)}] : null`}]:[],bind:o[l.field]??o[l.channel]??o})}),n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(c=>c.name===r+vy),s=r+HR,a=i.items.map(c=>gi(`${r}_${c.field}`)),l=a.map(c=>`${c} !== null`).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},U5="_toggle",b6e={defined:t=>t.type==="point"&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+U5,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+vy,r=e.name+U5;return`${r} ? null : ${n}, `+(e.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${Gx(t)}}, `)+`${r} ? ${n} : null`}},AGt={defined:t=>t.clear!==void 0&&t.clear!==!1,parse:(t,e)=>{e.clear&&(e.clear=gt(e.clear)?Qy(e.clear,"view"):e.clear)},topLevelSignals:(t,e,n)=>{if(x6e.defined(e))for(const r of e.project.items){const i=n.findIndex(o=>o.name===gi(`${e.name}_${r.field}`));i!==-1&&n[i].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:e.clear,update:o})}if(e.type==="interval")for(const i of e.project.items){const o=n.findIndex(s=>s.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===i.signals.data);r(s,"null")}}else{let i=n.findIndex(o=>o.name===e.name+vy);r(i,"null"),b6e.defined(e)&&(i=n.findIndex(o=>o.name===e.name+U5),r(i,"false"))}return n}},w6e={defined:t=>{const e=t.resolve==="global"&&t.bind&&mae(t.bind),n=t.project.items.length===1&&t.project.items[0].field!==Yf;return e&&!n&&Ze(Z8t),e&&n},parse:(t,e,n)=>{const r=Kt(n);if(r.select=gt(r.select)?{type:r.select,toggle:e.toggle}:{...r.select,toggle:e.toggle},T6e(e,r),ht(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of e.events)a.filter=pt(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const i=qV(e.bind)?e.bind.legend:"click",o=gt(i)?Qy(i,"view"):pt(i);e.bind={legend:{merge:o}}},topLevelSignals:(t,e,n)=>{const r=e.name,i=qV(e.bind)&&e.bind.legend,o=s=>a=>{const l=Kt(a);return l.markname=s,l};for(const s of e.project.items){if(!s.hasLegend)continue;const a=`${gi(s.field)}_legend`,l=`${r}_${a}`;if(n.filter(u=>u.name===l).length===0){const u=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:l,...e.init?{}:{value:null},on:[{events:u,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(d=>d.name===r+vy),s=r+HR,a=i.items.filter(d=>d.hasLegend).map(d=>gi(`${r}_${gi(d.field)}_legend`)),c=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;e.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:c}):a.length>0&&(o.update=c,delete o.value,delete o.on);const u=n.find(d=>d.name===r+U5),f=qV(e.bind)&&e.bind.legend;return u&&(e.events?u.on.push({...u.on[0],events:f}):u.on[0].events=f),n}};function PGt(t,e,n){var i;const r=(i=t.fieldDef(e))==null?void 0:i.field;for(const o of ws(t.component.selection??{})){const s=o.project.hasField[r]??o.project.hasChannel[e];if(s&&w6e.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const _6e="_translate_anchor",S6e="_translate_delta",MGt={defined:t=>t.type==="interval"&&t.translate,signals:(t,e,n)=>{const r=e.name,i=pg.defined(e),o=r+_6e,{x:s,y:a}=e.project.hasChannel;let l=Qy(e.translate,"scope");return i||(l=l.map(c=>(c.between[0].markname=r+q_,c))),n.push({name:o,value:{},on:[{events:l.map(c=>c.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${i?ZY(t,xi):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${i?ZY(t,Qo):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:r+S6e,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&c0e(t,e,s,"width",n),a!==void 0&&c0e(t,e,a,"height",n),n}};function c0e(t,e,n,r,i){const o=e.name,s=o+_6e,a=o+S6e,l=n.channel,c=pg.defined(e),u=i.find(w=>w.name===n.signals[c?"data":"visual"]),f=t.getSizeSignalRef(r).signal,d=t.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=c?l===xi?p?"":"-":p?"-":"":"",m=`${s}.extent_${l}`,v=`${g}${a}.${l} / ${c?`${f}`:`span(${m})`}`,y=!c||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",x=c?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",b=`${y}(${m}, ${v}${x})`;u.on.push({events:{signal:a},update:c?b:`clampRange(${b}, 0, ${f})`})}const C6e="_zoom_anchor",O6e="_zoom_delta",RGt={defined:t=>t.type==="interval"&&t.zoom,signals:(t,e,n)=>{const r=e.name,i=pg.defined(e),o=r+O6e,{x:s,y:a}=e.project.hasChannel,l=rt(t.scaleName(xi)),c=rt(t.scaleName(Qo));let u=Qy(e.zoom,"scope");return i||(u=u.map(f=>(f.markname=r+q_,f))),n.push({name:r+C6e,on:[{events:u,update:i?"{"+[l?`x: invert(${l}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&u0e(t,e,s,"width",n),a!==void 0&&u0e(t,e,a,"height",n),n}};function u0e(t,e,n,r,i){const o=e.name,s=n.channel,a=pg.defined(e),l=i.find(y=>y.name===n.signals[a?"data":"visual"]),c=t.getSizeSignalRef(r).signal,u=t.getScaleComponent(s),f=u&&u.get("type"),d=a?ZY(t,s):l.name,h=o+O6e,p=`${o}${C6e}.${s}`,g=!a||!u?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${u.get("exponent")??1}`:f==="symlog"?`, ${u.get("constant")??1}`:"":"",v=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?v:`clampRange(${v}, 0, ${c})`})}const Rb="_store",vy="_tuple",DGt="_modify",E6e="vlSelectionResolve",B6=[pGt,dGt,uGt,b6e,x6e,pg,w6e,AGt,MGt,RGt,y6e];function IGt(t){let e=t.parent;for(;e&&!gc(e);)e=e.parent;return e}function Gx(t,{escape:e}={escape:!0}){let n=e?rt(t.name):t.name;const r=IGt(t);if(r){const{facet:i}=r;for(const o of su)i[o]&&(n+=` + '__facet_${o}_' + (facet[${rt(r.vgField(o))}])`)}return n}function Tae(t){return ws(t.component.selection??{}).reduce((e,n)=>e||n.project.hasSelectionId,!1)}function T6e(t,e){(gt(e.select)||!e.select.on)&&delete t.events,(gt(e.select)||!e.select.clear)&&delete t.clear,(gt(e.select)||!e.select.toggle)&&delete t.toggle}function JY(t){const e=[];return t.type==="Identifier"?[t.name]:t.type==="Literal"?[t.value]:(t.type==="MemberExpression"&&(e.push(...JY(t.object)),e.push(...JY(t.property))),e)}function k6e(t){return t.object.type==="MemberExpression"?k6e(t.object):t.object.name==="datum"}function A6e(t){const e=qoe(t),n=new Set;return e.visit(r=>{r.type==="MemberExpression"&&k6e(r)&&n.add(JY(r).slice(1).join("."))}),n}class zO extends Sr{clone(){return new zO(null,this.model,Kt(this.filter))}constructor(e,n,r){super(e),this.model=n,this.filter=r,this.expr=W5(this.model,this.filter,this),this._dependentFields=A6e(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function LGt(t,e){const n={},r=t.config.selection;if(!e||!e.length)return n;for(const i of e){const o=gi(i.name),s=i.select,a=gt(s)?s:s.type,l=ht(s)?Kt(s):{type:a},c=r[a];for(const d in c)d==="fields"||d==="encodings"||(d==="mark"&&(l.mark={...c.mark,...l.mark}),(l[d]===void 0||l[d]===!0)&&(l[d]=Kt(c[d]??l[d])));const u=n[o]={...l,name:o,type:a,init:i.value,bind:i.bind,events:gt(l.on)?Qy(l.on,"scope"):pt(Kt(l.on))},f=Kt(i);for(const d of B6)d.defined(u)&&d.parse&&d.parse(t,u,f)}return n}function P6e(t,e,n,r="datum"){const i=gt(e)?e:e.param,o=gi(i),s=rt(o+Rb);let a;try{a=t.getSelectionComponent(o,i)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??t.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",c=a.resolve==="global"?")":`, ${rt(a.resolve)})`,u=`${l}${s}, ${r}${c}`,f=`length(data(${s}))`;return e.empty===!1?`${f} && ${u}`:`!${f} || ${u}`}function M6e(t,e,n){const r=gi(e),i=n.encoding;let o=n.field,s;try{s=t.getSelectionComponent(r,e)}catch{return r}if(!i&&!o)o=s.project.items[0].field,s.project.items.length>1&&Ze(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${rt(o)}.`);else if(i&&!o){const a=s.project.items.filter(l=>l.channel===i);!a.length||a.length>1?(o=s.project.items[0].field,Ze((a.length?"Multiple ":"No ")+`matching ${rt(i)} encoding found for selection ${rt(n.param)}. Using "field": ${rt(o)}.`)):o=a[0].field}return`${s.name}[${rt(Pu(o))}]`}function $Gt(t,e){for(const[n,r]of hy(t.component.selection??{})){const i=t.getName(`lookup_${n}`);t.component.data.outputNodes[i]=r.materialized=new gl(new zO(e,t,{param:n}),i,$i.Lookup,t.component.data.outputNodeRefCounts)}}function W5(t,e,n){return mk(e,r=>gt(r)?r:dVt(r)?P6e(t,r,n):V4e(r))}function FGt(t,e){if(t)return We(t)&&!Km(t)?t.map(n=>lae(n,e)).join(", "):t}function ZV(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}function _T(t,e,n,r={header:!1}){var f,d;const{disable:i,orient:o,scale:s,labelExpr:a,title:l,zindex:c,...u}=t.combine();if(!i){for(const h in u){const p=h,g=v9t[p],m=u[p];if(g&&g!==e&&g!=="both")delete u[p];else if(GR(m)){const{condition:v,...y}=m,x=pt(v),b=Fye[p];if(b){const{vgProp:w,part:_}=b,S=[...x.map(O=>{const{test:k,...E}=O;return{test:W5(null,k),...E}}),y];ZV(u,_,w,S),delete u[p]}else if(b===null){const w={signal:x.map(_=>{const{test:S,...O}=_;return`${W5(null,S)} ? ${wye(O)} : `}).join("")+wye(y)};u[p]=w}}else if(Rt(m)){const v=Fye[p];if(v){const{vgProp:y,part:x}=v;ZV(u,x,y,m),delete u[p]}}En(["labelAlign","labelBaseline"],p)&&u[p]===null&&delete u[p]}if(e==="grid"){if(!u.grid)return;if(u.encode){const{grid:h}=u.encode;u.encode={...h?{grid:h}:{}},Tr(u.encode)&&delete u.encode}return{scale:s,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:qi(c,0)}}else{if(!r.header&&t.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=u.encode)==null?void 0:f.labels)!=null&&d.update&&Rt(u.encode.labels.update.text)&&(p=Ob(a,"datum.label",u.encode.labels.update.text.signal)),ZV(u,"labels","text",{signal:p})}if(u.labelAlign===null&&delete u.labelAlign,u.encode){for(const p of wBe)t.hasAxisPart(p)||delete u.encode[p];Tr(u.encode)&&delete u.encode}const h=FGt(l,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...u,...n.aria===!1?{aria:!1}:{},zindex:qi(c,0)}}}}function R6e(t){const{axes:e}=t.component,n=[];for(const r of tm)if(e[r]){for(const i of e[r])if(!i.get("disable")&&!i.get("gridScale")){const o=r==="x"?"height":"width",s=t.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function NGt(t,e){const{x:n=[],y:r=[]}=t;return[...n.map(i=>_T(i,"grid",e)),...r.map(i=>_T(i,"grid",e)),...n.map(i=>_T(i,"main",e)),...r.map(i=>_T(i,"main",e))].filter(i=>i)}function f0e(t,e,n,r){return Object.assign.apply(null,[{},...t.map(i=>{if(i==="axisOrient"){const o=n==="x"?"bottom":"left",s=e[n==="x"?"axisBottom":"axisLeft"]||{},a=e[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...Qe(s),...Qe(a)]),c={};for(const u of l.values())c[u]={signal:`${r.signal} === "${o}" ? ${Ef(s[u])} : ${Ef(a[u])}`};return c}return e[i]})])}function zGt(t,e,n,r){const i=e==="band"?["axisDiscrete","axisBand"]:e==="point"?["axisDiscrete","axisPoint"]:X4e(e)?["axisQuantitative"]:e==="time"||e==="utc"?["axisTemporal"]:[],o=t==="x"?"axisX":"axisY",s=Rt(n)?"axisOrient":`axis${IR(n)}`,a=[...i,...i.map(c=>o+c.substr(4))],l=["axis",s,o];return{vlOnlyAxisConfig:f0e(a,r,t,n),vgAxisConfig:f0e(l,r,t,n),axisConfigStyle:jGt([...l,...a],r)}}function jGt(t,e){var r;const n=[{}];for(const i of t){let o=(r=e[i])==null?void 0:r.style;if(o){o=pt(o);for(const s of o)n.push(e.style[s])}}return Object.assign.apply(null,n)}function eQ(t,e,n,r={}){var o;const i=_4e(t,n,e);if(i!==void 0)return{configFrom:"style",configValue:i};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=r[s])==null?void 0:o[t])!==void 0)return{configFrom:s,configValue:r[s][t]};return{}}const d0e={scale:({model:t,channel:e})=>t.scaleName(e),format:({format:t})=>t,formatType:({formatType:t})=>t,grid:({fieldOrDatumDef:t,axis:e,scaleType:n})=>e.grid??BGt(n,t),gridScale:({model:t,channel:e})=>UGt(t,e),labelAlign:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelAlign||I6e(e,n,r),labelAngle:({labelAngle:t})=>t,labelBaseline:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelBaseline||D6e(e,n,r),labelFlush:({axis:t,fieldOrDatumDef:e,channel:n})=>t.labelFlush??VGt(e.type,n),labelOverlap:({axis:t,fieldOrDatumDef:e,scaleType:n})=>t.labelOverlap??GGt(e.type,n,Je(e)&&!!e.timeUnit,Je(e)?e.sort:void 0),orient:({orient:t})=>t,tickCount:({channel:t,model:e,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o=t==="x"?"width":t==="y"?"height":void 0,s=o?e.getSizeSignalRef(o):void 0;return n.tickCount??qGt({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},tickMinStep:XGt,title:({axis:t,model:e,channel:n})=>{if(t.title!==void 0)return t.title;const r=L6e(e,n);if(r!==void 0)return r;const i=e.typedFieldDef(n),o=n==="x"?"x2":"y2",s=e.fieldDef(o);return C4e(i?[Lye(i)]:[],Je(s)?[Lye(s)]:[])},values:({axis:t,fieldOrDatumDef:e})=>YGt(t,e),zindex:({axis:t,fieldOrDatumDef:e,mark:n})=>t.zindex??QGt(n,e)};function BGt(t,e){return!Go(t)&&Je(e)&&!qr(e==null?void 0:e.bin)&&!rs(e==null?void 0:e.bin)}function UGt(t,e){const n=e==="x"?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n)}function WGt(t,e,n,r,i){const o=e==null?void 0:e.labelAngle;if(o!==void 0)return Rt(o)?o:qA(o);{const{configValue:s}=eQ("labelAngle",r,e==null?void 0:e.style,i);return s!==void 0?qA(s):n===xi&&En([Qse,Yse],t.type)&&!(Je(t)&&t.timeUnit)?270:void 0}}function tQ(t){return`(((${t.signal} % 360) + 360) % 360)`}function D6e(t,e,n,r){if(t!==void 0)if(n==="x"){if(Rt(t)){const i=tQ(t),o=Rt(e)?`(${e.signal} === "top")`:e==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45{if(C1(r)&&uBe(r.sort)){const{field:o,timeUnit:s}=r,a=r.sort,l=a.map((c,u)=>`${V4e({field:o,timeUnit:s,equal:c})} ? ${u} : `).join("")+a.length;e=new hC(e,{calculate:l,as:pC(r,i,{forAs:!0})})}}),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Mn(this.transform)}`}}function pC(t,e,n){return ct(t,{prefix:e,suffix:"sort_index",...n})}function U6(t,e){return En(["top","bottom"],e)?"column":En(["left","right"],e)||t==="row"?"row":"column"}function gC(t,e,n,r){const i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return qi((e||{})[t],i[t],n.header[t])}function W6(t,e,n,r){const i={};for(const o of t){const s=gC(o,e||{},n,r);s!==void 0&&(i[o]=s)}return i}const kae=["row","column"],Aae=["header","footer"];function KGt(t,e){const n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=W6(["titleAnchor","titleAngle","titleOrient"],i.header,r,e),l=U6(e,a),c=qA(s);return{name:`${e}-title`,type:"group",role:`${l}-title`,title:{text:n,...e==="row"?{orient:"left"}:{},style:"guide-title",...F6e(c,l),...$6e(l,c,o),...N6e(r,i,e,z9t,zBe)}}}function $6e(t,e,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=I6e(e,t==="row"?"left":"top",t==="row"?"y":"x");return r?{align:r}:{}}function F6e(t,e){const n=D6e(t,e==="row"?"left":"top",e==="row"?"y":"x",!0);return n?{baseline:n}:{}}function ZGt(t,e){const n=t.component.layoutHeaders[e],r=[];for(const i of Aae)if(n[i])for(const o of n[i]){const s=eHt(t,e,i,n,o);s!=null&&r.push(s)}return r}function JGt(t,e){const{sort:n}=t;return hg(n)?{field:ct(n,{expr:"datum"}),order:n.order??"ascending"}:We(n)?{field:pC(t,e,{expr:"datum"}),order:"ascending"}:{field:ct(t,{expr:"datum"}),order:n??"ascending"}}function nQ(t,e,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=W6(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),c=iae({fieldOrDatumDef:t,format:r,formatType:i,expr:"parent",config:n}).signal,u=U6(e,a);return{text:{signal:l?Ob(Ob(l,"datum.label",c),"datum.value",ct(t,{expr:"parent"})):c},...e==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...F6e(o,u),...$6e(u,o,s),...N6e(n,t,e,j9t,jBe)}}function eHt(t,e,n,r,i){if(i){let o=null;const{facetFieldDef:s}=r,a=t.config?t.config:void 0;if(s&&i.labels){const{labelOrient:f}=W6(["labelOrient"],s.header,a,e);(e==="row"&&!En(["top","bottom"],f)||e==="column"&&!En(["left","right"],f))&&(o=nQ(s,e,a))}const l=gc(t)&&!BR(t.facet),c=i.axes,u=(c==null?void 0:c.length)>0;if(o||u){const f=e==="row"?"height":"width";return{name:t.getName(`${e}_${n}`),type:"group",role:`${e}-${n}`,...r.facetFieldDef?{from:{data:t.getName(`${e}_domain`)},sort:JGt(s,e)}:{},...u&&l?{from:{data:t.getName(`facet_domain_${e}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...u?{axes:c}:{}}}}return null}const tHt={column:{start:0,end:1},row:{start:1,end:0}};function nHt(t,e){return tHt[e][t]}function rHt(t,e){const n={};for(const r of su){const i=t[r];if(i!=null&&i.facetFieldDef){const{titleAnchor:o,titleOrient:s}=W6(["titleAnchor","titleOrient"],i.facetFieldDef.header,e,r),a=U6(r,s),l=nHt(o,a);l!==void 0&&(n[a]=l)}}return Tr(n)?void 0:n}function N6e(t,e,n,r,i){const o={};for(const s of r){if(!i[s])continue;const a=gC(s,e==null?void 0:e.header,t,n);a!==void 0&&(o[i[s]]=a)}return o}function Pae(t){return[...iL(t,"width"),...iL(t,"height"),...iL(t,"childWidth"),...iL(t,"childHeight")]}function iL(t,e){const n=e==="width"?"x":"y",r=t.component.layoutSize.get(e);if(!r||r==="merged")return[];const i=t.getSizeSignalRef(e).signal;if(r==="step"){const o=t.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(Go(s)&&w1(a)){const l=t.scaleName(n);return gc(t.parent)&&t.parent.component.resolve.scale[n]==="independent"?[h0e(l,a)]:[h0e(l,a),{name:i,update:z6e(l,o,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){const o=i.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=qY(t.config.view,o?"width":"height"),l=`isFinite(${s}) ? ${s} : ${a}`;return[{name:i,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:i,value:r}]}function h0e(t,e){const n=`${t}_step`;return Rt(e.step)?{name:n,update:e.step.signal}:{name:n,value:e.step}}function z6e(t,e,n){const r=e.get("type"),i=e.get("padding"),o=qi(e.get("paddingOuter"),i);let s=e.get("paddingInner");return s=r==="band"?s!==void 0?s:i:1,`bandspace(${n}, ${Ef(s)}, ${Ef(o)}) * ${t}_step`}function j6e(t){return t==="childWidth"?"width":t==="childHeight"?"height":t}function B6e(t,e){return Qe(t).reduce((n,r)=>({...n,...NO({model:e,channelDef:t[r],vgChannel:r,mainRefFn:i=>ni(i.value),invalidValueRef:void 0})}),{})}function U6e(t,e){if(gc(e))return t==="theta"?"independent":"shared";if(UO(e))return"shared";if(Fae(e))return Xi(t)||t==="theta"||t==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Mae(t,e){const n=t.scale[e],r=Xi(e)?"axis":"legend";return n==="independent"?(t[r][e]==="shared"&&Ze(IWt(e)),"independent"):t[r][e]||"shared"}const iHt={...W9t,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},W6e=Qe(iHt);class oHt extends rm{}const p0e={symbols:sHt,gradient:aHt,labels:lHt,entries:cHt};function sHt(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:l,mark:c}=n,u=s.filled&&c!=="trail";let f={...G8t({},n,NVt),...g6e(n,{filled:u})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?V6e(a.opacity)??s.opacity:void 0;if(f.fill){if(r==="fill"||u&&r===Cl)delete f.fill;else if(Ke(f.fill,"field"))h?delete f.fill:(f.fill=ni(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=ni(g??1));else if(We(f.fill)){const m=rQ(a.fill??a.color)??s.fill??(u&&s.color);m&&(f.fill=ni(m))}}if(f.stroke){if(r==="stroke"||!u&&r===Cl)delete f.stroke;else if(Ke(f.stroke,"field")||p)delete f.stroke;else if(We(f.stroke)){const m=qi(rQ(a.stroke||a.color),s.stroke,u?s.color:void 0);m&&(f.stroke={value:m})}}if(r!==em){const m=Je(e)&&H6e(n,i,e);m?f.opacity=[{test:m,...ni(g??1)},ni(l.legend.unselectedOpacity)]:g&&(f.opacity=ni(g))}return f={...f,...t},Tr(f)?void 0:f}function aHt(t,{model:e,legendType:n,legendCmpt:r}){if(n!=="gradient")return;const{config:i,markDef:o,encoding:s}=e;let a={};const c=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?V6e(s.opacity)||o.opacity:void 0;return c&&(a.opacity=ni(c)),a={...a,...t},Tr(a)?void 0:a}function lHt(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},s=n.config,a=Je(e)?H6e(n,i,e):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:c,formatType:u}=o;let f;Pb(u)?f=Tf({fieldOrDatumDef:e,field:"datum.value",format:c,formatType:u,config:s}):c===void 0&&u===void 0&&s.customFormatTypes&&(e.type==="quantitative"&&s.numberFormatType?f=Tf({fieldOrDatumDef:e,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):e.type==="temporal"&&s.timeFormatType&&Je(e)&&e.timeUnit===void 0&&(f=Tf({fieldOrDatumDef:e,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...t};return Tr(d)?void 0:d}function cHt(t,{legendCmpt:e}){const n=e.get("selections");return n!=null&&n.length?{...t,fill:{value:"transparent"}}:t}function V6e(t){return G6e(t,(e,n)=>Math.max(e,n.value))}function rQ(t){return G6e(t,(e,n)=>qi(e,n.value))}function G6e(t,e){if(o9t(t))return pt(t.condition).reduce(e,t.value);if(qf(t))return t.value}function H6e(t,e,n){const r=e.get("selections");if(!(r!=null&&r.length))return;const i=rt(n.field);return r.map(o=>`(!length(data(${rt(gi(o)+Rb)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}const g0e={direction:({direction:t})=>t,format:({fieldOrDatumDef:t,legend:e,config:n})=>{const{format:r,formatType:i}=e;return aBe(t,t.type,r,i,n,!1)},formatType:({legend:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:r}=t;return lBe(r,e,n)},gradientLength:t=>{const{legend:e,legendConfig:n}=t;return e.gradientLength??n.gradientLength??mHt(t)},labelOverlap:({legend:t,legendConfig:e,scaleType:n})=>t.labelOverlap??e.labelOverlap??vHt(n),symbolType:({legend:t,markDef:e,channel:n,encoding:r})=>t.symbolType??fHt(e.type,n,r.shape,e.shape),title:({fieldOrDatumDef:t,config:e})=>H_(t,e,{allowDisabling:!0}),type:({legendType:t,scaleType:e,channel:n})=>{if(G_(n)&&eh(e)){if(t==="gradient")return}else if(t==="symbol")return;return t},values:({fieldOrDatumDef:t,legend:e})=>uHt(e,t)};function uHt(t,e){const n=t.values;if(We(n))return bBe(e,n);if(Rt(n))return n}function fHt(t,e,n,r){if(e!=="shape"){const i=rQ(n)??r;if(i)return i}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function dHt(t){const{legend:e}=t;return qi(e.type,hHt(t))}function hHt({channel:t,timeUnit:e,scaleType:n}){if(G_(t)){if(En(["quarter","month","day"],e))return"symbol";if(eh(n))return"gradient"}return"symbol"}function pHt({legendConfig:t,legendType:e,orient:n,legend:r}){return r.direction??t[e?"gradientDirection":"symbolDirection"]??gHt(n,e)}function gHt(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return e==="gradient"?"horizontal":void 0}}function mHt({legendConfig:t,model:e,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=t;if(eh(i))return n==="horizontal"?r==="top"||r==="bottom"?m0e(e,"width",s,o):s:m0e(e,"height",l,a)}function m0e(t,e,n,r){return{signal:`clamp(${t.getSizeSignalRef(e).signal}, ${n}, ${r})`}}function vHt(t){if(En(["quantile","threshold","log","symlog"],t))return"greedy"}function q6e(t){const e=_i(t)?yHt(t):_Ht(t);return t.component.legends=e,e}function yHt(t){const{encoding:e}=t,n={};for(const r of[Cl,...UBe]){const i=_o(e[r]);!i||!t.getScaleComponent(r)||r===Ol&&Je(i)&&i.type===FO||(n[r]=wHt(t,r))}return n}function xHt(t,e){const n=t.scaleName(e);if(t.mark==="trail"){if(e==="color")return{stroke:n};if(e==="size")return{strokeWidth:n}}return e==="color"?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}function bHt(t,e,n,r){switch(e){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(e==="title"&&t===(r==null?void 0:r.title))return!0}return t===(n||{})[e]}function wHt(t,e){var b;let n=t.legend(e);const{markDef:r,encoding:i,config:o}=t,s=o.legend,a=new oHt({},xHt(t,e));PGt(t,e,a);const l=n!==void 0?!n:s.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const c=t.getScaleComponent(e).get("type"),u=_o(i[e]),f=Je(u)?(b=Vo(u.timeUnit))==null?void 0:b.unit:void 0,d=n.orient||o.legend.orient||"right",h=dHt({legend:n,channel:e,timeUnit:f,scaleType:c}),p=pHt({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:e,model:t,markDef:r,encoding:i,fieldOrDatumDef:u,legendConfig:s,config:o,scaleType:c,orient:d,legendType:h,direction:p};for(const w of W6e){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const _=w in g0e?g0e[w](g):n[w];if(_!==void 0){const S=bHt(_,w,n,t.fieldDef(e));(S||o.legend[w]===void 0)&&a.set(w,_,S)}}const m=(n==null?void 0:n.encoding)??{},v=a.get("selections"),y={},x={fieldOrDatumDef:u,model:t,channel:e,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const _=B6e(m[w]??{},t),S=w in p0e?p0e[w](_,x):_;S!==void 0&&!Tr(S)&&(y[w]={...v!=null&&v.length&&Je(u)?{name:`${gi(u.field)}_legend_${w}`}:{},...v!=null&&v.length?{interactive:!!v}:{},update:S})}return Tr(y)||a.set("encode",y,!!(n!=null&&n.encoding)),a}function _Ht(t){const{legends:e,resolve:n}=t.component;for(const r of t.children){q6e(r);for(const i of Qe(r.component.legends))n.legend[i]=Mae(t.component.resolve,i),n.legend[i]==="shared"&&(e[i]=X6e(e[i],r.component.legends[i]),e[i]||(n.legend[i]="independent",delete e[i]))}for(const r of Qe(e))for(const i of t.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return e}function X6e(t,e){var o,s,a,l;if(!t)return e.clone();const n=t.getWithExplicit("orient"),r=e.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const c of W6e){const u=my(t.getWithExplicit(c),e.getWithExplicit(c),c,"legend",(f,d)=>{switch(c){case"symbolType":return SHt(f,d);case"title":return E4e(f,d);case"type":return i=!0,Vl("symbol")}return F6(f,d,c,"legend")});t.setWithExplicit(c,u)}return i&&((s=(o=t.implicit)==null?void 0:o.encode)!=null&&s.gradient&&M5(t.implicit,["encode","gradient"]),(l=(a=t.explicit)==null?void 0:a.encode)!=null&&l.gradient&&M5(t.explicit,["encode","gradient"])),t}function SHt(t,e){return e.value==="circle"?e:t}function CHt(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}function Y6e(t){const e=t.component.legends,n={};for(const i of Qe(e)){const o=t.getScaleComponent(i),s=kr(o.get("domains"));if(n[s])for(const a of n[s])X6e(a,e[i])||n[s].push(e[i]);else n[s]=[e[i].clone()]}return ws(n).flat().map(i=>OHt(i,t.config)).filter(i=>i!==void 0)}function OHt(t,e){var s,a,l;const{disable:n,labelExpr:r,selections:i,...o}=t.combine();if(!n){if(e.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const c=o.encode.symbols.update;c.fill&&c.fill.value!=="transparent"&&!c.stroke&&!o.stroke&&(c.stroke={value:"transparent"});for(const u of UBe)o[u]&&delete c[u]}if(o.title||delete o.title,r!==void 0){let c=r;(l=(a=o.encode)==null?void 0:a.labels)!=null&&l.update&&Rt(o.encode.labels.update.text)&&(c=Ob(r,"datum.label",o.encode.labels.update.text.signal)),CHt(o,"labels","text",{signal:c})}return o}}function EHt(t){return UO(t)||Fae(t)?THt(t):Q6e(t)}function THt(t){return t.children.reduce((e,n)=>e.concat(n.assembleProjections()),Q6e(t))}function Q6e(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:r}=n;if(e.data){const i={signal:`[${e.size.map(s=>s.signal).join(", ")}]`},o=e.data.reduce((s,a)=>{const l=Rt(a)?a.signal:`data('${t.lookupDataSource(a)}')`;return En(s,l)||s.push(l),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const kHt=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class K6e extends rm{constructor(e,n,r,i){super({...n},{name:e}),this.specifiedProjection=n,this.size=r,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function Z6e(t){t.component.projection=_i(t)?AHt(t):RHt(t)}function AHt(t){if(t.hasProjection){const e=os(t.specifiedProjection),n=!(e&&(e.scale!=null||e.translate!=null)),r=n?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,i=n?PHt(t):void 0,o=new K6e(t.projectionName(!0),{...os(t.config.projection),...e},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function PHt(t){const e=[],{encoding:n}=t;for(const r of[[cd,ld],[Mu,ud]])(_o(n[r[0]])||_o(n[r[1]]))&&e.push({signal:t.getName(`geojson_${e.length}`)});return t.channelHasField(Ol)&&t.typedFieldDef(Ol).type===FO&&e.push({signal:t.getName(`geojson_${e.length}`)}),e.length===0&&e.push(t.requestDataName($i.Main)),e}function MHt(t,e){const n=Cse(kHt,i=>!!(!vt(t.explicit,i)&&!vt(e.explicit,i)||vt(t.explicit,i)&&vt(e.explicit,i)&&sc(t.get(i),e.get(i))));if(sc(t.size,e.size)){if(n)return t;if(sc(t.explicit,{}))return e;if(sc(e.explicit,{}))return t}return null}function RHt(t){if(t.children.length===0)return;let e;for(const r of t.children)Z6e(r);const n=Cse(t.children,r=>{const i=r.component.projection;if(i)if(e){const o=MHt(e,i);return o&&(e=o),!!o}else return e=i,!0;else return!0});if(e&&n){const r=t.projectionName(!0),i=new K6e(r,e.specifiedProjection,e.size,Kt(e.data));for(const o of t.children){const s=o.component.projection;s&&(s.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),r),s.merged=!0)}return i}}function DHt(t,e,n,r){if(VR(e,n)){const i=_i(t)?t.axis(n)??t.legend(n)??{}:{},o=ct(e,{expr:"datum"}),s=ct(e,{expr:"datum",binSuffix:"end"});return{formulaAs:ct(e,{binSuffix:"range",forAs:!0}),formula:jR(o,s,i.format,i.formatType,r)}}return{}}function J6e(t,e){return`${y4e(t)}_${e}`}function IHt(t,e){return{signal:t.getName(`${e}_bins`),extentSignal:t.getName(`${e}_extent`)}}function Rae(t,e,n){const r=M6(n,void 0)??{},i=J6e(r,e);return t.getName(`${i}_bins`)}function LHt(t){return"as"in t}function v0e(t,e,n){let r,i;LHt(t)?r=gt(t.as)?[t.as,`${t.as}_end`]:[t.as[0],t.as[1]]:r=[ct(t,{forAs:!0}),ct(t,{binSuffix:"end",forAs:!0})];const o={...M6(e,void 0)},s=J6e(o,t.field),{signal:a,extentSignal:l}=IHt(n,s);if(b6(o.extent)){const u=o.extent;i=M6e(n,u.param,u),delete o.extent}const c={bin:o,field:t.field,as:[r],...a?{signal:a}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}};return{key:s,binComponent:c}}class wh extends Sr{clone(){return new wh(null,Kt(this.bins))}constructor(e,n){super(e),this.bins=n}static makeFromEncoding(e,n){const r=n.reduceFieldDef((i,o,s)=>{if(Ra(o)&&qr(o.bin)){const{key:a,binComponent:l}=v0e(o,o.bin,n);i[a]={...l,...i[a],...DHt(n,o,s,n.config)}}return i},{});return Tr(r)?null:new wh(e,r)}static makeFromTransform(e,n,r){const{key:i,binComponent:o}=v0e(n,n.bin,r);return new wh(e,{[i]:o})}merge(e,n){for(const r of Qe(e.bins))r in this.bins?(n(e.bins[r].signal,this.bins[r].signal),this.bins[r].as=Jd([...this.bins[r].as,...e.bins[r].as],Mn)):this.bins[r]=e.bins[r];for(const r of e.children)e.removeChild(r),r.parent=this;e.remove()}producedFields(){return new Set(ws(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(ws(this.bins).map(e=>e.field))}hash(){return`Bin ${Mn(this.bins)}`}assemble(){return ws(this.bins).flatMap(e=>{const n=[],[r,...i]=e.as,{extent:o,...s}=e.bin,a={type:"bin",field:Pu(e.field),as:r,signal:e.signal,...b6(o)?{extent:null}:{extent:o},...e.span?{span:{signal:`span(${e.span})`}}:{},...s};!o&&e.extentSignal&&(n.push({type:"extent",field:Pu(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),n.push(a);for(const l of i)for(let c=0;c<2;c++)n.push({type:"formula",expr:ct({field:r[c]},{expr:"datum"}),as:l[c]});return e.formula&&n.push({type:"formula",expr:e.formula,as:e.formulaAs}),n})}}function $Ht(t,e,n,r){var o;const i=_i(r)?r.encoding[Zh(e)]:void 0;if(Ra(n)&&_i(r)&&dBe(n,i,r.markDef,r.config)){t.add(ct(n,{})),t.add(ct(n,{suffix:"end"}));const{mark:s,markDef:a,config:l}=r,c=gy({fieldDef:n,markDef:a,config:l});XA(s)&&c!==.5&&Xi(e)&&(t.add(ct(n,{suffix:N6})),t.add(ct(n,{suffix:z6}))),n.bin&&VR(n,e)&&t.add(ct(n,{binSuffix:"range"}))}else if(c4e(e)){const s=l4e(e);t.add(r.getName(s))}else t.add(ct(n));return C1(n)&&OVt((o=n.scale)==null?void 0:o.range)&&t.add(n.scale.range.field),t}function FHt(t,e){for(const n of Qe(e)){const r=e[n];for(const i of Qe(r))n in t?t[n][i]=new Set([...t[n][i]??[],...r[i]]):t[n]={[i]:r[i]}}}class Lf extends Sr{clone(){return new Lf(null,new Set(this.dimensions),Kt(this.measures))}constructor(e,n,r){super(e),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(e,n){let r=!1;n.forEachFieldDef(s=>{s.aggregate&&(r=!0)});const i={},o=new Set;return!r||(n.forEachFieldDef((s,a)=>{const{aggregate:l,field:c}=s;if(l)if(l==="count")i["*"]??(i["*"]={}),i["*"].count=new Set([ct(s,{forAs:!0})]);else{if(zg(l)||n0(l)){const u=zg(l)?"argmin":"argmax",f=l[u];i[f]??(i[f]={}),i[f][u]=new Set([ct({op:u,field:f},{forAs:!0})])}else i[c]??(i[c]={}),i[c][l]=new Set([ct(s,{forAs:!0})]);Jh(a)&&n.scaleDomain(a)==="unaggregated"&&(i[c]??(i[c]={}),i[c].min=new Set([ct({field:c,aggregate:"min"},{forAs:!0})]),i[c].max=new Set([ct({field:c,aggregate:"max"},{forAs:!0})]))}else $Ht(o,a,s,n)}),o.size+Qe(i).length===0)?null:new Lf(e,o,i)}static makeFromTransform(e,n){var r;const i=new Set,o={};for(const s of n.aggregate){const{op:a,field:l,as:c}=s;a&&(a==="count"?(o["*"]??(o["*"]={}),o["*"].count=new Set([c||ct(s,{forAs:!0})])):(o[l]??(o[l]={}),(r=o[l])[a]??(r[a]=new Set),o[l][a].add(c||ct(s,{forAs:!0}))))}for(const s of n.groupby??[])i.add(s);return i.size+Qe(o).length===0?null:new Lf(e,i,o)}merge(e){return e4e(this.dimensions,e.dimensions)?(FHt(this.measures,e.measures),!0):(QWt("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Qe(this.measures)])}producedFields(){const e=new Set;for(const n of Qe(this.measures))for(const r of Qe(this.measures[n])){const i=this.measures[n][r];i.size===0?e.add(`${r}_${n}`):i.forEach(e.add,e)}return e}hash(){return`Aggregate ${Mn({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],n=[],r=[];for(const o of Qe(this.measures))for(const s of Qe(this.measures[o]))for(const a of this.measures[o][s])r.push(a),e.push(s),n.push(o==="*"?null:Pu(o));return{type:"aggregate",groupby:[...this.dimensions].map(Pu),ops:e,fields:n,as:r}}}class jO extends Sr{constructor(e,n,r,i){super(e),this.model=n,this.name=r,this.data=i;for(const o of su){const s=n.facet[o];if(s){const{bin:a,sort:l}=s;this[o]={name:n.getName(`${o}_domain`),fields:[ct(s),...qr(a)?[ct(s,{binSuffix:"end"})]:[]],...hg(l)?{sortField:l}:We(l)?{sortIndexField:pC(s,o)}:{}}}}this.childModel=n.child}hash(){let e="Facet";for(const n of su)this[n]&&(e+=` ${n.charAt(0)}:${Mn(this[n])}`);return e}get fields(){var n;const e=[];for(const r of su)(n=this[r])!=null&&n.fields&&e.push(...this[r].fields);return e}dependentFields(){const e=new Set(this.fields);for(const n of su)this[n]&&(this[n].sortField&&e.add(this[n].sortField.field),this[n].sortIndexField&&e.add(this[n].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const n of tm){const r=this.childModel.component.scales[n];if(r&&!r.merged){const i=r.get("type"),o=r.get("range");if(Go(i)&&w1(o)){const s=V6(this.childModel,n),a=$ae(s);a?e[n]=a:Ze(Nse(n))}}}return e}assembleRowColumnHeaderData(e,n,r){const i={row:"y",column:"x",facet:void 0}[e],o=[],s=[],a=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),s.push("max")):(o.push(r[i]),s.push("distinct")),a.push(`distinct_${r[i]}`));const{sortField:l,sortIndexField:c}=this[e];if(l){const{op:u=k6,field:f}=l;o.push(f),s.push(u),a.push(ct(l,{forAs:!0}))}else c&&(o.push(c),s.push("max"),a.push(c));return{name:this[e].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[e].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(e){var l;const{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(const c of kae){for(const u of Aae){const f=(r[c]&&r[c][u])??[];for(const d of f)if(((l=d.axes)==null?void 0:l.length)>0){o[c]=!0;break}}if(o[c]){const u=`length(data("${this.facet.name}"))`,f=c==="row"?n?{signal:`ceil(${u} / ${n})`}:1:n?{signal:`min(${u}, ${n})`}:{signal:u};i.push({name:`${this.facet.name}_${c}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,e)),i}assemble(){const e=[];let n=null;const r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:s}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(r.x??[],r.y??[]),l=a.map(()=>"distinct");e.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[dg,fg])this[a]&&e.push(this.assembleRowColumnHeaderData(a,n,r));if(s){const a=this.assembleFacetHeaderData(r);a&&e.push(...a)}return e}}function y0e(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function NHt(t,e){const n=Tse(t);if(e==="number")return`toNumber(${n})`;if(e==="boolean")return`toBoolean(${n})`;if(e==="string")return`toString(${n})`;if(e==="date")return`toDate(${n})`;if(e==="flatten")return n;if(e.startsWith("date:")){const r=y0e(e.slice(5,e.length));return`timeParse(${n},'${r}')`}else if(e.startsWith("utc:")){const r=y0e(e.slice(4,e.length));return`utcParse(${n},'${r}')`}else return Ze(oWt(e)),null}function zHt(t){const e={};return $3(t.filter,n=>{if(W4e(n)){let r=null;Use(n)?r=tc(n.equal):Vse(n)?r=tc(n.lte):Wse(n)?r=tc(n.lt):Gse(n)?r=tc(n.gt):Hse(n)?r=tc(n.gte):qse(n)?r=n.range[0]:Xse(n)&&(r=(n.oneOf??n.in)[0]),r&&(_1(r)?e[n.field]="date":Jn(r)?e[n.field]="number":gt(r)&&(e[n.field]="string")),n.timeUnit&&(e[n.field]="date")}}),e}function jHt(t){const e={};function n(r){uC(r)?e[r.field]="date":r.type==="quantitative"&&$8t(r.aggregate)?e[r.field]="number":rC(r.field)>1?r.field in e||(e[r.field]="flatten"):C1(r)&&hg(r.sort)&&rC(r.sort.field)>1&&(r.sort.field in e||(e[r.sort.field]="flatten"))}if((_i(t)||gc(t))&&t.forEachFieldDef((r,i)=>{if(Ra(r))n(r);else{const o=x1(i),s=t.fieldDef(o);n({...r,type:s.type})}}),_i(t)){const{mark:r,markDef:i,encoding:o}=t;if(r0(r)&&!t.encoding.order){const s=i.orient==="horizontal"?"y":"x",a=o[s];Je(a)&&a.type==="quantitative"&&!(a.field in e)&&(e[a.field]="number")}}return e}function BHt(t){const e={};if(_i(t)&&t.component.selection)for(const n of Qe(t.component.selection)){const r=t.component.selection[n];for(const i of r.project.items)!i.channel&&rC(i.field)>1&&(e[i.field]="flatten")}return e}class Qs extends Sr{clone(){return new Qs(null,Kt(this._parse))}constructor(e,n){super(e),this._parse=n}hash(){return`Parse ${Mn(this._parse)}`}static makeExplicit(e,n,r){var s;let i={};const o=n.data;return!Wv(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(i=o.format.parse),this.makeWithAncestors(e,i,{},r)}static makeWithAncestors(e,n,r,i){for(const a of Qe(r)){const l=i.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===r[a]||l.value==="derived"||r[a]==="flatten"?delete r[a]:Ze(Tye(a,r[a],l.value)))}for(const a of Qe(n)){const l=i.get(a);l!==void 0&&(l===n[a]?delete n[a]:Ze(Tye(a,n[a],l)))}const o=new rm(n,r);i.copyAll(o);const s={};for(const a of Qe(o.combine())){const l=o.get(a);l!==null&&(s[a]=l)}return Qe(s).length===0||i.parseNothing?null:new Qs(e,s)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const n of Qe(this._parse)){const r=this._parse[n];rC(n)===1&&(e[n]=r)}return e}producedFields(){return new Set(Qe(this._parse))}dependentFields(){return new Set(Qe(this._parse))}assembleTransforms(e=!1){return Qe(this._parse).filter(n=>e?rC(n)>1:!0).map(n=>{const r=NHt(n,this._parse[n]);return r?{type:"formula",expr:r,as:LO(n)}:null}).filter(n=>n!==null)}}class yy extends Sr{clone(){return new yy(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([Yf])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Yf}}}class qR extends Sr{clone(){return new qR(null,this.params)}constructor(e,n){super(e),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Mn(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class XR extends Sr{clone(){return new XR(null,this.params)}constructor(e,n){super(e),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Mn(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Db extends Sr{constructor(e){super(null),e??(e={name:"source"});let n;if(Wv(e)||(n=e.format?{...pl(e.format,["parse"])}:{}),YA(e))this._data={values:e.values};else if(fC(e)){if(this._data={url:e.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(e.url)[1];En(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else s6e(e)?this._data={values:[{type:"Sphere"}]}:(i6e(e)||Wv(e))&&(this._data={});this._generator=Wv(e),e.name&&(this._name=e.name),n&&!Tr(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var x0e=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},UHt=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},ST;function Dae(t){return t instanceof Db||t instanceof qR||t instanceof XR}class Iae{constructor(){ST.set(this,void 0),x0e(this,ST,!1,"f")}setModified(){x0e(this,ST,!0,"f")}get modifiedFlag(){return UHt(this,ST,"f")}}ST=new WeakMap;class O1 extends Iae{getNodeDepths(e,n,r){r.set(e,n);for(const i of e.children)this.getNodeDepths(i,n+1,r);return r}optimize(e){const r=[...this.getNodeDepths(e,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(const i of r)this.run(i[0]);return this.modifiedFlag}}class Lae extends Iae{optimize(e){this.run(e);for(const n of e.children)this.optimize(n);return this.modifiedFlag}}class WHt extends Lae{mergeNodes(e,n){const r=n.shift();for(const i of n)e.removeChild(i),i.parent=r,i.remove()}run(e){const n=e.children.map(i=>i.hash()),r={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(e,r[i]))}}class VHt extends Lae{constructor(e){super(),this.requiresSelectionId=e&&Tae(e)}run(e){e instanceof yy&&(this.requiresSelectionId&&(Dae(e.parent)||e.parent instanceof Lf||e.parent instanceof Qs)||(this.setModified(),e.remove()))}}class GHt extends Iae{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,n){let r=new Set;e instanceof bh&&(r=e.producedFields(),Ose(r,n)&&(this.setModified(),e.removeFormulas(n),e.producedFields.length===0&&e.remove()));for(const i of e.children)this.run(i,new Set([...n,...r]))}}class HHt extends Lae{constructor(){super()}run(e){e instanceof gl&&!e.isRequired()&&(this.setModified(),e.remove())}}class qHt extends O1{run(e){if(!Dae(e)&&!(e.numChildren()>1)){for(const n of e.children)if(n instanceof Qs)if(e instanceof Qs)this.setModified(),e.merge(n);else{if(Ese(e.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class XHt extends O1{run(e){const n=[...e.children],r=e.children.filter(i=>i instanceof Qs);if(e.numChildren()>1&&r.length>=1){const i={},o=new Set;for(const s of r){const a=s.parse;for(const l of Qe(a))l in i?i[l]!==a[l]&&o.add(l):i[l]=a[l]}for(const s of o)delete i[s];if(!Tr(i)){this.setModified();const s=new Qs(e,i);for(const a of n){if(a instanceof Qs)for(const l of Qe(i))delete a.parse[l];e.removeChild(a),a.parent=s,a instanceof Qs&&Qe(a.parse).length===0&&a.remove()}}}}}class YHt extends O1{run(e){e instanceof gl||e.numChildren()>0||e instanceof jO||e instanceof Db||(this.setModified(),e.remove())}}class QHt extends O1{run(e){const n=e.children.filter(i=>i instanceof bh),r=n.pop();for(const i of n)this.setModified(),r.merge(i)}}class KHt extends O1{run(e){const n=e.children.filter(i=>i instanceof Lf),r={};for(const i of n){const o=Mn(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(const i of Qe(r)){const o=r[i];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(e.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class ZHt extends O1{constructor(e){super(),this.model=e}run(e){const n=!(Dae(e)||e instanceof zO||e instanceof Qs||e instanceof yy),r=[],i=[];for(const o of e.children)o instanceof wh&&(n&&!Ese(e.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof wh?e.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class JHt extends O1{run(e){const n=[...e.children];if(!nC(n,s=>s instanceof gl)||e.numChildren()<=1)return;const i=[];let o;for(const s of n)if(s instanceof gl){let a=s;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof gl)a=l;else break}i.push(...a.children),o?(e.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else i.push(s);if(i.length){this.setModified();for(const s of i)s.parent.removeChild(s),s.parent=o}}}class E1 extends Sr{clone(){return new E1(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Jd(this.transform.groupby.concat(e),n=>n)}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??ct(e)}hash(){return`JoinAggregateTransform ${Mn(this.transform)}`}assemble(){const e=[],n=[],r=[];for(const o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),e.push(o.field===void 0?null:o.field);const i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:e,...i!==void 0?{groupby:i}:{}}}}class mC extends Sr{clone(){return new mC(null,{...this.filter})}constructor(e,n){super(e),this.filter=n}static make(e,n,r){const{config:i,markDef:o}=n,{marks:s,scales:a}=r;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const l=n.reduceFieldDef((c,u,f)=>{const d=Jh(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=u,g=tae({scaleChannel:f,markDef:o,config:i,scaleType:h,isCountAggregate:x6(p)});g!=="show"&&g!=="always-valid"&&(c[u.field]=u)}return c},{});return Qe(l).length?new mC(e,l):null}dependentFields(){return new Set(Qe(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Mn(this.filter)}`}assemble(){const e=Qe(this.filter).reduce((n,r)=>{const i=this.filter[r],o=ct(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (${iQ(o)}))`):i.type==="quantitative"&&n.push(iQ(o))),n},[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}function iQ(t){return`isValid(${t}) && isFinite(+${t})`}function eqt(t){return t.stack.stackBy.reduce((e,n)=>{const r=n.fieldDef,i=ct(r);return i&&e.push(i),e},[])}function tqt(t){return We(t)&&t.every(e=>gt(e))&&t.length>1}class gg extends Sr{clone(){return new gg(null,Kt(this._stack))}constructor(e,n){super(e),this._stack=n}static makeFromTransform(e,n){const{stack:r,groupby:i,as:o,offset:s="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(qi(f.order,"ascending"));const c={field:a,order:l};let u;return tqt(o)?u=o:gt(o)?u=[o,`${o}_end`]:u=[`${n.stack}_start`,`${n.stack}_end`],new gg(e,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:s,sort:c,facetby:[],as:u})}static makeFromEncoding(e,n){const r=n.stack,{encoding:i}=n;if(!r)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:l}=r,c=o.map(h=>{const p=i[h];return Xf(p)}).filter(h=>!!h),u=eqt(n),f=n.encoding.order;let d;if(We(f)||Je(f))d=S4e(f);else{const h=hBe(f)?f.sort:s==="y"?"descending":"ascending";d=u.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new gg(e,{dimensionFieldDefs:c,stackField:n.vgField(s),facetby:[],stackby:u,sort:d,offset:a,impute:l,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Mn(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:n,groupby:r}=this._stack;return e.length>0?e.map(i=>i.bin?n?[ct(i,{binSuffix:"mid"})]:[ct(i,{}),ct(i,{binSuffix:"end"})]:[ct(i)]).flat():r??[]}assemble(){const e=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:s,offset:a,impute:l,as:c}=this._stack;if(l)for(const u of r){const{bandPosition:f=.5,bin:d}=u;if(d){const h=ct(u,{expr:"datum"}),p=ct(u,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${iQ(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:ct(u,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:i,groupby:[...o,...n],key:ct(u,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:s,as:c,offset:a}),e}}class BO extends Sr{clone(){return new BO(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Jd(this.transform.groupby.concat(e),n=>n)}dependentFields(){const e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach(n=>e.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??ct(e)}hash(){return`WindowTransform ${Mn(this.transform)}`}assemble(){const e=[],n=[],r=[],i=[];for(const f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),e.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>$se(f)))return{type:"joinaggregate",as:r,ops:n,fields:e,...s!==void 0?{groupby:s}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const c={field:a,order:l},u=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:e,sort:c,...u!==void 0?{ignorePeers:u}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function nqt(t){function e(n){if(!(n instanceof jO)){const r=n.clone();if(r instanceof gl){const i=sQ+r.getSource();r.setSource(i),t.model.component.data.outputNodes[i]=r}else(r instanceof Lf||r instanceof gg||r instanceof BO||r instanceof E1)&&r.addDimensions(t.fields);for(const i of n.children.flatMap(e))i.parent=r;return[r]}return n.children.flatMap(e)}return e}function oQ(t){if(t instanceof jO)if(t.numChildren()===1&&!(t.children[0]instanceof gl)){const e=t.children[0];(e instanceof Lf||e instanceof gg||e instanceof BO||e instanceof E1)&&e.addDimensions(t.fields),e.swapWithParent(),oQ(t)}else{const e=t.model.component.data.main;eUe(e);const n=nqt(t),r=t.children.map(n).flat();for(const i of r)i.parent=e}else t.children.map(oQ)}function eUe(t){if(t instanceof gl&&t.type===$i.Main&&t.numChildren()===1){const e=t.children[0];e instanceof jO||(e.swapWithParent(),eUe(t))}}const sQ="scale_",oL=5;function aQ(t){for(const e of t){for(const n of e.children)if(n.parent!==e)return!1;if(!aQ(e.children))return!1}return!0}function Xu(t,e){let n=!1;for(const r of e)n=t.optimize(r)||n;return n}function b0e(t,e,n){let r=t.sources,i=!1;return i=Xu(new HHt,r)||i,i=Xu(new VHt(e),r)||i,r=r.filter(o=>o.numChildren()>0),i=Xu(new YHt,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=Xu(new qHt,r)||i,i=Xu(new ZHt(e),r)||i,i=Xu(new GHt,r)||i,i=Xu(new XHt,r)||i,i=Xu(new KHt,r)||i,i=Xu(new QHt,r)||i,i=Xu(new WHt,r)||i,i=Xu(new JHt,r)||i),t.sources=r,i}function rqt(t,e){aQ(t.sources);let n=0,r=0;for(let i=0;ie(n))}}function tUe(t){_i(t)?iqt(t):oqt(t)}function iqt(t){const e=t.component.scales;for(const n of Qe(e)){const r=aqt(t,n);if(e[n].setWithExplicit("domains",r),cqt(t,n),t.component.data.isFaceted){let o=t;for(;!gc(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of r.value)eg(a)&&(a.data=sQ+a.data.replace(sQ,""))}}}function oqt(t){for(const n of t.children)tUe(n);const e=t.component.scales;for(const n of Qe(e)){let r,i=null;for(const o of t.children){const s=o.component.scales[n];if(s){r===void 0?r=s.getWithExplicit("domains"):r=my(r,s.getWithExplicit("domains"),"domains","scale",lQ);const a=s.get("selectionExtent");i&&a&&i.param!==a.param&&Ze(tWt),i=a}}e[n].setWithExplicit("domains",r),i&&e[n].set("selectionExtent",i,!0)}}function sqt(t,e,n,r){if(t==="unaggregated"){const{valid:i,reason:o}=w0e(e,n);if(!i){Ze(o);return}}else if(t===void 0&&r.useUnaggregatedDomain){const{valid:i}=w0e(e,n);if(i)return"unaggregated"}return t}function aqt(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:r}=t,i=sqt(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return i!==t.scaleDomain(e)&&(t.specifiedScales[e]={...t.specifiedScales[e],domain:i}),e==="x"&&_o(r.x2)?_o(r.x)?my(Im(n,i,t,"x"),Im(n,i,t,"x2"),"domain","scale",lQ):Im(n,i,t,"x2"):e==="y"&&_o(r.y2)?_o(r.y)?my(Im(n,i,t,"y"),Im(n,i,t,"y2"),"domain","scale",lQ):Im(n,i,t,"y2"):Im(n,i,t,e)}function lqt(t,e,n){return t.map(r=>({signal:`{data: ${R6(r,{timeUnit:n,type:e})}}`}))}function JV(t,e,n){var i;const r=(i=Vo(n))==null?void 0:i.unit;return e==="temporal"||r?lqt(t,e,r):[t]}function Im(t,e,n,r){const{encoding:i,markDef:o,mark:s,config:a,stack:l}=n,c=_o(i[r]),{type:u}=c,f=c.timeUnit,d=nGt({invalid:Ih("invalid",o,a),isPath:r0(s)});if(CVt(e)){const g=Im(t,void 0,n,r),m=JV(e.unionWith,u,f);return Md([...m,...g.value])}else{if(Rt(e))return Md([e]);if(e&&e!=="unaggregated"&&!Q4e(e))return Md(JV(e,u,f))}if(l&&r===l.fieldChannel){if(l.offset==="normalize")return Vl([[0,1]]);const g=n.requestDataName(d);return Vl([{data:g,field:n.vgField(r,{suffix:"start"})},{data:g,field:n.vgField(r,{suffix:"end"})}])}const h=Jh(r)&&Je(c)?uqt(n,r,t):void 0;if(ep(c)){const g=JV([c.datum],u,f);return Vl(g)}const p=c;if(e==="unaggregated"){const{field:g}=c;return Vl([{data:n.requestDataName(d),field:ct({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:ct({field:g,aggregate:"max"})}])}else if(qr(p.bin)){if(Go(t))return Vl(t==="bin-ordinal"?[]:[{data:HA(h)?n.requestDataName(d):n.requestDataName($i.Raw),field:n.vgField(r,VR(p,r)?{binSuffix:"range"}:{}),sort:h===!0||!ht(h)?{field:n.vgField(r,{}),op:"min"}:h}]);{const{bin:g}=p;if(qr(g)){const m=Rae(n,p.field,g);return Vl([new Lo(()=>{const v=n.getSignalName(m);return`[${v}.start, ${v}.stop]`})])}else return Vl([{data:n.requestDataName(d),field:n.vgField(r,{})}])}}else if(p.timeUnit&&En(["time","utc"],t)){const g=i[Zh(r)];if(dBe(p,g,o,a)){const m=n.requestDataName(d),v=gy({fieldDef:p,fieldDef2:g,markDef:o,config:a}),y=XA(s)&&v!==.5&&Xi(r);return Vl([{data:m,field:n.vgField(r,y?{suffix:N6}:{})},{data:m,field:n.vgField(r,{suffix:y?z6:"end"})}])}}return Vl(h?[{data:HA(h)?n.requestDataName(d):n.requestDataName($i.Raw),field:n.vgField(r),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(r)}])}function e9(t,e){const{op:n,field:r,order:i}=t;return{op:n??(e?"sum":k6),...r?{field:Pu(r)}:{},...i?{order:i}:{}}}function cqt(t,e){var a;const n=t.component.scales[e],r=t.specifiedScales[e].domain,i=(a=t.fieldDef(e))==null?void 0:a.bin,o=Q4e(r)?r:void 0,s=b1(i)&&b6(i.extent)?i.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function uqt(t,e,n){if(!Go(n))return;const r=t.fieldDef(e),i=r.sort;if(uBe(i))return{op:"min",field:pC(r,e),order:"ascending"};const{stack:o}=t,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(hg(i)){const a=o&&!s.has(i.field);return e9(i,a)}else if(n9t(i)){const{encoding:a,order:l}=i,c=t.fieldDef(a),{aggregate:u,field:f}=c,d=o&&!s.has(f);if(zg(u)||n0(u))return e9({field:ct(c),order:l},d);if($se(u)||!u)return e9({op:u,field:f,order:l},d)}else{if(i==="descending")return{op:"min",field:t.vgField(e),order:"descending"};if(En(["ascending",void 0],i))return!0}}function w0e(t,e){const{aggregate:n,type:r}=t;return n?gt(n)&&!N8t.has(n)?{valid:!1,reason:TWt(n)}:r==="quantitative"&&e==="log"?{valid:!1,reason:kWt(t)}:{valid:!0}:{valid:!1,reason:EWt(t)}}function lQ(t,e,n,r){return t.explicit&&e.explicit&&Ze(DWt(n,r,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function fqt(t){const e=Jd(t.map(s=>{if(eg(s)){const{sort:a,...l}=s;return l}return s}),Mn),n=Jd(t.map(s=>{if(eg(s)){const a=s.sort;return a!==void 0&&!HA(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),Mn);if(e.length===0)return;if(e.length===1){const s=t[0];if(eg(s)&&n.length>0){let a=n[0];if(n.length>1){Ze(Aye);const l=n.filter(c=>ht(c)&&"op"in c&&c.op!=="min");n.every(c=>ht(c)&&"op"in c)&&l.length===1?a=l[0]:a=!0}else if(ht(a)&&"field"in a){const l=a.field;s.field===l&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const r=Jd(n.map(s=>HA(s)||!("op"in s)||gt(s.op)&&vt(I8t,s.op)?s:(Ze(LWt(s)),!0)),Mn);let i;r.length===1?i=r[0]:r.length>1&&(Ze(Aye),i=!0);const o=Jd(t.map(s=>eg(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:e.map(a=>a.field),...i?{sort:i}:{}}:{fields:e,...i?{sort:i}:{}}}function $ae(t){if(eg(t)&>(t.field))return t.field;if(z8t(t)){let e;for(const n of t.fields)if(eg(n)&>(n.field)){if(!e)e=n.field;else if(e!==n.field)return Ze($Wt),e}return Ze(FWt),e}else if(j8t(t)){Ze(NWt);const e=t.fields[0];return gt(e)?e:void 0}}function V6(t,e){const r=t.component.scales[e].get("domains").map(i=>(eg(i)&&(i.data=t.lookupDataSource(i.data)),i));return fqt(r)}function nUe(t){return UO(t)||Fae(t)?t.children.reduce((e,n)=>e.concat(nUe(n)),_0e(t)):_0e(t)}function _0e(t){return Qe(t.component.scales).reduce((e,n)=>{const r=t.component.scales[n];if(r.merged)return e;const i=r.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:c,reverse:u,...f}=i,d=dqt(i.range,o,n,t),h=V6(t,n),p=a?lGt(t,a,r,h):null;return e.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...u!==void 0?{reverse:u}:{},...f}),e},[])}function dqt(t,e,n,r){if(Xi(n)){if(w1(t))return{step:{signal:`${e}_step`}}}else if(ht(t)&&eg(t))return{...t,data:r.lookupDataSource(t.data)};return t}class rUe extends rm{constructor(e,n){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const e=this.get("type");if(En([ss.LOG,ss.TIME,ss.UTC],e))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&En([ss.LINEAR,ss.SQRT,ss.POW],e))return"definitely";const r=this.get("domains");if(r.length>0){let i=!1,o=!1,s=!1;for(const a of r){if(We(a)){const l=a[0],c=a[a.length-1];if(Jn(l)&&Jn(c))if(l<=0&&c>=0){i=!0;continue}else{o=!0;continue}}s=!0}if(i)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const hqt=["range","scheme"];function pqt(t){const e=t.component.scales;for(const n of Lse){const r=e[n];if(!r)continue;const i=gqt(n,t);r.setWithExplicit("range",i)}}function S0e(t,e){const n=t.fieldDef(e);if(n!=null&&n.bin){const{bin:r,field:i}=n,o=El(e),s=t.getName(o);if(ht(r)&&r.binned&&r.step!==void 0)return new Lo(()=>{const a=t.scaleName(e),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${r.step}`;return`${t.getSignalName(s)} / (${l})`});if(qr(r)){const a=Rae(t,i,r);return new Lo(()=>{const l=t.getSignalName(a),c=`(${l}.stop - ${l}.start) / ${l}.step`;return`${t.getSignalName(s)} / (${c})`})}}}function gqt(t,e){const n=e.specifiedScales[t],{size:r}=e,o=e.getScaleComponent(t).get("type");for(const f of hqt)if(n[f]!==void 0){const d=VY(o,f),h=K4e(t,f);if(!d)Ze(P4e(o,f,t));else if(h)Ze(h);else switch(f){case"range":{const p=n.range;if(We(p)){if(Xi(t))return Md(p.map(g=>{if(g==="width"||g==="height"){const m=e.getName(g),v=e.getSignalName.bind(e);return Lo.fromName(v,m)}return g}))}else if(ht(p))return Md({data:e.requestDataName($i.Main),field:p.field,sort:{op:"min",field:e.vgField(t)}});return Md(p)}case"scheme":return Md(mqt(n[f]))}}const s=t===xi||t==="xOffset"?"width":"height",a=r[s];if($h(a)){if(Xi(t))if(Go(o)){const f=oUe(a,e,t);if(f)return Md({step:f})}else Ze(M4e(s));else if(FR(t)){const f=t===Ky?"x":"y";if(e.getScaleComponent(f).get("type")==="band"){const p=sUe(a,o);if(p)return Md(p)}}}const{rangeMin:l,rangeMax:c}=n,u=vqt(t,e);return(l!==void 0||c!==void 0)&&VY(o,"rangeMin")&&We(u)&&u.length===2?Md([l??u[0],c??u[1]]):Vl(u)}function mqt(t){return SVt(t)?{scheme:t.name,...pl(t,["name"])}:{scheme:t}}function iUe(t,e,n,{center:r}={}){const i=El(t),o=e.getName(i),s=e.getSignalName.bind(e);return t===Qo&&Hf(n)?r?[Lo.fromName(a=>`${s(a)}/2`,o),Lo.fromName(a=>`-${s(a)}/2`,o)]:[Lo.fromName(s,o),0]:r?[Lo.fromName(a=>`-${s(a)}/2`,o),Lo.fromName(a=>`${s(a)}/2`,o)]:[0,Lo.fromName(s,o)]}function vqt(t,e){const{size:n,config:r,mark:i,encoding:o}=e,{type:s}=_o(o[t]),l=e.getScaleComponent(t).get("type"),{domain:c,domainMid:u}=e.specifiedScales[t];switch(t){case xi:case Qo:{if(En(["point","band"],l)){const f=aUe(t,n,r.view);if($h(f))return{step:oUe(f,e,t)}}return iUe(t,e,l)}case Ky:case $O:return yqt(t,e,l);case Jg:{const f=wqt(i,r),d=_qt(i,n,e,r);return aC(l)?bqt(f,d,xqt(l,r,c,t)):[f,d]}case zu:return[0,Math.PI*2];case y1:return[0,360];case ad:return[0,new Lo(()=>{const f=e.getSignalName(gc(e.parent)?"child_width":"width"),d=e.getSignalName(gc(e.parent)?"child_height":"height");return`min(${f},${d})/2`})];case e0:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case t0:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Ol:return"symbol";case Cl:case Qh:case Kh:return l==="ordinal"?s==="nominal"?"category":"ordinal":u!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case em:case Zy:case Jy:return[r.scale.minOpacity,r.scale.maxOpacity]}}function oUe(t,e,n){const{encoding:r}=e,i=e.getScaleComponent(n),o=Mse(n),s=r[o];if(VBe({step:t,offsetIsDiscrete:en(s)&&G4e(s.type)})==="offset"&&CBe(r,o)){const l=e.getScaleComponent(o);let u=`domain('${e.scaleName(o)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;u=`bandspace(${u}, ${d}, ${h})`}const f=i.get("paddingInner")??i.get("padding");return{signal:`${t.step} * ${u} / (1-${V8t(f)})`}}else return t.step}function sUe(t,e){if(VBe({step:t,offsetIsDiscrete:Go(e)})==="offset")return{step:t.step}}function yqt(t,e,n){const r=t===Ky?"x":"y",i=e.getScaleComponent(r);if(!i)return iUe(r,e,n,{center:!0});const o=i.get("type"),s=e.scaleName(r),{markDef:a,config:l}=e;if(o==="band"){const c=aUe(r,e.size,e.config.view);if($h(c)){const u=sUe(c,n);if(u)return u}return[0,{signal:`bandwidth('${s}')`}]}else{const c=e.encoding[r];if(Je(c)&&c.timeUnit){const u=B4e(c.timeUnit,p=>`scale('${s}', ${p})`),f=e.config.scale.bandWithNestedOffsetPaddingInner,d=gy({fieldDef:c,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=Rt(f)?`${f.signal}/2`+h:`${f/2+d}`,g=Rt(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${u})`},{signal:`${g} * (${u})`}]}return[0,{signal:u}]}return Zje(`Cannot use ${t} scale if ${r} scale is not discrete.`)}}function aUe(t,e,n){const r=t===xi?"width":"height",i=e[r];return i||j5(n,r)}function xqt(t,e,n,r){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return n!==void 0&&We(n)?n.length+1:(Ze(qWt(r)),3)}}function bqt(t,e,n){const r=()=>{const i=Ef(e),o=Ef(t),s=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${s}, ${s})`};return Rt(e)?new Lo(r):{signal:r()}}function wqt(t,e){switch(t){case"bar":case"tick":return e.scale.minBandSize;case"line":case"trail":case"rule":return e.scale.minStrokeWidth;case"text":return e.scale.minFontSize;case"point":case"square":case"circle":return e.scale.minSize}throw new Error(w6("size",t))}const C0e=.95;function _qt(t,e,n,r){const i={x:S0e(n,"x"),y:S0e(n,"y")};switch(t){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;const o=O0e(e,i,r.view);return Jn(o)?o-1:new Lo(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const o=O0e(e,i,r.view);return Jn(o)?Math.pow(C0e*o,2):new Lo(()=>`pow(${C0e} * ${o.signal}, 2)`)}}throw new Error(w6("size",t))}function O0e(t,e,n){const r=$h(t.width)?t.width.step:XY(n,"width"),i=$h(t.height)?t.height.step:XY(n,"height");return e.x||e.y?new Lo(()=>`min(${[e.x?e.x.signal:r,e.y?e.y.signal:i].join(", ")})`):Math.min(r,i)}function lUe(t,e){_i(t)?Sqt(t,e):uUe(t,e)}function Sqt(t,e){const n=t.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:s}=t;for(const a of Qe(n)){const l=s[a],c=n[a],u=t.getScaleComponent(a),f=_o(i[a]),d=l[e],h=u.get("type"),p=u.get("padding"),g=u.get("paddingInner"),m=VY(h,e),v=K4e(a,e);if(d!==void 0&&(m?v&&Ze(v):Ze(P4e(h,e,a))),m&&v===void 0)if(d!==void 0){const y=f.timeUnit,x=f.type;switch(e){case"domainMax":case"domainMin":_1(l[e])||x==="temporal"||y?c.set(e,{signal:R6(l[e],{type:x,timeUnit:y})},!0):c.set(e,l[e],!0);break;default:c.copyKeyFromObject(e,l)}}else{const y=Ke(E0e,e)?E0e[e]({model:t,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:OBe(i,a),hasSecondaryRangeChannel:!!i[Zh(a)]}):r.scale[e];y!==void 0&&c.set(e,y,!1)}}}const E0e={bins:({model:t,fieldOrDatumDef:e})=>Je(e)?Cqt(t,e):void 0,interpolate:({channel:t,fieldOrDatumDef:e})=>Oqt(t,e.type),nice:({scaleType:t,channel:e,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>Eqt(t,e,n,r,i,o),padding:({channel:t,scaleType:e,fieldOrDatumDef:n,markDef:r,config:i})=>Tqt(t,e,i.scale,n,r,i.bar),paddingInner:({scalePadding:t,channel:e,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>kqt(t,e,n.type,r,i.scale,o),paddingOuter:({scalePadding:t,channel:e,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>Aqt(t,e,n,r,i.scale,o),reverse:({fieldOrDatumDef:t,scaleType:e,channel:n,config:r})=>{const i=Je(t)?t.sort:void 0;return Pqt(e,i,n,r.scale)},zero:({channel:t,fieldOrDatumDef:e,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:s})=>Mqt(t,e,n,r,i,o.scale,s)};function cUe(t){_i(t)?pqt(t):uUe(t,"range")}function uUe(t,e){const n=t.component.scales;for(const r of t.children)e==="range"?cUe(r):lUe(r,e);for(const r of Qe(n)){let i;for(const o of t.children){const s=o.component.scales[r];if(s){const a=s.getWithExplicit(e);i=my(i,a,e,"scale",r6e((l,c)=>{switch(e){case"range":return l.step&&c.step?l.step-c.step:0}return 0}))}}n[r].setWithExplicit(e,i)}}function Cqt(t,e){const n=e.bin;if(qr(n)){const r=Rae(t,e.field,n);return new Lo(()=>t.getSignalName(r))}else if(rs(n)&&b1(n)&&n.step!==void 0)return{step:n.step}}function Oqt(t,e){if(En([Cl,Qh,Kh],t)&&e!=="nominal")return"hcl"}function Eqt(t,e,n,r,i,o){var s;if(!((s=Xf(o))!=null&&s.bin||We(n)||i!=null||r!=null||En([ss.TIME,ss.UTC],t)))return Xi(e)?!0:void 0}function Tqt(t,e,n,r,i,o){if(Xi(t)){if(eh(e)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=i;if(s==="bar"&&!(Je(r)&&(r.bin||r.timeUnit))&&(a==="vertical"&&t==="x"||a==="horizontal"&&t==="y"))return o.continuousBandSize}if(e===ss.POINT)return n.pointPadding}}function kqt(t,e,n,r,i,o=!1){if(t===void 0){if(Xi(e)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:l,tickBandPaddingInner:c,bandWithNestedOffsetPaddingInner:u}=i;return o?u:qi(s,n==="bar"?a:n==="tick"?c:l)}else if(FR(e)&&r===ss.BAND)return i.offsetBandPaddingInner}}function Aqt(t,e,n,r,i,o=!1){if(t===void 0){if(Xi(e)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=i;if(o)return a;if(n===ss.BAND)return qi(s,Rt(r)?{signal:`${r.signal}/2`}:r/2)}else if(FR(e)){if(n===ss.POINT)return .5;if(n===ss.BAND)return i.offsetBandPaddingOuter}}}function Pqt(t,e,n,r){if(n==="x"&&r.xReverse!==void 0)return Hf(t)&&e==="descending"?Rt(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(Hf(t)&&e==="descending")return!0}function Mqt(t,e,n,r,i,o,s){if(!!n&&n!=="unaggregated"&&Hf(i)){if(We(n)){const l=n[0],c=n[n.length-1];if(Jn(l)&&l<=0&&Jn(c)&&c>=0)return!0}return!1}if(t==="size"&&e.type==="quantitative"&&!aC(i))return!0;if(!(Je(e)&&e.bin)&&En([...tm,...E8t],t)){const{orient:l,type:c}=r;return En(["bar","area","line","trail"],c)&&(l==="horizontal"&&t==="y"||l==="vertical"&&t==="x")?!1:En(["bar","area"],c)&&!s?!0:o==null?void 0:o.zero}return!1}function Rqt(t,e,n,r,i=!1){const o=Dqt(e,n,r,i),{type:s}=t;return Jh(e)?s!==void 0?PVt(e,s)?Je(n)&&!AVt(s,n.type)?(Ze(MWt(s,o)),o):s:(Ze(PWt(e,s,o)),o):o:null}function Dqt(t,e,n,r){var i;switch(e.type){case"nominal":case"ordinal":{if(G_(t)||VV(t)==="discrete")return t==="shape"&&e.type==="ordinal"&&Ze(GV(t,"ordinal")),"ordinal";if(Xi(t)||FR(t)){if(En(["rect","bar","image","rule","tick"],n.type)||r)return"band"}else if(n.type==="arc"&&t in Ise)return"band";const o=n[El(t)];return Ab(o)||cC(e)&&((i=e.axis)!=null&&i.tickBand)?"band":"point"}case"temporal":return G_(t)?"time":VV(t)==="discrete"?(Ze(GV(t,"temporal")),"ordinal"):Je(e)&&e.timeUnit&&Vo(e.timeUnit).utc?"utc":"time";case"quantitative":return G_(t)?Je(e)&&qr(e.bin)?"bin-ordinal":"linear":VV(t)==="discrete"?(Ze(GV(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(k4e(e.type))}function Iqt(t,{ignoreRange:e}={}){fUe(t),tUe(t);for(const n of kVt)lUe(t,n);e||cUe(t)}function fUe(t){_i(t)?t.component.scales=Lqt(t):t.component.scales=Fqt(t)}function Lqt(t){const{encoding:e,mark:n,markDef:r}=t,i={};for(const o of Lse){const s=_o(e[o]);if(s&&n===eBe&&o===Ol&&s.type===FO)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const l=OBe(e,o),c=Rqt(a,o,s,r,l);i[o]=new rUe(t.scaleName(`${o}`,!0),{value:c,explicit:a.type===c})}}return i}const $qt=r6e((t,e)=>Mye(t)-Mye(e));function Fqt(t){var e;const n=t.component.scales={},r={},i=t.component.resolve;for(const o of t.children){fUe(o);for(const s of Qe(o.component.scales))if((e=i.scale)[s]??(e[s]=U6e(s,t)),i.scale[s]==="shared"){const a=r[s],l=o.component.scales[s].getWithExplicit("type");a?yVt(a.value,l.value)?r[s]=my(a,l,"type","scale",$qt):(i.scale[s]="independent",delete r[s]):r[s]=l}}for(const o of Qe(r)){const s=t.scaleName(o,!0),a=r[o];n[o]=new rUe(s,a);for(const l of t.children){const c=l.component.scales[o];c&&(l.renameScale(c.get("name"),s),c.merged=!0)}}return n}class t9{constructor(){this.nameMap={}}rename(e,n){this.nameMap[e]=n}has(e){return this.nameMap[e]!==void 0}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function _i(t){return(t==null?void 0:t.type)==="unit"}function gc(t){return(t==null?void 0:t.type)==="facet"}function Fae(t){return(t==null?void 0:t.type)==="concat"}function UO(t){return(t==null?void 0:t.type)==="layer"}class Nae{constructor(e,n,r,i,o,s,a){this.type=n,this.parent=r,this.config=o,this.correctDataNames=l=>{var c,u,f;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data)),(f=(u=l.from)==null?void 0:u.facet)!=null&&f.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l},this.parent=r,this.config=o,this.view=os(a),this.name=e.name??i,this.title=Km(e.title)?{text:e.title}:e.title?os(e.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new t9,this.projectionNameMap=r?r.projectionNameMap:new t9,this.signalNameMap=r?r.signalNameMap:new t9,this.data=e.data,this.description=e.description,this.transforms=V7t(e.transform??[]),this.layout=n==="layer"||n==="unit"?{}:X9t(e,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:A6(e)||(r==null?void 0:r.component.data.isFaceted)&&e.data===void 0},layoutSize:new rm,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?Kt(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Iqt(this)}parseProjection(){Z6e(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){q6e(this)}assembleEncodeFromView(e){const{style:n,...r}=e,i={};for(const o of Qe(r)){const s=r[o];s!==void 0&&(i[o]=ni(s))}return i}assembleGroupEncodeEntry(e){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!e&&(this.description&&(n.description=ni(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Tr(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:e,...n}=this.layout,{component:r,config:i}=this,o=rHt(r.layoutHeaders,i);return{padding:e,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let n=[];for(const r of su)e[r].title&&n.push(KGt(this,r));for(const r of kae)n=n.concat(ZGt(this,r));return n}assembleAxes(){return NGt(this.component.axes,this.config)}assembleLegends(){return Y6e(this)}assembleProjections(){return EHt(this)}assembleTitle(){const{encoding:e,...n}=this.title??{},r={...x4e(this.config.title).nonMarkTitleProperties,...n,...e?{encode:{update:e}}:{}};if(r.text)return En(["unit","layer"],this.type)?En(["middle",void 0],r.anchor)&&(r.frame??(r.frame="group")):r.anchor??(r.anchor="start"),Tr(r)?void 0:r}assembleGroup(e=[]){const n={};e=e.concat(this.assembleSignals()),e.length>0&&(n.signals=e);const r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||gc(this.parent)?nUe(this):[];i.length>0&&(n.scales=i);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(e){return gi((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName($i[e].toLowerCase())}requestDataName(e){const n=this.getDataName(e),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(e){if(gc(this.parent)){const n=j6e(e),r=y6(n),i=this.component.scales[r];if(i&&!i.merged){const o=i.get("type"),s=i.get("range");if(Go(o)&&w1(s)){const a=i.get("name"),l=V6(this,r),c=$ae(l);if(c){const u=ct({aggregate:"distinct",field:c},{expr:"datum"});return{signal:z6e(a,i,u)}}else return Ze(Nse(r)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const n=this.component.data.outputNodes[e];return n?n.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,n){this.signalNameMap.rename(e,n)}renameScale(e,n){this.scaleNameMap.rename(e,n)}renameProjection(e,n){this.projectionNameMap.rename(e,n)}scaleName(e,n){if(n)return this.getName(e);if(f4e(e)&&Jh(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e)))return this.scaleNameMap.get(this.getName(e))}projectionName(e){if(e)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[e];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(e):void 0}getScaleType(e){const n=this.getScaleComponent(e);return n?n.get("type"):void 0}getSelectionComponent(e,n){let r=this.component.selection[e];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(e,n)),!r)throw new Error(Y8t(n));return r}hasAxisOrientSignalRef(){var e,n;return((e=this.component.axes.x)==null?void 0:e.some(r=>r.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(r=>r.hasOrientSignalRef()))}}class dUe extends Nae{vgField(e,n={}){const r=this.fieldDef(e);if(r)return ct(r,n)}reduceFieldDef(e,n){return S9t(this.getMapping(),(r,i,o)=>{const s=Xf(i);return s?e(r,s,o):r},n)}forEachFieldDef(e,n){uae(this.getMapping(),(r,i)=>{const o=Xf(r);o&&e(o,i)},n)}}class G6 extends Sr{clone(){return new G6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];const i=this.transform.resolve??"shared";this.transform.resolve=i}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Mn(this.transform)}`}assemble(){const{density:e,...n}=this.transform,r={type:"kde",field:e,...n};return r.resolve=this.transform.resolve,r}}class H6 extends Sr{clone(){return new H6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Mn(this.transform)}`}assemble(){const{extent:e,param:n}=this.transform;return{type:"extent",field:e,signal:n}}}class q6 extends Sr{clone(){return new q6(this.parent,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,s)=>i[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Mn(this.transform)}`}assemble(){const{flatten:e,as:n}=this.transform;return{type:"flatten",fields:e,as:n}}}class X6 extends Sr{clone(){return new X6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Mn(this.transform)}`}assemble(){const{fold:e,as:n}=this.transform;return{type:"fold",fields:e,as:n}}}class X_ extends Sr{clone(){return new X_(null,Kt(this.fields),this.geojson,this.signal)}static parseAll(e,n){if(n.component.projection&&!n.component.projection.isFit)return e;let r=0;for(const i of[[cd,ld],[Mu,ud]]){const o=i.map(s=>{const a=_o(n.encoding[s]);return Je(a)?a.field:ep(a)?{expr:`${a.datum}`}:qf(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(e=new X_(e,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(Ol)){const i=n.typedFieldDef(Ol);i.type===FO&&(e=new X_(e,null,i.field,n.getName(`geojson_${r++}`)))}return e}constructor(e,n,r,i){super(e),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){const e=(this.fields??[]).filter(gt);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Mn(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class QA extends Sr{clone(){return new QA(null,this.projection,Kt(this.fields),Kt(this.as))}constructor(e,n,r,i){super(e),this.projection=n,this.fields=r,this.as=i}static parseAll(e,n){if(!n.projectionName())return e;for(const r of[[cd,ld],[Mu,ud]]){const i=r.map(s=>{const a=_o(n.encoding[s]);return Je(a)?a.field:ep(a)?{expr:`${a.datum}`}:qf(a)?{expr:`${a.value}`}:void 0}),o=r[0]===Mu?"2":"";(i[0]||i[1])&&(e=new QA(e,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return e}dependentFields(){return new Set(this.fields.filter(gt))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Mn(this.fields)} ${Mn(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Hx extends Sr{clone(){return new Hx(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:n=0,stop:r,step:i}=e;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(e,n){return new Hx(e,n)}static makeFromEncoding(e,n){const r=n.encoding,i=r.x,o=r.y;if(Je(i)&&Je(o)){const s=i.impute?i:o.impute?o:void 0;if(s===void 0)return;const a=i.impute?o:o.impute?i:void 0,{method:l,value:c,frame:u,keyvals:f}=s.impute,d=kBe(n.mark,r);return new Hx(e,{impute:s.field,key:a.field,...l?{method:l}:{},...c!==void 0?{value:c}:{},...u?{frame:u}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${Mn(this.transform)}`}assemble(){const{impute:e,key:n,keyvals:r,method:i,groupby:o,value:s,frame:a=[null,null]}=this.transform,l={type:"impute",field:e,key:n,...r?{keyvals:O7t(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?s:null};if(i&&i!=="value"){const c={type:"window",as:[`imputed_${e}_value`],ops:[i],fields:[e],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},u={type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e};return[l,c,u]}else return[l]}}class Y6 extends Sr{clone(){return new Y6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Mn(this.transform)}`}assemble(){const{loess:e,on:n,...r}=this.transform;return{type:"loess",x:n,y:e,...r}}}class KA extends Sr{clone(){return new KA(null,Kt(this.transform),this.secondary)}constructor(e,n,r){super(e),this.transform=n,this.secondary=r}static make(e,n,r,i){const o=n.component.data.sources,{from:s}=r;let a=null;if(E7t(s)){let l=gUe(s.data,o);l||(l=new Db(s.data),o.push(l));const c=n.getName(`lookup_${i}`);a=new gl(l,c,$i.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[c]=a}else if(T7t(s)){const l=s.param;r={as:l,...r};let c;try{c=n.getSelectionComponent(gi(l),l)}catch{throw new Error(J8t(l))}if(a=c.materialized,!a)throw new Error(eWt(l))}return new KA(e,r,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?pt(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Mn({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:pt(this.transform.as)}:{}};else{let n=this.transform.as;gt(n)||(Ze(lWt),n="_lookup"),e={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class Q6 extends Sr{clone(){return new Q6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Mn(this.transform)}`}assemble(){const{quantile:e,...n}=this.transform;return{type:"quantile",field:e,...n}}}class K6 extends Sr{clone(){return new K6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Mn(this.transform)}`}assemble(){const{regression:e,on:n,...r}=this.transform;return{type:"regression",x:n,y:e,...r}}}class Z6 extends Sr{clone(){return new Z6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Jd((this.transform.groupby??[]).concat(e),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Mn(this.transform)}`}assemble(){const{pivot:e,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:e,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class J6 extends Sr{clone(){return new J6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Mn(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function hUe(t){let e=0;function n(r,i){if(r instanceof Db&&!r.isGenerator&&!fC(r.data)&&(t.push(i),i={name:null,source:i.name,transform:[]}),r instanceof Qs&&(r.parent instanceof Db&&!i.source?(i.format={...i.format,parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof jO){i.name||(i.name=`data_${e++}`),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source,t.push(...r.assemble());return}switch((r instanceof qR||r instanceof XR||r instanceof mC||r instanceof zO||r instanceof hC||r instanceof QA||r instanceof Lf||r instanceof KA||r instanceof BO||r instanceof E1||r instanceof X6||r instanceof q6||r instanceof G6||r instanceof Y6||r instanceof Q6||r instanceof K6||r instanceof yy||r instanceof J6||r instanceof Z6||r instanceof H6)&&i.transform.push(r.assemble()),(r instanceof wh||r instanceof bh||r instanceof Hx||r instanceof gg||r instanceof X_)&&i.transform.push(...r.assemble()),r instanceof gl&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof gl?r.setSource(i.name):(i.name||(i.name=`data_${e++}`),r.setSource(i.name),r.numChildren()===1&&(t.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof gl&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${e++}`);let o=i.name;!i.source||i.transform.length>0?t.push(i):o=i.source;for(const s of r.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function Nqt(t){const e=[],n=hUe(e);for(const r of t.children)n(r,{source:t.name,name:null,transform:[]});return e}function zqt(t,e){const n=[],r=hUe(n);let i=0;for(const s of t.sources){s.hasName()||(s.dataName=`source_${i++}`);const a=s.assemble();r(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=t.outputNodes[a.from].getSource());for(const s of n)s.name in e&&(s.values=e[s.name]);return n}function jqt(t){return t==="top"||t==="left"||Rt(t)?"header":"footer"}function Bqt(t){for(const e of su)Uqt(t,e);T0e(t,"x"),T0e(t,"y")}function Uqt(t,e){var s;const{facet:n,config:r,child:i,component:o}=t;if(t.channelHasField(e)){const a=n[e],l=gC("title",null,r,e);let c=H_(a,r,{allowDisabling:!0,includeDefault:l===void 0||!!l});i.component.layoutHeaders[e].title&&(c=We(c)?c.join(", "):c,c+=` / ${i.component.layoutHeaders[e].title}`,i.component.layoutHeaders[e].title=null);const u=gC("labelOrient",a.header,r,e),f=a.header!==null?qi((s=a.header)==null?void 0:s.labels,r.header.labels,!0):!1,d=En(["bottom","right"],u)?"footer":"header";o.layoutHeaders[e]={title:a.header!==null?c:null,facetFieldDef:a,[d]:e==="facet"?[]:[pUe(t,e,f)]}}}function pUe(t,e,n){const r=e==="row"?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function T0e(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:r,resolve:i}=t.component;if(i.axis[e]=Mae(i,e),i.axis[e]==="shared"){const o=e==="x"?"column":"row",s=r[o];for(const a of n.component.axes[e]){const l=jqt(a.get("orient"));s[l]??(s[l]=[pUe(t,o,!1)]);const c=_T(a,"main",t.config,{header:!0});c&&s[l][0].axes.push(c),a.mainExtracted=!0}}}}function Wqt(t){zae(t),V5(t,"width"),V5(t,"height")}function Vqt(t){zae(t);const e=t.layout.columns===1?"width":"childWidth",n=t.layout.columns===void 0?"height":"childHeight";V5(t,e),V5(t,n)}function zae(t){for(const e of t.children)e.parseLayoutSize()}function V5(t,e){const n=j6e(e),r=y6(n),i=t.component.resolve,o=t.component.layoutSize;let s;for(const a of t.children){const l=a.component.layoutSize.getWithExplicit(n),c=i.scale[r]??U6e(r,t);if(c==="independent"&&l.value==="step"){s=void 0;break}if(s){if(c==="independent"&&s.value!==l.value){s=void 0;break}s=my(s,l,n,"")}else s=l}if(s){for(const a of t.children)t.renameSignal(a.getName(n),t.getName(e)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,s)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function Gqt(t){const{size:e,component:n}=t;for(const r of tm){const i=El(r);if(e[i]){const o=e[i];n.layoutSize.set(i,$h(o)?"step":o,!0)}else{const o=Hqt(t,i);n.layoutSize.set(i,o,!1)}}}function Hqt(t,e){const n=e==="width"?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){const o=i.get("type"),s=i.get("range");if(Go(o)){const a=j5(r.view,e);return w1(s)||$h(a)?"step":a}else return qY(r.view,e)}else{if(t.hasProjection||t.mark==="arc")return qY(r.view,e);{const o=j5(r.view,e);return $h(o)?o.step:o}}}function cQ(t,e,n){return ct(e,{suffix:`by_${ct(t)}`,...n})}class yk extends dUe{constructor(e,n,r,i){super(e,"facet",n,r,i,e.resolve),this.child=Vae(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!BR(e))return{facet:this.initFacetFieldDef(e,"facet")};const n=Qe(e),r={};for(const i of n){if(![fg,dg].includes(i)){Ze(w6(i,"facet"));break}const o=e[i];if(o.field===void 0){Ze(UY(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(e,n){const r=cae(e,n);return r.header?r.header=os(r.header):r.header===null&&(r.header=null),r}channelHasField(e){return Ke(this.facet,e)}fieldDef(e){return this.facet[e]}parseData(){this.component.data=eU(this),this.child.parseData()}parseLayoutSize(){zae(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Bqt(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const n of su)for(const r of Aae){const i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:s}=i;if(s){const a=gC("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const l=U6(n,a);e.titleAnchor??(e.titleAnchor={}),e.titleAnchor[l]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(e[l]??(e[l]={}),e[l][n]=.5),i.title&&(e.offset??(e.offset={}),e.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:n}=this.facet,r=e?this.columnDistinctSignal():n?1:void 0;let i="all";return(!n&&this.component.resolve.scale.x==="independent"||!e&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof yk))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof yk?{...this.channelHasField("column")?{encode:{update:{columns:{field:ct(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],n=[],r=[];if(this.child instanceof yk){if(this.child.channelHasField("column")){const i=ct(this.child.facet.column);e.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(const i of tm){const o=this.child.component.scales[i];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(Go(s)&&w1(a)){const l=V6(this.child,i),c=$ae(l);c?(e.push(c),n.push("distinct"),r.push(`distinct_${c}`)):Ze(Nse(i))}}}return{fields:e,ops:n,as:r}}assembleFacet(){const{name:e,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const u of su){const f=this.facet[u];if(f){l.push(ct(f));const{bin:d,sort:h}=f;if(qr(d)&&l.push(ct(f,{binSuffix:"end"})),hg(h)){const{field:p,op:g=k6}=h,m=cQ(f,h);r&&i?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(We(h)){const p=pC(f,u);o.push(p),s.push("max"),a.push(p)}}}const c=!!r&&!!i;return{name:e,data:n,groupby:l,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(e){const{facet:n}=this,r=n[e];return r?hg(r.sort)?[cQ(r,r.sort,{expr:"datum"})]:We(r.sort)?[pC(r,e,{expr:"datum"})]:[ct(r,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:n}=this,r=n[e];if(r){const{sort:i}=r;return[(hg(i)?i.order:!We(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){var i;const{facet:e,config:n}=this;if(e.facet)return nQ(e.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const o of kae)if(e[o]){const s=gC("labelOrient",(i=e[o])==null?void 0:i.header,n,o);if(r[o].includes(s))return nQ(e[o],o,n)}}assembleMarks(){const{child:e}=this,n=this.component.data.facetRoot,r=Nqt(n),i=e.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||e.assembleTitle(),s=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:su.map(l=>this.facetSortFields(l)).flat(),order:su.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...e.assembleGroup(iGt(this,[]))}]}getMapping(){return this.facet}}function qqt(t,e){const{row:n,column:r}=e;if(n&&r){let i=null;for(const o of[n,r])if(hg(o.sort)){const{field:s,op:a=k6}=o.sort;t=i=new E1(t,{joinaggregate:[{op:a,field:s,as:cQ(o,o.sort,{forAs:!0})}],groupby:[ct(o)]})}return i}return null}function gUe(t,e){var n,r,i,o;for(const s of e){const a=s.data;if(t.name&&s.hasName()&&t.name!==s.dataName)continue;const l=(n=t.format)==null?void 0:n.mesh,c=(r=a.format)==null?void 0:r.feature;if(l&&c)continue;const u=(i=t.format)==null?void 0:i.feature;if((u||c)&&u!==c)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((l||f)&&l!==f)){if(YA(t)&&YA(a)){if(sc(t.values,a.values))return s}else if(fC(t)&&fC(a)){if(t.url===a.url)return s}else if(i6e(t)&&t.name===s.dataName)return s}}return null}function Xqt(t,e){if(t.data||!t.parent){if(t.data===null){const r=new Db({values:[]});return e.push(r),r}const n=gUe(t.data,e);if(n)return Wv(t.data)||(n.data.format=Jje({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const r=new Db(t.data);return e.push(r),r}}else return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}function Yqt(t,e,n){let r=0;for(const i of e.transforms){let o,s;if(F7t(i))s=t=new hC(t,i),o="derived";else if(wae(i)){const a=zHt(i);s=t=Qs.makeWithAncestors(t,{},a,n)??t,t=new zO(t,e,i.filter)}else if(JBe(i))s=t=wh.makeFromTransform(t,i,e),o="number";else if(z7t(i))o="date",n.getWithExplicit(i.field).value===void 0&&(t=new Qs(t,{[i.field]:o}),n.set(i.field,o,!1)),s=t=bh.makeFromTransform(t,i);else if(j7t(i))s=t=Lf.makeFromTransform(t,i),o="number",Tae(e)&&(t=new yy(t));else if(ZBe(i))s=t=KA.make(t,e,i,r++),o="derived";else if(I7t(i))s=t=new BO(t,i),o="number";else if(L7t(i))s=t=new E1(t,i),o="number";else if(B7t(i))s=t=gg.makeFromTransform(t,i),o="derived";else if(U7t(i))s=t=new X6(t,i),o="derived";else if(W7t(i))s=t=new H6(t,i),o="derived";else if($7t(i))s=t=new q6(t,i),o="derived";else if(k7t(i))s=t=new Z6(t,i),o="derived";else if(D7t(i))t=new J6(t,i);else if(N7t(i))s=t=Hx.makeFromTransform(t,i),o="derived";else if(A7t(i))s=t=new G6(t,i),o="derived";else if(P7t(i))s=t=new Q6(t,i),o="derived";else if(M7t(i))s=t=new K6(t,i),o="derived";else if(R7t(i))s=t=new Y6(t,i),o="derived";else{Ze(aWt(i));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return t}function eU(t){var m;let e=Xqt(t,t.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=t.component.data,i=t.data,s=!(i&&(Wv(i)||fC(i)||YA(i)))&&t.parent?t.parent.component.data.ancestorParse.clone():new tGt;Wv(i)?(o6e(i)?e=new XR(e,i.sequence):_ae(i)&&(e=new qR(e,i.graticule)),s.parseNothing=!0):((m=i==null?void 0:i.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),e=Qs.makeExplicit(e,t,s)??e,e=new yy(e);const a=t.parent&&UO(t.parent);(_i(t)||gc(t))&&a&&(e=wh.makeFromEncoding(e,t)??e),t.transforms.length>0&&(e=Yqt(e,t,s));const l=BHt(t),c=jHt(t);e=Qs.makeWithAncestors(e,{},{...l,...c},s)??e,_i(t)&&(e=X_.parseAll(e,t),e=QA.parseAll(e,t)),(_i(t)||gc(t))&&(a||(e=wh.makeFromEncoding(e,t)??e),e=bh.makeFromEncoding(e,t)??e,e=hC.parseAllForSortIndex(e,t));const u=e=sL($i.Raw,t,e);if(_i(t)){const v=Lf.makeFromEncoding(e,t);v&&(e=v,Tae(t)&&(e=new yy(e))),e=Hx.makeFromEncoding(e,t)??e,e=gg.makeFromEncoding(e,t)??e}let f,d;if(_i(t)){const{markDef:v,mark:y,config:x}=t,b=Er("invalid",v,x),{marks:w,scales:_}=d=a6e({invalid:b,isPath:r0(y)});w!==_&&_==="include-invalid-values"&&(f=e=sL($i.PreFilterInvalid,t,e)),w==="exclude-invalid-values"&&(e=mC.make(e,t,d)??e)}const h=e=sL($i.Main,t,e);let p;if(_i(t)&&d){const{marks:v,scales:y}=d;v==="include-invalid-values"&&y==="exclude-invalid-values"&&(e=mC.make(e,t,d)??e,p=e=sL($i.PostFilterInvalid,t,e))}_i(t)&&$Gt(t,h);let g=null;if(gc(t)){const v=t.getName("facet");e=qqt(e,t.facet)??e,g=new jO(e,t,v,h.getSource()),n[v]=g}return{...t.component.data,outputNodes:n,outputNodeRefCounts:r,raw:u,main:h,facetRoot:g,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:p}}function sL(t,e,n){const{outputNodes:r,outputNodeRefCounts:i}=e.component.data,o=e.getDataName(t),s=new gl(n,o,t,i);return r[o]=s,s}class Qqt extends Nae{constructor(e,n,r,i){var o,s,a,l;super(e,"concat",n,r,i,e.resolve),(((s=(o=e.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((l=(a=e.resolve)==null?void 0:a.axis)==null?void 0:l.y)==="shared")&&Ze(iWt),this.children=this.getChildren(e).map((c,u)=>Vae(c,this,this.getName(`concat_${u}`),void 0,i))}parseData(){this.component.data=eU(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const n of Qe(e.component.selection))this.component.selection[n]=e.component.selection[n]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return L6(e)?e.vconcat:xae(e)?e.hconcat:e.concat}parseLayoutSize(){Vqt(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){const e=Pae(this);for(const n of this.children)e.push(...n.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((n,r)=>r.assembleSelectionData(n),e)}assembleMarks(){return this.children.map(e=>{const n=e.assembleTitle(),r=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...e.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...e!=null?{columns:e}:{},bounds:"full",align:"each"}}}function Kqt(t){return t===!1||t===null}const Zqt={disable:1,gridScale:1,scale:1,..._Be,labelExpr:1,encode:1},mUe=Qe(Zqt);class jae extends rm{constructor(e={},n={},r=!1){super(),this.explicit=e,this.implicit=n,this.mainExtracted=r}clone(){return new jae(Kt(this.explicit),Kt(this.implicit),this.mainExtracted)}hasAxisPart(e){return e==="axis"?!0:e==="grid"||e==="title"?!!this.get(e):!Kqt(this.get(e))}hasOrientSignalRef(){return Rt(this.explicit.orient)}}function Jqt(t,e,n){const{encoding:r,config:i}=t,o=_o(r[e])??_o(r[Zh(e)]),s=t.axis(e)||{},{format:a,formatType:l}=s;if(Pb(l))return{text:Tf({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:i}),...n};if(a===void 0&&l===void 0&&i.customFormatTypes){if(lC(o)==="quantitative"){if(cC(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:Tf({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:Tf({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(lC(o)==="temporal"&&i.timeFormatType&&Je(o)&&!o.timeUnit)return{text:Tf({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function eXt(t){return tm.reduce((e,n)=>(t.component.scales[n]&&(e[n]=[aXt(n,t)]),e),{})}const tXt={bottom:"top",top:"bottom",left:"right",right:"left"};function nXt(t){const{axes:e,resolve:n}=t.component,r={top:0,bottom:0,right:0,left:0};for(const i of t.children){i.parseAxesAndHeaders();for(const o of Qe(i.component.axes))n.axis[o]=Mae(t.component.resolve,o),n.axis[o]==="shared"&&(e[o]=rXt(e[o],i.component.axes[o]),e[o]||(n.axis[o]="independent",delete e[o]))}for(const i of tm){for(const o of t.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){e[i]=(e[i]??[]).concat(o.component.axes[i]);for(const s of o.component.axes[i]){const{value:a,explicit:l}=s.getWithExplicit("orient");if(!Rt(a)){if(r[a]>0&&!l){const c=tXt[a];r[a]>r[c]&&s.set("orient",c,!1)}r[a]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&e[i]&&e[i].length>1)for(const[o,s]of(e[i]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function rXt(t,e){if(t){if(t.length!==e.length)return;const n=t.length;for(let r=0;rn.clone());return t}function iXt(t,e){for(const n of mUe){const r=my(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return E4e(i,o);case"gridScale":return{explicit:i.explicit,value:qi(i.value,o.value)}}return F6(i,o,n,"axis")});t.setWithExplicit(n,r)}return t}function oXt(t,e,n,r,i){if(e==="disable")return n!==void 0;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(Rt(n.labelAngle)?n.labelAngle:qA(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===L6e(r,i))return!0}return t===n[e]}const sXt=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function aXt(t,e){var v,y;let n=e.axis(t);const r=new jae,i=_o(e.encoding[t]),{mark:o,config:s}=e,a=(n==null?void 0:n.orient)||((v=s[t==="x"?"axisX":"axisY"])==null?void 0:v.orient)||((y=s.axis)==null?void 0:y.orient)||HGt(t),l=e.getScaleComponent(t).get("type"),c=zGt(t,l,a,e.config),u=n!==void 0?!n:eQ("disable",s.style,n==null?void 0:n.style,c).configValue;if(r.set("disable",u,n!==void 0),u)return r;n=n||{};const f=WGt(i,n,t,s.style,c),d=lBe(n.formatType,i,l),h=aBe(i,i.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:i,axis:n,channel:t,model:e,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const x of mUe){const b=x in d0e?d0e[x](p):Nye(x)?n[x]:void 0,w=b!==void 0,_=oXt(b,x,n,e,t);if(w&&_)r.set(x,b,_);else{const{configValue:S=void 0,configFrom:O=void 0}=Nye(x)&&x!=="values"?eQ(x,s.style,n.style,c):{},k=S!==void 0;w&&!k?r.set(x,b,_):(O!=="vgAxisConfig"||sXt.has(x)&&k||GR(S)||Rt(S))&&r.set(x,S,!1)}}const g=n.encoding??{},m=wBe.reduce((x,b)=>{if(!r.hasAxisPart(b))return x;const w=B6e(g[b]??{},e),_=b==="labels"?Jqt(e,t,w):w;return _!==void 0&&!Tr(_)&&(x[b]={update:_}),x},{});return Tr(m)||r.set("encode",m,!!n.encoding||n.labelAngle!==void 0),r}function lXt({encoding:t,size:e}){for(const n of tm){const r=El(n);$h(e[r])&&bv(t[n])&&(delete e[r],Ze(M4e(r)))}return e}const cXt={vgMark:"arc",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...jg(t,"radius"),...jg(t,"theta")})},uXt={vgMark:"area",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...B5("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="horizontal"}),...B5("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="vertical"}),...Eae(t)})},fXt={vgMark:"rect",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...jg(t,"x"),...jg(t,"y")})},dXt={vgMark:"shape",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[{type:"geoshape",projection:t.projectionName(),...n&&Je(n)&&n.type===FO?{field:ct(n,{expr:"datum"})}:{}}]}},hXt={vgMark:"image",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...jg(t,"x"),...jg(t,"y"),...Cae(t,"url")})},pXt={vgMark:"line",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...us("size",t,{vgChannel:"strokeWidth"}),...Eae(t)})},gXt={vgMark:"trail",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...us("size",t),...Eae(t)})};function Bae(t,e){const{config:n}=t;return{...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...us("size",t),...us("angle",t),...mXt(t,n,e)}}function mXt(t,e,n){return n?{shape:{value:n}}:us("shape",t)}const vXt={vgMark:"symbol",encodeEntry:t=>Bae(t)},yXt={vgMark:"symbol",encodeEntry:t=>Bae(t,"circle")},xXt={vgMark:"symbol",encodeEntry:t=>Bae(t,"square")},bXt={vgMark:"rect",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...jg(t,"x"),...jg(t,"y")})},wXt={vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return!t.encoding.x&&!t.encoding.y&&!t.encoding.latitude&&!t.encoding.longitude?{}:{...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...B5("x",t,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...B5("y",t,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...us("size",t,{vgChannel:"strokeWidth"})}}},_Xt={vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return{...ju(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...Cae(t),...us("size",t,{vgChannel:"fontSize"}),...us("angle",t),...l0e("align",SXt(t.markDef,n,e)),...l0e("baseline",CXt(t.markDef,n,e)),...Ca("radius",t,{defaultPos:null}),...Ca("theta",t,{defaultPos:null})}}};function SXt(t,e,n){if(Er("align",t,n)===void 0)return"center"}function CXt(t,e,n){if(Er("baseline",t,n)===void 0)return"middle"}const OXt={vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,r=n.orient,i=r==="horizontal"?"x":"y",o=r==="horizontal"?"y":"x",s=r==="horizontal"?"height":"width";return{...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...jg(t,i),...Ca(o,t,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:ni(Er("thickness",n,e))}}},aL={arc:cXt,area:uXt,bar:fXt,circle:yXt,geoshape:dXt,image:hXt,line:pXt,point:vXt,rect:bXt,rule:wXt,square:xXt,text:_Xt,tick:OXt,trail:gXt};function EXt(t){if(En([E6,C6,IVt],t.mark)){const e=kBe(t.mark,t.encoding);if(e.length>0)return TXt(t,e)}else if(t.mark===O6){const e=jY.some(n=>Er(n,t.markDef,t.config));if(t.stack&&!t.fieldDef("size")&&e)return kXt(t)}return Uae(t)}const k0e="faceted_path_";function TXt(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:k0e+t.requestDataName($i.Main),data:t.requestDataName($i.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Uae(t,{fromPrefix:k0e})}]}const A0e="stack_group_";function kXt(t){var c;const[e]=Uae(t,{fromPrefix:A0e}),n=t.scaleName(t.stack.fieldChannel),r=(u={})=>t.vgField(t.stack.fieldChannel,u),i=(u,f)=>{const d=[r({prefix:"min",suffix:"start",expr:f}),r({prefix:"max",suffix:"start",expr:f}),r({prefix:"min",suffix:"end",expr:f}),r({prefix:"max",suffix:"end",expr:f})];return`${u}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;t.stack.fieldChannel==="x"?(o={...tC(e.encode.update,["y","yc","y2","height",...jY]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},e.encode.update={...pl(e.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...tC(e.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},e.encode.update={...pl(e.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const u of jY){const f=Ih(u,t.markDef,t.config);e.encode.update[u]?(o[u]=e.encode.update[u],delete e.encode.update[u]):f&&(o[u]=ni(f)),f&&(e.encode.update[u]={value:0})}const a=[];if(((c=t.stack.groupbyChannels)==null?void 0:c.length)>0)for(const u of t.stack.groupbyChannels){const f=t.fieldDef(u),d=ct(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(ct(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((u,f)=>{if(e.encode.update[f])return{...u,[f]:e.encode.update[f]};{const d=Ih(f,t.markDef,t.config);return d!==void 0?{...u,[f]:ni(d)}:u}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:t.requestDataName($i.Main),name:A0e+t.requestDataName($i.Main),groupby:a,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[e]}]}]}function AXt(t){const{encoding:e,stack:n,mark:r,markDef:i,config:o}=t,s=e.order;if(!(!We(s)&&qf(s)&&NY(s.value)||!s&&NY(Er("order",i,o)))){if((We(s)||Je(s))&&!n)return S4e(s,{expr:"datum"});if(r0(r)){const a=i.orient==="horizontal"?"y":"x",l=e[a];if(Je(l))return{field:a}}}}function Uae(t,e={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=t,s=qi(r.clip,PXt(t),MXt(t)),a=w4e(r),l=i.key,c=AXt(t),u=RXt(t),f=Er("aria",r,o),d=aL[n].postEncodingTransform?aL[n].postEncodingTransform(t):null;return[{name:t.getName("marks"),type:aL[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...l?{key:l.field}:{},...c?{sort:c}:{},...u||{},...f===!1?{aria:f}:{},from:{data:e.fromPrefix+t.requestDataName($i.Main)},encode:{update:aL[n].encodeEntry(t)},...d?{transform:d}:{}}]}function PXt(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return e!=null&&e.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function MXt(t){const e=t.component.projection;return e&&!e.isFit?!0:void 0}function RXt(t){if(!t.component.selection)return null;const e=Qe(t.component.selection).length;let n=e,r=t.parent;for(;r&&n===0;)n=Qe(r.component.selection).length,r=r.parent;return n?{interactive:e>0||t.mark==="geoshape"||!!t.encoding.tooltip||!!t.markDef.tooltip}:null}class vUe extends dUe{constructor(e,n,r,i={},o){super(e,"unit",n,r,o,void 0,jye(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=Lh(e.mark)?{...e.mark}:{type:e.mark},a=s.type;s.filled===void 0&&(s.filled=v7t(s,o,{graticule:e.data&&_ae(e.data)}));const l=this.encoding=w9t(e.encoding||{},a,s.filled,o);this.markDef=YBe(s,l,o),this.size=lXt({encoding:l,size:jye(e)?{...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:i}),this.stack=XBe(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter(c=>vae(c))}get hasProjection(){const{encoding:e}=this,n=this.mark===eBe,r=e&&v8t.some(i=>en(e[i]));return n||r}scaleDomain(e){const n=this.specifiedScales[e];return n?n.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,n){return Lse.reduce((r,i)=>{const o=_o(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(e){const{domain:n,range:r}=e,i=os(e);return We(n)&&(i.domain=n.map(tc)),We(r)&&(i.range=r.map(tc)),i}initAxes(e){return tm.reduce((n,r)=>{const i=e[r];if(en(i)||r===xi&&en(e.x2)||r===Qo&&en(e.y2)){const o=en(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(e){const n=Qe(e),r={};for(const i of n){const o=e[i];r[i]=GR(o)?b4e(o):tc(o)}return r}initLegends(e){return T8t.reduce((n,r)=>{const i=_o(e[r]);if(i&&A8t(r)){const o=i.legend;n[r]=o&&os(o)}return n},{})}parseData(){this.component.data=eU(this)}parseLayoutSize(){Gqt(this)}parseSelections(){this.component.selection=LGt(this,this.selection)}parseMarkGroup(){this.component.mark=EXt(this)}parseAxesAndHeaders(){this.component.axes=eXt(this)}assembleSelectionTopLevelSignals(e){return oGt(this,e)}assembleSignals(){return[...R6e(this),...rGt(this,[])]}assembleSelectionData(e){return sGt(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return Pae(this)}assembleMarks(){let e=this.component.mark??[];return(!this.parent||!UO(this.parent))&&(e=c6e(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return e!==void 0?e:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return Vx(this.encoding,e)}fieldDef(e){const n=this.encoding[e];return Xf(n)}typedFieldDef(e){const n=this.fieldDef(e);return Ra(n)?n:null}}class Wae extends Nae{constructor(e,n,r,i,o){super(e,"layer",n,r,o,e.resolve,e.view);const s={...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map((a,l)=>{if($6(a))return new Wae(a,this,this.getName(`layer_${l}`),s,o);if(nm(a))return new vUe(a,this,this.getName(`layer_${l}`),s,o);throw new Error(Fse(a))})}parseData(){this.component.data=eU(this);for(const e of this.children)e.parseData()}parseLayoutSize(){Wqt(this)}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const n of Qe(e.component.selection))this.component.selection[n]=e.component.selection[n]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){nXt(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),e)}assembleSignals(){return this.children.reduce((e,n)=>e.concat(n.assembleSignals()),R6e(this))}assembleLayoutSignals(){return this.children.reduce((e,n)=>e.concat(n.assembleLayoutSignals()),Pae(this))}assembleSelectionData(e){return this.children.reduce((n,r)=>r.assembleSelectionData(n),e)}assembleGroupStyle(){const e=new Set;for(const r of this.children)for(const i of pt(r.assembleGroupStyle()))e.add(i);const n=Array.from(e);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const n of this.children)if(e=n.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return aGt(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,n)=>e.concat(n.assembleLegends()),Y6e(this))}}function Vae(t,e,n,r,i){if(A6(t))return new yk(t,e,n,i);if($6(t))return new Wae(t,e,n,r,i);if(nm(t))return new vUe(t,e,n,r,i);if(G9t(t))return new Qqt(t,e,n,i);throw new Error(Fse(t))}function DXt(t,e={}){e.logger&&XWt(e.logger),e.fieldTitle&&yBe(e.fieldTitle);try{const n=qBe(xO(e.config,t.config)),r=n6e(t,n),i=Vae(r,null,"",void 0,n);return i.parse(),rqt(i.component.data,i),{spec:LXt(i,IXt(t,r.autosize,n,i),t.datasets,t.usermeta),normalized:r}}finally{e.logger&&YWt(),e.fieldTitle&&d9t()}}function IXt(t,e,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(e===void 0?(e={type:"pad"},r.hasAxisOrientSignalRef()&&(e.resize=!0)):gt(e)&&(e={type:e}),i&&o&&Z7t(e.type)){if(i==="step"&&o==="step")Ze(Cye()),e.type="pad";else if(i==="step"||o==="step"){const s=i==="step"?"width":"height";Ze(Cye(y6(s)));const a=s==="width"?"height":"width";e.type=J7t(a)}}return{...Qe(e).length===1&&e.type?e.type==="pad"?{}:{autosize:e.type}:{autosize:e},...Zye(n,!1),...Zye(t,!0)}}function LXt(t,e,n={},r){const i=t.config?o7t(t.config):void 0,o=[].concat(t.assembleSelectionData([]),zqt(t.component.data,n)),s=t.assembleProjections(),a=t.assembleTitle(),l=t.assembleGroupStyle(),c=t.assembleGroupEncodeEntry(!0);let u=t.assembleLayoutSignals();u=u.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(e[h.name]=+h.value,!1):!0);const{params:f,...d}=e;return{$schema:"https://vega.github.io/schema/vega/v5.json",...t.description?{description:t.description}:{},...d,...a?{title:a}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...s.length>0?{projections:s}:{},...t.assembleGroup([...u,...t.assembleSelectionTopLevelSignals([]),...WBe(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}const $Xt=f8t.version,FXt=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:rC,accessPathWithDatum:Tse,compile:DXt,contains:En,deepEqual:sc,deleteNestedProperty:M5,duplicate:Kt,entries:hy,every:Cse,fieldIntersection:Ese,flatAccessWithDatum:t4e,getFirstDefined:qi,hasIntersection:Ose,hasProperty:Ke,hash:Mn,internalField:i4e,isBoolean:HA,isEmpty:Tr,isEqual:h8t,isInternalField:o4e,isNullOrFalse:NY,isNumeric:d6,keys:Qe,logicalExpr:mk,mergeDeep:Jje,never:Zje,normalize:n6e,normalizeAngle:qA,omit:pl,pick:tC,prefixGenerator:zY,removePathFromField:LO,replaceAll:Ob,replacePathInField:Pu,resetIdCounter:g8t,setEqual:e4e,some:nC,stringify:kr,titleCase:IR,unique:Jd,uniqueId:r4e,vals:ws,varName:gi,version:$Xt},Symbol.toStringTag,{value:"Module"}));function yUe(t){const[e,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}}var NXt="vega-themes",zXt="2.15.0",jXt="Themes for stylized Vega and Vega-Lite visualizations.",BXt=["vega","vega-lite","themes","style"],UXt="BSD-3-Clause",WXt={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},VXt=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],GXt="build/vega-themes.js",HXt="build/vega-themes.module.js",qXt="build/vega-themes.min.js",XXt="build/vega-themes.min.js",YXt="build/vega-themes.module.d.ts",QXt={type:"git",url:"https://github.com/vega/vega-themes.git"},KXt=["src","build"],ZXt={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},JXt={"@babel/core":"^7.24.6","@babel/plugin-transform-runtime":"^7.24.6","@babel/preset-env":"^7.24.6","@babel/preset-typescript":"^7.24.6","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","browser-sync":"^3.0.2",concurrently:"^8.2.2",eslint:"^8.45.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","gh-pages":"^6.1.1",prettier:"^3.2.5","release-it":"^17.3.0",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",typescript:"^5.4.5",vega:"^5.25.0","vega-lite":"^5.9.3"},eYt={vega:"*","vega-lite":"*"},tYt={},nYt={name:NXt,version:zXt,description:jXt,keywords:BXt,license:UXt,author:WXt,contributors:VXt,main:GXt,module:HXt,unpkg:qXt,jsdelivr:XXt,types:YXt,repository:QXt,files:KXt,scripts:ZXt,devDependencies:JXt,peerDependencies:eYt,dependencies:tYt};const lw="#fff",P0e="#888",rYt={background:"#333",view:{stroke:P0e},title:{color:lw,subtitleColor:lw},style:{"guide-label":{fill:lw},"guide-title":{fill:lw}},axis:{domainColor:lw,gridColor:P0e,tickColor:lw}},w0="#4572a7",iYt={background:"#fff",arc:{fill:w0},area:{fill:w0},line:{stroke:w0,strokeWidth:2},path:{stroke:w0},rect:{fill:w0},shape:{stroke:w0},symbol:{fill:w0,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},_0="#30a2da",n9="#cbcbcb",oYt="#999",sYt="#333",M0e="#f0f0f0",R0e="#333",aYt={arc:{fill:_0},area:{fill:_0},axis:{domainColor:n9,grid:!0,gridColor:n9,gridWidth:1,labelColor:oYt,labelFontSize:10,titleColor:sYt,tickColor:n9,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:M0e,group:{fill:M0e},legend:{labelColor:R0e,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:R0e,titleFontSize:14,titlePadding:10},line:{stroke:_0,strokeWidth:2},path:{stroke:_0,strokeWidth:.5},rect:{fill:_0},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:_0},bar:{binSpacing:2,fill:_0,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},S0="#000",lYt={group:{fill:"#e5e5e5"},arc:{fill:S0},area:{fill:S0},line:{stroke:S0},path:{stroke:S0},rect:{fill:S0},shape:{stroke:S0},symbol:{fill:S0,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},cYt=22,uYt="normal",D0e="Benton Gothic, sans-serif",I0e=11.5,fYt="normal",C0="#82c6df",r9="Benton Gothic Bold, sans-serif",L0e="normal",$0e=13,d2={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},dYt={background:"#ffffff",title:{anchor:"start",color:"#000000",font:r9,fontSize:cYt,fontWeight:uYt},arc:{fill:C0},area:{fill:C0},line:{stroke:C0,strokeWidth:2},path:{stroke:C0},rect:{fill:C0},shape:{stroke:C0},symbol:{fill:C0,size:30},axis:{labelFont:D0e,labelFontSize:I0e,labelFontWeight:fYt,titleFont:r9,titleFontSize:$0e,titleFontWeight:L0e},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:D0e,labelFontSize:I0e,symbolType:"square",titleFont:r9,titleFontSize:$0e,titleFontWeight:L0e},range:{category:d2["category-6"],diverging:d2["fireandice-6"],heatmap:d2["fire-7"],ordinal:d2["fire-7"],ramp:d2["fire-7"]}},O0="#ab5787",lL="#979797",hYt={background:"#f9f9f9",arc:{fill:O0},area:{fill:O0},line:{stroke:O0},path:{stroke:O0},rect:{fill:O0},shape:{stroke:O0},symbol:{fill:O0,size:30},axis:{domainColor:lL,domainWidth:.5,gridWidth:.2,labelColor:lL,tickColor:lL,tickWidth:.2,titleColor:lL},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},E0="#3e5c69",pYt={background:"#fff",arc:{fill:E0},area:{fill:E0},line:{stroke:E0},path:{stroke:E0},rect:{fill:E0},shape:{stroke:E0},symbol:{fill:E0},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},zc="#1696d2",F0e="#000000",gYt="#FFFFFF",cL="Lato",i9="Lato",mYt="Lato",vYt="#DEDDDD",yYt=18,h2={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},xYt={background:gYt,title:{anchor:"start",fontSize:yYt,font:cL},axisX:{domain:!0,domainColor:F0e,domainWidth:1,grid:!1,labelFontSize:12,labelFont:i9,labelAngle:0,tickColor:F0e,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:cL},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:vYt,gridWidth:1,labelFontSize:12,labelFont:i9,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:cL,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:i9,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:cL,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:h2["six-groups-cat-1"],diverging:h2["diverging-colors"],heatmap:h2["diverging-colors"],ordinal:h2["six-groups-seq"],ramp:h2["shades-blue"]},area:{fill:zc},rect:{fill:zc},line:{color:zc,stroke:zc,strokeWidth:5},trail:{color:zc,stroke:zc,strokeWidth:0,size:1},path:{stroke:zc,strokeWidth:.5},point:{filled:!0},text:{font:mYt,color:zc,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:zc,stroke:null}},arc:{fill:zc},shape:{stroke:zc},symbol:{fill:zc,size:30}},T0="#3366CC",N0e="#ccc",uL="Arial, sans-serif",bYt={arc:{fill:T0},area:{fill:T0},path:{stroke:T0},rect:{fill:T0},shape:{stroke:T0},symbol:{stroke:T0},circle:{fill:T0},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:uL,fontSize:12},"guide-title":{font:uL,fontSize:12},"group-title":{font:uL,fontSize:12}},title:{font:uL,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:N0e,tickColor:N0e,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Gae=t=>t*(1/3+1),z0e=Gae(9),j0e=Gae(10),B0e=Gae(12),p2="Segoe UI",U0e="wf_standard-font, helvetica, arial, sans-serif",W0e="#252423",g2="#605E5C",V0e="transparent",wYt="#C8C6C4",rf="#118DFF",_Yt="#12239E",SYt="#E66C37",CYt="#6B007B",OYt="#E044A7",EYt="#744EC2",TYt="#D9B300",kYt="#D64550",xUe=rf,bUe="#DEEFFF",G0e=[bUe,xUe],AYt=[bUe,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",xUe],PYt={view:{stroke:V0e},background:V0e,font:p2,header:{titleFont:U0e,titleFontSize:B0e,titleColor:W0e,labelFont:p2,labelFontSize:j0e,labelColor:g2},axis:{ticks:!1,grid:!1,domain:!1,labelColor:g2,labelFontSize:z0e,titleFont:U0e,titleColor:W0e,titleFontSize:B0e,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:wYt,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:rf},line:{stroke:rf,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:p2,fontSize:z0e,fill:g2},arc:{fill:rf},area:{fill:rf,line:!0,opacity:.6},path:{stroke:rf},rect:{fill:rf},point:{fill:rf,filled:!0,size:75},shape:{stroke:rf},symbol:{fill:rf,strokeWidth:1.5,size:50},legend:{titleFont:p2,titleFontWeight:"bold",titleColor:g2,labelFont:p2,labelFontSize:j0e,labelColor:g2,symbolType:"circle",symbolSize:75},range:{category:[rf,_Yt,SYt,CYt,OYt,EYt,TYt,kYt],diverging:G0e,heatmap:G0e,ordinal:AYt}},o9='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',MYt='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',s9=400,fL={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},RYt=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],DYt=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function tU({theme:t,background:e}){const n=["white","g10"].includes(t)?"light":"dark",r=fL.gridBg[t],i=fL.textPrimary[t],o=fL.textSecondary[t],s=n==="dark"?RYt:DYt,a=n==="dark"?"#d4bbff":"#6929c4";return{background:e,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:o9,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:MYt,labelFontWeight:s9,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:fL.layerAccent01[t],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:o9,fill:o,fontWeight:s9},"guide-title":{font:o9,fill:o,fontWeight:s9}},range:{category:s,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const IYt=tU({theme:"white",background:"#ffffff"}),LYt=tU({theme:"g10",background:"#f4f4f4"}),$Yt=tU({theme:"g90",background:"#262626"}),FYt=tU({theme:"g100",background:"#161616"}),NYt=nYt.version,wUe=Object.freeze(Object.defineProperty({__proto__:null,carbong10:LYt,carbong100:FYt,carbong90:$Yt,carbonwhite:IYt,dark:rYt,excel:iYt,fivethirtyeight:aYt,ggplot2:lYt,googlecharts:bYt,latimes:dYt,powerbi:PYt,quartz:hYt,urbaninstitute:xYt,version:NYt,vox:pYt},Symbol.toStringTag,{value:"Module"}));function zYt(t,e,n,r){if(We(t))return`[${t.map(i=>e(gt(i)?i:H0e(i,n))).join(", ")}]`;if(ht(t)){let i="";const{title:o,image:s,...a}=t;o&&(i+=`

${e(o)}

`),s&&(i+=``);const l=Object.keys(a);if(l.length>0){i+="";for(const c of l){let u=a[c];u!==void 0&&(ht(u)&&(u=H0e(u,n)),i+=``)}i+="
${e(c)}${e(u)}
"}return i||"{}"}return e(t)}function jYt(t){const e=[];return function(n,r){if(typeof r!="object"||r===null)return r;const i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}function H0e(t,e){return JSON.stringify(t,jYt(e))}var BYt=`#vg-tooltip-element { + : v !== v && u === u ? ${r} : `}var ujt={operator:(t,e)=>i2(t,["_"],e.code),parameter:(t,e)=>i2(t,["datum","_"],e.code),event:(t,e)=>i2(t,["event"],e.code),handler:(t,e)=>{const n=`var datum=event.item&&event.item.datum;return ${e.code};`;return i2(t,["_","event"],n)},encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const s="o["+rt(o)+"]";i+=`$=${r[o].code};if(${s}!==$)${s}=$,m=1;`}return i+=sjt(r,n),i+="return m;",i2(t,["item","_"],i)},codegen:{get(t){const e=`[${t.map(rt).join("][")}]`,n=Function("_",`return _${e};`);return n.path=e,n},comparator(t,e){let n;const r=(o,s)=>{const a=e[s];let l,c;return o.path?(l=`a${o.path}`,c=`b${o.path}`):((n=n||{})["f"+s]=o,l=`this.f${s}(a)`,c=`this.f${s}(b)`),cjt(l,c,-a,a)},i=Function("a","b","var u, v; return "+t.map(r).join("")+"0;");return n?i.bind(n):i}}};function fjt(t){const e=this;ajt(t.type)||!t.type?e.operator(t,t.update?e.operatorExpression(t.update):null):e.transform(t,t.type)}function djt(t){const e=this;if(t.params){const n=e.get(t.id);n||je("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}}function hjt(t,e){e=e||{};const n=this;for(const r in t){const i=t[r];e[r]=We(i)?i.map(o=>Uve(o,n,e)):Uve(i,n,e)}return e}function Uve(t,e,n){if(!t||!ht(t))return t;for(let r=0,i=Wve.length,o;ri&&i.$tupleid?jt:i);return e.fn[n]||(e.fn[n]=Tne(r,t.$order,e.expr.codegen))}function xjt(t,e){const n=t.$encode,r={};for(const i in n){const o=n[i];r[i]=Al(e.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}function bjt(t,e){return e}function wjt(t,e){const n=t.$subflow;return function(r,i,o){const s=e.fork().parse(n),a=s.get(n.operators[0].id),l=s.signals.parent;return l&&l.set(o),a.detachSubflow=()=>e.detach(s),a}}function _jt(){return jt}function Sjt(t){var e=this,n=t.filter!=null?e.eventExpression(t.filter):void 0,r=t.stream!=null?e.get(t.stream):void 0,i;t.source?r=e.events(t.source,t.type,n):t.merge&&(i=t.merge.map(o=>e.get(o)),r=i[0].merge.apply(i[0],i.slice(1))),t.between&&(i=t.between.map(o=>e.get(o)),r=r.between(i[0],i[1])),t.filter&&(r=r.filter(n)),t.throttle!=null&&(r=r.throttle(+t.throttle)),t.debounce!=null&&(r=r.debounce(+t.debounce)),r==null&&je("Invalid stream definition: "+JSON.stringify(t)),t.consume&&r.consume(!0),e.stream(t,r)}function Cjt(t){var e=this,n=ht(n=t.source)?n.$ref:n,r=e.get(n),i=null,o=t.update,s=void 0;r||je("Source not defined: "+t.source),i=t.target&&t.target.$expr?e.eventExpression(t.target.$expr):e.get(t.target),o&&o.$expr&&(o.$params&&(s=e.parseParameters(o.$params)),o=e.handlerExpression(o.$expr)),e.update(t,r,i,o,s)}const Ojt={skip:!0};function Ejt(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach(o=>{const s=e.signals[o];t.signals(o,s)&&(r[o]=s.value)})}if(t.data){var i=n.data={};Object.keys(e.data).forEach(o=>{const s=e.data[o];t.data(o,s)&&(i[o]=s.input.value)})}return e.subcontext&&t.recurse!==!1&&(n.subcontext=e.subcontext.map(o=>o.getState(t))),n}function Tjt(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach(o=>{n.update(e.signals[o],i[o],Ojt)}),Object.keys(r||{}).forEach(o=>{n.pulse(e.data[o].input,n.changeset().remove(Eu).insert(r[o]))}),(t.subcontext||[]).forEach((o,s)=>{const a=e.subcontext[s];a&&a.setState(o)})}function nje(t,e,n,r){return new rje(t,e,n,r)}function rje(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||ujt,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function Vve(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}rje.prototype=Vve.prototype={fork(){const t=new Vve(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter(n=>n!==t);const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),ljt(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let o=n.get(t.parent.$ref);o?(r.connect(o,[e]),e.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(t.parent.$ref),r.connect(o,[e]),e.targets().add(o)})}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const o in t.data){const s=n.data[o]||(n.data[o]={});t.data[o].forEach(a=>s[a]=e)}},resolve(){return(this.unresolved||[]).forEach(t=>t()),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[nse(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:ijt,parseOperator:fjt,parseOperatorParameters:djt,parseParameters:hjt,parseStream:Sjt,parseUpdate:Cjt,getState:Ejt,setState:Tjt};function kjt(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),ije(e,t.description()))}function ije(t,e){t&&(e==null?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}function Ajt(t){t.add(null,e=>(t._background=e.bg,t._resize=1,e.bg),{bg:t._signals.background})}const zV="default";function Pjt(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:zV,item:null}));t.on(t.events("view","pointermove"),e,(n,r)=>{const i=e.value,o=i?gt(i)?i:i.user:zV,s=r.item&&r.item.cursor||null;return i&&o===i.user&&s==i.item?i:{user:o,item:s}}),t.add(null,function(n){let r=n.cursor,i=this.value;return gt(r)||(i=r.item,r=r.user),kY(t,r&&r!==zV?r:i||r),i},{cursor:e})}function kY(t,e){const n=t.globalCursor()?typeof document<"u"&&document.body:t.container();if(n)return e==null?n.style.removeProperty("cursor"):n.style.cursor=e}function E5(t,e){var n=t._runtime.data;return vt(n,e)||je("Unrecognized data set: "+e),n[e]}function Mjt(t,e){return arguments.length<2?E5(this,t).values.value:t6.call(this,t,h1().remove(Eu).insert(e))}function t6(t,e){m$e(e)||je("Second argument to changes must be a changeset.");const n=E5(this,t);return n.modified=!0,this.pulse(n.input,e)}function Rjt(t,e){return t6.call(this,t,h1().insert(e))}function Djt(t,e){return t6.call(this,t,h1().remove(e))}function oje(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function sje(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function n6(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function Ijt(t){var e=n6(t),n=oje(t),r=sje(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach(i=>{try{i(n,r)}catch(o){t.error(o)}})}function Ljt(t,e,n){var r=t._renderer,i=r&&r.canvas(),o,s,a;return i&&(a=n6(t),s=e.changedTouches?e.changedTouches[0]:e,o=UB(s,i),o[0]-=a[0],o[1]-=a[1]),e.dataflow=t,e.item=n,e.vega=$jt(t,n,o),e}function $jt(t,e,n){const r=e?e.mark.marktype==="group"?e:e.mark.group:null;function i(s){var a=r,l;if(s){for(l=e;l;l=l.mark.group)if(l.mark.name===s){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;gt(s)&&(s=i(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:ra(t),item:ra(e||{}),group:i,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const Gve="view",Fjt="timer",Njt="window",zjt={trap:!1};function jjt(t){const e=cn({defaults:{}},t),n=(r,i)=>{i.forEach(o=>{We(r[o])&&(r[o]=Wf(r[o]))})};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}function aje(t,e,n,r){t._eventListeners.push({type:n,sources:pt(e),handler:r})}function Bjt(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[e]:i?!i[e]:t.preventDefault()}function JI(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return r===!1||ht(r)&&!r[n]?(t.warn(`Blocked ${e} ${n} event listener.`),!1):!0}function Ujt(t,e,n){var r=this,i=new lB(n),o=function(c,u){r.runAsync(null,()=>{t===Gve&&Bjt(r,e)&&c.preventDefault(),i.receive(Ljt(r,c,u))})},s;if(t===Fjt)JI(r,"timer",e)&&r.timer(o,e);else if(t===Gve)JI(r,"view",e)&&r.addEventListener(e,o,zjt);else if(t===Njt?JI(r,"window",e)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&JI(r,"selector",e)&&(s=Array.from(document.querySelectorAll(t))),!s)r.warn("Can not resolve event source: "+t);else{for(var a=0,l=s.length;a=0;)e[i].stop();for(i=r.length;--i>=0;)for(s=r[i],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(t&&t.call(this,this._handler,null,null,null),i=n.length;--i>=0;)l=n[i].type,a=n[i].handler,this._handler.off(l,a);return this}function pc(t,e,n){const r=document.createElement(t);for(const i in e)r.setAttribute(i,e[i]);return n!=null&&(r.textContent=n),r}const Gjt="vega-bind",Hjt="vega-bind-name",qjt="vega-bind-radio";function Xjt(t,e,n){if(!e)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:s=>{s!=t.signal(r.signal)&&t.runAsync(null,()=>{i.source=!0,t.signal(r.signal,s)})}},r.debounce&&(i.update=kne(r.debounce,i.update))),(r.input==null&&r.element?Yjt:Kjt)(i,e,r,t),i.active||(t.on(t._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(t.signal(r.signal))}),i.active=!0),i}function Yjt(t,e,n,r){const i=n.event||"input",o=()=>t.update(e.value);r.signal(n.signal,e.value),e.addEventListener(i,o),aje(r,e,i,o),t.set=s=>{e.value=s,e.dispatchEvent(Qjt(i))}}function Qjt(t){return typeof Event<"u"?new Event(t):{type:t}}function Kjt(t,e,n,r){const i=r.signal(n.signal),o=pc("div",{class:Gjt}),s=n.input==="radio"?o:o.appendChild(pc("label"));s.appendChild(pc("span",{class:Hjt},n.name||n.signal)),e.appendChild(o);let a=Zjt;switch(n.input){case"checkbox":a=Jjt;break;case"select":a=e4t;break;case"radio":a=t4t;break;case"range":a=n4t;break}a(t,s,n,i)}function Zjt(t,e,n,r){const i=pc("input");for(const o in n)o!=="signal"&&o!=="element"&&i.setAttribute(o==="input"?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",()=>t.update(i.value)),t.elements=[i],t.set=o=>i.value=o}function Jjt(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=pc("input",i);e.appendChild(o),o.addEventListener("change",()=>t.update(o.checked)),t.elements=[o],t.set=s=>o.checked=!!s||null}function e4t(t,e,n,r){const i=pc("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const l={value:s};T5(s,r)&&(l.selected=!0),i.appendChild(pc("option",l,(o[a]||s)+""))}),e.appendChild(i),i.addEventListener("change",()=>{t.update(n.options[i.selectedIndex])}),t.elements=[i],t.set=s=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:s};T5(s,r)&&(l.checked=!0);const c=pc("input",l);c.addEventListener("change",()=>t.update(s));const u=pc("label",{},(o[a]||s)+"");return u.prepend(c),i.appendChild(u),c}),t.set=s=>{const a=t.elements,l=a.length;for(let c=0;c{l.textContent=a.value,t.update(+a.value)};a.addEventListener("input",c),a.addEventListener("change",c),t.elements=[a],t.set=u=>{a.value=u,l.textContent=u}}function T5(t,e){return t===e||t+""==e+""}function lje(t,e,n,r,i,o){return e=e||new r(t.loader()),e.initialize(n,oje(t),sje(t),n6(t),i,o).background(t.background())}function rse(t,e){return e?function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}:null}function r4t(t,e,n,r){const i=new r(t.loader(),rse(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,n6(t),t);return e&&e.handlers().forEach(o=>{i.on(o.type,o.handler)}),i}function i4t(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,o=WB(r);t=n._el=t?jV(n,t,!0):null,kjt(n),o||n.error("Unrecognized renderer type: "+r);const s=o.handler||SR,a=t?o.renderer:o.headless;return n._renderer=a?lje(n,n._renderer,t,a):null,n._handler=r4t(n,n._handler,t,s),n._redraw=!0,t&&i!=="none"&&(e=e?n._elBind=jV(n,e,!0):t.appendChild(pc("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&i!=="container"&&(l.element=jV(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{Xjt(n,l.element||e,l)})),n}function jV(t,e,n){if(typeof e=="string")if(typeof document<"u"){if(e=document.querySelector(e),!e)return t.error("Signal bind element not found: "+e),null}else return t.error("DOM document instance not found."),null;if(e&&n)try{e.textContent=""}catch(r){e=null,t.error(r)}return e}const o2=t=>+t||0,o4t=t=>({top:t,bottom:t,left:t,right:t});function Yve(t){return ht(t)?{top:o2(t.top),bottom:o2(t.bottom),left:o2(t.left),right:o2(t.right)}:o4t(o2(t))}async function ise(t,e,n,r){const i=WB(e),o=i&&i.headless;return o||je("Unrecognized renderer type: "+e),await t.runAsync(),lje(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}async function s4t(t,e){t!==gv.Canvas&&t!==gv.SVG&&t!==gv.PNG&&je("Unrecognized image type: "+t);const n=await ise(this,t,e);return t===gv.SVG?a4t(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function a4t(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}async function l4t(t,e){return(await ise(this,gv.Canvas,t,e)).canvas()}async function c4t(t){return(await ise(this,gv.SVG,t)).svg()}function u4t(t,e,n){return nje(t,jS,BA,n).parse(e)}function f4t(t){var e=this._runtime.scales;return vt(e,t)||je("Unrecognized scale or projection: "+t),e[t].value}var cje="width",uje="height",ose="padding",Qve={skip:!0};function fje(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===ose?r.left+r.right:0)}function dje(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===ose?r.top+r.bottom:0)}function d4t(t){var e=t._signals,n=e[cje],r=e[uje],i=e[ose];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,a=>{t._width=a.size,t._viewWidth=fje(t,a.size),o()},{size:n}),t._resizeHeight=t.add(null,a=>{t._height=a.size,t._viewHeight=dje(t,a.size),o()},{size:r});const s=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,s.rank=i.rank+1}function h4t(t,e,n,r,i,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(cje,n,Qve),s._resizeWidth.skip(!0)),s.height()!==r&&(a=1,s.signal(uje,r,Qve),s._resizeHeight.skip(!0)),s._viewWidth!==t&&(s._resize=1,s._viewWidth=t),s._viewHeight!==e&&(s._resize=1,s._viewHeight=e),(s._origin[0]!==i[0]||s._origin[1]!==i[1])&&(s._resize=1,s._origin=i),a&&s.run("enter"),o&&s.runAfter(l=>l.resize())},!1,1)}function p4t(t){return this._runtime.getState(t||{data:g4t,signals:m4t,recurse:!0})}function g4t(t,e){return e.modified&&We(e.input.value)&&!t.startsWith("_:vega:_")}function m4t(t,e){return!(t==="parent"||e instanceof jS.proxy)}function v4t(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},e=>{e._trigger=!0}),this}function y4t(t,e){function n(r){t({timestamp:Date.now(),elapsed:r})}this._timers.push(Y$t(n,e))}function x4t(t,e,n,r){const i=t.element();i&&i.setAttribute("title",b4t(r))}function b4t(t){return t==null?"":We(t)?hje(t):ht(t)&&!Nv(t)?w4t(t):t+""}function w4t(t){return Object.keys(t).map(e=>{const n=t[e];return e+": "+(We(n)?hje(n):pje(n))}).join(` +`)}function hje(t){return"["+t.map(pje).join(", ")+"]"}function pje(t){return We(t)?"[…]":ht(t)&&!Nv(t)?"{…}":t}function _4t(){if(this.renderer()==="canvas"&&this._renderer._canvas){let t=null;const e=()=>{t!=null&&t();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",e),t=()=>{n.removeEventListener("change",e)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};e()}}function gje(t,e){const n=this;if(e=e||{},z_.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),e.logLevel!=null&&n.logLevel(e.logLevel),e.locale||t.locale){const o=cn({},t.locale,e.locale);n.locale(s$e(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||gv.Canvas,n._scenegraph=new cNe;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||x4t,n._redraw=!0,n._handler=new SR().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=jjt(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=u4t(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map(o=>({state:null,param:cn({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=fje(n,n._width),n._viewHeight=dje(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,d4t(n),Ajt(n),Pjt(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind),e.watchPixelRatio&&n._watchPixelRatio()}function eL(t,e){return vt(t._signals,e)?t._signals[e]:je("Unrecognized signal name: "+rt(e))}function mje(t,e){const n=(t._targets||[]).filter(r=>r._update&&r._update.handler===e);return n.length?n[0]:null}function Kve(t,e,n,r){let i=mje(n,r);return i||(i=rse(t,()=>r(e,n.value)),i.handler=r,t.on(n,null,i)),t}function Zve(t,e,n){const r=mje(e,n);return r&&e._targets.remove(r),t}it(gje,z_,{async evaluate(t,e,n){if(await z_.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,Ijt(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&h3(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=t!=null?t+"":null;return e!==this._desc&&ije(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const r=eL(this,t);return arguments.length===1?r.value:this.update(r,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",Yve(t)):Yve(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(WB(t)||je("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(z_.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(eL(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:h4t,addEventListener(t,e,n){let r=e;return n&&n.trap===!1||(r=rse(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n=this._handler.handlers(t),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,t===o&&(e===i||e===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.includes(t)||e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return Kve(this,t,eL(this,t),e)},removeSignalListener(t,e){return Zve(this,eL(this,t),e)},addDataListener(t,e){return Kve(this,t,E5(this,t).values,e)},removeDataListener(t,e){return Zve(this,E5(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=kY(this,null);this._globalCursor=!!t,e&&kY(this,e)}return this}else return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:y4t,events:Ujt,finalize:Vjt,hover:Wjt,data:Mjt,change:t6,insert:Rjt,remove:Djt,scale:f4t,initialize:i4t,toImageURL:s4t,toCanvas:l4t,toSVG:c4t,getState:p4t,setState:v4t,_watchPixelRatio:_4t});const S4t="view",k5="[",A5="]",vje="{",yje="}",C4t=":",xje=",",O4t="@",E4t=">",T4t=/[[\]{}]/,k4t={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let bje,wje;function Qy(t,e,n){return bje=e||S4t,wje=n||k4t,_je(t.trim()).map(AY)}function A4t(t){return wje[t]}function pk(t,e,n,r,i){const o=t.length;let s=0,a;for(;e=0?--s:r&&r.indexOf(a)>=0&&++s}return e}function _je(t){const e=[],n=t.length;let r=0,i=0;for(;i' after between selector: "+t;r=r.map(AY);const i=AY(t.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function M4t(t){const e={source:bje},n=[];let r=[0,0],i=0,o=0,s=t.length,a=0,l,c;if(t[s-1]===yje){if(a=t.lastIndexOf(vje),a>=0){try{r=R4t(t.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+t}t=t.slice(0,a).trim(),s=t.length}else throw"Unmatched right brace: "+t;a=0}if(!s)throw t;if(t[0]===O4t&&(i=++a),l=pk(t,a,C4t),l1?(e.type=n[1],i?e.markname=n[0].slice(1):A4t(n[0])?e.marktype=n[0]:e.source=n[0]):e.type=n[0],e.type.slice(-1)==="!"&&(e.consume=!0,e.type=e.type.slice(0,-1)),c!=null&&(e.filter=c),r[0]&&(e.throttle=r[0]),r[1]&&(e.debounce=r[1]),e}function R4t(t){const e=t.split(xje);if(!t.length||e.length>2)throw t;return e.map(n=>{const r=+n;if(r!==r)throw t;return r})}function D4t(t){return ht(t)?t:{type:t||"pad"}}const s2=t=>+t||0,I4t=t=>({top:t,bottom:t,left:t,right:t});function L4t(t){return ht(t)?t.signal?t:{top:s2(t.top),bottom:s2(t.bottom),left:s2(t.left),right:s2(t.right)}:I4t(s2(t))}const jo=t=>ht(t)&&!We(t)?cn({},t):{value:t};function Jve(t,e,n,r){return n!=null?(ht(n)&&!We(n)||We(n)&&n.length&&ht(n[0])?t.update[e]=n:t[r||"enter"][e]={value:n},1):0}function Cs(t,e,n){for(const r in e)Jve(t,r,e[r]);for(const r in n)Jve(t,r,n[r],"update")}function MO(t,e,n){for(const r in e)n&&vt(n,r)||(t[r]=cn(t[r]||{},e[r]));return t}function Ww(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const sse="mark",ase="frame",lse="scope",$4t="axis",F4t="axis-domain",N4t="axis-grid",z4t="axis-label",j4t="axis-tick",B4t="axis-title",U4t="legend",W4t="legend-band",V4t="legend-entry",G4t="legend-gradient",Sje="legend-label",H4t="legend-symbol",q4t="legend-title",X4t="title",Y4t="title-text",Q4t="title-subtitle";function K4t(t,e,n,r,i){const o={},s={};let a,l,c,u;l="lineBreak",e==="text"&&i[l]!=null&&!Ww(l,t)&&BV(o,l,i[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),u=n===ase?i.group:n===sse?cn({},i.mark,i[e]):null;for(l in u)c=Ww(l,t)||(l==="fill"||l==="stroke")&&(Ww("fill",t)||Ww("stroke",t)),c||BV(o,l,u[l]);pt(r).forEach(f=>{const d=i.style&&i.style[f];for(const h in d)Ww(h,t)||BV(o,h,d[h])}),t=cn({},t);for(l in o)u=o[l],u.signal?(a=a||{})[l]=u:s[l]=u;return t.enter=cn(s,t.enter),a&&(t.update=cn(a,t.update)),t}function BV(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const Cje=t=>gt(t)?rt(t):t.signal?`(${t.signal})`:Oje(t);function r6(t){if(t.gradient!=null)return J4t(t);let e=t.signal?`(${t.signal})`:t.color?Z4t(t.color):t.field!=null?Oje(t.field):t.value!==void 0?rt(t.value):void 0;return t.scale!=null&&(e=eBt(t,e)),e===void 0&&(e=null),t.exponent!=null&&(e=`pow(${e},${M3(t.exponent)})`),t.mult!=null&&(e+=`*${M3(t.mult)}`),t.offset!=null&&(e+=`+${M3(t.offset)}`),t.round&&(e=`round(${e})`),e}const tL=(t,e,n,r)=>`(${t}(${[e,n,r].map(r6).join(",")})+'')`;function Z4t(t){return t.c?tL("hcl",t.h,t.c,t.l):t.h||t.s?tL("hsl",t.h,t.s,t.l):t.l||t.a?tL("lab",t.l,t.a,t.b):t.r||t.g||t.b?tL("rgb",t.r,t.g,t.b):null}function J4t(t){const e=[t.start,t.stop,t.count].map(n=>n==null?null:rt(n));for(;e.length&&$n(e)==null;)e.pop();return e.unshift(Cje(t.gradient)),`gradient(${e.join(",")})`}function M3(t){return ht(t)?"("+r6(t)+")":t}function Oje(t){return Eje(ht(t)?t:{datum:t})}function Eje(t){let e,n,r;if(t.signal)e="datum",r=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(r=t.parent,e+=".datum"):r=t.group}else t.datum?(e="datum",r=t.datum):je("Invalid field reference: "+rt(t));return t.signal||(r=gt(r)?Wh(r).map(rt).join("]["):Eje(r)),e+"["+r+"]"}function eBt(t,e){const n=Cje(t.scale);return t.range!=null?e=`lerp(_range(${n}), ${+t.range})`:(e!==void 0&&(e=`_scale(${n}, ${e})`),t.band&&(e=(e?e+"+":"")+`_bandwidth(${n})`+(+t.band==1?"":"*"+M3(t.band)),t.extra&&(e=`(datum.extra ? _scale(${n}, datum.extra.value) : ${e})`)),e==null&&(e="0")),e}function tBt(t){let e="";return t.forEach(n=>{const r=r6(n);e+=n.test?`(${n.test})?${r}:`:r}),$n(e)===":"&&(e+="null"),e}function Tje(t,e,n,r,i,o){const s={};o=o||{},o.encoders={$encode:s},t=K4t(t,e,n,r,i.config);for(const a in t)s[a]=nBt(t[a],e,o,i);return o}function nBt(t,e,n,r){const i={},o={};for(const s in t)t[s]!=null&&(i[s]=iBt(rBt(t[s]),r,n,o));return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function rBt(t){return We(t)?tBt(t):r6(t)}function iBt(t,e,n,r){const i=Dh(t,e);return i.$fields.forEach(o=>r[o]=1),cn(n,i.$params),i.$expr}const oBt="outer",sBt=["value","update","init","react","bind"];function eye(t,e){je(t+' for "outer" push: '+rt(e))}function kje(t,e){const n=t.name;if(t.push===oBt)e.signals[n]||eye("No prior signal definition",n),sBt.forEach(r=>{t[r]!==void 0&&eye("Invalid property ",r)});else{const r=e.addSignal(n,t.value);t.react===!1&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function PY(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function i6(t,e,n,r){return new PY(t,e,n,r)}function P5(t,e){return i6("operator",t,e)}function zt(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function UA(t,e){return e?{$field:t,$name:e}:{$field:t}}const MY=UA("key");function tye(t,e){return{$compare:t,$order:e}}function aBt(t,e){const n={$key:t};return e&&(n.$flat=!0),n}const lBt="ascending",cBt="descending";function uBt(t){return ht(t)?(t.order===cBt?"-":"+")+o6(t.op,t.field):""}function o6(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const cse="scope",RY="view";function Co(t){return t&&t.signal}function fBt(t){return t&&t.expr}function R3(t){if(Co(t))return!0;if(ht(t)){for(const e in t)if(R3(t[e]))return!0}return!1}function df(t,e){return t??e}function Ux(t){return t&&t.signal||t}const nye="timer";function WA(t,e){return(t.merge?hBt:t.stream?pBt:t.type?gBt:je("Invalid stream specification: "+rt(t)))(t,e)}function dBt(t){return t===cse?RY:t||RY}function hBt(t,e){const n=t.merge.map(i=>WA(i,e)),r=use({merge:n},t,e);return e.addStream(r).id}function pBt(t,e){const n=WA(t.stream,e),r=use({stream:n},t,e);return e.addStream(r).id}function gBt(t,e){let n;t.type===nye?(n=e.event(nye,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(dBt(t.source),t.type);const r=use({stream:n},t,e);return Object.keys(r).length===1?n:e.addStream(r).id}function use(t,e,n){let r=e.between;return r&&(r.length!==2&&je('Stream "between" parameter must have 2 entries: '+rt(e)),t.between=[WA(r[0],n),WA(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(mBt(e.marktype,e.markname,e.markrole)),e.source===cse&&r.push("inScope(event.item)"),r.length&&(t.filter=Dh("("+r.join(")&&(")+")",n).$expr),(r=e.throttle)!=null&&(t.throttle=+r),(r=e.debounce)!=null&&(t.debounce=+r),e.consume&&(t.consume=!0),t}function mBt(t,e,n){const r="event.item";return r+(t&&t!=="*"?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}const vBt={code:"_.$value",ast:{type:"Identifier",value:"value"}};function yBt(t,e,n){const r=t.encode,i={target:n};let o=t.events,s=t.update,a=[];o||je("Signal update missing events specification."),gt(o)&&(o=Qy(o,e.isSubscope()?cse:RY)),o=pt(o).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[bBt(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),r!=null&&(s&&je("Signal encode and update are mutually exclusive."),s="encode(item(),"+rt(r)+")"),i.update=gt(s)?Dh(s,e):s.expr!=null?Dh(s.expr,e):s.value!=null?s.value:s.signal!=null?{$expr:vBt,$params:{$value:e.signalRef(s.signal)}}:je("Invalid signal update specification."),t.force&&(i.options={force:!0}),a.forEach(l=>e.addUpdate(cn(xBt(l,e),i)))}function xBt(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):WA(t,e)}}function bBt(t){return{signal:"["+t.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}function wBt(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?je("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=Dh(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach(i=>yBt(i,e,n.id))}const Pr=t=>(e,n,r)=>i6(t,n,e||void 0,r),Aje=Pr("aggregate"),_Bt=Pr("axisticks"),Pje=Pr("bound"),id=Pr("collect"),rye=Pr("compare"),SBt=Pr("datajoin"),Mje=Pr("encode"),CBt=Pr("expression"),OBt=Pr("facet"),EBt=Pr("field"),TBt=Pr("key"),kBt=Pr("legendentries"),ABt=Pr("load"),PBt=Pr("mark"),MBt=Pr("multiextent"),RBt=Pr("multivalues"),DBt=Pr("overlap"),IBt=Pr("params"),Rje=Pr("prefacet"),LBt=Pr("projection"),$Bt=Pr("proxy"),FBt=Pr("relay"),Dje=Pr("render"),NBt=Pr("scale"),m1=Pr("sieve"),zBt=Pr("sortitems"),Ije=Pr("viewlayout"),jBt=Pr("values");let BBt=0;const Lje={min:"min",max:"max",count:"sum"};function UBt(t,e){const n=t.type||"linear";wFe(n)||je("Unrecognized scale type: "+rt(n)),e.addScale(t.name,{type:n,domain:void 0})}function WBt(t,e){const n=e.getScale(t.name).params;let r;n.domain=$je(t.domain,t,e),t.range!=null&&(n.range=Nje(t,e,n)),t.interpolate!=null&&JBt(t.interpolate,n),t.nice!=null&&(n.nice=ZBt(t.nice,e)),t.bins!=null&&(n.bins=KBt(t.bins,e));for(r in t)vt(n,r)||r==="name"||(n[r]=ou(t[r],e))}function ou(t,e){return ht(t)?t.signal?e.signalRef(t.signal):je("Unsupported object: "+rt(t)):t}function D3(t,e){return t.signal?e.signalRef(t.signal):t.map(n=>ou(n,e))}function s6(t){je("Can not find data set: "+rt(t))}function $je(t,e,n){if(!t){(e.domainMin!=null||e.domainMax!=null)&&je("No scale domain defined for domainMin/domainMax to override.");return}return t.signal?n.signalRef(t.signal):(We(t)?VBt:t.fields?HBt:GBt)(t,e,n)}function VBt(t,e,n){return t.map(r=>ou(r,n))}function GBt(t,e,n){const r=n.getData(t.data);return r||s6(t.data),GS(e.type)?r.valuesRef(n,t.field,Fje(t.sort,!1)):CFe(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function HBt(t,e,n){const r=t.data,i=t.fields.reduce((o,s)=>(s=gt(s)?{data:r,field:s}:We(s)||s.signal?qBt(s,n):s,o.push(s),o),[]);return(GS(e.type)?XBt:CFe(e.type)?YBt:QBt)(t,n,i)}function qBt(t,e){const n="_:vega:_"+BBt++,r=id({});if(We(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+rt(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,m1({})]),{data:n,field:"data"}}function XBt(t,e,n){const r=Fje(t.sort,!0);let i,o;const s=n.map(c=>{const u=e.getData(c.data);return u||s6(c.data),u.countsRef(e,c.field,r)}),a={groupby:MY,pulse:s};r&&(i=r.op||"count",o=r.field?o6(i,r.field):"count",a.ops=[Lje[i]],a.fields=[e.fieldRef(o)],a.as=[o]),i=e.add(Aje(a));const l=e.add(id({pulse:zt(i)}));return o=e.add(jBt({field:MY,sort:e.sortRef(r),pulse:zt(l)})),zt(o)}function Fje(t,e){return t&&(!t.field&&!t.op?ht(t)?t.field="key":t={field:"key"}:!t.field&&t.op!=="count"?je("No field provided for sort aggregate op: "+t.op):e&&t.field&&t.op&&!Lje[t.op]&&je("Multiple domain scales can not be sorted using "+t.op)),t}function YBt(t,e,n){const r=n.map(i=>{const o=e.getData(i.data);return o||s6(i.data),o.domainRef(e,i.field)});return zt(e.add(RBt({values:r})))}function QBt(t,e,n){const r=n.map(i=>{const o=e.getData(i.data);return o||s6(i.data),o.extentRef(e,i.field)});return zt(e.add(MBt({extents:r})))}function KBt(t,e){return t.signal||We(t)?D3(t,e):e.objectProperty(t)}function ZBt(t,e){return t.signal?e.signalRef(t.signal):ht(t)?{interval:ou(t.interval),step:ou(t.step)}:ou(t)}function JBt(t,e){e.interpolate=ou(t.type||t),t.gamma!=null&&(e.interpolateGamma=ou(t.gamma))}function Nje(t,e,n){const r=e.config.range;let i=t.range;if(i.signal)return e.signalRef(i.signal);if(gt(i)){if(r&&vt(r,i))return t=cn({},t,{range:r[i]}),Nje(t,e,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=GS(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:je("Unrecognized scale range value: "+rt(i))}else if(i.scheme){n.scheme=We(i.scheme)?D3(i.scheme,e):ou(i.scheme,e),i.extent&&(n.schemeExtent=D3(i.extent,e)),i.count&&(n.schemeCount=ou(i.count,e));return}else if(i.step){n.rangeStep=ou(i.step,e);return}else{if(GS(t.type)&&!We(i))return $je(i,t,e);We(i)||je("Unsupported range type: "+rt(i))}return i.map(o=>(We(o)?D3:ou)(o,e))}function e6t(t,e){const n=e.config.projection||{},r={};for(const i in t)i!=="name"&&(r[i]=DY(t[i],i,e));for(const i in n)r[i]==null&&(r[i]=DY(n[i],i,e));e.addProjection(t.name,r)}function DY(t,e,n){return We(t)?t.map(r=>DY(r,e,n)):ht(t)?t.signal?n.signalRef(t.signal):e==="fit"?t:je("Unsupported parameter object: "+rt(t)):t}const od="top",RO="left",DO="right",dy="bottom",zje="center",t6t="vertical",n6t="start",r6t="middle",i6t="end",IY="index",fse="label",o6t="offset",eC="perc",s6t="perc2",hu="value",RR="guide-label",dse="guide-title",a6t="group-title",l6t="group-subtitle",iye="symbol",I3="gradient",LY="discrete",$Y="size",c6t="shape",u6t="fill",f6t="stroke",d6t="strokeWidth",h6t="strokeDash",p6t="opacity",hse=[$Y,c6t,u6t,f6t,d6t,h6t,p6t],DR={name:1,style:1,interactive:1},jn={value:0},pu={value:1},a6="group",jje="rect",pse="rule",g6t="symbol",v1="text";function VA(t){return t.type=a6,t.interactive=t.interactive||!1,t}function Pl(t,e){const n=(r,i)=>df(t[r],df(e[r],i));return n.isVertical=r=>t6t===df(t.direction,e.direction||(r?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>df(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>df(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>df(t.columns,df(e.columns,+n.isVertical(!0))),n}function Bje(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function m6t(t,e,n){const r=e.config.style[n];return r&&r[t]}function l6(t,e,n){return`item.anchor === '${n6t}' ? ${t} : item.anchor === '${i6t}' ? ${e} : ${n}`}const gse=l6(rt(RO),rt(DO),rt(zje));function v6t(t){const e=t("tickBand");let n=t("tickOffset"),r,i;return e?e.signal?(r={signal:`(${e.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${e.signal}) === 'extent'`},ht(n)||(n={signal:`(${e.signal}) === 'extent' ? 0 : ${n}`})):e==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=t("bandPosition"),i=t("tickExtra")),{extra:i,band:r,offset:n}}function Uje(t,e){return e?t?ht(t)?Object.assign({},t,{offset:Uje(t.offset,e)}):{value:t,offset:e}:e:t}function Tc(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=MO(t.encode,e,DR)):t.interactive=!1,t}function y6t(t,e,n,r){const i=Pl(t,n),o=i.isVertical(),s=i.gradientThickness(),a=i.gradientLength();let l,c,u,f,d;o?(c=[0,1],u=[0,0],f=s,d=a):(c=[0,0],u=[1,0],f=a,d=s);const h={enter:l={opacity:jn,x:jn,y:jn,width:jo(f),height:jo(d)},update:cn({},l,{opacity:pu,fill:{gradient:e,start:c,stop:u}}),exit:{opacity:jn}};return Cs(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),Tc({type:jje,role:G4t,encode:h},r)}function x6t(t,e,n,r,i){const o=Pl(t,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let c,u,f,d,h="";s?(c="y",f="y2",u="x",d="width",h="1-"):(c="x",f="x2",u="y",d="height");const p={opacity:jn,fill:{scale:e,field:hu}};p[c]={signal:h+"datum."+eC,mult:l},p[u]=jn,p[f]={signal:h+"datum."+s6t,mult:l},p[d]=jo(a);const g={enter:p,update:cn({},p,{opacity:pu}),exit:{opacity:jn}};return Cs(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Tc({type:jje,role:W4t,key:hu,from:i,encode:g},r)}const b6t=`datum.${eC}<=0?"${RO}":datum.${eC}>=1?"${DO}":"${zje}"`,w6t=`datum.${eC}<=0?"${dy}":datum.${eC}>=1?"${od}":"${r6t}"`;function oye(t,e,n,r){const i=Pl(t,e),o=i.isVertical(),s=jo(i.gradientThickness()),a=i.gradientLength();let l=i("labelOverlap"),c,u,f,d,h="";const p={enter:c={opacity:jn},update:u={opacity:pu,text:{field:fse}},exit:{opacity:jn}};return Cs(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:df(t.labelLimit,e.gradientLabelLimit)}),o?(c.align={value:"left"},c.baseline=u.baseline={signal:w6t},f="y",d="x",h="1-"):(c.align=u.align={signal:b6t},c.baseline={value:"top"},f="x",d="y"),c[f]=u[f]={signal:h+"datum."+eC,mult:a},c[d]=u[d]=s,s.offset=df(t.labelOffset,e.gradientLabelOffset)||0,l=l?{separation:i("labelSeparation"),method:l,order:"datum."+IY}:void 0,Tc({type:v1,role:Sje,style:RR,key:hu,from:r,encode:p,overlap:l},n)}function _6t(t,e,n,r,i){const o=Pl(t,e),s=n.entries,a=!!(s&&s.interactive),l=s?s.name:void 0,c=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${o6t} : datum.${$Y}`,h=c?jo(c):{field:$Y},p=`datum.${IY}`,g=`max(1, ${i})`;let m,v,y,x,b;h.mult=.5,m={enter:v={opacity:jn,x:{signal:d,mult:.5,offset:u},y:h},update:y={opacity:pu,x:v.x,y:v.y},exit:{opacity:jn}};let w=null,_=null;t.fill||(w=e.symbolBaseFillColor,_=e.symbolBaseStrokeColor),Cs(m,{fill:o("symbolFillColor",w),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",_),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),hse.forEach(E=>{t[E]&&(y[E]=v[E]={scale:t[E],field:hu})});const S=Tc({type:g6t,role:H4t,key:hu,from:f,clip:c?!0:void 0,encode:m},n.symbols),O=jo(u);O.offset=o("labelOffset"),m={enter:v={opacity:jn,x:{signal:d,offset:O},y:h},update:y={opacity:pu,text:{field:fse},x:v.x,y:v.y},exit:{opacity:jn}},Cs(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const k=Tc({type:v1,role:Sje,style:RR,key:hu,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!c},width:jn,height:c?jo(c):jn,opacity:jn},exit:{opacity:jn},update:y={opacity:pu,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(x=`ceil(item.mark.items.length / ${g})`,y.row.signal=`${p}%${x}`,y.column.signal=`floor(${p} / ${x})`,b={field:["row",p]}):(y.row.signal=`floor(${p} / ${g})`,y.column.signal=`${p} % ${g}`,b={field:p}),y.column.signal=`(${i})?${y.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:IY}},VA({role:lse,from:r,encode:MO(m,s,DR),marks:[S,k],name:l,interactive:a,sort:b})}function S6t(t,e){const n=Pl(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const mse='item.orient === "left"',vse='item.orient === "right"',c6=`(${mse} || ${vse})`,C6t=`datum.vgrad && ${c6}`,O6t=l6('"top"','"bottom"','"middle"'),E6t=l6('"right"','"left"','"center"'),T6t=`datum.vgrad && ${vse} ? (${E6t}) : (${c6} && !(datum.vgrad && ${mse})) ? "left" : ${gse}`,k6t=`item._anchor || (${c6} ? "middle" : "start")`,A6t=`${C6t} ? (${mse} ? -90 : 90) : 0`,P6t=`${c6} ? (datum.vgrad ? (${vse} ? "bottom" : "top") : ${O6t}) : "top"`;function M6t(t,e,n,r){const i=Pl(t,e),o={enter:{opacity:jn},update:{opacity:pu,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:jn}};return Cs(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:k6t},angle:{signal:A6t},align:{signal:T6t},baseline:{signal:P6t},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),Tc({type:v1,role:q4t,style:dse,from:r,encode:o},n)}function R6t(t,e){let n;return ht(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+sye(t.path)+")":t.sphere&&(n="geoShape("+sye(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function sye(t){return ht(t)&&t.signal?t.signal:rt(t)}function Wje(t){const e=t.role||"";return e.startsWith("axis")||e.startsWith("legend")||e.startsWith("title")?e:t.type===a6?lse:e||sse}function D6t(t){return{marktype:t.type,name:t.name||void 0,role:t.role||Wje(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function I6t(t,e){return t&&t.signal?e.signalRef(t.signal):t!==!1}function yse(t,e){const n=x$e(t.type);n||je("Unrecognized transform type: "+rt(t.type));const r=i6(n.type.toLowerCase(),null,Vje(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function Vje(t,e,n){const r={},i=t.params.length;for(let o=0;oaye(t,o,n)):aye(t,i,n)}function aye(t,e,n){const r=t.type;if(Co(e))return cye(r)?je("Expression references can not be signals."):UV(r)?n.fieldRef(e):uye(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||UV(r);return i&&N6t(e)?n.exprRef(e.expr,e.as):i&&z6t(e)?UA(e.field,e.as):cye(r)?Dh(e,n):j6t(r)?zt(n.getData(e).values):UV(r)?UA(e):uye(r)?n.compareRef(e):e}}function $6t(t,e,n){return gt(e.from)||je('Lookup "from" parameter must be a string literal.'),n.getData(e.from).lookupRef(n,e.key)}function F6t(t,e,n){const r=e[t.name];return t.array?(We(r)||je("Expected an array of sub-parameters. Instead: "+rt(r)),r.map(i=>lye(t,i,n))):lye(t,r,n)}function lye(t,e,n){const r=t.params.length;let i;for(let s=0;st&&t.expr,z6t=t=>t&&t.field,j6t=t=>t==="data",cye=t=>t==="expr",UV=t=>t==="field",uye=t=>t==="compare";function B6t(t,e,n){let r,i,o,s,a;return t?(r=t.facet)&&(e||je("Only group marks can be faceted."),r.field!=null?s=a=L3(r,n):(t.data?a=zt(n.getData(t.data).aggregate):(o=yse(cn({type:"aggregate",groupby:pt(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=L3(r,n),s=a=zt(n.add(o))),i=n.keyRef(r.groupby,!0))):s=zt(n.add(id(null,[{}]))),s||(s=L3(t,n)),{key:i,pulse:s,parent:a}}function L3(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:zt(e.getData(t.data).output)}function Cb(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}Cb.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=e[n-2];let o=e[0],s=null,a=1;for(o&&o.type==="load"&&(o=e[1]),t.add(e[0]);af??"null").join(",")+"),0)",u=Dh(c,e);l.update=u.$expr,l.params=u.$params}function u6(t,e){const n=Wje(t),r=t.type===a6,i=t.from&&t.from.facet,o=t.overlap;let s=t.layout||n===lse||n===ase,a,l,c,u,f,d,h;const p=n===sse||s||i,g=B6t(t.from,r,e);l=e.add(SBt({key:g.key||(t.key?UA(t.key):void 0),pulse:g.pulse,clean:!r}));const m=zt(l);l=c=e.add(id({pulse:m})),l=e.add(PBt({markdef:D6t(t),interactive:I6t(t.interactive,e),clip:R6t(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:zt(l)}));const v=zt(l);l=u=e.add(Mje(Tje(t.encode,t.type,n,t.style,e,{mod:!1,pulse:v}))),l.params.parent=e.encode(),t.transform&&t.transform.forEach(_=>{const S=yse(_,e),O=S.metadata;(O.generates||O.changes)&&je("Mark transforms should not generate new data."),O.nomod||(u.params.mod=!0),S.params.pulse=zt(l),e.add(l=S)}),t.sort&&(l=e.add(zBt({sort:e.compareRef(t.sort),pulse:zt(l)})));const y=zt(l);(i||s)&&(s=e.add(Ije({layout:e.objectProperty(t.layout),legends:e.legends,mark:v,pulse:y})),d=zt(s));const x=e.add(Pje({mark:v,pulse:d||y}));h=zt(x),r&&(p&&(a=e.operators,a.pop(),s&&a.pop()),e.pushState(y,d||h,m),i?U6t(t,e,g):p?W6t(t,e,g):e.parse(t),e.popState(),p&&(s&&a.push(s),a.push(x))),o&&(h=V6t(o,h,e));const b=e.add(Dje({pulse:h})),w=e.add(m1({pulse:zt(b)},void 0,e.parent()));t.name!=null&&(f=t.name,e.addData(f,new Cb(e,c,b,w)),t.on&&t.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&je("Marks only support modify triggers."),Hje(_,e,f)}))}function V6t(t,e,n){const r=t.method,i=t.bound,o=t.separation,s={separation:Co(o)?n.signalRef(o.signal):o,method:Co(r)?n.signalRef(r.signal):r,pulse:e};if(t.order&&(s.sort=n.compareRef({field:t.order})),i){const a=i.tolerance;s.boundTolerance=Co(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(i.scale),s.boundOrient=i.orient}return zt(n.add(DBt(s)))}function G6t(t,e){const n=e.config.legend,r=t.encode||{},i=Pl(t,n),o=r.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,c={};let u=0,f,d,h;hse.forEach(x=>t[x]?(c[x]=t[x],u=u||t[x]):0),u||je("Missing valid scale for legend.");const p=H6t(t,e.scaleType(u)),g={title:t.title!=null,scales:c,type:p,vgrad:p!=="symbol"&&i.isVertical()},m=zt(e.add(id(null,[g]))),v={enter:{x:{value:0},y:{value:0}}},y=zt(e.add(kBt(d={type:p,scale:e.scaleRef(u),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return p===I3?(h=[y6t(t,u,n,r.gradient),oye(t,n,r.labels,y)],d.count=d.count||e.signalRef(`max(2,2*floor((${Ux(i.gradientLength())})/100))`)):p===LY?h=[x6t(t,u,n,r.gradient,y),oye(t,n,r.labels,y)]:(f=S6t(t,n),h=[_6t(t,n,r,y,Ux(f.columns))],d.size=Y6t(t,e,h[0].marks)),h=[VA({role:V4t,from:m,encode:v,marks:h,layout:f,interactive:a})],g.title&&h.push(M6t(t,n,r.title,m)),u6(VA({role:U4t,from:m,encode:MO(X6t(i,t,n),o,DR),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:s,interactive:a,style:l}),e)}function H6t(t,e){let n=t.type||iye;return!t.type&&q6t(t)===1&&(t.fill||t.stroke)&&(n=vie(e)?I3:TX(e)?LY:iye),n!==I3?n:TX(e)?LY:I3}function q6t(t){return hse.reduce((e,n)=>e+(t[n]?1:0),0)}function X6t(t,e,n){const r={enter:{},update:{}};return Cs(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}function Y6t(t,e,n){const r=Ux(dye("size",t,n)),i=Ux(dye("strokeWidth",t,n)),o=Ux(Q6t(n[1].encode,e,RR));return Dh(`max(ceil(sqrt(${r})+${i}),${o})`,e)}function dye(t,e,n){return e[t]?`scale("${e[t]}",datum)`:Bje(t,n[0].encode)}function Q6t(t,e,n){return Bje("fontSize",t)||m6t("fontSize",e,n)}const K6t=`item.orient==="${RO}"?-90:item.orient==="${DO}"?90:0`;function Z6t(t,e){t=gt(t)?{text:t}:t;const n=Pl(t,e.config.title),r=t.encode||{},i=r.group||{},o=i.name||void 0,s=i.interactive,a=i.style,l=[],c={},u=zt(e.add(id(null,[c])));return l.push(tUt(t,n,J6t(t),u)),t.subtitle&&l.push(nUt(t,n,r.subtitle,u)),u6(VA({role:X4t,from:u,encode:eUt(n,i),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),e)}function J6t(t){const e=t.encode;return e&&e.title||cn({name:t.name,interactive:t.interactive,style:t.style},e)}function eUt(t,e){const n={enter:{},update:{}};return Cs(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:gse},angle:{signal:K6t},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),MO(n,e,DR)}function tUt(t,e,n,r){const i={value:0},o=t.text,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Cs(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),Tc({type:v1,role:Y4t,style:a6t,from:r,encode:s},n)}function nUt(t,e,n,r){const i={value:0},o=t.subtitle,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Cs(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),Tc({type:v1,role:Q4t,style:l6t,from:r,encode:s},n)}function rUt(t,e){const n=[];t.transform&&t.transform.forEach(r=>{n.push(yse(r,e))}),t.on&&t.on.forEach(r=>{Hje(r,e,t.name)}),e.addDataPipeline(t.name,iUt(t,e,n))}function iUt(t,e,n){const r=[];let i=null,o=!1,s=!1,a,l,c,u,f;for(t.values?Co(t.values)||R3(t.format)?(r.push(hye(e,t)),r.push(i=x0())):r.push(i=x0({$ingest:t.values,$format:t.format})):t.url?R3(t.url)||R3(t.format)?(r.push(hye(e,t)),r.push(i=x0())):r.push(i=x0({$request:t.url,$format:t.format})):t.source&&(i=a=pt(t.source).map(d=>zt(e.getData(d).output)),r.push(null)),l=0,c=n.length;lt===dy||t===od,f6=(t,e,n)=>Co(t)?lUt(t.signal,e,n):t===RO||t===od?e:n,Bo=(t,e,n)=>Co(t)?sUt(t.signal,e,n):qje(t)?e:n,If=(t,e,n)=>Co(t)?aUt(t.signal,e,n):qje(t)?n:e,Xje=(t,e,n)=>Co(t)?cUt(t.signal,e,n):t===od?{value:e}:{value:n},oUt=(t,e,n)=>Co(t)?uUt(t.signal,e,n):t===DO?{value:e}:{value:n},sUt=(t,e,n)=>Yje(`${t} === '${od}' || ${t} === '${dy}'`,e,n),aUt=(t,e,n)=>Yje(`${t} !== '${od}' && ${t} !== '${dy}'`,e,n),lUt=(t,e,n)=>xse(`${t} === '${RO}' || ${t} === '${od}'`,e,n),cUt=(t,e,n)=>xse(`${t} === '${od}'`,e,n),uUt=(t,e,n)=>xse(`${t} === '${DO}'`,e,n),Yje=(t,e,n)=>(e=e!=null?jo(e):e,n=n!=null?jo(n):n,pye(e)&&pye(n)?(e=e?e.signal||rt(e.value):null,n=n?n.signal||rt(n.value):null,{signal:`${t} ? (${e}) : (${n})`}):[cn({test:t},e)].concat(n||[])),pye=t=>t==null||Object.keys(t).length===1,xse=(t,e,n)=>({signal:`${t} ? (${m_(e)}) : (${m_(n)})`}),fUt=(t,e,n,r,i)=>({signal:(r!=null?`${t} === '${RO}' ? (${m_(r)}) : `:"")+(n!=null?`${t} === '${dy}' ? (${m_(n)}) : `:"")+(i!=null?`${t} === '${DO}' ? (${m_(i)}) : `:"")+(e!=null?`${t} === '${od}' ? (${m_(e)}) : `:"")+"(null)"}),m_=t=>Co(t)?t.signal:t==null?null:rt(t),dUt=(t,e)=>e===0?0:Co(t)?{signal:`(${t.signal}) * ${e}`}:{value:t*e},W_=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function ow(t,e,n,r){let i;if(e&&vt(e,t))return e[t];if(vt(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r[dse][i]}else if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r[RR][i]}return null}function gye(t){const e={};for(const n of t)if(n)for(const r in n)e[r]=1;return Object.keys(e)}function hUt(t,e){var n=e.config,r=n.style,i=n.axis,o=e.scaleType(t.scale)==="band"&&n.axisBand,s=t.orient,a,l,c;if(Co(s)){const f=gye([n.axisX,n.axisY]),d=gye([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(c of f)a[c]=Bo(s,ow(c,n.axisX,i,r),ow(c,n.axisY,i,r));l={};for(c of d)l[c]=fUt(s.signal,ow(c,n.axisTop,i,r),ow(c,n.axisBottom,i,r),ow(c,n.axisLeft,i,r),ow(c,n.axisRight,i,r))}else a=s===od||s===dy?n.axisX:n.axisY,l=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||l||o?cn({},i,a,l,o):i}function pUt(t,e,n,r){const i=Pl(t,e),o=t.orient;let s,a;const l={enter:s={opacity:jn},update:a={opacity:pu},exit:{opacity:jn}};Cs(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const c=mye(t,0),u=mye(t,1);return s.x=a.x=Bo(o,c,jn),s.x2=a.x2=Bo(o,u),s.y=a.y=If(o,c,jn),s.y2=a.y2=If(o,u),Tc({type:pse,role:F4t,from:r,encode:l},n)}function mye(t,e){return{scale:t.scale,range:e}}function gUt(t,e,n,r,i){const o=Pl(t,e),s=t.orient,a=t.gridScale,l=f6(s,1,-1),c=mUt(t.offset,l);let u,f,d;const h={enter:u={opacity:jn},update:d={opacity:pu},exit:f={opacity:jn}};Cs(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:hu,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=Bo(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:c}:{value:0,offset:c},v=a?{scale:a,range:1,mult:l,offset:c}:cn(g,{mult:l,offset:c});return u.x=d.x=Bo(s,p,m),u.y=d.y=If(s,p,m),u.x2=d.x2=If(s,v),u.y2=d.y2=Bo(s,v),f.x=Bo(s,p),f.y=If(s,p),Tc({type:pse,role:N4t,key:hu,from:r,encode:h},n)}function mUt(t,e){if(e!==1)if(!ht(t))t=Co(e)?{signal:`(${e.signal}) * (${t||0})`}:e*(t||0);else{let n=t=cn({},t);for(;n.mult!=null;)if(ht(n.mult))n=n.mult=cn({},n.mult);else return n.mult=Co(e)?{signal:`(${n.mult}) * (${e.signal})`}:n.mult*e,t;n.mult=e}return t}function vUt(t,e,n,r,i,o){const s=Pl(t,e),a=t.orient,l=f6(a,-1,1);let c,u,f;const d={enter:c={opacity:jn},update:f={opacity:pu},exit:u={opacity:jn}};Cs(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=jo(i);h.mult=l;const p={scale:t.scale,field:hu,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=c.y=Bo(a,jn,p),f.y2=c.y2=Bo(a,h),u.x=Bo(a,p),f.x=c.x=If(a,jn,p),f.x2=c.x2=If(a,h),u.y=If(a,p),Tc({type:pse,role:j4t,key:hu,from:r,encode:d},n)}function WV(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function yUt(t,e,n,r,i,o){const s=Pl(t,e),a=t.orient,l=t.scale,c=f6(a,-1,1),u=Ux(s("labelFlush")),f=Ux(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=u===0||!!u,g;const m=jo(i);m.mult=c,m.offset=jo(s("labelPadding")||0),m.offset.mult=c;const v={scale:l,field:hu,band:.5,offset:Uje(o.offset,s("labelOffset"))},y=Bo(a,p?WV(l,u,'"left"','"right"','"center"'):{value:"center"},oUt(a,"left","right")),x=Bo(a,Xje(a,"bottom","top"),p?WV(l,u,'"top"','"bottom"','"middle"'):{value:"middle"}),b=WV(l,u,`-(${f})`,f,0);p=p&&f;const w={opacity:jn,x:Bo(a,v,m),y:If(a,v,m)},_={enter:w,update:g={opacity:pu,text:{field:fse},x:w.x,y:w.y,align:y,baseline:x},exit:{opacity:jn,x:w.x,y:w.y}};Cs(_,{dx:!d&&p?Bo(a,b):null,dy:!h&&p?If(a,b):null}),Cs(_,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const S=s("labelBound");let O=s("labelOverlap");return O=O||S?{separation:s("labelSeparation"),method:O,order:"datum.index",bound:S?{scale:l,orient:a,tolerance:S}:null}:void 0,g.align!==y&&(g.align=W_(g.align,y)),g.baseline!==x&&(g.baseline=W_(g.baseline,x)),Tc({type:v1,role:z4t,style:RR,key:hu,from:r,encode:_,overlap:O},n)}function xUt(t,e,n,r){const i=Pl(t,e),o=t.orient,s=f6(o,-1,1);let a,l;const c={enter:a={opacity:jn,anchor:jo(i("titleAnchor",null)),align:{signal:gse}},update:l=cn({},a,{opacity:pu,text:jo(t.title)}),exit:{opacity:jn}},u={signal:`lerp(range("${t.scale}"), ${l6(0,1,.5)})`};return l.x=Bo(o,u),l.y=If(o,u),a.angle=Bo(o,jn,dUt(s,90)),a.baseline=Bo(o,Xje(o,dy,od),{value:dy}),l.angle=a.angle,l.baseline=a.baseline,Cs(c,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),bUt(i,o,c,n),c.update.align=W_(c.update.align,a.align),c.update.angle=W_(c.update.angle,a.angle),c.update.baseline=W_(c.update.baseline,a.baseline),Tc({type:v1,role:B4t,style:dse,from:r,encode:c},n)}function bUt(t,e,n,r){const i=(a,l)=>a!=null?(n.update[l]=W_(jo(a),n.update[l]),!1):!Ww(l,r),o=i(t("titleX"),"x"),s=i(t("titleY"),"y");n.enter.auto=s===o?jo(s):Bo(e,jo(s),jo(o))}function wUt(t,e){const n=hUt(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,s=i.interactive,a=i.style,l=Pl(t,n),c=v6t(l),u={scale:t.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:t.title!=null},f=zt(e.add(id({},[u]))),d=zt(e.add(_Bt({scale:e.scaleRef(t.scale),extra:e.property(c.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),h=[];let p;return u.grid&&h.push(gUt(t,n,r.grid,d,c)),u.ticks&&(p=l("tickSize"),h.push(vUt(t,n,r.ticks,d,p,c))),u.labels&&(p=u.ticks?p:0,h.push(yUt(t,n,r.labels,d,p,c))),u.domain&&h.push(pUt(t,n,r.domain,f)),u.title&&h.push(xUt(t,n,r.title,f)),u6(VA({role:$4t,from:f,encode:MO(_Ut(l,t),i,DR),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),e)}function _Ut(t,e){const n={enter:{},update:{}};return Cs(n,{orient:t("orient"),offset:t("offset")||0,position:df(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:`abs(span(range("${e.scale}")))`},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function Qje(t,e,n){const r=pt(t.signals),i=pt(t.scales);return n||r.forEach(o=>kje(o,e)),pt(t.projections).forEach(o=>e6t(o,e)),i.forEach(o=>UBt(o,e)),pt(t.data).forEach(o=>rUt(o,e)),i.forEach(o=>WBt(o,e)),(n||r).forEach(o=>wBt(o,e)),pt(t.axes).forEach(o=>wUt(o,e)),pt(t.marks).forEach(o=>u6(o,e)),pt(t.legends).forEach(o=>G6t(o,e)),t.title&&Z6t(t.title,e),e.parseLambdas(),e}const SUt=t=>MO({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function CUt(t,e){const n=e.config,r=zt(e.root=e.add(P5())),i=OUt(t,n);i.forEach(c=>kje(c,e)),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(id()),s=e.add(Mje(Tje(SUt(t.encode),a6,ase,t.style,e,{pulse:zt(o)}))),a=e.add(Ije({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:zt(s)}));e.operators.pop(),e.pushState(zt(s),zt(a),null),Qje(t,e,i),e.operators.push(a);let l=e.add(Pje({mark:r,pulse:zt(a)}));return l=e.add(Dje({pulse:zt(l)})),l=e.add(m1({pulse:zt(l)})),e.addData("root",new Cb(e,o,o,l)),e}function l2(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function OUt(t,e){const n=s=>df(t[s],e[s]),r=[l2("background",n("background")),l2("autosize",D4t(n("autosize"))),l2("padding",L4t(n("padding"))),l2("width",n("width")||0),l2("height",n("height")||0)],i=r.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return pt(t.signals).forEach(s=>{vt(i,s.name)?s=cn(i[s.name],s):r.push(s),o[s.name]=s}),pt(e.signals).forEach(s=>{!vt(o,s.name)&&!vt(i,s.name)&&r.push(s)}),r}function Kje(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function vye(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}Kje.prototype=vye.prototype={parse(t){return Qje(t,this)},fork(){return new vye(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(e=>{e.$ref=t.id}),t.refs=null),t},proxy(t){const e=t instanceof PY?zt(t):t;return this.add($Bt({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;this.root&&(this.root.root=!0);for(t in this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(r,i,o){let s,a;r&&(s=r.data||(r.data={}),a=s[i]||(s[i]=[]),a.push(o))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(zt(this.add(m1({pulse:t})))),this._parent.push(e),this._lookup.push(n?zt(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return $n(this._parent)},encode(){return $n(this._encode)},lookup(){return $n(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if(gt(t))return UA(t,e);t.signal||je("Unsupported field reference: "+rt(t));const n=t.signal;let r=this.field[n];if(!r){const i={name:this.signalRef(n)};e&&(i.as=e),this.field[n]=r=zt(this.add(EBt(i)))}return r},compareRef(t){let e=!1;const n=o=>Co(o)?(e=!0,this.signalRef(o.signal)):fBt(o)?(e=!0,this.exprRef(o.expr)):o,r=pt(t.field).map(n),i=pt(t.order).map(n);return e?zt(this.add(rye({fields:r,orders:i}))):tye(r,i)},keyRef(t,e){let n=!1;const r=o=>Co(o)?(n=!0,zt(i[o.signal])):o,i=this.signals;return t=pt(t).map(r),n?zt(this.add(TBt({fields:t,flat:e}))):aBt(t,e)},sortRef(t){if(!t)return t;const e=o6(t.op,t.field),n=t.order||lBt;return n.signal?zt(this.add(rye({fields:e,orders:this.signalRef(n.signal)}))):tye(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},hasOwnSignal(t){return vt(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&je("Duplicate signal name: "+rt(t));const n=e instanceof PY?e:this.add(P5(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||je("Unrecognized signal name: "+rt(t)),this.signals[t]},signalRef(t){return this.signals[t]?zt(this.signals[t]):(vt(this.lambdas,t)||(this.lambdas[t]=this.add(P5(null))),zt(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e0?",":"")+(ht(i)?i.signal||bse(i):rt(i))}return n+"]"}function TUt(t){let e="{",n=0,r,i;for(r in t)i=t[r],e+=(++n>1?",":"")+rt(r)+":"+(ht(i)?i.signal||bse(i):rt(i));return e+"}"}function kUt(){const t="sans-serif",r="#4c78a8",i="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:t,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:t,fontSize:10},"guide-title":{fill:i,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:t,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function AUt(t,e,n){return ht(t)||je("Input Vega specification must be an object."),e=yO(kUt(),e,t.config),CUt(t,new Kje(e,n)).toRuntime()}var PUt="5.30.0";cn(jS,_kt,nIt,IIt,x$t,h3t,jFt,xFt,UFt,dNt,_Nt,ANt);const MUt=Object.freeze(Object.defineProperty({__proto__:null,Bounds:uo,CanvasHandler:SR,CanvasRenderer:VN,DATE:_l,DAY:qs,DAYOFYEAR:Mh,Dataflow:z_,Debug:BIe,Error:wne,EventStream:lB,Gradient:zFe,GroupItem:LB,HOURS:Cc,Handler:Uie,HybridHandler:PNe,HybridRenderer:NX,Info:jIe,Item:IB,MILLISECONDS:Vf,MINUTES:Oc,MONTH:Zs,Marks:Ec,MultiPulse:Hne,None:zIe,Operator:Lr,Parameters:aB,Pulse:jv,QUARTER:wl,RenderType:gv,Renderer:_R,ResourceLoader:HFe,SECONDS:Tu,SVGHandler:vNe,SVGRenderer:Xie,SVGStringRenderer:ANe,Scenegraph:cNe,TIME_UNITS:$ne,Transform:De,View:gje,WEEK:wo,Warn:_ne,YEAR:bs,accessor:Al,accessorFields:Ks,accessorName:Fi,array:pt,ascending:Q4,bandwidthNRD:Qne,bin:_$e,bootstrapCI:S$e,boundClip:jNe,boundContext:yR,boundItem:DX,boundMark:oNe,boundStroke:Yg,changeset:h1,clampRange:ZIe,codegenExpression:Uze,compare:Tne,constant:ra,cumulativeLogNormal:nre,cumulativeNormal:uB,cumulativeUniform:sre,dayofyear:ALe,debounce:kne,defaultLocale:Bne,definition:x$e,densityLogNormal:tre,densityNormal:Kne,densityUniform:ore,domChild:xo,domClear:qc,domCreate:hv,domFind:Bie,dotbin:C$e,error:je,expressionFunction:Ki,extend:cn,extent:kh,extentIndex:JIe,falsy:Rm,fastmap:bO,field:Ou,flush:eLe,font:jB,fontFamily:wR,fontSize:Gh,format:d3,formatLocale:bN,formats:Vne,hasOwnProperty:vt,id:eR,identity:na,inferType:l$e,inferTypes:c$e,ingest:cr,inherits:it,inrange:u_,interpolate:yie,interpolateColors:RB,interpolateRange:OFe,intersect:$Ne,intersectBoxLine:d_,intersectPath:Eie,intersectPoint:Tie,intersectRule:XFe,isArray:We,isBoolean:Vy,isDate:Nv,isFunction:fn,isIterable:tLe,isNumber:Jn,isObject:ht,isRegExp:nLe,isString:gt,isTuple:oB,key:Ane,lerp:rLe,lineHeight:cy,loader:rB,locale:s$e,logger:Sne,lruCache:iLe,markup:qie,merge:oLe,mergeConfig:yO,multiLineOffset:Nie,one:vO,pad:sLe,panLinear:HIe,panLog:qIe,panPow:XIe,panSymlog:YIe,parse:AUt,parseExpression:qoe,parseSelector:Qy,path:gB,pathCurves:Sie,pathEqual:BNe,pathParse:HS,pathRectangle:UFe,pathRender:PA,pathSymbols:BFe,pathTrail:WFe,peek:$n,point:UB,projection:hoe,quantileLogNormal:rre,quantileNormal:fB,quantileUniform:are,quantiles:Xne,quantizeInterpolator:EFe,quarter:QIe,quartiles:Yne,get random(){return ku},randomInteger:ETt,randomKDE:Jne,randomLCG:OTt,randomLogNormal:E$e,randomMixture:T$e,randomNormal:Zne,randomUniform:k$e,read:d$e,regressionConstant:lre,regressionExp:P$e,regressionLinear:cre,regressionLoess:D$e,regressionLog:A$e,regressionPoly:R$e,regressionPow:M$e,regressionQuad:ure,renderModule:WB,repeat:eT,resetDefaultLocale:_2t,resetSVGClipId:GFe,resetSVGDefIds:bDt,responseType:f$e,runtimeContext:nje,sampleCurve:hB,sampleLogNormal:ere,sampleNormal:cB,sampleUniform:ire,scale:tr,sceneEqual:Yie,sceneFromJSON:aNe,scenePickVisit:$N,sceneToJSON:sNe,sceneVisit:Gf,sceneZOrder:kie,scheme:xie,serializeXML:ONe,setHybridRendererOptions:mDt,setRandom:STt,span:tR,splitAccessPath:Wh,stringValue:rt,textMetrics:hc,timeBin:HLe,timeFloor:$Le,timeFormatLocale:_A,timeInterval:CO,timeOffset:zLe,timeSequence:ULe,timeUnitSpecifier:kLe,timeUnits:Fne,toBoolean:Pne,toDate:Mne,toNumber:Ys,toSet:Wf,toString:Rne,transform:b$e,transforms:jS,truncate:aLe,truthy:Eu,tupleid:jt,typeParsers:gX,utcFloor:FLe,utcInterval:OO,utcOffset:jLe,utcSequence:WLe,utcdayofyear:RLe,utcquarter:KIe,utcweek:DLe,version:PUt,visitArray:qm,week:PLe,writeConfig:xO,zero:rv,zoomLinear:Cne,zoomLog:One,zoomPow:hN,zoomSymlog:Ene},Symbol.toStringTag,{value:"Module"}));function RUt(t,e,n){let r;e.x2&&(e.x?(n&&t.x>t.x2&&(r=t.x,t.x=t.x2,t.x2=r),t.width=t.x2-t.x):t.x=t.x2-(t.width||0)),e.xc&&(t.x=t.xc-(t.width||0)/2),e.y2&&(e.y?(n&&t.y>t.y2&&(r=t.y,t.y=t.y2,t.y2=r),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),e.yc&&(t.y=t.yc-(t.height||0)/2)}var DUt={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},IUt={"*":(t,e)=>t*e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,">":(t,e)=>t>e,"<":(t,e)=>tt<=e,">=":(t,e)=>t>=e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"&":(t,e)=>t&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"<<":(t,e)=>t<>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e},LUt={"+":t=>+t,"-":t=>-t,"~":t=>~t,"!":t=>!t};const $Ut=Array.prototype.slice,b0=(t,e,n)=>{const r=n?n(e[0]):e[0];return r[t].apply(r,$Ut.call(e,1))},FUt=(t,e,n,r,i,o,s)=>new Date(t,e||0,n??1,r||0,i||0,o||0,s||0);var NUt={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(t,e,n)=>Math.max(e,Math.min(n,t)),now:Date.now,utc:Date.UTC,datetime:FUt,date:t=>new Date(t).getDate(),day:t=>new Date(t).getDay(),year:t=>new Date(t).getFullYear(),month:t=>new Date(t).getMonth(),hours:t=>new Date(t).getHours(),minutes:t=>new Date(t).getMinutes(),seconds:t=>new Date(t).getSeconds(),milliseconds:t=>new Date(t).getMilliseconds(),time:t=>new Date(t).getTime(),timezoneoffset:t=>new Date(t).getTimezoneOffset(),utcdate:t=>new Date(t).getUTCDate(),utcday:t=>new Date(t).getUTCDay(),utcyear:t=>new Date(t).getUTCFullYear(),utcmonth:t=>new Date(t).getUTCMonth(),utchours:t=>new Date(t).getUTCHours(),utcminutes:t=>new Date(t).getUTCMinutes(),utcseconds:t=>new Date(t).getUTCSeconds(),utcmilliseconds:t=>new Date(t).getUTCMilliseconds(),length:t=>t.length,join:function(){return b0("join",arguments)},indexof:function(){return b0("indexOf",arguments)},lastindexof:function(){return b0("lastIndexOf",arguments)},slice:function(){return b0("slice",arguments)},reverse:t=>t.slice().reverse(),parseFloat,parseInt,upper:t=>String(t).toUpperCase(),lower:t=>String(t).toLowerCase(),substring:function(){return b0("substring",arguments,String)},split:function(){return b0("split",arguments,String)},replace:function(){return b0("replace",arguments,String)},trim:t=>String(t).trim(),regexp:RegExp,test:(t,e)=>RegExp(t).test(e)};const zUt=["view","item","group","xy","x","y"],FY=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&FY.add(setImmediate);const jUt={Literal:(t,e)=>e.value,Identifier:(t,e)=>{const n=e.name;return t.memberDepth>0?n:n==="datum"?t.datum:n==="event"?t.event:n==="item"?t.item:DUt[n]||t.params["$"+n]},MemberExpression:(t,e)=>{const n=!e.computed,r=t(e.object);n&&(t.memberDepth+=1);const i=t(e.property);if(n&&(t.memberDepth-=1),FY.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(t,e)=>{const n=e.arguments;let r=e.callee.name;return r.startsWith("_")&&(r=r.slice(1)),r==="if"?t(n[0])?t(n[1]):t(n[2]):(t.fn[r]||NUt[r]).apply(t.fn,n.map(t))},ArrayExpression:(t,e)=>e.elements.map(t),BinaryExpression:(t,e)=>IUt[e.operator](t(e.left),t(e.right)),UnaryExpression:(t,e)=>LUt[e.operator](t(e.argument)),ConditionalExpression:(t,e)=>t(e.test)?t(e.consequent):t(e.alternate),LogicalExpression:(t,e)=>e.operator==="&&"?t(e.left)&&t(e.right):t(e.left)||t(e.right),ObjectExpression:(t,e)=>e.properties.reduce((n,r)=>{t.memberDepth+=1;const i=t(r.key);return t.memberDepth-=1,FY.has(t(r.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):n[i]=t(r.value),n},{})};function c2(t,e,n,r,i,o){const s=a=>jUt[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(e),s.params=n,s.datum=r,s.event=i,s.item=o,zUt.forEach(a=>s.fn[a]=function(){return i.vega[a](...arguments)}),s(t)}var BUt={operator(t,e){const n=e.ast,r=t.functions;return i=>c2(n,r,i)},parameter(t,e){const n=e.ast,r=t.functions;return(i,o)=>c2(n,r,o,i)},event(t,e){const n=e.ast,r=t.functions;return i=>c2(n,r,void 0,void 0,i)},handler(t,e){const n=e.ast,r=t.functions;return(i,o)=>{const s=o.item&&o.item.datum;return c2(n,r,i,s,o)}},encode(t,e){const{marktype:n,channels:r}=e,i=t.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const l=s.datum;let c=0,u;for(const f in r)u=c2(r[f].ast,i,a,l,void 0,s),s[f]!==u&&(s[f]=u,c=1);return n!=="rule"&&RUt(s,r,o),c}}};const UUt="vega-lite",WUt='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',VUt="5.21.0",GUt=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],HUt="https://vega.github.io/vega-lite/",qUt="Vega-Lite is a concise high-level language for interactive visualization.",XUt=["vega","chart","visualization"],YUt="build/vega-lite.js",QUt="build/vega-lite.min.js",KUt="build/vega-lite.min.js",ZUt="build/src/index",JUt="build/src/index.d.ts",e8t={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},t8t=["bin","build","src","vega-lite*","tsconfig.json"],n8t={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},r8t={type:"git",url:"https://github.com/vega/vega-lite.git"},i8t="BSD-3-Clause",o8t={url:"https://github.com/vega/vega-lite/issues"},s8t={"@babel/core":"^7.24.9","@babel/preset-env":"^7.25.0","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.12","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^7.17.0","@typescript-eslint/parser":"^7.17.0",ajv:"^8.17.1","ajv-formats":"^3.0.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^5.0.0",d3:"^7.9.0","del-cli":"^5.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.9.0","eslint-plugin-prettier":"^5.2.1","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.10.0",jest:"^29.7.0","jest-dev-server":"^10.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.3.3",puppeteer:"^15.0.0","release-it":"17.6.0",rollup:"^4.19.1","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.3",terser:"^5.31.3","ts-jest":"^29.2.3","ts-json-schema-generator":"^2.3.0",typescript:"~5.5.4","vega-cli":"^5.28.0","vega-datasets":"^2.8.1","vega-embed":"^6.26.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},a8t={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.3","vega-event-selector":"~3.0.1","vega-expression":"~5.1.1","vega-util":"~1.17.2",yargs:"~17.7.2"},l8t={vega:"^5.24.0"},c8t={node:">=18"},u8t="yarn@1.22.19",f8t={name:UUt,author:WUt,version:VUt,collaborators:GUt,homepage:HUt,description:qUt,keywords:XUt,main:YUt,unpkg:QUt,jsdelivr:KUt,module:ZUt,types:JUt,bin:e8t,files:t8t,scripts:n8t,repository:r8t,license:i8t,bugs:o8t,devDependencies:s8t,dependencies:a8t,peerDependencies:l8t,engines:c8t,packageManager:u8t};function wse(t){return Ke(t,"or")}function _se(t){return Ke(t,"and")}function Sse(t){return Ke(t,"not")}function $3(t,e){if(Sse(t))$3(t.not,e);else if(_se(t))for(const n of t.and)$3(n,e);else if(wse(t))for(const n of t.or)$3(n,e);else e(t)}function V_(t,e){return Sse(t)?{not:V_(t.not,e)}:_se(t)?{and:t.and.map(n=>V_(n,e))}:wse(t)?{or:t.or.map(n=>V_(n,e))}:e(t)}const Kt=structuredClone;function Zje(t){throw new Error(t)}function tC(t,e){const n={};for(const r of e)vt(t,r)&&(n[r]=t[r]);return n}function pl(t,e){const n={...t};for(const r of e)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(t=>kr(t)).join(",")})`};function Mn(t){if(Jn(t))return t;const e=gt(t)?t:kr(t);if(e.length<250)return e;let n=0;for(let r=0;ra===0?s:`[${s}]`),o=i.map((s,a)=>i.slice(0,a+1).join(""));for(const s of o)e.add(s)}return e}function Ese(t,e){return t===void 0||e===void 0?!0:Ose(zY(t),zY(e))}function Tr(t){return Qe(t).length===0}const Qe=Object.keys,ws=Object.values,hy=Object.entries;function GA(t){return t===!0||t===!1}function gi(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function gk(t,e){return Sse(t)?`!(${gk(t.not,e)})`:_se(t)?`(${t.and.map(n=>gk(n,e)).join(") && (")})`:wse(t)?`(${t.or.map(n=>gk(n,e)).join(") || (")})`:e(t)}function M5(t,e){if(e.length===0)return!0;const n=e.shift();return n in t&&M5(t[n],e)&&delete t[n],Tr(t)}function IR(t){return t.charAt(0).toUpperCase()+t.substr(1)}function Tse(t,e="datum"){const n=Wh(t),r=[];for(let i=1;i<=n.length;i++){const o=`[${n.slice(0,i).map(rt).join("][")}]`;r.push(`${e}${o}`)}return r.join(" && ")}function t4e(t,e="datum"){return`${e}[${rt(Wh(t).join("."))}]`}function p8t(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Pu(t){return`${Wh(t).map(p8t).join("\\.")}`}function Ob(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function IO(t){return`${Wh(t).join(".")}`}function rC(t){return t?Wh(t).length:0}function qi(...t){return t.find(e=>e!==void 0)}let n4e=42;function r4e(t){const e=++n4e;return t?String(t)+e:e}function g8t(){n4e=42}function i4e(t){return o4e(t)?t:`__${t}`}function o4e(t){return t.startsWith("__")}function HA(t){if(t!==void 0)return(t%360+360)%360}function d6(t){return Jn(t)?!0:!isNaN(t)&&!isNaN(parseFloat(t))}const yye=Object.getPrototypeOf(structuredClone({}));function sc(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor.name!==e.constructor.name)return!1;let n,r;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!sc(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const o of t.entries())if(!e.has(o[0]))return!1;for(const o of t.entries())if(!sc(o[1],e.get(o[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t.entries())if(!e.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&t.valueOf!==yye.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&t.toString!==yye.toString)return t.toString()===e.toString();const i=Object.keys(t);if(n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!sc(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function kr(t){const e=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;ib6(t[e])?gi(`_${e}_${hy(t[e])}`):gi(`_${e}_${t[e]}`)).join("")}function qr(t){return t===!0||b1(t)&&!t.binned}function rs(t){return t==="binned"||b1(t)&&t.binned===!0}function b1(t){return ht(t)}function b6(t){return Ke(t,"param")}function xye(t){switch(t){case fg:case dg:case Jg:case Cl:case Qh:case Kh:case e0:case em:case Zy:case Jy:case Ol:return 6;case t0:return 4;default:return 10}}function NR(t){return Ke(t,"expr")}function os(t,{level:e}={level:0}){const n=Qe(t||{}),r={};for(const i of n)r[i]=e===0?tc(t[i]):os(t[i],{level:e-1});return r}function x4e(t){const{anchor:e,frame:n,offset:r,orient:i,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:c,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=t,m={...g,...a?{fill:a}:{}},v={...e?{anchor:e}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},y={...l?{subtitleColor:l}:{},...c?{subtitleFont:c}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},x=tC(t,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:x,nonMarkTitleProperties:v,subtitle:y}}function Km(t){return gt(t)||We(t)&>(t[0])}function Rt(t){return Ke(t,"signal")}function w1(t){return Ke(t,"step")}function z8t(t){return We(t)?!1:Ke(t,"fields")&&!Ke(t,"data")}function j8t(t){return We(t)?!1:Ke(t,"fields")&&Ke(t,"data")}function eg(t){return We(t)?!1:Ke(t,"field")&&Ke(t,"data")}const B8t={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},U8t=Qe(B8t),W8t={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},jY=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function b4e(t){const e=We(t.condition)?t.condition.map(bye):bye(t.condition);return{...tc(t),condition:e}}function tc(t){if(NR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function bye(t){if(NR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function ni(t){if(NR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return Rt(t)?t:t!==void 0?{value:t}:void 0}function V8t(t){return Rt(t)?t.signal:rt(t)}function wye(t){return Rt(t)?t.signal:rt(t.value)}function Ef(t){return Rt(t)?t.signal:t==null?null:rt(t)}function G8t(t,e,n){for(const r of n){const i=Ih(r,e.markDef,e.config);i!==void 0&&(t[r]=ni(i))}return t}function w4e(t){return[].concat(t.type,t.style??[])}function Er(t,e,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&Ke(e,i)?e[i]:e[t]!==void 0?e[t]:o&&(!i||i===t)?void 0:Ih(t,e,n,r)}function Ih(t,e,n,{vgChannel:r}={}){const i=BY(t,e,n.style);return qi(r?i:void 0,i,r?n[e.type][r]:void 0,n[e.type][t],r?n.mark[r]:n.mark[t])}function BY(t,e,n){return _4e(t,w4e(e),n)}function _4e(t,e,n){e=pt(e);let r;for(const i of e){const o=n[i];Ke(o,t)&&(r=o[t])}return r}function S4e(t,e){return pt(t).reduce((n,r)=>(n.field.push(ct(r,e)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function C4e(t,e){const n=[...t];return e.forEach(r=>{for(const i of n)if(sc(i,r))return;n.push(r)}),n}function O4e(t,e){return sc(t,e)||!e?t:t?[...pt(t),...pt(e)].join(", "):e}function E4e(t,e){const n=t.value,r=e.value;if(n==null||r===null)return{explicit:t.explicit,value:null};if((Km(n)||Rt(n))&&(Km(r)||Rt(r)))return{explicit:t.explicit,value:O4e(n,r)};if(Km(n)||Rt(n))return{explicit:t.explicit,value:n};if(Km(r)||Rt(r))return{explicit:t.explicit,value:r};if(!Km(n)&&!Rt(n)&&!Km(r)&&!Rt(r))return{explicit:t.explicit,value:C4e(n,r)};throw new Error("It should never reach here")}function Fse(t){return`Invalid specification ${kr(t)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const H8t='Autosize "fit" only works for single views and layered views.';function _ye(t){return`${t=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function Sye(t){const e=t=="width"?"Width":"Height",n=t=="width"?"x":"y";return`${e} "container" only works well with autosize "fit" or "fit-${n}".`}function Cye(t){return t?`Dropping "fit-${t}" because spec has discrete ${El(t)}.`:'Dropping "fit" because spec has discrete size.'}function Nse(t){return`Unknown field for ${t}. Cannot calculate view size.`}function Oye(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function q8t(t,e){return`Cannot project a selection on encoding channel "${t}" as it uses an aggregate function ("${e}").`}function X8t(t){return`The "nearest" transform is not supported for ${t} marks.`}function T4e(t){return`Selection not supported for ${t} yet.`}function Y8t(t){return`Cannot find a selection named "${t}".`}const Q8t="Scale bindings are currently only supported for scales with unbinned, continuous domains.",K8t="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Z8t="Legend bindings are only supported for selections over an individual field or encoding channel.";function J8t(t){return`Lookups can only be performed on selection parameters. "${t}" is a variable parameter.`}function eWt(t){return`Cannot define and lookup the "${t}" selection in the same view. Try moving the lookup into a second, layered view?`}const tWt="The same selection must be used to override scale domains in a layered view.",nWt='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function rWt(t){return`Unknown repeated value "${t}".`}function Eye(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}const iWt="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function oWt(t){return`Unrecognized parse "${t}".`}function Tye(t,e,n){return`An ancestor parsed field "${t}" as ${n} but a child wants to parse the field as ${e}.`}const sWt="Attempt to add the same child twice.";function aWt(t){return`Ignoring an invalid transform: ${kr(t)}.`}const lWt='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function kye(t){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${t} are dropped.`}function cWt(t){const{parentProjection:e,projection:n}=t;return`Layer's shared projection ${kr(e)} is overridden by a child projection ${kr(n)}.`}const uWt="Arc marks uses theta channel rather than angle, replacing angle with theta.";function fWt(t){return`${t}Offset dropped because ${t} is continuous`}function dWt(t,e,n){return`Channel ${t} is a ${e}. Converted to {value: ${kr(n)}}.`}function k4e(t){return`Invalid field type "${t}".`}function hWt(t,e){return`Invalid field type "${t}" for aggregate: "${e}", using "quantitative" instead.`}function pWt(t){return`Invalid aggregation operator "${t}".`}function A4e(t,e){const{fill:n,stroke:r}=e;return`Dropping color ${t} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function gWt(t){return`Position range does not support relative band size for ${t}.`}function UY(t,e){return`Dropping ${kr(t)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`}const mWt="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function w6(t,e,n){return`${t} dropped as it is incompatible with "${e}".`}function vWt(t){return`${t}-encoding is dropped as ${t} is not a valid encoding channel.`}function yWt(t){return`${t} encoding should be discrete (ordinal / nominal / binned).`}function xWt(t){return`${t} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function bWt(t){return`Facet encoding dropped as ${t.join(" and ")} ${t.length>1?"are":"is"} also specified.`}function GV(t,e){return`Using discrete channel "${t}" to encode "${e}" field can be misleading as it does not encode ${e==="ordinal"?"order":"magnitude"}.`}function wWt(t){return`The ${t} for range marks cannot be an expression`}function _Wt(t,e){return`Line mark is for continuous lines and thus cannot be used with ${t&&e?"x2 and y2":t?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function SWt(t,e){return`Specified orient "${t}" overridden with "${e}".`}function CWt(t){return`Cannot use the scale property "${t}" with non-color channel.`}function OWt(t){return`Cannot use the relative band size with ${t} scale.`}function EWt(t){return`Using unaggregated domain with raw field has no effect (${kr(t)}).`}function TWt(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function kWt(t){return`Unaggregated domain is currently unsupported for log scale (${kr(t)}).`}function AWt(t){return`Cannot apply size to non-oriented mark "${t}".`}function PWt(t,e,n){return`Channel "${t}" does not work with "${e}" scale. We are using "${n}" scale instead.`}function MWt(t,e){return`FieldDef does not work with "${t}" scale. We are using "${e}" scale instead.`}function P4e(t,e,n){return`${n}-scale's "${e}" is dropped as it does not work with ${t} scale.`}function M4e(t){return`The step for "${t}" is dropped because the ${t==="width"?"x":"y"} is continuous.`}function RWt(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${kr(n)} and ${kr(r)}). Using ${kr(n)}.`}function DWt(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${kr(n)} and ${kr(r)}). Using the union of the two domains.`}function IWt(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}function LWt(t){return`Dropping sort property ${kr(t)} as unioned domains only support boolean or op "count", "min", and "max".`}const Aye="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",$Wt="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",FWt="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",NWt="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function zWt(t){return`Cannot stack "${t}" if there is already "${t}2".`}function jWt(t){return`Stack is applied to a non-linear scale (${t}).`}function BWt(t){return`Stacking is applied even though the aggregate function is non-summative ("${t}").`}function R5(t,e){return`Invalid ${t}: ${kr(e)}.`}function UWt(t){return`Dropping day from datetime ${kr(t)} as day cannot be combined with other units.`}function WWt(t,e){return`${e?"extent ":""}${e&&t?"and ":""}${t?"center ":""}${e&&t?"are ":"is "}not needed when data are aggregated.`}function VWt(t,e,n){return`${t} is not usually used with ${e} for ${n}.`}function GWt(t,e){return`Continuous axis should not have customized aggregation function ${t}; ${e} already agregates the axis.`}function Pye(t){return`1D error band does not support ${t}.`}function R4e(t){return`Channel ${t} is required for "binned" bin.`}function HWt(t){return`Channel ${t} should not be used with "binned" bin.`}function qWt(t){return`Domain for ${t} is required for threshold scale.`}const D4e=Sne(_ne);let oC=D4e;function XWt(t){return oC=t,oC}function YWt(){return oC=D4e,oC}function Ze(...t){oC.warn(...t)}function QWt(...t){oC.debug(...t)}function _1(t){if(t&&ht(t)){for(const e of jse)if(Ke(t,e))return!0}return!1}const I4e=["january","february","march","april","may","june","july","august","september","october","november","december"],KWt=I4e.map(t=>t.substr(0,3)),L4e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],ZWt=L4e.map(t=>t.substr(0,3));function JWt(t){if(d6(t)&&(t=+t),Jn(t))return t>4&&Ze(R5("quarter",t)),t-1;throw new Error(R5("quarter",t))}function eVt(t){if(d6(t)&&(t=+t),Jn(t))return t-1;{const e=t.toLowerCase(),n=I4e.indexOf(e);if(n!==-1)return n;const r=e.substr(0,3),i=KWt.indexOf(r);if(i!==-1)return i;throw new Error(R5("month",t))}}function tVt(t){if(d6(t)&&(t=+t),Jn(t))return t%7;{const e=t.toLowerCase(),n=L4e.indexOf(e);if(n!==-1)return n;const r=e.substr(0,3),i=ZWt.indexOf(r);if(i!==-1)return i;throw new Error(R5("day",t))}}function zse(t,e){const n=[];if(e&&t.day!==void 0&&Qe(t).length>1&&(Ze(UWt(t)),t=Kt(t),delete t.day),t.year!==void 0?n.push(t.year):n.push(2012),t.month!==void 0){const r=e?eVt(t.month):t.month;n.push(r)}else if(t.quarter!==void 0){const r=e?JWt(t.quarter):t.quarter;n.push(Jn(r)?r*3:`${r}*3`)}else n.push(0);if(t.date!==void 0)n.push(t.date);else if(t.day!==void 0){const r=e?tVt(t.day):t.day;n.push(Jn(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const i=t[r];n.push(typeof i>"u"?0:i)}return n}function Tb(t){const n=zse(t,!0).join(", ");return t.utc?`utc(${n})`:`datetime(${n})`}function nVt(t){const n=zse(t,!1).join(", ");return t.utc?`utc(${n})`:`datetime(${n})`}function rVt(t){const e=zse(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}const $4e={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},jse=Qe($4e);function iVt(t){return vt($4e,t)}function S1(t){return ht(t)?t.binned:F4e(t)}function F4e(t){return t&&t.startsWith("binned")}function Bse(t){return t.startsWith("utc")}function oVt(t){return t.substring(3)}const sVt={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function _6(t){return jse.filter(e=>z4e(t,e))}function N4e(t){const e=_6(t);return e[e.length-1]}function z4e(t,e){const n=t.indexOf(e);return!(n<0||n>0&&e==="seconds"&&t.charAt(n-1)==="i"||t.length>n+3&&e==="day"&&t.charAt(n+3)==="o"||n>0&&e==="year"&&t.charAt(n-1)==="f")}function aVt(t,e,{end:n}={end:!1}){const r=Tse(e),i=Bse(t)?"utc":"";function o(l){return l==="quarter"?`(${i}quarter(${r})-1)`:`${i}${l}(${r})`}let s;const a={};for(const l of jse)z4e(t,l)&&(a[l]=o(l),s=l);return n&&(a[s]+="+1"),nVt(a)}function j4e(t){if(!t)return;const e=_6(t);return`timeUnitSpecifier(${kr(e)}, ${kr(sVt)})`}function lVt(t,e,n){if(!t)return;const r=j4e(t);return`${n||Bse(t)?"utc":"time"}Format(${e}, ${r})`}function Vo(t){if(!t)return;let e;return gt(t)?F4e(t)?e={unit:t.substring(6),binned:!0}:e={unit:t}:ht(t)&&(e={...t,...t.unit?{unit:t.unit}:{}}),Bse(e.unit)&&(e.utc=!0,e.unit=oVt(e.unit)),e}function cVt(t){const{utc:e,...n}=Vo(t);return n.unit?(e?"utc":"")+Qe(n).map(r=>gi(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):(e?"utc":"")+"timeunit"+Qe(n).map(r=>gi(`_${r}_${n[r]}`)).join("")}function B4e(t,e=n=>n){const n=Vo(t),r=N4e(n.unit);if(r&&r!=="day"){const i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=U4e(r,n.step),a={...i,[s]:+i[s]+o};return`${e(Tb(a))} - ${e(Tb(i))}`}}const uVt={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function fVt(t){return vt(uVt,t)}function U4e(t,e=1){if(fVt(t))return{part:t,step:e};switch(t){case"day":case"dayofyear":return{part:"date",step:e};case"quarter":return{part:"month",step:e*3};case"week":return{part:"date",step:e*7}}}function dVt(t){return Ke(t,"param")}function Use(t){return!!(t!=null&&t.field)&&t.equal!==void 0}function Wse(t){return!!(t!=null&&t.field)&&t.lt!==void 0}function Vse(t){return!!(t!=null&&t.field)&&t.lte!==void 0}function Gse(t){return!!(t!=null&&t.field)&&t.gt!==void 0}function Hse(t){return!!(t!=null&&t.field)&&t.gte!==void 0}function qse(t){if(t!=null&&t.field){if(We(t.range)&&t.range.length===2)return!0;if(Rt(t.range))return!0}return!1}function Xse(t){return!!(t!=null&&t.field)&&(We(t.oneOf)||We(t.in))}function hVt(t){return!!(t!=null&&t.field)&&t.valid!==void 0}function W4e(t){return Xse(t)||Use(t)||qse(t)||Wse(t)||Gse(t)||Vse(t)||Hse(t)}function _d(t,e){return R6(t,{timeUnit:e,wrapTime:!0})}function pVt(t,e){return t.map(n=>_d(n,e))}function V4e(t,e=!0){const{field:n}=t,r=Vo(t.timeUnit),{unit:i,binned:o}=r||{},s=ct(t,{expr:"datum"}),a=i?`time(${o?s:aVt(i,n)})`:s;if(Use(t))return`${a}===${_d(t.equal,i)}`;if(Wse(t)){const l=t.lt;return`${a}<${_d(l,i)}`}else if(Gse(t)){const l=t.gt;return`${a}>${_d(l,i)}`}else if(Vse(t)){const l=t.lte;return`${a}<=${_d(l,i)}`}else if(Hse(t)){const l=t.gte;return`${a}>=${_d(l,i)}`}else{if(Xse(t))return`indexof([${pVt(t.oneOf,i).join(",")}], ${a}) !== -1`;if(hVt(t))return S6(a,t.valid);if(qse(t)){const{range:l}=os(t),c=Rt(l)?{signal:`${l.signal}[0]`}:l[0],u=Rt(l)?{signal:`${l.signal}[1]`}:l[1];if(c!==null&&u!==null&&e)return"inrange("+a+", ["+_d(c,i)+", "+_d(u,i)+"])";const f=[];return c!==null&&f.push(`${a} >= ${_d(c,i)}`),u!==null&&f.push(`${a} <= ${_d(u,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${kr(t)}`)}function S6(t,e=!0){return e?`isValid(${t}) && isFinite(+${t})`:`!isValid(${t}) || !isFinite(+${t})`}function gVt(t){return W4e(t)&&t.timeUnit?{...t,timeUnit:Vo(t.timeUnit)}:t}const zR={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function mVt(t){return t==="quantitative"||t==="temporal"}function G4e(t){return t==="ordinal"||t==="nominal"}const kb=zR.quantitative,Yse=zR.ordinal,sC=zR.temporal,Qse=zR.nominal,$O=zR.geojson;function vVt(t){if(t)switch(t=t.toLowerCase(),t){case"q":case kb:return"quantitative";case"t":case sC:return"temporal";case"o":case Yse:return"ordinal";case"n":case Qse:return"nominal";case $O:return"geojson"}}const ss={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},WY={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function yVt(t,e){const n=WY[t],r=WY[e];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}const xVt={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function Mye(t){return xVt[t]}const H4e=new Set(["linear","log","pow","sqrt","symlog"]),q4e=new Set([...H4e,"time","utc"]);function X4e(t){return H4e.has(t)}const Y4e=new Set(["quantile","quantize","threshold"]),bVt=new Set([...q4e,...Y4e,"sequential","identity"]),wVt=new Set(["ordinal","bin-ordinal","point","band"]);function Go(t){return wVt.has(t)}function Hf(t){return bVt.has(t)}function eh(t){return q4e.has(t)}function aC(t){return Y4e.has(t)}const _Vt={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function SVt(t){return!gt(t)&&Ke(t,"name")}function Q4e(t){return Ke(t,"param")}function CVt(t){return Ke(t,"unionWith")}function OVt(t){return ht(t)&&"field"in t}const EVt={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:MYn,domain:RYn,range:DYn,rangeMax:IYn,rangeMin:LYn,scheme:$Yn,...TVt}=EVt,kVt=Qe(TVt);function VY(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(t);case"bins":return!["point","band","identity","ordinal"].includes(t);case"round":return eh(t)||t==="band"||t==="point";case"padding":case"rangeMin":case"rangeMax":return eh(t)||["point","band"].includes(t);case"paddingOuter":case"align":return["point","band"].includes(t);case"paddingInner":return t==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return eh(t);case"nice":return eh(t)||t==="quantize"||t==="threshold";case"exponent":return t==="pow";case"base":return t==="log";case"constant":return t==="symlog";case"zero":return Hf(t)&&!En(["log","time","utc","threshold","quantile"],t)}}function K4e(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return G_(t)?void 0:CWt(e);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function AVt(t,e){return En([Yse,Qse],e)?t===void 0||Go(t):e===sC?En([ss.TIME,ss.UTC,void 0],t):e===kb?X4e(t)||aC(t)||t===void 0:!0}function PVt(t,e,n=!1){if(!Jh(t))return!1;switch(t){case xi:case Qo:case Ky:case LO:case zu:case ad:return eh(e)||e==="band"?!0:e==="point"?!n:!1;case Jg:case e0:case em:case Zy:case Jy:case y1:return eh(e)||aC(e)||En(["band","point","ordinal"],e);case Cl:case Qh:case Kh:return e!=="band";case t0:case Ol:return e==="ordinal"||aC(e)}}function MVt(t){return ht(t)&&"value"in t}const Ba={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},Z4e=Ba.arc,C6=Ba.area,O6=Ba.bar,RVt=Ba.image,E6=Ba.line,T6=Ba.point,DVt=Ba.rect,D5=Ba.rule,J4e=Ba.text,Kse=Ba.tick,IVt=Ba.trail,Zse=Ba.circle,Jse=Ba.square,eBe=Ba.geoshape;function r0(t){return["line","area","trail"].includes(t)}function qA(t){return["rect","bar","image","arc","tick"].includes(t)}const LVt=new Set(Qe(Ba));function Lh(t){return Ke(t,"type")}const $Vt=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],FVt=["fill","fillOpacity"],NVt=[...$Vt,...FVt],zVt={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},Rye=Qe(zVt),HV=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],jVt={area:["line","point"],bar:HV,rect:HV,line:["point"],tick:["bandSize","thickness",...HV]},BVt={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},UVt={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},tBe=Qe(UVt);function Ab(t){return Ke(t,"band")}const WVt={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},VVt=5,eae={binSpacing:0,continuousBandSize:VVt,minBandSize:.25,timeUnitBandPosition:.5},GVt={...eae,binSpacing:1},HVt={...eae,thickness:1};function qVt(t){return Lh(t)?t.type:t}function nBe(t,{isPath:e}){return t===void 0||t==="break-paths-show-path-domains"?e?"break-paths-show-domains":"filter":t===null?"show":t}function tae({markDef:t,config:e,scaleChannel:n,scaleType:r,isCountAggregate:i}){var a,l;if(!r||!Hf(r)||i)return"always-valid";const o=nBe(Er("invalid",t,e),{isPath:r0(t.type)});return((l=(a=e.scale)==null?void 0:a.invalid)==null?void 0:l[n])!==void 0?"show":o}function XVt(t){return t==="break-paths-filter-domains"||t==="break-paths-show-domains"}function rBe({scaleName:t,scale:e,mode:n}){const r=`domain('${t}')`;if(!e||!t)return;const i=`${r}[0]`,o=`peek(${r})`,s=e.domainHasZero();return s==="definitely"?{scale:t,value:0}:s==="maybe"?{signal:`scale('${t}', inrange(0, ${r}) ? 0 : ${n==="zeroOrMin"?i:o})`}:{signal:`scale('${t}', ${n==="zeroOrMin"?i:o})`}}function iBe({scaleChannel:t,channelDef:e,scale:n,scaleName:r,markDef:i,config:o}){var u;const s=n==null?void 0:n.get("type"),a=Xf(e),l=x6(a==null?void 0:a.aggregate),c=tae({scaleChannel:t,markDef:i,config:o,scaleType:s,isCountAggregate:l});if(a&&c==="show"){const f=((u=o.scale.invalid)==null?void 0:u[t])??"zero-or-min";return{test:S6(ct(a,{expr:"datum"}),!1),...YVt(f,n,r)}}}function YVt(t,e,n){if(MVt(t)){const{value:r}=t;return Rt(r)?{signal:r.signal}:{value:r}}return rBe({scale:e,scaleName:n,mode:"zeroOrMin"})}function nae(t){const{channel:e,channelDef:n,markDef:r,scale:i,scaleName:o,config:s}=t,a=x1(e),l=rae(t),c=iBe({scaleChannel:a,channelDef:n,scale:i,scaleName:o,markDef:r,config:s});return c!==void 0?[c,l]:l}function QVt(t){const{datum:e}=t;return _1(e)?Tb(e):`${kr(e)}`}function Wx(t,e,n,r){const i={};if(e&&(i.scale=e),ep(t)){const{datum:o}=t;_1(o)?i.signal=Tb(o):Rt(o)?i.signal=o.signal:NR(o)?i.signal=o.expr:i.value=o}else i.field=ct(t,n);if(r){const{offset:o,band:s}=r;o&&(i.offset=o),s&&(i.band=s)}return i}function I5({scaleName:t,fieldOrDatumDef:e,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:s=.5}){const a=!Rt(s)&&0{switch(e.fieldTitle){case"plain":return t.field;case"functional":return f9t(t);default:return u9t(t,e)}};let vBe=mBe;function yBe(t){vBe=t}function d9t(){yBe(mBe)}function H_(t,e,{allowDisabling:n,includeDefault:r=!0}){var a;const i=(a=aae(t))==null?void 0:a.title;if(!Je(t))return i??t.title;const o=t,s=r?lae(o,e):void 0;return n?qi(i,o.title,s):i??o.title??s}function aae(t){if(cC(t)&&t.axis)return t.axis;if(pBe(t)&&t.legend)return t.legend;if(oae(t)&&t.header)return t.header}function lae(t,e){return vBe(t,e)}function F5(t){if(gBe(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}else{const e=aae(t)??{},{format:n,formatType:r}=e;return{format:n,formatType:r}}}function h9t(t,e){var o;switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(sae(t)&&We(t.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=t;if(i)return"temporal";if(r||n&&!n0(n)&&!zg(n))return"quantitative";if(C1(t)&&((o=t.scale)!=null&&o.type))switch(WY[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Xf(t){if(Je(t))return t;if(P6(t))return t.condition}function _o(t){if(en(t))return t;if(WR(t))return t.condition}function xBe(t,e,n,r={}){if(gt(t)||Jn(t)||Vy(t)){const i=gt(t)?"string":Jn(t)?"number":"boolean";return Ze(dWt(e,i,t)),{value:t}}return en(t)?N5(t,e,n,r):WR(t)?{...t,condition:N5(t.condition,e,n,r)}:t}function N5(t,e,n,r){if(gBe(t)){const{format:i,formatType:o,...s}=t;if(Pb(o)&&!n.customFormatTypes)return Ze(kye(e)),N5(s,e,n,r)}else{const i=cC(t)?"axis":pBe(t)?"legend":oae(t)?"header":null;if(i&&t[i]){const{format:o,formatType:s,...a}=t[i];if(Pb(s)&&!n.customFormatTypes)return Ze(kye(e)),N5({...t,[i]:a},e,n,r)}}return Je(t)?cae(t,e,r):p9t(t)}function p9t(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=Jn(n)?"quantitative":gt(n)?"nominal":_1(n)?"temporal":void 0,{...t,type:e}}function cae(t,e,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:s}=t,a={...t};if(!n&&r&&!$se(r)&&!n0(r)&&!zg(r)&&(Ze(pWt(r)),delete a.aggregate),i&&(a.timeUnit=Vo(i)),s&&(a.field=`${s}`),qr(o)&&(a.bin=M6(o,e)),rs(o)&&!Xi(e)&&Ze(HWt(e)),Ra(a)){const{type:l}=a,c=vVt(l);l!==c&&(a.type=c),l!=="quantitative"&&x6(r)&&(Ze(hWt(l,r)),a.type="quantitative")}else if(!d4e(e)){const l=h9t(a,e);a.type=l}if(Ra(a)){const{compatible:l,warning:c}=g9t(a,e)||{};l===!1&&Ze(c)}if(sae(a)&>(a.sort)){const{sort:l}=a;if(Iye(l))return{...a,sort:{encoding:l}};const c=l.substring(1);if(l.charAt(0)==="-"&&Iye(c))return{...a,sort:{encoding:c,order:"descending"}}}if(oae(a)){const{header:l}=a;if(l){const{orient:c,...u}=l;if(c)return{...a,header:{...u,labelOrient:l.labelOrient||c,titleOrient:l.titleOrient||c}}}}return a}function M6(t,e){return Vy(t)?{maxbins:xye(e)}:t==="binned"?{binned:!0}:!t.maxbins&&!t.step?{...t,maxbins:xye(e)}:t}const sw={compatible:!0};function g9t(t,e){const n=t.type;if(n==="geojson"&&e!=="shape")return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case fg:case dg:case h6:return $5(t)?sw:{compatible:!1,warning:yWt(e)};case xi:case Qo:case Ky:case LO:case Cl:case Qh:case Kh:case LR:case $R:case p6:case Eb:case g6:case m6:case y1:case zu:case ad:case v6:return sw;case cd:case Mu:case ld:case ud:return n!==kb?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${t.type} field.`}:sw;case em:case Zy:case Jy:case e0:case Jg:case Zg:case Kg:case sd:case Yh:return n==="nominal"&&!t.sort?{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`}:sw;case Ol:case t0:return!$5(t)&&!l9t(t)?{compatible:!1,warning:xWt(e)}:sw;case iC:return t.type==="nominal"&&!("sort"in t)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:sw}}function uC(t){const{formatType:e}=F5(t);return e==="time"||!e&&m9t(t)}function m9t(t){return t&&(t.type==="temporal"||Je(t)&&!!t.timeUnit)}function R6(t,{timeUnit:e,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var l;const o=e&&((l=Vo(e))==null?void 0:l.unit);let s=o||n==="temporal",a;return NR(t)?a=t.expr:Rt(t)?a=t.signal:_1(t)?(s=!0,a=Tb(t)):(gt(t)||Jn(t))&&s&&(a=`datetime(${kr(t)})`,iVt(o)&&(Jn(t)&&t<1e4||gt(t)&&isNaN(Date.parse(t)))&&(a=Tb({[o]:t}))),a?r&&s?`time(${a})`:a:i?void 0:kr(t)}function bBe(t,e){const{type:n}=t;return e.map(r=>{const i=Je(t)&&!S1(t.timeUnit)?t.timeUnit:void 0,o=R6(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function VR(t,e){return qr(t.bin)?Jh(e)&&["ordinal","nominal"].includes(t.type):(console.warn("Only call this method for binned field defs."),!1)}const Fye={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function GR(t){return t==null?void 0:t.condition}const wBe=["domain","grid","labels","ticks","title"],v9t={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},_Be={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},y9t={..._Be,style:1,labelExpr:1,encoding:1};function Nye(t){return vt(y9t,t)}const x9t={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},SBe=Qe(x9t);function nm(t){return Ke(t,"mark")}class D6{constructor(e,n){this.name=e,this.run=n}hasMatchingType(e){return nm(e)?qVt(e.mark)===this.name:!1}}function Vx(t,e){const n=t&&t[e];return n?We(n)?nC(n,r=>!!r.field):Je(n)||P6(n):!1}function CBe(t,e){const n=t&&t[e];return n?We(n)?nC(n,r=>!!r.field):Je(n)||ep(n)||WR(n):!1}function OBe(t,e){if(Xi(e)){const n=t[e];if((Je(n)||ep(n))&&(G4e(n.type)||Je(n)&&n.timeUnit)){const r=Mse(e);return CBe(t,r)}}return!1}function EBe(t){return nC(y8t,e=>{if(Vx(t,e)){const n=t[e];if(We(n))return nC(n,r=>!!r.aggregate);{const r=Xf(n);return r&&!!r.aggregate}}return!1})}function TBe(t,e){const n=[],r=[],i=[],o=[],s={};return uae(t,(a,l)=>{if(Je(a)){const{field:c,aggregate:u,bin:f,timeUnit:d,...h}=a;if(u||d||f){const p=aae(a),g=p==null?void 0:p.title;let m=ct(a,{forAs:!0});const v={...g?[]:{title:H_(a,e,{allowDisabling:!0})},...h,field:m};if(u){let y;if(n0(u)?(y="argmax",m=ct({op:"argmax",field:u.argmax},{forAs:!0}),v.field=`${m}.${c}`):zg(u)?(y="argmin",m=ct({op:"argmin",field:u.argmin},{forAs:!0}),v.field=`${m}.${c}`):u!=="boxplot"&&u!=="errorbar"&&u!=="errorband"&&(y=u),y){const x={op:y,as:m};c&&(x.field=c),o.push(x)}}else if(n.push(m),Ra(a)&&qr(f)){if(r.push({bin:f,field:c,as:m}),n.push(ct(a,{binSuffix:"end"})),VR(a,l)&&n.push(ct(a,{binSuffix:"range"})),Xi(l)){const y={field:`${m}_end`};s[`${l}2`]=y}v.bin="binned",d4e(l)||(v.type=kb)}else if(d&&!S1(d)){i.push({timeUnit:d,field:c,as:m});const y=Ra(a)&&a.type!==sC&&"time";y&&(l===LR||l===Eb?v.formatType=y:k8t(l)?v.legend={formatType:y,...v.legend}:Xi(l)&&(v.axis={formatType:y,...v.axis}))}s[l]=v}else n.push(c),s[l]=t[l]}else s[l]=t[l]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:s}}function b9t(t,e,n){const r=P8t(e,n);if(r){if(r==="binned"){const i=t[e===sd?xi:Qo];return!!(Je(i)&&Je(t[e])&&rs(i.bin))}}else return!1;return!0}function w9t(t,e,n,r){const i={};for(const o of Qe(t))f4e(o)||Ze(vWt(o));for(let o of C8t){if(!t[o])continue;const s=t[o];if(FR(o)){const a=S8t(o),l=i[a];if(Je(l)&&mVt(l.type)&&Je(s)&&!l.timeUnit){Ze(fWt(a));continue}}if(o==="angle"&&e==="arc"&&!t.theta&&(Ze(uWt),o=zu),!b9t(t,o,e)){Ze(w6(o,e));continue}if(o===Jg&&e==="line"){const a=Xf(t[o]);if(a!=null&&a.aggregate){Ze(mWt);continue}}if(o===Cl&&(n?"fill"in t:"stroke"in t)){Ze(A4e("encoding",{fill:"fill"in t,stroke:"stroke"in t}));continue}if(o===$R||o===iC&&!We(s)&&!qf(s)||o===Eb&&We(s)){if(s){if(o===iC){const a=t[o];if(hBe(a)){i[o]=a;continue}}i[o]=pt(s).reduce((a,l)=>(Je(l)?a.push(cae(l,o)):Ze(UY(l,o)),a),[])}}else{if(o===Eb&&s===null)i[o]=null;else if(!Je(s)&&!ep(s)&&!qf(s)&&!UR(s)&&!Rt(s)){Ze(UY(s,o));continue}i[o]=xBe(s,o,r)}}return i}function I6(t,e){const n={};for(const r of Qe(t)){const i=xBe(t[r],r,e,{compositeMark:!0});n[r]=i}return n}function _9t(t){const e=[];for(const n of Qe(t))if(Vx(t,n)){const r=t[n],i=pt(r);for(const o of i)Je(o)?e.push(o):P6(o)&&e.push(o.condition)}return e}function uae(t,e,n){if(t)for(const r of Qe(t)){const i=t[r];if(We(i))for(const o of i)e.call(n,o,r);else e.call(n,i,r)}}function S9t(t,e,n,r){return t?Qe(t).reduce((i,o)=>{const s=t[o];return We(s)?s.reduce((a,l)=>e.call(r,a,l,o),i):e.call(r,i,s,o)},n):n}function kBe(t,e){return Qe(e).reduce((n,r)=>{switch(r){case xi:case Qo:case g6:case v6:case m6:case sd:case Yh:case Ky:case LO:case zu:case Zg:case ad:case Kg:case ld:case cd:case ud:case Mu:case LR:case Ol:case y1:case Eb:return n;case iC:if(t==="line"||t==="trail")return n;case $R:case p6:{const i=e[r];if(We(i)||Je(i))for(const o of pt(i))o.aggregate||n.push(ct(o,{}));return n}case Jg:if(t==="trail")return n;case Cl:case Qh:case Kh:case em:case Zy:case Jy:case t0:case e0:{const i=Xf(e[r]);return i&&!i.aggregate&&n.push(ct(i,{})),n}}},[])}function C9t(t){const{tooltip:e,...n}=t;if(!e)return{filteredEncoding:n};let r,i;if(We(e)){for(const o of e)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else e.aggregate?n.tooltip=e:i=e;return We(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function HY(t,e,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=t.map(({fieldPrefix:s,titlePrefix:a})=>{const l=r?` of ${fae(e)}`:"";return{field:s+e.field,type:e.type,title:Rt(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),o=_9t(n).map(s9t);return{tooltip:[...i,...Jd(o,Mn)]}}function fae(t){const{title:e,field:n}=t;return qi(e,n)}function dae(t,e,n,r,i){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:c,endPositionPrefix:u=void 0,extraEncoding:f={}})=>{const d=fae(n);return ABe(t,a,i,{mark:l,encoding:{[e]:{field:`${c}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...gt(u)?{[`${e}2`]:{field:`${u}_${n.field}`}}:{},...r,...f}})}}function ABe(t,e,n,r){const{clip:i,color:o,opacity:s}=t,a=t.type;return t[e]||t[e]===void 0&&n[e]?[{...r,mark:{...n[e],...i?{clip:i}:{},...o?{color:o}:{},...s?{opacity:s}:{},...Lh(r.mark)?r.mark:{type:r.mark},style:`${a}-${String(e)}`,...Vy(t[e])?{}:t[e]}}]:[]}function PBe(t,e,n){const{encoding:r}=t,i=e==="vertical"?"y":"x",o=r[i],s=r[`${i}2`],a=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:nL(o,n),continuousAxisChannelDef2:nL(s,n),continuousAxisChannelDefError:nL(a,n),continuousAxisChannelDefError2:nL(l,n),continuousAxis:i}}function nL(t,e){if(t!=null&&t.aggregate){const{aggregate:n,...r}=t;return n!==e&&Ze(GWt(n,e)),r}else return t}function MBe(t,e){const{mark:n,encoding:r}=t,{x:i,y:o}=r;if(Lh(n)&&n.orient)return n.orient;if(bv(i)){if(bv(o)){const s=Je(i)&&i.aggregate,a=Je(o)&&o.aggregate;if(!s&&a===e)return"vertical";if(!a&&s===e)return"horizontal";if(s===e&&a===e)throw new Error("Both x and y cannot have aggregate");return uC(o)&&!uC(i)?"horizontal":"vertical"}return"horizontal"}else{if(bv(o))return"vertical";throw new Error(`Need a valid continuous axis for ${e}s`)}}const z5="boxplot",O9t=["box","median","outliers","rule","ticks"],E9t=new D6(z5,DBe);function RBe(t){return Jn(t)?"tukey":t}function DBe(t,{config:e}){t={...t,encoding:I6(t.encoding,e)};const{mark:n,encoding:r,params:i,projection:o,...s}=t,a=Lh(n)?n:{type:n};i&&Ze(T4e("boxplot"));const l=a.extent??e.boxplot.extent,c=Er("size",a,e),u=a.invalid,f=RBe(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:v,aggregate:y,encodingWithoutContinuousAxis:x,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:_}=T9t(t,l,e),S=IO(g.field),{color:O,size:k,...E}=x,P=q=>dae(a,m,g,q,e.boxplot),A=P(E),R=P(x),T=(ht(e.boxplot.box)?e.boxplot.box.color:e.mark.color)||"#4c78a8",M=P({...E,...k?{size:k}:{},color:{condition:{test:`datum['lower_box_${g.field}'] >= datum['upper_box_${g.field}']`,...O||{value:T}}}}),I=HY([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,x),z={type:"tick",color:"black",opacity:1,orient:b,invalid:u,aria:!1},F=f==="min-max"?I:HY([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,x),N=[...A({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:F}),...A({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:F}),...A({partName:"ticks",mark:z,positionPrefix:"lower_whisker",extraEncoding:F}),...A({partName:"ticks",mark:z,positionPrefix:"upper_whisker",extraEncoding:F})],L=[...f!=="tukey"?N:[],...R({partName:"box",mark:{type:"bar",...c?{size:c}:{},orient:w,invalid:u,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:I}),...M({partName:"median",mark:{type:"tick",invalid:u,...ht(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{},...c?{size:c}:{},orient:b,aria:!1},positionPrefix:"mid_box",extraEncoding:I})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:L};const B=`datum["lower_box_${g.field}"]`,$=`datum["upper_box_${g.field}"]`,j=`(${$} - ${B})`,X=`${B} - ${l} * ${j}`,V=`${$} + ${l} * ${j}`,Y=`datum["${g.field}"]`,le={joinaggregate:IBe(g.field),groupby:v},K={transform:[{filter:`(${X} <= ${Y}) && (${Y} <= ${V})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${S}`},{op:"max",field:g.field,as:`upper_whisker_${S}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${S}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${S}`},...y],groupby:v}],layer:N},{tooltip:ee,...re}=E,{scale:me,axis:te}=g,ae=fae(g),U=pl(te,["title"]),oe=ABe(a,"outliers",e.boxplot,{transform:[{filter:`(${Y} < ${X}) || (${Y} > ${V})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...ae!==void 0?{title:ae}:{},...me!==void 0?{scale:me}:{},...Tr(U)?{}:{axis:U}},...re,...O?{color:O}:{},..._?{tooltip:_}:{}}})[0];let ne;const G=[...d,...h,le];return oe?ne={transform:G,layer:[oe,K]}:(ne=K,ne.transform.unshift(...G)),{...s,layer:[ne,{transform:p,layer:L}]}}function IBe(t){const e=IO(t);return[{op:"q1",field:t,as:`lower_box_${e}`},{op:"q3",field:t,as:`upper_box_${e}`}]}function T9t(t,e,n){const r=MBe(t,z5),{continuousAxisChannelDef:i,continuousAxis:o}=PBe(t,r,z5),s=i.field,a=IO(s),l=RBe(e),c=[...IBe(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(l==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(l==="min-max"?"upper_whisker_":"max_")+a}],u=l==="min-max"||l==="tukey"?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${e}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${e}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[o]:f,...d}=t.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=C9t(d),{bins:g,timeUnits:m,aggregate:v,groupby:y,encoding:x}=TBe(p,n),b=r==="vertical"?"horizontal":"vertical",w=r,_=[...g,...m,{aggregate:[...v,...c],groupby:y},...u];return{bins:g,timeUnits:m,transform:_,groupby:y,aggregate:v,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:x,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:h}}const hae="errorbar",k9t=["ticks","rule"],A9t=new D6(hae,LBe);function LBe(t,{config:e}){t={...t,encoding:I6(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:c}=$Be(t,hae,e);delete o.size;const u=dae(a,i,r,o,e.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...u({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:c}),...u({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:c}),...u({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function P9t(t,e){const{encoding:n}=t;if(M9t(n))return{orient:MBe(t,e),inputType:"raw"};const r=R9t(n),i=D9t(n),o=n.x,s=n.y;if(r){if(i)throw new Error(`${e} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(en(a)&&en(l))throw new Error(`${e} cannot have both x2 and y2`);if(en(a)){if(bv(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${e}`)}else if(en(l)){if(bv(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${e}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,c=n.yError,u=n.yError2;if(en(l)&&!en(a))throw new Error(`${e} cannot have xError2 without xError`);if(en(u)&&!en(c))throw new Error(`${e} cannot have yError2 without yError`);if(en(a)&&en(c))throw new Error(`${e} cannot have both xError and yError with both are quantiative`);if(en(a)){if(bv(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(en(c)){if(bv(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function M9t(t){return(en(t.x)||en(t.y))&&!en(t.x2)&&!en(t.y2)&&!en(t.xError)&&!en(t.xError2)&&!en(t.yError)&&!en(t.yError2)}function R9t(t){return en(t.x2)||en(t.y2)}function D9t(t){return en(t.xError)||en(t.xError2)||en(t.yError)||en(t.yError2)}function $Be(t,e,n){const{mark:r,encoding:i,params:o,projection:s,...a}=t,l=Lh(r)?r:{type:r};o&&Ze(T4e(e));const{orient:c,inputType:u}=P9t(t,e),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=PBe(t,c,e),{errorBarSpecificAggregate:m,postAggregateCalculates:v,tooltipSummary:y,tooltipTitleWithFieldName:x}=I9t(l,f,d,h,p,u,e,n),{[g]:b,[g==="x"?"x2":"y2"]:w,[g==="x"?"xError":"yError"]:_,[g==="x"?"xError2":"yError2"]:S,...O}=i,{bins:k,timeUnits:E,aggregate:P,groupby:A,encoding:R}=TBe(O,n),T=[...P,...m],M=u!=="raw"?[]:A,I=HY(y,f,R,x);return{transform:[...a.transform??[],...k,...E,...T.length===0?[]:[{aggregate:T,groupby:M}],...v],groupby:M,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:R,ticksOrient:c==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:I}}function I9t(t,e,n,r,i,o,s,a){let l=[],c=[];const u=e.field;let f,d=!1;if(o==="raw"){const h=t.center?t.center:t.extent?t.extent==="iqr"?"median":"mean":a.errorbar.center,p=t.extent?t.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Ze(VWt(h,p,s)),p==="stderr"||p==="stdev")l=[{op:p,field:u,as:`extent_${u}`},{op:h,field:u,as:`center_${u}`}],c=[{calculate:`datum["center_${u}"] + datum["extent_${u}"]`,as:`upper_${u}`},{calculate:`datum["center_${u}"] - datum["extent_${u}"]`,as:`lower_${u}`}],f=[{fieldPrefix:"center_",titlePrefix:IR(h)},{fieldPrefix:"upper_",titlePrefix:zye(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:zye(h,p,"-")}],d=!0;else{let g,m,v;p==="ci"?(g="mean",m="ci0",v="ci1"):(g="median",m="q1",v="q3"),l=[{op:m,field:u,as:`lower_${u}`},{op:v,field:u,as:`upper_${u}`},{op:g,field:u,as:`center_${u}`}],f=[{fieldPrefix:"upper_",titlePrefix:H_({field:u,aggregate:v,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:H_({field:u,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:H_({field:u,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&Ze(WWt(t.center,t.extent)),o==="aggregated-upper-lower"?(f=[],c=[{calculate:`datum["${n.field}"]`,as:`upper_${u}`},{calculate:`datum["${u}"]`,as:`lower_${u}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:u}],c=[{calculate:`datum["${u}"] + datum["${r.field}"]`,as:`upper_${u}`}],i?c.push({calculate:`datum["${u}"] + datum["${i.field}"]`,as:`lower_${u}`}):c.push({calculate:`datum["${u}"] - datum["${r.field}"]`,as:`lower_${u}`}));for(const h of c)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:Ob(Ob(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function zye(t,e,n){return`${IR(t)} ${n} ${e}`}const pae="errorband",L9t=["band","borders"],$9t=new D6(pae,FBe);function FBe(t,{config:e}){t={...t,encoding:I6(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=$Be(t,pae,e),c=s,u=dae(c,i,r,o,e.errorband),f=t.encoding.x!==void 0&&t.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...c.interpolate?{interpolate:c.interpolate}:{},...c.tension&&c.interpolate?{tension:c.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):c.interpolate?Ze(Pye("interpolate")):c.tension&&Ze(Pye("tension")),{...a,transform:n,layer:[...u({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const NBe={};function gae(t,e,n){const r=new D6(t,e);NBe[t]={normalizer:r,parts:n}}function F9t(){return Qe(NBe)}gae(z5,DBe,O9t);gae(hae,LBe,k9t);gae(pae,FBe,L9t);const N9t=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],zBe={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},jBe={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},z9t=Qe(zBe),j9t=Qe(jBe),B9t={header:1,headerRow:1,headerColumn:1,headerFacet:1},BBe=Qe(B9t),UBe=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],U9t={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},W9t={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Yf="_vgsid_",V9t={point:{on:"click",fields:[Yf],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function mae(t){return t==="legend"||!!(t!=null&&t.legend)}function qV(t){return mae(t)&&ht(t)}function vae(t){return!!(t!=null&&t.select)}function WBe(t){const e=[];for(const n of t||[]){if(vae(n))continue;const{expr:r,bind:i,...o}=n;if(i&&r){const s={...o,bind:i,init:r};e.push(s)}else{const s={...o,...r?{update:r}:{},...i?{bind:i}:{}};e.push(s)}}return e}function G9t(t){return L6(t)||xae(t)||yae(t)}function yae(t){return Ke(t,"concat")}function L6(t){return Ke(t,"vconcat")}function xae(t){return Ke(t,"hconcat")}function VBe({step:t,offsetIsDiscrete:e}){return e?t.for??"offset":"position"}function $h(t){return Ke(t,"step")}function jye(t){return Ke(t,"view")||Ke(t,"width")||Ke(t,"height")}const Bye=20,H9t={align:1,bounds:1,center:1,columns:1,spacing:1},q9t=Qe(H9t);function X9t(t,e,n){const r=n[e],i={},{spacing:o,columns:s}=r;o!==void 0&&(i.spacing=o),s!==void 0&&(A6(t)&&!BR(t.facet)||yae(t))&&(i.columns=s),L6(t)&&(i.columns=1);for(const a of q9t)if(t[a]!==void 0)if(a==="spacing"){const l=t[a];i[a]=Jn(l)?l:{row:l.row??o,column:l.column??o}}else i[a]=t[a];return i}function qY(t,e){return t[e]??t[e==="width"?"continuousWidth":"continuousHeight"]}function XY(t,e){const n=j5(t,e);return $h(n)?n.step:GBe}function j5(t,e){const n=t[e]??t[e==="width"?"discreteWidth":"discreteHeight"];return qi(n,{step:t.step})}const GBe=20,Y9t={continuousWidth:200,continuousHeight:200,step:GBe},Q9t={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:Y9t,mark:BVt,arc:{},area:{},bar:GVt,circle:{},geoshape:{},image:{},line:{},point:{},rect:eae,rule:{color:"black"},square:{},text:{color:"black"},tick:HVt,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:_Vt,projection:{},legend:U9t,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:V9t,style:{},title:{},facet:{spacing:Bye},concat:{spacing:Bye},normalizedNumberFormat:".0%"},pp=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Uye={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Wye={blue:pp[0],orange:pp[1],red:pp[2],teal:pp[3],green:pp[4],yellow:pp[5],purple:pp[6],pink:pp[7],brown:pp[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function K9t(t={}){return{signals:[{name:"color",value:ht(t)?{...Wye,...t}:Wye}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Z9t(t){return{signals:[{name:"fontSize",value:ht(t)?{...Uye,...t}:Uye}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function J9t(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}function HBe(t){const e=Qe(t||{}),n={};for(const r of e){const i=t[r];n[r]=GR(i)?b4e(i):tc(i)}return n}function e7t(t){const e=Qe(t),n={};for(const r of e)n[r]=HBe(t[r]);return n}const t7t=[...tBe,...SBe,...BBe,"background","padding","legend","lineBreak","scale","style","title","view"];function qBe(t={}){const{color:e,font:n,fontSize:r,selection:i,...o}=t,s=yO({},Kt(Q9t),n?J9t(n):{},e?K9t(e):{},r?Z9t(r):{},o||{});i&&xO(s,"selection",i,!0);const a=pl(s,t7t);for(const l of["background","lineBreak","padding"])s[l]&&(a[l]=tc(s[l]));for(const l of tBe)s[l]&&(a[l]=os(s[l]));for(const l of SBe)s[l]&&(a[l]=HBe(s[l]));for(const l of BBe)s[l]&&(a[l]=os(s[l]));if(s.legend&&(a.legend=os(s.legend)),s.scale){const{invalid:l,...c}=s.scale,u=os(l,{level:1});a.scale={...os(c),...Qe(u).length>0?{invalid:u}:{}}}return s.style&&(a.style=e7t(s.style)),s.title&&(a.title=os(s.title)),s.view&&(a.view=os(s.view)),a}const n7t=new Set(["view",...LVt]),r7t=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],i7t={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...jVt};function o7t(t){t=Kt(t);for(const e of r7t)delete t[e];if(t.axis)for(const e in t.axis)GR(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of N9t)delete t.legend[e];if(t.mark){for(const e of Rye)delete t.mark[e];t.mark.tooltip&&ht(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(WBe(t.params)),delete t.params);for(const e of n7t){for(const r of Rye)delete t[e][r];const n=i7t[e];if(n)for(const r of n)delete t[e][r];a7t(t,e)}for(const e of F9t())delete t[e];s7t(t);for(const e in t)ht(t[e])&&Tr(t[e])&&delete t[e];return Tr(t)?void 0:t}function s7t(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:r}=x4e(t.title);Tr(e)||(t.style["group-title"]={...t.style["group-title"],...e}),Tr(n)||(t.style["group-subtitle"]={...t.style["group-subtitle"],...n}),Tr(r)?delete t.title:t.title=r}function a7t(t,e,n,r){const i=t[e];e==="view"&&(n="cell");const o={...i,...t.style[n??e]};Tr(o)||(t.style[n??e]=o),delete t[e]}function $6(t){return Ke(t,"layer")}function l7t(t){return Ke(t,"repeat")}function c7t(t){return!We(t.repeat)&&Ke(t.repeat,"layer")}class bae{map(e,n){return A6(e)?this.mapFacet(e,n):l7t(e)?this.mapRepeat(e,n):xae(e)?this.mapHConcat(e,n):L6(e)?this.mapVConcat(e,n):yae(e)?this.mapConcat(e,n):this.mapLayerOrUnit(e,n)}mapLayerOrUnit(e,n){if($6(e))return this.mapLayer(e,n);if(nm(e))return this.mapUnit(e,n);throw new Error(Fse(e))}mapLayer(e,n){return{...e,layer:e.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(e,n){return{...e,hconcat:e.hconcat.map(r=>this.map(r,n))}}mapVConcat(e,n){return{...e,vconcat:e.vconcat.map(r=>this.map(r,n))}}mapConcat(e,n){const{concat:r,...i}=e;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(e,n){return{...e,spec:this.map(e.spec,n)}}mapRepeat(e,n){return{...e,spec:this.map(e.spec,n)}}}const u7t={zero:1,center:1,normalize:1};function f7t(t){return vt(u7t,t)}const d7t=new Set([Z4e,O6,C6,D5,T6,Zse,Jse,E6,J4e,Kse]),h7t=new Set([O6,C6,Z4e]);function aw(t){return Je(t)&&lC(t)==="quantitative"&&!t.bin}function Vye(t,e,{orient:n,type:r}){const i=e==="x"?"y":"radius",o=e==="x"&&["bar","area"].includes(r),s=t[e],a=t[i];if(Je(s)&&Je(a))if(aw(s)&&aw(a)){if(s.stack)return e;if(a.stack)return i;const l=Je(s)&&!!s.aggregate,c=Je(a)&&!!a.aggregate;if(l!==c)return l?e:i;if(o){if(n==="vertical")return i;if(n==="horizontal")return e}}else{if(aw(s))return e;if(aw(a))return i}else{if(aw(s))return o&&n==="vertical"?void 0:e;if(aw(a))return o&&n==="horizontal"?void 0:i}}function p7t(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function XBe(t,e){var g,m;const n=Lh(t)?t:{type:t},r=n.type;if(!d7t.has(r))return null;const i=Vye(e,"x",n)||Vye(e,"theta",n);if(!i)return null;const o=e[i],s=Je(o)?ct(o,{}):void 0,a=p7t(i),l=[],c=new Set;if(e[a]){const v=e[a],y=Je(v)?ct(v,{}):void 0;y&&y!==s&&(l.push(a),c.add(y))}const u=a==="x"?"xOffset":"yOffset",f=e[u],d=Je(f)?ct(f,{}):void 0;d&&d!==s&&(l.push(u),c.add(d));const h=O8t.reduce((v,y)=>{if(y!=="tooltip"&&Vx(e,y)){const x=e[y];for(const b of pt(x)){const w=Xf(b);if(w.aggregate)continue;const _=ct(w,{});(!_||!c.has(_))&&v.push({channel:y,fieldDef:w})}}return v},[]);let p;return o.stack!==void 0?Vy(o.stack)?p=o.stack?"zero":null:p=o.stack:h7t.has(r)&&(p="zero"),!p||!f7t(p)||EBe(e)&&h.length===0?null:((g=o==null?void 0:o.scale)!=null&&g.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==ss.LINEAR&&o!=null&&o.stack&&Ze(jWt(o.scale.type)),en(e[Zh(i)])?(o.stack!==void 0&&Ze(zWt(i)),null):(Je(o)&&o.aggregate&&!F8t.has(o.aggregate)&&Ze(BWt(o.aggregate)),{groupbyChannels:l,groupbyFields:c,fieldChannel:i,impute:o.impute===null?!1:r0(r),stackBy:h,offset:p}))}function YBe(t,e,n){const r=os(t),i=Er("orient",r,n);if(r.orient=y7t(r.type,e,i),i!==void 0&&i!==r.orient&&Ze(SWt(r.orient,i)),r.type==="bar"&&r.orient){const l=Er("cornerRadiusEnd",r,n);if(l!==void 0){const c=r.orient==="horizontal"&&e.x2||r.orient==="vertical"&&e.y2?["cornerRadius"]:WVt[r.orient];for(const u of c)r[u]=l;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}const o=Er("opacity",r,n),s=Er("fillOpacity",r,n);return o===void 0&&s===void 0&&(r.opacity=m7t(r.type,e)),Er("cursor",r,n)===void 0&&(r.cursor=g7t(r,e,n)),r}function g7t(t,e,n){return e.href||t.href||Er("href",t,n)?"pointer":t.cursor}function m7t(t,e){if(En([T6,Kse,Zse,Jse],t)&&!EBe(e))return .7}function v7t(t,e,{graticule:n}){if(n)return!1;const r=Ih("filled",t,e),i=t.type;return qi(r,i!==T6&&i!==E6&&i!==D5)}function y7t(t,e,n){switch(t){case T6:case Zse:case Jse:case J4e:case DVt:case RVt:return}const{x:r,y:i,x2:o,y2:s}=e;switch(t){case O6:if(Je(r)&&(rs(r.bin)||Je(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Je(i)&&(rs(i.bin)||Je(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(Je(r)&&r.type===kb&&!qr(r.bin)||L5(r))&&Je(i)&&rs(i.bin)?"horizontal":"vertical";if(!s)return(Je(i)&&i.type===kb&&!qr(i.bin)||L5(i))&&Je(r)&&rs(r.bin)?"vertical":"horizontal"}case D5:if(o&&!(Je(r)&&rs(r.bin))&&s&&!(Je(i)&&rs(i.bin)))return;case C6:if(s)return Je(i)&&rs(i.bin)?"horizontal":"vertical";if(o)return Je(r)&&rs(r.bin)?"vertical":"horizontal";if(t===D5){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case E6:case Kse:{const a=$ye(r),l=$ye(i);if(n)return n;if(a&&!l)return t!=="tick"?"horizontal":"vertical";if(!a&&l)return t!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const c=Ra(r)&&r.type===sC,u=Ra(i)&&i.type===sC;if(c&&!u)return"vertical";if(!c&&u)return"horizontal"}return}}return"vertical"}function x7t(t){const{point:e,line:n,...r}=t;return Qe(r).length>1?r:r.type}function b7t(t){for(const e of["line","area","rule","trail"])t[e]&&(t={...t,[e]:pl(t[e],["point","line"])});return t}function XV(t,e={},n){return t.point==="transparent"?{opacity:0}:t.point?ht(t.point)?t.point:{}:t.point!==void 0?null:e.point||n.shape?ht(e.point)?e.point:{}:void 0}function Gye(t,e={}){return t.line?t.line===!0?{}:t.line:t.line!==void 0?null:e.line?e.line===!0?{}:e.line:void 0}class w7t{constructor(){this.name="path-overlay"}hasMatchingType(e,n){if(nm(e)){const{mark:r,encoding:i}=e,o=Lh(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!XV(o,n[o.type],i);case"area":return!!XV(o,n[o.type],i)||!!Gye(o,n[o.type])}}return!1}run(e,n,r){const{config:i}=n,{params:o,projection:s,mark:a,name:l,encoding:c,...u}=e,f=I6(c,i),d=Lh(a)?a:{type:a},h=XV(d,i[d.type],f),p=d.type==="area"&&Gye(d,i[d.type]),g=[{name:l,...o?{params:o}:{},mark:x7t({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:pl(f,["shape"])}],m=XBe(YBe(d,f,i),f);let v=f;if(m){const{fieldChannel:y,offset:x}=m;v={...f,[y]:{...f[y],...x?{stack:x}:{}}}}return v=pl(v,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...tC(d,["clip","interpolate","tension","tooltip"]),...p},encoding:v}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...tC(d,["clip","tooltip"]),...h},encoding:v}),r({...u,layer:g},{...n,config:b7t(i)})}}function _7t(t,e){return e?BR(t)?KBe(t,e):QBe(t,e):t}function YV(t,e){return e?KBe(t,e):t}function YY(t,e,n){const r=e[t];if(i9t(r)){if(r.repeat in n)return{...e,[t]:n[r.repeat]};Ze(rWt(r.repeat));return}return e}function QBe(t,e){if(t=YY("field",t,e),t!==void 0){if(t===null)return null;if(sae(t)&&hg(t.sort)){const n=YY("field",t.sort,e);t={...t,...n?{sort:n}:{}}}return t}}function Hye(t,e){if(Je(t))return QBe(t,e);{const n=YY("datum",t,e);return n!==t&&!n.type&&(n.type="nominal"),n}}function qye(t,e){if(en(t)){const n=Hye(t,e);if(n)return n;if(UR(t))return{condition:t.condition}}else{if(WR(t)){const n=Hye(t.condition,e);if(n)return{...t,condition:n};{const{condition:r,...i}=t;return i}}return t}}function KBe(t,e){const n={};for(const r in t)if(Ke(t,r)){const i=t[r];if(We(i))n[r]=i.map(o=>qye(o,e)).filter(o=>o);else{const o=qye(i,e);o!==void 0&&(n[r]=o)}}return n}class S7t{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(nm(e)){const{encoding:n,mark:r}=e;if(r==="line"||Lh(r)&&r.type==="line")for(const i of _8t){const o=x1(i),s=n[o];if(n[i]&&(Je(s)&&!rs(s.bin)||ep(s)))return!0}}return!1}run(e,n,r){const{encoding:i,mark:o}=e;return Ze(_Wt(!!i.x2,!!i.y2)),r({...e,mark:ht(o)?{...o,type:"rule"}:"rule"},n)}}class C7t extends bae{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[E9t,A9t,$9t,new w7t,new S7t]}map(e,n){if(nm(e)){const r=Vx(e.encoding,fg),i=Vx(e.encoding,dg),o=Vx(e.encoding,h6);if(r||i||o)return this.mapFacetedUnit(e,n)}return super.map(e,n)}mapUnit(e,n){const{parentEncoding:r,parentProjection:i}=n,o=YV(e.encoding,n.repeater),s={...e,...e.name?{name:[n.repeaterPrefix,e.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(s,n.config))return l.run(s,n,a);return s}mapRepeat(e,n){return c7t(e)?this.mapLayerRepeat(e,n):this.mapNonLayerRepeat(e,n)}mapLayerRepeat(e,n){const{repeat:r,spec:i,...o}=e,{row:s,column:a,layer:l}=r,{repeater:c={},repeaterPrefix:u=""}=n;return s||a?this.mapRepeat({...e,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:i}},n):{...o,layer:l.map(f=>{const d={...c,layer:f},h=`${(i.name?`${i.name}_`:"")+u}child__layer_${gi(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(e,n){const{repeat:r,spec:i,data:o,...s}=e;!We(r)&&e.columns&&(e=pl(e,["columns"]),Ze(Eye("repeat")));const a=[],{repeater:l={},repeaterPrefix:c=""}=n,u=!We(r)&&r.row||[l?l.row:null],f=!We(r)&&r.column||[l?l.column:null],d=We(r)&&r||[l?l.repeat:null];for(const p of d)for(const g of u)for(const m of f){const v={repeat:p,row:g,column:m,layer:l.layer},y=(i.name?`${i.name}_`:"")+c+"child__"+(We(r)?`${gi(p)}`:(r.row?`row_${gi(g)}`:"")+(r.column?`column_${gi(m)}`:"")),x=this.map(i,{...n,repeater:v,repeaterPrefix:y});x.name=y,a.push(pl(x,["data"]))}const h=We(r)?e.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(e,n){const{facet:r}=e;return BR(r)&&e.columns&&(e=pl(e,["columns"]),Ze(Eye("facet"))),super.mapFacet(e,n)}mapUnitWithParentEncodingOrProjection(e,n){const{encoding:r,projection:i}=e,{parentEncoding:o,parentProjection:s,config:a}=n,l=Yye({parentProjection:s,projection:i}),c=Xye({parentEncoding:o,encoding:YV(r,n.repeater)});return this.mapUnit({...e,...l?{projection:l}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(e,n){const{row:r,column:i,facet:o,...s}=e.encoding,{mark:a,width:l,projection:c,height:u,view:f,params:d,encoding:h,...p}=e,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),v=YV(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...u?{height:u}:{},...f?{view:f}:{},...c?{projection:c}:{},mark:a,encoding:v,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(e,n){const{row:r,column:i,facet:o}=e;if(r||i){o&&Ze(bWt([...r?[fg]:[],...i?[dg]:[]]));const s={},a={};for(const l of[fg,dg]){const c=e[l];if(c){const{align:u,center:f,spacing:d,columns:h,...p}=c;s[l]=p;for(const g of["align","center","spacing"])c[g]!==void 0&&(a[g]??(a[g]={}),a[g][l]=c[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:l,columns:c,...u}=o;return{facetMapping:_7t(u,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...l?{spacing:l}:{},...c?{columns:c}:{}}}}}mapLayer(e,{parentEncoding:n,parentProjection:r,...i}){const{encoding:o,projection:s,...a}=e,l={...i,parentEncoding:Xye({parentEncoding:n,encoding:o,layer:!0}),parentProjection:Yye({parentProjection:r,projection:s})};return super.mapLayer({...a,...e.name?{name:[l.repeaterPrefix,e.name].filter(c=>c).join("_")}:{}},l)}}function Xye({parentEncoding:t,encoding:e={},layer:n}){let r={};if(t){const i=new Set([...Qe(t),...Qe(e)]);for(const o of i){const s=e[o],a=t[o];if(en(s)){const l={...a,...s};r[o]=l}else WR(s)?r[o]={...s,condition:{...a,...s.condition}}:s||s===null?r[o]=s:(n||qf(a)||Rt(a)||en(a)||We(a))&&(r[o]=a)}}else r=e;return!r||Tr(r)?void 0:r}function Yye(t){const{parentProjection:e,projection:n}=t;return e&&n&&Ze(cWt({parentProjection:e,projection:n})),n??e}function wae(t){return Ke(t,"filter")}function O7t(t){return Ke(t,"stop")}function ZBe(t){return Ke(t,"lookup")}function E7t(t){return Ke(t,"data")}function T7t(t){return Ke(t,"param")}function k7t(t){return Ke(t,"pivot")}function A7t(t){return Ke(t,"density")}function P7t(t){return Ke(t,"quantile")}function M7t(t){return Ke(t,"regression")}function R7t(t){return Ke(t,"loess")}function D7t(t){return Ke(t,"sample")}function I7t(t){return Ke(t,"window")}function L7t(t){return Ke(t,"joinaggregate")}function $7t(t){return Ke(t,"flatten")}function F7t(t){return Ke(t,"calculate")}function JBe(t){return Ke(t,"bin")}function N7t(t){return Ke(t,"impute")}function z7t(t){return Ke(t,"timeUnit")}function j7t(t){return Ke(t,"aggregate")}function B7t(t){return Ke(t,"stack")}function U7t(t){return Ke(t,"fold")}function W7t(t){return Ke(t,"extent")&&!Ke(t,"density")&&!Ke(t,"regression")}function V7t(t){return t.map(e=>wae(e)?{filter:V_(e.filter,gVt)}:e)}class G7t extends bae{map(e,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),e=Qye(e,n),super.map(e,n)}mapLayerOrUnit(e,n){if(e=Qye(e,n),e.encoding){const r={};for(const[i,o]of hy(e.encoding))r[i]=e6e(o,n);e={...e,encoding:r}}return super.mapLayerOrUnit(e,n)}mapUnit(e,n){const{selection:r,...i}=e;return r?{...i,params:hy(r).map(([o,s])=>{const{init:a,bind:l,empty:c,...u}=s;u.type==="single"?(u.type="point",u.toggle=!1):u.type==="multi"&&(u.type="point"),n.emptySelections[o]=c!=="none";for(const f of ws(n.selectionPredicates[o]??{}))f.empty=c!=="none";return{name:o,value:a,select:u,bind:l}})}:e}}function Qye(t,e){const{transform:n,...r}=t;if(n){const i=n.map(o=>{if(wae(o))return{filter:QY(o,e)};if(JBe(o)&&b1(o.bin))return{...o,bin:t6e(o.bin)};if(ZBe(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...r,transform:i}}return t}function e6e(t,e){var r,i;const n=Kt(t);if(Je(n)&&b1(n.bin)&&(n.bin=t6e(n.bin)),C1(n)&&((i=(r=n.scale)==null?void 0:r.domain)!=null&&i.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(UR(n))if(We(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:l,...c}=o;return a?o:{...c,test:QY(o,e)}});else{const{selection:o,param:s,test:a,...l}=e6e(n.condition,e);n.condition=s?n.condition:{...l,test:QY(n.condition,e)}}return n}function t6e(t){const e=t.extent;if(e!=null&&e.selection){const{selection:n,...r}=e;return{...t,extent:{...r,param:n}}}return t}function QY(t,e){const n=r=>V_(r,i=>{var o;const s=e.emptySelections[i]??!0,a={param:i,empty:s};return(o=e.selectionPredicates)[i]??(o[i]=[]),e.selectionPredicates[i].push(a),a});return t.selection?n(t.selection):V_(t.test||t.filter,r=>r.selection?n(r.selection):r)}class KY extends bae{map(e,n){const r=n.selections??[];if(e.params&&!nm(e)){const i=[];for(const o of e.params)vae(o)?r.push(o):i.push(o);e.params=i}return n.selections=r,super.map(e,n)}mapUnit(e,n){const r=n.selections;if(!r||!r.length)return e;const i=(n.path??[]).concat(e.name),o=[];for(const s of r)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(gt(a)&&(a===e.name||i.includes(a))||We(a)&&a.map(l=>i.indexOf(l)).every((l,c,u)=>l!==-1&&(c===0||l>u[c-1])))&&o.push(s);return o.length&&(e.params=o),e}}for(const t of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const e=KY.prototype[t];KY.prototype[t]=function(n,r){return e.call(this,n,H7t(n,r))}}function H7t(t,e){return t.name?{...e,path:(e.path??[]).concat(t.name)}:e}function n6e(t,e){e===void 0&&(e=qBe(t.config));const n=Q7t(t,e),{width:r,height:i}=t,o=K7t(n,{width:r,height:i,autosize:t.autosize},e);return{...n,...o?{autosize:o}:{}}}const q7t=new C7t,X7t=new G7t,Y7t=new KY;function Q7t(t,e={}){const n={config:e};return Y7t.map(q7t.map(X7t.map(t,n),n),n)}function Kye(t){return gt(t)?{type:t}:t??{}}function K7t(t,e,n){let{width:r,height:i}=e;const o=nm(t)||$6(t),s={};o?r=="container"&&i=="container"?(s.type="fit",s.contains="padding"):r=="container"?(s.type="fit-x",s.contains="padding"):i=="container"&&(s.type="fit-y",s.contains="padding"):(r=="container"&&(Ze(_ye("width")),r=void 0),i=="container"&&(Ze(_ye("height")),i=void 0));const a={type:"pad",...s,...n?Kye(n.autosize):{},...Kye(t.autosize)};if(a.type==="fit"&&!o&&(Ze(H8t),a.type="pad"),r=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Ze(Sye("width")),i=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Ze(Sye("height")),!sc(a,{type:"pad"}))return a}function Z7t(t){return["fit","fit-x","fit-y"].includes(t)}function J7t(t){return t?`fit-${y6(t)}`:"fit"}const eGt=["background","padding"];function Zye(t,e){const n={};for(const r of eGt)t&&t[r]!==void 0&&(n[r]=tc(t[r]));return e&&(n.params=t.params),n}class rm{constructor(e={},n={}){this.explicit=e,this.implicit=n}clone(){return new rm(Kt(this.explicit),Kt(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return qi(this.explicit[e],this.implicit[e])}getWithExplicit(e){return this.explicit[e]!==void 0?{explicit:!0,value:this.explicit[e]}:this.implicit[e]!==void 0?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,{value:n,explicit:r}){n!==void 0&&this.set(e,n,r)}set(e,n,r){return delete this[r?"implicit":"explicit"][e],this[r?"explicit":"implicit"][e]=n,this}copyKeyFromSplit(e,{explicit:n,implicit:r}){n[e]!==void 0?this.set(e,n[e],!0):r[e]!==void 0&&this.set(e,r[e],!1)}copyKeyFromObject(e,n){n[e]!==void 0&&this.set(e,n[e],!0)}copyAll(e){for(const n of Qe(e.combine())){const r=e.getWithExplicit(n);this.setWithExplicit(n,r)}}}function Md(t){return{explicit:!0,value:t}}function Vl(t){return{explicit:!1,value:t}}function r6e(t){return(e,n,r,i)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:F6(e,n,r,i)}}function F6(t,e,n,r){return t.explicit&&e.explicit&&Ze(RWt(n,r,t.value,e.value)),t}function my(t,e,n,r,i=F6){return t===void 0||t.value===void 0?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:sc(t.value,e.value)?t:i(t,e,n,r)}class tGt extends rm{constructor(e={},n={},r=!1){super(e,n),this.explicit=e,this.implicit=n,this.parseNothing=r}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function fC(t){return Ke(t,"url")}function XA(t){return Ke(t,"values")}function i6e(t){return Ke(t,"name")&&!fC(t)&&!XA(t)&&!Wv(t)}function Wv(t){return t&&(o6e(t)||s6e(t)||_ae(t))}function o6e(t){return Ke(t,"sequence")}function s6e(t){return Ke(t,"sphere")}function _ae(t){return Ke(t,"graticule")}var $i;(function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup",t[t.PreFilterInvalid=5]="PreFilterInvalid",t[t.PostFilterInvalid=6]="PostFilterInvalid"})($i||($i={}));function a6e({invalid:t,isPath:e}){switch(nBe(t,{isPath:e})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:e?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:e?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function nGt(t){const{marks:e,scales:n}=a6e(t);return e===n?$i.Main:n==="include-invalid-values"?$i.PreFilterInvalid:$i.PostFilterInvalid}function l6e(t){const{signals:e,hasLegend:n,index:r,...i}=t;return i.field=Pu(i.field),i}function Mb(t,e=!0,n=na){if(We(t)){const r=t.map(i=>Mb(i,e,n));return e?`[${r.join(", ")}]`:r}else if(_1(t))return n(e?Tb(t):rVt(t));return e?n(kr(t)):t}function rGt(t,e){for(const n of ws(t.component.selection??{})){const r=n.name;let i=`${r}${vy}, ${n.resolve==="global"?"true":`{unit: ${Gx(t)}}`}`;for(const o of B6)o.defined(n)&&(o.signals&&(e=o.signals(t,n,e)),o.modifyExpr&&(i=o.modifyExpr(t,n,i)));e.push({name:r+DGt,on:[{events:{signal:n.name+vy},update:`modify(${rt(n.name+Rb)}, ${i})`}]})}return Sae(e)}function iGt(t,e){if(t.component.selection&&Qe(t.component.selection).length){const n=rt(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:Qy("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Sae(e)}function oGt(t,e){let n=!1;for(const r of ws(t.component.selection??{})){const i=r.name,o=rt(i+Rb);if(e.filter(a=>a.name===i).length===0){const a=r.resolve==="global"?"union":r.resolve,l=r.type==="point"?", true, true)":")";e.push({name:r.name,update:`${E6e}(${o}, ${rt(a)}${l}`})}n=!0;for(const a of B6)a.defined(r)&&a.topLevelSignals&&(e=a.topLevelSignals(t,r,e))}return n&&e.filter(i=>i.name==="unit").length===0&&e.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Sae(e)}function sGt(t,e){const n=[...e],r=Gx(t,{escape:!1});for(const i of ws(t.component.selection??{})){const o={name:i.name+Rb};if(i.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Yf}}]),i.init){const a=i.project.items.map(l6e);o.values=i.project.hasSelectionId?i.init.map(l=>({unit:r,[Yf]:Mb(l,!1)[0]})):i.init.map(l=>({unit:r,fields:a,values:Mb(l,!1)}))}n.filter(a=>a.name===i.name+Rb).length||n.push(o)}return n}function c6e(t,e){for(const n of ws(t.component.selection??{}))for(const r of B6)r.defined(n)&&r.marks&&(e=r.marks(t,n,e));return e}function aGt(t,e){for(const n of t.children)_i(n)&&(e=c6e(n,e));return e}function lGt(t,e,n,r){const i=M6e(t,e.param,e);return{signal:Hf(n.get("type"))&&We(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function Sae(t){return t.map(e=>(e.on&&!e.on.length&&delete e.on,e))}class Sr{constructor(e,n){this.debugName=n,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,n){if(this._children.includes(e)){Ze(sWt);return}n!==void 0?this._children.splice(n,0,e):this._children.push(e)}removeChild(e){const n=this._children.indexOf(e);return this._children.splice(n,1),n}remove(){let e=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,e++)}insertAsParentOf(e){const n=e.parent;n.removeChild(this),this.parent=n,e.parent=this}swapWithParent(){const e=this._parent,n=e.parent;for(const i of this._children)i.parent=e;this._children=[],e.removeChild(this);const r=e.parent.removeChild(e);this._parent=n,n.addChild(this,r),e.parent=this}}class gl extends Sr{clone(){const e=new this.constructor;return e.debugName=`clone_${this.debugName}`,e._source=this._source,e._name=`clone_${this._name}`,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,n,r,i){super(e,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${r4e()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}function QV(t){return t.as!==void 0}function Jye(t){return`${t}_end`}class bh extends Sr{clone(){return new bh(null,Kt(this.timeUnits))}constructor(e,n){super(e),this.timeUnits=n}static makeFromEncoding(e,n){const r=n.reduceFieldDef((i,o,s)=>{const{field:a,timeUnit:l}=o;if(l){let c;if(S1(l)){if(_i(n)){const{mark:u,markDef:f,config:d}=n,h=gy({fieldDef:o,markDef:f,config:d});(qA(u)||h)&&(c={timeUnit:Vo(l),field:a})}}else c={as:ct(o,{forAs:!0}),field:a,timeUnit:l};if(_i(n)){const{mark:u,markDef:f,config:d}=n,h=gy({fieldDef:o,markDef:f,config:d});qA(u)&&Xi(s)&&h!==.5&&(c.rectBandPosition=h)}c&&(i[Mn(c)]=c)}return i},{});return Tr(r)?null:new bh(e,r)}static makeFromTransform(e,n){const{timeUnit:r,...i}={...n},o=Vo(r),s={...i,timeUnit:o};return new bh(e,{[Mn(s)]:s})}merge(e){this.timeUnits={...this.timeUnits};for(const n in e.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=e.timeUnits[n]);for(const n of e.children)e.removeChild(n),n.parent=this;e.remove()}removeFormulas(e){const n={};for(const[r,i]of hy(this.timeUnits)){const o=QV(i)?i.as:`${i.field}_end`;e.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(ws(this.timeUnits).map(e=>QV(e)?e.as:Jye(e.field)))}dependentFields(){return new Set(ws(this.timeUnits).map(e=>e.field))}hash(){return`TimeUnit ${Mn(this.timeUnits)}`}assemble(){const e=[];for(const n of ws(this.timeUnits)){const{rectBandPosition:r}=n,i=Vo(n.timeUnit);if(QV(n)){const{field:o,as:s}=n,{unit:a,utc:l,...c}=i,u=[s,`${s}_end`];e.push({field:Pu(o),type:"timeunit",...a?{units:_6(a)}:{},...l?{timezone:"utc"}:{},...c,as:u}),e.push(...e0e(u,r,i))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=u6e({timeUnit:i,field:s}),l=Jye(s);e.push({type:"formula",expr:a,as:l}),e.push(...e0e([s,l],r,i))}}return e}}const N6="offsetted_rect_start",z6="offsetted_rect_end";function u6e({timeUnit:t,field:e,reverse:n}){const{unit:r,utc:i}=t,o=N4e(r),{part:s,step:a}=U4e(o,t.step);return`${i?"utcOffset":"timeOffset"}('${s}', datum['${e}'], ${n?-a:a})`}function e0e([t,e],n,r){if(n!==void 0&&n!==.5){const i=`datum['${t}']`,o=`datum['${e}']`;return[{type:"formula",expr:t0e([u6e({timeUnit:r,field:t,reverse:!0}),i],n+.5),as:`${t}_${N6}`},{type:"formula",expr:t0e([i,o],n+.5),as:`${t}_${z6}`}]}return[]}function t0e([t,e],n){return`${1-n} * ${t} + ${n} * ${e}`}const HR="_tuple_fields";class cGt{constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const uGt={defined:()=>!0,parse:(t,e,n)=>{const r=e.name,i=e.project??(e.project=new cGt),o={},s={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let v=gi(`${r}_${m}`);for(let y=1;a.has(v);y++)v=gi(`${r}_${m}_${y}`);return a.add(v),{[g]:v}},c=e.type,u=t.config.selection[c],f=n.value!==void 0?pt(n.value):null;let{fields:d,encodings:h}=ht(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ht(p))for(const g of Qe(p))w8t(g)?(h||(h=[])).push(g):c==="interval"?(Ze(nWt),h=u.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=u.encodings,"fields"in u&&(d=u.fields));for(const p of h??[]){const g=t.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Ze(q8t(p,g.aggregate));continue}else if(!m){Ze(Oye(p));continue}if(g.timeUnit&&!S1(g.timeUnit)){m=t.vgField(p);const v={timeUnit:g.timeUnit,as:m,field:g.field};s[Mn(v)]=v}if(!o[m]){const v=c==="interval"&&Jh(p)&&Hf(t.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",y={field:m,channel:p,type:v,index:i.items.length};y.signals={...l(y,"data"),...l(y,"visual")},i.items.push(o[m]=y),i.hasField[m]=o[m],i.hasSelectionId=i.hasSelectionId||m===Yf,c4e(p)?(y.geoChannel=p,y.channel=l4e(p),i.hasChannel[y.channel]=o[m]):i.hasChannel[p]=o[m]}}else Ze(Oye(p))}for(const p of d??[]){if(i.hasField[p])continue;const g={type:"E",field:p,index:i.items.length};g.signals={...l(g,"data")},i.items.push(g),i.hasField[p]=g,i.hasSelectionId=i.hasSelectionId||p===Yf}f&&(e.init=f.map(p=>i.items.map(g=>ht(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Tr(s)||(i.timeUnit=new bh(null,s))},signals:(t,e,n)=>{const r=e.name+HR;return n.filter(o=>o.name===r).length>0||e.project.hasSelectionId?n:n.concat({name:r,value:e.project.items.map(l6e)})}},pg={defined:t=>t.type==="interval"&&t.resolve==="global"&&t.bind&&t.bind==="scales",parse:(t,e)=>{const n=e.scales=[];for(const r of e.project.items){const i=r.channel;if(!Jh(i))continue;const o=t.getScaleComponent(i),s=o?o.get("type"):void 0;if(s=="sequential"&&Ze(K8t),!o||!Hf(s)){Ze(Q8t);continue}o.set("selectionExtent",{param:e.name,field:r.field},!0),n.push(r)}},topLevelSignals:(t,e,n)=>{const r=e.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!t.parent||n0e(t)||r.length===0)return n;const i=n.find(s=>s.name===e.name);let o=i.update;if(o.includes(E6e))i.update=`{${r.map(s=>`${rt(Pu(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of r){const a=`${rt(Pu(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}i.update=o}return n.concat(r.map(s=>({name:s.signals.data})))},signals:(t,e,n)=>{if(t.parent&&!n0e(t))for(const r of e.scales){const i=n.find(o=>o.name===r.signals.data);i.push="outer",delete i.value,delete i.update}return n}};function ZY(t,e){return`domain(${rt(t.scaleName(e))})`}function n0e(t){return t.parent&&BO(t.parent)&&!t.parent.parent}const q_="_brush",f6e="_scale_trigger",u2="geo_interval_init_tick",d6e="_init",fGt="_center",dGt={defined:t=>t.type==="interval",parse:(t,e,n)=>{var r;if(t.hasProjection){const i={...ht(n.select)?n.select:{}};i.fields=[Yf],i.encodings||(i.encodings=n.value?Qe(n.value):[cd,ld]),n.select={type:"interval",...i}}if(e.translate&&!pg.defined(e)){const i=`!event.item || event.item.mark.name !== ${rt(e.name+q_)}`;for(const o of e.events){if(!o.between){Ze(`${o} is not an ordered event stream for interval selections.`);continue}const s=pt((r=o.between[0]).filter??(r.filter=[]));s.includes(i)||s.push(i)}}},signals:(t,e,n)=>{const r=e.name,i=r+vy,o=ws(e.project.hasChannel).filter(a=>a.channel===xi||a.channel===Qo),s=e.init?e.init[0]:null;if(n.push(...o.reduce((a,l)=>a.concat(hGt(t,e,l,s&&s[l.index])),[])),t.hasProjection){const a=rt(t.projectionName()),l=t.projectionName()+fGt,{x:c,y:u}=e.project.hasChannel,f=c&&c.signals.visual,d=u&&u.signals.visual,h=c?s&&s[c.index]:`${l}[0]`,p=u?s&&s[u.index]:`${l}[1]`,g=w=>t.getSizeSignalRef(w).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;s&&(n.unshift({name:r+d6e,init:`[scale(${a}, [${c?h[0]:h}, ${u?p[0]:p}]), scale(${a}, [${c?h[1]:h}, ${u?p[1]:p}])]`}),(!c||!u)&&(n.find(_=>_.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const v=`intersect(${m}, {markname: ${rt(t.getName("marks"))}}, unit.mark)`,y=`{unit: ${Gx(t)}}`,x=`vlSelectionTuples(${v}, ${y})`,b=o.map(w=>w.signals.visual);return n.concat({name:i,on:[{events:[...b.length?[{signal:b.join(" || ")}]:[],...s?[{signal:u2}]:[]],update:x}]})}else{if(!pg.defined(e)){const c=r+f6e,u=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=rt(t.scaleName(d)),m=t.getScaleComponent(d).get("type"),v=Hf(m)?"+":"";return`(!isArray(${h}) || (${v}invert(${g}, ${p})[0] === ${v}${h}[0] && ${v}invert(${g}, ${p})[1] === ${v}${h}[1]))`});u.length&&n.push({name:c,value:{},on:[{events:o.map(f=>({scale:t.scaleName(f.channel)})),update:u.join(" && ")+` ? ${c} : {}`}]})}const a=o.map(c=>c.signals.data),l=`unit: ${Gx(t)}, fields: ${r+HR}, values`;return n.concat({name:i,...s?{init:`{${l}: ${Mb(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(t,e,n)=>(_i(t)&&t.hasProjection&&e.init&&(n.filter(i=>i.name===u2).length||n.unshift({name:u2,value:null,on:[{events:"timer{1}",update:`${u2} === null ? {} : ${u2}`}]})),n),marks:(t,e,n)=>{const r=e.name,{x:i,y:o}=e.project.hasChannel,s=i==null?void 0:i.signals.visual,a=o==null?void 0:o.signals.visual,l=`data(${rt(e.name+Rb)})`;if(pg.defined(e)||!i&&!o)return n;const c={x:i!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:i!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(e.resolve==="global")for(const m of Qe(c))c[m]=[{test:`${l}.length && ${l}[0].unit === ${Gx(t)}`,...c[m]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=e.mark,p=Qe(h).reduce((m,v)=>(m[v]=[{test:[i!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[v]},{value:null}],m),{}),g=d??(e.translate?"move":null);return[{name:`${r+q_}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:c}},...n,{name:r+q_,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}};function hGt(t,e,n,r){const i=!t.hasProjection,o=n.channel,s=n.signals.visual,a=rt(i?t.scaleName(o):t.projectionName()),l=d=>`scale(${a}, ${d})`,c=t.getSizeSignalRef(o===xi?"width":"height").signal,u=`${o}(unit)`,f=e.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${u}, ${u}]`},{events:h,update:`[${s}[0], clamp(${u}, 0, ${c})]`}],[]);if(i){const d=n.signals.data,h=pg.defined(e),p=t.getScaleComponent(o),g=p?p.get("type"):void 0,m=r?{init:Mb(r,!0,l)}:{value:[]};return f.push({events:{signal:e.name+f6e},update:Hf(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...r?{init:Mb(r)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===xi?0:1,h=e.name+d6e,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}const pGt={defined:t=>t.type==="point",signals:(t,e,n)=>{const r=e.name,i=r+HR,o=e.project,s="(item().isVoronoi ? datum.datum : datum)",a=ws(t.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+q_):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let c=`unit: ${Gx(t)}, `;if(e.project.hasSelectionId)c+=`${Yf}: ${s}[${rt(Yf)}]`;else{const f=o.items.map(d=>{const h=t.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${rt(t.vgField(d.channel,{}))}], ${s}[${rt(t.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${rt(d.field)}]`}).join(", ");c+=`fields: ${i}, values: [${f}]`}const u=e.events;return n.concat([{name:r+vy,on:u?[{events:u,update:`${l} ? {${c}} : null`,force:!0}]:[]}])}};function FO({model:t,channelDef:e,vgChannel:n,invalidValueRef:r,mainRefFn:i}){const o=UR(e)&&e.condition;let s=[];o&&(s=pt(o).map(c=>{const u=i(c);if(r9t(c)){const{param:f,empty:d}=c;return{test:P6e(t,{param:f,empty:d}),...u}}else return{test:W5(t,c.test),...u}})),r!==void 0&&s.push(r);const a=i(e);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function Cae(t,e="text"){const n=t.encoding[e];return FO({model:t,channelDef:n,vgChannel:e,mainRefFn:r=>j6(r,t.config),invalidValueRef:void 0})}function j6(t,e,n="datum"){if(t){if(qf(t))return ni(t.value);if(en(t)){const{format:r,formatType:i}=F5(t);return iae({fieldOrDatumDef:t,format:r,formatType:i,expr:n,config:e})}}}function h6e(t,e={}){const{encoding:n,markDef:r,config:i,stack:o}=t,s=n.tooltip;if(We(s))return{tooltip:r0e({tooltip:s},o,i,e)};{const a=e.reactiveGeom?"datum.datum":"datum";return FO({model:t,channelDef:s,vgChannel:"tooltip",mainRefFn:c=>{const u=j6(c,i,a);if(u)return u;if(c===null)return;let f=Er("tooltip",r,i);if(f===!0&&(f={content:"encoding"}),gt(f))return{value:f};if(ht(f))return Rt(f)?f:f.content==="encoding"?r0e(n,o,i,e):{signal:a}},invalidValueRef:void 0})}}function p6e(t,e,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o=new Set,s=r?"datum.datum":"datum",a=[];function l(u,f){const d=x1(f),h=Ra(u)?u:{...u,type:t[d].type},p=h.title||lae(h,i),g=pt(p).join(", ").replaceAll(/"/g,'\\"');let m;if(Xi(f)){const v=f==="x"?"x2":"y2",y=Xf(t[v]);if(rs(h.bin)&&y){const x=ct(h,{expr:s}),b=ct(y,{expr:s}),{format:w,formatType:_}=F5(h);m=jR(x,b,w,_,i),o.add(v)}}if((Xi(f)||f===zu||f===ad)&&e&&e.fieldChannel===f&&e.offset==="normalize"){const{format:v,formatType:y}=F5(h);m=iae({fieldOrDatumDef:h,format:v,formatType:y,expr:s,config:i,normalizeStack:!0}).signal}m??(m=j6(h,i,s).signal),a.push({channel:f,key:g,value:m})}uae(t,(u,f)=>{Je(u)?l(u,f):P6(u)&&l(u.condition,f)});const c={};for(const{channel:u,key:f,value:d}of a)!o.has(u)&&!c[f]&&(c[f]=d);return c}function r0e(t,e,n,{reactiveGeom:r}={}){const i=p6e(t,e,n,{reactiveGeom:r}),o=hy(i).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function gGt(t){const{markDef:e,config:n}=t,r=Er("aria",e,n);return r===!1?{}:{...r?{aria:r}:{},...mGt(t),...vGt(t)}}function mGt(t){const{mark:e,markDef:n,config:r}=t;if(r.aria===!1)return{};const i=Er("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:vt(W8t,e)?{}:{ariaRoleDescription:{value:e}}}function vGt(t){const{encoding:e,markDef:n,config:r,stack:i}=t,o=e.description;if(o)return FO({model:t,channelDef:o,vgChannel:"description",mainRefFn:l=>j6(l,t.config),invalidValueRef:void 0});const s=Er("description",n,r);if(s!=null)return{description:ni(s)};if(r.aria===!1)return{};const a=p6e(e,i,r);if(!Tr(a))return{description:{signal:hy(a).map(([l,c],u)=>`"${u>0?"; ":""}${l}: " + (${c})`).join(" + ")}}}function us(t,e,n={}){const{markDef:r,encoding:i,config:o}=e,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;const c=i[t];a===void 0&&(l??(l=Er(t,r,o,{vgChannel:s,ignoreVgConfig:!UR(c)})),l!==void 0&&(a=ni(l)));const u={markDef:r,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t)},f=iBe({...u,scaleChannel:t,channelDef:c});return FO({model:e,channelDef:c,vgChannel:s??t,invalidValueRef:f,mainRefFn:h=>rae({...u,channel:t,channelDef:h,stack:null,defaultRef:a})})}function g6e(t,e={filled:void 0}){const{markDef:n,encoding:r,config:i}=t,{type:o}=n,s=e.filled??Er("filled",n,i),a=En(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=Er(s===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[s===!0&&"color"]??a,c=Er(s===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[s===!1&&"color"],u=s?"fill":"stroke",f={...l?{fill:ni(l)}:{},...c?{stroke:ni(c)}:{}};return n.color&&(s?n.fill:n.stroke)&&Ze(A4e("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...us("color",t,{vgChannel:u,defaultValue:s?l:c}),...us("fill",t,{defaultValue:r.fill?l:void 0}),...us("stroke",t,{defaultValue:r.stroke?c:void 0})}}function yGt(t){const{encoding:e,mark:n}=t,r=e.order;return!r0(n)&&qf(r)?FO({model:t,channelDef:r,vgChannel:"zindex",mainRefFn:i=>ni(i.value),invalidValueRef:void 0}):{}}function dC({channel:t,markDef:e,encoding:n={},model:r,bandPosition:i}){const o=`${t}Offset`,s=e[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:rae({channel:o,channelDef:a,markDef:e,config:r==null?void 0:r.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:ni(s),bandPosition:i})};const l=e[o];return l?{offsetType:"visual",offset:l}:{}}function Ca(t,e,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:s,stack:a}=e,l=i[t],c=i[Zh(t)],u=e.scaleName(t),f=e.getScaleComponent(t),{offset:d,offsetType:h}=dC({channel:t,markDef:o,encoding:i,model:e,bandPosition:.5}),p=Oae({model:e,defaultPos:n,channel:t,scaleName:u,scale:f}),g=!l&&Xi(t)&&(i.latitude||i.longitude)?{field:e.getName(t)}:xGt({channel:t,channelDef:l,channel2Def:c,markDef:o,config:s,scaleName:u,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[r||t]:g}:void 0}function xGt(t){const{channel:e,channelDef:n,scaleName:r,stack:i,offset:o,markDef:s}=t;if(en(n)&&i&&e===i.fieldChannel){if(Je(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(e==="radius"||e==="theta")&&(a=.5),a!==void 0)return I5({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Wx(n,r,{suffix:"end"},{offset:o})}return nae(t)}function Oae({model:t,defaultPos:e,channel:n,scaleName:r,scale:i}){const{markDef:o,config:s}=t;return()=>{const a=x1(n),l=py(n),c=Er(n,o,s,{vgChannel:l});if(c!==void 0)return mk(n,c);switch(e){case"zeroOrMin":return i0e({scaleName:r,scale:i,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return i0e({scaleName:r,scale:i,mode:{zeroOrMax:{widthSignal:t.width.signal,heightSignal:t.height.signal}},mainChannel:a,config:s});case"mid":return{...t[El(n)],mult:.5}}}}function i0e({mainChannel:t,config:e,...n}){const r=rBe(n),{mode:i}=n;if(r)return r;switch(t){case"radius":{if(i==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=i.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return i==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return i==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return i==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const bGt={left:"x",center:"xc",right:"x2"},wGt={top:"y",middle:"yc",bottom:"y2"};function m6e(t,e,n,r="middle"){if(t==="radius"||t==="theta")return py(t);const i=t==="x"?"align":"baseline",o=Er(i,e,n);let s;return Rt(o)?(Ze(wWt(i)),s=void 0):s=o,t==="x"?bGt[s||(r==="top"?"left":"center")]:wGt[s||r]}function B5(t,e,{defaultPos:n,defaultPos2:r,range:i}){return i?v6e(t,e,{defaultPos:n,defaultPos2:r}):Ca(t,e,{defaultPos:n})}function v6e(t,e,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=e,s=Zh(t),a=El(t),l=_Gt(e,r,s),c=l[a]?m6e(t,i,o):py(t);return{...Ca(t,e,{defaultPos:n,vgChannel:c}),...l}}function _Gt(t,e,n){const{encoding:r,mark:i,markDef:o,stack:s,config:a}=t,l=x1(n),c=El(n),u=py(n),f=r[l],d=t.scaleName(l),h=t.getScaleComponent(l),{offset:p}=n in r||n in o?dC({channel:n,markDef:o,encoding:r,model:t}):dC({channel:l,markDef:o,encoding:r,model:t});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){const m=El(n),v=t.markDef[m];return v!=null?{[m]:{value:v}}:{[u]:{field:t.getName(n)}}}const g=SGt({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[u]:g}:rL(n,o)||rL(n,{[n]:BY(n,o,a.style),[c]:BY(c,o,a.style)})||rL(n,a[i])||rL(n,a.mark)||{[u]:Oae({model:t,defaultPos:e,channel:n,scaleName:d,scale:h})()}}function SGt({channel:t,channelDef:e,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:c}){return en(e)&&a&&t.charAt(0)===a.fieldChannel.charAt(0)?Wx(e,o,{suffix:"start"},{offset:l}):nae({channel:t,channelDef:n,scaleName:o,scale:s,stack:a,markDef:r,config:i,offset:l,defaultRef:c})}function rL(t,e){const n=El(t),r=py(t);if(e[r]!==void 0)return{[r]:mk(t,e[r])};if(e[t]!==void 0)return{[r]:mk(t,e[t])};if(e[n]){const i=e[n];if(Ab(i))Ze(gWt(n));else return{[n]:mk(t,i)}}}function jg(t,e){const{config:n,encoding:r,markDef:i}=t,o=i.type,s=Zh(e),a=El(e),l=r[e],c=r[s],u=t.getScaleComponent(e),f=u?u.get("type"):void 0,d=i.orient,h=r[a]??r.size??Er("size",i,n,{vgChannel:a}),p=h4e(e),g=o==="bar"&&(e==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(e==="y"?d==="vertical":d==="horizontal");return Je(l)&&(qr(l.bin)||rs(l.bin)||l.timeUnit&&!c)&&!(h&&!Ab(h))&&!r[p]&&!Go(f)?EGt({fieldDef:l,fieldDef2:c,channel:e,model:t}):(en(l)&&Go(f)||g)&&!c?OGt(l,e,t):v6e(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function CGt(t,e,n,r,i,o,s){if(Ab(i))if(n){const l=n.get("type");if(l==="band"){let c=`bandwidth('${e}')`;i.band!==1&&(c=`${i.band} * ${c}`);const u=Ih("minBandSize",{type:s},r);return{signal:u?`max(${Ef(u)}, ${c})`:c}}else i.band!==1&&(Ze(OWt(l)),i=void 0)}else return{mult:i.band,field:{group:t}};else{if(Rt(i))return i;if(i)return{value:i}}if(n){const l=n.get("range");if(w1(l)&&Jn(l.step))return{value:l.step-2}}if(!o){const{bandPaddingInner:l,barBandPaddingInner:c,rectBandPaddingInner:u,tickBandPaddingInner:f}=r.scale,d=qi(l,s==="tick"?f:s==="bar"?c:u);if(Rt(d))return{signal:`(1 - (${d.signal})) * ${t}`};if(Jn(d))return{signal:`${1-d} * ${t}`}}return{value:XY(r.view,t)-2}}function OGt(t,e,n){var k,E;const{markDef:r,encoding:i,config:o,stack:s}=n,a=r.orient,l=n.scaleName(e),c=n.getScaleComponent(e),u=El(e),f=Zh(e),d=h4e(e),h=n.scaleName(d),p=n.getScaleComponent(Mse(e)),g=r.type==="tick"||a==="horizontal"&&e==="y"||a==="vertical"&&e==="x";let m;(i.size||r.size)&&(g?m=us("size",n,{vgChannel:u,defaultRef:ni(r.size)}):Ze(AWt(r.type)));const v=!!m,y=fBe({channel:e,fieldDef:t,markDef:r,config:o,scaleType:(k=c||p)==null?void 0:k.get("type"),useVlSizeChannel:g});m=m||{[u]:CGt(u,h||l,p||c,o,y,!!t,r.type)};const x=((E=c||p)==null?void 0:E.get("type"))==="band"&&Ab(y)&&!v?"top":"middle",b=m6e(e,r,o,x),w=b==="xc"||b==="yc",{offset:_,offsetType:S}=dC({channel:e,markDef:r,encoding:i,model:n,bandPosition:w?.5:0}),O=nae({channel:e,channelDef:t,markDef:r,config:o,scaleName:l,scale:c,stack:s,offset:_,defaultRef:Oae({model:n,defaultPos:"mid",channel:e,scaleName:l,scale:c}),bandPosition:w?S==="encoding"?0:.5:Rt(y)?{signal:`(1-${y})/2`}:Ab(y)?(1-y.band)/2:0});if(u)return{[b]:O,...m};{const P=py(f),A=m[u],R=_?{...A,offset:_}:A;return{[b]:O,[P]:We(O)?[O[0],{...O[1],offset:R}]:{...O,offset:R}}}}function o0e(t,e,n,r,i,o,s){if(a4e(t))return 0;const a=t==="x"||t==="y2",l=a?-e/2:e/2;if(Rt(n)||Rt(i)||Rt(r)||o){const c=Ef(n),u=Ef(i),f=Ef(r),d=Ef(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${l})`:l,g=f?`${f} + `:"",m=c?`(${c} ? -1 : 1) * `:"",v=u?`(${u} + ${p})`:p;return{signal:g+m+v}}else return i=i||0,r+(n?-i-l:+i+l)}function EGt({fieldDef:t,fieldDef2:e,channel:n,model:r}){var E;const{config:i,markDef:o,encoding:s}=r,a=r.getScaleComponent(n),l=r.scaleName(n),c=a?a.get("type"):void 0,u=a.get("reverse"),f=fBe({channel:n,fieldDef:t,markDef:o,config:i,scaleType:c}),d=(E=r.component.axes[n])==null?void 0:E[0],h=(d==null?void 0:d.get("translate"))??.5,p=Xi(n)?Er("binSpacing",o,i)??0:0,g=Zh(n),m=py(n),v=py(g),y=Ih("minBandSize",o,i),{offset:x}=dC({channel:n,markDef:o,encoding:s,model:r,bandPosition:0}),{offset:b}=dC({channel:g,markDef:o,encoding:s,model:r,bandPosition:0}),w=KVt({fieldDef:t,scaleName:l}),_=o0e(n,p,u,h,x,y,w),S=o0e(g,p,u,h,b??x,y,w),O=Rt(f)?{signal:`(1-${f.signal})/2`}:Ab(f)?(1-f.band)/2:.5,k=gy({fieldDef:t,fieldDef2:e,markDef:o,config:i});if(qr(t.bin)||t.timeUnit){const P=t.timeUnit&&k!==.5;return{[v]:s0e({fieldDef:t,scaleName:l,bandPosition:O,offset:S,useRectOffsetField:P}),[m]:s0e({fieldDef:t,scaleName:l,bandPosition:Rt(O)?{signal:`1-${O.signal}`}:1-O,offset:_,useRectOffsetField:P})}}else if(rs(t.bin)){const P=Wx(t,l,{},{offset:S});if(Je(e))return{[v]:P,[m]:Wx(e,l,{},{offset:_})};if(b1(t.bin)&&t.bin.step)return{[v]:P,[m]:{signal:`scale("${l}", ${ct(t,{expr:"datum"})} + ${t.bin.step})`,offset:_}}}Ze(R4e(g))}function s0e({fieldDef:t,scaleName:e,bandPosition:n,offset:r,useRectOffsetField:i}){return I5({scaleName:e,fieldOrDatumDef:t,bandPosition:n,offset:r,...i?{startSuffix:N6,endSuffix:z6}:{}})}const TGt=new Set(["aria","width","height"]);function ju(t,e){const{fill:n=void 0,stroke:r=void 0}=e.color==="include"?g6e(t):{};return{...kGt(t.markDef,e),...a0e("fill",n),...a0e("stroke",r),...us("opacity",t),...us("fillOpacity",t),...us("strokeOpacity",t),...us("strokeWidth",t),...us("strokeDash",t),...yGt(t),...h6e(t),...Cae(t,"href"),...gGt(t)}}function a0e(t,e){return e?{[t]:e}:{}}function kGt(t,e){return U8t.reduce((n,r)=>(!TGt.has(r)&&Ke(t,r)&&e[r]!=="ignore"&&(n[r]=ni(t[r])),n),{})}function Eae(t){const{config:e,markDef:n}=t,r=new Set;if(t.forEachFieldDef((i,o)=>{var c;let s;if(!Jh(o)||!(s=t.getScaleType(o)))return;const a=x6(i.aggregate),l=tae({scaleChannel:o,markDef:n,config:e,scaleType:s,isCountAggregate:a});if(XVt(l)){const u=t.vgField(o,{expr:"datum",binSuffix:(c=t.stack)!=null&&c.impute?"mid":void 0});u&&r.add(u)}}),r.size>0)return{defined:{signal:[...r].map(o=>S6(o,!0)).join(" && ")}}}function l0e(t,e){if(e!==void 0)return{[t]:ni(e)}}const KV="voronoi",y6e={defined:t=>t.type==="point"&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName(KV)},marks:(t,e,n)=>{const{x:r,y:i}=e.project.hasChannel,o=t.mark;if(r0(o))return Ze(X8t(o)),n;const s={name:t.getName(KV),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...h6e(t,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((c,u)=>{const f=c.name??"";f===t.component.mark[0].name?a=u:f.includes(KV)&&(l=!0)}),l||n.splice(a+1,0,s),n}},x6e={defined:t=>t.type==="point"&&t.resolve==="global"&&t.bind&&t.bind!=="scales"&&!mae(t.bind),parse:(t,e,n)=>T6e(e,n),topLevelSignals:(t,e,n)=>{const r=e.name,i=e.project,o=e.bind,s=e.init&&e.init[0],a=y6e.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((l,c)=>{const u=gi(`${r}_${l.field}`);n.filter(d=>d.name===u).length||n.unshift({name:u,...s?{init:Mb(s[c])}:{value:null},on:e.events?[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${rt(l.field)}] : null`}]:[],bind:o[l.field]??o[l.channel]??o})}),n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(c=>c.name===r+vy),s=r+HR,a=i.items.map(c=>gi(`${r}_${c.field}`)),l=a.map(c=>`${c} !== null`).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},U5="_toggle",b6e={defined:t=>t.type==="point"&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+U5,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+vy,r=e.name+U5;return`${r} ? null : ${n}, `+(e.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${Gx(t)}}, `)+`${r} ? ${n} : null`}},AGt={defined:t=>t.clear!==void 0&&t.clear!==!1,parse:(t,e)=>{e.clear&&(e.clear=gt(e.clear)?Qy(e.clear,"view"):e.clear)},topLevelSignals:(t,e,n)=>{if(x6e.defined(e))for(const r of e.project.items){const i=n.findIndex(o=>o.name===gi(`${e.name}_${r.field}`));i!==-1&&n[i].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:e.clear,update:o})}if(e.type==="interval")for(const i of e.project.items){const o=n.findIndex(s=>s.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===i.signals.data);r(s,"null")}}else{let i=n.findIndex(o=>o.name===e.name+vy);r(i,"null"),b6e.defined(e)&&(i=n.findIndex(o=>o.name===e.name+U5),r(i,"false"))}return n}},w6e={defined:t=>{const e=t.resolve==="global"&&t.bind&&mae(t.bind),n=t.project.items.length===1&&t.project.items[0].field!==Yf;return e&&!n&&Ze(Z8t),e&&n},parse:(t,e,n)=>{const r=Kt(n);if(r.select=gt(r.select)?{type:r.select,toggle:e.toggle}:{...r.select,toggle:e.toggle},T6e(e,r),ht(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of e.events)a.filter=pt(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const i=qV(e.bind)?e.bind.legend:"click",o=gt(i)?Qy(i,"view"):pt(i);e.bind={legend:{merge:o}}},topLevelSignals:(t,e,n)=>{const r=e.name,i=qV(e.bind)&&e.bind.legend,o=s=>a=>{const l=Kt(a);return l.markname=s,l};for(const s of e.project.items){if(!s.hasLegend)continue;const a=`${gi(s.field)}_legend`,l=`${r}_${a}`;if(n.filter(u=>u.name===l).length===0){const u=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:l,...e.init?{}:{value:null},on:[{events:u,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(d=>d.name===r+vy),s=r+HR,a=i.items.filter(d=>d.hasLegend).map(d=>gi(`${r}_${gi(d.field)}_legend`)),c=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;e.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:c}):a.length>0&&(o.update=c,delete o.value,delete o.on);const u=n.find(d=>d.name===r+U5),f=qV(e.bind)&&e.bind.legend;return u&&(e.events?u.on.push({...u.on[0],events:f}):u.on[0].events=f),n}};function PGt(t,e,n){var i;const r=(i=t.fieldDef(e))==null?void 0:i.field;for(const o of ws(t.component.selection??{})){const s=o.project.hasField[r]??o.project.hasChannel[e];if(s&&w6e.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const _6e="_translate_anchor",S6e="_translate_delta",MGt={defined:t=>t.type==="interval"&&t.translate,signals:(t,e,n)=>{const r=e.name,i=pg.defined(e),o=r+_6e,{x:s,y:a}=e.project.hasChannel;let l=Qy(e.translate,"scope");return i||(l=l.map(c=>(c.between[0].markname=r+q_,c))),n.push({name:o,value:{},on:[{events:l.map(c=>c.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${i?ZY(t,xi):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${i?ZY(t,Qo):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:r+S6e,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&c0e(t,e,s,"width",n),a!==void 0&&c0e(t,e,a,"height",n),n}};function c0e(t,e,n,r,i){const o=e.name,s=o+_6e,a=o+S6e,l=n.channel,c=pg.defined(e),u=i.find(w=>w.name===n.signals[c?"data":"visual"]),f=t.getSizeSignalRef(r).signal,d=t.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=c?l===xi?p?"":"-":p?"-":"":"",m=`${s}.extent_${l}`,v=`${g}${a}.${l} / ${c?`${f}`:`span(${m})`}`,y=!c||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",x=c?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",b=`${y}(${m}, ${v}${x})`;u.on.push({events:{signal:a},update:c?b:`clampRange(${b}, 0, ${f})`})}const C6e="_zoom_anchor",O6e="_zoom_delta",RGt={defined:t=>t.type==="interval"&&t.zoom,signals:(t,e,n)=>{const r=e.name,i=pg.defined(e),o=r+O6e,{x:s,y:a}=e.project.hasChannel,l=rt(t.scaleName(xi)),c=rt(t.scaleName(Qo));let u=Qy(e.zoom,"scope");return i||(u=u.map(f=>(f.markname=r+q_,f))),n.push({name:r+C6e,on:[{events:u,update:i?"{"+[l?`x: invert(${l}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&u0e(t,e,s,"width",n),a!==void 0&&u0e(t,e,a,"height",n),n}};function u0e(t,e,n,r,i){const o=e.name,s=n.channel,a=pg.defined(e),l=i.find(y=>y.name===n.signals[a?"data":"visual"]),c=t.getSizeSignalRef(r).signal,u=t.getScaleComponent(s),f=u&&u.get("type"),d=a?ZY(t,s):l.name,h=o+O6e,p=`${o}${C6e}.${s}`,g=!a||!u?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${u.get("exponent")??1}`:f==="symlog"?`, ${u.get("constant")??1}`:"":"",v=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?v:`clampRange(${v}, 0, ${c})`})}const Rb="_store",vy="_tuple",DGt="_modify",E6e="vlSelectionResolve",B6=[pGt,dGt,uGt,b6e,x6e,pg,w6e,AGt,MGt,RGt,y6e];function IGt(t){let e=t.parent;for(;e&&!gc(e);)e=e.parent;return e}function Gx(t,{escape:e}={escape:!0}){let n=e?rt(t.name):t.name;const r=IGt(t);if(r){const{facet:i}=r;for(const o of su)i[o]&&(n+=` + '__facet_${o}_' + (facet[${rt(r.vgField(o))}])`)}return n}function Tae(t){return ws(t.component.selection??{}).reduce((e,n)=>e||n.project.hasSelectionId,!1)}function T6e(t,e){(gt(e.select)||!e.select.on)&&delete t.events,(gt(e.select)||!e.select.clear)&&delete t.clear,(gt(e.select)||!e.select.toggle)&&delete t.toggle}function JY(t){const e=[];return t.type==="Identifier"?[t.name]:t.type==="Literal"?[t.value]:(t.type==="MemberExpression"&&(e.push(...JY(t.object)),e.push(...JY(t.property))),e)}function k6e(t){return t.object.type==="MemberExpression"?k6e(t.object):t.object.name==="datum"}function A6e(t){const e=qoe(t),n=new Set;return e.visit(r=>{r.type==="MemberExpression"&&k6e(r)&&n.add(JY(r).slice(1).join("."))}),n}class NO extends Sr{clone(){return new NO(null,this.model,Kt(this.filter))}constructor(e,n,r){super(e),this.model=n,this.filter=r,this.expr=W5(this.model,this.filter,this),this._dependentFields=A6e(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function LGt(t,e){const n={},r=t.config.selection;if(!e||!e.length)return n;for(const i of e){const o=gi(i.name),s=i.select,a=gt(s)?s:s.type,l=ht(s)?Kt(s):{type:a},c=r[a];for(const d in c)d==="fields"||d==="encodings"||(d==="mark"&&(l.mark={...c.mark,...l.mark}),(l[d]===void 0||l[d]===!0)&&(l[d]=Kt(c[d]??l[d])));const u=n[o]={...l,name:o,type:a,init:i.value,bind:i.bind,events:gt(l.on)?Qy(l.on,"scope"):pt(Kt(l.on))},f=Kt(i);for(const d of B6)d.defined(u)&&d.parse&&d.parse(t,u,f)}return n}function P6e(t,e,n,r="datum"){const i=gt(e)?e:e.param,o=gi(i),s=rt(o+Rb);let a;try{a=t.getSelectionComponent(o,i)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??t.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",c=a.resolve==="global"?")":`, ${rt(a.resolve)})`,u=`${l}${s}, ${r}${c}`,f=`length(data(${s}))`;return e.empty===!1?`${f} && ${u}`:`!${f} || ${u}`}function M6e(t,e,n){const r=gi(e),i=n.encoding;let o=n.field,s;try{s=t.getSelectionComponent(r,e)}catch{return r}if(!i&&!o)o=s.project.items[0].field,s.project.items.length>1&&Ze(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${rt(o)}.`);else if(i&&!o){const a=s.project.items.filter(l=>l.channel===i);!a.length||a.length>1?(o=s.project.items[0].field,Ze((a.length?"Multiple ":"No ")+`matching ${rt(i)} encoding found for selection ${rt(n.param)}. Using "field": ${rt(o)}.`)):o=a[0].field}return`${s.name}[${rt(Pu(o))}]`}function $Gt(t,e){for(const[n,r]of hy(t.component.selection??{})){const i=t.getName(`lookup_${n}`);t.component.data.outputNodes[i]=r.materialized=new gl(new NO(e,t,{param:n}),i,$i.Lookup,t.component.data.outputNodeRefCounts)}}function W5(t,e,n){return gk(e,r=>gt(r)?r:dVt(r)?P6e(t,r,n):V4e(r))}function FGt(t,e){if(t)return We(t)&&!Km(t)?t.map(n=>lae(n,e)).join(", "):t}function ZV(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}function wT(t,e,n,r={header:!1}){var f,d;const{disable:i,orient:o,scale:s,labelExpr:a,title:l,zindex:c,...u}=t.combine();if(!i){for(const h in u){const p=h,g=v9t[p],m=u[p];if(g&&g!==e&&g!=="both")delete u[p];else if(GR(m)){const{condition:v,...y}=m,x=pt(v),b=Fye[p];if(b){const{vgProp:w,part:_}=b,S=[...x.map(O=>{const{test:k,...E}=O;return{test:W5(null,k),...E}}),y];ZV(u,_,w,S),delete u[p]}else if(b===null){const w={signal:x.map(_=>{const{test:S,...O}=_;return`${W5(null,S)} ? ${wye(O)} : `}).join("")+wye(y)};u[p]=w}}else if(Rt(m)){const v=Fye[p];if(v){const{vgProp:y,part:x}=v;ZV(u,x,y,m),delete u[p]}}En(["labelAlign","labelBaseline"],p)&&u[p]===null&&delete u[p]}if(e==="grid"){if(!u.grid)return;if(u.encode){const{grid:h}=u.encode;u.encode={...h?{grid:h}:{}},Tr(u.encode)&&delete u.encode}return{scale:s,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:qi(c,0)}}else{if(!r.header&&t.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=u.encode)==null?void 0:f.labels)!=null&&d.update&&Rt(u.encode.labels.update.text)&&(p=Ob(a,"datum.label",u.encode.labels.update.text.signal)),ZV(u,"labels","text",{signal:p})}if(u.labelAlign===null&&delete u.labelAlign,u.encode){for(const p of wBe)t.hasAxisPart(p)||delete u.encode[p];Tr(u.encode)&&delete u.encode}const h=FGt(l,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...u,...n.aria===!1?{aria:!1}:{},zindex:qi(c,0)}}}}function R6e(t){const{axes:e}=t.component,n=[];for(const r of tm)if(e[r]){for(const i of e[r])if(!i.get("disable")&&!i.get("gridScale")){const o=r==="x"?"height":"width",s=t.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function NGt(t,e){const{x:n=[],y:r=[]}=t;return[...n.map(i=>wT(i,"grid",e)),...r.map(i=>wT(i,"grid",e)),...n.map(i=>wT(i,"main",e)),...r.map(i=>wT(i,"main",e))].filter(i=>i)}function f0e(t,e,n,r){return Object.assign.apply(null,[{},...t.map(i=>{if(i==="axisOrient"){const o=n==="x"?"bottom":"left",s=e[n==="x"?"axisBottom":"axisLeft"]||{},a=e[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...Qe(s),...Qe(a)]),c={};for(const u of l.values())c[u]={signal:`${r.signal} === "${o}" ? ${Ef(s[u])} : ${Ef(a[u])}`};return c}return e[i]})])}function zGt(t,e,n,r){const i=e==="band"?["axisDiscrete","axisBand"]:e==="point"?["axisDiscrete","axisPoint"]:X4e(e)?["axisQuantitative"]:e==="time"||e==="utc"?["axisTemporal"]:[],o=t==="x"?"axisX":"axisY",s=Rt(n)?"axisOrient":`axis${IR(n)}`,a=[...i,...i.map(c=>o+c.substr(4))],l=["axis",s,o];return{vlOnlyAxisConfig:f0e(a,r,t,n),vgAxisConfig:f0e(l,r,t,n),axisConfigStyle:jGt([...l,...a],r)}}function jGt(t,e){var r;const n=[{}];for(const i of t){let o=(r=e[i])==null?void 0:r.style;if(o){o=pt(o);for(const s of o)n.push(e.style[s])}}return Object.assign.apply(null,n)}function eQ(t,e,n,r={}){var o;const i=_4e(t,n,e);if(i!==void 0)return{configFrom:"style",configValue:i};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=r[s])==null?void 0:o[t])!==void 0)return{configFrom:s,configValue:r[s][t]};return{}}const d0e={scale:({model:t,channel:e})=>t.scaleName(e),format:({format:t})=>t,formatType:({formatType:t})=>t,grid:({fieldOrDatumDef:t,axis:e,scaleType:n})=>e.grid??BGt(n,t),gridScale:({model:t,channel:e})=>UGt(t,e),labelAlign:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelAlign||I6e(e,n,r),labelAngle:({labelAngle:t})=>t,labelBaseline:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelBaseline||D6e(e,n,r),labelFlush:({axis:t,fieldOrDatumDef:e,channel:n})=>t.labelFlush??VGt(e.type,n),labelOverlap:({axis:t,fieldOrDatumDef:e,scaleType:n})=>t.labelOverlap??GGt(e.type,n,Je(e)&&!!e.timeUnit,Je(e)?e.sort:void 0),orient:({orient:t})=>t,tickCount:({channel:t,model:e,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o=t==="x"?"width":t==="y"?"height":void 0,s=o?e.getSizeSignalRef(o):void 0;return n.tickCount??qGt({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},tickMinStep:XGt,title:({axis:t,model:e,channel:n})=>{if(t.title!==void 0)return t.title;const r=L6e(e,n);if(r!==void 0)return r;const i=e.typedFieldDef(n),o=n==="x"?"x2":"y2",s=e.fieldDef(o);return C4e(i?[Lye(i)]:[],Je(s)?[Lye(s)]:[])},values:({axis:t,fieldOrDatumDef:e})=>YGt(t,e),zindex:({axis:t,fieldOrDatumDef:e,mark:n})=>t.zindex??QGt(n,e)};function BGt(t,e){return!Go(t)&&Je(e)&&!qr(e==null?void 0:e.bin)&&!rs(e==null?void 0:e.bin)}function UGt(t,e){const n=e==="x"?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n)}function WGt(t,e,n,r,i){const o=e==null?void 0:e.labelAngle;if(o!==void 0)return Rt(o)?o:HA(o);{const{configValue:s}=eQ("labelAngle",r,e==null?void 0:e.style,i);return s!==void 0?HA(s):n===xi&&En([Qse,Yse],t.type)&&!(Je(t)&&t.timeUnit)?270:void 0}}function tQ(t){return`(((${t.signal} % 360) + 360) % 360)`}function D6e(t,e,n,r){if(t!==void 0)if(n==="x"){if(Rt(t)){const i=tQ(t),o=Rt(e)?`(${e.signal} === "top")`:e==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45{if(C1(r)&&uBe(r.sort)){const{field:o,timeUnit:s}=r,a=r.sort,l=a.map((c,u)=>`${V4e({field:o,timeUnit:s,equal:c})} ? ${u} : `).join("")+a.length;e=new hC(e,{calculate:l,as:pC(r,i,{forAs:!0})})}}),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Mn(this.transform)}`}}function pC(t,e,n){return ct(t,{prefix:e,suffix:"sort_index",...n})}function U6(t,e){return En(["top","bottom"],e)?"column":En(["left","right"],e)||t==="row"?"row":"column"}function gC(t,e,n,r){const i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return qi((e||{})[t],i[t],n.header[t])}function W6(t,e,n,r){const i={};for(const o of t){const s=gC(o,e||{},n,r);s!==void 0&&(i[o]=s)}return i}const kae=["row","column"],Aae=["header","footer"];function KGt(t,e){const n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=W6(["titleAnchor","titleAngle","titleOrient"],i.header,r,e),l=U6(e,a),c=HA(s);return{name:`${e}-title`,type:"group",role:`${l}-title`,title:{text:n,...e==="row"?{orient:"left"}:{},style:"guide-title",...F6e(c,l),...$6e(l,c,o),...N6e(r,i,e,z9t,zBe)}}}function $6e(t,e,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=I6e(e,t==="row"?"left":"top",t==="row"?"y":"x");return r?{align:r}:{}}function F6e(t,e){const n=D6e(t,e==="row"?"left":"top",e==="row"?"y":"x",!0);return n?{baseline:n}:{}}function ZGt(t,e){const n=t.component.layoutHeaders[e],r=[];for(const i of Aae)if(n[i])for(const o of n[i]){const s=eHt(t,e,i,n,o);s!=null&&r.push(s)}return r}function JGt(t,e){const{sort:n}=t;return hg(n)?{field:ct(n,{expr:"datum"}),order:n.order??"ascending"}:We(n)?{field:pC(t,e,{expr:"datum"}),order:"ascending"}:{field:ct(t,{expr:"datum"}),order:n??"ascending"}}function nQ(t,e,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=W6(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),c=iae({fieldOrDatumDef:t,format:r,formatType:i,expr:"parent",config:n}).signal,u=U6(e,a);return{text:{signal:l?Ob(Ob(l,"datum.label",c),"datum.value",ct(t,{expr:"parent"})):c},...e==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...F6e(o,u),...$6e(u,o,s),...N6e(n,t,e,j9t,jBe)}}function eHt(t,e,n,r,i){if(i){let o=null;const{facetFieldDef:s}=r,a=t.config?t.config:void 0;if(s&&i.labels){const{labelOrient:f}=W6(["labelOrient"],s.header,a,e);(e==="row"&&!En(["top","bottom"],f)||e==="column"&&!En(["left","right"],f))&&(o=nQ(s,e,a))}const l=gc(t)&&!BR(t.facet),c=i.axes,u=(c==null?void 0:c.length)>0;if(o||u){const f=e==="row"?"height":"width";return{name:t.getName(`${e}_${n}`),type:"group",role:`${e}-${n}`,...r.facetFieldDef?{from:{data:t.getName(`${e}_domain`)},sort:JGt(s,e)}:{},...u&&l?{from:{data:t.getName(`facet_domain_${e}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...u?{axes:c}:{}}}}return null}const tHt={column:{start:0,end:1},row:{start:1,end:0}};function nHt(t,e){return tHt[e][t]}function rHt(t,e){const n={};for(const r of su){const i=t[r];if(i!=null&&i.facetFieldDef){const{titleAnchor:o,titleOrient:s}=W6(["titleAnchor","titleOrient"],i.facetFieldDef.header,e,r),a=U6(r,s),l=nHt(o,a);l!==void 0&&(n[a]=l)}}return Tr(n)?void 0:n}function N6e(t,e,n,r,i){const o={};for(const s of r){if(!i[s])continue;const a=gC(s,e==null?void 0:e.header,t,n);a!==void 0&&(o[i[s]]=a)}return o}function Pae(t){return[...iL(t,"width"),...iL(t,"height"),...iL(t,"childWidth"),...iL(t,"childHeight")]}function iL(t,e){const n=e==="width"?"x":"y",r=t.component.layoutSize.get(e);if(!r||r==="merged")return[];const i=t.getSizeSignalRef(e).signal;if(r==="step"){const o=t.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(Go(s)&&w1(a)){const l=t.scaleName(n);return gc(t.parent)&&t.parent.component.resolve.scale[n]==="independent"?[h0e(l,a)]:[h0e(l,a),{name:i,update:z6e(l,o,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){const o=i.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=qY(t.config.view,o?"width":"height"),l=`isFinite(${s}) ? ${s} : ${a}`;return[{name:i,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:i,value:r}]}function h0e(t,e){const n=`${t}_step`;return Rt(e.step)?{name:n,update:e.step.signal}:{name:n,value:e.step}}function z6e(t,e,n){const r=e.get("type"),i=e.get("padding"),o=qi(e.get("paddingOuter"),i);let s=e.get("paddingInner");return s=r==="band"?s!==void 0?s:i:1,`bandspace(${n}, ${Ef(s)}, ${Ef(o)}) * ${t}_step`}function j6e(t){return t==="childWidth"?"width":t==="childHeight"?"height":t}function B6e(t,e){return Qe(t).reduce((n,r)=>({...n,...FO({model:e,channelDef:t[r],vgChannel:r,mainRefFn:i=>ni(i.value),invalidValueRef:void 0})}),{})}function U6e(t,e){if(gc(e))return t==="theta"?"independent":"shared";if(BO(e))return"shared";if(Fae(e))return Xi(t)||t==="theta"||t==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Mae(t,e){const n=t.scale[e],r=Xi(e)?"axis":"legend";return n==="independent"?(t[r][e]==="shared"&&Ze(IWt(e)),"independent"):t[r][e]||"shared"}const iHt={...W9t,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},W6e=Qe(iHt);class oHt extends rm{}const p0e={symbols:sHt,gradient:aHt,labels:lHt,entries:cHt};function sHt(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:l,mark:c}=n,u=s.filled&&c!=="trail";let f={...G8t({},n,NVt),...g6e(n,{filled:u})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?V6e(a.opacity)??s.opacity:void 0;if(f.fill){if(r==="fill"||u&&r===Cl)delete f.fill;else if(Ke(f.fill,"field"))h?delete f.fill:(f.fill=ni(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=ni(g??1));else if(We(f.fill)){const m=rQ(a.fill??a.color)??s.fill??(u&&s.color);m&&(f.fill=ni(m))}}if(f.stroke){if(r==="stroke"||!u&&r===Cl)delete f.stroke;else if(Ke(f.stroke,"field")||p)delete f.stroke;else if(We(f.stroke)){const m=qi(rQ(a.stroke||a.color),s.stroke,u?s.color:void 0);m&&(f.stroke={value:m})}}if(r!==em){const m=Je(e)&&H6e(n,i,e);m?f.opacity=[{test:m,...ni(g??1)},ni(l.legend.unselectedOpacity)]:g&&(f.opacity=ni(g))}return f={...f,...t},Tr(f)?void 0:f}function aHt(t,{model:e,legendType:n,legendCmpt:r}){if(n!=="gradient")return;const{config:i,markDef:o,encoding:s}=e;let a={};const c=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?V6e(s.opacity)||o.opacity:void 0;return c&&(a.opacity=ni(c)),a={...a,...t},Tr(a)?void 0:a}function lHt(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},s=n.config,a=Je(e)?H6e(n,i,e):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:c,formatType:u}=o;let f;Pb(u)?f=Tf({fieldOrDatumDef:e,field:"datum.value",format:c,formatType:u,config:s}):c===void 0&&u===void 0&&s.customFormatTypes&&(e.type==="quantitative"&&s.numberFormatType?f=Tf({fieldOrDatumDef:e,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):e.type==="temporal"&&s.timeFormatType&&Je(e)&&e.timeUnit===void 0&&(f=Tf({fieldOrDatumDef:e,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...t};return Tr(d)?void 0:d}function cHt(t,{legendCmpt:e}){const n=e.get("selections");return n!=null&&n.length?{...t,fill:{value:"transparent"}}:t}function V6e(t){return G6e(t,(e,n)=>Math.max(e,n.value))}function rQ(t){return G6e(t,(e,n)=>qi(e,n.value))}function G6e(t,e){if(o9t(t))return pt(t.condition).reduce(e,t.value);if(qf(t))return t.value}function H6e(t,e,n){const r=e.get("selections");if(!(r!=null&&r.length))return;const i=rt(n.field);return r.map(o=>`(!length(data(${rt(gi(o)+Rb)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}const g0e={direction:({direction:t})=>t,format:({fieldOrDatumDef:t,legend:e,config:n})=>{const{format:r,formatType:i}=e;return aBe(t,t.type,r,i,n,!1)},formatType:({legend:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:r}=t;return lBe(r,e,n)},gradientLength:t=>{const{legend:e,legendConfig:n}=t;return e.gradientLength??n.gradientLength??mHt(t)},labelOverlap:({legend:t,legendConfig:e,scaleType:n})=>t.labelOverlap??e.labelOverlap??vHt(n),symbolType:({legend:t,markDef:e,channel:n,encoding:r})=>t.symbolType??fHt(e.type,n,r.shape,e.shape),title:({fieldOrDatumDef:t,config:e})=>H_(t,e,{allowDisabling:!0}),type:({legendType:t,scaleType:e,channel:n})=>{if(G_(n)&&eh(e)){if(t==="gradient")return}else if(t==="symbol")return;return t},values:({fieldOrDatumDef:t,legend:e})=>uHt(e,t)};function uHt(t,e){const n=t.values;if(We(n))return bBe(e,n);if(Rt(n))return n}function fHt(t,e,n,r){if(e!=="shape"){const i=rQ(n)??r;if(i)return i}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function dHt(t){const{legend:e}=t;return qi(e.type,hHt(t))}function hHt({channel:t,timeUnit:e,scaleType:n}){if(G_(t)){if(En(["quarter","month","day"],e))return"symbol";if(eh(n))return"gradient"}return"symbol"}function pHt({legendConfig:t,legendType:e,orient:n,legend:r}){return r.direction??t[e?"gradientDirection":"symbolDirection"]??gHt(n,e)}function gHt(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return e==="gradient"?"horizontal":void 0}}function mHt({legendConfig:t,model:e,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=t;if(eh(i))return n==="horizontal"?r==="top"||r==="bottom"?m0e(e,"width",s,o):s:m0e(e,"height",l,a)}function m0e(t,e,n,r){return{signal:`clamp(${t.getSizeSignalRef(e).signal}, ${n}, ${r})`}}function vHt(t){if(En(["quantile","threshold","log","symlog"],t))return"greedy"}function q6e(t){const e=_i(t)?yHt(t):_Ht(t);return t.component.legends=e,e}function yHt(t){const{encoding:e}=t,n={};for(const r of[Cl,...UBe]){const i=_o(e[r]);!i||!t.getScaleComponent(r)||r===Ol&&Je(i)&&i.type===$O||(n[r]=wHt(t,r))}return n}function xHt(t,e){const n=t.scaleName(e);if(t.mark==="trail"){if(e==="color")return{stroke:n};if(e==="size")return{strokeWidth:n}}return e==="color"?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}function bHt(t,e,n,r){switch(e){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(e==="title"&&t===(r==null?void 0:r.title))return!0}return t===(n||{})[e]}function wHt(t,e){var b;let n=t.legend(e);const{markDef:r,encoding:i,config:o}=t,s=o.legend,a=new oHt({},xHt(t,e));PGt(t,e,a);const l=n!==void 0?!n:s.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const c=t.getScaleComponent(e).get("type"),u=_o(i[e]),f=Je(u)?(b=Vo(u.timeUnit))==null?void 0:b.unit:void 0,d=n.orient||o.legend.orient||"right",h=dHt({legend:n,channel:e,timeUnit:f,scaleType:c}),p=pHt({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:e,model:t,markDef:r,encoding:i,fieldOrDatumDef:u,legendConfig:s,config:o,scaleType:c,orient:d,legendType:h,direction:p};for(const w of W6e){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const _=w in g0e?g0e[w](g):n[w];if(_!==void 0){const S=bHt(_,w,n,t.fieldDef(e));(S||o.legend[w]===void 0)&&a.set(w,_,S)}}const m=(n==null?void 0:n.encoding)??{},v=a.get("selections"),y={},x={fieldOrDatumDef:u,model:t,channel:e,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const _=B6e(m[w]??{},t),S=w in p0e?p0e[w](_,x):_;S!==void 0&&!Tr(S)&&(y[w]={...v!=null&&v.length&&Je(u)?{name:`${gi(u.field)}_legend_${w}`}:{},...v!=null&&v.length?{interactive:!!v}:{},update:S})}return Tr(y)||a.set("encode",y,!!(n!=null&&n.encoding)),a}function _Ht(t){const{legends:e,resolve:n}=t.component;for(const r of t.children){q6e(r);for(const i of Qe(r.component.legends))n.legend[i]=Mae(t.component.resolve,i),n.legend[i]==="shared"&&(e[i]=X6e(e[i],r.component.legends[i]),e[i]||(n.legend[i]="independent",delete e[i]))}for(const r of Qe(e))for(const i of t.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return e}function X6e(t,e){var o,s,a,l;if(!t)return e.clone();const n=t.getWithExplicit("orient"),r=e.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const c of W6e){const u=my(t.getWithExplicit(c),e.getWithExplicit(c),c,"legend",(f,d)=>{switch(c){case"symbolType":return SHt(f,d);case"title":return E4e(f,d);case"type":return i=!0,Vl("symbol")}return F6(f,d,c,"legend")});t.setWithExplicit(c,u)}return i&&((s=(o=t.implicit)==null?void 0:o.encode)!=null&&s.gradient&&M5(t.implicit,["encode","gradient"]),(l=(a=t.explicit)==null?void 0:a.encode)!=null&&l.gradient&&M5(t.explicit,["encode","gradient"])),t}function SHt(t,e){return e.value==="circle"?e:t}function CHt(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}function Y6e(t){const e=t.component.legends,n={};for(const i of Qe(e)){const o=t.getScaleComponent(i),s=kr(o.get("domains"));if(n[s])for(const a of n[s])X6e(a,e[i])||n[s].push(e[i]);else n[s]=[e[i].clone()]}return ws(n).flat().map(i=>OHt(i,t.config)).filter(i=>i!==void 0)}function OHt(t,e){var s,a,l;const{disable:n,labelExpr:r,selections:i,...o}=t.combine();if(!n){if(e.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const c=o.encode.symbols.update;c.fill&&c.fill.value!=="transparent"&&!c.stroke&&!o.stroke&&(c.stroke={value:"transparent"});for(const u of UBe)o[u]&&delete c[u]}if(o.title||delete o.title,r!==void 0){let c=r;(l=(a=o.encode)==null?void 0:a.labels)!=null&&l.update&&Rt(o.encode.labels.update.text)&&(c=Ob(r,"datum.label",o.encode.labels.update.text.signal)),CHt(o,"labels","text",{signal:c})}return o}}function EHt(t){return BO(t)||Fae(t)?THt(t):Q6e(t)}function THt(t){return t.children.reduce((e,n)=>e.concat(n.assembleProjections()),Q6e(t))}function Q6e(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:r}=n;if(e.data){const i={signal:`[${e.size.map(s=>s.signal).join(", ")}]`},o=e.data.reduce((s,a)=>{const l=Rt(a)?a.signal:`data('${t.lookupDataSource(a)}')`;return En(s,l)||s.push(l),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const kHt=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class K6e extends rm{constructor(e,n,r,i){super({...n},{name:e}),this.specifiedProjection=n,this.size=r,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function Z6e(t){t.component.projection=_i(t)?AHt(t):RHt(t)}function AHt(t){if(t.hasProjection){const e=os(t.specifiedProjection),n=!(e&&(e.scale!=null||e.translate!=null)),r=n?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,i=n?PHt(t):void 0,o=new K6e(t.projectionName(!0),{...os(t.config.projection),...e},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function PHt(t){const e=[],{encoding:n}=t;for(const r of[[cd,ld],[Mu,ud]])(_o(n[r[0]])||_o(n[r[1]]))&&e.push({signal:t.getName(`geojson_${e.length}`)});return t.channelHasField(Ol)&&t.typedFieldDef(Ol).type===$O&&e.push({signal:t.getName(`geojson_${e.length}`)}),e.length===0&&e.push(t.requestDataName($i.Main)),e}function MHt(t,e){const n=Cse(kHt,i=>!!(!vt(t.explicit,i)&&!vt(e.explicit,i)||vt(t.explicit,i)&&vt(e.explicit,i)&&sc(t.get(i),e.get(i))));if(sc(t.size,e.size)){if(n)return t;if(sc(t.explicit,{}))return e;if(sc(e.explicit,{}))return t}return null}function RHt(t){if(t.children.length===0)return;let e;for(const r of t.children)Z6e(r);const n=Cse(t.children,r=>{const i=r.component.projection;if(i)if(e){const o=MHt(e,i);return o&&(e=o),!!o}else return e=i,!0;else return!0});if(e&&n){const r=t.projectionName(!0),i=new K6e(r,e.specifiedProjection,e.size,Kt(e.data));for(const o of t.children){const s=o.component.projection;s&&(s.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),r),s.merged=!0)}return i}}function DHt(t,e,n,r){if(VR(e,n)){const i=_i(t)?t.axis(n)??t.legend(n)??{}:{},o=ct(e,{expr:"datum"}),s=ct(e,{expr:"datum",binSuffix:"end"});return{formulaAs:ct(e,{binSuffix:"range",forAs:!0}),formula:jR(o,s,i.format,i.formatType,r)}}return{}}function J6e(t,e){return`${y4e(t)}_${e}`}function IHt(t,e){return{signal:t.getName(`${e}_bins`),extentSignal:t.getName(`${e}_extent`)}}function Rae(t,e,n){const r=M6(n,void 0)??{},i=J6e(r,e);return t.getName(`${i}_bins`)}function LHt(t){return"as"in t}function v0e(t,e,n){let r,i;LHt(t)?r=gt(t.as)?[t.as,`${t.as}_end`]:[t.as[0],t.as[1]]:r=[ct(t,{forAs:!0}),ct(t,{binSuffix:"end",forAs:!0})];const o={...M6(e,void 0)},s=J6e(o,t.field),{signal:a,extentSignal:l}=IHt(n,s);if(b6(o.extent)){const u=o.extent;i=M6e(n,u.param,u),delete o.extent}const c={bin:o,field:t.field,as:[r],...a?{signal:a}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}};return{key:s,binComponent:c}}class wh extends Sr{clone(){return new wh(null,Kt(this.bins))}constructor(e,n){super(e),this.bins=n}static makeFromEncoding(e,n){const r=n.reduceFieldDef((i,o,s)=>{if(Ra(o)&&qr(o.bin)){const{key:a,binComponent:l}=v0e(o,o.bin,n);i[a]={...l,...i[a],...DHt(n,o,s,n.config)}}return i},{});return Tr(r)?null:new wh(e,r)}static makeFromTransform(e,n,r){const{key:i,binComponent:o}=v0e(n,n.bin,r);return new wh(e,{[i]:o})}merge(e,n){for(const r of Qe(e.bins))r in this.bins?(n(e.bins[r].signal,this.bins[r].signal),this.bins[r].as=Jd([...this.bins[r].as,...e.bins[r].as],Mn)):this.bins[r]=e.bins[r];for(const r of e.children)e.removeChild(r),r.parent=this;e.remove()}producedFields(){return new Set(ws(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(ws(this.bins).map(e=>e.field))}hash(){return`Bin ${Mn(this.bins)}`}assemble(){return ws(this.bins).flatMap(e=>{const n=[],[r,...i]=e.as,{extent:o,...s}=e.bin,a={type:"bin",field:Pu(e.field),as:r,signal:e.signal,...b6(o)?{extent:null}:{extent:o},...e.span?{span:{signal:`span(${e.span})`}}:{},...s};!o&&e.extentSignal&&(n.push({type:"extent",field:Pu(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),n.push(a);for(const l of i)for(let c=0;c<2;c++)n.push({type:"formula",expr:ct({field:r[c]},{expr:"datum"}),as:l[c]});return e.formula&&n.push({type:"formula",expr:e.formula,as:e.formulaAs}),n})}}function $Ht(t,e,n,r){var o;const i=_i(r)?r.encoding[Zh(e)]:void 0;if(Ra(n)&&_i(r)&&dBe(n,i,r.markDef,r.config)){t.add(ct(n,{})),t.add(ct(n,{suffix:"end"}));const{mark:s,markDef:a,config:l}=r,c=gy({fieldDef:n,markDef:a,config:l});qA(s)&&c!==.5&&Xi(e)&&(t.add(ct(n,{suffix:N6})),t.add(ct(n,{suffix:z6}))),n.bin&&VR(n,e)&&t.add(ct(n,{binSuffix:"range"}))}else if(c4e(e)){const s=l4e(e);t.add(r.getName(s))}else t.add(ct(n));return C1(n)&&OVt((o=n.scale)==null?void 0:o.range)&&t.add(n.scale.range.field),t}function FHt(t,e){for(const n of Qe(e)){const r=e[n];for(const i of Qe(r))n in t?t[n][i]=new Set([...t[n][i]??[],...r[i]]):t[n]={[i]:r[i]}}}class Lf extends Sr{clone(){return new Lf(null,new Set(this.dimensions),Kt(this.measures))}constructor(e,n,r){super(e),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(e,n){let r=!1;n.forEachFieldDef(s=>{s.aggregate&&(r=!0)});const i={},o=new Set;return!r||(n.forEachFieldDef((s,a)=>{const{aggregate:l,field:c}=s;if(l)if(l==="count")i["*"]??(i["*"]={}),i["*"].count=new Set([ct(s,{forAs:!0})]);else{if(zg(l)||n0(l)){const u=zg(l)?"argmin":"argmax",f=l[u];i[f]??(i[f]={}),i[f][u]=new Set([ct({op:u,field:f},{forAs:!0})])}else i[c]??(i[c]={}),i[c][l]=new Set([ct(s,{forAs:!0})]);Jh(a)&&n.scaleDomain(a)==="unaggregated"&&(i[c]??(i[c]={}),i[c].min=new Set([ct({field:c,aggregate:"min"},{forAs:!0})]),i[c].max=new Set([ct({field:c,aggregate:"max"},{forAs:!0})]))}else $Ht(o,a,s,n)}),o.size+Qe(i).length===0)?null:new Lf(e,o,i)}static makeFromTransform(e,n){var r;const i=new Set,o={};for(const s of n.aggregate){const{op:a,field:l,as:c}=s;a&&(a==="count"?(o["*"]??(o["*"]={}),o["*"].count=new Set([c||ct(s,{forAs:!0})])):(o[l]??(o[l]={}),(r=o[l])[a]??(r[a]=new Set),o[l][a].add(c||ct(s,{forAs:!0}))))}for(const s of n.groupby??[])i.add(s);return i.size+Qe(o).length===0?null:new Lf(e,i,o)}merge(e){return e4e(this.dimensions,e.dimensions)?(FHt(this.measures,e.measures),!0):(QWt("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Qe(this.measures)])}producedFields(){const e=new Set;for(const n of Qe(this.measures))for(const r of Qe(this.measures[n])){const i=this.measures[n][r];i.size===0?e.add(`${r}_${n}`):i.forEach(e.add,e)}return e}hash(){return`Aggregate ${Mn({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],n=[],r=[];for(const o of Qe(this.measures))for(const s of Qe(this.measures[o]))for(const a of this.measures[o][s])r.push(a),e.push(s),n.push(o==="*"?null:Pu(o));return{type:"aggregate",groupby:[...this.dimensions].map(Pu),ops:e,fields:n,as:r}}}class zO extends Sr{constructor(e,n,r,i){super(e),this.model=n,this.name=r,this.data=i;for(const o of su){const s=n.facet[o];if(s){const{bin:a,sort:l}=s;this[o]={name:n.getName(`${o}_domain`),fields:[ct(s),...qr(a)?[ct(s,{binSuffix:"end"})]:[]],...hg(l)?{sortField:l}:We(l)?{sortIndexField:pC(s,o)}:{}}}}this.childModel=n.child}hash(){let e="Facet";for(const n of su)this[n]&&(e+=` ${n.charAt(0)}:${Mn(this[n])}`);return e}get fields(){var n;const e=[];for(const r of su)(n=this[r])!=null&&n.fields&&e.push(...this[r].fields);return e}dependentFields(){const e=new Set(this.fields);for(const n of su)this[n]&&(this[n].sortField&&e.add(this[n].sortField.field),this[n].sortIndexField&&e.add(this[n].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const n of tm){const r=this.childModel.component.scales[n];if(r&&!r.merged){const i=r.get("type"),o=r.get("range");if(Go(i)&&w1(o)){const s=V6(this.childModel,n),a=$ae(s);a?e[n]=a:Ze(Nse(n))}}}return e}assembleRowColumnHeaderData(e,n,r){const i={row:"y",column:"x",facet:void 0}[e],o=[],s=[],a=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),s.push("max")):(o.push(r[i]),s.push("distinct")),a.push(`distinct_${r[i]}`));const{sortField:l,sortIndexField:c}=this[e];if(l){const{op:u=k6,field:f}=l;o.push(f),s.push(u),a.push(ct(l,{forAs:!0}))}else c&&(o.push(c),s.push("max"),a.push(c));return{name:this[e].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[e].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(e){var l;const{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(const c of kae){for(const u of Aae){const f=(r[c]&&r[c][u])??[];for(const d of f)if(((l=d.axes)==null?void 0:l.length)>0){o[c]=!0;break}}if(o[c]){const u=`length(data("${this.facet.name}"))`,f=c==="row"?n?{signal:`ceil(${u} / ${n})`}:1:n?{signal:`min(${u}, ${n})`}:{signal:u};i.push({name:`${this.facet.name}_${c}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,e)),i}assemble(){const e=[];let n=null;const r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:s}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(r.x??[],r.y??[]),l=a.map(()=>"distinct");e.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[dg,fg])this[a]&&e.push(this.assembleRowColumnHeaderData(a,n,r));if(s){const a=this.assembleFacetHeaderData(r);a&&e.push(...a)}return e}}function y0e(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function NHt(t,e){const n=Tse(t);if(e==="number")return`toNumber(${n})`;if(e==="boolean")return`toBoolean(${n})`;if(e==="string")return`toString(${n})`;if(e==="date")return`toDate(${n})`;if(e==="flatten")return n;if(e.startsWith("date:")){const r=y0e(e.slice(5,e.length));return`timeParse(${n},'${r}')`}else if(e.startsWith("utc:")){const r=y0e(e.slice(4,e.length));return`utcParse(${n},'${r}')`}else return Ze(oWt(e)),null}function zHt(t){const e={};return $3(t.filter,n=>{if(W4e(n)){let r=null;Use(n)?r=tc(n.equal):Vse(n)?r=tc(n.lte):Wse(n)?r=tc(n.lt):Gse(n)?r=tc(n.gt):Hse(n)?r=tc(n.gte):qse(n)?r=n.range[0]:Xse(n)&&(r=(n.oneOf??n.in)[0]),r&&(_1(r)?e[n.field]="date":Jn(r)?e[n.field]="number":gt(r)&&(e[n.field]="string")),n.timeUnit&&(e[n.field]="date")}}),e}function jHt(t){const e={};function n(r){uC(r)?e[r.field]="date":r.type==="quantitative"&&$8t(r.aggregate)?e[r.field]="number":rC(r.field)>1?r.field in e||(e[r.field]="flatten"):C1(r)&&hg(r.sort)&&rC(r.sort.field)>1&&(r.sort.field in e||(e[r.sort.field]="flatten"))}if((_i(t)||gc(t))&&t.forEachFieldDef((r,i)=>{if(Ra(r))n(r);else{const o=x1(i),s=t.fieldDef(o);n({...r,type:s.type})}}),_i(t)){const{mark:r,markDef:i,encoding:o}=t;if(r0(r)&&!t.encoding.order){const s=i.orient==="horizontal"?"y":"x",a=o[s];Je(a)&&a.type==="quantitative"&&!(a.field in e)&&(e[a.field]="number")}}return e}function BHt(t){const e={};if(_i(t)&&t.component.selection)for(const n of Qe(t.component.selection)){const r=t.component.selection[n];for(const i of r.project.items)!i.channel&&rC(i.field)>1&&(e[i.field]="flatten")}return e}class Qs extends Sr{clone(){return new Qs(null,Kt(this._parse))}constructor(e,n){super(e),this._parse=n}hash(){return`Parse ${Mn(this._parse)}`}static makeExplicit(e,n,r){var s;let i={};const o=n.data;return!Wv(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(i=o.format.parse),this.makeWithAncestors(e,i,{},r)}static makeWithAncestors(e,n,r,i){for(const a of Qe(r)){const l=i.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===r[a]||l.value==="derived"||r[a]==="flatten"?delete r[a]:Ze(Tye(a,r[a],l.value)))}for(const a of Qe(n)){const l=i.get(a);l!==void 0&&(l===n[a]?delete n[a]:Ze(Tye(a,n[a],l)))}const o=new rm(n,r);i.copyAll(o);const s={};for(const a of Qe(o.combine())){const l=o.get(a);l!==null&&(s[a]=l)}return Qe(s).length===0||i.parseNothing?null:new Qs(e,s)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const n of Qe(this._parse)){const r=this._parse[n];rC(n)===1&&(e[n]=r)}return e}producedFields(){return new Set(Qe(this._parse))}dependentFields(){return new Set(Qe(this._parse))}assembleTransforms(e=!1){return Qe(this._parse).filter(n=>e?rC(n)>1:!0).map(n=>{const r=NHt(n,this._parse[n]);return r?{type:"formula",expr:r,as:IO(n)}:null}).filter(n=>n!==null)}}class yy extends Sr{clone(){return new yy(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([Yf])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Yf}}}class qR extends Sr{clone(){return new qR(null,this.params)}constructor(e,n){super(e),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Mn(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class XR extends Sr{clone(){return new XR(null,this.params)}constructor(e,n){super(e),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Mn(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Db extends Sr{constructor(e){super(null),e??(e={name:"source"});let n;if(Wv(e)||(n=e.format?{...pl(e.format,["parse"])}:{}),XA(e))this._data={values:e.values};else if(fC(e)){if(this._data={url:e.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(e.url)[1];En(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else s6e(e)?this._data={values:[{type:"Sphere"}]}:(i6e(e)||Wv(e))&&(this._data={});this._generator=Wv(e),e.name&&(this._name=e.name),n&&!Tr(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var x0e=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},UHt=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},_T;function Dae(t){return t instanceof Db||t instanceof qR||t instanceof XR}class Iae{constructor(){_T.set(this,void 0),x0e(this,_T,!1,"f")}setModified(){x0e(this,_T,!0,"f")}get modifiedFlag(){return UHt(this,_T,"f")}}_T=new WeakMap;class O1 extends Iae{getNodeDepths(e,n,r){r.set(e,n);for(const i of e.children)this.getNodeDepths(i,n+1,r);return r}optimize(e){const r=[...this.getNodeDepths(e,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(const i of r)this.run(i[0]);return this.modifiedFlag}}class Lae extends Iae{optimize(e){this.run(e);for(const n of e.children)this.optimize(n);return this.modifiedFlag}}class WHt extends Lae{mergeNodes(e,n){const r=n.shift();for(const i of n)e.removeChild(i),i.parent=r,i.remove()}run(e){const n=e.children.map(i=>i.hash()),r={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(e,r[i]))}}class VHt extends Lae{constructor(e){super(),this.requiresSelectionId=e&&Tae(e)}run(e){e instanceof yy&&(this.requiresSelectionId&&(Dae(e.parent)||e.parent instanceof Lf||e.parent instanceof Qs)||(this.setModified(),e.remove()))}}class GHt extends Iae{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,n){let r=new Set;e instanceof bh&&(r=e.producedFields(),Ose(r,n)&&(this.setModified(),e.removeFormulas(n),e.producedFields.length===0&&e.remove()));for(const i of e.children)this.run(i,new Set([...n,...r]))}}class HHt extends Lae{constructor(){super()}run(e){e instanceof gl&&!e.isRequired()&&(this.setModified(),e.remove())}}class qHt extends O1{run(e){if(!Dae(e)&&!(e.numChildren()>1)){for(const n of e.children)if(n instanceof Qs)if(e instanceof Qs)this.setModified(),e.merge(n);else{if(Ese(e.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class XHt extends O1{run(e){const n=[...e.children],r=e.children.filter(i=>i instanceof Qs);if(e.numChildren()>1&&r.length>=1){const i={},o=new Set;for(const s of r){const a=s.parse;for(const l of Qe(a))l in i?i[l]!==a[l]&&o.add(l):i[l]=a[l]}for(const s of o)delete i[s];if(!Tr(i)){this.setModified();const s=new Qs(e,i);for(const a of n){if(a instanceof Qs)for(const l of Qe(i))delete a.parse[l];e.removeChild(a),a.parent=s,a instanceof Qs&&Qe(a.parse).length===0&&a.remove()}}}}}class YHt extends O1{run(e){e instanceof gl||e.numChildren()>0||e instanceof zO||e instanceof Db||(this.setModified(),e.remove())}}class QHt extends O1{run(e){const n=e.children.filter(i=>i instanceof bh),r=n.pop();for(const i of n)this.setModified(),r.merge(i)}}class KHt extends O1{run(e){const n=e.children.filter(i=>i instanceof Lf),r={};for(const i of n){const o=Mn(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(const i of Qe(r)){const o=r[i];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(e.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class ZHt extends O1{constructor(e){super(),this.model=e}run(e){const n=!(Dae(e)||e instanceof NO||e instanceof Qs||e instanceof yy),r=[],i=[];for(const o of e.children)o instanceof wh&&(n&&!Ese(e.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof wh?e.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class JHt extends O1{run(e){const n=[...e.children];if(!nC(n,s=>s instanceof gl)||e.numChildren()<=1)return;const i=[];let o;for(const s of n)if(s instanceof gl){let a=s;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof gl)a=l;else break}i.push(...a.children),o?(e.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else i.push(s);if(i.length){this.setModified();for(const s of i)s.parent.removeChild(s),s.parent=o}}}class E1 extends Sr{clone(){return new E1(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Jd(this.transform.groupby.concat(e),n=>n)}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??ct(e)}hash(){return`JoinAggregateTransform ${Mn(this.transform)}`}assemble(){const e=[],n=[],r=[];for(const o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),e.push(o.field===void 0?null:o.field);const i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:e,...i!==void 0?{groupby:i}:{}}}}class mC extends Sr{clone(){return new mC(null,{...this.filter})}constructor(e,n){super(e),this.filter=n}static make(e,n,r){const{config:i,markDef:o}=n,{marks:s,scales:a}=r;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const l=n.reduceFieldDef((c,u,f)=>{const d=Jh(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=u,g=tae({scaleChannel:f,markDef:o,config:i,scaleType:h,isCountAggregate:x6(p)});g!=="show"&&g!=="always-valid"&&(c[u.field]=u)}return c},{});return Qe(l).length?new mC(e,l):null}dependentFields(){return new Set(Qe(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Mn(this.filter)}`}assemble(){const e=Qe(this.filter).reduce((n,r)=>{const i=this.filter[r],o=ct(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (${iQ(o)}))`):i.type==="quantitative"&&n.push(iQ(o))),n},[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}function iQ(t){return`isValid(${t}) && isFinite(+${t})`}function eqt(t){return t.stack.stackBy.reduce((e,n)=>{const r=n.fieldDef,i=ct(r);return i&&e.push(i),e},[])}function tqt(t){return We(t)&&t.every(e=>gt(e))&&t.length>1}class gg extends Sr{clone(){return new gg(null,Kt(this._stack))}constructor(e,n){super(e),this._stack=n}static makeFromTransform(e,n){const{stack:r,groupby:i,as:o,offset:s="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(qi(f.order,"ascending"));const c={field:a,order:l};let u;return tqt(o)?u=o:gt(o)?u=[o,`${o}_end`]:u=[`${n.stack}_start`,`${n.stack}_end`],new gg(e,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:s,sort:c,facetby:[],as:u})}static makeFromEncoding(e,n){const r=n.stack,{encoding:i}=n;if(!r)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:l}=r,c=o.map(h=>{const p=i[h];return Xf(p)}).filter(h=>!!h),u=eqt(n),f=n.encoding.order;let d;if(We(f)||Je(f))d=S4e(f);else{const h=hBe(f)?f.sort:s==="y"?"descending":"ascending";d=u.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new gg(e,{dimensionFieldDefs:c,stackField:n.vgField(s),facetby:[],stackby:u,sort:d,offset:a,impute:l,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Mn(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:n,groupby:r}=this._stack;return e.length>0?e.map(i=>i.bin?n?[ct(i,{binSuffix:"mid"})]:[ct(i,{}),ct(i,{binSuffix:"end"})]:[ct(i)]).flat():r??[]}assemble(){const e=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:s,offset:a,impute:l,as:c}=this._stack;if(l)for(const u of r){const{bandPosition:f=.5,bin:d}=u;if(d){const h=ct(u,{expr:"datum"}),p=ct(u,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${iQ(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:ct(u,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:i,groupby:[...o,...n],key:ct(u,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:s,as:c,offset:a}),e}}class jO extends Sr{clone(){return new jO(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Jd(this.transform.groupby.concat(e),n=>n)}dependentFields(){const e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach(n=>e.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??ct(e)}hash(){return`WindowTransform ${Mn(this.transform)}`}assemble(){const e=[],n=[],r=[],i=[];for(const f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),e.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>$se(f)))return{type:"joinaggregate",as:r,ops:n,fields:e,...s!==void 0?{groupby:s}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const c={field:a,order:l},u=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:e,sort:c,...u!==void 0?{ignorePeers:u}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function nqt(t){function e(n){if(!(n instanceof zO)){const r=n.clone();if(r instanceof gl){const i=sQ+r.getSource();r.setSource(i),t.model.component.data.outputNodes[i]=r}else(r instanceof Lf||r instanceof gg||r instanceof jO||r instanceof E1)&&r.addDimensions(t.fields);for(const i of n.children.flatMap(e))i.parent=r;return[r]}return n.children.flatMap(e)}return e}function oQ(t){if(t instanceof zO)if(t.numChildren()===1&&!(t.children[0]instanceof gl)){const e=t.children[0];(e instanceof Lf||e instanceof gg||e instanceof jO||e instanceof E1)&&e.addDimensions(t.fields),e.swapWithParent(),oQ(t)}else{const e=t.model.component.data.main;eUe(e);const n=nqt(t),r=t.children.map(n).flat();for(const i of r)i.parent=e}else t.children.map(oQ)}function eUe(t){if(t instanceof gl&&t.type===$i.Main&&t.numChildren()===1){const e=t.children[0];e instanceof zO||(e.swapWithParent(),eUe(t))}}const sQ="scale_",oL=5;function aQ(t){for(const e of t){for(const n of e.children)if(n.parent!==e)return!1;if(!aQ(e.children))return!1}return!0}function Xu(t,e){let n=!1;for(const r of e)n=t.optimize(r)||n;return n}function b0e(t,e,n){let r=t.sources,i=!1;return i=Xu(new HHt,r)||i,i=Xu(new VHt(e),r)||i,r=r.filter(o=>o.numChildren()>0),i=Xu(new YHt,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=Xu(new qHt,r)||i,i=Xu(new ZHt(e),r)||i,i=Xu(new GHt,r)||i,i=Xu(new XHt,r)||i,i=Xu(new KHt,r)||i,i=Xu(new QHt,r)||i,i=Xu(new WHt,r)||i,i=Xu(new JHt,r)||i),t.sources=r,i}function rqt(t,e){aQ(t.sources);let n=0,r=0;for(let i=0;ie(n))}}function tUe(t){_i(t)?iqt(t):oqt(t)}function iqt(t){const e=t.component.scales;for(const n of Qe(e)){const r=aqt(t,n);if(e[n].setWithExplicit("domains",r),cqt(t,n),t.component.data.isFaceted){let o=t;for(;!gc(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of r.value)eg(a)&&(a.data=sQ+a.data.replace(sQ,""))}}}function oqt(t){for(const n of t.children)tUe(n);const e=t.component.scales;for(const n of Qe(e)){let r,i=null;for(const o of t.children){const s=o.component.scales[n];if(s){r===void 0?r=s.getWithExplicit("domains"):r=my(r,s.getWithExplicit("domains"),"domains","scale",lQ);const a=s.get("selectionExtent");i&&a&&i.param!==a.param&&Ze(tWt),i=a}}e[n].setWithExplicit("domains",r),i&&e[n].set("selectionExtent",i,!0)}}function sqt(t,e,n,r){if(t==="unaggregated"){const{valid:i,reason:o}=w0e(e,n);if(!i){Ze(o);return}}else if(t===void 0&&r.useUnaggregatedDomain){const{valid:i}=w0e(e,n);if(i)return"unaggregated"}return t}function aqt(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:r}=t,i=sqt(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return i!==t.scaleDomain(e)&&(t.specifiedScales[e]={...t.specifiedScales[e],domain:i}),e==="x"&&_o(r.x2)?_o(r.x)?my(Im(n,i,t,"x"),Im(n,i,t,"x2"),"domain","scale",lQ):Im(n,i,t,"x2"):e==="y"&&_o(r.y2)?_o(r.y)?my(Im(n,i,t,"y"),Im(n,i,t,"y2"),"domain","scale",lQ):Im(n,i,t,"y2"):Im(n,i,t,e)}function lqt(t,e,n){return t.map(r=>({signal:`{data: ${R6(r,{timeUnit:n,type:e})}}`}))}function JV(t,e,n){var i;const r=(i=Vo(n))==null?void 0:i.unit;return e==="temporal"||r?lqt(t,e,r):[t]}function Im(t,e,n,r){const{encoding:i,markDef:o,mark:s,config:a,stack:l}=n,c=_o(i[r]),{type:u}=c,f=c.timeUnit,d=nGt({invalid:Ih("invalid",o,a),isPath:r0(s)});if(CVt(e)){const g=Im(t,void 0,n,r),m=JV(e.unionWith,u,f);return Md([...m,...g.value])}else{if(Rt(e))return Md([e]);if(e&&e!=="unaggregated"&&!Q4e(e))return Md(JV(e,u,f))}if(l&&r===l.fieldChannel){if(l.offset==="normalize")return Vl([[0,1]]);const g=n.requestDataName(d);return Vl([{data:g,field:n.vgField(r,{suffix:"start"})},{data:g,field:n.vgField(r,{suffix:"end"})}])}const h=Jh(r)&&Je(c)?uqt(n,r,t):void 0;if(ep(c)){const g=JV([c.datum],u,f);return Vl(g)}const p=c;if(e==="unaggregated"){const{field:g}=c;return Vl([{data:n.requestDataName(d),field:ct({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:ct({field:g,aggregate:"max"})}])}else if(qr(p.bin)){if(Go(t))return Vl(t==="bin-ordinal"?[]:[{data:GA(h)?n.requestDataName(d):n.requestDataName($i.Raw),field:n.vgField(r,VR(p,r)?{binSuffix:"range"}:{}),sort:h===!0||!ht(h)?{field:n.vgField(r,{}),op:"min"}:h}]);{const{bin:g}=p;if(qr(g)){const m=Rae(n,p.field,g);return Vl([new Lo(()=>{const v=n.getSignalName(m);return`[${v}.start, ${v}.stop]`})])}else return Vl([{data:n.requestDataName(d),field:n.vgField(r,{})}])}}else if(p.timeUnit&&En(["time","utc"],t)){const g=i[Zh(r)];if(dBe(p,g,o,a)){const m=n.requestDataName(d),v=gy({fieldDef:p,fieldDef2:g,markDef:o,config:a}),y=qA(s)&&v!==.5&&Xi(r);return Vl([{data:m,field:n.vgField(r,y?{suffix:N6}:{})},{data:m,field:n.vgField(r,{suffix:y?z6:"end"})}])}}return Vl(h?[{data:GA(h)?n.requestDataName(d):n.requestDataName($i.Raw),field:n.vgField(r),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(r)}])}function e9(t,e){const{op:n,field:r,order:i}=t;return{op:n??(e?"sum":k6),...r?{field:Pu(r)}:{},...i?{order:i}:{}}}function cqt(t,e){var a;const n=t.component.scales[e],r=t.specifiedScales[e].domain,i=(a=t.fieldDef(e))==null?void 0:a.bin,o=Q4e(r)?r:void 0,s=b1(i)&&b6(i.extent)?i.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function uqt(t,e,n){if(!Go(n))return;const r=t.fieldDef(e),i=r.sort;if(uBe(i))return{op:"min",field:pC(r,e),order:"ascending"};const{stack:o}=t,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(hg(i)){const a=o&&!s.has(i.field);return e9(i,a)}else if(n9t(i)){const{encoding:a,order:l}=i,c=t.fieldDef(a),{aggregate:u,field:f}=c,d=o&&!s.has(f);if(zg(u)||n0(u))return e9({field:ct(c),order:l},d);if($se(u)||!u)return e9({op:u,field:f,order:l},d)}else{if(i==="descending")return{op:"min",field:t.vgField(e),order:"descending"};if(En(["ascending",void 0],i))return!0}}function w0e(t,e){const{aggregate:n,type:r}=t;return n?gt(n)&&!N8t.has(n)?{valid:!1,reason:TWt(n)}:r==="quantitative"&&e==="log"?{valid:!1,reason:kWt(t)}:{valid:!0}:{valid:!1,reason:EWt(t)}}function lQ(t,e,n,r){return t.explicit&&e.explicit&&Ze(DWt(n,r,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function fqt(t){const e=Jd(t.map(s=>{if(eg(s)){const{sort:a,...l}=s;return l}return s}),Mn),n=Jd(t.map(s=>{if(eg(s)){const a=s.sort;return a!==void 0&&!GA(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),Mn);if(e.length===0)return;if(e.length===1){const s=t[0];if(eg(s)&&n.length>0){let a=n[0];if(n.length>1){Ze(Aye);const l=n.filter(c=>ht(c)&&"op"in c&&c.op!=="min");n.every(c=>ht(c)&&"op"in c)&&l.length===1?a=l[0]:a=!0}else if(ht(a)&&"field"in a){const l=a.field;s.field===l&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const r=Jd(n.map(s=>GA(s)||!("op"in s)||gt(s.op)&&vt(I8t,s.op)?s:(Ze(LWt(s)),!0)),Mn);let i;r.length===1?i=r[0]:r.length>1&&(Ze(Aye),i=!0);const o=Jd(t.map(s=>eg(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:e.map(a=>a.field),...i?{sort:i}:{}}:{fields:e,...i?{sort:i}:{}}}function $ae(t){if(eg(t)&>(t.field))return t.field;if(z8t(t)){let e;for(const n of t.fields)if(eg(n)&>(n.field)){if(!e)e=n.field;else if(e!==n.field)return Ze($Wt),e}return Ze(FWt),e}else if(j8t(t)){Ze(NWt);const e=t.fields[0];return gt(e)?e:void 0}}function V6(t,e){const r=t.component.scales[e].get("domains").map(i=>(eg(i)&&(i.data=t.lookupDataSource(i.data)),i));return fqt(r)}function nUe(t){return BO(t)||Fae(t)?t.children.reduce((e,n)=>e.concat(nUe(n)),_0e(t)):_0e(t)}function _0e(t){return Qe(t.component.scales).reduce((e,n)=>{const r=t.component.scales[n];if(r.merged)return e;const i=r.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:c,reverse:u,...f}=i,d=dqt(i.range,o,n,t),h=V6(t,n),p=a?lGt(t,a,r,h):null;return e.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...u!==void 0?{reverse:u}:{},...f}),e},[])}function dqt(t,e,n,r){if(Xi(n)){if(w1(t))return{step:{signal:`${e}_step`}}}else if(ht(t)&&eg(t))return{...t,data:r.lookupDataSource(t.data)};return t}class rUe extends rm{constructor(e,n){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const e=this.get("type");if(En([ss.LOG,ss.TIME,ss.UTC],e))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&En([ss.LINEAR,ss.SQRT,ss.POW],e))return"definitely";const r=this.get("domains");if(r.length>0){let i=!1,o=!1,s=!1;for(const a of r){if(We(a)){const l=a[0],c=a[a.length-1];if(Jn(l)&&Jn(c))if(l<=0&&c>=0){i=!0;continue}else{o=!0;continue}}s=!0}if(i)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const hqt=["range","scheme"];function pqt(t){const e=t.component.scales;for(const n of Lse){const r=e[n];if(!r)continue;const i=gqt(n,t);r.setWithExplicit("range",i)}}function S0e(t,e){const n=t.fieldDef(e);if(n!=null&&n.bin){const{bin:r,field:i}=n,o=El(e),s=t.getName(o);if(ht(r)&&r.binned&&r.step!==void 0)return new Lo(()=>{const a=t.scaleName(e),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${r.step}`;return`${t.getSignalName(s)} / (${l})`});if(qr(r)){const a=Rae(t,i,r);return new Lo(()=>{const l=t.getSignalName(a),c=`(${l}.stop - ${l}.start) / ${l}.step`;return`${t.getSignalName(s)} / (${c})`})}}}function gqt(t,e){const n=e.specifiedScales[t],{size:r}=e,o=e.getScaleComponent(t).get("type");for(const f of hqt)if(n[f]!==void 0){const d=VY(o,f),h=K4e(t,f);if(!d)Ze(P4e(o,f,t));else if(h)Ze(h);else switch(f){case"range":{const p=n.range;if(We(p)){if(Xi(t))return Md(p.map(g=>{if(g==="width"||g==="height"){const m=e.getName(g),v=e.getSignalName.bind(e);return Lo.fromName(v,m)}return g}))}else if(ht(p))return Md({data:e.requestDataName($i.Main),field:p.field,sort:{op:"min",field:e.vgField(t)}});return Md(p)}case"scheme":return Md(mqt(n[f]))}}const s=t===xi||t==="xOffset"?"width":"height",a=r[s];if($h(a)){if(Xi(t))if(Go(o)){const f=oUe(a,e,t);if(f)return Md({step:f})}else Ze(M4e(s));else if(FR(t)){const f=t===Ky?"x":"y";if(e.getScaleComponent(f).get("type")==="band"){const p=sUe(a,o);if(p)return Md(p)}}}const{rangeMin:l,rangeMax:c}=n,u=vqt(t,e);return(l!==void 0||c!==void 0)&&VY(o,"rangeMin")&&We(u)&&u.length===2?Md([l??u[0],c??u[1]]):Vl(u)}function mqt(t){return SVt(t)?{scheme:t.name,...pl(t,["name"])}:{scheme:t}}function iUe(t,e,n,{center:r}={}){const i=El(t),o=e.getName(i),s=e.getSignalName.bind(e);return t===Qo&&Hf(n)?r?[Lo.fromName(a=>`${s(a)}/2`,o),Lo.fromName(a=>`-${s(a)}/2`,o)]:[Lo.fromName(s,o),0]:r?[Lo.fromName(a=>`-${s(a)}/2`,o),Lo.fromName(a=>`${s(a)}/2`,o)]:[0,Lo.fromName(s,o)]}function vqt(t,e){const{size:n,config:r,mark:i,encoding:o}=e,{type:s}=_o(o[t]),l=e.getScaleComponent(t).get("type"),{domain:c,domainMid:u}=e.specifiedScales[t];switch(t){case xi:case Qo:{if(En(["point","band"],l)){const f=aUe(t,n,r.view);if($h(f))return{step:oUe(f,e,t)}}return iUe(t,e,l)}case Ky:case LO:return yqt(t,e,l);case Jg:{const f=wqt(i,r),d=_qt(i,n,e,r);return aC(l)?bqt(f,d,xqt(l,r,c,t)):[f,d]}case zu:return[0,Math.PI*2];case y1:return[0,360];case ad:return[0,new Lo(()=>{const f=e.getSignalName(gc(e.parent)?"child_width":"width"),d=e.getSignalName(gc(e.parent)?"child_height":"height");return`min(${f},${d})/2`})];case e0:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case t0:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Ol:return"symbol";case Cl:case Qh:case Kh:return l==="ordinal"?s==="nominal"?"category":"ordinal":u!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case em:case Zy:case Jy:return[r.scale.minOpacity,r.scale.maxOpacity]}}function oUe(t,e,n){const{encoding:r}=e,i=e.getScaleComponent(n),o=Mse(n),s=r[o];if(VBe({step:t,offsetIsDiscrete:en(s)&&G4e(s.type)})==="offset"&&CBe(r,o)){const l=e.getScaleComponent(o);let u=`domain('${e.scaleName(o)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;u=`bandspace(${u}, ${d}, ${h})`}const f=i.get("paddingInner")??i.get("padding");return{signal:`${t.step} * ${u} / (1-${V8t(f)})`}}else return t.step}function sUe(t,e){if(VBe({step:t,offsetIsDiscrete:Go(e)})==="offset")return{step:t.step}}function yqt(t,e,n){const r=t===Ky?"x":"y",i=e.getScaleComponent(r);if(!i)return iUe(r,e,n,{center:!0});const o=i.get("type"),s=e.scaleName(r),{markDef:a,config:l}=e;if(o==="band"){const c=aUe(r,e.size,e.config.view);if($h(c)){const u=sUe(c,n);if(u)return u}return[0,{signal:`bandwidth('${s}')`}]}else{const c=e.encoding[r];if(Je(c)&&c.timeUnit){const u=B4e(c.timeUnit,p=>`scale('${s}', ${p})`),f=e.config.scale.bandWithNestedOffsetPaddingInner,d=gy({fieldDef:c,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=Rt(f)?`${f.signal}/2`+h:`${f/2+d}`,g=Rt(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${u})`},{signal:`${g} * (${u})`}]}return[0,{signal:u}]}return Zje(`Cannot use ${t} scale if ${r} scale is not discrete.`)}}function aUe(t,e,n){const r=t===xi?"width":"height",i=e[r];return i||j5(n,r)}function xqt(t,e,n,r){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return n!==void 0&&We(n)?n.length+1:(Ze(qWt(r)),3)}}function bqt(t,e,n){const r=()=>{const i=Ef(e),o=Ef(t),s=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${s}, ${s})`};return Rt(e)?new Lo(r):{signal:r()}}function wqt(t,e){switch(t){case"bar":case"tick":return e.scale.minBandSize;case"line":case"trail":case"rule":return e.scale.minStrokeWidth;case"text":return e.scale.minFontSize;case"point":case"square":case"circle":return e.scale.minSize}throw new Error(w6("size",t))}const C0e=.95;function _qt(t,e,n,r){const i={x:S0e(n,"x"),y:S0e(n,"y")};switch(t){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;const o=O0e(e,i,r.view);return Jn(o)?o-1:new Lo(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const o=O0e(e,i,r.view);return Jn(o)?Math.pow(C0e*o,2):new Lo(()=>`pow(${C0e} * ${o.signal}, 2)`)}}throw new Error(w6("size",t))}function O0e(t,e,n){const r=$h(t.width)?t.width.step:XY(n,"width"),i=$h(t.height)?t.height.step:XY(n,"height");return e.x||e.y?new Lo(()=>`min(${[e.x?e.x.signal:r,e.y?e.y.signal:i].join(", ")})`):Math.min(r,i)}function lUe(t,e){_i(t)?Sqt(t,e):uUe(t,e)}function Sqt(t,e){const n=t.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:s}=t;for(const a of Qe(n)){const l=s[a],c=n[a],u=t.getScaleComponent(a),f=_o(i[a]),d=l[e],h=u.get("type"),p=u.get("padding"),g=u.get("paddingInner"),m=VY(h,e),v=K4e(a,e);if(d!==void 0&&(m?v&&Ze(v):Ze(P4e(h,e,a))),m&&v===void 0)if(d!==void 0){const y=f.timeUnit,x=f.type;switch(e){case"domainMax":case"domainMin":_1(l[e])||x==="temporal"||y?c.set(e,{signal:R6(l[e],{type:x,timeUnit:y})},!0):c.set(e,l[e],!0);break;default:c.copyKeyFromObject(e,l)}}else{const y=Ke(E0e,e)?E0e[e]({model:t,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:OBe(i,a),hasSecondaryRangeChannel:!!i[Zh(a)]}):r.scale[e];y!==void 0&&c.set(e,y,!1)}}}const E0e={bins:({model:t,fieldOrDatumDef:e})=>Je(e)?Cqt(t,e):void 0,interpolate:({channel:t,fieldOrDatumDef:e})=>Oqt(t,e.type),nice:({scaleType:t,channel:e,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>Eqt(t,e,n,r,i,o),padding:({channel:t,scaleType:e,fieldOrDatumDef:n,markDef:r,config:i})=>Tqt(t,e,i.scale,n,r,i.bar),paddingInner:({scalePadding:t,channel:e,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>kqt(t,e,n.type,r,i.scale,o),paddingOuter:({scalePadding:t,channel:e,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>Aqt(t,e,n,r,i.scale,o),reverse:({fieldOrDatumDef:t,scaleType:e,channel:n,config:r})=>{const i=Je(t)?t.sort:void 0;return Pqt(e,i,n,r.scale)},zero:({channel:t,fieldOrDatumDef:e,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:s})=>Mqt(t,e,n,r,i,o.scale,s)};function cUe(t){_i(t)?pqt(t):uUe(t,"range")}function uUe(t,e){const n=t.component.scales;for(const r of t.children)e==="range"?cUe(r):lUe(r,e);for(const r of Qe(n)){let i;for(const o of t.children){const s=o.component.scales[r];if(s){const a=s.getWithExplicit(e);i=my(i,a,e,"scale",r6e((l,c)=>{switch(e){case"range":return l.step&&c.step?l.step-c.step:0}return 0}))}}n[r].setWithExplicit(e,i)}}function Cqt(t,e){const n=e.bin;if(qr(n)){const r=Rae(t,e.field,n);return new Lo(()=>t.getSignalName(r))}else if(rs(n)&&b1(n)&&n.step!==void 0)return{step:n.step}}function Oqt(t,e){if(En([Cl,Qh,Kh],t)&&e!=="nominal")return"hcl"}function Eqt(t,e,n,r,i,o){var s;if(!((s=Xf(o))!=null&&s.bin||We(n)||i!=null||r!=null||En([ss.TIME,ss.UTC],t)))return Xi(e)?!0:void 0}function Tqt(t,e,n,r,i,o){if(Xi(t)){if(eh(e)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=i;if(s==="bar"&&!(Je(r)&&(r.bin||r.timeUnit))&&(a==="vertical"&&t==="x"||a==="horizontal"&&t==="y"))return o.continuousBandSize}if(e===ss.POINT)return n.pointPadding}}function kqt(t,e,n,r,i,o=!1){if(t===void 0){if(Xi(e)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:l,tickBandPaddingInner:c,bandWithNestedOffsetPaddingInner:u}=i;return o?u:qi(s,n==="bar"?a:n==="tick"?c:l)}else if(FR(e)&&r===ss.BAND)return i.offsetBandPaddingInner}}function Aqt(t,e,n,r,i,o=!1){if(t===void 0){if(Xi(e)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=i;if(o)return a;if(n===ss.BAND)return qi(s,Rt(r)?{signal:`${r.signal}/2`}:r/2)}else if(FR(e)){if(n===ss.POINT)return .5;if(n===ss.BAND)return i.offsetBandPaddingOuter}}}function Pqt(t,e,n,r){if(n==="x"&&r.xReverse!==void 0)return Hf(t)&&e==="descending"?Rt(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(Hf(t)&&e==="descending")return!0}function Mqt(t,e,n,r,i,o,s){if(!!n&&n!=="unaggregated"&&Hf(i)){if(We(n)){const l=n[0],c=n[n.length-1];if(Jn(l)&&l<=0&&Jn(c)&&c>=0)return!0}return!1}if(t==="size"&&e.type==="quantitative"&&!aC(i))return!0;if(!(Je(e)&&e.bin)&&En([...tm,...E8t],t)){const{orient:l,type:c}=r;return En(["bar","area","line","trail"],c)&&(l==="horizontal"&&t==="y"||l==="vertical"&&t==="x")?!1:En(["bar","area"],c)&&!s?!0:o==null?void 0:o.zero}return!1}function Rqt(t,e,n,r,i=!1){const o=Dqt(e,n,r,i),{type:s}=t;return Jh(e)?s!==void 0?PVt(e,s)?Je(n)&&!AVt(s,n.type)?(Ze(MWt(s,o)),o):s:(Ze(PWt(e,s,o)),o):o:null}function Dqt(t,e,n,r){var i;switch(e.type){case"nominal":case"ordinal":{if(G_(t)||VV(t)==="discrete")return t==="shape"&&e.type==="ordinal"&&Ze(GV(t,"ordinal")),"ordinal";if(Xi(t)||FR(t)){if(En(["rect","bar","image","rule","tick"],n.type)||r)return"band"}else if(n.type==="arc"&&t in Ise)return"band";const o=n[El(t)];return Ab(o)||cC(e)&&((i=e.axis)!=null&&i.tickBand)?"band":"point"}case"temporal":return G_(t)?"time":VV(t)==="discrete"?(Ze(GV(t,"temporal")),"ordinal"):Je(e)&&e.timeUnit&&Vo(e.timeUnit).utc?"utc":"time";case"quantitative":return G_(t)?Je(e)&&qr(e.bin)?"bin-ordinal":"linear":VV(t)==="discrete"?(Ze(GV(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(k4e(e.type))}function Iqt(t,{ignoreRange:e}={}){fUe(t),tUe(t);for(const n of kVt)lUe(t,n);e||cUe(t)}function fUe(t){_i(t)?t.component.scales=Lqt(t):t.component.scales=Fqt(t)}function Lqt(t){const{encoding:e,mark:n,markDef:r}=t,i={};for(const o of Lse){const s=_o(e[o]);if(s&&n===eBe&&o===Ol&&s.type===$O)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const l=OBe(e,o),c=Rqt(a,o,s,r,l);i[o]=new rUe(t.scaleName(`${o}`,!0),{value:c,explicit:a.type===c})}}return i}const $qt=r6e((t,e)=>Mye(t)-Mye(e));function Fqt(t){var e;const n=t.component.scales={},r={},i=t.component.resolve;for(const o of t.children){fUe(o);for(const s of Qe(o.component.scales))if((e=i.scale)[s]??(e[s]=U6e(s,t)),i.scale[s]==="shared"){const a=r[s],l=o.component.scales[s].getWithExplicit("type");a?yVt(a.value,l.value)?r[s]=my(a,l,"type","scale",$qt):(i.scale[s]="independent",delete r[s]):r[s]=l}}for(const o of Qe(r)){const s=t.scaleName(o,!0),a=r[o];n[o]=new rUe(s,a);for(const l of t.children){const c=l.component.scales[o];c&&(l.renameScale(c.get("name"),s),c.merged=!0)}}return n}class t9{constructor(){this.nameMap={}}rename(e,n){this.nameMap[e]=n}has(e){return this.nameMap[e]!==void 0}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function _i(t){return(t==null?void 0:t.type)==="unit"}function gc(t){return(t==null?void 0:t.type)==="facet"}function Fae(t){return(t==null?void 0:t.type)==="concat"}function BO(t){return(t==null?void 0:t.type)==="layer"}class Nae{constructor(e,n,r,i,o,s,a){this.type=n,this.parent=r,this.config=o,this.correctDataNames=l=>{var c,u,f;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data)),(f=(u=l.from)==null?void 0:u.facet)!=null&&f.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l},this.parent=r,this.config=o,this.view=os(a),this.name=e.name??i,this.title=Km(e.title)?{text:e.title}:e.title?os(e.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new t9,this.projectionNameMap=r?r.projectionNameMap:new t9,this.signalNameMap=r?r.signalNameMap:new t9,this.data=e.data,this.description=e.description,this.transforms=V7t(e.transform??[]),this.layout=n==="layer"||n==="unit"?{}:X9t(e,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:A6(e)||(r==null?void 0:r.component.data.isFaceted)&&e.data===void 0},layoutSize:new rm,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?Kt(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Iqt(this)}parseProjection(){Z6e(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){q6e(this)}assembleEncodeFromView(e){const{style:n,...r}=e,i={};for(const o of Qe(r)){const s=r[o];s!==void 0&&(i[o]=ni(s))}return i}assembleGroupEncodeEntry(e){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!e&&(this.description&&(n.description=ni(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Tr(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:e,...n}=this.layout,{component:r,config:i}=this,o=rHt(r.layoutHeaders,i);return{padding:e,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let n=[];for(const r of su)e[r].title&&n.push(KGt(this,r));for(const r of kae)n=n.concat(ZGt(this,r));return n}assembleAxes(){return NGt(this.component.axes,this.config)}assembleLegends(){return Y6e(this)}assembleProjections(){return EHt(this)}assembleTitle(){const{encoding:e,...n}=this.title??{},r={...x4e(this.config.title).nonMarkTitleProperties,...n,...e?{encode:{update:e}}:{}};if(r.text)return En(["unit","layer"],this.type)?En(["middle",void 0],r.anchor)&&(r.frame??(r.frame="group")):r.anchor??(r.anchor="start"),Tr(r)?void 0:r}assembleGroup(e=[]){const n={};e=e.concat(this.assembleSignals()),e.length>0&&(n.signals=e);const r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||gc(this.parent)?nUe(this):[];i.length>0&&(n.scales=i);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(e){return gi((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName($i[e].toLowerCase())}requestDataName(e){const n=this.getDataName(e),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(e){if(gc(this.parent)){const n=j6e(e),r=y6(n),i=this.component.scales[r];if(i&&!i.merged){const o=i.get("type"),s=i.get("range");if(Go(o)&&w1(s)){const a=i.get("name"),l=V6(this,r),c=$ae(l);if(c){const u=ct({aggregate:"distinct",field:c},{expr:"datum"});return{signal:z6e(a,i,u)}}else return Ze(Nse(r)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const n=this.component.data.outputNodes[e];return n?n.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,n){this.signalNameMap.rename(e,n)}renameScale(e,n){this.scaleNameMap.rename(e,n)}renameProjection(e,n){this.projectionNameMap.rename(e,n)}scaleName(e,n){if(n)return this.getName(e);if(f4e(e)&&Jh(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e)))return this.scaleNameMap.get(this.getName(e))}projectionName(e){if(e)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[e];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(e):void 0}getScaleType(e){const n=this.getScaleComponent(e);return n?n.get("type"):void 0}getSelectionComponent(e,n){let r=this.component.selection[e];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(e,n)),!r)throw new Error(Y8t(n));return r}hasAxisOrientSignalRef(){var e,n;return((e=this.component.axes.x)==null?void 0:e.some(r=>r.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(r=>r.hasOrientSignalRef()))}}class dUe extends Nae{vgField(e,n={}){const r=this.fieldDef(e);if(r)return ct(r,n)}reduceFieldDef(e,n){return S9t(this.getMapping(),(r,i,o)=>{const s=Xf(i);return s?e(r,s,o):r},n)}forEachFieldDef(e,n){uae(this.getMapping(),(r,i)=>{const o=Xf(r);o&&e(o,i)},n)}}class G6 extends Sr{clone(){return new G6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];const i=this.transform.resolve??"shared";this.transform.resolve=i}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Mn(this.transform)}`}assemble(){const{density:e,...n}=this.transform,r={type:"kde",field:e,...n};return r.resolve=this.transform.resolve,r}}class H6 extends Sr{clone(){return new H6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Mn(this.transform)}`}assemble(){const{extent:e,param:n}=this.transform;return{type:"extent",field:e,signal:n}}}class q6 extends Sr{clone(){return new q6(this.parent,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,s)=>i[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Mn(this.transform)}`}assemble(){const{flatten:e,as:n}=this.transform;return{type:"flatten",fields:e,as:n}}}class X6 extends Sr{clone(){return new X6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Mn(this.transform)}`}assemble(){const{fold:e,as:n}=this.transform;return{type:"fold",fields:e,as:n}}}class X_ extends Sr{clone(){return new X_(null,Kt(this.fields),this.geojson,this.signal)}static parseAll(e,n){if(n.component.projection&&!n.component.projection.isFit)return e;let r=0;for(const i of[[cd,ld],[Mu,ud]]){const o=i.map(s=>{const a=_o(n.encoding[s]);return Je(a)?a.field:ep(a)?{expr:`${a.datum}`}:qf(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(e=new X_(e,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(Ol)){const i=n.typedFieldDef(Ol);i.type===$O&&(e=new X_(e,null,i.field,n.getName(`geojson_${r++}`)))}return e}constructor(e,n,r,i){super(e),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){const e=(this.fields??[]).filter(gt);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Mn(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class YA extends Sr{clone(){return new YA(null,this.projection,Kt(this.fields),Kt(this.as))}constructor(e,n,r,i){super(e),this.projection=n,this.fields=r,this.as=i}static parseAll(e,n){if(!n.projectionName())return e;for(const r of[[cd,ld],[Mu,ud]]){const i=r.map(s=>{const a=_o(n.encoding[s]);return Je(a)?a.field:ep(a)?{expr:`${a.datum}`}:qf(a)?{expr:`${a.value}`}:void 0}),o=r[0]===Mu?"2":"";(i[0]||i[1])&&(e=new YA(e,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return e}dependentFields(){return new Set(this.fields.filter(gt))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Mn(this.fields)} ${Mn(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Hx extends Sr{clone(){return new Hx(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:n=0,stop:r,step:i}=e;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(e,n){return new Hx(e,n)}static makeFromEncoding(e,n){const r=n.encoding,i=r.x,o=r.y;if(Je(i)&&Je(o)){const s=i.impute?i:o.impute?o:void 0;if(s===void 0)return;const a=i.impute?o:o.impute?i:void 0,{method:l,value:c,frame:u,keyvals:f}=s.impute,d=kBe(n.mark,r);return new Hx(e,{impute:s.field,key:a.field,...l?{method:l}:{},...c!==void 0?{value:c}:{},...u?{frame:u}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${Mn(this.transform)}`}assemble(){const{impute:e,key:n,keyvals:r,method:i,groupby:o,value:s,frame:a=[null,null]}=this.transform,l={type:"impute",field:e,key:n,...r?{keyvals:O7t(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?s:null};if(i&&i!=="value"){const c={type:"window",as:[`imputed_${e}_value`],ops:[i],fields:[e],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},u={type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e};return[l,c,u]}else return[l]}}class Y6 extends Sr{clone(){return new Y6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Mn(this.transform)}`}assemble(){const{loess:e,on:n,...r}=this.transform;return{type:"loess",x:n,y:e,...r}}}class QA extends Sr{clone(){return new QA(null,Kt(this.transform),this.secondary)}constructor(e,n,r){super(e),this.transform=n,this.secondary=r}static make(e,n,r,i){const o=n.component.data.sources,{from:s}=r;let a=null;if(E7t(s)){let l=gUe(s.data,o);l||(l=new Db(s.data),o.push(l));const c=n.getName(`lookup_${i}`);a=new gl(l,c,$i.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[c]=a}else if(T7t(s)){const l=s.param;r={as:l,...r};let c;try{c=n.getSelectionComponent(gi(l),l)}catch{throw new Error(J8t(l))}if(a=c.materialized,!a)throw new Error(eWt(l))}return new QA(e,r,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?pt(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Mn({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:pt(this.transform.as)}:{}};else{let n=this.transform.as;gt(n)||(Ze(lWt),n="_lookup"),e={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class Q6 extends Sr{clone(){return new Q6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Mn(this.transform)}`}assemble(){const{quantile:e,...n}=this.transform;return{type:"quantile",field:e,...n}}}class K6 extends Sr{clone(){return new K6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Mn(this.transform)}`}assemble(){const{regression:e,on:n,...r}=this.transform;return{type:"regression",x:n,y:e,...r}}}class Z6 extends Sr{clone(){return new Z6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Jd((this.transform.groupby??[]).concat(e),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Mn(this.transform)}`}assemble(){const{pivot:e,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:e,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class J6 extends Sr{clone(){return new J6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Mn(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function hUe(t){let e=0;function n(r,i){if(r instanceof Db&&!r.isGenerator&&!fC(r.data)&&(t.push(i),i={name:null,source:i.name,transform:[]}),r instanceof Qs&&(r.parent instanceof Db&&!i.source?(i.format={...i.format,parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof zO){i.name||(i.name=`data_${e++}`),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source,t.push(...r.assemble());return}switch((r instanceof qR||r instanceof XR||r instanceof mC||r instanceof NO||r instanceof hC||r instanceof YA||r instanceof Lf||r instanceof QA||r instanceof jO||r instanceof E1||r instanceof X6||r instanceof q6||r instanceof G6||r instanceof Y6||r instanceof Q6||r instanceof K6||r instanceof yy||r instanceof J6||r instanceof Z6||r instanceof H6)&&i.transform.push(r.assemble()),(r instanceof wh||r instanceof bh||r instanceof Hx||r instanceof gg||r instanceof X_)&&i.transform.push(...r.assemble()),r instanceof gl&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof gl?r.setSource(i.name):(i.name||(i.name=`data_${e++}`),r.setSource(i.name),r.numChildren()===1&&(t.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof gl&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${e++}`);let o=i.name;!i.source||i.transform.length>0?t.push(i):o=i.source;for(const s of r.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function Nqt(t){const e=[],n=hUe(e);for(const r of t.children)n(r,{source:t.name,name:null,transform:[]});return e}function zqt(t,e){const n=[],r=hUe(n);let i=0;for(const s of t.sources){s.hasName()||(s.dataName=`source_${i++}`);const a=s.assemble();r(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=t.outputNodes[a.from].getSource());for(const s of n)s.name in e&&(s.values=e[s.name]);return n}function jqt(t){return t==="top"||t==="left"||Rt(t)?"header":"footer"}function Bqt(t){for(const e of su)Uqt(t,e);T0e(t,"x"),T0e(t,"y")}function Uqt(t,e){var s;const{facet:n,config:r,child:i,component:o}=t;if(t.channelHasField(e)){const a=n[e],l=gC("title",null,r,e);let c=H_(a,r,{allowDisabling:!0,includeDefault:l===void 0||!!l});i.component.layoutHeaders[e].title&&(c=We(c)?c.join(", "):c,c+=` / ${i.component.layoutHeaders[e].title}`,i.component.layoutHeaders[e].title=null);const u=gC("labelOrient",a.header,r,e),f=a.header!==null?qi((s=a.header)==null?void 0:s.labels,r.header.labels,!0):!1,d=En(["bottom","right"],u)?"footer":"header";o.layoutHeaders[e]={title:a.header!==null?c:null,facetFieldDef:a,[d]:e==="facet"?[]:[pUe(t,e,f)]}}}function pUe(t,e,n){const r=e==="row"?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function T0e(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:r,resolve:i}=t.component;if(i.axis[e]=Mae(i,e),i.axis[e]==="shared"){const o=e==="x"?"column":"row",s=r[o];for(const a of n.component.axes[e]){const l=jqt(a.get("orient"));s[l]??(s[l]=[pUe(t,o,!1)]);const c=wT(a,"main",t.config,{header:!0});c&&s[l][0].axes.push(c),a.mainExtracted=!0}}}}function Wqt(t){zae(t),V5(t,"width"),V5(t,"height")}function Vqt(t){zae(t);const e=t.layout.columns===1?"width":"childWidth",n=t.layout.columns===void 0?"height":"childHeight";V5(t,e),V5(t,n)}function zae(t){for(const e of t.children)e.parseLayoutSize()}function V5(t,e){const n=j6e(e),r=y6(n),i=t.component.resolve,o=t.component.layoutSize;let s;for(const a of t.children){const l=a.component.layoutSize.getWithExplicit(n),c=i.scale[r]??U6e(r,t);if(c==="independent"&&l.value==="step"){s=void 0;break}if(s){if(c==="independent"&&s.value!==l.value){s=void 0;break}s=my(s,l,n,"")}else s=l}if(s){for(const a of t.children)t.renameSignal(a.getName(n),t.getName(e)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,s)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function Gqt(t){const{size:e,component:n}=t;for(const r of tm){const i=El(r);if(e[i]){const o=e[i];n.layoutSize.set(i,$h(o)?"step":o,!0)}else{const o=Hqt(t,i);n.layoutSize.set(i,o,!1)}}}function Hqt(t,e){const n=e==="width"?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){const o=i.get("type"),s=i.get("range");if(Go(o)){const a=j5(r.view,e);return w1(s)||$h(a)?"step":a}else return qY(r.view,e)}else{if(t.hasProjection||t.mark==="arc")return qY(r.view,e);{const o=j5(r.view,e);return $h(o)?o.step:o}}}function cQ(t,e,n){return ct(e,{suffix:`by_${ct(t)}`,...n})}class vk extends dUe{constructor(e,n,r,i){super(e,"facet",n,r,i,e.resolve),this.child=Vae(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!BR(e))return{facet:this.initFacetFieldDef(e,"facet")};const n=Qe(e),r={};for(const i of n){if(![fg,dg].includes(i)){Ze(w6(i,"facet"));break}const o=e[i];if(o.field===void 0){Ze(UY(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(e,n){const r=cae(e,n);return r.header?r.header=os(r.header):r.header===null&&(r.header=null),r}channelHasField(e){return Ke(this.facet,e)}fieldDef(e){return this.facet[e]}parseData(){this.component.data=eU(this),this.child.parseData()}parseLayoutSize(){zae(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Bqt(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const n of su)for(const r of Aae){const i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:s}=i;if(s){const a=gC("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const l=U6(n,a);e.titleAnchor??(e.titleAnchor={}),e.titleAnchor[l]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(e[l]??(e[l]={}),e[l][n]=.5),i.title&&(e.offset??(e.offset={}),e.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:n}=this.facet,r=e?this.columnDistinctSignal():n?1:void 0;let i="all";return(!n&&this.component.resolve.scale.x==="independent"||!e&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof vk))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof vk?{...this.channelHasField("column")?{encode:{update:{columns:{field:ct(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],n=[],r=[];if(this.child instanceof vk){if(this.child.channelHasField("column")){const i=ct(this.child.facet.column);e.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(const i of tm){const o=this.child.component.scales[i];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(Go(s)&&w1(a)){const l=V6(this.child,i),c=$ae(l);c?(e.push(c),n.push("distinct"),r.push(`distinct_${c}`)):Ze(Nse(i))}}}return{fields:e,ops:n,as:r}}assembleFacet(){const{name:e,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const u of su){const f=this.facet[u];if(f){l.push(ct(f));const{bin:d,sort:h}=f;if(qr(d)&&l.push(ct(f,{binSuffix:"end"})),hg(h)){const{field:p,op:g=k6}=h,m=cQ(f,h);r&&i?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(We(h)){const p=pC(f,u);o.push(p),s.push("max"),a.push(p)}}}const c=!!r&&!!i;return{name:e,data:n,groupby:l,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(e){const{facet:n}=this,r=n[e];return r?hg(r.sort)?[cQ(r,r.sort,{expr:"datum"})]:We(r.sort)?[pC(r,e,{expr:"datum"})]:[ct(r,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:n}=this,r=n[e];if(r){const{sort:i}=r;return[(hg(i)?i.order:!We(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){var i;const{facet:e,config:n}=this;if(e.facet)return nQ(e.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const o of kae)if(e[o]){const s=gC("labelOrient",(i=e[o])==null?void 0:i.header,n,o);if(r[o].includes(s))return nQ(e[o],o,n)}}assembleMarks(){const{child:e}=this,n=this.component.data.facetRoot,r=Nqt(n),i=e.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||e.assembleTitle(),s=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:su.map(l=>this.facetSortFields(l)).flat(),order:su.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...e.assembleGroup(iGt(this,[]))}]}getMapping(){return this.facet}}function qqt(t,e){const{row:n,column:r}=e;if(n&&r){let i=null;for(const o of[n,r])if(hg(o.sort)){const{field:s,op:a=k6}=o.sort;t=i=new E1(t,{joinaggregate:[{op:a,field:s,as:cQ(o,o.sort,{forAs:!0})}],groupby:[ct(o)]})}return i}return null}function gUe(t,e){var n,r,i,o;for(const s of e){const a=s.data;if(t.name&&s.hasName()&&t.name!==s.dataName)continue;const l=(n=t.format)==null?void 0:n.mesh,c=(r=a.format)==null?void 0:r.feature;if(l&&c)continue;const u=(i=t.format)==null?void 0:i.feature;if((u||c)&&u!==c)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((l||f)&&l!==f)){if(XA(t)&&XA(a)){if(sc(t.values,a.values))return s}else if(fC(t)&&fC(a)){if(t.url===a.url)return s}else if(i6e(t)&&t.name===s.dataName)return s}}return null}function Xqt(t,e){if(t.data||!t.parent){if(t.data===null){const r=new Db({values:[]});return e.push(r),r}const n=gUe(t.data,e);if(n)return Wv(t.data)||(n.data.format=Jje({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const r=new Db(t.data);return e.push(r),r}}else return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}function Yqt(t,e,n){let r=0;for(const i of e.transforms){let o,s;if(F7t(i))s=t=new hC(t,i),o="derived";else if(wae(i)){const a=zHt(i);s=t=Qs.makeWithAncestors(t,{},a,n)??t,t=new NO(t,e,i.filter)}else if(JBe(i))s=t=wh.makeFromTransform(t,i,e),o="number";else if(z7t(i))o="date",n.getWithExplicit(i.field).value===void 0&&(t=new Qs(t,{[i.field]:o}),n.set(i.field,o,!1)),s=t=bh.makeFromTransform(t,i);else if(j7t(i))s=t=Lf.makeFromTransform(t,i),o="number",Tae(e)&&(t=new yy(t));else if(ZBe(i))s=t=QA.make(t,e,i,r++),o="derived";else if(I7t(i))s=t=new jO(t,i),o="number";else if(L7t(i))s=t=new E1(t,i),o="number";else if(B7t(i))s=t=gg.makeFromTransform(t,i),o="derived";else if(U7t(i))s=t=new X6(t,i),o="derived";else if(W7t(i))s=t=new H6(t,i),o="derived";else if($7t(i))s=t=new q6(t,i),o="derived";else if(k7t(i))s=t=new Z6(t,i),o="derived";else if(D7t(i))t=new J6(t,i);else if(N7t(i))s=t=Hx.makeFromTransform(t,i),o="derived";else if(A7t(i))s=t=new G6(t,i),o="derived";else if(P7t(i))s=t=new Q6(t,i),o="derived";else if(M7t(i))s=t=new K6(t,i),o="derived";else if(R7t(i))s=t=new Y6(t,i),o="derived";else{Ze(aWt(i));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return t}function eU(t){var m;let e=Xqt(t,t.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=t.component.data,i=t.data,s=!(i&&(Wv(i)||fC(i)||XA(i)))&&t.parent?t.parent.component.data.ancestorParse.clone():new tGt;Wv(i)?(o6e(i)?e=new XR(e,i.sequence):_ae(i)&&(e=new qR(e,i.graticule)),s.parseNothing=!0):((m=i==null?void 0:i.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),e=Qs.makeExplicit(e,t,s)??e,e=new yy(e);const a=t.parent&&BO(t.parent);(_i(t)||gc(t))&&a&&(e=wh.makeFromEncoding(e,t)??e),t.transforms.length>0&&(e=Yqt(e,t,s));const l=BHt(t),c=jHt(t);e=Qs.makeWithAncestors(e,{},{...l,...c},s)??e,_i(t)&&(e=X_.parseAll(e,t),e=YA.parseAll(e,t)),(_i(t)||gc(t))&&(a||(e=wh.makeFromEncoding(e,t)??e),e=bh.makeFromEncoding(e,t)??e,e=hC.parseAllForSortIndex(e,t));const u=e=sL($i.Raw,t,e);if(_i(t)){const v=Lf.makeFromEncoding(e,t);v&&(e=v,Tae(t)&&(e=new yy(e))),e=Hx.makeFromEncoding(e,t)??e,e=gg.makeFromEncoding(e,t)??e}let f,d;if(_i(t)){const{markDef:v,mark:y,config:x}=t,b=Er("invalid",v,x),{marks:w,scales:_}=d=a6e({invalid:b,isPath:r0(y)});w!==_&&_==="include-invalid-values"&&(f=e=sL($i.PreFilterInvalid,t,e)),w==="exclude-invalid-values"&&(e=mC.make(e,t,d)??e)}const h=e=sL($i.Main,t,e);let p;if(_i(t)&&d){const{marks:v,scales:y}=d;v==="include-invalid-values"&&y==="exclude-invalid-values"&&(e=mC.make(e,t,d)??e,p=e=sL($i.PostFilterInvalid,t,e))}_i(t)&&$Gt(t,h);let g=null;if(gc(t)){const v=t.getName("facet");e=qqt(e,t.facet)??e,g=new zO(e,t,v,h.getSource()),n[v]=g}return{...t.component.data,outputNodes:n,outputNodeRefCounts:r,raw:u,main:h,facetRoot:g,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:p}}function sL(t,e,n){const{outputNodes:r,outputNodeRefCounts:i}=e.component.data,o=e.getDataName(t),s=new gl(n,o,t,i);return r[o]=s,s}class Qqt extends Nae{constructor(e,n,r,i){var o,s,a,l;super(e,"concat",n,r,i,e.resolve),(((s=(o=e.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((l=(a=e.resolve)==null?void 0:a.axis)==null?void 0:l.y)==="shared")&&Ze(iWt),this.children=this.getChildren(e).map((c,u)=>Vae(c,this,this.getName(`concat_${u}`),void 0,i))}parseData(){this.component.data=eU(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const n of Qe(e.component.selection))this.component.selection[n]=e.component.selection[n]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return L6(e)?e.vconcat:xae(e)?e.hconcat:e.concat}parseLayoutSize(){Vqt(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){const e=Pae(this);for(const n of this.children)e.push(...n.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((n,r)=>r.assembleSelectionData(n),e)}assembleMarks(){return this.children.map(e=>{const n=e.assembleTitle(),r=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...e.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...e!=null?{columns:e}:{},bounds:"full",align:"each"}}}function Kqt(t){return t===!1||t===null}const Zqt={disable:1,gridScale:1,scale:1,..._Be,labelExpr:1,encode:1},mUe=Qe(Zqt);class jae extends rm{constructor(e={},n={},r=!1){super(),this.explicit=e,this.implicit=n,this.mainExtracted=r}clone(){return new jae(Kt(this.explicit),Kt(this.implicit),this.mainExtracted)}hasAxisPart(e){return e==="axis"?!0:e==="grid"||e==="title"?!!this.get(e):!Kqt(this.get(e))}hasOrientSignalRef(){return Rt(this.explicit.orient)}}function Jqt(t,e,n){const{encoding:r,config:i}=t,o=_o(r[e])??_o(r[Zh(e)]),s=t.axis(e)||{},{format:a,formatType:l}=s;if(Pb(l))return{text:Tf({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:i}),...n};if(a===void 0&&l===void 0&&i.customFormatTypes){if(lC(o)==="quantitative"){if(cC(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:Tf({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:Tf({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(lC(o)==="temporal"&&i.timeFormatType&&Je(o)&&!o.timeUnit)return{text:Tf({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function eXt(t){return tm.reduce((e,n)=>(t.component.scales[n]&&(e[n]=[aXt(n,t)]),e),{})}const tXt={bottom:"top",top:"bottom",left:"right",right:"left"};function nXt(t){const{axes:e,resolve:n}=t.component,r={top:0,bottom:0,right:0,left:0};for(const i of t.children){i.parseAxesAndHeaders();for(const o of Qe(i.component.axes))n.axis[o]=Mae(t.component.resolve,o),n.axis[o]==="shared"&&(e[o]=rXt(e[o],i.component.axes[o]),e[o]||(n.axis[o]="independent",delete e[o]))}for(const i of tm){for(const o of t.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){e[i]=(e[i]??[]).concat(o.component.axes[i]);for(const s of o.component.axes[i]){const{value:a,explicit:l}=s.getWithExplicit("orient");if(!Rt(a)){if(r[a]>0&&!l){const c=tXt[a];r[a]>r[c]&&s.set("orient",c,!1)}r[a]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&e[i]&&e[i].length>1)for(const[o,s]of(e[i]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function rXt(t,e){if(t){if(t.length!==e.length)return;const n=t.length;for(let r=0;rn.clone());return t}function iXt(t,e){for(const n of mUe){const r=my(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return E4e(i,o);case"gridScale":return{explicit:i.explicit,value:qi(i.value,o.value)}}return F6(i,o,n,"axis")});t.setWithExplicit(n,r)}return t}function oXt(t,e,n,r,i){if(e==="disable")return n!==void 0;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(Rt(n.labelAngle)?n.labelAngle:HA(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===L6e(r,i))return!0}return t===n[e]}const sXt=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function aXt(t,e){var v,y;let n=e.axis(t);const r=new jae,i=_o(e.encoding[t]),{mark:o,config:s}=e,a=(n==null?void 0:n.orient)||((v=s[t==="x"?"axisX":"axisY"])==null?void 0:v.orient)||((y=s.axis)==null?void 0:y.orient)||HGt(t),l=e.getScaleComponent(t).get("type"),c=zGt(t,l,a,e.config),u=n!==void 0?!n:eQ("disable",s.style,n==null?void 0:n.style,c).configValue;if(r.set("disable",u,n!==void 0),u)return r;n=n||{};const f=WGt(i,n,t,s.style,c),d=lBe(n.formatType,i,l),h=aBe(i,i.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:i,axis:n,channel:t,model:e,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const x of mUe){const b=x in d0e?d0e[x](p):Nye(x)?n[x]:void 0,w=b!==void 0,_=oXt(b,x,n,e,t);if(w&&_)r.set(x,b,_);else{const{configValue:S=void 0,configFrom:O=void 0}=Nye(x)&&x!=="values"?eQ(x,s.style,n.style,c):{},k=S!==void 0;w&&!k?r.set(x,b,_):(O!=="vgAxisConfig"||sXt.has(x)&&k||GR(S)||Rt(S))&&r.set(x,S,!1)}}const g=n.encoding??{},m=wBe.reduce((x,b)=>{if(!r.hasAxisPart(b))return x;const w=B6e(g[b]??{},e),_=b==="labels"?Jqt(e,t,w):w;return _!==void 0&&!Tr(_)&&(x[b]={update:_}),x},{});return Tr(m)||r.set("encode",m,!!n.encoding||n.labelAngle!==void 0),r}function lXt({encoding:t,size:e}){for(const n of tm){const r=El(n);$h(e[r])&&bv(t[n])&&(delete e[r],Ze(M4e(r)))}return e}const cXt={vgMark:"arc",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...jg(t,"radius"),...jg(t,"theta")})},uXt={vgMark:"area",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...B5("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="horizontal"}),...B5("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="vertical"}),...Eae(t)})},fXt={vgMark:"rect",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...jg(t,"x"),...jg(t,"y")})},dXt={vgMark:"shape",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[{type:"geoshape",projection:t.projectionName(),...n&&Je(n)&&n.type===$O?{field:ct(n,{expr:"datum"})}:{}}]}},hXt={vgMark:"image",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...jg(t,"x"),...jg(t,"y"),...Cae(t,"url")})},pXt={vgMark:"line",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...us("size",t,{vgChannel:"strokeWidth"}),...Eae(t)})},gXt={vgMark:"trail",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...us("size",t),...Eae(t)})};function Bae(t,e){const{config:n}=t;return{...ju(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...us("size",t),...us("angle",t),...mXt(t,n,e)}}function mXt(t,e,n){return n?{shape:{value:n}}:us("shape",t)}const vXt={vgMark:"symbol",encodeEntry:t=>Bae(t)},yXt={vgMark:"symbol",encodeEntry:t=>Bae(t,"circle")},xXt={vgMark:"symbol",encodeEntry:t=>Bae(t,"square")},bXt={vgMark:"rect",encodeEntry:t=>({...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...jg(t,"x"),...jg(t,"y")})},wXt={vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return!t.encoding.x&&!t.encoding.y&&!t.encoding.latitude&&!t.encoding.longitude?{}:{...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...B5("x",t,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...B5("y",t,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...us("size",t,{vgChannel:"strokeWidth"})}}},_Xt={vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return{...ju(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...Cae(t),...us("size",t,{vgChannel:"fontSize"}),...us("angle",t),...l0e("align",SXt(t.markDef,n,e)),...l0e("baseline",CXt(t.markDef,n,e)),...Ca("radius",t,{defaultPos:null}),...Ca("theta",t,{defaultPos:null})}}};function SXt(t,e,n){if(Er("align",t,n)===void 0)return"center"}function CXt(t,e,n){if(Er("baseline",t,n)===void 0)return"middle"}const OXt={vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,r=n.orient,i=r==="horizontal"?"x":"y",o=r==="horizontal"?"y":"x",s=r==="horizontal"?"height":"width";return{...ju(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...jg(t,i),...Ca(o,t,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:ni(Er("thickness",n,e))}}},aL={arc:cXt,area:uXt,bar:fXt,circle:yXt,geoshape:dXt,image:hXt,line:pXt,point:vXt,rect:bXt,rule:wXt,square:xXt,text:_Xt,tick:OXt,trail:gXt};function EXt(t){if(En([E6,C6,IVt],t.mark)){const e=kBe(t.mark,t.encoding);if(e.length>0)return TXt(t,e)}else if(t.mark===O6){const e=jY.some(n=>Er(n,t.markDef,t.config));if(t.stack&&!t.fieldDef("size")&&e)return kXt(t)}return Uae(t)}const k0e="faceted_path_";function TXt(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:k0e+t.requestDataName($i.Main),data:t.requestDataName($i.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Uae(t,{fromPrefix:k0e})}]}const A0e="stack_group_";function kXt(t){var c;const[e]=Uae(t,{fromPrefix:A0e}),n=t.scaleName(t.stack.fieldChannel),r=(u={})=>t.vgField(t.stack.fieldChannel,u),i=(u,f)=>{const d=[r({prefix:"min",suffix:"start",expr:f}),r({prefix:"max",suffix:"start",expr:f}),r({prefix:"min",suffix:"end",expr:f}),r({prefix:"max",suffix:"end",expr:f})];return`${u}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;t.stack.fieldChannel==="x"?(o={...tC(e.encode.update,["y","yc","y2","height",...jY]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},e.encode.update={...pl(e.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...tC(e.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},e.encode.update={...pl(e.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const u of jY){const f=Ih(u,t.markDef,t.config);e.encode.update[u]?(o[u]=e.encode.update[u],delete e.encode.update[u]):f&&(o[u]=ni(f)),f&&(e.encode.update[u]={value:0})}const a=[];if(((c=t.stack.groupbyChannels)==null?void 0:c.length)>0)for(const u of t.stack.groupbyChannels){const f=t.fieldDef(u),d=ct(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(ct(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((u,f)=>{if(e.encode.update[f])return{...u,[f]:e.encode.update[f]};{const d=Ih(f,t.markDef,t.config);return d!==void 0?{...u,[f]:ni(d)}:u}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:t.requestDataName($i.Main),name:A0e+t.requestDataName($i.Main),groupby:a,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[e]}]}]}function AXt(t){const{encoding:e,stack:n,mark:r,markDef:i,config:o}=t,s=e.order;if(!(!We(s)&&qf(s)&&NY(s.value)||!s&&NY(Er("order",i,o)))){if((We(s)||Je(s))&&!n)return S4e(s,{expr:"datum"});if(r0(r)){const a=i.orient==="horizontal"?"y":"x",l=e[a];if(Je(l))return{field:a}}}}function Uae(t,e={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=t,s=qi(r.clip,PXt(t),MXt(t)),a=w4e(r),l=i.key,c=AXt(t),u=RXt(t),f=Er("aria",r,o),d=aL[n].postEncodingTransform?aL[n].postEncodingTransform(t):null;return[{name:t.getName("marks"),type:aL[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...l?{key:l.field}:{},...c?{sort:c}:{},...u||{},...f===!1?{aria:f}:{},from:{data:e.fromPrefix+t.requestDataName($i.Main)},encode:{update:aL[n].encodeEntry(t)},...d?{transform:d}:{}}]}function PXt(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return e!=null&&e.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function MXt(t){const e=t.component.projection;return e&&!e.isFit?!0:void 0}function RXt(t){if(!t.component.selection)return null;const e=Qe(t.component.selection).length;let n=e,r=t.parent;for(;r&&n===0;)n=Qe(r.component.selection).length,r=r.parent;return n?{interactive:e>0||t.mark==="geoshape"||!!t.encoding.tooltip||!!t.markDef.tooltip}:null}class vUe extends dUe{constructor(e,n,r,i={},o){super(e,"unit",n,r,o,void 0,jye(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=Lh(e.mark)?{...e.mark}:{type:e.mark},a=s.type;s.filled===void 0&&(s.filled=v7t(s,o,{graticule:e.data&&_ae(e.data)}));const l=this.encoding=w9t(e.encoding||{},a,s.filled,o);this.markDef=YBe(s,l,o),this.size=lXt({encoding:l,size:jye(e)?{...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:i}),this.stack=XBe(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter(c=>vae(c))}get hasProjection(){const{encoding:e}=this,n=this.mark===eBe,r=e&&v8t.some(i=>en(e[i]));return n||r}scaleDomain(e){const n=this.specifiedScales[e];return n?n.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,n){return Lse.reduce((r,i)=>{const o=_o(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(e){const{domain:n,range:r}=e,i=os(e);return We(n)&&(i.domain=n.map(tc)),We(r)&&(i.range=r.map(tc)),i}initAxes(e){return tm.reduce((n,r)=>{const i=e[r];if(en(i)||r===xi&&en(e.x2)||r===Qo&&en(e.y2)){const o=en(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(e){const n=Qe(e),r={};for(const i of n){const o=e[i];r[i]=GR(o)?b4e(o):tc(o)}return r}initLegends(e){return T8t.reduce((n,r)=>{const i=_o(e[r]);if(i&&A8t(r)){const o=i.legend;n[r]=o&&os(o)}return n},{})}parseData(){this.component.data=eU(this)}parseLayoutSize(){Gqt(this)}parseSelections(){this.component.selection=LGt(this,this.selection)}parseMarkGroup(){this.component.mark=EXt(this)}parseAxesAndHeaders(){this.component.axes=eXt(this)}assembleSelectionTopLevelSignals(e){return oGt(this,e)}assembleSignals(){return[...R6e(this),...rGt(this,[])]}assembleSelectionData(e){return sGt(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return Pae(this)}assembleMarks(){let e=this.component.mark??[];return(!this.parent||!BO(this.parent))&&(e=c6e(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return e!==void 0?e:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return Vx(this.encoding,e)}fieldDef(e){const n=this.encoding[e];return Xf(n)}typedFieldDef(e){const n=this.fieldDef(e);return Ra(n)?n:null}}class Wae extends Nae{constructor(e,n,r,i,o){super(e,"layer",n,r,o,e.resolve,e.view);const s={...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map((a,l)=>{if($6(a))return new Wae(a,this,this.getName(`layer_${l}`),s,o);if(nm(a))return new vUe(a,this,this.getName(`layer_${l}`),s,o);throw new Error(Fse(a))})}parseData(){this.component.data=eU(this);for(const e of this.children)e.parseData()}parseLayoutSize(){Wqt(this)}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const n of Qe(e.component.selection))this.component.selection[n]=e.component.selection[n]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){nXt(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),e)}assembleSignals(){return this.children.reduce((e,n)=>e.concat(n.assembleSignals()),R6e(this))}assembleLayoutSignals(){return this.children.reduce((e,n)=>e.concat(n.assembleLayoutSignals()),Pae(this))}assembleSelectionData(e){return this.children.reduce((n,r)=>r.assembleSelectionData(n),e)}assembleGroupStyle(){const e=new Set;for(const r of this.children)for(const i of pt(r.assembleGroupStyle()))e.add(i);const n=Array.from(e);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const n of this.children)if(e=n.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return aGt(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,n)=>e.concat(n.assembleLegends()),Y6e(this))}}function Vae(t,e,n,r,i){if(A6(t))return new vk(t,e,n,i);if($6(t))return new Wae(t,e,n,r,i);if(nm(t))return new vUe(t,e,n,r,i);if(G9t(t))return new Qqt(t,e,n,i);throw new Error(Fse(t))}function DXt(t,e={}){e.logger&&XWt(e.logger),e.fieldTitle&&yBe(e.fieldTitle);try{const n=qBe(yO(e.config,t.config)),r=n6e(t,n),i=Vae(r,null,"",void 0,n);return i.parse(),rqt(i.component.data,i),{spec:LXt(i,IXt(t,r.autosize,n,i),t.datasets,t.usermeta),normalized:r}}finally{e.logger&&YWt(),e.fieldTitle&&d9t()}}function IXt(t,e,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(e===void 0?(e={type:"pad"},r.hasAxisOrientSignalRef()&&(e.resize=!0)):gt(e)&&(e={type:e}),i&&o&&Z7t(e.type)){if(i==="step"&&o==="step")Ze(Cye()),e.type="pad";else if(i==="step"||o==="step"){const s=i==="step"?"width":"height";Ze(Cye(y6(s)));const a=s==="width"?"height":"width";e.type=J7t(a)}}return{...Qe(e).length===1&&e.type?e.type==="pad"?{}:{autosize:e.type}:{autosize:e},...Zye(n,!1),...Zye(t,!0)}}function LXt(t,e,n={},r){const i=t.config?o7t(t.config):void 0,o=[].concat(t.assembleSelectionData([]),zqt(t.component.data,n)),s=t.assembleProjections(),a=t.assembleTitle(),l=t.assembleGroupStyle(),c=t.assembleGroupEncodeEntry(!0);let u=t.assembleLayoutSignals();u=u.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(e[h.name]=+h.value,!1):!0);const{params:f,...d}=e;return{$schema:"https://vega.github.io/schema/vega/v5.json",...t.description?{description:t.description}:{},...d,...a?{title:a}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...s.length>0?{projections:s}:{},...t.assembleGroup([...u,...t.assembleSelectionTopLevelSignals([]),...WBe(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}const $Xt=f8t.version,FXt=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:rC,accessPathWithDatum:Tse,compile:DXt,contains:En,deepEqual:sc,deleteNestedProperty:M5,duplicate:Kt,entries:hy,every:Cse,fieldIntersection:Ese,flatAccessWithDatum:t4e,getFirstDefined:qi,hasIntersection:Ose,hasProperty:Ke,hash:Mn,internalField:i4e,isBoolean:GA,isEmpty:Tr,isEqual:h8t,isInternalField:o4e,isNullOrFalse:NY,isNumeric:d6,keys:Qe,logicalExpr:gk,mergeDeep:Jje,never:Zje,normalize:n6e,normalizeAngle:HA,omit:pl,pick:tC,prefixGenerator:zY,removePathFromField:IO,replaceAll:Ob,replacePathInField:Pu,resetIdCounter:g8t,setEqual:e4e,some:nC,stringify:kr,titleCase:IR,unique:Jd,uniqueId:r4e,vals:ws,varName:gi,version:$Xt},Symbol.toStringTag,{value:"Module"}));function yUe(t){const[e,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}}var NXt="vega-themes",zXt="2.15.0",jXt="Themes for stylized Vega and Vega-Lite visualizations.",BXt=["vega","vega-lite","themes","style"],UXt="BSD-3-Clause",WXt={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},VXt=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],GXt="build/vega-themes.js",HXt="build/vega-themes.module.js",qXt="build/vega-themes.min.js",XXt="build/vega-themes.min.js",YXt="build/vega-themes.module.d.ts",QXt={type:"git",url:"https://github.com/vega/vega-themes.git"},KXt=["src","build"],ZXt={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},JXt={"@babel/core":"^7.24.6","@babel/plugin-transform-runtime":"^7.24.6","@babel/preset-env":"^7.24.6","@babel/preset-typescript":"^7.24.6","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","browser-sync":"^3.0.2",concurrently:"^8.2.2",eslint:"^8.45.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","gh-pages":"^6.1.1",prettier:"^3.2.5","release-it":"^17.3.0",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",typescript:"^5.4.5",vega:"^5.25.0","vega-lite":"^5.9.3"},eYt={vega:"*","vega-lite":"*"},tYt={},nYt={name:NXt,version:zXt,description:jXt,keywords:BXt,license:UXt,author:WXt,contributors:VXt,main:GXt,module:HXt,unpkg:qXt,jsdelivr:XXt,types:YXt,repository:QXt,files:KXt,scripts:ZXt,devDependencies:JXt,peerDependencies:eYt,dependencies:tYt};const lw="#fff",P0e="#888",rYt={background:"#333",view:{stroke:P0e},title:{color:lw,subtitleColor:lw},style:{"guide-label":{fill:lw},"guide-title":{fill:lw}},axis:{domainColor:lw,gridColor:P0e,tickColor:lw}},w0="#4572a7",iYt={background:"#fff",arc:{fill:w0},area:{fill:w0},line:{stroke:w0,strokeWidth:2},path:{stroke:w0},rect:{fill:w0},shape:{stroke:w0},symbol:{fill:w0,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},_0="#30a2da",n9="#cbcbcb",oYt="#999",sYt="#333",M0e="#f0f0f0",R0e="#333",aYt={arc:{fill:_0},area:{fill:_0},axis:{domainColor:n9,grid:!0,gridColor:n9,gridWidth:1,labelColor:oYt,labelFontSize:10,titleColor:sYt,tickColor:n9,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:M0e,group:{fill:M0e},legend:{labelColor:R0e,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:R0e,titleFontSize:14,titlePadding:10},line:{stroke:_0,strokeWidth:2},path:{stroke:_0,strokeWidth:.5},rect:{fill:_0},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:_0},bar:{binSpacing:2,fill:_0,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},S0="#000",lYt={group:{fill:"#e5e5e5"},arc:{fill:S0},area:{fill:S0},line:{stroke:S0},path:{stroke:S0},rect:{fill:S0},shape:{stroke:S0},symbol:{fill:S0,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},cYt=22,uYt="normal",D0e="Benton Gothic, sans-serif",I0e=11.5,fYt="normal",C0="#82c6df",r9="Benton Gothic Bold, sans-serif",L0e="normal",$0e=13,f2={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},dYt={background:"#ffffff",title:{anchor:"start",color:"#000000",font:r9,fontSize:cYt,fontWeight:uYt},arc:{fill:C0},area:{fill:C0},line:{stroke:C0,strokeWidth:2},path:{stroke:C0},rect:{fill:C0},shape:{stroke:C0},symbol:{fill:C0,size:30},axis:{labelFont:D0e,labelFontSize:I0e,labelFontWeight:fYt,titleFont:r9,titleFontSize:$0e,titleFontWeight:L0e},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:D0e,labelFontSize:I0e,symbolType:"square",titleFont:r9,titleFontSize:$0e,titleFontWeight:L0e},range:{category:f2["category-6"],diverging:f2["fireandice-6"],heatmap:f2["fire-7"],ordinal:f2["fire-7"],ramp:f2["fire-7"]}},O0="#ab5787",lL="#979797",hYt={background:"#f9f9f9",arc:{fill:O0},area:{fill:O0},line:{stroke:O0},path:{stroke:O0},rect:{fill:O0},shape:{stroke:O0},symbol:{fill:O0,size:30},axis:{domainColor:lL,domainWidth:.5,gridWidth:.2,labelColor:lL,tickColor:lL,tickWidth:.2,titleColor:lL},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},E0="#3e5c69",pYt={background:"#fff",arc:{fill:E0},area:{fill:E0},line:{stroke:E0},path:{stroke:E0},rect:{fill:E0},shape:{stroke:E0},symbol:{fill:E0},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},zc="#1696d2",F0e="#000000",gYt="#FFFFFF",cL="Lato",i9="Lato",mYt="Lato",vYt="#DEDDDD",yYt=18,d2={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},xYt={background:gYt,title:{anchor:"start",fontSize:yYt,font:cL},axisX:{domain:!0,domainColor:F0e,domainWidth:1,grid:!1,labelFontSize:12,labelFont:i9,labelAngle:0,tickColor:F0e,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:cL},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:vYt,gridWidth:1,labelFontSize:12,labelFont:i9,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:cL,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:i9,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:cL,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:d2["six-groups-cat-1"],diverging:d2["diverging-colors"],heatmap:d2["diverging-colors"],ordinal:d2["six-groups-seq"],ramp:d2["shades-blue"]},area:{fill:zc},rect:{fill:zc},line:{color:zc,stroke:zc,strokeWidth:5},trail:{color:zc,stroke:zc,strokeWidth:0,size:1},path:{stroke:zc,strokeWidth:.5},point:{filled:!0},text:{font:mYt,color:zc,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:zc,stroke:null}},arc:{fill:zc},shape:{stroke:zc},symbol:{fill:zc,size:30}},T0="#3366CC",N0e="#ccc",uL="Arial, sans-serif",bYt={arc:{fill:T0},area:{fill:T0},path:{stroke:T0},rect:{fill:T0},shape:{stroke:T0},symbol:{stroke:T0},circle:{fill:T0},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:uL,fontSize:12},"guide-title":{font:uL,fontSize:12},"group-title":{font:uL,fontSize:12}},title:{font:uL,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:N0e,tickColor:N0e,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Gae=t=>t*(1/3+1),z0e=Gae(9),j0e=Gae(10),B0e=Gae(12),h2="Segoe UI",U0e="wf_standard-font, helvetica, arial, sans-serif",W0e="#252423",p2="#605E5C",V0e="transparent",wYt="#C8C6C4",rf="#118DFF",_Yt="#12239E",SYt="#E66C37",CYt="#6B007B",OYt="#E044A7",EYt="#744EC2",TYt="#D9B300",kYt="#D64550",xUe=rf,bUe="#DEEFFF",G0e=[bUe,xUe],AYt=[bUe,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",xUe],PYt={view:{stroke:V0e},background:V0e,font:h2,header:{titleFont:U0e,titleFontSize:B0e,titleColor:W0e,labelFont:h2,labelFontSize:j0e,labelColor:p2},axis:{ticks:!1,grid:!1,domain:!1,labelColor:p2,labelFontSize:z0e,titleFont:U0e,titleColor:W0e,titleFontSize:B0e,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:wYt,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:rf},line:{stroke:rf,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:h2,fontSize:z0e,fill:p2},arc:{fill:rf},area:{fill:rf,line:!0,opacity:.6},path:{stroke:rf},rect:{fill:rf},point:{fill:rf,filled:!0,size:75},shape:{stroke:rf},symbol:{fill:rf,strokeWidth:1.5,size:50},legend:{titleFont:h2,titleFontWeight:"bold",titleColor:p2,labelFont:h2,labelFontSize:j0e,labelColor:p2,symbolType:"circle",symbolSize:75},range:{category:[rf,_Yt,SYt,CYt,OYt,EYt,TYt,kYt],diverging:G0e,heatmap:G0e,ordinal:AYt}},o9='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',MYt='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',s9=400,fL={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},RYt=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],DYt=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function tU({theme:t,background:e}){const n=["white","g10"].includes(t)?"light":"dark",r=fL.gridBg[t],i=fL.textPrimary[t],o=fL.textSecondary[t],s=n==="dark"?RYt:DYt,a=n==="dark"?"#d4bbff":"#6929c4";return{background:e,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:o9,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:MYt,labelFontWeight:s9,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:fL.layerAccent01[t],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:o9,fill:o,fontWeight:s9},"guide-title":{font:o9,fill:o,fontWeight:s9}},range:{category:s,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const IYt=tU({theme:"white",background:"#ffffff"}),LYt=tU({theme:"g10",background:"#f4f4f4"}),$Yt=tU({theme:"g90",background:"#262626"}),FYt=tU({theme:"g100",background:"#161616"}),NYt=nYt.version,wUe=Object.freeze(Object.defineProperty({__proto__:null,carbong10:LYt,carbong100:FYt,carbong90:$Yt,carbonwhite:IYt,dark:rYt,excel:iYt,fivethirtyeight:aYt,ggplot2:lYt,googlecharts:bYt,latimes:dYt,powerbi:PYt,quartz:hYt,urbaninstitute:xYt,version:NYt,vox:pYt},Symbol.toStringTag,{value:"Module"}));function zYt(t,e,n,r){if(We(t))return`[${t.map(i=>e(gt(i)?i:H0e(i,n))).join(", ")}]`;if(ht(t)){let i="";const{title:o,image:s,...a}=t;o&&(i+=`

${e(o)}

`),s&&(i+=``);const l=Object.keys(a);if(l.length>0){i+="";for(const c of l){let u=a[c];u!==void 0&&(ht(u)&&(u=H0e(u,n)),i+=``)}i+="
${e(c)}${e(u)}
"}return i||"{}"}return e(t)}function jYt(t){const e=[];return function(n,r){if(typeof r!="object"||r===null)return r;const i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}function H0e(t,e){return JSON.stringify(t,jYt(e))}var BYt=`#vg-tooltip-element { visibility: hidden; padding: 8px; position: fixed; @@ -376,11 +376,11 @@ ${a}`)}return c}(t,"",0)}function Al(t,e,n){return t.fields=e||[],t.fname=n,t}fu * (c) 2017-2022 Joachim Wester * MIT licensed */var YYt=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)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),QYt=Object.prototype.hasOwnProperty;function uQ(t,e){return QYt.call(t,e)}function fQ(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n=48&&r<=57){e++;continue}return!1}return!0}function G0(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function EUe(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function hQ(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var e=0,n=t.length;e0&&l[u-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[h]===void 0?d=l.slice(0,u).join("/"):u==f-1&&(d=e.path),d!==void 0&&p(e,0,t,d)),u++,Array.isArray(c)){if(h==="-")h=c.length;else{if(n&&!dQ(h))throw new Di("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);dQ(h)&&(h=~~h)}if(u>=f){if(n&&e.op==="add"&&h>c.length)throw new Di("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);var s=ZYt[e.op].call(e,c,h,t);if(s.test===!1)throw new Di("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}}else if(u>=f){var s=v_[e.op].call(e,c,h,t);if(s.test===!1)throw new Di("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}if(c=c[h],n&&u0)throw new Di('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Di("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Di("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&hQ(t.value))throw new Di("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n){if(t.op=="add"){var i=t.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new Di("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==r)throw new Di("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if(t.op==="move"||t.op==="copy"){var s={op:"_get",path:t.from,value:void 0},a=kUe([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Di("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}}else throw new Di("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n)}function kUe(t,e,n){try{if(!Array.isArray(t))throw new Di("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)nU(ac(e),ac(t),n||!0);else{n=n||H5;for(var r=0;r0&&l[u-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[h]===void 0?d=l.slice(0,u).join("/"):u==f-1&&(d=e.path),d!==void 0&&p(e,0,t,d)),u++,Array.isArray(c)){if(h==="-")h=c.length;else{if(n&&!dQ(h))throw new Di("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);dQ(h)&&(h=~~h)}if(u>=f){if(n&&e.op==="add"&&h>c.length)throw new Di("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);var s=ZYt[e.op].call(e,c,h,t);if(s.test===!1)throw new Di("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}}else if(u>=f){var s=v_[e.op].call(e,c,h,t);if(s.test===!1)throw new Di("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}if(c=c[h],n&&u0)throw new Di('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Di("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Di("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&hQ(t.value))throw new Di("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n){if(t.op=="add"){var i=t.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new Di("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==r)throw new Di("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if(t.op==="move"||t.op==="copy"){var s={op:"_get",path:t.from,value:void 0},a=kUe([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Di("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}}else throw new Di("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n)}function kUe(t,e,n){try{if(!Array.isArray(t))throw new Di("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)nU(ac(e),ac(t),n||!0);else{n=n||H5;for(var r=0;r0&&(t.patches=[],t.callback&&t.callback(r)),r}function qae(t,e,n,r,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var o=fQ(e),s=fQ(t),a=!1,l=s.length-1;l>=0;l--){var c=s[l],u=t[c];if(uQ(e,c)&&!(e[c]===void 0&&u!==void 0&&Array.isArray(e)===!1)){var f=e[c];typeof u=="object"&&u!=null&&typeof f=="object"&&f!=null&&Array.isArray(u)===Array.isArray(f)?qae(u,f,n,r+"/"+G0(c),i):u!==f&&(i&&n.push({op:"test",path:r+"/"+G0(c),value:ac(u)}),n.push({op:"replace",path:r+"/"+G0(c),value:ac(f)}))}else Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+G0(c),value:ac(u)}),n.push({op:"remove",path:r+"/"+G0(c)}),a=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}))}if(!(!a&&o.length==s.length))for(var l=0;l=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(n,r)}return this}}return l9=t,l9}var c9,Y0e;function Xae(){if(Y0e)return c9;Y0e=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return c9=r=>r?typeof r!="object"?t:r:e,c9}var dL={exports:{}},u9,Q0e;function Yae(){if(Q0e)return u9;Q0e=1;const t="2.0.0",e=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=e-6;return u9={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},u9}var f9,K0e;function rU(){return K0e||(K0e=1,f9=typeof process=="object"&&a9&&a9.NODE_DEBUG&&/\bsemver\b/i.test(a9.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),f9}var Z0e;function Qae(){return Z0e||(Z0e=1,function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Yae(),o=rU();e=t.exports={};const s=e.re=[],a=e.safeRe=[],l=e.src=[],c=e.t={};let u=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=g=>{for(const[m,v]of d)g=g.split(`${m}*`).join(`${m}{0,${v}}`).split(`${m}+`).join(`${m}{1,${v}}`);return g},p=(g,m,v)=>{const y=h(m),x=u++;o(g,x,m),c[g]=x,l[x]=m,s[x]=new RegExp(m,v?"g":void 0),a[x]=new RegExp(y,v?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("COERCERTLFULL",l[c.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(dL,dL.exports)),dL.exports}var d9,J0e;function dQt(){if(J0e)return d9;J0e=1;const t=/^[0-9]+$/,e=(r,i)=>{const o=t.test(r),s=t.test(i);return o&&s&&(r=+r,i=+i),r===i?0:o&&!s?-1:s&&!o?1:re(i,r)},d9}var h9,exe;function Kae(){if(exe)return h9;exe=1;const t=rU(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:n}=Yae(),{safeRe:r,t:i}=Qae(),o=Xae(),{compareIdentifiers:s}=dQt();class a{constructor(c,u){if(u=o(u),c instanceof a){if(c.loose===!!u.loose&&c.includePrerelease===!!u.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",c,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const f=c.trim().match(u.loose?r[i.LOOSE]:r[i.FULL]);if(!f)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(u===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(u){let h=[u,d];f===!1&&(h=[u]),s(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return h9=a,h9}var p9,txe;function WO(){if(txe)return p9;txe=1;const t=Kae();return p9=(n,r,i)=>new t(n,i).compare(new t(r,i)),p9}var g9,nxe;function hQt(){if(nxe)return g9;nxe=1;const t=WO();return g9=(n,r,i)=>t(n,r,i)===0,g9}var m9,rxe;function pQt(){if(rxe)return m9;rxe=1;const t=WO();return m9=(n,r,i)=>t(n,r,i)!==0,m9}var v9,ixe;function gQt(){if(ixe)return v9;ixe=1;const t=WO();return v9=(n,r,i)=>t(n,r,i)>0,v9}var y9,oxe;function mQt(){if(oxe)return y9;oxe=1;const t=WO();return y9=(n,r,i)=>t(n,r,i)>=0,y9}var x9,sxe;function vQt(){if(sxe)return x9;sxe=1;const t=WO();return x9=(n,r,i)=>t(n,r,i)<0,x9}var b9,axe;function yQt(){if(axe)return b9;axe=1;const t=WO();return b9=(n,r,i)=>t(n,r,i)<=0,b9}var w9,lxe;function xQt(){if(lxe)return w9;lxe=1;const t=hQt(),e=pQt(),n=gQt(),r=mQt(),i=vQt(),o=yQt();return w9=(a,l,c,u)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return t(a,c,u);case"!=":return e(a,c,u);case">":return n(a,c,u);case">=":return r(a,c,u);case"<":return i(a,c,u);case"<=":return o(a,c,u);default:throw new TypeError(`Invalid operator: ${l}`)}},w9}var _9,cxe;function bQt(){if(cxe)return _9;cxe=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(u,f){if(f=n(f),u instanceof e){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===t?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=t}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===t||u===t)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return o(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,f).test(u.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||o(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||o(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}_9=e;const n=Xae(),{safeRe:r,t:i}=Qae(),o=xQt(),s=rU(),a=Kae(),l=AUe();return _9}var S9,uxe;function AUe(){if(uxe)return S9;uxe=1;const t=/\s+/g;class e{constructor(M,I){if(I=i(I),M instanceof e)return M.loose===!!I.loose&&M.includePrerelease===!!I.includePrerelease?M:new e(M.raw,I);if(M instanceof o)return this.raw=M.value,this.set=[[M]],this.formatted=void 0,this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.includePrerelease,this.raw=M.trim().replace(t," "),this.set=this.raw.split("||").map(z=>this.parseRange(z.trim())).filter(z=>z.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const z=this.set[0];if(this.set=this.set.filter(F=>!g(F[0])),this.set.length===0)this.set=[z];else if(this.set.length>1){for(const F of this.set)if(F.length===1&&m(F[0])){this.set=[F];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M0&&(this.formatted+="||");const I=this.set[M];for(let z=0;z0&&(this.formatted+=" "),this.formatted+=I[z].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const z=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+M,F=r.get(z);if(F)return F;const N=this.options.loose,L=N?l[c.HYPHENRANGELOOSE]:l[c.HYPHENRANGE];M=M.replace(L,A(this.options.includePrerelease)),s("hyphen replace",M),M=M.replace(l[c.COMPARATORTRIM],u),s("comparator trim",M),M=M.replace(l[c.TILDETRIM],f),s("tilde trim",M),M=M.replace(l[c.CARETTRIM],d),s("caret trim",M);let B=M.split(" ").map(V=>y(V,this.options)).join(" ").split(/\s+/).map(V=>P(V,this.options));N&&(B=B.filter(V=>(s("loose invalid filter",V,this.options),!!V.match(l[c.COMPARATORLOOSE])))),s("range list",B);const $=new Map,j=B.map(V=>new o(V,this.options));for(const V of j){if(g(V))return[V];$.set(V.value,V)}$.size>1&&$.has("")&&$.delete("");const X=[...$.values()];return r.set(z,X),X}intersects(M,I){if(!(M instanceof e))throw new TypeError("a Range is required");return this.set.some(z=>v(z,I)&&M.set.some(F=>v(F,I)&&z.every(N=>F.every(L=>N.intersects(L,I)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new a(M,this.options)}catch{return!1}for(let I=0;IT.value==="<0.0.0-0",m=T=>T.value==="",v=(T,M)=>{let I=!0;const z=T.slice();let F=z.pop();for(;I&&z.length;)I=z.every(N=>F.intersects(N,M)),F=z.pop();return I},y=(T,M)=>(s("comp",T,M),T=_(T,M),s("caret",T),T=b(T,M),s("tildes",T),T=O(T,M),s("xrange",T),T=E(T,M),s("stars",T),T),x=T=>!T||T.toLowerCase()==="x"||T==="*",b=(T,M)=>T.trim().split(/\s+/).map(I=>w(I,M)).join(" "),w=(T,M)=>{const I=M.loose?l[c.TILDELOOSE]:l[c.TILDE];return T.replace(I,(z,F,N,L,B)=>{s("tilde",T,z,F,N,L,B);let $;return x(F)?$="":x(N)?$=`>=${F}.0.0 <${+F+1}.0.0-0`:x(L)?$=`>=${F}.${N}.0 <${F}.${+N+1}.0-0`:B?(s("replaceTilde pr",B),$=`>=${F}.${N}.${L}-${B} <${F}.${+N+1}.0-0`):$=`>=${F}.${N}.${L} <${F}.${+N+1}.0-0`,s("tilde return",$),$})},_=(T,M)=>T.trim().split(/\s+/).map(I=>S(I,M)).join(" "),S=(T,M)=>{s("caret",T,M);const I=M.loose?l[c.CARETLOOSE]:l[c.CARET],z=M.includePrerelease?"-0":"";return T.replace(I,(F,N,L,B,$)=>{s("caret",T,F,N,L,B,$);let j;return x(N)?j="":x(L)?j=`>=${N}.0.0${z} <${+N+1}.0.0-0`:x(B)?N==="0"?j=`>=${N}.${L}.0${z} <${N}.${+L+1}.0-0`:j=`>=${N}.${L}.0${z} <${+N+1}.0.0-0`:$?(s("replaceCaret pr",$),N==="0"?L==="0"?j=`>=${N}.${L}.${B}-${$} <${N}.${L}.${+B+1}-0`:j=`>=${N}.${L}.${B}-${$} <${N}.${+L+1}.0-0`:j=`>=${N}.${L}.${B}-${$} <${+N+1}.0.0-0`):(s("no pr"),N==="0"?L==="0"?j=`>=${N}.${L}.${B}${z} <${N}.${L}.${+B+1}-0`:j=`>=${N}.${L}.${B}${z} <${N}.${+L+1}.0-0`:j=`>=${N}.${L}.${B} <${+N+1}.0.0-0`),s("caret return",j),j})},O=(T,M)=>(s("replaceXRanges",T,M),T.split(/\s+/).map(I=>k(I,M)).join(" ")),k=(T,M)=>{T=T.trim();const I=M.loose?l[c.XRANGELOOSE]:l[c.XRANGE];return T.replace(I,(z,F,N,L,B,$)=>{s("xRange",T,z,F,N,L,B,$);const j=x(N),X=j||x(L),V=X||x(B),Y=V;return F==="="&&Y&&(F=""),$=M.includePrerelease?"-0":"",j?F===">"||F==="<"?z="<0.0.0-0":z="*":F&&Y?(X&&(L=0),B=0,F===">"?(F=">=",X?(N=+N+1,L=0,B=0):(L=+L+1,B=0)):F==="<="&&(F="<",X?N=+N+1:L=+L+1),F==="<"&&($="-0"),z=`${F+N}.${L}.${B}${$}`):X?z=`>=${N}.0.0${$} <${+N+1}.0.0-0`:V&&(z=`>=${N}.${L}.0${$} <${N}.${+L+1}.0-0`),s("xRange return",z),z})},E=(T,M)=>(s("replaceStars",T,M),T.trim().replace(l[c.STAR],"")),P=(T,M)=>(s("replaceGTE0",T,M),T.trim().replace(l[M.includePrerelease?c.GTE0PRE:c.GTE0],"")),A=T=>(M,I,z,F,N,L,B,$,j,X,V,Y)=>(x(z)?I="":x(F)?I=`>=${z}.0.0${T?"-0":""}`:x(N)?I=`>=${z}.${F}.0${T?"-0":""}`:L?I=`>=${I}`:I=`>=${I}${T?"-0":""}`,x(j)?$="":x(X)?$=`<${+j+1}.0.0-0`:x(V)?$=`<${j}.${+X+1}.0-0`:Y?$=`<=${j}.${X}.${V}-${Y}`:T?$=`<${j}.${X}.${+V+1}-0`:$=`<=${$}`,`${I} ${$}`.trim()),R=(T,M,I)=>{for(let z=0;z0){const F=T[z].semver;if(F.major===M.major&&F.minor===M.minor&&F.patch===M.patch)return!0}return!1}return!0};return S9}var C9,fxe;function wQt(){if(fxe)return C9;fxe=1;const t=AUe();return C9=(n,r,i)=>{try{r=new t(r,i)}catch{return!1}return r.test(n)},C9}var _Qt=wQt(),PUe=uQt(_Qt);function SQt(t,e,n){const r=t.open(e),i=1e4,o=250,{origin:s}=new URL(e);let a=~~(i/o);function l(u){u.source===r&&(a=0,t.removeEventListener("message",l,!1))}t.addEventListener("message",l,!1);function c(){a<=0||(r.postMessage(n,s),setTimeout(c,o),a-=1)}setTimeout(c,o)}var CQt=`.vega-embed { + */var Hae=new WeakMap,tQt=function(){function t(e){this.observers=new Map,this.obj=e}return t}(),nQt=function(){function t(e,n){this.callback=e,this.observer=n}return t}();function rQt(t){return Hae.get(t)}function iQt(t,e){return t.observers.get(e)}function oQt(t,e){t.observers.delete(e.callback)}function sQt(t,e){e.unobserve()}function aQt(t,e){var n=[],r,i=rQt(t);if(!i)i=new tQt(t),Hae.set(t,i);else{var o=iQt(i,e);r=o&&o.observer}if(r)return r;if(r={},i.value=ac(t),e){r.callback=e,r.next=null;var s=function(){pQ(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(s)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=n,r.object=t,r.unobserve=function(){pQ(r),clearTimeout(r.next),oQt(i,r),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},i.observers.set(e,new nQt(e,r)),r}function pQ(t,e){e===void 0&&(e=!1);var n=Hae.get(t.object);qae(n.value,t.object,t.patches,"",e),t.patches.length&&nU(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function qae(t,e,n,r,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var o=fQ(e),s=fQ(t),a=!1,l=s.length-1;l>=0;l--){var c=s[l],u=t[c];if(uQ(e,c)&&!(e[c]===void 0&&u!==void 0&&Array.isArray(e)===!1)){var f=e[c];typeof u=="object"&&u!=null&&typeof f=="object"&&f!=null&&Array.isArray(u)===Array.isArray(f)?qae(u,f,n,r+"/"+G0(c),i):u!==f&&(i&&n.push({op:"test",path:r+"/"+G0(c),value:ac(u)}),n.push({op:"replace",path:r+"/"+G0(c),value:ac(f)}))}else Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+G0(c),value:ac(u)}),n.push({op:"remove",path:r+"/"+G0(c)}),a=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}))}if(!(!a&&o.length==s.length))for(var l=0;l=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(n,r)}return this}}return l9=t,l9}var c9,Y0e;function Xae(){if(Y0e)return c9;Y0e=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return c9=r=>r?typeof r!="object"?t:r:e,c9}var dL={exports:{}},u9,Q0e;function Yae(){if(Q0e)return u9;Q0e=1;const t="2.0.0",e=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=e-6;return u9={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},u9}var f9,K0e;function rU(){return K0e||(K0e=1,f9=typeof process=="object"&&a9&&a9.NODE_DEBUG&&/\bsemver\b/i.test(a9.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),f9}var Z0e;function Qae(){return Z0e||(Z0e=1,function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Yae(),o=rU();e=t.exports={};const s=e.re=[],a=e.safeRe=[],l=e.src=[],c=e.t={};let u=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=g=>{for(const[m,v]of d)g=g.split(`${m}*`).join(`${m}{0,${v}}`).split(`${m}+`).join(`${m}{1,${v}}`);return g},p=(g,m,v)=>{const y=h(m),x=u++;o(g,x,m),c[g]=x,l[x]=m,s[x]=new RegExp(m,v?"g":void 0),a[x]=new RegExp(y,v?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("COERCERTLFULL",l[c.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(dL,dL.exports)),dL.exports}var d9,J0e;function dQt(){if(J0e)return d9;J0e=1;const t=/^[0-9]+$/,e=(r,i)=>{const o=t.test(r),s=t.test(i);return o&&s&&(r=+r,i=+i),r===i?0:o&&!s?-1:s&&!o?1:re(i,r)},d9}var h9,exe;function Kae(){if(exe)return h9;exe=1;const t=rU(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:n}=Yae(),{safeRe:r,t:i}=Qae(),o=Xae(),{compareIdentifiers:s}=dQt();class a{constructor(c,u){if(u=o(u),c instanceof a){if(c.loose===!!u.loose&&c.includePrerelease===!!u.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",c,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const f=c.trim().match(u.loose?r[i.LOOSE]:r[i.FULL]);if(!f)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(u===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(u){let h=[u,d];f===!1&&(h=[u]),s(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return h9=a,h9}var p9,txe;function UO(){if(txe)return p9;txe=1;const t=Kae();return p9=(n,r,i)=>new t(n,i).compare(new t(r,i)),p9}var g9,nxe;function hQt(){if(nxe)return g9;nxe=1;const t=UO();return g9=(n,r,i)=>t(n,r,i)===0,g9}var m9,rxe;function pQt(){if(rxe)return m9;rxe=1;const t=UO();return m9=(n,r,i)=>t(n,r,i)!==0,m9}var v9,ixe;function gQt(){if(ixe)return v9;ixe=1;const t=UO();return v9=(n,r,i)=>t(n,r,i)>0,v9}var y9,oxe;function mQt(){if(oxe)return y9;oxe=1;const t=UO();return y9=(n,r,i)=>t(n,r,i)>=0,y9}var x9,sxe;function vQt(){if(sxe)return x9;sxe=1;const t=UO();return x9=(n,r,i)=>t(n,r,i)<0,x9}var b9,axe;function yQt(){if(axe)return b9;axe=1;const t=UO();return b9=(n,r,i)=>t(n,r,i)<=0,b9}var w9,lxe;function xQt(){if(lxe)return w9;lxe=1;const t=hQt(),e=pQt(),n=gQt(),r=mQt(),i=vQt(),o=yQt();return w9=(a,l,c,u)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return t(a,c,u);case"!=":return e(a,c,u);case">":return n(a,c,u);case">=":return r(a,c,u);case"<":return i(a,c,u);case"<=":return o(a,c,u);default:throw new TypeError(`Invalid operator: ${l}`)}},w9}var _9,cxe;function bQt(){if(cxe)return _9;cxe=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(u,f){if(f=n(f),u instanceof e){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===t?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=t}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===t||u===t)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return o(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,f).test(u.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||o(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||o(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}_9=e;const n=Xae(),{safeRe:r,t:i}=Qae(),o=xQt(),s=rU(),a=Kae(),l=AUe();return _9}var S9,uxe;function AUe(){if(uxe)return S9;uxe=1;const t=/\s+/g;class e{constructor(M,I){if(I=i(I),M instanceof e)return M.loose===!!I.loose&&M.includePrerelease===!!I.includePrerelease?M:new e(M.raw,I);if(M instanceof o)return this.raw=M.value,this.set=[[M]],this.formatted=void 0,this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.includePrerelease,this.raw=M.trim().replace(t," "),this.set=this.raw.split("||").map(z=>this.parseRange(z.trim())).filter(z=>z.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const z=this.set[0];if(this.set=this.set.filter(F=>!g(F[0])),this.set.length===0)this.set=[z];else if(this.set.length>1){for(const F of this.set)if(F.length===1&&m(F[0])){this.set=[F];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M0&&(this.formatted+="||");const I=this.set[M];for(let z=0;z0&&(this.formatted+=" "),this.formatted+=I[z].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const z=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+M,F=r.get(z);if(F)return F;const N=this.options.loose,L=N?l[c.HYPHENRANGELOOSE]:l[c.HYPHENRANGE];M=M.replace(L,A(this.options.includePrerelease)),s("hyphen replace",M),M=M.replace(l[c.COMPARATORTRIM],u),s("comparator trim",M),M=M.replace(l[c.TILDETRIM],f),s("tilde trim",M),M=M.replace(l[c.CARETTRIM],d),s("caret trim",M);let B=M.split(" ").map(V=>y(V,this.options)).join(" ").split(/\s+/).map(V=>P(V,this.options));N&&(B=B.filter(V=>(s("loose invalid filter",V,this.options),!!V.match(l[c.COMPARATORLOOSE])))),s("range list",B);const $=new Map,j=B.map(V=>new o(V,this.options));for(const V of j){if(g(V))return[V];$.set(V.value,V)}$.size>1&&$.has("")&&$.delete("");const X=[...$.values()];return r.set(z,X),X}intersects(M,I){if(!(M instanceof e))throw new TypeError("a Range is required");return this.set.some(z=>v(z,I)&&M.set.some(F=>v(F,I)&&z.every(N=>F.every(L=>N.intersects(L,I)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new a(M,this.options)}catch{return!1}for(let I=0;IT.value==="<0.0.0-0",m=T=>T.value==="",v=(T,M)=>{let I=!0;const z=T.slice();let F=z.pop();for(;I&&z.length;)I=z.every(N=>F.intersects(N,M)),F=z.pop();return I},y=(T,M)=>(s("comp",T,M),T=_(T,M),s("caret",T),T=b(T,M),s("tildes",T),T=O(T,M),s("xrange",T),T=E(T,M),s("stars",T),T),x=T=>!T||T.toLowerCase()==="x"||T==="*",b=(T,M)=>T.trim().split(/\s+/).map(I=>w(I,M)).join(" "),w=(T,M)=>{const I=M.loose?l[c.TILDELOOSE]:l[c.TILDE];return T.replace(I,(z,F,N,L,B)=>{s("tilde",T,z,F,N,L,B);let $;return x(F)?$="":x(N)?$=`>=${F}.0.0 <${+F+1}.0.0-0`:x(L)?$=`>=${F}.${N}.0 <${F}.${+N+1}.0-0`:B?(s("replaceTilde pr",B),$=`>=${F}.${N}.${L}-${B} <${F}.${+N+1}.0-0`):$=`>=${F}.${N}.${L} <${F}.${+N+1}.0-0`,s("tilde return",$),$})},_=(T,M)=>T.trim().split(/\s+/).map(I=>S(I,M)).join(" "),S=(T,M)=>{s("caret",T,M);const I=M.loose?l[c.CARETLOOSE]:l[c.CARET],z=M.includePrerelease?"-0":"";return T.replace(I,(F,N,L,B,$)=>{s("caret",T,F,N,L,B,$);let j;return x(N)?j="":x(L)?j=`>=${N}.0.0${z} <${+N+1}.0.0-0`:x(B)?N==="0"?j=`>=${N}.${L}.0${z} <${N}.${+L+1}.0-0`:j=`>=${N}.${L}.0${z} <${+N+1}.0.0-0`:$?(s("replaceCaret pr",$),N==="0"?L==="0"?j=`>=${N}.${L}.${B}-${$} <${N}.${L}.${+B+1}-0`:j=`>=${N}.${L}.${B}-${$} <${N}.${+L+1}.0-0`:j=`>=${N}.${L}.${B}-${$} <${+N+1}.0.0-0`):(s("no pr"),N==="0"?L==="0"?j=`>=${N}.${L}.${B}${z} <${N}.${L}.${+B+1}-0`:j=`>=${N}.${L}.${B}${z} <${N}.${+L+1}.0-0`:j=`>=${N}.${L}.${B} <${+N+1}.0.0-0`),s("caret return",j),j})},O=(T,M)=>(s("replaceXRanges",T,M),T.split(/\s+/).map(I=>k(I,M)).join(" ")),k=(T,M)=>{T=T.trim();const I=M.loose?l[c.XRANGELOOSE]:l[c.XRANGE];return T.replace(I,(z,F,N,L,B,$)=>{s("xRange",T,z,F,N,L,B,$);const j=x(N),X=j||x(L),V=X||x(B),Y=V;return F==="="&&Y&&(F=""),$=M.includePrerelease?"-0":"",j?F===">"||F==="<"?z="<0.0.0-0":z="*":F&&Y?(X&&(L=0),B=0,F===">"?(F=">=",X?(N=+N+1,L=0,B=0):(L=+L+1,B=0)):F==="<="&&(F="<",X?N=+N+1:L=+L+1),F==="<"&&($="-0"),z=`${F+N}.${L}.${B}${$}`):X?z=`>=${N}.0.0${$} <${+N+1}.0.0-0`:V&&(z=`>=${N}.${L}.0${$} <${N}.${+L+1}.0-0`),s("xRange return",z),z})},E=(T,M)=>(s("replaceStars",T,M),T.trim().replace(l[c.STAR],"")),P=(T,M)=>(s("replaceGTE0",T,M),T.trim().replace(l[M.includePrerelease?c.GTE0PRE:c.GTE0],"")),A=T=>(M,I,z,F,N,L,B,$,j,X,V,Y)=>(x(z)?I="":x(F)?I=`>=${z}.0.0${T?"-0":""}`:x(N)?I=`>=${z}.${F}.0${T?"-0":""}`:L?I=`>=${I}`:I=`>=${I}${T?"-0":""}`,x(j)?$="":x(X)?$=`<${+j+1}.0.0-0`:x(V)?$=`<${j}.${+X+1}.0-0`:Y?$=`<=${j}.${X}.${V}-${Y}`:T?$=`<${j}.${X}.${+V+1}-0`:$=`<=${$}`,`${I} ${$}`.trim()),R=(T,M,I)=>{for(let z=0;z0){const F=T[z].semver;if(F.major===M.major&&F.minor===M.minor&&F.patch===M.patch)return!0}return!1}return!0};return S9}var C9,fxe;function wQt(){if(fxe)return C9;fxe=1;const t=AUe();return C9=(n,r,i)=>{try{r=new t(r,i)}catch{return!1}return r.test(n)},C9}var _Qt=wQt(),PUe=uQt(_Qt);function SQt(t,e,n){const r=t.open(e),i=1e4,o=250,{origin:s}=new URL(e);let a=~~(i/o);function l(u){u.source===r&&(a=0,t.removeEventListener("message",l,!1))}t.addEventListener("message",l,!1);function c(){a<=0||(r.postMessage(n,s),setTimeout(c,o),a-=1)}setTimeout(c,o)}var CQt=`.vega-embed { position: relative; display: inline-block; box-sizing: border-box; @@ -498,30 +498,30 @@ ${a}`)}return c}(t,"",0)}function Al(t,e,n){return t.fields=e||[],t.fname=n,t}fu transform: scale(1); } } -`;function MUe(t,...e){for(const n of e)OQt(t,n);return t}function OQt(t,e){for(const n of Object.keys(e))bO(t,n,e[n],!0)}const cf=MUt;let JA=FXt;const hL=typeof window<"u"?window:void 0;var v2e;JA===void 0&&((v2e=hL==null?void 0:hL.vl)!=null&&v2e.compile)&&(JA=hL.vl);const EQt={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},TQt={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},CT={vega:"Vega","vega-lite":"Vega-Lite"},q5={vega:cf.version,"vega-lite":JA?JA.version:"not available"},kQt={vega:t=>t,"vega-lite":(t,e)=>JA.compile(t,{config:e}).spec},AQt=` +`;function MUe(t,...e){for(const n of e)OQt(t,n);return t}function OQt(t,e){for(const n of Object.keys(e))xO(t,n,e[n],!0)}const cf=MUt;let ZA=FXt;const hL=typeof window<"u"?window:void 0;var v2e;ZA===void 0&&((v2e=hL==null?void 0:hL.vl)!=null&&v2e.compile)&&(ZA=hL.vl);const EQt={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},TQt={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},ST={vega:"Vega","vega-lite":"Vega-Lite"},q5={vega:cf.version,"vega-lite":ZA?ZA.version:"not available"},kQt={vega:t=>t,"vega-lite":(t,e)=>ZA.compile(t,{config:e}).spec},AQt=` -`,PQt="chart-wrapper";function MQt(t){return typeof t=="function"}function dxe(t,e,n,r){const i=`${e}
`,o=`
${n}`,s=window.open("");s.document.write(i+t+o),s.document.title=`${CT[r]} JSON Source`}function RQt(t,e){if(t.$schema){const n=yUe(t.$schema);e&&e!==n.library&&console.warn(`The given visualization spec is written in ${CT[n.library]}, but mode argument sets ${CT[e]??e}.`);const r=n.library;return PUe(q5[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${CT[r]} ${n.version}, but the current version of ${CT[r]} is v${q5[r]}.`),r}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":e??"vega"}function RUe(t){return!!(t&&"load"in t)}function hxe(t){return RUe(t)?t:cf.loader(t)}function DQt(t){var n;const e=((n=t.usermeta)==null?void 0:n.embedOptions)??{};return gt(e.defaultStyle)&&(e.defaultStyle=!1),e}async function IQt(t,e,n={}){let r,i;gt(e)?(i=hxe(n.loader),r=JSON.parse(await i.load(e))):r=e;const o=DQt(r),s=o.loader;(!i||s)&&(i=hxe(n.loader??s));const a=await pxe(o,i),l=await pxe(n,i),c={...MUe(l,a),config:xO(l.config??{},a.config??{})};return await $Qt(t,r,c,i)}async function pxe(t,e){const n=gt(t.config)?JSON.parse(await e.load(t.config)):t.config??{},r=gt(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return{...t,...r?{patch:r}:{},...n?{config:n}:{}}}function LQt(t){const e=t.getRootNode?t.getRootNode():document;return e instanceof ShadowRoot?{root:e,rootContainer:e}:{root:document,rootContainer:document.head??document.body}}async function $Qt(t,e,n={},r){const i=n.theme?xO(wUe[n.theme],n.config??{}):n.config,o=Vy(n.actions)?n.actions:MUe({},EQt,n.actions??{}),s={...TQt,...n.i18n},a=n.renderer??"canvas",l=n.logLevel??cf.Warn,c=n.downloadFileName??"visualization",u=typeof t=="string"?document.querySelector(t):t;if(!u)throw new Error(`${t} does not exist`);if(n.defaultStyle!==!1){const w="vega-embed-style",{root:_,rootContainer:S}=LQt(u);if(!_.getElementById(w)){const O=document.createElement("style");O.id=w,O.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?CQt.toString():n.defaultStyle,S.appendChild(O)}}const f=RQt(e,n.mode);let d=kQt[f](e,i);if(f==="vega-lite"&&d.$schema){const w=yUe(d.$schema);PUe(q5.vega,`^${w.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${w.version}, but current version is v${q5.vega}.`)}u.classList.add("vega-embed"),o&&u.classList.add("has-actions"),u.innerHTML="";let h=u;if(o){const w=document.createElement("div");w.classList.add(PQt),u.appendChild(w),h=w}const p=n.patch;if(p&&(d=p instanceof Function?p(d):nU(d,p,!0,!1).newDocument),n.formatLocale&&cf.formatLocale(n.formatLocale),n.timeFormatLocale&&cf.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const w in n.expressionFunctions){const _=n.expressionFunctions[w];"fn"in _?cf.expressionFunction(w,_.fn,_.visitor):_ instanceof Function&&cf.expressionFunction(w,_)}const{ast:g}=n,m=cf.parse(d,f==="vega-lite"?{}:i,{ast:g}),v=new(n.viewClass||cf.View)(m,{loader:r,logLevel:l,renderer:a,...g?{expr:cf.expressionInterpreter??n.expr??BUt}:{}});if(v.addSignalListener("autosize",(w,_)=>{const{type:S}=_;S=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):S=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):S=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:w,tooltip:_}=n,S=w&&!RUe(w)?w==null?void 0:w.baseURL:void 0,O=MQt(_)?_:new XYt({baseURL:S,..._===!0?{}:_}).call;v.tooltip(O)}let{hover:y}=n;if(y===void 0&&(y=f==="vega"),y){const{hoverSet:w,updateSet:_}=typeof y=="boolean"?{}:y;v.hover(w,_)}n&&(n.width!=null&&v.width(n.width),n.height!=null&&v.height(n.height),n.padding!=null&&v.padding(n.padding)),await v.initialize(h,n.bind).runAsync();let x;if(o!==!1){let w=u;if(n.defaultStyle!==!1||n.forceActionsMenu){const S=document.createElement("details");S.title=s.CLICK_TO_VIEW_ACTIONS,u.append(S),w=S;const O=document.createElement("summary");O.innerHTML=AQt,S.append(O),x=k=>{S.contains(k.target)||S.removeAttribute("open")},document.addEventListener("click",x)}const _=document.createElement("div");if(w.append(_),_.classList.add("vega-actions"),o===!0||o.export!==!1){for(const S of["svg","png"])if(o===!0||o.export===!0||o.export[S]){const O=s[`${S.toUpperCase()}_ACTION`],k=document.createElement("a"),E=ht(n.scaleFactor)?n.scaleFactor[S]:n.scaleFactor;k.text=O,k.href="#",k.target="_blank",k.download=`${c}.${S}`,k.addEventListener("mousedown",async function(P){P.preventDefault();const A=await v.toImageURL(S,E);this.href=A}),_.append(k)}}if(o===!0||o.source!==!1){const S=document.createElement("a");S.text=s.SOURCE_ACTION,S.href="#",S.addEventListener("click",function(O){dxe(FW(e),n.sourceHeader??"",n.sourceFooter??"",f),O.preventDefault()}),_.append(S)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const S=document.createElement("a");S.text=s.COMPILED_ACTION,S.href="#",S.addEventListener("click",function(O){dxe(FW(d),n.sourceHeader??"",n.sourceFooter??"","vega"),O.preventDefault()}),_.append(S)}if(o===!0||o.editor!==!1){const S=n.editorUrl??"https://vega.github.io/editor/",O=document.createElement("a");O.text=s.EDITOR_ACTION,O.href="#",O.addEventListener("click",function(k){SQt(window,S,{config:i,mode:p?"vega":f,renderer:a,spec:FW(p?d:e)}),k.preventDefault()}),_.append(O)}}function b(){x&&document.removeEventListener("click",x),v.finalize()}return{view:v,spec:e,vgSpec:d,finalize:b,embedOptions:n}}function FQt(t){return!!t&&{}.toString.call(t)==="[object Function]"}function NQt(t,e,n){n&&(FQt(n)?n(t.data(e)):t.change(e,cf.changeset().remove(()=>!0).insert(n)))}function zQt(t,e){Object.keys(e).forEach(n=>{NQt(t,n,e[n])})}function DUe(t){const e=new Set;return t.forEach(n=>{Object.keys(n).forEach(r=>{e.add(r)})}),e}const IUe=()=>{};function O9(t,e){const n=Object.keys(e);return n.forEach(r=>{try{t.addSignalListener(r,e[r])}catch(i){console.warn("Cannot add invalid signal listener.",i)}}),n.length>0}var jQt=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const BQt=sn(jQt);function UQt(t,e){if(t===e)return!1;const n={width:!1,height:!1,isExpensive:!1},r=DUe([t,e]);return r.has("width")&&(!("width"in t)||!("width"in e)||t.width!==e.width)&&("width"in t&&typeof t.width=="number"?n.width=t.width:n.isExpensive=!0),r.has("height")&&(!("height"in t)||!("height"in e)||t.height!==e.height)&&("height"in t&&typeof t.height=="number"?n.height=t.height:n.isExpensive=!0),r.delete("width"),r.delete("height"),[...r].some(i=>!(i in t)||!(i in e)||!BQt(t[i],e[i]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function gxe(t,e){const n=Object.keys(e);return n.forEach(r=>{try{t.removeSignalListener(r,e[r])}catch(i){console.warn("Cannot remove invalid signal listener.",i)}}),n.length>0}function E9(t){const{spec:e,width:n,height:r}=t;return typeof n<"u"&&typeof r<"u"?{...e,width:n,height:r}:typeof n<"u"?{...e,width:n}:typeof r<"u"?{...e,height:r}:e}function OT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class LUe extends he.PureComponent{constructor(){super(...arguments),OT(this,"containerRef",he.createRef()),OT(this,"resultPromise",void 0),OT(this,"handleError",e=>{const{onError:n=IUe}=this.props;n(e,this.containerRef.current),console.warn(e)}),OT(this,"modifyView",e=>{this.resultPromise&&this.resultPromise.then(n=>(n&&e(n.view),!0)).catch(this.handleError)})}componentDidMount(){this.createView()}componentDidUpdate(e){const n=DUe([this.props,e]);if(n.delete("className"),n.delete("signalListeners"),n.delete("spec"),n.delete("style"),n.delete("width"),n.delete("height"),Array.from(n).some(r=>this.props[r]!==e[r]))this.clearView(),this.createView();else{const r=UQt(E9(this.props),E9(e)),{signalListeners:i}=this.props,{signalListeners:o}=e;if(r)if(r.isExpensive)this.clearView(),this.createView();else{const s=!nX(i,o);this.modifyView(a=>{r.width!==!1&&a.width(r.width),r.height!==!1&&a.height(r.height),s&&(o&&gxe(a,o),i&&O9(a,i)),a.run()})}else nX(i,o)||this.modifyView(s=>{o&&gxe(s,o),i&&O9(s,i),s.run()})}}componentWillUnmount(){this.clearView()}createView(){const{spec:e,onNewView:n,signalListeners:r={},width:i,height:o,...s}=this.props;if(this.containerRef.current){const a=E9(this.props);this.resultPromise=IQt(this.containerRef.current,a,s).then(l=>{if(l){const{view:c}=l;O9(c,r)&&c.run()}return l}).catch(this.handleError),n&&this.modifyView(n)}}clearView(){return this.resultPromise&&this.resultPromise.then(e=>{e&&e.finalize()}).catch(this.handleError),this.resultPromise=void 0,this}render(){const{className:e,style:n}=this.props;return he.createElement("div",{ref:this.containerRef,className:e,style:n})}}OT(LUe,"propTypes",{className:ge.string,onError:ge.func});function gQ(){return gQ=Object.assign||function(t){for(var e=1;e{this.update();const{onNewView:n=IUe}=this.props;n(e)})}componentDidMount(){this.update()}componentDidUpdate(e){nX(this.props.data,e.data)||this.update()}update(){const{data:e}=this.props;this.vegaEmbed.current&&e&&Object.keys(e).length>0&&this.vegaEmbed.current.modifyView(n=>{zQt(n,e),n.resize().run()})}render(){const{data:e,...n}=this.props;return he.createElement(LUe,gQ({ref:this.vegaEmbed},n,{onNewView:this.handleNewView}))}}mQ($Ue,"defaultProps",{data:WQt});function vQ(){return vQ=Object.assign||function(t){for(var e=1;egh(t)&&(t.select==="point"||t.select==="interval"||gh(t.select)&&(t.select.type==="point"||t.select.type==="interval")&&JM(t.select.on));function HQt(t,e,n,r){const i=D.useMemo(()=>{const s=[];return!t||!t.params?s:t.params.filter(GQt).reduce((a,l)=>(l.select==="point"?a.push(["click",l.name]):l.select==="interval"?a.push(["drag",l.name]):a.push([l.select.on,l.name]),a),s)},[t]),o=D.useCallback((s,a)=>{if(n)return r({componentType:e,id:n,property:s,value:a})},[n,r,e]);return D.useMemo(()=>{const s={click:o,drag:o},a={};return i.forEach(([l,c])=>{s[l]?a[c]=s[l]:console.warn(`The signal "${l}" is not yet supported in chartlets.js`)}),a},[i,o])}const qQt=t=>!!t&&t in wUe,mxe=()=>window.matchMedia("(prefers-color-scheme: dark)").matches;function XQt(t){const e=pCt();return D.useMemo(()=>!t||t==="default"?e==="dark"||e==="system"&&mxe()?"dark":void 0:t==="system"?mxe()?"dark":void 0:qQt(t)?t:void 0,[t,e])}function YQt({type:t,id:e,style:n,theme:r,chart:i,onChange:o}){const s=HQt(i,t,e,o),a=XQt(r);return i?C.jsx(VQt,{theme:a,spec:i,style:n,signalListeners:s,actions:!1}):C.jsx("div",{id:e,style:n})}function QQt(){return{components:[["VegaChart",YQt]]}}const yQ={selectedDatasetId:{type:"str | None",description:"The identifier of the currently selected dataset.",selector:pO},selectedVariableName:{type:"str | None",description:"The name of the currently selected variable within the selected dataset.",selector:a1},selectedDataset2Id:{type:"str | None",description:"The identifier of the dataset that contains the pinned variable.",selector:IDe},selectedVariable2Name:{type:"str | None",description:"The name of the pinned variable.",selector:sne},selectedPlaceGeometry:{type:"dict[str, Any] | None",description:"The geometry of the currently selected place in GeoJSON format.",selector:oSt},selectedTimeLabel:{type:"str | None",description:"The currently selected UTC time using ISO format.",selector:c1},themeMode:{type:"str",description:'The appearance mode of the UI. Either "light" or "dark".',selector:t=>BMe(t.controlState.themeMode)}};function KQt(t){return{subscribe(e){return t.subscribe(e)},get(e){const n=yQ[e];if(n)return n.selector(t.getState())}}}function ZQt(t){return(e,n)=>{const r=zi(n());ICt({plugins:[tOt(),QQt()],hostStore:KQt(t),logging:{enabled:!1},api:{serverUrl:r.url,endpointName:"viewer/ext"}})}}const FUe="POST_MESSAGE";function _s(t,e){return{type:FUe,messageType:t,messageText:typeof e=="string"?e:e.message}}const NUe="HIDE_MESSAGE";function JQt(t){return{type:NUe,messageId:t}}var eKt={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 vxe=sn(eKt);var yxe={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function tKt(t){var e,n=[],r=1,i;if(typeof t=="string")if(t=t.toLowerCase(),vxe[t])n=vxe[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),s=o.length,a=s<=4;r=1,a?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],s===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)],s===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 s=o==="cmyk"?4:o==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,h){if(/%$/.test(d))return h===s?parseFloat(d)/100:o==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(o[h]==="h"){if(/deg$/.test(d))return parseFloat(d);if(yxe[d]!==void 0)return yxe[d]}return parseFloat(d)}),l===o&&n.push(1),r=c||n[s]===void 0?1:n[s],n=n.slice(0,s)}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 xQ={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},T9={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,s,a,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,a=[0,0,0];c<3;)s=e+1/3*-(c-1),s<0?s++:s>1&&s--,l=6*s<1?i+(o-i)*6*s:2*s<1?o:3*s<2?i+(o-i)*(2/3-s)*6:i,a[c++]=l*255;return a}};xQ.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),s=o-i,a,l,c;return o===i?a=0:e===o?a=(n-r)/s:n===o?a=2+(r-e)/s:r===o&&(a=4+(e-n)/s),a=Math.min(a*60,360),a<0&&(a+=360),c=(i+o)/2,o===i?l=0:c<=.5?l=s/(o+i):l=s/(2-o-i),[a,l*100,c*100]};function nKt(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,n=tKt(t);if(!n.space)return[];const r=n.space[0]==="h"?T9.min:xQ.min,i=n.space[0]==="h"?T9.max:xQ.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=T9.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}function Zae(t,e,n,r="circle"){if(t.getGeometry()instanceof hh)t.setStyle(rKt(7,e,"white",2,r));else{n=typeof n=="number"?n:.25;let i=nKt(e);Array.isArray(i)?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],t.setStyle(oKt(i,e,2))}}function rKt(t,e,n,r,i="circle"){return new Zd({image:iKt(t,e,n,r,i)})}function iKt(t,e,n,r,i){const o=new fb({color:e}),s=new ph({color:n,width:r});switch(i){case"square":return new zq({fill:o,stroke:s,radius:t,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new zq({fill:o,stroke:s,radius:t,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new WM({fill:o,stroke:s,radius:t})}}function oKt(t,e,n){const r=new fb({color:t}),i=new ph({color:e,width:n});return new Zd({fill:r,stroke:i})}function sKt(t,e,n){Hs[t]}function aKt(t,e,n){if(Hs[t]){const i=Hs[t].getSource(),o=i==null?void 0:i.getFeatureById(e);o&&Zae(o,n.color,n.opacity)}}function lKt(t,e,n){if(Hs[t]){const r=Hs[t],i=r.getView().getProjection(),s=(Array.isArray(e)?Oq(e):e).transform(rO,i);s.getType()==="Point"?r.getView().setCenter(s.getFirstCoordinate()):n?r.getView().fit(s,{size:r.getSize()}):r.getView().setCenter(ty(s.getExtent()))}}const zUe="1.4.0",cKt=["userPlaceGroups","timeSeriesGroups","statistics"],uKt=["selectedDatasetId","selectedVariableName","selectedDataset2Id","selectedVariable2Name","selectedTime","selectedTimeRange","selectedUserPlaceId","selectedPlaceId","selectedPlaceGroupIds","sidebarPanelId","layerMenuOpen","sidebarOpen","sidebarPosition","variableSplitPos","variableCompareMode","selectedBaseMapId","selectedOverlayId","userBaseMaps","userOverlays","userColorBars","mapProjection"];function fKt(t){return{version:zUe,creationDate:new Date().toUTCString(),apiUrl:zi(t).url,viewerUrl:nO.origin,state:{dataState:xxe(t.dataState,cKt),controlState:xxe(t.controlState,uKt),mapState:dKt()}}}function xxe(t,e){const n={};return e.forEach(r=>{n[r]=t[r]}),n}function dKt(){if(Hs.map){const e=Hs.map.getView(),n=e.getProjection().getCode(),r=e.getCenter();if(r!==void 0){const i=e.getZoom(),o=e.getRotation();return{view:{projection:n,center:r,zoom:i,rotation:o}}}}}const Jae="APPLY_PERSISTED_STATE";function hKt(t){return e=>{console.debug("Restoring persisted state:",t),e(pKt(t));const{mapState:n}=t.state;n&&gKt(n)}}function pKt(t){return{type:Jae,persistedState:t}}function gKt(t){Hs.map&&(console.log("Restoring map:",t),Hs.map.setView(new jd(t.view)))}const X5="UPDATE_SERVER_INFO";function mKt(){return(t,e)=>{const n=zi(e());t(YR(X5,pe.get("Connecting to server"))),ovt(n.url).then(r=>{t(vKt(r))}).catch(r=>{t(_s("error",r))}).then(()=>{t(QR(X5))})}}function vKt(t){return{type:X5,serverInfo:t}}const bxe="SHARE_STATE_PERMALINK";function jUe(){return(t,e)=>{const n=zi(e());t(YR(bxe,pe.get("Creating permalink"))),fvt(n.url,e().userAuthState.accessToken,fKt(e())).then(r=>{if(r){const i=`${nO.origin}?stateKey=${r}`;navigator.clipboard.writeText(i).then(()=>{t(_s("success",pe.get("Permalink copied to clipboard")))})}else t(_s("error",pe.get("Failed to create permalink")))}).finally(()=>t(QR(bxe)))}}const wxe="UPDATE_RESOURCES";function BUe(){return(t,e)=>{const n=zi(e());t(YR(wxe,pe.get("Updating resources"))),cvt(n.url,e().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>t(QR(wxe)))}}const eP="UPDATE_DATASETS";function UUe(){return(t,e)=>{const n=zi(e());t(YR(eP,pe.get("Loading data"))),evt(n.url,e().userAuthState.accessToken).then(r=>{const i=Igt();if(r=r.map(o=>({...o,variables:[...o.variables,...i[o.id]||[]]})),t(_xe(r)),r.length>0){const o=e().controlState.selectedDatasetId||r[0].id;t(c8e(o,r,!0))}}).catch(r=>{t(_s("error",r)),t(_xe([]))}).then(()=>{t(QR(eP))})}}function _xe(t){return{type:eP,datasets:t}}function yKt(t,e){return(n,r)=>{n(xKt(t,e));const i={};r().dataState.datasets.forEach(o=>{const[s,a]=Fte(o);a.length>=0&&(i[o.id]=a)}),Dgt(i)}}const WUe="UPDATE_DATASET_USER_VARIABLES";function xKt(t,e){return{type:WUe,datasetId:t,userVariables:e}}const ele="UPDATE_DATASET_PLACE_GROUP";function bKt(t,e){return{type:ele,datasetId:t,placeGroup:e}}const tle="ADD_DRAWN_USER_PLACE";function wKt(t,e,n,r,i){return(o,s)=>{o(_Kt(t,e,n,r,i)),s().controlState.autoShowTimeSeries&&s().controlState.selectedPlaceId===e&&o(iU())}}function _Kt(t,e,n,r,i){return{type:tle,placeGroupTitle:t,id:e,properties:n,geometry:r,selected:i}}const nle="ADD_IMPORTED_USER_PLACES";function SKt(t,e,n){return{type:nle,placeGroups:t,mapProjection:e,selected:n}}function VUe(t){return(e,n)=>{const r=D_t(n());let i;try{if(r==="csv"){const o=I_t(n());i=ygt(t,o)}else if(r==="geojson"){const o=L_t(n());i=Sgt(t,o)}else if(r==="wkt"){const o=$_t(n());i=kgt(t,o)}else i=[]}catch(o){e(_s("error",o)),e(T1("addUserPlacesFromText")),i=[]}if(i.length>0){if(e(SKt(i,Uy(n()),!0)),i.length===1&&i[0].features.length===1){const s=i[0].features[0];e(oU(s.id,KM(n()),!0)),n().controlState.autoShowTimeSeries&&e(iU())}let o=0;i.forEach(s=>{o+=s.features?s.features.length:0}),e(_s("info",pe.get(`Imported ${o} place(s) in ${i.length} groups(s), 1 selected`)))}else e(_s("warning",pe.get("No places imported")))}}const rle="RENAME_USER_PLACE_GROUP";function CKt(t,e){return{type:rle,placeGroupId:t,newName:e}}const GUe="RENAME_USER_PLACE";function OKt(t,e,n){return r=>{r(EKt(t,e,n)),sKt(t)}}function EKt(t,e,n){return{type:GUe,placeGroupId:t,placeId:e,newName:n}}const HUe="RESTYLE_USER_PLACE";function TKt(t,e,n){return r=>{r(kKt(t,e,n)),aKt(t,e,n)}}function kKt(t,e,n){return{type:HUe,placeGroupId:t,placeId:e,placeStyle:n}}const ile="REMOVE_USER_PLACE";function AKt(t,e,n){return{type:ile,placeGroupId:t,placeId:e,places:n}}const qUe="REMOVE_USER_PLACE_GROUP";function PKt(t){return{type:qUe,placeGroupId:t}}function XUe(){return(t,e)=>{const n=zi(e()),r=fo(e()),i=za(e()),o=ZM(e()),s=c1(e()),a=e().controlState.sidebarOpen,l=e().controlState.sidebarPanelId;r&&i&&o&&(l!=="stats"&&t(ule("stats")),a||t(cle(!0)),t(Sxe(null)),avt(n.url,r,i,o,s,e().userAuthState.accessToken).then(c=>t(Sxe(c))).catch(c=>{t(_s("error",c))}))}}const YUe="ADD_STATISTICS";function Sxe(t){return{type:YUe,statistics:t}}const QUe="REMOVE_STATISTICS";function MKt(t){return{type:QUe,index:t}}function iU(){return(t,e)=>{const n=zi(e()),r=fo(e()),i=vO(e()),o=za(e()),s=gO(e()),a=fne(e()),l=e().controlState.timeSeriesUpdateMode,c=e().controlState.timeSeriesUseMedian,u=e().controlState.timeSeriesIncludeStdev;let f=uSt(e());const d=e().controlState.sidebarOpen,h=e().controlState.sidebarPanelId,p=RDe(e());if(r&&o&&s&&i){h!=="timeSeries"&&t(ule("timeSeries")),d||t(cle(!0));const g=i.labels,m=g.length;f=f>0?f:m;let v=m-1,y=v-f+1;const x=()=>{const w=y>=0?g[y]:null,_=g[v];return svt(n.url,r,o,a.id,a.geometry,w,_,c,u,e().userAuthState.accessToken)},b=w=>{if(w!==null&&Cxe(p,a.id)){const _=y>0,S=_?(m-y)/m:1;t(RKt({...w,dataProgress:S},l,v===m-1?"new":"append")),_&&Cxe(p,a.id)&&(y-=f,v-=f,x().then(b))}else t(_s("info","No data found here"))};x().then(b).catch(w=>{t(_s("error",w))})}}}function Cxe(t,e){return Rte(t,e)!==null}const KUe="UPDATE_TIME_SERIES";function RKt(t,e,n){return{type:KUe,timeSeries:t,updateMode:e,dataMode:n}}const ZUe="ADD_PLACE_GROUP_TIME_SERIES";function DKt(t,e){return{type:ZUe,timeSeriesGroupId:t,timeSeries:e}}const JUe="REMOVE_TIME_SERIES";function IKt(t,e){return{type:JUe,groupId:t,index:e}}const e8e="REMOVE_TIME_SERIES_GROUP";function LKt(t){return{type:e8e,id:t}}const t8e="REMOVE_ALL_TIME_SERIES";function $Kt(){return{type:t8e}}const ole="CONFIGURE_SERVERS";function FKt(t,e,n){return(r,i)=>{i().controlState.selectedServerId!==e?(r($Kt()),r(Oxe(t,e)),r(sle(n))):i().dataState.userServers!==t&&r(Oxe(t,e))}}function Oxe(t,e){return{type:ole,servers:t,selectedServerId:e}}function sle(t,e=!1){return n=>{n(mKt()),n(UUe()),n(zKt()),n(BKt()),n(ZQt(t));const r=Up.get("stateKey");r&&e&&n(NKt(t,r))}}function NKt(t,e){return(n,r)=>{const i=zi(t.getState()).url;uvt(i,r().userAuthState.accessToken,e).then(o=>{if(typeof o=="object"){const s=o,{apiUrl:a}=s;n(a===i?hKt(s):_s("warning","Failed to restore state, backend mismatch"))}else n(_s("warning",o))})}}const n8e="UPDATE_EXPRESSION_CAPABILITIES";function zKt(){return(t,e)=>{const n=zi(e());ivt(n.url).then(r=>{t(jKt(r))}).catch(r=>{t(_s("error",r))})}}function jKt(t){return{type:n8e,expressionCapabilities:t}}const r8e="UPDATE_COLOR_BARS";function BKt(){return(t,e)=>{const n=zi(e());Qmt(n.url).then(r=>{t(UKt(r))}).catch(r=>{t(_s("error",r))})}}function UKt(t){return{type:r8e,colorBars:t}}const i8e="UPDATE_VARIABLE_COLOR_BAR";function WKt(t,e,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariableName;s&&a&&i(o8e(s,a,t,e,n,r))}}function VKt(t,e,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariable2Name;s&&a&&i(o8e(s,a,t,e,n,r))}}function o8e(t,e,n,r,i,o){if(i==="log"){let[s,a]=r;s<=0&&(s=.001),a<=s&&(a=1),r=[s,a]}return{type:i8e,datasetId:t,variableName:e,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const s8e="UPDATE_VARIABLE_VOLUME";function GKt(t,e,n,r,i){return{type:s8e,datasetId:t,variableName:e,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function HKt(){return(t,e)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:s,exportFileName:a}=e().controlState;let l=[];n?(l=[],qM(e()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...XM(e())]):i&&(l=mO(e())),YKt(e().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:s,fileName:a})}}class a8e{}class qKt extends a8e{constructor(n){super();gn(this,"fileName");gn(this,"zipArchive");this.fileName=n,this.zipArchive=new zSt}write(n,r){this.zipArchive.file(n,r)}close(){this.zipArchive.generateAsync({type:"blob"}).then(n=>bIe.saveAs(n,this.fileName))}}class XKt extends a8e{write(e,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});bIe.saveAs(r,e)}close(){}}function YKt(t,e,n){const{includeTimeSeries:r,includePlaces:i,placesAsCollection:o,zip:s}=n;let{separator:a,fileName:l}=n;if(a=a||"TAB",a.toUpperCase()==="TAB"&&(a=" "),l=l||"export",!r&&!i)return;let c;s?c=new qKt(`${l}.zip`):c=new XKt;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=s_t(t,e),p={number:!0,string:!0},g=f.join(a),m=d.map(y=>y.map(x=>p[typeof x]?x+"":"").join(a)),v=[g].concat(m).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 l8e="SELECT_DATASET";function c8e(t,e,n){return(r,i)=>{r(QKt(t,e));const o=i().controlState.datasetLocateMode;t&&n&&o!=="doNothing"&&r(u8e(t,i().controlState.datasetLocateMode==="panAndZoom"))}}function QKt(t,e){return{type:l8e,selectedDatasetId:t,datasets:e}}function KKt(){return(t,e)=>{const n=pO(e());n&&t(u8e(n,!0))}}function ZKt(){return(t,e)=>{const n=gO(e());n&&t(f8e(n,!0))}}function u8e(t,e){return(n,r)=>{const i=qM(r()),o=hA(i,t);o&&o.bbox&&n(bQ(o.bbox,e))}}const JKt=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function f8e(t,e){return(n,r)=>{const i=mO(r()),o=Rte(i,t);o&&(o.bbox&&o.bbox.length===4?n(bQ(o.bbox,e)):o.geometry&&JKt.includes(o.geometry.type)&&n(bQ(new s1().readGeometry(o.geometry),e)))}}function bQ(t,e){return n=>{if(t!==null){const r="map";n(eZt(r,t)),lKt(r,t,e)}}}const d8e="FLY_TO";function eZt(t,e){return{type:d8e,mapId:t,location:e}}const h8e="SELECT_PLACE_GROUPS";function tZt(t){return(e,n)=>{const r=zi(n());e(nZt(t));const i=fo(n()),o=tIe(n());if(i!==null&&o.length>0){for(const s of o)if(!sO(s)){const a=i.id,l=s.id,c=`${ele}-${a}-${l}`;e(YR(c,pe.get("Loading places"))),rvt(r.url,a,l,n().userAuthState.accessToken).then(u=>{e(bKt(i.id,u))}).catch(u=>{e(_s("error",u))}).finally(()=>{e(QR(c))})}}}}function nZt(t){return{type:h8e,selectedPlaceGroupIds:t}}const p8e="SELECT_PLACE";function oU(t,e,n){return(r,i)=>{r(rZt(t,e));const o=i().controlState.placeLocateMode;n&&t&&o!=="doNothing"&&r(f8e(t,i().controlState.placeLocateMode==="panAndZoom"))}}function rZt(t,e){return{type:p8e,placeId:t,places:e}}const g8e="SET_LAYER_VISIBILITY";function iZt(t,e){return{type:g8e,layerId:t,visible:e}}const m8e="SET_MAP_POINT_INFO_BOX_ENABLED";function oZt(t){return{type:m8e,mapPointInfoBoxEnabled:t}}const v8e="SET_VARIABLE_COMPARE_MODE";function sZt(t){return{type:v8e,variableCompareMode:t}}const ale="SET_VARIABLE_SPLIT_POS";function aZt(t){return{type:ale,variableSplitPos:t}}const y8e="SELECT_VARIABLE";function x8e(t){return{type:y8e,selectedVariableName:t}}const b8e="SELECT_VARIABLE_2";function lZt(t,e){return{type:b8e,selectedDataset2Id:t,selectedVariable2Name:e}}const w8e="SELECT_TIME";function sU(t){return{type:w8e,selectedTime:t}}const _8e="INC_SELECTED_TIME";function cZt(t){return{type:_8e,increment:t}}const lle="SELECT_TIME_RANGE";function S8e(t,e,n){return{type:lle,selectedTimeRange:t,selectedGroupId:e,selectedValueRange:n}}const uZt="SELECT_TIME_SERIES_UPDATE_MODE",C8e="UPDATE_TIME_ANIMATION";function fZt(t,e){return{type:C8e,timeAnimationActive:t,timeAnimationInterval:e}}const O8e="SET_MAP_INTERACTION";function E8e(t){return{type:O8e,mapInteraction:t}}const T8e="SET_LAYER_MENU_OPEN";function k8e(t){return{type:T8e,layerMenuOpen:t}}const A8e="SET_SIDEBAR_POSITION";function dZt(t){return{type:A8e,sidebarPosition:t}}const P8e="SET_SIDEBAR_OPEN";function cle(t){return{type:P8e,sidebarOpen:t}}const M8e="SET_SIDEBAR_PANEL_ID";function ule(t){return{type:M8e,sidebarPanelId:t}}const R8e="SET_VOLUME_RENDER_MODE";function hZt(t){return{type:R8e,volumeRenderMode:t}}const D8e="UPDATE_VOLUME_STATE";function pZt(t,e){return{type:D8e,volumeId:t,volumeState:e}}const I8e="SET_VISIBLE_INFO_CARD_ELEMENTS";function gZt(t){return{type:I8e,visibleElements:t}}const L8e="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function mZt(t,e){return{type:L8e,elementType:t,viewMode:e}}const $8e="ADD_ACTIVITY";function YR(t,e){return{type:$8e,id:t,message:e}}const F8e="REMOVE_ACTIVITY";function QR(t){return{type:F8e,id:t}}const N8e="CHANGE_LOCALE";function z8e(t){return{type:N8e,locale:t}}const j8e="OPEN_DIALOG";function T1(t){return{type:j8e,dialogId:t}}const B8e="CLOSE_DIALOG";function VO(t){return{type:B8e,dialogId:t}}const fle="UPDATE_SETTINGS";function KR(t){return{type:fle,settings:t}}const U8e="STORE_SETTINGS";function W8e(){return{type:U8e}}function V8e(t){return e=>{e(vZt(t)),e(yZt(t))}}const G8e="ADD_USER_COLOR_BAR";function vZt(t){return{type:G8e,colorBarId:t}}const H8e="REMOVE_USER_COLOR_BAR";function q8e(t){return{type:H8e,colorBarId:t}}function X8e(t){return e=>{e(Q8e(t)),e(dle(t))}}const Y8e="UPDATE_USER_COLOR_BAR";function Q8e(t){return{type:Y8e,userColorBar:t}}function yZt(t){return(e,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===t);r&&e(dle(r))}}function dle(t){return e=>{yvt(t).then(({imageData:n,errorMessage:r})=>{e(Q8e({...t,imageData:n,errorMessage:r}))})}}function xZt(){return(t,e)=>{e().controlState.userColorBars.forEach(n=>{n.imageData||t(dle(n))})}}function K8e(t){return{type:fle,settings:{userColorBars:t}}}const GO=lt(C.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"),Exe=["http","https","mailto","tel"];function bZt(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)"}/*! +`,PQt="chart-wrapper";function MQt(t){return typeof t=="function"}function dxe(t,e,n,r){const i=`${e}
`,o=`
${n}`,s=window.open("");s.document.write(i+t+o),s.document.title=`${ST[r]} JSON Source`}function RQt(t,e){if(t.$schema){const n=yUe(t.$schema);e&&e!==n.library&&console.warn(`The given visualization spec is written in ${ST[n.library]}, but mode argument sets ${ST[e]??e}.`);const r=n.library;return PUe(q5[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${ST[r]} ${n.version}, but the current version of ${ST[r]} is v${q5[r]}.`),r}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":e??"vega"}function RUe(t){return!!(t&&"load"in t)}function hxe(t){return RUe(t)?t:cf.loader(t)}function DQt(t){var n;const e=((n=t.usermeta)==null?void 0:n.embedOptions)??{};return gt(e.defaultStyle)&&(e.defaultStyle=!1),e}async function IQt(t,e,n={}){let r,i;gt(e)?(i=hxe(n.loader),r=JSON.parse(await i.load(e))):r=e;const o=DQt(r),s=o.loader;(!i||s)&&(i=hxe(n.loader??s));const a=await pxe(o,i),l=await pxe(n,i),c={...MUe(l,a),config:yO(l.config??{},a.config??{})};return await $Qt(t,r,c,i)}async function pxe(t,e){const n=gt(t.config)?JSON.parse(await e.load(t.config)):t.config??{},r=gt(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return{...t,...r?{patch:r}:{},...n?{config:n}:{}}}function LQt(t){const e=t.getRootNode?t.getRootNode():document;return e instanceof ShadowRoot?{root:e,rootContainer:e}:{root:document,rootContainer:document.head??document.body}}async function $Qt(t,e,n={},r){const i=n.theme?yO(wUe[n.theme],n.config??{}):n.config,o=Vy(n.actions)?n.actions:MUe({},EQt,n.actions??{}),s={...TQt,...n.i18n},a=n.renderer??"canvas",l=n.logLevel??cf.Warn,c=n.downloadFileName??"visualization",u=typeof t=="string"?document.querySelector(t):t;if(!u)throw new Error(`${t} does not exist`);if(n.defaultStyle!==!1){const w="vega-embed-style",{root:_,rootContainer:S}=LQt(u);if(!_.getElementById(w)){const O=document.createElement("style");O.id=w,O.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?CQt.toString():n.defaultStyle,S.appendChild(O)}}const f=RQt(e,n.mode);let d=kQt[f](e,i);if(f==="vega-lite"&&d.$schema){const w=yUe(d.$schema);PUe(q5.vega,`^${w.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${w.version}, but current version is v${q5.vega}.`)}u.classList.add("vega-embed"),o&&u.classList.add("has-actions"),u.innerHTML="";let h=u;if(o){const w=document.createElement("div");w.classList.add(PQt),u.appendChild(w),h=w}const p=n.patch;if(p&&(d=p instanceof Function?p(d):nU(d,p,!0,!1).newDocument),n.formatLocale&&cf.formatLocale(n.formatLocale),n.timeFormatLocale&&cf.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const w in n.expressionFunctions){const _=n.expressionFunctions[w];"fn"in _?cf.expressionFunction(w,_.fn,_.visitor):_ instanceof Function&&cf.expressionFunction(w,_)}const{ast:g}=n,m=cf.parse(d,f==="vega-lite"?{}:i,{ast:g}),v=new(n.viewClass||cf.View)(m,{loader:r,logLevel:l,renderer:a,...g?{expr:cf.expressionInterpreter??n.expr??BUt}:{}});if(v.addSignalListener("autosize",(w,_)=>{const{type:S}=_;S=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):S=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):S=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:w,tooltip:_}=n,S=w&&!RUe(w)?w==null?void 0:w.baseURL:void 0,O=MQt(_)?_:new XYt({baseURL:S,..._===!0?{}:_}).call;v.tooltip(O)}let{hover:y}=n;if(y===void 0&&(y=f==="vega"),y){const{hoverSet:w,updateSet:_}=typeof y=="boolean"?{}:y;v.hover(w,_)}n&&(n.width!=null&&v.width(n.width),n.height!=null&&v.height(n.height),n.padding!=null&&v.padding(n.padding)),await v.initialize(h,n.bind).runAsync();let x;if(o!==!1){let w=u;if(n.defaultStyle!==!1||n.forceActionsMenu){const S=document.createElement("details");S.title=s.CLICK_TO_VIEW_ACTIONS,u.append(S),w=S;const O=document.createElement("summary");O.innerHTML=AQt,S.append(O),x=k=>{S.contains(k.target)||S.removeAttribute("open")},document.addEventListener("click",x)}const _=document.createElement("div");if(w.append(_),_.classList.add("vega-actions"),o===!0||o.export!==!1){for(const S of["svg","png"])if(o===!0||o.export===!0||o.export[S]){const O=s[`${S.toUpperCase()}_ACTION`],k=document.createElement("a"),E=ht(n.scaleFactor)?n.scaleFactor[S]:n.scaleFactor;k.text=O,k.href="#",k.target="_blank",k.download=`${c}.${S}`,k.addEventListener("mousedown",async function(P){P.preventDefault();const A=await v.toImageURL(S,E);this.href=A}),_.append(k)}}if(o===!0||o.source!==!1){const S=document.createElement("a");S.text=s.SOURCE_ACTION,S.href="#",S.addEventListener("click",function(O){dxe(FW(e),n.sourceHeader??"",n.sourceFooter??"",f),O.preventDefault()}),_.append(S)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const S=document.createElement("a");S.text=s.COMPILED_ACTION,S.href="#",S.addEventListener("click",function(O){dxe(FW(d),n.sourceHeader??"",n.sourceFooter??"","vega"),O.preventDefault()}),_.append(S)}if(o===!0||o.editor!==!1){const S=n.editorUrl??"https://vega.github.io/editor/",O=document.createElement("a");O.text=s.EDITOR_ACTION,O.href="#",O.addEventListener("click",function(k){SQt(window,S,{config:i,mode:p?"vega":f,renderer:a,spec:FW(p?d:e)}),k.preventDefault()}),_.append(O)}}function b(){x&&document.removeEventListener("click",x),v.finalize()}return{view:v,spec:e,vgSpec:d,finalize:b,embedOptions:n}}function FQt(t){return!!t&&{}.toString.call(t)==="[object Function]"}function NQt(t,e,n){n&&(FQt(n)?n(t.data(e)):t.change(e,cf.changeset().remove(()=>!0).insert(n)))}function zQt(t,e){Object.keys(e).forEach(n=>{NQt(t,n,e[n])})}function DUe(t){const e=new Set;return t.forEach(n=>{Object.keys(n).forEach(r=>{e.add(r)})}),e}const IUe=()=>{};function O9(t,e){const n=Object.keys(e);return n.forEach(r=>{try{t.addSignalListener(r,e[r])}catch(i){console.warn("Cannot add invalid signal listener.",i)}}),n.length>0}var jQt=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const BQt=sn(jQt);function UQt(t,e){if(t===e)return!1;const n={width:!1,height:!1,isExpensive:!1},r=DUe([t,e]);return r.has("width")&&(!("width"in t)||!("width"in e)||t.width!==e.width)&&("width"in t&&typeof t.width=="number"?n.width=t.width:n.isExpensive=!0),r.has("height")&&(!("height"in t)||!("height"in e)||t.height!==e.height)&&("height"in t&&typeof t.height=="number"?n.height=t.height:n.isExpensive=!0),r.delete("width"),r.delete("height"),[...r].some(i=>!(i in t)||!(i in e)||!BQt(t[i],e[i]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function gxe(t,e){const n=Object.keys(e);return n.forEach(r=>{try{t.removeSignalListener(r,e[r])}catch(i){console.warn("Cannot remove invalid signal listener.",i)}}),n.length>0}function E9(t){const{spec:e,width:n,height:r}=t;return typeof n<"u"&&typeof r<"u"?{...e,width:n,height:r}:typeof n<"u"?{...e,width:n}:typeof r<"u"?{...e,height:r}:e}function CT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class LUe extends he.PureComponent{constructor(){super(...arguments),CT(this,"containerRef",he.createRef()),CT(this,"resultPromise",void 0),CT(this,"handleError",e=>{const{onError:n=IUe}=this.props;n(e,this.containerRef.current),console.warn(e)}),CT(this,"modifyView",e=>{this.resultPromise&&this.resultPromise.then(n=>(n&&e(n.view),!0)).catch(this.handleError)})}componentDidMount(){this.createView()}componentDidUpdate(e){const n=DUe([this.props,e]);if(n.delete("className"),n.delete("signalListeners"),n.delete("spec"),n.delete("style"),n.delete("width"),n.delete("height"),Array.from(n).some(r=>this.props[r]!==e[r]))this.clearView(),this.createView();else{const r=UQt(E9(this.props),E9(e)),{signalListeners:i}=this.props,{signalListeners:o}=e;if(r)if(r.isExpensive)this.clearView(),this.createView();else{const s=!nX(i,o);this.modifyView(a=>{r.width!==!1&&a.width(r.width),r.height!==!1&&a.height(r.height),s&&(o&&gxe(a,o),i&&O9(a,i)),a.run()})}else nX(i,o)||this.modifyView(s=>{o&&gxe(s,o),i&&O9(s,i),s.run()})}}componentWillUnmount(){this.clearView()}createView(){const{spec:e,onNewView:n,signalListeners:r={},width:i,height:o,...s}=this.props;if(this.containerRef.current){const a=E9(this.props);this.resultPromise=IQt(this.containerRef.current,a,s).then(l=>{if(l){const{view:c}=l;O9(c,r)&&c.run()}return l}).catch(this.handleError),n&&this.modifyView(n)}}clearView(){return this.resultPromise&&this.resultPromise.then(e=>{e&&e.finalize()}).catch(this.handleError),this.resultPromise=void 0,this}render(){const{className:e,style:n}=this.props;return he.createElement("div",{ref:this.containerRef,className:e,style:n})}}CT(LUe,"propTypes",{className:ge.string,onError:ge.func});function gQ(){return gQ=Object.assign||function(t){for(var e=1;e{this.update();const{onNewView:n=IUe}=this.props;n(e)})}componentDidMount(){this.update()}componentDidUpdate(e){nX(this.props.data,e.data)||this.update()}update(){const{data:e}=this.props;this.vegaEmbed.current&&e&&Object.keys(e).length>0&&this.vegaEmbed.current.modifyView(n=>{zQt(n,e),n.resize().run()})}render(){const{data:e,...n}=this.props;return he.createElement(LUe,gQ({ref:this.vegaEmbed},n,{onNewView:this.handleNewView}))}}mQ($Ue,"defaultProps",{data:WQt});function vQ(){return vQ=Object.assign||function(t){for(var e=1;egh(t)&&(t.select==="point"||t.select==="interval"||gh(t.select)&&(t.select.type==="point"||t.select.type==="interval")&&JM(t.select.on));function HQt(t,e,n,r){const i=D.useMemo(()=>{const s=[];return!t||!t.params?s:t.params.filter(GQt).reduce((a,l)=>(l.select==="point"?a.push(["click",l.name]):l.select==="interval"?a.push(["drag",l.name]):a.push([l.select.on,l.name]),a),s)},[t]),o=D.useCallback((s,a)=>{if(n)return r({componentType:e,id:n,property:s,value:a})},[n,r,e]);return D.useMemo(()=>{const s={click:o,drag:o},a={};return i.forEach(([l,c])=>{s[l]?a[c]=s[l]:console.warn(`The signal "${l}" is not yet supported in chartlets.js`)}),a},[i,o])}const qQt=t=>!!t&&t in wUe,mxe=()=>window.matchMedia("(prefers-color-scheme: dark)").matches;function XQt(t){const e=pCt();return D.useMemo(()=>!t||t==="default"?e==="dark"||e==="system"&&mxe()?"dark":void 0:t==="system"?mxe()?"dark":void 0:qQt(t)?t:void 0,[t,e])}function YQt({type:t,id:e,style:n,theme:r,chart:i,onChange:o}){const s=HQt(i,t,e,o),a=XQt(r);return i?C.jsx(VQt,{theme:a,spec:i,style:n,signalListeners:s,actions:!1}):C.jsx("div",{id:e,style:n})}function QQt(){return{components:[["VegaChart",YQt]]}}const yQ={selectedDatasetId:{type:"str | None",description:"The identifier of the currently selected dataset.",selector:hO},selectedVariableName:{type:"str | None",description:"The name of the currently selected variable within the selected dataset.",selector:a1},selectedDataset2Id:{type:"str | None",description:"The identifier of the dataset that contains the pinned variable.",selector:IDe},selectedVariable2Name:{type:"str | None",description:"The name of the pinned variable.",selector:sne},selectedPlaceGeometry:{type:"dict[str, Any] | None",description:"The geometry of the currently selected place in GeoJSON format.",selector:oSt},selectedTimeLabel:{type:"str | None",description:"The currently selected UTC time using ISO format.",selector:c1},themeMode:{type:"str",description:'The appearance mode of the UI. Either "light" or "dark".',selector:t=>BMe(t.controlState.themeMode)}};function KQt(t){return{subscribe(e){return t.subscribe(e)},get(e){const n=yQ[e];if(n)return n.selector(t.getState())}}}function ZQt(t){return(e,n)=>{const r=zi(n());ICt({plugins:[tOt(),QQt()],hostStore:KQt(t),logging:{enabled:!1},api:{serverUrl:r.url,endpointName:"viewer/ext"}})}}const FUe="POST_MESSAGE";function _s(t,e){return{type:FUe,messageType:t,messageText:typeof e=="string"?e:e.message}}const NUe="HIDE_MESSAGE";function JQt(t){return{type:NUe,messageId:t}}var eKt={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 vxe=sn(eKt);var yxe={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function tKt(t){var e,n=[],r=1,i;if(typeof t=="string")if(t=t.toLowerCase(),vxe[t])n=vxe[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),s=o.length,a=s<=4;r=1,a?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],s===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)],s===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 s=o==="cmyk"?4:o==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,h){if(/%$/.test(d))return h===s?parseFloat(d)/100:o==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(o[h]==="h"){if(/deg$/.test(d))return parseFloat(d);if(yxe[d]!==void 0)return yxe[d]}return parseFloat(d)}),l===o&&n.push(1),r=c||n[s]===void 0?1:n[s],n=n.slice(0,s)}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 xQ={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},T9={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,s,a,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,a=[0,0,0];c<3;)s=e+1/3*-(c-1),s<0?s++:s>1&&s--,l=6*s<1?i+(o-i)*6*s:2*s<1?o:3*s<2?i+(o-i)*(2/3-s)*6:i,a[c++]=l*255;return a}};xQ.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),s=o-i,a,l,c;return o===i?a=0:e===o?a=(n-r)/s:n===o?a=2+(r-e)/s:r===o&&(a=4+(e-n)/s),a=Math.min(a*60,360),a<0&&(a+=360),c=(i+o)/2,o===i?l=0:c<=.5?l=s/(o+i):l=s/(2-o-i),[a,l*100,c*100]};function nKt(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,n=tKt(t);if(!n.space)return[];const r=n.space[0]==="h"?T9.min:xQ.min,i=n.space[0]==="h"?T9.max:xQ.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=T9.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}function Zae(t,e,n,r="circle"){if(t.getGeometry()instanceof hh)t.setStyle(rKt(7,e,"white",2,r));else{n=typeof n=="number"?n:.25;let i=nKt(e);Array.isArray(i)?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],t.setStyle(oKt(i,e,2))}}function rKt(t,e,n,r,i="circle"){return new Zd({image:iKt(t,e,n,r,i)})}function iKt(t,e,n,r,i){const o=new fb({color:e}),s=new ph({color:n,width:r});switch(i){case"square":return new zq({fill:o,stroke:s,radius:t,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new zq({fill:o,stroke:s,radius:t,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new WM({fill:o,stroke:s,radius:t})}}function oKt(t,e,n){const r=new fb({color:t}),i=new ph({color:e,width:n});return new Zd({fill:r,stroke:i})}function sKt(t,e,n){Hs[t]}function aKt(t,e,n){if(Hs[t]){const i=Hs[t].getSource(),o=i==null?void 0:i.getFeatureById(e);o&&Zae(o,n.color,n.opacity)}}function lKt(t,e,n){if(Hs[t]){const r=Hs[t],i=r.getView().getProjection(),s=(Array.isArray(e)?Oq(e):e).transform(nO,i);s.getType()==="Point"?r.getView().setCenter(s.getFirstCoordinate()):n?r.getView().fit(s,{size:r.getSize()}):r.getView().setCenter(ty(s.getExtent()))}}const zUe="1.4.1",cKt=["userPlaceGroups","timeSeriesGroups","statistics"],uKt=["selectedDatasetId","selectedVariableName","selectedDataset2Id","selectedVariable2Name","selectedTime","selectedTimeRange","selectedUserPlaceId","selectedPlaceId","selectedPlaceGroupIds","sidebarPanelId","layerMenuOpen","sidebarOpen","sidebarPosition","variableSplitPos","variableCompareMode","selectedBaseMapId","selectedOverlayId","userBaseMaps","userOverlays","userColorBars","mapProjection"];function fKt(t){return{version:zUe,creationDate:new Date().toUTCString(),apiUrl:zi(t).url,viewerUrl:RM.origin,state:{dataState:xxe(t.dataState,cKt),controlState:xxe(t.controlState,uKt),mapState:dKt()}}}function xxe(t,e){const n={};return e.forEach(r=>{n[r]=t[r]}),n}function dKt(){if(Hs.map){const e=Hs.map.getView(),n=e.getProjection().getCode(),r=e.getCenter();if(r!==void 0){const i=e.getZoom(),o=e.getRotation();return{view:{projection:n,center:r,zoom:i,rotation:o}}}}}const Jae="APPLY_PERSISTED_STATE";function hKt(t){return e=>{console.debug("Restoring persisted state:",t),e(pKt(t));const{mapState:n}=t.state;n&&gKt(n)}}function pKt(t){return{type:Jae,persistedState:t}}function gKt(t){Hs.map&&(console.log("Restoring map:",t),Hs.map.setView(new jd(t.view)))}const X5="UPDATE_SERVER_INFO";function mKt(){return(t,e)=>{const n=zi(e());t(YR(X5,pe.get("Connecting to server"))),ovt(n.url).then(r=>{t(vKt(r))}).catch(r=>{t(_s("error",r))}).then(()=>{t(QR(X5))})}}function vKt(t){return{type:X5,serverInfo:t}}const bxe="SHARE_STATE_PERMALINK";function jUe(){return(t,e)=>{const n=zi(e());t(YR(bxe,pe.get("Creating permalink"))),fvt(n.url,e().userAuthState.accessToken,fKt(e())).then(r=>{if(r){const i=window.location,s=`${i.origin+i.pathname}?stateKey=${r}`;navigator.clipboard.writeText(s).then(()=>{t(_s("success",pe.get("Permalink copied to clipboard")))})}else t(_s("error",pe.get("Failed to create permalink")))}).finally(()=>t(QR(bxe)))}}const wxe="UPDATE_RESOURCES";function BUe(){return(t,e)=>{const n=zi(e());t(YR(wxe,pe.get("Updating resources"))),cvt(n.url,e().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>t(QR(wxe)))}}const JA="UPDATE_DATASETS";function UUe(){return(t,e)=>{const n=zi(e());t(YR(JA,pe.get("Loading data"))),evt(n.url,e().userAuthState.accessToken).then(r=>{const i=Igt();if(r=r.map(o=>({...o,variables:[...o.variables,...i[o.id]||[]]})),t(_xe(r)),r.length>0){const o=e().controlState.selectedDatasetId||r[0].id;t(c8e(o,r,!0))}}).catch(r=>{t(_s("error",r)),t(_xe([]))}).then(()=>{t(QR(JA))})}}function _xe(t){return{type:JA,datasets:t}}function yKt(t,e){return(n,r)=>{n(xKt(t,e));const i={};r().dataState.datasets.forEach(o=>{const[s,a]=Fte(o);a.length>=0&&(i[o.id]=a)}),Dgt(i)}}const WUe="UPDATE_DATASET_USER_VARIABLES";function xKt(t,e){return{type:WUe,datasetId:t,userVariables:e}}const ele="UPDATE_DATASET_PLACE_GROUP";function bKt(t,e){return{type:ele,datasetId:t,placeGroup:e}}const tle="ADD_DRAWN_USER_PLACE";function wKt(t,e,n,r,i){return(o,s)=>{o(_Kt(t,e,n,r,i)),s().controlState.autoShowTimeSeries&&s().controlState.selectedPlaceId===e&&o(iU())}}function _Kt(t,e,n,r,i){return{type:tle,placeGroupTitle:t,id:e,properties:n,geometry:r,selected:i}}const nle="ADD_IMPORTED_USER_PLACES";function SKt(t,e,n){return{type:nle,placeGroups:t,mapProjection:e,selected:n}}function VUe(t){return(e,n)=>{const r=D_t(n());let i;try{if(r==="csv"){const o=I_t(n());i=ygt(t,o)}else if(r==="geojson"){const o=L_t(n());i=Sgt(t,o)}else if(r==="wkt"){const o=$_t(n());i=kgt(t,o)}else i=[]}catch(o){e(_s("error",o)),e(T1("addUserPlacesFromText")),i=[]}if(i.length>0){if(e(SKt(i,Uy(n()),!0)),i.length===1&&i[0].features.length===1){const s=i[0].features[0];e(oU(s.id,KM(n()),!0)),n().controlState.autoShowTimeSeries&&e(iU())}let o=0;i.forEach(s=>{o+=s.features?s.features.length:0}),e(_s("info",pe.get(`Imported ${o} place(s) in ${i.length} groups(s), 1 selected`)))}else e(_s("warning",pe.get("No places imported")))}}const rle="RENAME_USER_PLACE_GROUP";function CKt(t,e){return{type:rle,placeGroupId:t,newName:e}}const GUe="RENAME_USER_PLACE";function OKt(t,e,n){return r=>{r(EKt(t,e,n)),sKt(t)}}function EKt(t,e,n){return{type:GUe,placeGroupId:t,placeId:e,newName:n}}const HUe="RESTYLE_USER_PLACE";function TKt(t,e,n){return r=>{r(kKt(t,e,n)),aKt(t,e,n)}}function kKt(t,e,n){return{type:HUe,placeGroupId:t,placeId:e,placeStyle:n}}const ile="REMOVE_USER_PLACE";function AKt(t,e,n){return{type:ile,placeGroupId:t,placeId:e,places:n}}const qUe="REMOVE_USER_PLACE_GROUP";function PKt(t){return{type:qUe,placeGroupId:t}}function XUe(){return(t,e)=>{const n=zi(e()),r=fo(e()),i=za(e()),o=ZM(e()),s=c1(e()),a=e().controlState.sidebarOpen,l=e().controlState.sidebarPanelId;r&&i&&o&&(l!=="stats"&&t(ule("stats")),a||t(cle(!0)),t(Sxe(null)),avt(n.url,r,i,o,s,e().userAuthState.accessToken).then(c=>t(Sxe(c))).catch(c=>{t(_s("error",c))}))}}const YUe="ADD_STATISTICS";function Sxe(t){return{type:YUe,statistics:t}}const QUe="REMOVE_STATISTICS";function MKt(t){return{type:QUe,index:t}}function iU(){return(t,e)=>{const n=zi(e()),r=fo(e()),i=mO(e()),o=za(e()),s=pO(e()),a=fne(e()),l=e().controlState.timeSeriesUpdateMode,c=e().controlState.timeSeriesUseMedian,u=e().controlState.timeSeriesIncludeStdev;let f=uSt(e());const d=e().controlState.sidebarOpen,h=e().controlState.sidebarPanelId,p=RDe(e());if(r&&o&&s&&i){h!=="timeSeries"&&t(ule("timeSeries")),d||t(cle(!0));const g=i.labels,m=g.length;f=f>0?f:m;let v=m-1,y=v-f+1;const x=()=>{const w=y>=0?g[y]:null,_=g[v];return svt(n.url,r,o,a.id,a.geometry,w,_,c,u,e().userAuthState.accessToken)},b=w=>{if(w!==null&&Cxe(p,a.id)){const _=y>0,S=_?(m-y)/m:1;t(RKt({...w,dataProgress:S},l,v===m-1?"new":"append")),_&&Cxe(p,a.id)&&(y-=f,v-=f,x().then(b))}else t(_s("info","No data found here"))};x().then(b).catch(w=>{t(_s("error",w))})}}}function Cxe(t,e){return Rte(t,e)!==null}const KUe="UPDATE_TIME_SERIES";function RKt(t,e,n){return{type:KUe,timeSeries:t,updateMode:e,dataMode:n}}const ZUe="ADD_PLACE_GROUP_TIME_SERIES";function DKt(t,e){return{type:ZUe,timeSeriesGroupId:t,timeSeries:e}}const JUe="REMOVE_TIME_SERIES";function IKt(t,e){return{type:JUe,groupId:t,index:e}}const e8e="REMOVE_TIME_SERIES_GROUP";function LKt(t){return{type:e8e,id:t}}const t8e="REMOVE_ALL_TIME_SERIES";function $Kt(){return{type:t8e}}const ole="CONFIGURE_SERVERS";function FKt(t,e,n){return(r,i)=>{i().controlState.selectedServerId!==e?(r($Kt()),r(Oxe(t,e)),r(sle(n))):i().dataState.userServers!==t&&r(Oxe(t,e))}}function Oxe(t,e){return{type:ole,servers:t,selectedServerId:e}}function sle(t,e=!1){return n=>{n(mKt()),n(UUe()),n(zKt()),n(BKt()),n(ZQt(t));const r=Up.get("stateKey");r&&e&&n(NKt(t,r))}}function NKt(t,e){return(n,r)=>{const i=zi(t.getState()).url;uvt(i,r().userAuthState.accessToken,e).then(o=>{if(typeof o=="object"){const s=o,{apiUrl:a}=s;n(a===i?hKt(s):_s("warning","Failed to restore state, backend mismatch"))}else n(_s("warning",o))})}}const n8e="UPDATE_EXPRESSION_CAPABILITIES";function zKt(){return(t,e)=>{const n=zi(e());ivt(n.url).then(r=>{t(jKt(r))}).catch(r=>{t(_s("error",r))})}}function jKt(t){return{type:n8e,expressionCapabilities:t}}const r8e="UPDATE_COLOR_BARS";function BKt(){return(t,e)=>{const n=zi(e());Qmt(n.url).then(r=>{t(UKt(r))}).catch(r=>{t(_s("error",r))})}}function UKt(t){return{type:r8e,colorBars:t}}const i8e="UPDATE_VARIABLE_COLOR_BAR";function WKt(t,e,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariableName;s&&a&&i(o8e(s,a,t,e,n,r))}}function VKt(t,e,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariable2Name;s&&a&&i(o8e(s,a,t,e,n,r))}}function o8e(t,e,n,r,i,o){if(i==="log"){let[s,a]=r;s<=0&&(s=.001),a<=s&&(a=1),r=[s,a]}return{type:i8e,datasetId:t,variableName:e,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const s8e="UPDATE_VARIABLE_VOLUME";function GKt(t,e,n,r,i){return{type:s8e,datasetId:t,variableName:e,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function HKt(){return(t,e)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:s,exportFileName:a}=e().controlState;let l=[];n?(l=[],qM(e()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...XM(e())]):i&&(l=gO(e())),YKt(e().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:s,fileName:a})}}class a8e{}class qKt extends a8e{constructor(n){super();gn(this,"fileName");gn(this,"zipArchive");this.fileName=n,this.zipArchive=new zSt}write(n,r){this.zipArchive.file(n,r)}close(){this.zipArchive.generateAsync({type:"blob"}).then(n=>bIe.saveAs(n,this.fileName))}}class XKt extends a8e{write(e,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});bIe.saveAs(r,e)}close(){}}function YKt(t,e,n){const{includeTimeSeries:r,includePlaces:i,placesAsCollection:o,zip:s}=n;let{separator:a,fileName:l}=n;if(a=a||"TAB",a.toUpperCase()==="TAB"&&(a=" "),l=l||"export",!r&&!i)return;let c;s?c=new qKt(`${l}.zip`):c=new XKt;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=s_t(t,e),p={number:!0,string:!0},g=f.join(a),m=d.map(y=>y.map(x=>p[typeof x]?x+"":"").join(a)),v=[g].concat(m).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 l8e="SELECT_DATASET";function c8e(t,e,n){return(r,i)=>{r(QKt(t,e));const o=i().controlState.datasetLocateMode;t&&n&&o!=="doNothing"&&r(u8e(t,i().controlState.datasetLocateMode==="panAndZoom"))}}function QKt(t,e){return{type:l8e,selectedDatasetId:t,datasets:e}}function KKt(){return(t,e)=>{const n=hO(e());n&&t(u8e(n,!0))}}function ZKt(){return(t,e)=>{const n=pO(e());n&&t(f8e(n,!0))}}function u8e(t,e){return(n,r)=>{const i=qM(r()),o=dA(i,t);o&&o.bbox&&n(bQ(o.bbox,e))}}const JKt=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function f8e(t,e){return(n,r)=>{const i=gO(r()),o=Rte(i,t);o&&(o.bbox&&o.bbox.length===4?n(bQ(o.bbox,e)):o.geometry&&JKt.includes(o.geometry.type)&&n(bQ(new s1().readGeometry(o.geometry),e)))}}function bQ(t,e){return n=>{if(t!==null){const r="map";n(eZt(r,t)),lKt(r,t,e)}}}const d8e="FLY_TO";function eZt(t,e){return{type:d8e,mapId:t,location:e}}const h8e="SELECT_PLACE_GROUPS";function tZt(t){return(e,n)=>{const r=zi(n());e(nZt(t));const i=fo(n()),o=tIe(n());if(i!==null&&o.length>0){for(const s of o)if(!oO(s)){const a=i.id,l=s.id,c=`${ele}-${a}-${l}`;e(YR(c,pe.get("Loading places"))),rvt(r.url,a,l,n().userAuthState.accessToken).then(u=>{e(bKt(i.id,u))}).catch(u=>{e(_s("error",u))}).finally(()=>{e(QR(c))})}}}}function nZt(t){return{type:h8e,selectedPlaceGroupIds:t}}const p8e="SELECT_PLACE";function oU(t,e,n){return(r,i)=>{r(rZt(t,e));const o=i().controlState.placeLocateMode;n&&t&&o!=="doNothing"&&r(f8e(t,i().controlState.placeLocateMode==="panAndZoom"))}}function rZt(t,e){return{type:p8e,placeId:t,places:e}}const g8e="SET_LAYER_VISIBILITY";function iZt(t,e){return{type:g8e,layerId:t,visible:e}}const m8e="SET_MAP_POINT_INFO_BOX_ENABLED";function oZt(t){return{type:m8e,mapPointInfoBoxEnabled:t}}const v8e="SET_VARIABLE_COMPARE_MODE";function sZt(t){return{type:v8e,variableCompareMode:t}}const ale="SET_VARIABLE_SPLIT_POS";function aZt(t){return{type:ale,variableSplitPos:t}}const y8e="SELECT_VARIABLE";function x8e(t){return{type:y8e,selectedVariableName:t}}const b8e="SELECT_VARIABLE_2";function lZt(t,e){return{type:b8e,selectedDataset2Id:t,selectedVariable2Name:e}}const w8e="SELECT_TIME";function sU(t){return{type:w8e,selectedTime:t}}const _8e="INC_SELECTED_TIME";function cZt(t){return{type:_8e,increment:t}}const lle="SELECT_TIME_RANGE";function S8e(t,e,n){return{type:lle,selectedTimeRange:t,selectedGroupId:e,selectedValueRange:n}}const uZt="SELECT_TIME_SERIES_UPDATE_MODE",C8e="UPDATE_TIME_ANIMATION";function fZt(t,e){return{type:C8e,timeAnimationActive:t,timeAnimationInterval:e}}const O8e="SET_MAP_INTERACTION";function E8e(t){return{type:O8e,mapInteraction:t}}const T8e="SET_LAYER_MENU_OPEN";function k8e(t){return{type:T8e,layerMenuOpen:t}}const A8e="SET_SIDEBAR_POSITION";function dZt(t){return{type:A8e,sidebarPosition:t}}const P8e="SET_SIDEBAR_OPEN";function cle(t){return{type:P8e,sidebarOpen:t}}const M8e="SET_SIDEBAR_PANEL_ID";function ule(t){return{type:M8e,sidebarPanelId:t}}const R8e="SET_VOLUME_RENDER_MODE";function hZt(t){return{type:R8e,volumeRenderMode:t}}const D8e="UPDATE_VOLUME_STATE";function pZt(t,e){return{type:D8e,volumeId:t,volumeState:e}}const I8e="SET_VISIBLE_INFO_CARD_ELEMENTS";function gZt(t){return{type:I8e,visibleElements:t}}const L8e="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function mZt(t,e){return{type:L8e,elementType:t,viewMode:e}}const $8e="ADD_ACTIVITY";function YR(t,e){return{type:$8e,id:t,message:e}}const F8e="REMOVE_ACTIVITY";function QR(t){return{type:F8e,id:t}}const N8e="CHANGE_LOCALE";function z8e(t){return{type:N8e,locale:t}}const j8e="OPEN_DIALOG";function T1(t){return{type:j8e,dialogId:t}}const B8e="CLOSE_DIALOG";function WO(t){return{type:B8e,dialogId:t}}const fle="UPDATE_SETTINGS";function KR(t){return{type:fle,settings:t}}const U8e="STORE_SETTINGS";function W8e(){return{type:U8e}}function V8e(t){return e=>{e(vZt(t)),e(yZt(t))}}const G8e="ADD_USER_COLOR_BAR";function vZt(t){return{type:G8e,colorBarId:t}}const H8e="REMOVE_USER_COLOR_BAR";function q8e(t){return{type:H8e,colorBarId:t}}function X8e(t){return e=>{e(Q8e(t)),e(dle(t))}}const Y8e="UPDATE_USER_COLOR_BAR";function Q8e(t){return{type:Y8e,userColorBar:t}}function yZt(t){return(e,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===t);r&&e(dle(r))}}function dle(t){return e=>{yvt(t).then(({imageData:n,errorMessage:r})=>{e(Q8e({...t,imageData:n,errorMessage:r}))})}}function xZt(){return(t,e)=>{e().controlState.userColorBars.forEach(n=>{n.imageData||t(dle(n))})}}function K8e(t){return{type:fle,settings:{userColorBars:t}}}const VO=lt(C.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"),Exe=["http","https","mailto","tel"];function bZt(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 wZt=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)};const Z8e=sn(wZt);function xk(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Txe(t.position):"start"in t||"end"in t?Txe(t):"line"in t||"column"in t?wQ(t):""}function wQ(t){return kxe(t&&t.line)+":"+kxe(t&&t.column)}function Txe(t){return wQ(t&&t.start)+"-"+wQ(t&&t.end)}function kxe(t){return t&&typeof t=="number"?t:1}class Bu 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 s=r.indexOf(":");s===-1?i[1]=r:(i[0]=r.slice(0,s),i[1]=r.slice(s+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=xk(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}}Bu.prototype.file="";Bu.prototype.name="";Bu.prototype.reason="";Bu.prototype.message="";Bu.prototype.stack="";Bu.prototype.fatal=null;Bu.prototype.column=null;Bu.prototype.line=null;Bu.prototype.source=null;Bu.prototype.ruleId=null;Bu.prototype.position=null;const kd={basename:_Zt,dirname:SZt,extname:CZt,join:OZt,sep:"/"};function _Zt(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ZR(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 s=-1,a=e.length-1;for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.charCodeAt(i)===e.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function SZt(t){if(ZR(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 CZt(t){ZR(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.charCodeAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===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 OZt(...t){let e=-1,n;for(;++e0&&t.charCodeAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function TZt(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s2){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=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function ZR(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const kZt={cwd:AZt};function AZt(){return"/"}function _Q(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function PZt(t){if(typeof t=="string")t=new URL(t);else if(!_Q(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 MZt(t)}function MZt(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"||F3.call(e,i)},Lxe=function(e,n){Mxe&&n.name==="__proto__"?Mxe(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},$xe=function(e,n){if(n==="__proto__")if(F3.call(e,n)){if(Rxe)return Rxe(e,n).value}else return;return e[n]},DZt=function t(){var e,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});ls.length;let l;a&&s.push(i);try{l=t.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,e(s,...a))}function o(s){i(null,s)}}const $Zt=nWe().freeze(),tWe={}.hasOwnProperty;function nWe(){const t=IZt(),e=[];let n={},r,i=-1;return o.data=s,o.Parser=void 0,o.Compiler=void 0,o.freeze=a,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 g=nWe();let m=-1;for(;++m{if(_||!S||!O)w(_);else{const k=o.stringify(S,O);k==null||(zZt(k)?O.value=k:O.result=k),w(_,O)}});function w(_,S){_||!S?x(_):y?y(S):m(null,S)}}}function p(g){let m;o.freeze(),M9("processSync",o.Parser),R9("processSync",o.Compiler);const v=m2(g);return o.process(v,y),jxe("processSync","process",m),v;function y(x){m=!0,Pxe(x)}}}function Nxe(t,e){return typeof t=="function"&&t.prototype&&(FZt(t.prototype)||e in t.prototype)}function FZt(t){let e;for(e in t)if(tWe.call(t,e))return!0;return!1}function M9(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function R9(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function D9(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 zxe(t){if(!SQ(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function jxe(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function m2(t){return NZt(t)?t:new J8e(t)}function NZt(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function zZt(t){return typeof t=="string"||Z8e(t)}const jZt={};function BZt(t,e){const n=jZt,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rWe(t,r,i)}function rWe(t,e,n){if(UZt(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 Bxe(t.children,e,n)}return Array.isArray(t)?Bxe(t,e,n):""}function Bxe(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)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o0?(Fh(t,t.length,0,e),t):e}const Uxe={}.hasOwnProperty;function WZt(t){const e={};let n=-1;for(;++ns))return;const S=e.events.length;let O=S,k,E;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(k){E=e.events[O][1].end;break}k=!0}for(v(r),_=S;_x;){const w=n[b];e.containerState=w[1],w[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 nJt(t,e,n){return Wr(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vxe(t){if(t===null||ml(t)||KZt(t))return 1;if(QZt(t))return 2}function hle(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);Gxe(f,-l),Gxe(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},t[r][1].end)},a={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({},s.start),end:Object.assign({},a.end)},t[r][1].end=Object.assign({},s.start),t[n][1].start=Object.assign({},a.end),c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=Xc(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=Xc(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),c=Xc(c,hle(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=Xc(c,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=Xc(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Fh(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&sr(_)?Wr(t,y,"linePrefix",o+1)(_):y(_)}function y(_){return _===null||Qt(_)?t.check(qxe,g,b)(_):(t.enter("codeFlowValue"),x(_))}function x(_){return _===null||Qt(_)?(t.exit("codeFlowValue"),y(_)):(t.consume(_),x)}function b(_){return t.exit("codeFenced"),e(_)}function w(_,S,O){let k=0;return E;function E(M){return _.enter("lineEnding"),_.consume(M),_.exit("lineEnding"),P}function P(M){return _.enter("codeFencedFence"),sr(M)?Wr(_,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):A(M)}function A(M){return M===a?(_.enter("codeFencedFenceSequence"),R(M)):O(M)}function R(M){return M===a?(k++,_.consume(M),R):k>=s?(_.exit("codeFencedFenceSequence"),sr(M)?Wr(_,T,"whitespace")(M):T(M)):O(M)}function T(M){return M===null||Qt(M)?(_.exit("codeFencedFence"),S(M)):O(M)}}}function pJt(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const I9={name:"codeIndented",tokenize:mJt},gJt={tokenize:vJt,partial:!0};function mJt(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Wr(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?s(c):n(c)}function s(c){return c===null?l(c):Qt(c)?t.attempt(gJt,s,l)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||Qt(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),a)}function l(c){return t.exit("codeIndented"),e(c)}}function vJt(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Qt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Wr(t,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):Qt(s)?i(s):n(s)}}const yJt={name:"codeText",tokenize:wJt,resolve:xJt,previous:bJt};function xJt(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(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function lWe(t,e,n,r,i,o,s,a,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||CQ(v)?n(v):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),g(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(a),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(t.exit("chunkString"),t.exit(a),d(v)):v===null||v===60||Qt(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 g(v){return!u&&(v===null||v===41||ml(v))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(v)):u999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(t.exit(o),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):Qt(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||Qt(h)||a++>999?(t.exit("chunkString"),u(h)):(t.consume(h),l||(l=!sr(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),a++,f):f(h)}}function uWe(t,e,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),c(d))}function c(d){return d===s?(t.exit(o),l(s)):d===null?n(d):Qt(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Wr(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||Qt(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?f:u)}function f(d){return d===s||d===92?(t.consume(d),u):u(d)}}function bk(t,e){let n;return r;function r(i){return Qt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):sr(i)?Wr(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}function Y_(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kJt={name:"definition",tokenize:PJt},AJt={tokenize:MJt,partial:!0};function PJt(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),s(h)}function s(h){return cWe.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Y_(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 ml(h)?bk(t,c)(h):c(h)}function c(h){return lWe(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(AJt,f,f)(h)}function f(h){return sr(h)?Wr(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Qt(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function MJt(t,e,n){return r;function r(a){return ml(a)?bk(t,i)(a):n(a)}function i(a){return uWe(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return sr(a)?Wr(t,s,"whitespace")(a):s(a)}function s(a){return a===null||Qt(a)?e(a):n(a)}}const RJt={name:"hardBreakEscape",tokenize:DJt};function DJt(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return Qt(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const IJt={name:"headingAtx",tokenize:$Jt,resolve:LJt};function LJt(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"},Fh(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function $Jt(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(t.consume(u),s):u===null||ml(u)?(t.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||Qt(u)?(t.exit("atxHeading"),e(u)):sr(u)?Wr(t,a,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||ml(u)?(t.exit("atxHeadingText"),a(u)):(t.consume(u),c)}}const FJt=["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"],Yxe=["pre","script","style","textarea"],NJt={name:"htmlFlow",tokenize:UJt,resolveTo:BJt,concrete:!0},zJt={tokenize:VJt,partial:!0},jJt={tokenize:WJt,partial:!0};function BJt(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 UJt(t,e,n){const r=this;let i,o,s,a,l;return c;function c(j){return u(j)}function u(j){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(j),f}function f(j){return j===33?(t.consume(j),d):j===47?(t.consume(j),o=!0,g):j===63?(t.consume(j),i=3,r.interrupt?e:L):Hd(j)?(t.consume(j),s=String.fromCharCode(j),m):n(j)}function d(j){return j===45?(t.consume(j),i=2,h):j===91?(t.consume(j),i=5,a=0,p):Hd(j)?(t.consume(j),i=4,r.interrupt?e:L):n(j)}function h(j){return j===45?(t.consume(j),r.interrupt?e:L):n(j)}function p(j){const X="CDATA[";return j===X.charCodeAt(a++)?(t.consume(j),a===X.length?r.interrupt?e:A:p):n(j)}function g(j){return Hd(j)?(t.consume(j),s=String.fromCharCode(j),m):n(j)}function m(j){if(j===null||j===47||j===62||ml(j)){const X=j===47,V=s.toLowerCase();return!X&&!o&&Yxe.includes(V)?(i=1,r.interrupt?e(j):A(j)):FJt.includes(s.toLowerCase())?(i=6,X?(t.consume(j),v):r.interrupt?e(j):A(j)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):o?y(j):x(j))}return j===45||lc(j)?(t.consume(j),s+=String.fromCharCode(j),m):n(j)}function v(j){return j===62?(t.consume(j),r.interrupt?e:A):n(j)}function y(j){return sr(j)?(t.consume(j),y):E(j)}function x(j){return j===47?(t.consume(j),E):j===58||j===95||Hd(j)?(t.consume(j),b):sr(j)?(t.consume(j),x):E(j)}function b(j){return j===45||j===46||j===58||j===95||lc(j)?(t.consume(j),b):w(j)}function w(j){return j===61?(t.consume(j),_):sr(j)?(t.consume(j),w):x(j)}function _(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(t.consume(j),l=j,S):sr(j)?(t.consume(j),_):O(j)}function S(j){return j===l?(t.consume(j),l=null,k):j===null||Qt(j)?n(j):(t.consume(j),S)}function O(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||ml(j)?w(j):(t.consume(j),O)}function k(j){return j===47||j===62||sr(j)?x(j):n(j)}function E(j){return j===62?(t.consume(j),P):n(j)}function P(j){return j===null||Qt(j)?A(j):sr(j)?(t.consume(j),P):n(j)}function A(j){return j===45&&i===2?(t.consume(j),I):j===60&&i===1?(t.consume(j),z):j===62&&i===4?(t.consume(j),B):j===63&&i===3?(t.consume(j),L):j===93&&i===5?(t.consume(j),N):Qt(j)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(zJt,$,R)(j)):j===null||Qt(j)?(t.exit("htmlFlowData"),R(j)):(t.consume(j),A)}function R(j){return t.check(jJt,T,$)(j)}function T(j){return t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),M}function M(j){return j===null||Qt(j)?R(j):(t.enter("htmlFlowData"),A(j))}function I(j){return j===45?(t.consume(j),L):A(j)}function z(j){return j===47?(t.consume(j),s="",F):A(j)}function F(j){if(j===62){const X=s.toLowerCase();return Yxe.includes(X)?(t.consume(j),B):A(j)}return Hd(j)&&s.length<8?(t.consume(j),s+=String.fromCharCode(j),F):A(j)}function N(j){return j===93?(t.consume(j),L):A(j)}function L(j){return j===62?(t.consume(j),B):j===45&&i===2?(t.consume(j),L):A(j)}function B(j){return j===null||Qt(j)?(t.exit("htmlFlowData"),$(j)):(t.consume(j),B)}function $(j){return t.exit("htmlFlow"),e(j)}}function WJt(t,e,n){const r=this;return i;function i(s){return Qt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function VJt(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(aU,e,n)}}const GJt={name:"htmlText",tokenize:HJt};function HJt(t,e,n){const r=this;let i,o,s;return a;function a(L){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(L),l}function l(L){return L===33?(t.consume(L),c):L===47?(t.consume(L),w):L===63?(t.consume(L),x):Hd(L)?(t.consume(L),O):n(L)}function c(L){return L===45?(t.consume(L),u):L===91?(t.consume(L),o=0,p):Hd(L)?(t.consume(L),y):n(L)}function u(L){return L===45?(t.consume(L),h):n(L)}function f(L){return L===null?n(L):L===45?(t.consume(L),d):Qt(L)?(s=f,z(L)):(t.consume(L),f)}function d(L){return L===45?(t.consume(L),h):f(L)}function h(L){return L===62?I(L):L===45?d(L):f(L)}function p(L){const B="CDATA[";return L===B.charCodeAt(o++)?(t.consume(L),o===B.length?g:p):n(L)}function g(L){return L===null?n(L):L===93?(t.consume(L),m):Qt(L)?(s=g,z(L)):(t.consume(L),g)}function m(L){return L===93?(t.consume(L),v):g(L)}function v(L){return L===62?I(L):L===93?(t.consume(L),v):g(L)}function y(L){return L===null||L===62?I(L):Qt(L)?(s=y,z(L)):(t.consume(L),y)}function x(L){return L===null?n(L):L===63?(t.consume(L),b):Qt(L)?(s=x,z(L)):(t.consume(L),x)}function b(L){return L===62?I(L):x(L)}function w(L){return Hd(L)?(t.consume(L),_):n(L)}function _(L){return L===45||lc(L)?(t.consume(L),_):S(L)}function S(L){return Qt(L)?(s=S,z(L)):sr(L)?(t.consume(L),S):I(L)}function O(L){return L===45||lc(L)?(t.consume(L),O):L===47||L===62||ml(L)?k(L):n(L)}function k(L){return L===47?(t.consume(L),I):L===58||L===95||Hd(L)?(t.consume(L),E):Qt(L)?(s=k,z(L)):sr(L)?(t.consume(L),k):I(L)}function E(L){return L===45||L===46||L===58||L===95||lc(L)?(t.consume(L),E):P(L)}function P(L){return L===61?(t.consume(L),A):Qt(L)?(s=P,z(L)):sr(L)?(t.consume(L),P):k(L)}function A(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(t.consume(L),i=L,R):Qt(L)?(s=A,z(L)):sr(L)?(t.consume(L),A):(t.consume(L),T)}function R(L){return L===i?(t.consume(L),i=void 0,M):L===null?n(L):Qt(L)?(s=R,z(L)):(t.consume(L),R)}function T(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||ml(L)?k(L):(t.consume(L),T)}function M(L){return L===47||L===62||ml(L)?k(L):n(L)}function I(L){return L===62?(t.consume(L),t.exit("htmlTextData"),t.exit("htmlText"),e):n(L)}function z(L){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),F}function F(L){return sr(L)?Wr(t,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):N(L)}function N(L){return t.enter("htmlTextData"),s(L)}}const gle={name:"labelEnd",tokenize:ZJt,resolveTo:KJt,resolveAll:QJt},qJt={tokenize:JJt},XJt={tokenize:een},YJt={tokenize:ten};function QJt(t){let e=-1;for(;++e=3&&(c===null||Qt(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),sr(c)?Wr(t,a,"whitespace")(c):a(c))}}const Wa={name:"list",tokenize:uen,continuation:{tokenize:fen},exit:hen},len={tokenize:pen,partial:!0},cen={tokenize:den,partial:!0};function uen(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,s=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:OQ(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(N3,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 OQ(h)&&++s<10?(t.consume(h),l):(!r.interrupt||s<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(aU,r.interrupt?n:u,t.attempt(len,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return sr(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 fen(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(aU,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Wr(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!sr(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(cen,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Wr(t,t.attempt(Wa,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function den(t,e,n){const r=this;return Wr(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function hen(t){t.exit(this.containerState.type)}function pen(t,e,n){const r=this;return Wr(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!sr(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Qxe={name:"setextUnderline",tokenize:men,resolveTo:gen};function gen(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 s={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",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end=Object.assign({},t[o][1].end)):t[r][1]=s,t.push(["exit",s,e]),t}function men(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,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),sr(c)?Wr(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Qt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const ven={tokenize:yen};function yen(t){const e=this,n=t.attempt(aU,r,t.attempt(this.parser.constructs.flowInitial,i,Wr(t,t.attempt(this.parser.constructs.flow,i,t.attempt(SJt,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 xen={resolveAll:dWe()},ben=fWe("string"),wen=fWe("text");function fWe(t){return{tokenize:e,resolveAll:dWe(t==="text"?_en:void 0)};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(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 a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function Oen(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 s=-1,a=e.length-1;for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.charCodeAt(i)===e.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function SZt(t){if(ZR(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 CZt(t){ZR(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.charCodeAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===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 OZt(...t){let e=-1,n;for(;++e0&&t.charCodeAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function TZt(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s2){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=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function ZR(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const kZt={cwd:AZt};function AZt(){return"/"}function _Q(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function PZt(t){if(typeof t=="string")t=new URL(t);else if(!_Q(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 MZt(t)}function MZt(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"||F3.call(e,i)},Lxe=function(e,n){Mxe&&n.name==="__proto__"?Mxe(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},$xe=function(e,n){if(n==="__proto__")if(F3.call(e,n)){if(Rxe)return Rxe(e,n).value}else return;return e[n]},DZt=function t(){var e,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});ls.length;let l;a&&s.push(i);try{l=t.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,e(s,...a))}function o(s){i(null,s)}}const $Zt=nWe().freeze(),tWe={}.hasOwnProperty;function nWe(){const t=IZt(),e=[];let n={},r,i=-1;return o.data=s,o.Parser=void 0,o.Compiler=void 0,o.freeze=a,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 g=nWe();let m=-1;for(;++m{if(_||!S||!O)w(_);else{const k=o.stringify(S,O);k==null||(zZt(k)?O.value=k:O.result=k),w(_,O)}});function w(_,S){_||!S?x(_):y?y(S):m(null,S)}}}function p(g){let m;o.freeze(),M9("processSync",o.Parser),R9("processSync",o.Compiler);const v=g2(g);return o.process(v,y),jxe("processSync","process",m),v;function y(x){m=!0,Pxe(x)}}}function Nxe(t,e){return typeof t=="function"&&t.prototype&&(FZt(t.prototype)||e in t.prototype)}function FZt(t){let e;for(e in t)if(tWe.call(t,e))return!0;return!1}function M9(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function R9(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function D9(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 zxe(t){if(!SQ(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function jxe(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function g2(t){return NZt(t)?t:new J8e(t)}function NZt(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function zZt(t){return typeof t=="string"||Z8e(t)}const jZt={};function BZt(t,e){const n=jZt,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rWe(t,r,i)}function rWe(t,e,n){if(UZt(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 Bxe(t.children,e,n)}return Array.isArray(t)?Bxe(t,e,n):""}function Bxe(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)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o0?(Fh(t,t.length,0,e),t):e}const Uxe={}.hasOwnProperty;function WZt(t){const e={};let n=-1;for(;++ns))return;const S=e.events.length;let O=S,k,E;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(k){E=e.events[O][1].end;break}k=!0}for(v(r),_=S;_x;){const w=n[b];e.containerState=w[1],w[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 nJt(t,e,n){return Wr(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vxe(t){if(t===null||ml(t)||KZt(t))return 1;if(QZt(t))return 2}function hle(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);Gxe(f,-l),Gxe(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},t[r][1].end)},a={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({},s.start),end:Object.assign({},a.end)},t[r][1].end=Object.assign({},s.start),t[n][1].start=Object.assign({},a.end),c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=Xc(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=Xc(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),c=Xc(c,hle(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=Xc(c,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=Xc(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Fh(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&sr(_)?Wr(t,y,"linePrefix",o+1)(_):y(_)}function y(_){return _===null||Qt(_)?t.check(qxe,g,b)(_):(t.enter("codeFlowValue"),x(_))}function x(_){return _===null||Qt(_)?(t.exit("codeFlowValue"),y(_)):(t.consume(_),x)}function b(_){return t.exit("codeFenced"),e(_)}function w(_,S,O){let k=0;return E;function E(M){return _.enter("lineEnding"),_.consume(M),_.exit("lineEnding"),P}function P(M){return _.enter("codeFencedFence"),sr(M)?Wr(_,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):A(M)}function A(M){return M===a?(_.enter("codeFencedFenceSequence"),R(M)):O(M)}function R(M){return M===a?(k++,_.consume(M),R):k>=s?(_.exit("codeFencedFenceSequence"),sr(M)?Wr(_,T,"whitespace")(M):T(M)):O(M)}function T(M){return M===null||Qt(M)?(_.exit("codeFencedFence"),S(M)):O(M)}}}function pJt(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const I9={name:"codeIndented",tokenize:mJt},gJt={tokenize:vJt,partial:!0};function mJt(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Wr(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?s(c):n(c)}function s(c){return c===null?l(c):Qt(c)?t.attempt(gJt,s,l)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||Qt(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),a)}function l(c){return t.exit("codeIndented"),e(c)}}function vJt(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Qt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Wr(t,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):Qt(s)?i(s):n(s)}}const yJt={name:"codeText",tokenize:wJt,resolve:xJt,previous:bJt};function xJt(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(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function lWe(t,e,n,r,i,o,s,a,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||CQ(v)?n(v):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),g(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(a),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(t.exit("chunkString"),t.exit(a),d(v)):v===null||v===60||Qt(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 g(v){return!u&&(v===null||v===41||ml(v))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(v)):u999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(t.exit(o),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):Qt(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||Qt(h)||a++>999?(t.exit("chunkString"),u(h)):(t.consume(h),l||(l=!sr(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),a++,f):f(h)}}function uWe(t,e,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),c(d))}function c(d){return d===s?(t.exit(o),l(s)):d===null?n(d):Qt(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Wr(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||Qt(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?f:u)}function f(d){return d===s||d===92?(t.consume(d),u):u(d)}}function xk(t,e){let n;return r;function r(i){return Qt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):sr(i)?Wr(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}function Y_(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kJt={name:"definition",tokenize:PJt},AJt={tokenize:MJt,partial:!0};function PJt(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),s(h)}function s(h){return cWe.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Y_(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 ml(h)?xk(t,c)(h):c(h)}function c(h){return lWe(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(AJt,f,f)(h)}function f(h){return sr(h)?Wr(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Qt(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function MJt(t,e,n){return r;function r(a){return ml(a)?xk(t,i)(a):n(a)}function i(a){return uWe(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return sr(a)?Wr(t,s,"whitespace")(a):s(a)}function s(a){return a===null||Qt(a)?e(a):n(a)}}const RJt={name:"hardBreakEscape",tokenize:DJt};function DJt(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return Qt(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const IJt={name:"headingAtx",tokenize:$Jt,resolve:LJt};function LJt(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"},Fh(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function $Jt(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(t.consume(u),s):u===null||ml(u)?(t.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||Qt(u)?(t.exit("atxHeading"),e(u)):sr(u)?Wr(t,a,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||ml(u)?(t.exit("atxHeadingText"),a(u)):(t.consume(u),c)}}const FJt=["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"],Yxe=["pre","script","style","textarea"],NJt={name:"htmlFlow",tokenize:UJt,resolveTo:BJt,concrete:!0},zJt={tokenize:VJt,partial:!0},jJt={tokenize:WJt,partial:!0};function BJt(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 UJt(t,e,n){const r=this;let i,o,s,a,l;return c;function c(j){return u(j)}function u(j){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(j),f}function f(j){return j===33?(t.consume(j),d):j===47?(t.consume(j),o=!0,g):j===63?(t.consume(j),i=3,r.interrupt?e:L):Hd(j)?(t.consume(j),s=String.fromCharCode(j),m):n(j)}function d(j){return j===45?(t.consume(j),i=2,h):j===91?(t.consume(j),i=5,a=0,p):Hd(j)?(t.consume(j),i=4,r.interrupt?e:L):n(j)}function h(j){return j===45?(t.consume(j),r.interrupt?e:L):n(j)}function p(j){const X="CDATA[";return j===X.charCodeAt(a++)?(t.consume(j),a===X.length?r.interrupt?e:A:p):n(j)}function g(j){return Hd(j)?(t.consume(j),s=String.fromCharCode(j),m):n(j)}function m(j){if(j===null||j===47||j===62||ml(j)){const X=j===47,V=s.toLowerCase();return!X&&!o&&Yxe.includes(V)?(i=1,r.interrupt?e(j):A(j)):FJt.includes(s.toLowerCase())?(i=6,X?(t.consume(j),v):r.interrupt?e(j):A(j)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):o?y(j):x(j))}return j===45||lc(j)?(t.consume(j),s+=String.fromCharCode(j),m):n(j)}function v(j){return j===62?(t.consume(j),r.interrupt?e:A):n(j)}function y(j){return sr(j)?(t.consume(j),y):E(j)}function x(j){return j===47?(t.consume(j),E):j===58||j===95||Hd(j)?(t.consume(j),b):sr(j)?(t.consume(j),x):E(j)}function b(j){return j===45||j===46||j===58||j===95||lc(j)?(t.consume(j),b):w(j)}function w(j){return j===61?(t.consume(j),_):sr(j)?(t.consume(j),w):x(j)}function _(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(t.consume(j),l=j,S):sr(j)?(t.consume(j),_):O(j)}function S(j){return j===l?(t.consume(j),l=null,k):j===null||Qt(j)?n(j):(t.consume(j),S)}function O(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||ml(j)?w(j):(t.consume(j),O)}function k(j){return j===47||j===62||sr(j)?x(j):n(j)}function E(j){return j===62?(t.consume(j),P):n(j)}function P(j){return j===null||Qt(j)?A(j):sr(j)?(t.consume(j),P):n(j)}function A(j){return j===45&&i===2?(t.consume(j),I):j===60&&i===1?(t.consume(j),z):j===62&&i===4?(t.consume(j),B):j===63&&i===3?(t.consume(j),L):j===93&&i===5?(t.consume(j),N):Qt(j)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(zJt,$,R)(j)):j===null||Qt(j)?(t.exit("htmlFlowData"),R(j)):(t.consume(j),A)}function R(j){return t.check(jJt,T,$)(j)}function T(j){return t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),M}function M(j){return j===null||Qt(j)?R(j):(t.enter("htmlFlowData"),A(j))}function I(j){return j===45?(t.consume(j),L):A(j)}function z(j){return j===47?(t.consume(j),s="",F):A(j)}function F(j){if(j===62){const X=s.toLowerCase();return Yxe.includes(X)?(t.consume(j),B):A(j)}return Hd(j)&&s.length<8?(t.consume(j),s+=String.fromCharCode(j),F):A(j)}function N(j){return j===93?(t.consume(j),L):A(j)}function L(j){return j===62?(t.consume(j),B):j===45&&i===2?(t.consume(j),L):A(j)}function B(j){return j===null||Qt(j)?(t.exit("htmlFlowData"),$(j)):(t.consume(j),B)}function $(j){return t.exit("htmlFlow"),e(j)}}function WJt(t,e,n){const r=this;return i;function i(s){return Qt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function VJt(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(aU,e,n)}}const GJt={name:"htmlText",tokenize:HJt};function HJt(t,e,n){const r=this;let i,o,s;return a;function a(L){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(L),l}function l(L){return L===33?(t.consume(L),c):L===47?(t.consume(L),w):L===63?(t.consume(L),x):Hd(L)?(t.consume(L),O):n(L)}function c(L){return L===45?(t.consume(L),u):L===91?(t.consume(L),o=0,p):Hd(L)?(t.consume(L),y):n(L)}function u(L){return L===45?(t.consume(L),h):n(L)}function f(L){return L===null?n(L):L===45?(t.consume(L),d):Qt(L)?(s=f,z(L)):(t.consume(L),f)}function d(L){return L===45?(t.consume(L),h):f(L)}function h(L){return L===62?I(L):L===45?d(L):f(L)}function p(L){const B="CDATA[";return L===B.charCodeAt(o++)?(t.consume(L),o===B.length?g:p):n(L)}function g(L){return L===null?n(L):L===93?(t.consume(L),m):Qt(L)?(s=g,z(L)):(t.consume(L),g)}function m(L){return L===93?(t.consume(L),v):g(L)}function v(L){return L===62?I(L):L===93?(t.consume(L),v):g(L)}function y(L){return L===null||L===62?I(L):Qt(L)?(s=y,z(L)):(t.consume(L),y)}function x(L){return L===null?n(L):L===63?(t.consume(L),b):Qt(L)?(s=x,z(L)):(t.consume(L),x)}function b(L){return L===62?I(L):x(L)}function w(L){return Hd(L)?(t.consume(L),_):n(L)}function _(L){return L===45||lc(L)?(t.consume(L),_):S(L)}function S(L){return Qt(L)?(s=S,z(L)):sr(L)?(t.consume(L),S):I(L)}function O(L){return L===45||lc(L)?(t.consume(L),O):L===47||L===62||ml(L)?k(L):n(L)}function k(L){return L===47?(t.consume(L),I):L===58||L===95||Hd(L)?(t.consume(L),E):Qt(L)?(s=k,z(L)):sr(L)?(t.consume(L),k):I(L)}function E(L){return L===45||L===46||L===58||L===95||lc(L)?(t.consume(L),E):P(L)}function P(L){return L===61?(t.consume(L),A):Qt(L)?(s=P,z(L)):sr(L)?(t.consume(L),P):k(L)}function A(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(t.consume(L),i=L,R):Qt(L)?(s=A,z(L)):sr(L)?(t.consume(L),A):(t.consume(L),T)}function R(L){return L===i?(t.consume(L),i=void 0,M):L===null?n(L):Qt(L)?(s=R,z(L)):(t.consume(L),R)}function T(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||ml(L)?k(L):(t.consume(L),T)}function M(L){return L===47||L===62||ml(L)?k(L):n(L)}function I(L){return L===62?(t.consume(L),t.exit("htmlTextData"),t.exit("htmlText"),e):n(L)}function z(L){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),F}function F(L){return sr(L)?Wr(t,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):N(L)}function N(L){return t.enter("htmlTextData"),s(L)}}const gle={name:"labelEnd",tokenize:ZJt,resolveTo:KJt,resolveAll:QJt},qJt={tokenize:JJt},XJt={tokenize:een},YJt={tokenize:ten};function QJt(t){let e=-1;for(;++e=3&&(c===null||Qt(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),sr(c)?Wr(t,a,"whitespace")(c):a(c))}}const Wa={name:"list",tokenize:uen,continuation:{tokenize:fen},exit:hen},len={tokenize:pen,partial:!0},cen={tokenize:den,partial:!0};function uen(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,s=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:OQ(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(N3,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 OQ(h)&&++s<10?(t.consume(h),l):(!r.interrupt||s<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(aU,r.interrupt?n:u,t.attempt(len,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return sr(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 fen(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(aU,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Wr(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!sr(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(cen,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Wr(t,t.attempt(Wa,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function den(t,e,n){const r=this;return Wr(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function hen(t){t.exit(this.containerState.type)}function pen(t,e,n){const r=this;return Wr(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!sr(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Qxe={name:"setextUnderline",tokenize:men,resolveTo:gen};function gen(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 s={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",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end=Object.assign({},t[o][1].end)):t[r][1]=s,t.push(["exit",s,e]),t}function men(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,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),sr(c)?Wr(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Qt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const ven={tokenize:yen};function yen(t){const e=this,n=t.attempt(aU,r,t.attempt(this.parser.constructs.flowInitial,i,Wr(t,t.attempt(this.parser.constructs.flow,i,t.attempt(SJt,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 xen={resolveAll:dWe()},ben=fWe("string"),wen=fWe("text");function fWe(t){return{tokenize:e,resolveAll:dWe(t==="text"?_en:void 0)};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(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 a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function Oen(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 zen=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jen(t){return t.replace(zen,Ben)}function Ben(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return hWe(n.slice(o?2:1),o?16:10)}return ple(n)||t}const pWe={}.hasOwnProperty,Uen=function(t,e,n){return typeof e!="string"&&(n=e,e=void 0),Wen(n)(Nen($en(n).document().write(Fen()(t,e,!0))))};function Wen(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(de),autolinkProtocol:P,autolinkEmail:P,atxHeading:a(ne),blockQuote:a(me),characterEscape:P,characterReference:P,codeFenced:a(te),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(te,l),codeText:a(ae,l),codeTextData:P,data:P,codeFlowValue:P,definition:a(U),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(oe),hardBreakEscape:a(G),hardBreakTrailing:a(G),htmlFlow:a(q,l),htmlFlowData:P,htmlText:a(q,l),htmlTextData:P,image:a(Z),label:l,link:a(de),listItem:a(H),listItemValue:p,listOrdered:a(xe,h),listUnordered:a(xe),paragraph:a(W),reference:V,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(ne),strong:a(J),thematicBreak:a(ye)},exit:{atxHeading:u(),atxHeadingSequence:S,autolink:u(),autolinkEmail:re,autolinkProtocol:ee,blockQuote:u(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:K,codeFenced:u(y),codeFencedFence:v,codeFencedFenceInfo:g,codeFencedFenceMeta:m,codeFlowValue:A,codeIndented:u(x),codeText:u(z),codeTextData:A,data:A,definition:u(),definitionDestinationString:_,definitionLabelString:b,definitionTitleString:w,emphasis:u(),hardBreakEscape:u(T),hardBreakTrailing:u(T),htmlFlow:u(M),htmlFlowData:A,htmlText:u(I),htmlTextData:A,image:u(N),label:B,labelText:L,lineEnding:R,link:u(F),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Y,resourceDestinationString:$,resourceTitleString:j,resource:X,setextHeading:u(E),setextHeadingLineSequence:k,setextHeadingText:O,strong:u(),thematicBreak:u()}};gWe(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ie){let fe={type:"root",children:[]};const Q={stack:[fe],tokenStack:[],config:e,enter:c,exit:f,buffer:l,resume:d,setData:o,getData:s},_e=[];let we=-1;for(;++we0){const Ie=Q.tokenStack[Q.tokenStack.length-1];(Ie[1]||Zxe).call(Q,void 0,Ie[0])}for(fe.position={start:vm(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:vm(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we{const r=this.data("settings");return Uen(n,Object.assign({},r,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function Hen(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 qen(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:` +`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const Een={42:Wa,43:Wa,45:Wa,48:Wa,49:Wa,50:Wa,51:Wa,52:Wa,53:Wa,54:Wa,55:Wa,56:Wa,57:Wa,62:iWe},Ten={91:kJt},ken={[-2]:I9,[-1]:I9,32:I9},Aen={35:IJt,42:N3,45:[Qxe,N3],60:NJt,61:Qxe,95:N3,96:Xxe,126:Xxe},Pen={38:sWe,92:oWe},Men={[-5]:L9,[-4]:L9,[-3]:L9,33:nen,38:sWe,42:EQ,60:[oJt,GJt],91:ien,92:[RJt,oWe],93:gle,95:EQ,96:yJt},Ren={null:[EQ,xen]},Den={null:[42,95]},Ien={null:[]},Len=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Den,contentInitial:Ten,disable:Ien,document:Een,flow:Aen,flowInitial:ken,insideSpan:Ren,string:Pen,text:Men},Symbol.toStringTag,{value:"Module"}));function $en(t){const n=WZt([Len,...(t||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(ZZt),document:i(eJt),flow:i(ven),string:i(ben),text:i(wen)};return r;function i(o){return s;function s(a){return Sen(r,o,a)}}}const Kxe=/[\0\t\n\r]/g;function Fen(){let t=1,e="",n=!0,r;return i;function i(o,s,a){const l=[];let c,u,f,d,h;for(o=e+o.toString(s),f=0,e="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f13&&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 zen=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jen(t){return t.replace(zen,Ben)}function Ben(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return hWe(n.slice(o?2:1),o?16:10)}return ple(n)||t}const pWe={}.hasOwnProperty,Uen=function(t,e,n){return typeof e!="string"&&(n=e,e=void 0),Wen(n)(Nen($en(n).document().write(Fen()(t,e,!0))))};function Wen(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(de),autolinkProtocol:P,autolinkEmail:P,atxHeading:a(ne),blockQuote:a(me),characterEscape:P,characterReference:P,codeFenced:a(te),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(te,l),codeText:a(ae,l),codeTextData:P,data:P,codeFlowValue:P,definition:a(U),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(oe),hardBreakEscape:a(G),hardBreakTrailing:a(G),htmlFlow:a(q,l),htmlFlowData:P,htmlText:a(q,l),htmlTextData:P,image:a(Z),label:l,link:a(de),listItem:a(H),listItemValue:p,listOrdered:a(xe,h),listUnordered:a(xe),paragraph:a(W),reference:V,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(ne),strong:a(J),thematicBreak:a(ye)},exit:{atxHeading:u(),atxHeadingSequence:S,autolink:u(),autolinkEmail:re,autolinkProtocol:ee,blockQuote:u(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:K,codeFenced:u(y),codeFencedFence:v,codeFencedFenceInfo:g,codeFencedFenceMeta:m,codeFlowValue:A,codeIndented:u(x),codeText:u(z),codeTextData:A,data:A,definition:u(),definitionDestinationString:_,definitionLabelString:b,definitionTitleString:w,emphasis:u(),hardBreakEscape:u(T),hardBreakTrailing:u(T),htmlFlow:u(M),htmlFlowData:A,htmlText:u(I),htmlTextData:A,image:u(N),label:B,labelText:L,lineEnding:R,link:u(F),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Y,resourceDestinationString:$,resourceTitleString:j,resource:X,setextHeading:u(E),setextHeadingLineSequence:k,setextHeadingText:O,strong:u(),thematicBreak:u()}};gWe(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ie){let fe={type:"root",children:[]};const Q={stack:[fe],tokenStack:[],config:e,enter:c,exit:f,buffer:l,resume:d,setData:o,getData:s},_e=[];let we=-1;for(;++we0){const Ie=Q.tokenStack[Q.tokenStack.length-1];(Ie[1]||Zxe).call(Q,void 0,Ie[0])}for(fe.position={start:vm(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:vm(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we{const r=this.data("settings");return Uen(n,Object.assign({},r,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function Hen(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 qen(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:` `}]}function Xen(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 Yen(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Qen(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function HO(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=t.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function mWe(t,e){const n=String(e.identifier).toUpperCase(),r=HO(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 s=t.footnoteCounts[n],a={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,a);const l={type:"element",tagName:"sup",properties:{},children:[a]};return t.patch(e,l),t.applyData(e,l)}function Ken(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},mWe(t,{type:"footnoteReference",identifier:i,position:e.position})}function Zen(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 Jen(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function vWe(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 s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function etn(t,e){const n=t.definition(e.identifier);if(!n)return vWe(t,e);const r={src:HO(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 ttn(t,e){const n={src:HO(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 ntn(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 rtn(t,e){const n=t.definition(e.identifier);if(!n)return vWe(t,e);const r={href:HO(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 itn(t,e){const n={href:HO(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 otn(t,e,n){const r=t.all(e),i=n?stn(n):yWe(e),o={},s=[];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 a=-1;for(;++a55295&&o<57344){const a=t.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function mWe(t,e){const n=String(e.identifier).toUpperCase(),r=GO(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 s=t.footnoteCounts[n],a={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,a);const l={type:"element",tagName:"sup",properties:{},children:[a]};return t.patch(e,l),t.applyData(e,l)}function Ken(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},mWe(t,{type:"footnoteReference",identifier:i,position:e.position})}function Zen(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 Jen(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function vWe(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 s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function etn(t,e){const n=t.definition(e.identifier);if(!n)return vWe(t,e);const r={src:GO(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 ttn(t,e){const n={src:GO(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 ntn(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 rtn(t,e){const n=t.definition(e.identifier);if(!n)return vWe(t,e);const r={href:GO(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 itn(t,e){const n={href:GO(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 otn(t,e,n){const r=t.all(e),i=n?stn(n):yWe(e),o={},s=[];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 a=-1;for(;++a1}function atn(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 dtn(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=mle(e.children[1]),l=vle(e.children[e.children.length-1]);a.line&&l.line&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function htn(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.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(tbe(e.slice(i),i>0,!1)),o.join("")}function tbe(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===Jxe||o===ebe;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===Jxe||o===ebe;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function mtn(t,e){const n={type:"text",value:gtn(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function vtn(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const ytn={blockquote:Hen,break:qen,code:Xen,delete:Yen,emphasis:Qen,footnoteReference:mWe,footnote:Ken,heading:Zen,html:Jen,imageReference:etn,image:ttn,inlineCode:ntn,linkReference:rtn,link:itn,listItem:otn,list:atn,paragraph:ltn,root:ctn,strong:utn,table:dtn,tableCell:ptn,tableRow:htn,text:mtn,thematicBreak:vtn,toml:pL,yaml:pL,definition:pL,footnoteDefinition:pL};function pL(){return null}const bWe=function(t){if(t==null)return _tn;if(typeof t=="string")return wtn(t);if(typeof t=="object")return Array.isArray(t)?xtn(t):btn(t);if(typeof t=="function")return lU(t);throw new Error("Expected function, string, or object as test")};function xtn(t){const e=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let d=[],h,p,g;if((!e||i(a,l,c[c.length-1]||null))&&(d=Etn(n(a,c)),d[0]===nbe))return d;if(a.children&&d[0]!==Ctn)for(p=(r?a.children.length:-1)+o,g=c.concat(a);p>-1&&p{const i=ibe(r.identifier);i&&!rbe.call(e,i)&&(e[i]=r)}),n;function n(r){const i=ibe(r);return i&&rbe.call(e,i)?e[i]:null}}function ibe(t){return String(t||"").toUpperCase()}const Y5={}.hasOwnProperty;function Atn(t,e){const n=e||{},r=n.allowDangerousHtml||!1,i={};return s.dangerous=r,s.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,s.footnoteLabel=n.footnoteLabel||"Footnotes",s.footnoteLabelTagName=n.footnoteLabelTagName||"h2",s.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},s.footnoteBackLabel=n.footnoteBackLabel||"Back to content",s.unknownHandler=n.unknownHandler,s.passThrough=n.passThrough,s.handlers={...ytn,...n.handlers},s.definition=ktn(t),s.footnoteById=i,s.footnoteOrder=[],s.footnoteCounts={},s.patch=Ptn,s.applyData=Mtn,s.one=a,s.all=l,s.wrap=Dtn,s.augment=o,yle(t,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();Y5.call(i,u)||(i[u]=c)}),s;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};Ttn(f)||(u.position={start:mle(f),end:vle(f)})}return u}function s(c,u,f,d){return Array.isArray(f)&&(d=f,f={}),o(c,{type:"element",tagName:u,properties:f||{},children:d||[]})}function a(c,u){return wWe(s,c,u)}function l(c){return xle(s,c)}}function Ptn(t,e){t.position&&(e.position=ftn(t))}function Mtn(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 wWe(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return Y5.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:xle(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):Rtn(t,e)}function xle(t,e){const n=[];if("children"in e){const r=e.children;let i=-1;for(;++i0&&n.push({type:"text",value:` -`}),n}function Itn(t){const e=[];let n=-1;for(;++n1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:t.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),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-"+s},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 Itn(t){const e=[];let n=-1;for(;++n1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:t.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),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-"+s},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 _We(t,e){const n=Atn(t,e),r=n.one(t,null),i=Itn(n);return i&&r.children.push({type:"text",value:` -`},i),Array.isArray(r)?{type:"root",children:r}:r}const Ltn=function(t,e){return t&&"run"in t?$tn(t,e):Ftn(t||e)};function $tn(t,e){return(n,r,i)=>{t.run(_We(n,e),r,o=>{i(o)})}}function Ftn(t){return e=>_We(e,t)}class JR{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}JR.prototype.property={};JR.prototype.normal={};JR.prototype.space=null;function SWe(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Utn.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(sbe,Htn);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!sbe.test(o)){let s=o.replace(Wtn,Gtn);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=ble}return new i(r,e)}function Gtn(t){return"-"+t.toLowerCase()}function Htn(t){return t.charAt(1).toUpperCase()}const abe={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"},qtn=SWe([EWe,OWe,AWe,PWe,jtn],"html"),Xtn=SWe([EWe,OWe,AWe,PWe,Btn],"svg");function Ytn(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=>{yle(e,"element",(n,r,i)=>{const o=i;let s;if(t.allowedElements?s=!t.allowedElements.includes(n.tagName):t.disallowedElements&&(s=t.disallowedElements.includes(n.tagName)),!s&&t.allowElement&&typeof r=="number"&&(s=!t.allowElement(n,r,o)),s&&typeof r=="number")return t.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}var MWe={exports:{}},Cr={};/** +`},i),Array.isArray(r)?{type:"root",children:r}:r}const Ltn=function(t,e){return t&&"run"in t?$tn(t,e):Ftn(t||e)};function $tn(t,e){return(n,r,i)=>{t.run(_We(n,e),r,o=>{i(o)})}}function Ftn(t){return e=>_We(e,t)}class JR{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}JR.prototype.property={};JR.prototype.normal={};JR.prototype.space=null;function SWe(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Utn.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(sbe,Htn);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!sbe.test(o)){let s=o.replace(Wtn,Gtn);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=ble}return new i(r,e)}function Gtn(t){return"-"+t.toLowerCase()}function Htn(t){return t.charAt(1).toUpperCase()}const abe={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"},qtn=SWe([EWe,OWe,AWe,PWe,jtn],"html"),Xtn=SWe([EWe,OWe,AWe,PWe,Btn],"svg");function Ytn(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=>{yle(e,"element",(n,r,i)=>{const o=i;let s;if(t.allowedElements?s=!t.allowedElements.includes(n.tagName):t.disallowedElements&&(s=t.disallowedElements.includes(n.tagName)),!s&&t.allowElement&&typeof r=="number"&&(s=!t.allowElement(n,r,o)),s&&typeof r=="number")return t.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}var MWe={exports:{}},Cr={};/** * @license React * react-is.production.min.js * @@ -530,64 +530,64 @@ ${a}`)}return c}(t,"",0)}function Al(t,e,n){return t.fields=e||[],t.fname=n,t}fu * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var wle=Symbol.for("react.element"),_le=Symbol.for("react.portal"),cU=Symbol.for("react.fragment"),uU=Symbol.for("react.strict_mode"),fU=Symbol.for("react.profiler"),dU=Symbol.for("react.provider"),hU=Symbol.for("react.context"),Qtn=Symbol.for("react.server_context"),pU=Symbol.for("react.forward_ref"),gU=Symbol.for("react.suspense"),mU=Symbol.for("react.suspense_list"),vU=Symbol.for("react.memo"),yU=Symbol.for("react.lazy"),Ktn=Symbol.for("react.offscreen"),RWe;RWe=Symbol.for("react.module.reference");function Wu(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case wle:switch(t=t.type,t){case cU:case fU:case uU:case gU:case mU:return t;default:switch(t=t&&t.$$typeof,t){case Qtn:case hU:case pU:case yU:case vU:case dU:return t;default:return e}}case _le:return e}}}Cr.ContextConsumer=hU;Cr.ContextProvider=dU;Cr.Element=wle;Cr.ForwardRef=pU;Cr.Fragment=cU;Cr.Lazy=yU;Cr.Memo=vU;Cr.Portal=_le;Cr.Profiler=fU;Cr.StrictMode=uU;Cr.Suspense=gU;Cr.SuspenseList=mU;Cr.isAsyncMode=function(){return!1};Cr.isConcurrentMode=function(){return!1};Cr.isContextConsumer=function(t){return Wu(t)===hU};Cr.isContextProvider=function(t){return Wu(t)===dU};Cr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===wle};Cr.isForwardRef=function(t){return Wu(t)===pU};Cr.isFragment=function(t){return Wu(t)===cU};Cr.isLazy=function(t){return Wu(t)===yU};Cr.isMemo=function(t){return Wu(t)===vU};Cr.isPortal=function(t){return Wu(t)===_le};Cr.isProfiler=function(t){return Wu(t)===fU};Cr.isStrictMode=function(t){return Wu(t)===uU};Cr.isSuspense=function(t){return Wu(t)===gU};Cr.isSuspenseList=function(t){return Wu(t)===mU};Cr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===cU||t===fU||t===uU||t===gU||t===mU||t===Ktn||typeof t=="object"&&t!==null&&(t.$$typeof===yU||t.$$typeof===vU||t.$$typeof===dU||t.$$typeof===hU||t.$$typeof===pU||t.$$typeof===RWe||t.getModuleId!==void 0)};Cr.typeOf=Wu;MWe.exports=Cr;var Ztn=MWe.exports;const Jtn=sn(Ztn);function enn(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 tnn(t){return t.join(" ").trim()}function nnn(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var Sle={exports:{}},lbe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,rnn=/\n/g,inn=/^\s*/,onn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,snn=/^:\s*/,ann=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,lnn=/^[;\s]*/,cnn=/^\s+|\s+$/g,unn=` -`,cbe="/",ube="*",rx="",fnn="comment",dnn="declaration",hnn=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 g=p.match(rnn);g&&(n+=g.length);var m=p.lastIndexOf(unn);r=~m?p.length-m:r+p.length}function o(){var p={line:n,column:r};return function(g){return g.position=new s(p),c(),g}}function s(p){this.start=p,this.end={line:n,column:r},this.source=e.source}s.prototype.content=t;function a(p){var g=new Error(e.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=e.source,g.line=n,g.column=r,g.source=t,!e.silent)throw g}function l(p){var g=p.exec(t);if(g){var m=g[0];return i(m),t=t.slice(m.length),g}}function c(){l(inn)}function u(p){var g;for(p=p||[];g=f();)g!==!1&&p.push(g);return p}function f(){var p=o();if(!(cbe!=t.charAt(0)||ube!=t.charAt(1))){for(var g=2;rx!=t.charAt(g)&&(ube!=t.charAt(g)||cbe!=t.charAt(g+1));)++g;if(g+=2,rx===t.charAt(g-1))return a("End of comment missing");var m=t.slice(2,g-2);return r+=2,i(m),t=t.slice(g),r+=2,p({type:fnn,comment:m})}}function d(){var p=o(),g=l(onn);if(g){if(f(),!l(snn))return a("property missing ':'");var m=l(ann),v=p({type:dnn,property:fbe(g[0].replace(lbe,rx)),value:m?fbe(m[0].replace(lbe,rx)):rx});return l(lnn),v}}function h(){var p=[];u(p);for(var g;g=d();)g!==!1&&(p.push(g),u(p));return p}return c(),h()};function fbe(t){return t?t.replace(cnn,rx):rx}var pnn=hnn;function DWe(t,e){var n=null;if(!t||typeof t!="string")return n;for(var r,i=pnn(t),o=typeof e=="function",s,a,l=0,c=i.length;l0?he.createElement(h,l,f):he.createElement(h,l)}function xnn(t){let e=-1;for(;++e for more info)`),delete gL[o]}const e=$Zt().use(Gen).use(t.remarkPlugins||[]).use(Ltn,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(Ytn,t),n=new J8e;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=he.createElement(he.Fragment,{},IWe({options:t,schema:qtn,listDepth:0},r));return t.className&&(i=he.createElement("div",{className:t.className},i)),i}LWe.propTypes={children:ge.string,className:ge.string,allowElement:ge.func,allowedElements:ge.arrayOf(ge.string),disallowedElements:ge.arrayOf(ge.string),unwrapDisallowed:ge.bool,remarkPlugins:ge.arrayOf(ge.oneOfType([ge.object,ge.func,ge.arrayOf(ge.oneOfType([ge.bool,ge.string,ge.object,ge.func,ge.arrayOf(ge.any)]))])),rehypePlugins:ge.arrayOf(ge.oneOfType([ge.object,ge.func,ge.arrayOf(ge.oneOfType([ge.bool,ge.string,ge.object,ge.func,ge.arrayOf(ge.any)]))])),sourcePos:ge.bool,rawSourcePos:ge.bool,skipHtml:ge.bool,includeElementIndex:ge.bool,transformLinkUri:ge.oneOfType([ge.func,ge.bool]),linkTarget:ge.oneOfType([ge.func,ge.string]),transformImageUri:ge.func,components:ge.object};function Cle({text:t}){const e=To(),n=D.useMemo(()=>({a:r=>{const{node:i,...o}=r;return C.jsx("a",{...o,style:{color:e.palette.mode==="dark"?"#90caf9":"#1e90ff"}})},code:r=>{const{node:i,...o}=r;return C.jsx("code",{...o,style:{color:"grey"}})}}),[e]);return t?C.jsx(LWe,{children:t,components:n,linkTarget:"_blank"}):null}const N9={dialog:t=>({backgroundColor:t.palette.mode==="dark"?t.palette.grey[800]:t.palette.grey[200]}),appBar:{position:"relative"},title:t=>({marginLeft:t.spacing(2),flex:1})},Onn=oa("div")(({theme:t})=>({marginTop:t.spacing(4),marginLeft:t.spacing(40),marginRight:t.spacing(40)})),Enn=he.forwardRef(function(e,n){return C.jsx(Jat,{direction:"up",ref:n,...e})}),$We=({title:t,text:e,open:n,onClose:r})=>C.jsxs(ed,{fullScreen:!0,open:n,onClose:r,TransitionComponent:Enn,PaperProps:{tabIndex:-1},children:[C.jsx(rPe,{sx:N9.appBar,children:C.jsxs(C4,{children:[C.jsx(Gt,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:C.jsx(GO,{})}),C.jsx(Jt,{variant:"h6",sx:N9.title,children:t})]})}),C.jsx(Nf,{sx:N9.dialog,children:C.jsx(Onn,{children:C.jsx(Cle,{text:e})})})]});function Ole(t){const[e,n]=D.useState();return D.useEffect(()=>{t?fetch(t).then(r=>r.text()).then(r=>n(r)).catch(r=>{console.error(r)}):n(void 0)},[t]),e}const Tnn=({open:t,onClose:e})=>{const n=Ole(pe.get("docs/dev-reference.en.md")),r=RIe(),i=D.useMemo(()=>{if(n){const o=knn(r),s=Ann();return n.replace("${extensions}",o).replace("${derivedState}",s)}},[n,r]);return C.jsx($We,{title:pe.get("Developer Reference"),text:i||"",open:t,onClose:e})};function knn(t){const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{const r=t[n];e.push(` +`,cbe="/",ube="*",rx="",fnn="comment",dnn="declaration",hnn=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 g=p.match(rnn);g&&(n+=g.length);var m=p.lastIndexOf(unn);r=~m?p.length-m:r+p.length}function o(){var p={line:n,column:r};return function(g){return g.position=new s(p),c(),g}}function s(p){this.start=p,this.end={line:n,column:r},this.source=e.source}s.prototype.content=t;function a(p){var g=new Error(e.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=e.source,g.line=n,g.column=r,g.source=t,!e.silent)throw g}function l(p){var g=p.exec(t);if(g){var m=g[0];return i(m),t=t.slice(m.length),g}}function c(){l(inn)}function u(p){var g;for(p=p||[];g=f();)g!==!1&&p.push(g);return p}function f(){var p=o();if(!(cbe!=t.charAt(0)||ube!=t.charAt(1))){for(var g=2;rx!=t.charAt(g)&&(ube!=t.charAt(g)||cbe!=t.charAt(g+1));)++g;if(g+=2,rx===t.charAt(g-1))return a("End of comment missing");var m=t.slice(2,g-2);return r+=2,i(m),t=t.slice(g),r+=2,p({type:fnn,comment:m})}}function d(){var p=o(),g=l(onn);if(g){if(f(),!l(snn))return a("property missing ':'");var m=l(ann),v=p({type:dnn,property:fbe(g[0].replace(lbe,rx)),value:m?fbe(m[0].replace(lbe,rx)):rx});return l(lnn),v}}function h(){var p=[];u(p);for(var g;g=d();)g!==!1&&(p.push(g),u(p));return p}return c(),h()};function fbe(t){return t?t.replace(cnn,rx):rx}var pnn=hnn;function DWe(t,e){var n=null;if(!t||typeof t!="string")return n;for(var r,i=pnn(t),o=typeof e=="function",s,a,l=0,c=i.length;l0?he.createElement(h,l,f):he.createElement(h,l)}function xnn(t){let e=-1;for(;++e for more info)`),delete gL[o]}const e=$Zt().use(Gen).use(t.remarkPlugins||[]).use(Ltn,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(Ytn,t),n=new J8e;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=he.createElement(he.Fragment,{},IWe({options:t,schema:qtn,listDepth:0},r));return t.className&&(i=he.createElement("div",{className:t.className},i)),i}LWe.propTypes={children:ge.string,className:ge.string,allowElement:ge.func,allowedElements:ge.arrayOf(ge.string),disallowedElements:ge.arrayOf(ge.string),unwrapDisallowed:ge.bool,remarkPlugins:ge.arrayOf(ge.oneOfType([ge.object,ge.func,ge.arrayOf(ge.oneOfType([ge.bool,ge.string,ge.object,ge.func,ge.arrayOf(ge.any)]))])),rehypePlugins:ge.arrayOf(ge.oneOfType([ge.object,ge.func,ge.arrayOf(ge.oneOfType([ge.bool,ge.string,ge.object,ge.func,ge.arrayOf(ge.any)]))])),sourcePos:ge.bool,rawSourcePos:ge.bool,skipHtml:ge.bool,includeElementIndex:ge.bool,transformLinkUri:ge.oneOfType([ge.func,ge.bool]),linkTarget:ge.oneOfType([ge.func,ge.string]),transformImageUri:ge.func,components:ge.object};function Cle({text:t}){const e=To(),n=D.useMemo(()=>({a:r=>{const{node:i,...o}=r;return C.jsx("a",{...o,style:{color:e.palette.mode==="dark"?"#90caf9":"#1e90ff"}})},code:r=>{const{node:i,...o}=r;return C.jsx("code",{...o,style:{color:"grey"}})}}),[e]);return t?C.jsx(LWe,{children:t,components:n,linkTarget:"_blank"}):null}const N9={dialog:t=>({backgroundColor:t.palette.mode==="dark"?t.palette.grey[800]:t.palette.grey[200]}),appBar:{position:"relative"},title:t=>({marginLeft:t.spacing(2),flex:1})},Onn=oa("div")(({theme:t})=>({marginTop:t.spacing(4),marginLeft:t.spacing(40),marginRight:t.spacing(40)})),Enn=he.forwardRef(function(e,n){return C.jsx(Jat,{direction:"up",ref:n,...e})}),$We=({title:t,text:e,open:n,onClose:r})=>C.jsxs(ed,{fullScreen:!0,open:n,onClose:r,TransitionComponent:Enn,PaperProps:{tabIndex:-1},children:[C.jsx(rPe,{sx:N9.appBar,children:C.jsxs(C4,{children:[C.jsx(Gt,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:C.jsx(VO,{})}),C.jsx(Jt,{variant:"h6",sx:N9.title,children:t})]})}),C.jsx(Nf,{sx:N9.dialog,children:C.jsx(Onn,{children:C.jsx(Cle,{text:e})})})]});function Ole(t){const[e,n]=D.useState();return D.useEffect(()=>{t?fetch(t).then(r=>r.text()).then(r=>n(r)).catch(r=>{console.error(r)}):n(void 0)},[t]),e}const Tnn=({open:t,onClose:e})=>{const n=Ole(pe.get("docs/dev-reference.en.md")),r=RIe(),i=D.useMemo(()=>{if(n){const o=knn(r),s=Ann();return n.replace("${extensions}",o).replace("${derivedState}",s)}},[n,r]);return C.jsx($We,{title:pe.get("Developer Reference"),text:i||"",open:t,onClose:e})};function knn(t){const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{const r=t[n];e.push(` Contribution point **\`${n}\`**: `),r.forEach(({name:i,extension:o})=>{e.push(`- \`${i}\` from extension \`${o}\``)})}),e.join(` `)}function Ann(){const t=[];return Object.getOwnPropertyNames(yQ).forEach(e=>{const n=yQ[e];t.push(`- \`${e}\`: **${n.type}** ${n.description}`)}),t.join(` -`)}const Pnn=({open:t,onClose:e})=>{const n=Ole(pe.get("docs/imprint.md"));return C.jsx($We,{title:pe.get("Imprint"),text:n??"",open:t,onClose:e})},hbe=lt(C.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"),Mnn=({userInfo:t})=>C.jsxs(oW,{container:!0,justifyContent:"center",spacing:1,children:[C.jsx(oW,{item:!0,children:C.jsx("img",{src:t.picture,width:84,alt:pe.get("User Profile")})}),C.jsx(oW,{item:!0,children:C.jsx(kl,{elevation:3,children:C.jsxs(RM,{children:[C.jsx($_,{children:C.jsx(fu,{primary:t.name,secondary:pe.get("User name")})}),C.jsx(zf,{light:!0}),C.jsx($_,{children:C.jsx(fu,{primary:`${t.email} (${t.email_verified?pe.get("verified"):pe.get("not verified")})`,secondary:pe.get("E-mail")})}),C.jsx(zf,{light:!0}),C.jsx($_,{children:C.jsx(fu,{primary:t.nickname,secondary:pe.get("Nickname")})})]})})})]}),v2={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:Px[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:Px[300]},signInProgress:{color:Px[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:{padding:0}},Rnn=oa("div")(({theme:t})=>({margin:t.spacing(1),position:"relative"})),Dnn=({updateAccessToken:t})=>{const e=Umt(),[n,r]=D.useState(null),[i,o]=D.useState(!1);D.useEffect(()=>{e.user&&e.user.access_token?t(e.user.access_token):t(null)},[e.user,t]);const s=()=>{c(),o(!0)},a=()=>{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=C.jsx(hbe,{});if(!d)h=C.jsx(nW,{sx:v2.letterAvatar,children:"?"});else if(d.picture)h=C.jsx(nW,{sx:v2.imageAvatar,src:d.picture,alt:d.name});else{const g=d.given_name||d.name||d.nickname,m=d.family_name;let v=null;g&&m?v=g[0]+m[0]:g?v=g[0]:m&&(v=m[0]),v!==null&&(p=v.toUpperCase()),h=C.jsx(nW,{sx:v2.letterAvatar,children:p})}return C.jsxs(D.Fragment,{children:[C.jsx(Gt,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:v2.iconButton,children:h}),C.jsxs(Ny,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[C.jsx(Br,{onClick:s,children:pe.get("Profile")}),C.jsx(Br,{onClick:f,children:pe.get("Log out")})]}),C.jsxs(ed,{open:i,keepMounted:!0,onClose:a,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[C.jsx($y,{id:"alert-dialog-slide-title",children:pe.get("User Profile")}),C.jsx(Nf,{children:C.jsx(Mnn,{userInfo:e.user.profile})}),C.jsx(Jb,{children:C.jsx(Hr,{onClick:a,children:"OK"})})]})]})}else{let d=C.jsx(Gt,{onClick:e.isLoading?void 0:u,size:"small",children:C.jsx(hbe,{})});return e.isLoading&&(d=C.jsxs(Rnn,{children:[d,C.jsx(Ly,{size:24,sx:v2.signInProgress})]})),d}},Inn=t=>Pn.instance.authClient?C.jsx(Dnn,{...t}):null,Lnn=Inn,FWe="UPDATE_ACCESS_TOKEN";function $nn(t){return(e,n)=>{const r=n().userAuthState.accessToken;r!==t&&(e(Fnn(t)),(t===null||r===null)&&e(UUe()))}}function Fnn(t){return{type:FWe,accessToken:t}}const Nnn=t=>({}),znn={updateAccessToken:$nn},jnn=Rn(Nnn,znn)(Lnn),Bnn=t=>({locale:t.controlState.locale,appName:Pn.instance.branding.appBarTitle,allowRefresh:Pn.instance.branding.allowRefresh,allowSharing:Pn.instance.branding.allowRefresh}),Unn={openDialog:T1,updateResources:BUe,shareStatePermalink:jUe},Wnn={appBar:t=>({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})})},Vnn=be("a")(()=>({display:"flex",alignItems:"center"})),Gnn=be("img")(({theme:t})=>({marginLeft:t.spacing(1)})),ym={toolbar:t=>({backgroundColor:Pn.instance.branding.headerBackgroundColor,paddingRight:t.spacing(1)}),logo:t=>({marginLeft:t.spacing(1)}),title:t=>({flexGrow:1,marginLeft:t.spacing(1),...Pn.instance.branding.headerTitleStyle}),imageAvatar:{width:24,height:24,color:"#fff",backgroundColor:Px[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:Px[300]},signInProgress:{color:Px[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:t=>({marginLeft:t.spacing(2),...Pn.instance.branding.headerIconStyle})},Hnn=({appName:t,openDialog:e,allowRefresh:n,updateResources:r,allowSharing:i,shareStatePermalink:o})=>{const[s,a]=D.useState(!1),[l,c]=D.useState(!1),[u,f]=D.useState(!1),d=D.useRef(null),h=()=>{e("settings")},p=()=>{c(!0)},g=()=>{c(!1)},m=()=>{c(!1),window.open("https://xcube-dev.github.io/xcube-viewer/","Manual")},v=()=>{f(!0)},y=()=>{f(!1)},x=()=>{a(!0)},b=()=>{a(!1)};return C.jsxs(rPe,{position:"absolute",sx:Wnn.appBar,elevation:0,children:[C.jsxs(C4,{disableGutters:!0,sx:ym.toolbar,variant:"dense",children:[C.jsx(Vnn,{href:Pn.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:C.jsx(Gnn,{src:Pn.instance.branding.logoImage,width:Pn.instance.branding.logoWidth,alt:"xcube logo"})}),C.jsx(Jt,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:ym.title,children:t}),C.jsx(jnn,{}),n&&C.jsx(Mt,{arrow:!0,title:pe.get("Refresh"),children:C.jsx(Gt,{onClick:r,size:"small",sx:ym.iconButton,children:C.jsx(rRe,{})})}),i&&C.jsx(Mt,{arrow:!0,title:pe.get("Share"),children:C.jsx(Gt,{onClick:o,size:"small",sx:ym.iconButton,children:C.jsx(iRe,{})})}),Pn.instance.branding.allowDownloads&&C.jsx(Mt,{arrow:!0,title:pe.get("Export data"),children:C.jsx(Gt,{onClick:()=>e("export"),size:"small",sx:ym.iconButton,children:C.jsx(oRe,{})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Help"),children:C.jsx(Gt,{onClick:p,size:"small",sx:ym.iconButton,ref:d,children:C.jsx(tRe,{})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Imprint"),children:C.jsx(Gt,{onClick:x,size:"small",sx:ym.iconButton,children:C.jsx(Vmt,{})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Settings"),children:C.jsx(Gt,{onClick:h,size:"small",sx:ym.iconButton,children:C.jsx(nRe,{})})})]}),C.jsx(Pnn,{open:s,onClose:b}),C.jsx(Tnn,{open:u,onClose:y}),C.jsxs(Ny,{anchorEl:d.current,open:l,onClose:g,children:[C.jsx(Br,{onClick:m,children:"Documentation"}),C.jsx(Br,{onClick:v,children:"Developer Reference"})]})]})},qnn=Rn(Bnn,Unn)(Hnn),Xnn=oa("form")(({theme:t})=>({display:"flex",flexWrap:"wrap",paddingTop:t.spacing(1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),flexGrow:0}));function Ynn({children:t}){return C.jsx(Xnn,{autoComplete:"off",children:t})}const NWe=lt(C.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"),au=({sx:t,className:e,disabled:n,onClick:r,icon:i,tooltipText:o,toggle:s,value:a,selected:l})=>{const c=f=>{s?r(f,a):r(f)},u=o?C.jsx(Mt,{arrow:!0,title:o,children:i}):i;return s?C.jsx(xr,{sx:{padding:.3,...t},className:e,disabled:n,size:"small",onClick:c,value:a||"",selected:l,children:u}):C.jsx(Gt,{sx:t,className:e,disabled:n,size:"small",onClick:c,children:u})},Qnn=oa(td)(({theme:t})=>({marginRight:t.spacing(1)}));function tP({label:t,control:e,actions:n}){return C.jsx(Qnn,{variant:"standard",children:C.jsxs(ot,{children:[t,e,n]})})}function Knn({selectedDatasetId:t,datasets:e,selectDataset:n,locateSelectedDataset:r}){const i=D.useMemo(()=>e.sort((d,h)=>{const p=d.groupTitle||"zzz",g=h.groupTitle||"zzz",m=p.localeCompare(g);return m!==0?m:d.title.localeCompare(h.title)}),[e]),o=i.length>0&&!!i[0].groupTitle,s=d=>{const h=d.target.value||null;n(h,e,!0)};t=t||"",e=e||[];const a=C.jsx(Fy,{shrink:!0,htmlFor:"dataset-select",children:pe.get("Dataset")}),l=[];let c;i.forEach(d=>{if(o){const h=d.groupTitle||pe.get("Others");h!==c&&l.push(C.jsx(zf,{children:C.jsx(Jt,{fontSize:"small",color:"text.secondary",children:h})},h)),c=h}l.push(C.jsx(Br,{value:d.id,selected:d.id===t,children:d.title},d.id))});const u=C.jsx(Hg,{variant:"standard",value:t,onChange:s,input:C.jsx(Dg,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",children:l}),f=C.jsx(au,{onClick:r,tooltipText:pe.get("Locate dataset in map"),icon:C.jsx(NWe,{})});return C.jsx(tP,{label:a,control:u,actions:f})}const Znn=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,datasets:t.dataState.datasets}),Jnn={selectDataset:c8e,locateSelectedDataset:KKt},ern=Rn(Znn,Jnn)(Knn),PQ=lt(C.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"),zWe=lt(C.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),MQ=lt(C.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"),trn=lt(C.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"),il={toggleButton:{padding:.3}},Q5="userVariablesDialog";function nrn(){return{id:Uf("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function rrn(t){return{...t,id:Uf("user"),name:`${t.name}_copy`,title:t.title?`${t.title} Copy`:""}}const irn={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},jWe=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],orn={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function srn({selectedDatasetId:t,selectedVariableName:e,selectedDataset2Id:n,selectedVariable2Name:r,variables:i,userVariablesAllowed:o,canAddTimeSeries:s,addTimeSeries:a,canAddStatistics:l,addStatistics:c,selectVariable:u,selectVariable2:f,openDialog:d}){const h=O=>{u(O.target.value||null)},p=()=>{d(Q5)},g=()=>{a()},m=()=>{c()},v=t===n&&e===r,y=C.jsx(Fy,{shrink:!0,htmlFor:"variable-select",children:pe.get("Variable")}),x=C.jsx(Hg,{variant:"standard",value:e||"",onChange:h,input:C.jsx(Dg,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>pbe(i.find(O=>O.name===e)),children:(i||[]).map(O=>C.jsxs(Br,{value:O.name,selected:O.name===e,children:[jM(O)&&C.jsx(kPe,{children:C.jsx(PQ,{fontSize:"small"})}),C.jsx(fu,{children:pbe(O)}),t===n&&O.name===r&&C.jsx(MQ,{fontSize:"small",color:"secondary"})]},O.name))}),b=o&&C.jsx(au,{onClick:p,tooltipText:pe.get("Create and manage user variables"),icon:C.jsx(PQ,{})},"userVariables"),w=C.jsx(au,{disabled:!s,onClick:g,tooltipText:pe.get("Show time-series diagram"),icon:C.jsx(trn,{})},"timeSeries"),_=C.jsx(au,{disabled:!l,onClick:m,tooltipText:pe.get("Add statistics"),icon:C.jsx(zWe,{})},"statistics"),S=C.jsx(xr,{selected:v,value:"comparison",size:"small",sx:{...il.toggleButton,marginLeft:.4},onClick:()=>f(t,e),children:C.jsx(Mt,{arrow:!0,title:pe.get("Make it 2nd variable for comparison"),children:C.jsx(MQ,{fontSize:"small"})})},"variable2");return C.jsx(tP,{label:y,control:x,actions:[S,b,w,_]})}function pbe(t){return t?t.title||t.name:"?"}const arn=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,selectedVariableName:t.controlState.selectedVariableName,selectedDataset2Id:t.controlState.selectedDataset2Id,selectedVariable2Name:t.controlState.selectedVariable2Name,userVariablesAllowed:F_t(),canAddTimeSeries:nIe(t),canAddStatistics:rIe(t),variables:H_t(t)}),lrn={openDialog:T1,selectVariable:x8e,selectVariable2:lZt,addTimeSeries:iU,addStatistics:XUe},crn=Rn(arn,lrn)(srn),XO=lt(C.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.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),xU=lt(C.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"),BWe=({itemValue:t,setItemValue:e,validateItemValue:n,editMode:r,setEditMode:i,labelText:o,select:s,actions:a})=>{const l=D.useRef(null),[c,u]=D.useState("");D.useEffect(()=>{r&&u(t)},[r,t,u]),D.useEffect(()=>{if(r){const p=l.current;p!==null&&(p.focus(),p.select())}},[r]);const f=C.jsx(Fy,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return C.jsx(tP,{label:f,control:s,actions:a});const d=n?n(c):!0,h=C.jsx(Dg,{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 C.jsx(tP,{label:f,control:h})},urn={select:{minWidth:"5em"}};function frn({placeGroups:t,selectPlaceGroups:e,renameUserPlaceGroup:n,removeUserPlaceGroup:r,selectedPlaceGroupIds:i,selectedPlaceGroupsTitle:o}){const[s,a]=D.useState(!1);if(t=t||[],i=i||[],t.length===0)return null;const l=i.length===1?i[0]:null,c=g=>{n(l,g)},u=g=>{e(g.target.value||null)},f=()=>o,d=C.jsx(Hg,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:C.jsx(Dg,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:urn.select,children:t.map(g=>C.jsxs(Br,{value:g.id,children:[C.jsx(FF,{checked:i.indexOf(g.id)>-1}),C.jsx(fu,{primary:g.title})]},g.id))});let h=!1;l!==null&&l.startsWith(oO)&&(h=!!t.find(g=>g.id===l&&g.features&&g.features.length>=0));let p;if(h){const g=()=>{a(!0)},m=()=>{r(l)};p=[C.jsx(au,{onClick:g,tooltipText:pe.get("Rename place group"),icon:C.jsx(XO,{})},"editPlaceGroup"),C.jsx(au,{onClick:m,tooltipText:pe.get("Remove places"),icon:C.jsx(xU,{})},"removePlaceGroup")]}return C.jsx(BWe,{itemValue:o,setItemValue:c,validateItemValue:g=>g.trim().length>0,editMode:s,setEditMode:a,labelText:pe.get("Places"),select:d,actions:p})}const drn=t=>({locale:t.controlState.locale,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,placeGroups:G4(t),selectedPlaceGroupsTitle:iSt(t)}),hrn={selectPlaceGroups:tZt,renameUserPlaceGroup:CKt,removeUserPlaceGroup:PKt},prn=Rn(drn,hrn)(frn),grn=lt(C.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"),k0={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"}},mrn=({anchorEl:t,setAnchorEl:e,isPoint:n,placeStyle:r,updatePlaceStyle:i})=>{const[o,s]=D.useState(null);function a(l){s(l.currentTarget)}return C.jsxs(C.Fragment,{children:[C.jsx(e1,{open:t!==null,anchorEl:t,onClose:()=>e(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:C.jsxs(ot,{sx:k0.container,children:[C.jsx(Jt,{sx:k0.colorLabel,children:pe.get("Color")}),C.jsx(Jt,{sx:k0.opacityLabel,color:n?"text.secondary":"text.primary",children:pe.get("Opacity")}),C.jsx(ot,{sx:k0.colorValue,style:{backgroundColor:r.color},onClick:a}),C.jsx(t1,{sx:k0.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),C.jsx(Ny,{open:!!o,anchorEl:o,onClose:()=>s(null),children:tte.map(([l,c])=>C.jsx(Br,{selected:r.color===l,sx:k0.colorMenuItem,onClick:()=>i({...r,color:l}),children:C.jsx(Mt,{title:l,children:C.jsx(ot,{sx:{...k0.colorMenuItemBox,backgroundColor:l}})})},l))})]})},vrn={select:{minWidth:"5em"}};function yrn({selectPlace:t,placeLabels:e,selectedPlaceId:n,selectedPlaceGroupIds:r,selectedPlaceInfo:i,renameUserPlace:o,restyleUserPlace:s,removeUserPlace:a,places:l,locateSelectedPlace:c}){const[u,f]=D.useState(!1),[d,h]=D.useState(null);l=l||[],e=e||[],n=n||"",r=r||[];const p=r.length===1?r[0]:null,g=l.findIndex(S=>S.id===n),m=g>=0?e[g]:"",v=S=>{o(p,n,S)},y=S=>{s(p,n,S)},x=S=>{t(S.target.value||null,l,!0)},b=C.jsx(Hg,{variant:"standard",value:n,onChange:x,input:C.jsx(Dg,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:vrn.select,disabled:l.length===0,children:l.map((S,O)=>C.jsx(Br,{value:S.id,selected:S.id===n,children:e[O]},S.id))}),w=p!==null&&p.startsWith(oO)&&n!=="";let _=[C.jsx(au,{onClick:c,tooltipText:pe.get("Locate place in map"),icon:C.jsx(NWe,{})},"locatePlace")];if(!u&&w){const S=()=>{f(!0)},O=E=>{h(E.currentTarget)},k=()=>{a(p,n,l)};_=[C.jsx(au,{onClick:S,tooltipText:pe.get("Rename place"),icon:C.jsx(XO,{})},"editButton"),C.jsx(au,{onClick:O,tooltipText:pe.get("Style place"),icon:C.jsx(grn,{})},"styleButton"),C.jsx(au,{onClick:k,tooltipText:pe.get("Remove place"),icon:C.jsx(xU,{})},"removeButton")].concat(_)}return C.jsxs(C.Fragment,{children:[C.jsx(BWe,{itemValue:m,setItemValue:v,validateItemValue:S=>S.trim().length>0,editMode:u,setEditMode:f,labelText:pe.get("Place"),select:b,actions:_}),i&&C.jsx(mrn,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const xrn=t=>({locale:t.controlState.locale,datasets:t.dataState.datasets,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,selectedPlaceId:t.controlState.selectedPlaceId,selectedPlaceInfo:ZM(t),places:KM(t),placeLabels:cSt(t)}),brn={selectPlace:oU,renameUserPlace:OKt,restyleUserPlace:TKt,removeUserPlace:AKt,locateSelectedPlace:ZKt,openDialog:T1},wrn=Rn(xrn,brn)(yrn),_rn=lt(C.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"),Srn=lt(C.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"),Crn=lt([C.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),C.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),C.jsx("path",{d:"M3 13.5h8v8H3z"},"2")],"Category"),Orn=lt(C.jsx("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord"),Ern=lt(C.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"),Trn=oa(td)(({theme:t})=>({marginTop:t.spacing(2),marginLeft:t.spacing(1),marginRight:t.spacing(2)}));function krn({mapInteraction:t,setMapInteraction:e}){function n(r,i){e(i!==null?i:"Select")}return C.jsx(Trn,{variant:"standard",children:C.jsxs(tO,{size:"small",value:t,exclusive:!0,onChange:n,children:[C.jsx(xr,{value:"Select",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Select a place in map"),children:C.jsx(Srn,{})})},0),C.jsx(xr,{value:"Point",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Add a point location in map"),children:C.jsx(_rn,{})})},1),C.jsx(xr,{value:"Polygon",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Draw a polygon area in map"),children:C.jsx(Crn,{})})},2),C.jsx(xr,{value:"Circle",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Draw a circular area in map"),children:C.jsx(Orn,{})})},3),C.jsx(xr,{value:"Geometry",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Import places"),children:C.jsx(Ern,{})})},4)]})})}const Arn=t=>({mapInteraction:t.controlState.mapInteraction}),Prn={setMapInteraction:E8e},Mrn=Rn(Arn,Prn)(krn);var gbe=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},eD=(typeof window>"u"?"undefined":gbe(window))==="object"&&(typeof document>"u"?"undefined":gbe(document))==="object"&&document.nodeType===9,Rrn={}.constructor;function RQ(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(RQ);if(t.constructor!==Rrn)return t;var e={};for(var n in t)e[n]=RQ(t[n]);return e}function Ele(t,e,n){t===void 0&&(t="unnamed");var r=n.jss,i=RQ(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var mbe=function(e,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,vbe=typeof CSS<"u"&&CSS.escape,Tle=function(t){return vbe?vbe(t):t.replace(Drn,"\\$1")},UWe=function(){function t(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,s=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:s&&(this.renderer=new s)}var e=t.prototype;return e.prop=function(r,i,o){if(i===void 0)return this.style[r];var s=o?o.force:!1;if(!s&&this.style[r]===i)return this;var a=i;(!o||o.process!==!1)&&(a=this.options.jss.plugins.onChangeValue(i,r,this));var l=a==null||a===!1,c=r in this.style;if(l&&!c&&!s)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=a,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,a),this;var f=this.options.sheet;return f&&f.attached,this},t}(),DQ=function(t){kM(e,t);function e(r,i,o){var s;s=t.call(this,r,i,o)||this;var a=o.selector,l=o.scoped,c=o.sheet,u=o.generateId;return a?s.selectorText=a:l!==!1&&(s.id=u(bt(bt(s)),c),s.selectorText="."+Tle(s.id)),s}var n=e.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var s=this.toJSON();for(var a in s)o.setProperty(i,a,s[a])}return this},n.toJSON=function(){var i={};for(var o in this.style){var s=this.style[o];typeof s!="object"?i[o]=s:Array.isArray(s)&&(i[o]=Xx(s))}return i},n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?ve({},i,{allowEmpty:!0}):i;return nP(this.selectorText,this.style,a)},An(e,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,s=this.renderable;if(!(!s||!o)){var a=o.setSelector(s,i);a||o.replaceRule(s,this)}}},get:function(){return this.selectorText}}]),e}(UWe),Irn={onCreateRule:function(e,n,r){return e[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new DQ(e,n,r)}},z9={indent:1,children:!0},Lrn=/@([\w-]+)/,$rn=function(){function t(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(Lrn);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new bU(ve({},i,{parent:this}));for(var s in r)this.rules.add(s,r[s]);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 s=this.rules.add(r,i,o);return s?(this.options.jss.plugins.onProcessRule(s),s):null},e.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.toString=function(r){r===void 0&&(r=z9);var i=YO(r),o=i.linebreak;if(r.indent==null&&(r.indent=z9.indent),r.children==null&&(r.children=z9.children),r.children===!1)return this.query+" {}";var s=this.rules.toString(r);return s?this.query+" {"+o+s+o+"}":""},t}(),Frn=/@container|@media|@supports\s+/,Nrn={onCreateRule:function(e,n,r){return Frn.test(e)?new $rn(e,n,r):null}},j9={indent:1,children:!0},zrn=/@keyframes\s+([\w-]+)/,IQ=function(){function t(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(zrn);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var s=i.scoped,a=i.sheet,l=i.generateId;this.id=s===!1?this.name:Tle(l(this,a)),this.rules=new bU(ve({},i,{parent:this}));for(var c in r)this.rules.add(c,r[c],ve({},i,{parent:this}));this.rules.process()}var e=t.prototype;return e.toString=function(r){r===void 0&&(r=j9);var i=YO(r),o=i.linebreak;if(r.indent==null&&(r.indent=j9.indent),r.children==null&&(r.children=j9.children),r.children===!1)return this.at+" "+this.id+" {}";var s=this.rules.toString(r);return s&&(s=""+o+s+o),this.at+" "+this.id+" {"+s+"}"},t}(),jrn=/@keyframes\s+/,Brn=/\$([\w-]+)/g,LQ=function(e,n){return typeof e=="string"?e.replace(Brn,function(r,i){return i in n?n[i]:r}):e},ybe=function(e,n,r){var i=e[n],o=LQ(i,r);o!==i&&(e[n]=o)},Urn={onCreateRule:function(e,n,r){return typeof e=="string"&&jrn.test(e)?new IQ(e,n,r):null},onProcessStyle:function(e,n,r){return n.type!=="style"||!r||("animation-name"in e&&ybe(e,"animation-name",r.keyframes),"animation"in e&&ybe(e,"animation",r.keyframes)),e},onChangeValue:function(e,n,r){var i=r.options.sheet;if(!i)return e;switch(n){case"animation":return LQ(e,i.keyframes);case"animation-name":return LQ(e,i.keyframes);default:return e}}},Wrn=function(t){kM(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?ve({},i,{allowEmpty:!0}):i;return nP(this.key,this.style,a)},e}(UWe),Vrn={onCreateRule:function(e,n,r){return r.parent&&r.parent.type==="keyframes"?new Wrn(e,n,r):null}},Grn=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=YO(r),o=i.linebreak;if(Array.isArray(this.style)){for(var s="",a=0;a=this.index){i.push(r);return}for(var s=0;so){i.splice(s,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,s=Dt(i,["attached"]),a=YO(s),l=a.linebreak,c="",u=0;u-1?i.substr(0,o-1):i;e.style.setProperty(n,s,o>-1?"important":"")}}catch{return!1}return!0},iin=function(e,n){try{e.attributeStyleMap?e.attributeStyleMap.delete(n):e.style.removeProperty(n)}catch{}},oin=function(e,n){return e.selectorText=n,e.selectorText===n},GWe=VWe(function(){return document.querySelector("head")});function sin(t,e){for(var n=0;ne.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}function ain(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 lin(t){for(var e=GWe(),n=0;n0){var n=sin(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=ain(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=lin(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function uin(t,e){var n=e.insertionPoint,r=cin(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}GWe().appendChild(t)}var fin=VWe(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),Sbe=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]},Cbe=function(e,n){var r=e.cssRules.length;return n===void 0||n>r?r:n},din=function(){var e=document.createElement("style");return e.textContent=` -`,e},hin=function(){function t(n){this.getPropertyValue=nin,this.setProperty=rin,this.removeProperty=iin,this.setSelector=oin,this.hasInsertedRules=!1,this.cssRules=[],n&&wk.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,s=r.element;this.element=s||din(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var a=fin();a&&this.element.setAttribute("nonce",a)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){uin(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=` +`)}const Pnn=({open:t,onClose:e})=>{const n=Ole(pe.get("docs/imprint.md"));return C.jsx($We,{title:pe.get("Imprint"),text:n??"",open:t,onClose:e})},hbe=lt(C.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"),Mnn=({userInfo:t})=>C.jsxs(oW,{container:!0,justifyContent:"center",spacing:1,children:[C.jsx(oW,{item:!0,children:C.jsx("img",{src:t.picture,width:84,alt:pe.get("User Profile")})}),C.jsx(oW,{item:!0,children:C.jsx(kl,{elevation:3,children:C.jsxs(MM,{children:[C.jsx($_,{children:C.jsx(fu,{primary:t.name,secondary:pe.get("User name")})}),C.jsx(zf,{light:!0}),C.jsx($_,{children:C.jsx(fu,{primary:`${t.email} (${t.email_verified?pe.get("verified"):pe.get("not verified")})`,secondary:pe.get("E-mail")})}),C.jsx(zf,{light:!0}),C.jsx($_,{children:C.jsx(fu,{primary:t.nickname,secondary:pe.get("Nickname")})})]})})})]}),m2={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:Px[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:Px[300]},signInProgress:{color:Px[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:{padding:0}},Rnn=oa("div")(({theme:t})=>({margin:t.spacing(1),position:"relative"})),Dnn=({updateAccessToken:t})=>{const e=Umt(),[n,r]=D.useState(null),[i,o]=D.useState(!1);D.useEffect(()=>{e.user&&e.user.access_token?t(e.user.access_token):t(null)},[e.user,t]);const s=()=>{c(),o(!0)},a=()=>{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=C.jsx(hbe,{});if(!d)h=C.jsx(nW,{sx:m2.letterAvatar,children:"?"});else if(d.picture)h=C.jsx(nW,{sx:m2.imageAvatar,src:d.picture,alt:d.name});else{const g=d.given_name||d.name||d.nickname,m=d.family_name;let v=null;g&&m?v=g[0]+m[0]:g?v=g[0]:m&&(v=m[0]),v!==null&&(p=v.toUpperCase()),h=C.jsx(nW,{sx:m2.letterAvatar,children:p})}return C.jsxs(D.Fragment,{children:[C.jsx(Gt,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:m2.iconButton,children:h}),C.jsxs(Ny,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[C.jsx(Br,{onClick:s,children:pe.get("Profile")}),C.jsx(Br,{onClick:f,children:pe.get("Log out")})]}),C.jsxs(ed,{open:i,keepMounted:!0,onClose:a,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[C.jsx($y,{id:"alert-dialog-slide-title",children:pe.get("User Profile")}),C.jsx(Nf,{children:C.jsx(Mnn,{userInfo:e.user.profile})}),C.jsx(Jb,{children:C.jsx(Hr,{onClick:a,children:"OK"})})]})]})}else{let d=C.jsx(Gt,{onClick:e.isLoading?void 0:u,size:"small",children:C.jsx(hbe,{})});return e.isLoading&&(d=C.jsxs(Rnn,{children:[d,C.jsx(Ly,{size:24,sx:m2.signInProgress})]})),d}},Inn=t=>Pn.instance.authClient?C.jsx(Dnn,{...t}):null,Lnn=Inn,FWe="UPDATE_ACCESS_TOKEN";function $nn(t){return(e,n)=>{const r=n().userAuthState.accessToken;r!==t&&(e(Fnn(t)),(t===null||r===null)&&e(UUe()))}}function Fnn(t){return{type:FWe,accessToken:t}}const Nnn=t=>({}),znn={updateAccessToken:$nn},jnn=Rn(Nnn,znn)(Lnn),Bnn=t=>({locale:t.controlState.locale,appName:Pn.instance.branding.appBarTitle,allowRefresh:Pn.instance.branding.allowRefresh,allowSharing:Pn.instance.branding.allowSharing}),Unn={openDialog:T1,updateResources:BUe,shareStatePermalink:jUe},Wnn={appBar:t=>({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})})},Vnn=be("a")(()=>({display:"flex",alignItems:"center"})),Gnn=be("img")(({theme:t})=>({marginLeft:t.spacing(1)})),ym={toolbar:t=>({backgroundColor:Pn.instance.branding.headerBackgroundColor,paddingRight:t.spacing(1)}),logo:t=>({marginLeft:t.spacing(1)}),title:t=>({flexGrow:1,marginLeft:t.spacing(1),...Pn.instance.branding.headerTitleStyle}),imageAvatar:{width:24,height:24,color:"#fff",backgroundColor:Px[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:Px[300]},signInProgress:{color:Px[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:t=>({marginLeft:t.spacing(2),...Pn.instance.branding.headerIconStyle})},Hnn=({appName:t,openDialog:e,allowRefresh:n,updateResources:r,allowSharing:i,shareStatePermalink:o})=>{const[s,a]=D.useState(!1),[l,c]=D.useState(!1),[u,f]=D.useState(!1),d=D.useRef(null),h=()=>{e("settings")},p=()=>{c(!0)},g=()=>{c(!1)},m=()=>{c(!1),window.open("https://xcube-dev.github.io/xcube-viewer/","Manual")},v=()=>{f(!0)},y=()=>{f(!1)},x=()=>{a(!0)},b=()=>{a(!1)};return C.jsxs(rPe,{position:"absolute",sx:Wnn.appBar,elevation:0,children:[C.jsxs(C4,{disableGutters:!0,sx:ym.toolbar,variant:"dense",children:[C.jsx(Vnn,{href:Pn.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:C.jsx(Gnn,{src:Pn.instance.branding.logoImage,width:Pn.instance.branding.logoWidth,alt:"xcube logo"})}),C.jsx(Jt,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:ym.title,children:t}),C.jsx(jnn,{}),n&&C.jsx(Mt,{arrow:!0,title:pe.get("Refresh"),children:C.jsx(Gt,{onClick:r,size:"small",sx:ym.iconButton,children:C.jsx(rRe,{})})}),i&&C.jsx(Mt,{arrow:!0,title:pe.get("Share"),children:C.jsx(Gt,{onClick:o,size:"small",sx:ym.iconButton,children:C.jsx(iRe,{})})}),Pn.instance.branding.allowDownloads&&C.jsx(Mt,{arrow:!0,title:pe.get("Export data"),children:C.jsx(Gt,{onClick:()=>e("export"),size:"small",sx:ym.iconButton,children:C.jsx(oRe,{})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Help"),children:C.jsx(Gt,{onClick:p,size:"small",sx:ym.iconButton,ref:d,children:C.jsx(tRe,{})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Imprint"),children:C.jsx(Gt,{onClick:x,size:"small",sx:ym.iconButton,children:C.jsx(Vmt,{})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Settings"),children:C.jsx(Gt,{onClick:h,size:"small",sx:ym.iconButton,children:C.jsx(nRe,{})})})]}),C.jsx(Pnn,{open:s,onClose:b}),C.jsx(Tnn,{open:u,onClose:y}),C.jsxs(Ny,{anchorEl:d.current,open:l,onClose:g,children:[C.jsx(Br,{onClick:m,children:"Documentation"}),C.jsx(Br,{onClick:v,children:"Developer Reference"})]})]})},qnn=Rn(Bnn,Unn)(Hnn),Xnn=oa("form")(({theme:t})=>({display:"flex",flexWrap:"wrap",paddingTop:t.spacing(1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),flexGrow:0}));function Ynn({children:t}){return C.jsx(Xnn,{autoComplete:"off",children:t})}const NWe=lt(C.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"),au=({sx:t,className:e,disabled:n,onClick:r,icon:i,tooltipText:o,toggle:s,value:a,selected:l})=>{const c=f=>{s?r(f,a):r(f)},u=o?C.jsx(Mt,{arrow:!0,title:o,children:i}):i;return s?C.jsx(xr,{sx:{padding:.3,...t},className:e,disabled:n,size:"small",onClick:c,value:a||"",selected:l,children:u}):C.jsx(Gt,{sx:t,className:e,disabled:n,size:"small",onClick:c,children:u})},Qnn=oa(td)(({theme:t})=>({marginRight:t.spacing(1)}));function eP({label:t,control:e,actions:n}){return C.jsx(Qnn,{variant:"standard",children:C.jsxs(ot,{children:[t,e,n]})})}function Knn({selectedDatasetId:t,datasets:e,selectDataset:n,locateSelectedDataset:r}){const i=D.useMemo(()=>e.sort((d,h)=>{const p=d.groupTitle||"zzz",g=h.groupTitle||"zzz",m=p.localeCompare(g);return m!==0?m:d.title.localeCompare(h.title)}),[e]),o=i.length>0&&!!i[0].groupTitle,s=d=>{const h=d.target.value||null;n(h,e,!0)};t=t||"",e=e||[];const a=C.jsx(Fy,{shrink:!0,htmlFor:"dataset-select",children:pe.get("Dataset")}),l=[];let c;i.forEach(d=>{if(o){const h=d.groupTitle||pe.get("Others");h!==c&&l.push(C.jsx(zf,{children:C.jsx(Jt,{fontSize:"small",color:"text.secondary",children:h})},h)),c=h}l.push(C.jsx(Br,{value:d.id,selected:d.id===t,children:d.title},d.id))});const u=C.jsx(Hg,{variant:"standard",value:t,onChange:s,input:C.jsx(Dg,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",children:l}),f=C.jsx(au,{onClick:r,tooltipText:pe.get("Locate dataset in map"),icon:C.jsx(NWe,{})});return C.jsx(eP,{label:a,control:u,actions:f})}const Znn=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,datasets:t.dataState.datasets}),Jnn={selectDataset:c8e,locateSelectedDataset:KKt},ern=Rn(Znn,Jnn)(Knn),PQ=lt(C.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"),zWe=lt(C.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),MQ=lt(C.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"),trn=lt(C.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"),il={toggleButton:{padding:.3}},Q5="userVariablesDialog";function nrn(){return{id:Uf("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function rrn(t){return{...t,id:Uf("user"),name:`${t.name}_copy`,title:t.title?`${t.title} Copy`:""}}const irn={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},jWe=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],orn={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function srn({selectedDatasetId:t,selectedVariableName:e,selectedDataset2Id:n,selectedVariable2Name:r,variables:i,userVariablesAllowed:o,canAddTimeSeries:s,addTimeSeries:a,canAddStatistics:l,addStatistics:c,selectVariable:u,selectVariable2:f,openDialog:d}){const h=O=>{u(O.target.value||null)},p=()=>{d(Q5)},g=()=>{a()},m=()=>{c()},v=t===n&&e===r,y=C.jsx(Fy,{shrink:!0,htmlFor:"variable-select",children:pe.get("Variable")}),x=C.jsx(Hg,{variant:"standard",value:e||"",onChange:h,input:C.jsx(Dg,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>pbe(i.find(O=>O.name===e)),children:(i||[]).map(O=>C.jsxs(Br,{value:O.name,selected:O.name===e,children:[jM(O)&&C.jsx(kPe,{children:C.jsx(PQ,{fontSize:"small"})}),C.jsx(fu,{children:pbe(O)}),t===n&&O.name===r&&C.jsx(MQ,{fontSize:"small",color:"secondary"})]},O.name))}),b=o&&C.jsx(au,{onClick:p,tooltipText:pe.get("Create and manage user variables"),icon:C.jsx(PQ,{})},"userVariables"),w=C.jsx(au,{disabled:!s,onClick:g,tooltipText:pe.get("Show time-series diagram"),icon:C.jsx(trn,{})},"timeSeries"),_=C.jsx(au,{disabled:!l,onClick:m,tooltipText:pe.get("Add statistics"),icon:C.jsx(zWe,{})},"statistics"),S=C.jsx(xr,{selected:v,value:"comparison",size:"small",sx:{...il.toggleButton,marginLeft:.4},onClick:()=>f(t,e),children:C.jsx(Mt,{arrow:!0,title:pe.get("Make it 2nd variable for comparison"),children:C.jsx(MQ,{fontSize:"small"})})},"variable2");return C.jsx(eP,{label:y,control:x,actions:[S,b,w,_]})}function pbe(t){return t?t.title||t.name:"?"}const arn=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,selectedVariableName:t.controlState.selectedVariableName,selectedDataset2Id:t.controlState.selectedDataset2Id,selectedVariable2Name:t.controlState.selectedVariable2Name,userVariablesAllowed:F_t(),canAddTimeSeries:nIe(t),canAddStatistics:rIe(t),variables:H_t(t)}),lrn={openDialog:T1,selectVariable:x8e,selectVariable2:lZt,addTimeSeries:iU,addStatistics:XUe},crn=Rn(arn,lrn)(srn),qO=lt(C.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.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),xU=lt(C.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"),BWe=({itemValue:t,setItemValue:e,validateItemValue:n,editMode:r,setEditMode:i,labelText:o,select:s,actions:a})=>{const l=D.useRef(null),[c,u]=D.useState("");D.useEffect(()=>{r&&u(t)},[r,t,u]),D.useEffect(()=>{if(r){const p=l.current;p!==null&&(p.focus(),p.select())}},[r]);const f=C.jsx(Fy,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return C.jsx(eP,{label:f,control:s,actions:a});const d=n?n(c):!0,h=C.jsx(Dg,{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 C.jsx(eP,{label:f,control:h})},urn={select:{minWidth:"5em"}};function frn({placeGroups:t,selectPlaceGroups:e,renameUserPlaceGroup:n,removeUserPlaceGroup:r,selectedPlaceGroupIds:i,selectedPlaceGroupsTitle:o}){const[s,a]=D.useState(!1);if(t=t||[],i=i||[],t.length===0)return null;const l=i.length===1?i[0]:null,c=g=>{n(l,g)},u=g=>{e(g.target.value||null)},f=()=>o,d=C.jsx(Hg,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:C.jsx(Dg,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:urn.select,children:t.map(g=>C.jsxs(Br,{value:g.id,children:[C.jsx(FF,{checked:i.indexOf(g.id)>-1}),C.jsx(fu,{primary:g.title})]},g.id))});let h=!1;l!==null&&l.startsWith(iO)&&(h=!!t.find(g=>g.id===l&&g.features&&g.features.length>=0));let p;if(h){const g=()=>{a(!0)},m=()=>{r(l)};p=[C.jsx(au,{onClick:g,tooltipText:pe.get("Rename place group"),icon:C.jsx(qO,{})},"editPlaceGroup"),C.jsx(au,{onClick:m,tooltipText:pe.get("Remove places"),icon:C.jsx(xU,{})},"removePlaceGroup")]}return C.jsx(BWe,{itemValue:o,setItemValue:c,validateItemValue:g=>g.trim().length>0,editMode:s,setEditMode:a,labelText:pe.get("Places"),select:d,actions:p})}const drn=t=>({locale:t.controlState.locale,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,placeGroups:G4(t),selectedPlaceGroupsTitle:iSt(t)}),hrn={selectPlaceGroups:tZt,renameUserPlaceGroup:CKt,removeUserPlaceGroup:PKt},prn=Rn(drn,hrn)(frn),grn=lt(C.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"),k0={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"}},mrn=({anchorEl:t,setAnchorEl:e,isPoint:n,placeStyle:r,updatePlaceStyle:i})=>{const[o,s]=D.useState(null);function a(l){s(l.currentTarget)}return C.jsxs(C.Fragment,{children:[C.jsx(e1,{open:t!==null,anchorEl:t,onClose:()=>e(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:C.jsxs(ot,{sx:k0.container,children:[C.jsx(Jt,{sx:k0.colorLabel,children:pe.get("Color")}),C.jsx(Jt,{sx:k0.opacityLabel,color:n?"text.secondary":"text.primary",children:pe.get("Opacity")}),C.jsx(ot,{sx:k0.colorValue,style:{backgroundColor:r.color},onClick:a}),C.jsx(t1,{sx:k0.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),C.jsx(Ny,{open:!!o,anchorEl:o,onClose:()=>s(null),children:tte.map(([l,c])=>C.jsx(Br,{selected:r.color===l,sx:k0.colorMenuItem,onClick:()=>i({...r,color:l}),children:C.jsx(Mt,{title:l,children:C.jsx(ot,{sx:{...k0.colorMenuItemBox,backgroundColor:l}})})},l))})]})},vrn={select:{minWidth:"5em"}};function yrn({selectPlace:t,placeLabels:e,selectedPlaceId:n,selectedPlaceGroupIds:r,selectedPlaceInfo:i,renameUserPlace:o,restyleUserPlace:s,removeUserPlace:a,places:l,locateSelectedPlace:c}){const[u,f]=D.useState(!1),[d,h]=D.useState(null);l=l||[],e=e||[],n=n||"",r=r||[];const p=r.length===1?r[0]:null,g=l.findIndex(S=>S.id===n),m=g>=0?e[g]:"",v=S=>{o(p,n,S)},y=S=>{s(p,n,S)},x=S=>{t(S.target.value||null,l,!0)},b=C.jsx(Hg,{variant:"standard",value:n,onChange:x,input:C.jsx(Dg,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:vrn.select,disabled:l.length===0,children:l.map((S,O)=>C.jsx(Br,{value:S.id,selected:S.id===n,children:e[O]},S.id))}),w=p!==null&&p.startsWith(iO)&&n!=="";let _=[C.jsx(au,{onClick:c,tooltipText:pe.get("Locate place in map"),icon:C.jsx(NWe,{})},"locatePlace")];if(!u&&w){const S=()=>{f(!0)},O=E=>{h(E.currentTarget)},k=()=>{a(p,n,l)};_=[C.jsx(au,{onClick:S,tooltipText:pe.get("Rename place"),icon:C.jsx(qO,{})},"editButton"),C.jsx(au,{onClick:O,tooltipText:pe.get("Style place"),icon:C.jsx(grn,{})},"styleButton"),C.jsx(au,{onClick:k,tooltipText:pe.get("Remove place"),icon:C.jsx(xU,{})},"removeButton")].concat(_)}return C.jsxs(C.Fragment,{children:[C.jsx(BWe,{itemValue:m,setItemValue:v,validateItemValue:S=>S.trim().length>0,editMode:u,setEditMode:f,labelText:pe.get("Place"),select:b,actions:_}),i&&C.jsx(mrn,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const xrn=t=>({locale:t.controlState.locale,datasets:t.dataState.datasets,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,selectedPlaceId:t.controlState.selectedPlaceId,selectedPlaceInfo:ZM(t),places:KM(t),placeLabels:cSt(t)}),brn={selectPlace:oU,renameUserPlace:OKt,restyleUserPlace:TKt,removeUserPlace:AKt,locateSelectedPlace:ZKt,openDialog:T1},wrn=Rn(xrn,brn)(yrn),_rn=lt(C.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"),Srn=lt(C.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"),Crn=lt([C.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),C.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),C.jsx("path",{d:"M3 13.5h8v8H3z"},"2")],"Category"),Orn=lt(C.jsx("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord"),Ern=lt(C.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"),Trn=oa(td)(({theme:t})=>({marginTop:t.spacing(2),marginLeft:t.spacing(1),marginRight:t.spacing(2)}));function krn({mapInteraction:t,setMapInteraction:e}){function n(r,i){e(i!==null?i:"Select")}return C.jsx(Trn,{variant:"standard",children:C.jsxs(tO,{size:"small",value:t,exclusive:!0,onChange:n,children:[C.jsx(xr,{value:"Select",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Select a place in map"),children:C.jsx(Srn,{})})},0),C.jsx(xr,{value:"Point",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Add a point location in map"),children:C.jsx(_rn,{})})},1),C.jsx(xr,{value:"Polygon",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Draw a polygon area in map"),children:C.jsx(Crn,{})})},2),C.jsx(xr,{value:"Circle",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Draw a circular area in map"),children:C.jsx(Orn,{})})},3),C.jsx(xr,{value:"Geometry",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Import places"),children:C.jsx(Ern,{})})},4)]})})}const Arn=t=>({mapInteraction:t.controlState.mapInteraction}),Prn={setMapInteraction:E8e},Mrn=Rn(Arn,Prn)(krn);var gbe=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},eD=(typeof window>"u"?"undefined":gbe(window))==="object"&&(typeof document>"u"?"undefined":gbe(document))==="object"&&document.nodeType===9,Rrn={}.constructor;function RQ(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(RQ);if(t.constructor!==Rrn)return t;var e={};for(var n in t)e[n]=RQ(t[n]);return e}function Ele(t,e,n){t===void 0&&(t="unnamed");var r=n.jss,i=RQ(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var mbe=function(e,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,vbe=typeof CSS<"u"&&CSS.escape,Tle=function(t){return vbe?vbe(t):t.replace(Drn,"\\$1")},UWe=function(){function t(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,s=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:s&&(this.renderer=new s)}var e=t.prototype;return e.prop=function(r,i,o){if(i===void 0)return this.style[r];var s=o?o.force:!1;if(!s&&this.style[r]===i)return this;var a=i;(!o||o.process!==!1)&&(a=this.options.jss.plugins.onChangeValue(i,r,this));var l=a==null||a===!1,c=r in this.style;if(l&&!c&&!s)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=a,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,a),this;var f=this.options.sheet;return f&&f.attached,this},t}(),DQ=function(t){TM(e,t);function e(r,i,o){var s;s=t.call(this,r,i,o)||this;var a=o.selector,l=o.scoped,c=o.sheet,u=o.generateId;return a?s.selectorText=a:l!==!1&&(s.id=u(bt(bt(s)),c),s.selectorText="."+Tle(s.id)),s}var n=e.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var s=this.toJSON();for(var a in s)o.setProperty(i,a,s[a])}return this},n.toJSON=function(){var i={};for(var o in this.style){var s=this.style[o];typeof s!="object"?i[o]=s:Array.isArray(s)&&(i[o]=Xx(s))}return i},n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?ve({},i,{allowEmpty:!0}):i;return tP(this.selectorText,this.style,a)},An(e,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,s=this.renderable;if(!(!s||!o)){var a=o.setSelector(s,i);a||o.replaceRule(s,this)}}},get:function(){return this.selectorText}}]),e}(UWe),Irn={onCreateRule:function(e,n,r){return e[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new DQ(e,n,r)}},z9={indent:1,children:!0},Lrn=/@([\w-]+)/,$rn=function(){function t(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(Lrn);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new bU(ve({},i,{parent:this}));for(var s in r)this.rules.add(s,r[s]);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 s=this.rules.add(r,i,o);return s?(this.options.jss.plugins.onProcessRule(s),s):null},e.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.toString=function(r){r===void 0&&(r=z9);var i=XO(r),o=i.linebreak;if(r.indent==null&&(r.indent=z9.indent),r.children==null&&(r.children=z9.children),r.children===!1)return this.query+" {}";var s=this.rules.toString(r);return s?this.query+" {"+o+s+o+"}":""},t}(),Frn=/@container|@media|@supports\s+/,Nrn={onCreateRule:function(e,n,r){return Frn.test(e)?new $rn(e,n,r):null}},j9={indent:1,children:!0},zrn=/@keyframes\s+([\w-]+)/,IQ=function(){function t(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(zrn);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var s=i.scoped,a=i.sheet,l=i.generateId;this.id=s===!1?this.name:Tle(l(this,a)),this.rules=new bU(ve({},i,{parent:this}));for(var c in r)this.rules.add(c,r[c],ve({},i,{parent:this}));this.rules.process()}var e=t.prototype;return e.toString=function(r){r===void 0&&(r=j9);var i=XO(r),o=i.linebreak;if(r.indent==null&&(r.indent=j9.indent),r.children==null&&(r.children=j9.children),r.children===!1)return this.at+" "+this.id+" {}";var s=this.rules.toString(r);return s&&(s=""+o+s+o),this.at+" "+this.id+" {"+s+"}"},t}(),jrn=/@keyframes\s+/,Brn=/\$([\w-]+)/g,LQ=function(e,n){return typeof e=="string"?e.replace(Brn,function(r,i){return i in n?n[i]:r}):e},ybe=function(e,n,r){var i=e[n],o=LQ(i,r);o!==i&&(e[n]=o)},Urn={onCreateRule:function(e,n,r){return typeof e=="string"&&jrn.test(e)?new IQ(e,n,r):null},onProcessStyle:function(e,n,r){return n.type!=="style"||!r||("animation-name"in e&&ybe(e,"animation-name",r.keyframes),"animation"in e&&ybe(e,"animation",r.keyframes)),e},onChangeValue:function(e,n,r){var i=r.options.sheet;if(!i)return e;switch(n){case"animation":return LQ(e,i.keyframes);case"animation-name":return LQ(e,i.keyframes);default:return e}}},Wrn=function(t){TM(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?ve({},i,{allowEmpty:!0}):i;return tP(this.key,this.style,a)},e}(UWe),Vrn={onCreateRule:function(e,n,r){return r.parent&&r.parent.type==="keyframes"?new Wrn(e,n,r):null}},Grn=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=XO(r),o=i.linebreak;if(Array.isArray(this.style)){for(var s="",a=0;a=this.index){i.push(r);return}for(var s=0;so){i.splice(s,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,s=Dt(i,["attached"]),a=XO(s),l=a.linebreak,c="",u=0;u-1?i.substr(0,o-1):i;e.style.setProperty(n,s,o>-1?"important":"")}}catch{return!1}return!0},iin=function(e,n){try{e.attributeStyleMap?e.attributeStyleMap.delete(n):e.style.removeProperty(n)}catch{}},oin=function(e,n){return e.selectorText=n,e.selectorText===n},GWe=VWe(function(){return document.querySelector("head")});function sin(t,e){for(var n=0;ne.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}function ain(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 lin(t){for(var e=GWe(),n=0;n0){var n=sin(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=ain(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=lin(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function uin(t,e){var n=e.insertionPoint,r=cin(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}GWe().appendChild(t)}var fin=VWe(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),Sbe=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]},Cbe=function(e,n){var r=e.cssRules.length;return n===void 0||n>r?r:n},din=function(){var e=document.createElement("style");return e.textContent=` +`,e},hin=function(){function t(n){this.getPropertyValue=nin,this.setProperty=rin,this.removeProperty=iin,this.setSelector=oin,this.hasInsertedRules=!1,this.cssRules=[],n&&bk.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,s=r.element;this.element=s||din(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var a=fin();a&&this.element.setAttribute("nonce",a)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){uin(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 y_={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 YWe(){const t=t4();return(t==null?void 0:t.$$material)??t}const min=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function vin(t={}){const{disableGlobal:e=!1,productionPrefix:n="jss",seed:r=""}=t,i=r===""?"":`${r}-`;let o=0;const s=()=>(o+=1,o);return(a,l)=>{const c=l.options.name;if(c&&c.startsWith("Mui")&&!l.options.link&&!e){if(min.includes(a.key))return`Mui-${a.key}`;const u=`${i}${c}-${a.key}`;return!l.options.theme[WAe]||r!==""?u:`${u}-${s()}`}return`${i}${n}${s()}`}}var QWe=Date.now(),B9="fnValues"+QWe,U9="fnStyle"+ ++QWe,yin=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=Ele(n,{},i);return o[U9]=r,o},onProcessStyle:function(n,r){if(B9 in r||U9 in r)return n;var i={};for(var o in n){var s=n[o];typeof s=="function"&&(delete n[o],i[o]=s)}return r[B9]=i,n},onUpdate:function(n,r,i,o){var s=r,a=s[U9];a&&(s.style=a(n)||{});var l=s[B9];if(l)for(var c in l)s.prop(c,l[c](n),o)}}},Vv="@global",NQ="@global ",xin=function(){function t(n,r,i){this.type="global",this.at=Vv,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new bU(ve({},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 s=this.rules.add(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.indexOf=function(r){return this.rules.indexOf(r)},e.toString=function(r){return this.rules.toString(r)},t}(),bin=function(){function t(n,r,i){this.type="global",this.at=Vv,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(NQ.length);this.rule=i.jss.createRule(o,r,ve({},i,{parent:this}))}var e=t.prototype;return e.toString=function(r){return this.rule?this.rule.toString(r):""},t}(),win=/\s*,\s*/g;function KWe(t,e){for(var n=t.split(win),r="",i=0;i-1){var o=nVe[e];if(!Array.isArray(o))return un.js+xy(o)in n?un.css+o:!1;if(!i)return!1;for(var s=0;sr?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),s=0;s"u"?null:pon(),gon()]}}const von=HWe(mon()),yon=vin(),xon=new Map,bon={disableGeneration:!1,generateClassName:yon,jss:von,sheetsCache:null,sheetsManager:xon,sheetsRegistry:null},won=D.createContext(bon);let kbe=-1e9;function _on(){return kbe+=1,kbe}function Abe(t){return t.length===0}function Son(t){const{variant:e,...n}=t;let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=Abe(r)?t[i]:Me(t[i]):r+=`${Abe(r)?i:Me(i)}${Me(t[i].toString())}`}),r}const Con={};function Oon(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||{},s=n.components[r].variants||[],a={...i};return Object.keys(o).forEach(l=>{a[l]=Wo(a[l]||{},o[l])}),s.forEach(l=>{const c=Son(l.props);a[c]=Wo(a[c]||{},l.style)}),a},options:{}}}function Eon({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=XWe({baseClasses:t.cacheClasses.lastJSS,newClasses:n,Component:r})),t.cacheClasses.value}function Ton({state:t,theme:e,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let s=y_.get(n.sheetsManager,r,e);s||(s={refs:0,staticSheet:null,dynamicStyles:null},y_.set(n.sheetsManager,r,e,s));const a={...r.options,...n,theme:e,flip:typeof n.flip=="boolean"?n.flip:e.direction==="rtl"};a.generateId=a.serverGenerateClassName||a.generateClassName;const l=n.sheetsRegistry;if(s.refs===0){let c;n.sheetsCache&&(c=y_.get(n.sheetsCache,r,e));const u=r.create(e,i);c||(c=n.jss.createStyleSheet(u,{link:!1,...a}),c.attach(),n.sheetsCache&&y_.set(n.sheetsCache,r,e,c)),l&&l.add(c),s.staticSheet=c,s.dynamicStyles=qWe(u)}if(s.dynamicStyles){const c=n.jss.createStyleSheet(s.dynamicStyles,{link:!0,...a});c.update(o),c.attach(),t.dynamicSheet=c,t.classes=XWe({baseClasses:s.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else t.classes=s.staticSheet.classes;s.refs+=1}function kon({state:t},e){t.dynamicSheet&&t.dynamicSheet.update(e)}function Aon({state:t,theme:e,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=y_.get(n.sheetsManager,r,e);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(y_.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 Pon(t,e){const n=D.useRef([]);let r;const i=D.useMemo(()=>({}),e);n.current!==i&&(n.current=i,r=t()),D.useEffect(()=>()=>{r&&r()},[i])}function Mon(t,e={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=Con,...s}=e,a=Oon(t),l=n||r||"makeStyles";return a.options={index:_on(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=YWe()||o,d={...D.useContext(won),...s},h=D.useRef(),p=D.useRef();return Pon(()=>{const m={name:n,state:{},stylesCreator:a,stylesOptions:d,theme:f};return Ton(m,u),p.current=!1,h.current=m,()=>{Aon(m)}},[f,a]),D.useEffect(()=>{p.current&&kon(h.current,u),p.current=!0}),Eon(h.current,u.classes,i)}}function Ron(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n]||!e.components[n].defaultProps)return r;const i={...r},o=e.components[n].defaultProps;let s;for(s in o)i[s]===void 0&&(i[s]=o[s]);return i}const Don=(t,e={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o,...s}=e;let a=o;const l=Mon(t,{defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:a,...s}),c=D.forwardRef(function(f,d){const{classes:h,...p}=f,g=l({...n.defaultProps,...f});let m,v=p;return(typeof o=="string"||i)&&(m=YWe()||r,o&&(v=Ron({theme:m,name:o,props:p})),i&&!v.theme&&(v.theme=m)),C.jsx(n,{ref:d,classes:g,...v})});return GH(c,n),c},Ion=["localeText"],BQ=D.createContext(null),iVe=function(e){const{localeText:n}=e,r=Dt(e,Ion),{utils:i,localeText:o}=D.useContext(BQ)??{utils:void 0,localeText:void 0},s=kn({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:f,localeText:d}=s,h=D.useMemo(()=>ve({},d,o,n),[d,o,n]),p=D.useMemo(()=>{if(!l)return i||null;const v=new l({locale:f,formats:c,instance:u});if(!v.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` -`));return v},[l,f,c,u,i]),g=D.useMemo(()=>p?{minDate:p.date("1900-01-01T00:00:00.000"),maxDate:p.date("2099-12-31T00:00:00.000")}:null,[p]),m=D.useMemo(()=>({utils:p,defaultDates:g,localeText:h}),[g,p,h]);return C.jsx(BQ.Provider,{value:m,children:a})};var UQ={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},s=o;e.default=s,t.exports=e.default})(UQ,UQ.exports);var Lon=UQ.exports;const $on=sn(Lon),Fon={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},Non={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class zon{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=Fon,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=s=>typeof s>"u"?new Date:s===null?null:new Date(s),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=s=>s,this.toJsDate=s=>s,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=s=>{const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return s.match(a).map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=this.longFormatters[c];return u(l,this.locale.formatLong)}return l}).join("")},this.formatNumber=s=>s,this.getDayOfWeek=s=>s.getDay()+1;const{locale:n,formats:r,longFormatters:i,lib:o}=e;this.locale=n,this.formats=ve({},Non,r),this.longFormatters=i,this.lib=o||"date-fns"}}class jon extends zon{constructor({locale:e,formats:n}={}){super({locale:e??rne,formats:n,longFormatters:$on}),this.parse=(r,i)=>r===""?null:Pwt(r,i,new Date,{locale:this.locale}),this.isValid=r=>r==null?!1:hDe(r),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>w1t(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:r===null||i===null?!1:L1t(r,i),this.isSameYear=(r,i)=>Iwt(r,i),this.isSameMonth=(r,i)=>Dwt(r,i),this.isSameDay=(r,i)=>_bt(r,i),this.isSameHour=(r,i)=>Rwt(r,i),this.isAfter=(r,i)=>PW(r,i),this.isAfterYear=(r,i)=>PW(r,Spe(i)),this.isAfterDay=(r,i)=>PW(r,_pe(i)),this.isBefore=(r,i)=>MW(r,i),this.isBeforeYear=(r,i)=>MW(r,this.startOfYear(i)),this.isBeforeDay=(r,i)=>MW(r,this.startOfDay(i)),this.isWithinRange=(r,[i,o])=>Lwt(r,{start:i,end:o}),this.startOfYear=r=>Ebt(r),this.startOfMonth=r=>Obt(r),this.startOfWeek=r=>bA(r,{locale:this.locale}),this.startOfDay=r=>qq(r),this.endOfYear=r=>Spe(r),this.endOfMonth=r=>Cbt(r),this.endOfWeek=r=>Tbt(r,{locale:this.locale}),this.endOfDay=r=>_pe(r),this.addYears=(r,i)=>bbt(r,i),this.addMonths=(r,i)=>fDe(r,i),this.addWeeks=(r,i)=>xbt(r,i),this.addDays=(r,i)=>uDe(r,i),this.addHours=(r,i)=>pbt(r,i),this.addMinutes=(r,i)=>vbt(r,i),this.addSeconds=(r,i)=>ybt(r,i),this.getYear=r=>I1t(r),this.getMonth=r=>k1t(r),this.getDate=r=>C1t(r),this.getHours=r=>O1t(r),this.getMinutes=r=>T1t(r),this.getSeconds=r=>A1t(r),this.getMilliseconds=r=>E1t(r),this.setYear=(r,i)=>i_t(r,i),this.setMonth=(r,i)=>Zwt(r,i),this.setDate=(r,i)=>Jwt(r,i),this.setHours=(r,i)=>e_t(r,i),this.setMinutes=(r,i)=>n_t(r,i),this.setSeconds=(r,i)=>r_t(r,i),this.setMilliseconds=(r,i)=>t_t(r,i),this.getDaysInMonth=r=>wDe(r),this.getWeekArray=r=>{const i=this.startOfWeek(this.startOfMonth(r)),o=this.endOfWeek(this.endOfMonth(r));let s=0,a=i;const l=[];for(;this.isBefore(a,o);){const c=Math.floor(s/7);l[c]=l[c]||[],l[c].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=r=>D1t(r,{locale:this.locale}),this.getYearRange=([r,i])=>{const o=this.startOfYear(r),s=this.endOfYear(i),a=[];let l=o;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a}}}const qd=(t,e)=>t.length!==e.length?!1:e.every(n=>t.includes(n)),Bon=({openTo:t,defaultOpenTo:e,views:n,defaultViews:r})=>{const i=n??r;let o;if(t!=null)o=t;else if(i.includes(e))o=e;else if(i.length>0)o=i[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:i,openTo:o}},Z5=(t,e,n)=>{let r=e;return r=t.setHours(r,t.getHours(n)),r=t.setMinutes(r,t.getMinutes(n)),r=t.setSeconds(r,t.getSeconds(n)),r=t.setMilliseconds(r,t.getMilliseconds(n)),r},Sk=({date:t,disableFuture:e,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:s,timezone:a})=>{const l=Z5(s,s.date(void 0,a),t);n&&s.isBefore(i,l)&&(i=l),e&&s.isAfter(r,l)&&(r=l);let c=t,u=t;for(s.isBefore(t,i)&&(c=i,u=null),s.isAfter(t,r)&&(u&&(u=r),c=null);c||u;){if(c&&s.isAfter(c,r)&&(c=null),u&&s.isBefore(u,i)&&(u=null),c){if(!o(c))return c;c=s.addDays(c,1)}if(u){if(!o(u))return u;u=s.addDays(u,-1)}}return null},Uon=(t,e)=>e==null||!t.isValid(e)?null:e,Ru=(t,e,n)=>e==null||!t.isValid(e)?n:e,Won=(t,e,n)=>!t.isValid(e)&&e!=null&&!t.isValid(n)&&n!=null?!0:t.isEqual(e,n),Ple=(t,e)=>{const r=[t.startOfYear(e)];for(;r.length<12;){const i=r[r.length-1];r.push(t.addMonths(i,1))}return r},Mle=(t,e,n)=>n==="date"?t.startOfDay(t.date(void 0,e)):t.date(void 0,e),tg=(t,e)=>{const n=t.setHours(t.date(),e==="am"?2:14);return t.format(n,"meridiem")},Von=["year","month","day"],vC=t=>Von.includes(t),Pbe=(t,{format:e,views:n},r)=>{if(e!=null)return e;const i=t.formats;return qd(n,["year"])?i.year:qd(n,["month"])?i.month:qd(n,["day"])?i.dayOfMonth:qd(n,["month","year"])?`${i.month} ${i.year}`:qd(n,["day","month"])?`${i.month} ${i.dayOfMonth}`:i.keyboardDate},Gon=(t,e)=>{const n=t.startOfWeek(e);return[0,1,2,3,4,5,6].map(r=>t.addDays(n,r))},oVe=["hours","minutes","seconds"],yC=t=>oVe.includes(t),kT=t=>oVe.includes(t)||t==="meridiem",Hon=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,rP=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,qon=(t,e,n,r)=>{const i=rP(r.getHours(t),e,n);return r.setHours(t,i)},Mbe=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),tD=(t,e)=>(n,r)=>t?e.isAfter(n,r):Mbe(n,e)>Mbe(r,e),Rbe=(t,{format:e,views:n,ampm:r})=>{if(e!=null)return e;const i=t.formats;return qd(n,["hours"])?r?`${i.hours12h} ${i.meridiem}`:i.hours24h:qd(n,["minutes"])?i.minutes:qd(n,["seconds"])?i.seconds:qd(n,["minutes","seconds"])?`${i.minutes}:${i.seconds}`:qd(n,["hours","minutes","seconds"])?r?`${i.hours12h}:${i.minutes}:${i.seconds} ${i.meridiem}`:`${i.hours24h}:${i.minutes}:${i.seconds}`:r?`${i.hours12h}:${i.minutes} ${i.meridiem}`:`${i.hours24h}:${i.minutes}`},xf={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Xon=t=>Math.max(...t.map(e=>xf[e.type]??1)),x2=(t,e,n)=>{if(e===xf.year)return t.startOfYear(n);if(e===xf.month)return t.startOfMonth(n);if(e===xf.day)return t.startOfDay(n);let r=n;return e{let o=i?i():x2(e,n,Mle(e,r));t.minDate!=null&&e.isAfterDay(t.minDate,o)&&(o=x2(e,n,t.minDate)),t.maxDate!=null&&e.isBeforeDay(t.maxDate,o)&&(o=x2(e,n,t.maxDate));const s=tD(t.disableIgnoringDatePartForTimeValidation??!1,e);return t.minTime!=null&&s(t.minTime,o)&&(o=x2(e,n,t.disableIgnoringDatePartForTimeValidation?t.minTime:Z5(e,o,t.minTime))),t.maxTime!=null&&s(o,t.maxTime)&&(o=x2(e,n,t.disableIgnoringDatePartForTimeValidation?t.maxTime:Z5(e,o,t.maxTime))),o},sVe=(t,e)=>{const n=t.formatTokenMap[e];if(n==null)throw new Error([`MUI X: The token "${e}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` + */HWe();function XWe(t={}){const{baseClasses:e,newClasses:n,Component:r}=t;if(!n)return e;const i={...e};return Object.keys(n).forEach(o=>{n[o]&&(i[o]=`${e[o]} ${n[o]}`)}),i}const y_={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 YWe(){const t=t4();return(t==null?void 0:t.$$material)??t}const min=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function vin(t={}){const{disableGlobal:e=!1,productionPrefix:n="jss",seed:r=""}=t,i=r===""?"":`${r}-`;let o=0;const s=()=>(o+=1,o);return(a,l)=>{const c=l.options.name;if(c&&c.startsWith("Mui")&&!l.options.link&&!e){if(min.includes(a.key))return`Mui-${a.key}`;const u=`${i}${c}-${a.key}`;return!l.options.theme[WAe]||r!==""?u:`${u}-${s()}`}return`${i}${n}${s()}`}}var QWe=Date.now(),B9="fnValues"+QWe,U9="fnStyle"+ ++QWe,yin=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=Ele(n,{},i);return o[U9]=r,o},onProcessStyle:function(n,r){if(B9 in r||U9 in r)return n;var i={};for(var o in n){var s=n[o];typeof s=="function"&&(delete n[o],i[o]=s)}return r[B9]=i,n},onUpdate:function(n,r,i,o){var s=r,a=s[U9];a&&(s.style=a(n)||{});var l=s[B9];if(l)for(var c in l)s.prop(c,l[c](n),o)}}},Vv="@global",NQ="@global ",xin=function(){function t(n,r,i){this.type="global",this.at=Vv,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new bU(ve({},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 s=this.rules.add(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.indexOf=function(r){return this.rules.indexOf(r)},e.toString=function(r){return this.rules.toString(r)},t}(),bin=function(){function t(n,r,i){this.type="global",this.at=Vv,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(NQ.length);this.rule=i.jss.createRule(o,r,ve({},i,{parent:this}))}var e=t.prototype;return e.toString=function(r){return this.rule?this.rule.toString(r):""},t}(),win=/\s*,\s*/g;function KWe(t,e){for(var n=t.split(win),r="",i=0;i-1){var o=nVe[e];if(!Array.isArray(o))return un.js+xy(o)in n?un.css+o:!1;if(!i)return!1;for(var s=0;sr?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),s=0;s"u"?null:pon(),gon()]}}const von=HWe(mon()),yon=vin(),xon=new Map,bon={disableGeneration:!1,generateClassName:yon,jss:von,sheetsCache:null,sheetsManager:xon,sheetsRegistry:null},won=D.createContext(bon);let kbe=-1e9;function _on(){return kbe+=1,kbe}function Abe(t){return t.length===0}function Son(t){const{variant:e,...n}=t;let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=Abe(r)?t[i]:Me(t[i]):r+=`${Abe(r)?i:Me(i)}${Me(t[i].toString())}`}),r}const Con={};function Oon(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||{},s=n.components[r].variants||[],a={...i};return Object.keys(o).forEach(l=>{a[l]=Wo(a[l]||{},o[l])}),s.forEach(l=>{const c=Son(l.props);a[c]=Wo(a[c]||{},l.style)}),a},options:{}}}function Eon({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=XWe({baseClasses:t.cacheClasses.lastJSS,newClasses:n,Component:r})),t.cacheClasses.value}function Ton({state:t,theme:e,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let s=y_.get(n.sheetsManager,r,e);s||(s={refs:0,staticSheet:null,dynamicStyles:null},y_.set(n.sheetsManager,r,e,s));const a={...r.options,...n,theme:e,flip:typeof n.flip=="boolean"?n.flip:e.direction==="rtl"};a.generateId=a.serverGenerateClassName||a.generateClassName;const l=n.sheetsRegistry;if(s.refs===0){let c;n.sheetsCache&&(c=y_.get(n.sheetsCache,r,e));const u=r.create(e,i);c||(c=n.jss.createStyleSheet(u,{link:!1,...a}),c.attach(),n.sheetsCache&&y_.set(n.sheetsCache,r,e,c)),l&&l.add(c),s.staticSheet=c,s.dynamicStyles=qWe(u)}if(s.dynamicStyles){const c=n.jss.createStyleSheet(s.dynamicStyles,{link:!0,...a});c.update(o),c.attach(),t.dynamicSheet=c,t.classes=XWe({baseClasses:s.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else t.classes=s.staticSheet.classes;s.refs+=1}function kon({state:t},e){t.dynamicSheet&&t.dynamicSheet.update(e)}function Aon({state:t,theme:e,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=y_.get(n.sheetsManager,r,e);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(y_.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 Pon(t,e){const n=D.useRef([]);let r;const i=D.useMemo(()=>({}),e);n.current!==i&&(n.current=i,r=t()),D.useEffect(()=>()=>{r&&r()},[i])}function Mon(t,e={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=Con,...s}=e,a=Oon(t),l=n||r||"makeStyles";return a.options={index:_on(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=YWe()||o,d={...D.useContext(won),...s},h=D.useRef(),p=D.useRef();return Pon(()=>{const m={name:n,state:{},stylesCreator:a,stylesOptions:d,theme:f};return Ton(m,u),p.current=!1,h.current=m,()=>{Aon(m)}},[f,a]),D.useEffect(()=>{p.current&&kon(h.current,u),p.current=!0}),Eon(h.current,u.classes,i)}}function Ron(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n]||!e.components[n].defaultProps)return r;const i={...r},o=e.components[n].defaultProps;let s;for(s in o)i[s]===void 0&&(i[s]=o[s]);return i}const Don=(t,e={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o,...s}=e;let a=o;const l=Mon(t,{defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:a,...s}),c=D.forwardRef(function(f,d){const{classes:h,...p}=f,g=l({...n.defaultProps,...f});let m,v=p;return(typeof o=="string"||i)&&(m=YWe()||r,o&&(v=Ron({theme:m,name:o,props:p})),i&&!v.theme&&(v.theme=m)),C.jsx(n,{ref:d,classes:g,...v})});return GH(c,n),c},Ion=["localeText"],BQ=D.createContext(null),iVe=function(e){const{localeText:n}=e,r=Dt(e,Ion),{utils:i,localeText:o}=D.useContext(BQ)??{utils:void 0,localeText:void 0},s=kn({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:f,localeText:d}=s,h=D.useMemo(()=>ve({},d,o,n),[d,o,n]),p=D.useMemo(()=>{if(!l)return i||null;const v=new l({locale:f,formats:c,instance:u});if(!v.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` +`));return v},[l,f,c,u,i]),g=D.useMemo(()=>p?{minDate:p.date("1900-01-01T00:00:00.000"),maxDate:p.date("2099-12-31T00:00:00.000")}:null,[p]),m=D.useMemo(()=>({utils:p,defaultDates:g,localeText:h}),[g,p,h]);return C.jsx(BQ.Provider,{value:m,children:a})};var UQ={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},s=o;e.default=s,t.exports=e.default})(UQ,UQ.exports);var Lon=UQ.exports;const $on=sn(Lon),Fon={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},Non={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class zon{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=Fon,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=s=>typeof s>"u"?new Date:s===null?null:new Date(s),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=s=>s,this.toJsDate=s=>s,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=s=>{const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return s.match(a).map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=this.longFormatters[c];return u(l,this.locale.formatLong)}return l}).join("")},this.formatNumber=s=>s,this.getDayOfWeek=s=>s.getDay()+1;const{locale:n,formats:r,longFormatters:i,lib:o}=e;this.locale=n,this.formats=ve({},Non,r),this.longFormatters=i,this.lib=o||"date-fns"}}class jon extends zon{constructor({locale:e,formats:n}={}){super({locale:e??rne,formats:n,longFormatters:$on}),this.parse=(r,i)=>r===""?null:Pwt(r,i,new Date,{locale:this.locale}),this.isValid=r=>r==null?!1:hDe(r),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>w1t(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:r===null||i===null?!1:L1t(r,i),this.isSameYear=(r,i)=>Iwt(r,i),this.isSameMonth=(r,i)=>Dwt(r,i),this.isSameDay=(r,i)=>_bt(r,i),this.isSameHour=(r,i)=>Rwt(r,i),this.isAfter=(r,i)=>PW(r,i),this.isAfterYear=(r,i)=>PW(r,Spe(i)),this.isAfterDay=(r,i)=>PW(r,_pe(i)),this.isBefore=(r,i)=>MW(r,i),this.isBeforeYear=(r,i)=>MW(r,this.startOfYear(i)),this.isBeforeDay=(r,i)=>MW(r,this.startOfDay(i)),this.isWithinRange=(r,[i,o])=>Lwt(r,{start:i,end:o}),this.startOfYear=r=>Ebt(r),this.startOfMonth=r=>Obt(r),this.startOfWeek=r=>xA(r,{locale:this.locale}),this.startOfDay=r=>qq(r),this.endOfYear=r=>Spe(r),this.endOfMonth=r=>Cbt(r),this.endOfWeek=r=>Tbt(r,{locale:this.locale}),this.endOfDay=r=>_pe(r),this.addYears=(r,i)=>bbt(r,i),this.addMonths=(r,i)=>fDe(r,i),this.addWeeks=(r,i)=>xbt(r,i),this.addDays=(r,i)=>uDe(r,i),this.addHours=(r,i)=>pbt(r,i),this.addMinutes=(r,i)=>vbt(r,i),this.addSeconds=(r,i)=>ybt(r,i),this.getYear=r=>I1t(r),this.getMonth=r=>k1t(r),this.getDate=r=>C1t(r),this.getHours=r=>O1t(r),this.getMinutes=r=>T1t(r),this.getSeconds=r=>A1t(r),this.getMilliseconds=r=>E1t(r),this.setYear=(r,i)=>i_t(r,i),this.setMonth=(r,i)=>Zwt(r,i),this.setDate=(r,i)=>Jwt(r,i),this.setHours=(r,i)=>e_t(r,i),this.setMinutes=(r,i)=>n_t(r,i),this.setSeconds=(r,i)=>r_t(r,i),this.setMilliseconds=(r,i)=>t_t(r,i),this.getDaysInMonth=r=>wDe(r),this.getWeekArray=r=>{const i=this.startOfWeek(this.startOfMonth(r)),o=this.endOfWeek(this.endOfMonth(r));let s=0,a=i;const l=[];for(;this.isBefore(a,o);){const c=Math.floor(s/7);l[c]=l[c]||[],l[c].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=r=>D1t(r,{locale:this.locale}),this.getYearRange=([r,i])=>{const o=this.startOfYear(r),s=this.endOfYear(i),a=[];let l=o;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a}}}const qd=(t,e)=>t.length!==e.length?!1:e.every(n=>t.includes(n)),Bon=({openTo:t,defaultOpenTo:e,views:n,defaultViews:r})=>{const i=n??r;let o;if(t!=null)o=t;else if(i.includes(e))o=e;else if(i.length>0)o=i[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:i,openTo:o}},Z5=(t,e,n)=>{let r=e;return r=t.setHours(r,t.getHours(n)),r=t.setMinutes(r,t.getMinutes(n)),r=t.setSeconds(r,t.getSeconds(n)),r=t.setMilliseconds(r,t.getMilliseconds(n)),r},_k=({date:t,disableFuture:e,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:s,timezone:a})=>{const l=Z5(s,s.date(void 0,a),t);n&&s.isBefore(i,l)&&(i=l),e&&s.isAfter(r,l)&&(r=l);let c=t,u=t;for(s.isBefore(t,i)&&(c=i,u=null),s.isAfter(t,r)&&(u&&(u=r),c=null);c||u;){if(c&&s.isAfter(c,r)&&(c=null),u&&s.isBefore(u,i)&&(u=null),c){if(!o(c))return c;c=s.addDays(c,1)}if(u){if(!o(u))return u;u=s.addDays(u,-1)}}return null},Uon=(t,e)=>e==null||!t.isValid(e)?null:e,Ru=(t,e,n)=>e==null||!t.isValid(e)?n:e,Won=(t,e,n)=>!t.isValid(e)&&e!=null&&!t.isValid(n)&&n!=null?!0:t.isEqual(e,n),Ple=(t,e)=>{const r=[t.startOfYear(e)];for(;r.length<12;){const i=r[r.length-1];r.push(t.addMonths(i,1))}return r},Mle=(t,e,n)=>n==="date"?t.startOfDay(t.date(void 0,e)):t.date(void 0,e),tg=(t,e)=>{const n=t.setHours(t.date(),e==="am"?2:14);return t.format(n,"meridiem")},Von=["year","month","day"],vC=t=>Von.includes(t),Pbe=(t,{format:e,views:n},r)=>{if(e!=null)return e;const i=t.formats;return qd(n,["year"])?i.year:qd(n,["month"])?i.month:qd(n,["day"])?i.dayOfMonth:qd(n,["month","year"])?`${i.month} ${i.year}`:qd(n,["day","month"])?`${i.month} ${i.dayOfMonth}`:i.keyboardDate},Gon=(t,e)=>{const n=t.startOfWeek(e);return[0,1,2,3,4,5,6].map(r=>t.addDays(n,r))},oVe=["hours","minutes","seconds"],yC=t=>oVe.includes(t),TT=t=>oVe.includes(t)||t==="meridiem",Hon=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,nP=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,qon=(t,e,n,r)=>{const i=nP(r.getHours(t),e,n);return r.setHours(t,i)},Mbe=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),tD=(t,e)=>(n,r)=>t?e.isAfter(n,r):Mbe(n,e)>Mbe(r,e),Rbe=(t,{format:e,views:n,ampm:r})=>{if(e!=null)return e;const i=t.formats;return qd(n,["hours"])?r?`${i.hours12h} ${i.meridiem}`:i.hours24h:qd(n,["minutes"])?i.minutes:qd(n,["seconds"])?i.seconds:qd(n,["minutes","seconds"])?`${i.minutes}:${i.seconds}`:qd(n,["hours","minutes","seconds"])?r?`${i.hours12h}:${i.minutes}:${i.seconds} ${i.meridiem}`:`${i.hours24h}:${i.minutes}:${i.seconds}`:r?`${i.hours12h}:${i.minutes} ${i.meridiem}`:`${i.hours24h}:${i.minutes}`},xf={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Xon=t=>Math.max(...t.map(e=>xf[e.type]??1)),y2=(t,e,n)=>{if(e===xf.year)return t.startOfYear(n);if(e===xf.month)return t.startOfMonth(n);if(e===xf.day)return t.startOfDay(n);let r=n;return e{let o=i?i():y2(e,n,Mle(e,r));t.minDate!=null&&e.isAfterDay(t.minDate,o)&&(o=y2(e,n,t.minDate)),t.maxDate!=null&&e.isBeforeDay(t.maxDate,o)&&(o=y2(e,n,t.maxDate));const s=tD(t.disableIgnoringDatePartForTimeValidation??!1,e);return t.minTime!=null&&s(t.minTime,o)&&(o=y2(e,n,t.disableIgnoringDatePartForTimeValidation?t.minTime:Z5(e,o,t.minTime))),t.maxTime!=null&&s(o,t.maxTime)&&(o=y2(e,n,t.disableIgnoringDatePartForTimeValidation?t.maxTime:Z5(e,o,t.maxTime))),o},sVe=(t,e)=>{const n=t.formatTokenMap[e];if(n==null)throw new Error([`MUI X: The token "${e}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` `));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},Qon=t=>{switch(t){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},wU=(t,e)=>{const n=[],r=t.date(void 0,"default"),i=t.startOfWeek(r),o=t.endOfWeek(r);let s=i;for(;t.isBefore(s,o);)n.push(s),s=t.addDays(s,1);return n.map(a=>t.formatByString(a,e))},aVe=(t,e,n,r)=>{switch(n){case"month":return Ple(t,t.date(void 0,e)).map(i=>t.formatByString(i,r));case"weekDay":return wU(t,r);case"meridiem":{const i=t.date(void 0,e);return[t.startOfDay(i),t.endOfDay(i)].map(o=>t.formatByString(o,r))}default:return[]}},Dbe="s",Kon=["0","1","2","3","4","5","6","7","8","9"],Zon=t=>{const e=t.date(void 0);return t.formatByString(t.setSeconds(e,0),Dbe)==="0"?Kon:Array.from({length:10}).map((r,i)=>t.formatByString(t.setSeconds(e,i),Dbe))},Ib=(t,e)=>{if(e[0]==="0")return t;const n=[];let r="";for(let i=0;i-1&&(n.push(o.toString()),r="")}return n.join("")},Rle=(t,e)=>e[0]==="0"?t:t.split("").map(n=>e[Number(n)]).join(""),Ibe=(t,e)=>{const n=Ib(t,e);return n!==" "&&!Number.isNaN(Number(n))},lVe=(t,e)=>{let n=t;for(n=Number(n).toString();n.length{if(i.type==="day"&&i.contentType==="digit-with-letter"){const s=t.setDate(n.longestMonth,e);return t.formatByString(s,i.format)}let o=e.toString();return i.hasLeadingZerosInInput&&(o=lVe(o,i.maxLength)),Rle(o,r)},Jon=(t,e,n,r,i,o,s,a)=>{const l=Qon(r),c=r==="Home",u=r==="End",f=n.value===""||c||u,d=()=>{const p=i[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),g=x=>cVe(t,x,p,o,n),m=n.type==="minutes"&&(a!=null&&a.minutesStep)?a.minutesStep:1;let y=parseInt(Ib(n.value,o),10)+l*m;if(f){if(n.type==="year"&&!u&&!c)return t.formatByString(t.date(void 0,e),n.format);l>0||c?y=p.minimum:y=p.maximum}return y%m!==0&&((l<0||c)&&(y+=m-(m+y)%m),(l>0||u)&&(y-=y%m)),y>p.maximum?g(p.minimum+(y-p.maximum-1)%(p.maximum-p.minimum+1)):y{const p=aVe(t,e,n.type,n.format);if(p.length===0)return n.value;if(f)return l>0||c?p[0]:p[p.length-1];const v=((p.indexOf(n.value)+l)%p.length+p.length)%p.length;return p[v]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?d():h()},Dle=(t,e,n)=>{let r=t.value||t.placeholder;const i=e==="non-input"?t.hasLeadingZerosInFormat:t.hasLeadingZerosInInput;return e==="non-input"&&t.hasLeadingZerosInInput&&!t.hasLeadingZerosInFormat&&(r=Number(Ib(r,n)).toString()),["input-rtl","input-ltr"].includes(e)&&t.contentType==="digit"&&!i&&r.length===1&&(r=`${r}‎`),e==="input-rtl"&&(r=`⁨${r}⁩`),r},Lbe=(t,e,n,r)=>t.formatByString(t.parse(e,n),r),uVe=(t,e)=>t.formatByString(t.date(void 0,"system"),e).length===4,fVe=(t,e,n,r)=>{if(e!=="digit")return!1;const i=t.date(void 0,"default");switch(n){case"year":return uVe(t,r)?t.formatByString(t.setYear(i,1),r)==="0001":t.formatByString(t.setYear(i,2001),r)==="01";case"month":return t.formatByString(t.startOfYear(i),r).length>1;case"day":return t.formatByString(t.startOfMonth(i),r).length>1;case"weekDay":return t.formatByString(t.startOfWeek(i),r).length>1;case"hours":return t.formatByString(t.setHours(i,1),r).length>1;case"minutes":return t.formatByString(t.setMinutes(i,1),r).length>1;case"seconds":return t.formatByString(t.setSeconds(i,1),r).length>1;default:throw new Error("Invalid section type")}},esn=(t,e,n)=>{const r=e.some(l=>l.type==="day"),i=[],o=[];for(let l=0;lt.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),nsn=(t,e,n)=>{const i=t.map(o=>{const s=Dle(o,n?"input-rtl":"input-ltr",e);return`${o.startSeparator}${s}${o.endSeparator}`}).join("");return n?`⁦${i}⁩`:i},rsn=(t,e,n)=>{const r=t.date(void 0,n),i=t.endOfYear(r),o=t.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=Ple(t,r).reduce((l,c)=>{const u=t.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:uVe(t,l)?9999:99}),month:()=>({minimum:1,maximum:t.getMonth(i)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&t.isValid(l)?t.getDaysInMonth(l):s,longestMonth:a}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=wU(t,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=t.getHours(o);return Ib(t.formatByString(t.endOfDay(r),l),e)!==c.toString()?{minimum:1,maximum:Number(Ib(t.formatByString(t.startOfDay(r),l),e))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:t.getMinutes(o)}),seconds:()=>({minimum:0,maximum:t.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},isn=(t,e,n,r)=>{switch(e.type){case"year":return t.setYear(r,t.getYear(n));case"month":return t.setMonth(r,t.getMonth(n));case"weekDay":{const i=wU(t,e.format),o=t.formatByString(n,e.format),s=i.indexOf(o),l=i.indexOf(e.value)-s;return t.addDays(n,l)}case"day":return t.setDate(r,t.getDate(n));case"meridiem":{const i=t.getHours(n)<12,o=t.getHours(r);return i&&o>=12?t.addHours(r,-12):!i&&o<12?t.addHours(r,12):r}case"hours":return t.setHours(r,t.getHours(n));case"minutes":return t.setMinutes(r,t.getMinutes(n));case"seconds":return t.setSeconds(r,t.getSeconds(n));default:return r}},$be={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},Fbe=(t,e,n,r,i)=>[...n].sort((o,s)=>$be[o.type]-$be[s.type]).reduce((o,s)=>!i||s.modified?isn(t,s,e,o):o,r),osn=()=>navigator.userAgent.toLowerCase().includes("android"),ssn=(t,e)=>{const n={};if(!e)return t.forEach((l,c)=>{const u=c===0?null:c-1,f=c===t.length-1?null:c+1;n[c]={leftIndex:u,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:t.length-1};const r={},i={};let o=0,s=0,a=t.length-1;for(;a>=0;){s=t.findIndex((l,c)=>{var u;return c>=o&&((u=l.endSeparator)==null?void 0:u.includes(" "))&&l.endSeparator!==" / "}),s===-1&&(s=t.length-1);for(let l=s;l>=o;l-=1)i[l]=a,r[a]=l,a-=1;o=s+1}return t.forEach((l,c)=>{const u=i[c],f=u===0?null:r[u-1],d=u===t.length-1?null:r[u+1];n[c]={leftIndex:f,rightIndex:d}}),{neighbors:n,startIndex:r[0],endIndex:r[t.length-1]}},WQ=(t,e)=>t==null?null:t==="all"?"all":typeof t=="string"?e.findIndex(n=>n.type===t):t,asn=(t,e)=>{if(t.value)switch(t.type){case"month":{if(t.contentType==="digit")return e.format(e.setMonth(e.date(),Number(t.value)-1),"month");const n=e.parse(t.value,t.format);return n?e.format(n,"month"):void 0}case"day":return t.contentType==="digit"?e.format(e.setDate(e.startOfYear(e.date()),Number(t.value)),"dayOfMonthFull"):t.value;case"weekDay":return;default:return}},lsn=(t,e)=>{if(t.value)switch(t.type){case"weekDay":return t.contentType==="letter"?void 0:Number(t.value);case"meridiem":{const n=e.parse(`01:00 ${t.value}`,`${e.formats.hours12h}:${e.formats.minutes} ${t.format}`);return n?e.getHours(n)>=12?1:0:void 0}case"day":return t.contentType==="digit-with-letter"?parseInt(t.value,10):Number(t.value);case"month":{if(t.contentType==="digit")return Number(t.value);const n=e.parse(t.value,t.format);return n?e.getMonth(n)+1:void 0}default:return t.contentType!=="letter"?Number(t.value):void 0}},csn=["value","referenceDate"],ia={emptyValue:null,getTodayValue:Mle,getInitialReferenceValue:t=>{let{value:e,referenceDate:n}=t,r=Dt(t,csn);return e!=null&&r.utils.isValid(e)?e:n??Yon(r)},cleanValue:Uon,areValuesEqual:Won,isSameError:(t,e)=>t===e,hasError:t=>t!=null,defaultErrorState:null,getTimezone:(t,e)=>e==null||!t.isValid(e)?null:t.getTimezone(e),setTimezone:(t,e,n)=>n==null?null:t.setTimezone(n,e)},usn={updateReferenceValue:(t,e,n)=>e==null||!t.isValid(e)?n:e,getSectionsFromValue:(t,e,n,r)=>!t.isValid(e)&&!!n?n:r(e),getV7HiddenInputValueFromSections:tsn,getV6InputValueFromSections:nsn,getActiveDateManager:(t,e)=>({date:e.value,referenceDate:e.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!t.isValid(n)?e.referenceValue:n})}),parseValueStr:(t,e,n)=>n(t.trim(),e)},Ile=({props:t,value:e,timezone:n,adapter:r})=>{if(e===null)return null;const{shouldDisableDate:i,shouldDisableMonth:o,shouldDisableYear:s,disablePast:a,disableFuture:l}=t,c=r.utils.date(void 0,n),u=Ru(r.utils,t.minDate,r.defaultDates.minDate),f=Ru(r.utils,t.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(e):return"invalidDate";case!!(i&&i(e)):return"shouldDisableDate";case!!(o&&o(e)):return"shouldDisableMonth";case!!(s&&s(e)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(e,c)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(e,c)):return"disablePast";case!!(u&&r.utils.isBeforeDay(e,u)):return"minDate";case!!(f&&r.utils.isAfterDay(e,f)):return"maxDate";default:return null}};Ile.valueManager=ia;const dVe=({adapter:t,value:e,timezone:n,props:r})=>{if(e===null)return null;const{minTime:i,maxTime:o,minutesStep:s,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:c,disableFuture:u}=r,f=t.utils.date(void 0,n),d=tD(l,t.utils);switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(i&&d(i,e)):return"minTime";case!!(o&&d(e,o)):return"maxTime";case!!(u&&t.utils.isAfter(e,f)):return"disableFuture";case!!(c&&t.utils.isBefore(e,f)):return"disablePast";case!!(a&&a(e,"hours")):return"shouldDisableTime-hours";case!!(a&&a(e,"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(e,"seconds")):return"shouldDisableTime-seconds";case!!(s&&t.utils.getMinutes(e)%s!==0):return"minutesStep";default:return null}};dVe.valueManager=ia;const _U=({adapter:t,value:e,timezone:n,props:r})=>{const i=Ile({adapter:t,value:e,timezone:n,props:r});return i!==null?i:dVe({adapter:t,value:e,timezone:n,props:r})};_U.valueManager=ia;const hVe=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],pVe=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],gVe=["minDateTime","maxDateTime"],fsn=[...hVe,...pVe,...gVe],mVe=t=>fsn.reduce((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e),{}),dsn=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:ve({},t)}}}}),vVe=t=>{const{utils:e,formatKey:n,contextTranslation:r,propsTranslation:i}=t;return o=>{const s=o!==null&&e.isValid(o)?e.format(o,n):null;return(i??r)(o,e,s)}},yVe={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",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(t,e,n,r)=>`Select ${t}. ${!r&&(e===null||!n.isValid(e))?"No time selected":`Selected time is ${r??n.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,selectViewText:t=>`Select ${t}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:t=>`Week ${t}`,calendarWeekNumberText:t=>`${t}`,openDatePickerDialogue:(t,e,n)=>n||t!==null&&e.isValid(t)?`Choose date, selected date is ${n??e.format(t,"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e,n)=>n||t!==null&&e.isValid(t)?`Choose time, selected time is ${n??e.format(t,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:t=>"Y".repeat(t.digitAmount),fieldMonthPlaceholder:t=>t.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:t=>t.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},hsn=yVe;dsn(yVe);const A1=()=>{const t=D.useContext(BQ);if(t===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(` `));if(t.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(` -`));const e=D.useMemo(()=>ve({},hsn,t.localeText),[t.localeText]);return D.useMemo(()=>ve({},t,{localeText:e}),[t,e])},gr=()=>A1().utils,nD=()=>A1().defaultDates,P1=t=>{const e=gr(),n=D.useRef();return n.current===void 0&&(n.current=e.date(void 0,t)),n.current};function xVe(t){const{props:e,validator:n,value:r,timezone:i,onError:o}=t,s=A1(),a=D.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:i,props:e}),c=n.valueManager.hasError(l);D.useEffect(()=>{o&&!n.valueManager.isSameError(l,a.current)&&o(l,r),a.current=l},[n,o,l,r]);const u=st(f=>n({adapter:s,value:f,timezone:i,props:e}));return{validationError:l,hasValidationError:c,getValidationErrorForNewValue:u}}const Ml=()=>A1().localeText,psn=({utils:t,format:e})=>{let n=10,r=e,i=t.expandFormat(e);for(;i!==r;)if(r=i,i=t.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return i},gsn=({utils:t,expandedFormat:e})=>{const n=[],{start:r,end:i}=t.escapedCharacters,o=new RegExp(`(\\${r}[^\\${i}]*\\${i})+`,"g");let s=null;for(;s=o.exec(e);)n.push({start:s.index,end:o.lastIndex-1});return n},msn=(t,e,n,r)=>{switch(n.type){case"year":return e.fieldYearPlaceholder({digitAmount:t.formatByString(t.date(void 0,"default"),r).length,format:r});case"month":return e.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return e.fieldDayPlaceholder({format:r});case"weekDay":return e.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return e.fieldHoursPlaceholder({format:r});case"minutes":return e.fieldMinutesPlaceholder({format:r});case"seconds":return e.fieldSecondsPlaceholder({format:r});case"meridiem":return e.fieldMeridiemPlaceholder({format:r});default:return r}},vsn=({utils:t,date:e,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:i,now:o,token:s,startSeparator:a})=>{if(s==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=sVe(t,s),c=fVe(t,l.contentType,l.type,s),u=n?c:l.contentType==="digit",f=e!=null&&t.isValid(e);let d=f?t.formatByString(e,s):"",h=null;if(u)if(c)h=d===""?t.formatByString(o,s).length:d.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);h=l.maxLength,f&&(d=Rle(lVe(Ib(d,i),h),i))}return ve({},l,{format:s,maxLength:h,value:d,placeholder:msn(t,r,l,s),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:a,endSeparator:"",modified:!1})},ysn=t=>{var h;const{utils:e,expandedFormat:n,escapedParts:r}=t,i=e.date(void 0),o=[];let s="";const a=Object.keys(e.formatTokenMap).sort((p,g)=>g.length-p.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${a.join("|")})*$`),u=new RegExp(`^(${a.join("|")})`),f=p=>r.find(g=>g.start<=p&&g.end>=p);let d=0;for(;d0;){const y=u.exec(v)[1];v=v.slice(y.length),o.push(vsn(ve({},t,{now:i,token:y,startSeparator:s}))),s=""}d+=m.length}else{const v=n[d];g&&(p==null?void 0:p.start)===d||(p==null?void 0:p.end)===d||(o.length===0?s+=v:o[o.length-1].endSeparator+=v),d+=1}}return o.length===0&&s.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),o},xsn=({isRtl:t,formatDensity:e,sections:n})=>n.map(r=>{const i=o=>{let s=o;return t&&s!==null&&s.includes(" ")&&(s=`⁩${s}⁦`),e==="spacious"&&["/",".","-"].includes(s)&&(s=` ${s} `),s};return r.startSeparator=i(r.startSeparator),r.endSeparator=i(r.endSeparator),r}),Nbe=t=>{let e=psn(t);t.isRtl&&t.enableAccessibleFieldDOMStructure&&(e=e.split(" ").reverse().join(" "));const n=gsn(ve({},t,{expandedFormat:e})),r=ysn(ve({},t,{expandedFormat:e,escapedParts:n}));return xsn(ve({},t,{sections:r}))},Lle=({timezone:t,value:e,defaultValue:n,onChange:r,valueManager:i})=>{const o=gr(),s=D.useRef(n),a=e??s.current??i.emptyValue,l=D.useMemo(()=>i.getTimezone(o,a),[o,i,a]),c=st(h=>l==null?h:i.setTimezone(o,l,h)),u=t??l??"default",f=D.useMemo(()=>i.setTimezone(o,u,a),[i,o,u,a]),d=st((h,...p)=>{const g=c(h);r==null||r(g,...p)});return{value:f,handleValueChange:d,timezone:u}},QO=({name:t,timezone:e,value:n,defaultValue:r,onChange:i,valueManager:o})=>{const[s,a]=bc({name:t,state:"value",controlled:n,default:r??o.emptyValue}),l=st((c,...u)=>{a(c),i==null||i(c,...u)});return Lle({timezone:e,value:s,defaultValue:void 0,onChange:l,valueManager:o})},bsn=t=>{const e=gr(),n=Ml(),r=A1(),i=Eo(),{valueManager:o,fieldValueManager:s,valueType:a,validator:l,internalProps:c,internalProps:{value:u,defaultValue:f,referenceDate:d,onChange:h,format:p,formatDensity:g="dense",selectedSections:m,onSelectedSectionsChange:v,shouldRespectLeadingZeros:y=!1,timezone:x,enableAccessibleFieldDOMStructure:b=!1}}=t,{timezone:w,value:_,handleValueChange:S}=Lle({timezone:x,value:u,defaultValue:f,onChange:h,valueManager:o}),O=D.useMemo(()=>Zon(e),[e]),k=D.useMemo(()=>rsn(e,O,w),[e,O,w]),E=D.useCallback((V,Y=null)=>s.getSectionsFromValue(e,V,Y,le=>Nbe({utils:e,localeText:n,localizedDigits:O,format:p,date:le,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i})),[s,p,n,O,i,y,e,g,b]),[P,A]=D.useState(()=>{const V=E(_),Y={sections:V,value:_,referenceValue:o.emptyValue,tempValueStrAndroid:null},le=Xon(V),K=o.getInitialReferenceValue({referenceDate:d,value:_,utils:e,props:c,granularity:le,timezone:w});return ve({},Y,{referenceValue:K})}),[R,T]=bc({controlled:m,default:null,name:"useField",state:"selectedSections"}),M=V=>{T(V),v==null||v(V)},I=D.useMemo(()=>WQ(R,P.sections),[R,P.sections]),z=I==="all"?0:I,F=({value:V,referenceValue:Y,sections:le})=>{if(A(ee=>ve({},ee,{sections:le,value:V,referenceValue:Y,tempValueStrAndroid:null})),o.areValuesEqual(e,P.value,V))return;const K={validationError:l({adapter:r,value:V,timezone:w,props:c})};S(V,K)},N=(V,Y)=>{const le=[...P.sections];return le[V]=ve({},le[V],{value:Y,modified:!0}),le},L=()=>{F({value:o.emptyValue,referenceValue:P.referenceValue,sections:E(o.emptyValue)})},B=()=>{if(z==null)return;const V=P.sections[z],Y=s.getActiveDateManager(e,P,V),K=Y.getSections(P.sections).filter(te=>te.value!=="").length===(V.value===""?0:1),ee=N(z,""),re=K?null:e.getInvalidDate(),me=Y.getNewValuesFromNewActiveDate(re);F(ve({},me,{sections:ee}))},$=V=>{const Y=(ee,re)=>{const me=e.parse(ee,p);if(me==null||!e.isValid(me))return null;const te=Nbe({utils:e,localeText:n,localizedDigits:O,format:p,date:me,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i});return Fbe(e,me,te,re,!1)},le=s.parseValueStr(V,P.referenceValue,Y),K=s.updateReferenceValue(e,le,P.referenceValue);F({value:le,referenceValue:K,sections:E(le,P.sections)})},j=({activeSection:V,newSectionValue:Y,shouldGoToNextSection:le})=>{le&&zve({},U,te,{sections:ee,tempValueStrAndroid:null}))},X=V=>A(Y=>ve({},Y,{tempValueStrAndroid:V}));return D.useEffect(()=>{const V=E(P.value);A(Y=>ve({},Y,{sections:V}))},[p,e.locale,i]),D.useEffect(()=>{let V;o.areValuesEqual(e,P.value,_)?V=o.getTimezone(e,P.value)!==o.getTimezone(e,_):V=!0,V&&A(Y=>ve({},Y,{value:_,referenceValue:s.updateReferenceValue(e,_,Y.referenceValue),sections:E(_)}))},[_]),{state:P,activeSectionIndex:z,parsedSelectedSections:I,setSelectedSections:M,clearValue:L,clearActiveSection:B,updateSectionValue:j,updateValueFromValueStr:$,setTempAndroidValueStr:X,getSectionsFromValue:E,sectionsValueBoundaries:k,localizedDigits:O,timezone:w}},wsn=5e3,fw=t=>t.saveQuery!=null,_sn=({sections:t,updateSectionValue:e,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:i,timezone:o})=>{const s=gr(),[a,l]=D.useState(null),c=st(()=>l(null));D.useEffect(()=>{var p;a!=null&&((p=t[a.sectionIndex])==null?void 0:p.type)!==a.sectionType&&c()},[t,a,c]),D.useEffect(()=>{if(a!=null){const p=setTimeout(()=>c(),wsn);return()=>{clearTimeout(p)}}return()=>{}},[a,c]);const u=({keyPressed:p,sectionIndex:g},m,v)=>{const y=p.toLowerCase(),x=t[g];if(a!=null&&(!v||v(a.value))&&a.sectionIndex===g){const w=`${a.value}${y}`,_=m(w,x);if(!fw(_))return l({sectionIndex:g,value:w,sectionType:x.type}),_}const b=m(y,x);return fw(b)&&!b.saveQuery?(c(),null):(l({sectionIndex:g,value:y,sectionType:x.type}),fw(b)?null:b)},f=p=>{const g=(y,x,b)=>{const w=x.filter(_=>_.toLowerCase().startsWith(b));return w.length===0?{saveQuery:!1}:{sectionValue:w[0],shouldGoToNextSection:w.length===1}},m=(y,x,b,w)=>{const _=S=>aVe(s,o,x.type,S);if(x.contentType==="letter")return g(x.format,_(x.format),y);if(b&&w!=null&&sVe(s,b).contentType==="letter"){const S=_(b),O=g(b,S,y);return fw(O)?{saveQuery:!1}:ve({},O,{sectionValue:w(O.sectionValue,S)})}return{saveQuery:!1}};return u(p,(y,x)=>{switch(x.type){case"month":{const b=w=>Lbe(s,w,s.formats.month,x.format);return m(y,x,s.formats.month,b)}case"weekDay":{const b=(w,_)=>_.indexOf(w).toString();return m(y,x,s.formats.weekday,b)}case"meridiem":return m(y,x);default:return{saveQuery:!1}}})},d=p=>{const g=(v,y)=>{const x=Ib(v,r),b=Number(x),w=n[y.type]({currentDate:null,format:y.format,contentType:y.contentType});if(b>w.maximum)return{saveQuery:!1};if(bw.maximum||x.length===w.maximum.toString().length;return{sectionValue:cVe(s,b,w,r,y),shouldGoToNextSection:_}};return u(p,(v,y)=>{if(y.contentType==="digit"||y.contentType==="digit-with-letter")return g(v,y);if(y.type==="month"){const x=fVe(s,"digit","month","MM"),b=g(v,{type:y.type,format:"MM",hasLeadingZerosInFormat:x,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(fw(b))return b;const w=Lbe(s,b.sectionValue,"MM",y.format);return ve({},b,{sectionValue:w})}if(y.type==="weekDay"){const x=g(v,y);if(fw(x))return x;const b=wU(s,y.format)[Number(x.sectionValue)-1];return ve({},x,{sectionValue:b})}return{saveQuery:!1}},v=>Ibe(v,r))};return{applyCharacterEditing:st(p=>{const g=t[p.sectionIndex],v=Ibe(p.keyPressed,r)?d(ve({},p,{keyPressed:Rle(p.keyPressed,r)})):f(p);if(v==null){i(null);return}e({activeSection:g,newSectionValue:v.sectionValue,shouldGoToNextSection:v.shouldGoToNextSection})}),resetCharacterQuery:c}};function Ssn(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const Csn=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(n),n.preventDefault(),n.stopPropagation())},Ka=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?Ka(e.shadowRoot):e:null},J5=t=>Array.from(t.children).indexOf(Ka(document)),Osn="@media (pointer: fine)",Esn=t=>{const{internalProps:{disabled:e,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:i,onClick:o,onFocus:s,onInput:a,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:f,applyCharacterEditing:d,resetCharacterQuery:h,setSelectedSections:p,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:x,updateValueFromValueStr:b,sectionOrder:w,areAllSectionsEmpty:_,sectionsValueBoundaries:S}=t,O=D.useRef(null),k=dn(r,O),E=Ml(),P=gr(),A=Jf(),[R,T]=D.useState(!1),M=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!O.current)return;const ae=document.getSelection();if(!ae)return;if(g==null){ae.rangeCount>0&&O.current.getRoot().contains(ae.getRangeAt(0).startContainer)&&ae.removeAllRanges(),R&&O.current.getRoot().blur();return}if(!O.current.getRoot().contains(Ka(document)))return;const U=new window.Range;let oe;g==="all"?oe=O.current.getRoot():m.sections[g].type==="empty"?oe=O.current.getSectionContainer(g):oe=O.current.getSectionContent(g),U.selectNodeContents(oe),oe.focus(),ae.removeAllRanges(),ae.addRange(U)},getActiveSectionIndexFromDOM:()=>{const ae=Ka(document);return!ae||!O.current||!O.current.getRoot().contains(ae)?null:O.current.getSectionIndexFromDOMElement(ae)},focusField:(ae=0)=>{if(!O.current)return;const U=WQ(ae,m.sections);T(!0),O.current.getSectionContent(U).focus()},setSelectedSections:ae=>{if(!O.current)return;const U=WQ(ae,m.sections);T((U==="all"?0:U)!==null),p(ae)},isFieldFocused:()=>{const ae=Ka(document);return!!O.current&&O.current.getRoot().contains(ae)}}),[g,p,m.sections,R]),I=st(ae=>{if(!O.current)return;const U=m.sections[ae];O.current.getSectionContent(ae).innerHTML=U.value||U.placeholder,M.syncSelectionToDOM()}),z=st((ae,...U)=>{ae.isDefaultPrevented()||!O.current||(T(!0),o==null||o(ae,...U),g==="all"?setTimeout(()=>{const oe=document.getSelection().getRangeAt(0).startOffset;if(oe===0){p(w.startIndex);return}let ne=0,G=0;for(;G{if(a==null||a(ae),!O.current||g!=="all")return;const oe=ae.target.textContent??"";O.current.getRoot().innerHTML=m.sections.map(ne=>`${ne.startSeparator}${ne.value||ne.placeholder}${ne.endSeparator}`).join(""),M.syncSelectionToDOM(),oe.length===0||oe.charCodeAt(0)===10?(h(),y(),p("all")):oe.length>1?b(oe):d({keyPressed:oe,sectionIndex:0})}),N=st(ae=>{if(l==null||l(ae),n||g!=="all"){ae.preventDefault();return}const U=ae.clipboardData.getData("text");ae.preventDefault(),h(),b(U)}),L=st((...ae)=>{if(s==null||s(...ae),R||!O.current)return;T(!0),O.current.getSectionIndexFromDOMElement(Ka(document))!=null||p(w.startIndex)}),B=st((...ae)=>{i==null||i(...ae),setTimeout(()=>{if(!O.current)return;const U=Ka(document);!O.current.getRoot().contains(U)&&(T(!1),p(null))})}),$=st(ae=>U=>{U.isDefaultPrevented()||p(ae)}),j=st(ae=>{ae.preventDefault()}),X=st(ae=>()=>{p(ae)}),V=st(ae=>{if(ae.preventDefault(),n||e||typeof g!="number")return;const U=m.sections[g],oe=ae.clipboardData.getData("text"),ne=/^[a-zA-Z]+$/.test(oe),G=/^[0-9]+$/.test(oe),q=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(oe);U.contentType==="letter"&&ne||U.contentType==="digit"&&G||U.contentType==="digit-with-letter"&&q?(h(),x({activeSection:U,newSectionValue:oe,shouldGoToNextSection:!0})):!ne&&!G&&(h(),b(oe))}),Y=st(ae=>{ae.preventDefault(),ae.dataTransfer.dropEffect="none"}),le=st(ae=>{if(!O.current)return;const U=ae.target,oe=U.textContent??"",ne=O.current.getSectionIndexFromDOMElement(U),G=m.sections[ne];if(n||!O.current){I(ne);return}if(oe.length===0){if(G.value===""){I(ne);return}const q=ae.nativeEvent.inputType;if(q==="insertParagraph"||q==="insertLineBreak"){I(ne);return}h(),v();return}d({keyPressed:oe,sectionIndex:ne}),I(ne)});Ei(()=>{if(!(!R||!O.current)){if(g==="all")O.current.getRoot().focus();else if(typeof g=="number"){const ae=O.current.getSectionContent(g);ae&&ae.focus()}}},[g,R]);const K=D.useMemo(()=>m.sections.reduce((ae,U)=>(ae[U.type]=S[U.type]({currentDate:null,contentType:U.contentType,format:U.format}),ae),{}),[S,m.sections]),ee=g==="all",re=D.useMemo(()=>m.sections.map((ae,U)=>{const oe=!ee&&!e&&!n;return{container:{"data-sectionindex":U,onClick:$(U)},content:{tabIndex:ee||U>0?-1:0,contentEditable:!ee&&!e&&!n,role:"spinbutton",id:`${A}-${ae.type}`,"aria-labelledby":`${A}-${ae.type}`,"aria-readonly":n,"aria-valuenow":lsn(ae,P),"aria-valuemin":K[ae.type].minimum,"aria-valuemax":K[ae.type].maximum,"aria-valuetext":ae.value?asn(ae,P):E.empty,"aria-label":E[ae.type],"aria-disabled":e,spellCheck:oe?!1:void 0,autoCapitalize:oe?"off":void 0,autoCorrect:oe?"off":void 0,[parseInt(D.version,10)>=17?"enterKeyHint":"enterkeyhint"]:oe?"next":void 0,children:ae.value||ae.placeholder,onInput:le,onPaste:V,onFocus:X(U),onDragOver:Y,onMouseUp:j,inputMode:ae.contentType==="letter"?"text":"numeric"},before:{children:ae.startSeparator},after:{children:ae.endSeparator}}}),[m.sections,X,V,Y,le,$,j,e,n,ee,E,P,K,A]),me=st(ae=>{b(ae.target.value)}),te=D.useMemo(()=>_?"":f.getV7HiddenInputValueFromSections(m.sections),[_,m.sections,f]);return D.useEffect(()=>{if(O.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `` element instead of a `PickersSectionList`.","","If you want to keep using an `` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(` -`));u&&O.current&&O.current.getSectionContent(w.startIndex).focus()},[]),{interactions:M,returnedValue:{autoFocus:u,readOnly:n,focused:c??R,sectionListRef:k,onBlur:B,onClick:z,onFocus:L,onInput:F,onPaste:N,enableAccessibleFieldDOMStructure:!0,elements:re,tabIndex:g===0?-1:0,contentEditable:ee,value:te,onChange:me,areAllSectionsEmpty:_}}},x_=t=>t.replace(/[\u2066\u2067\u2068\u2069]/g,""),Tsn=(t,e,n)=>{let r=0,i=n?1:0;const o=[];for(let s=0;s{const e=Eo(),n=D.useRef(),r=D.useRef(),{forwardedProps:{onFocus:i,onClick:o,onPaste:s,onBlur:a,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:f=!1},parsedSelectedSections:d,activeSectionIndex:h,state:p,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:x,updateValueFromValueStr:b,clearActiveSection:w,clearValue:_,setTempAndroidValueStr:S,setSelectedSections:O,getSectionsFromValue:k,areAllSectionsEmpty:E,localizedDigits:P}=t,A=D.useRef(null),R=dn(l,A),T=D.useMemo(()=>Tsn(p.sections,P,e),[p.sections,P,e]),M=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!A.current)return;if(d==null){A.current.scrollLeft&&(A.current.scrollLeft=0);return}if(A.current!==Ka(document))return;const le=A.current.scrollTop;if(d==="all")A.current.select();else{const K=T[d],ee=K.type==="empty"?K.startInInput-K.startSeparator.length:K.startInInput,re=K.type==="empty"?K.endInInput+K.endSeparator.length:K.endInInput;(ee!==A.current.selectionStart||re!==A.current.selectionEnd)&&A.current===Ka(document)&&A.current.setSelectionRange(ee,re),clearTimeout(r.current),r.current=setTimeout(()=>{A.current&&A.current===Ka(document)&&A.current.selectionStart===A.current.selectionEnd&&(A.current.selectionStart!==ee||A.current.selectionEnd!==re)&&M.syncSelectionToDOM()})}A.current.scrollTop=le},getActiveSectionIndexFromDOM:()=>{const le=A.current.selectionStart??0,K=A.current.selectionEnd??0;if(le===0&&K===0)return null;const ee=le<=T[0].startInInput?1:T.findIndex(re=>re.startInInput-re.startSeparator.length>le);return ee===-1?T.length-1:ee-1},focusField:(le=0)=>{var K;(K=A.current)==null||K.focus(),O(le)},setSelectedSections:le=>O(le),isFieldFocused:()=>A.current===Ka(document)}),[A,d,T,O]),I=()=>{const le=A.current.selectionStart??0;let K;le<=T[0].startInInput||le>=T[T.length-1].endInInput?K=1:K=T.findIndex(re=>re.startInInput-re.startSeparator.length>le);const ee=K===-1?T.length-1:K-1;O(ee)},z=st((...le)=>{i==null||i(...le);const K=A.current;clearTimeout(n.current),n.current=setTimeout(()=>{!K||K!==A.current||h==null&&(K.value.length&&Number(K.selectionEnd)-Number(K.selectionStart)===K.value.length?O("all"):I())})}),F=st((le,...K)=>{le.isDefaultPrevented()||(o==null||o(le,...K),I())}),N=st(le=>{if(s==null||s(le),le.preventDefault(),u||f)return;const K=le.clipboardData.getData("text");if(typeof d=="number"){const ee=p.sections[d],re=/^[a-zA-Z]+$/.test(K),me=/^[0-9]+$/.test(K),te=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(K);if(ee.contentType==="letter"&&re||ee.contentType==="digit"&&me||ee.contentType==="digit-with-letter"&&te){y(),x({activeSection:ee,newSectionValue:K,shouldGoToNextSection:!0});return}if(re||me)return}y(),b(K)}),L=st((...le)=>{a==null||a(...le),O(null)}),B=st(le=>{if(u)return;const K=le.target.value;if(K===""){y(),_();return}const ee=le.nativeEvent.data,re=ee&&ee.length>1,me=re?ee:K,te=x_(me);if(h==null||re){b(re?ee:te);return}let ae;if(d==="all"&&te.length===1)ae=te;else{const U=x_(g.getV6InputValueFromSections(T,P,e));let oe=-1,ne=-1;for(let de=0;deG.end)return;const Z=te.length-U.length+G.end-x_(G.endSeparator||"").length;ae=te.slice(G.start+x_(G.startSeparator||"").length,Z)}if(ae.length===0){osn()&&S(me),y(),w();return}v({keyPressed:ae,sectionIndex:h})}),$=D.useMemo(()=>c!==void 0?c:g.getV6InputValueFromSections(k(m.emptyValue),P,e),[c,g,k,m.emptyValue,P,e]),j=D.useMemo(()=>p.tempValueStrAndroid??g.getV6InputValueFromSections(p.sections,P,e),[p.sections,g,p.tempValueStrAndroid,P,e]);D.useEffect(()=>(A.current&&A.current===Ka(document)&&O("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const X=D.useMemo(()=>h==null||p.sections[h].contentType==="letter"?"text":"numeric",[h,p.sections]),Y=!(A.current&&A.current===Ka(document))&&E;return{interactions:M,returnedValue:{readOnly:u,onBlur:L,onClick:F,onFocus:z,onPaste:N,inputRef:R,enableAccessibleFieldDOMStructure:!1,placeholder:$,inputMode:X,autoComplete:"off",value:Y?"":j,onChange:B}}},Asn=t=>{const e=gr(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:i,enableAccessibleFieldDOMStructure:o=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:f},fieldValueManager:d,valueManager:h,validator:p}=t,g=Eo(),m=bsn(t),{state:v,activeSectionIndex:y,parsedSelectedSections:x,setSelectedSections:b,clearValue:w,clearActiveSection:_,updateSectionValue:S,setTempAndroidValueStr:O,sectionsValueBoundaries:k,localizedDigits:E,timezone:P}=m,A=_sn({sections:v.sections,updateSectionValue:S,sectionsValueBoundaries:k,localizedDigits:E,setTempAndroidValueStr:O,timezone:P}),{resetCharacterQuery:R}=A,T=h.areValuesEqual(e,v.value,h.emptyValue),M=o?Esn:ksn,I=D.useMemo(()=>ssn(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:z,interactions:F}=M(ve({},t,m,A,{areAllSectionsEmpty:T,sectionOrder:I})),N=st(V=>{if(l==null||l(V),!s)switch(!0){case((V.ctrlKey||V.metaKey)&&String.fromCharCode(V.keyCode)==="A"&&!V.shiftKey&&!V.altKey):{V.preventDefault(),b("all");break}case V.key==="ArrowRight":{if(V.preventDefault(),x==null)b(I.startIndex);else if(x==="all")b(I.endIndex);else{const Y=I.neighbors[x].rightIndex;Y!==null&&b(Y)}break}case V.key==="ArrowLeft":{if(V.preventDefault(),x==null)b(I.endIndex);else if(x==="all")b(I.startIndex);else{const Y=I.neighbors[x].leftIndex;Y!==null&&b(Y)}break}case V.key==="Delete":{if(V.preventDefault(),a)break;x==null||x==="all"?w():_(),R();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(V.key):{if(V.preventDefault(),a||y==null)break;const Y=v.sections[y],le=d.getActiveDateManager(e,v,Y),K=Jon(e,P,Y,V.key,k,E,le.date,{minutesStep:i});S({activeSection:Y,newSectionValue:K,shouldGoToNextSection:!1});break}}});Ei(()=>{F.syncSelectionToDOM()});const{hasValidationError:L}=xVe({props:n,validator:p,timezone:P,value:v.value,onError:n.onError}),B=D.useMemo(()=>c!==void 0?c:L,[L,c]);D.useEffect(()=>{!B&&y==null&&R()},[v.referenceValue,y,B]),D.useEffect(()=>{v.tempValueStrAndroid!=null&&y!=null&&(R(),_())},[v.sections]),D.useImperativeHandle(r,()=>({getSections:()=>v.sections,getActiveSectionIndex:F.getActiveSectionIndexFromDOM,setSelectedSections:F.setSelectedSections,focusField:F.focusField,isFieldFocused:F.isFieldFocused}));const $=st((V,...Y)=>{V.preventDefault(),f==null||f(V,...Y),w(),F.isFieldFocused()?b(I.startIndex):F.focusField(0)}),j={onKeyDown:N,onClear:$,error:B,clearable:!!(u&&!T&&!a&&!s)},X={disabled:s,readOnly:a};return ve({},t.forwardedProps,j,X,z)},Psn=lt(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Msn=lt(C.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),Rsn=lt(C.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),Dsn=lt(C.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");lt(C.jsxs(D.Fragment,{children:[C.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"}),C.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");const Isn=lt(C.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"),Lsn=lt(C.jsxs(D.Fragment,{children:[C.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"}),C.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),$sn=lt(C.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"}),"Clear"),Fsn=["clearable","onClear","InputProps","sx","slots","slotProps"],Nsn=["ownerState"],zsn=t=>{const e=Ml(),{clearable:n,onClear:r,InputProps:i,sx:o,slots:s,slotProps:a}=t,l=Dt(t,Fsn),c=(s==null?void 0:s.clearButton)??Gt,u=Zt({elementType:c,externalSlotProps:a==null?void 0:a.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:e.fieldClearLabel}}),f=Dt(u,Nsn),d=(s==null?void 0:s.clearIcon)??$sn,h=Zt({elementType:d,externalSlotProps:a==null?void 0:a.clearIcon,ownerState:{}});return ve({},l,{InputProps:ve({},i,{endAdornment:C.jsxs(D.Fragment,{children:[n&&C.jsx(EPe,{position:"end",sx:{marginRight:i!=null&&i.endAdornment?-1:-1.5},children:C.jsx(c,ve({},f,{onClick:r,children:C.jsx(d,ve({fontSize:"small"},h))}))}),i==null?void 0:i.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})},jsn=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],Bsn=(t,e)=>D.useMemo(()=>{const n=ve({},t),r={},i=o=>{n.hasOwnProperty(o)&&(r[o]=n[o],delete n[o])};return jsn.forEach(i),hVe.forEach(i),pVe.forEach(i),gVe.forEach(i),{forwardedProps:n,internalProps:r}},[t,e]),Usn=D.createContext(null);function bVe(t){const{contextValue:e,localeText:n,children:r}=t;return C.jsx(Usn.Provider,{value:e,children:C.jsx(iVe,{localeText:n,children:r})})}const Wsn=t=>{const e=gr(),n=nD(),i=t.ampm??e.is12HourCycleInCurrentLocale()?e.formats.keyboardDateTime12h:e.formats.keyboardDateTime24h;return ve({},t,{disablePast:t.disablePast??!1,disableFuture:t.disableFuture??!1,format:t.format??i,disableIgnoringDatePartForTimeValidation:!!(t.minDateTime||t.maxDateTime),minDate:Ru(e,t.minDateTime??t.minDate,n.minDate),maxDate:Ru(e,t.maxDateTime??t.maxDate,n.maxDate),minTime:t.minDateTime??t.minTime,maxTime:t.maxDateTime??t.maxTime})},Vsn=t=>{const e=Wsn(t),{forwardedProps:n,internalProps:r}=Bsn(e,"date-time");return Asn({forwardedProps:n,internalProps:r,valueManager:ia,fieldValueManager:usn,validator:_U,valueType:"date-time"})};function Gsn(t){return Xe("MuiPickersTextField",t)}He("MuiPickersTextField",["root","focused","disabled","error","required"]);function Hsn(t){return Xe("MuiPickersInputBase",t)}const K_=He("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function qsn(t){return Xe("MuiPickersSectionList",t)}const b2=He("MuiPickersSectionList",["root","section","sectionContent"]),Xsn=["slots","slotProps","elements","sectionListRef"],wVe=be("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(t,e)=>e.root})({direction:"ltr /*! @noflip */",outline:"none"}),_Ve=be("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(t,e)=>e.section})({}),SVe=be("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(t,e)=>e.sectionSeparator})({whiteSpace:"pre"}),CVe=be("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(t,e)=>e.sectionContent})({outline:"none"}),Ysn=t=>{const{classes:e}=t;return qe({root:["root"],section:["section"],sectionContent:["sectionContent"]},qsn,e)};function Qsn(t){const{slots:e,slotProps:n,element:r,classes:i}=t,o=(e==null?void 0:e.section)??_Ve,s=Zt({elementType:o,externalSlotProps:n==null?void 0:n.section,externalForwardedProps:r.container,className:i.section,ownerState:{}}),a=(e==null?void 0:e.sectionContent)??CVe,l=Zt({elementType:a,externalSlotProps:n==null?void 0:n.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:i.sectionContent,ownerState:{}}),c=(e==null?void 0:e.sectionSeparator)??SVe,u=Zt({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Zt({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return C.jsxs(o,ve({},s,{children:[C.jsx(c,ve({},u)),C.jsx(a,ve({},l)),C.jsx(c,ve({},f))]}))}const Ksn=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersSectionList"}),{slots:i,slotProps:o,elements:s,sectionListRef:a}=r,l=Dt(r,Xsn),c=Ysn(r),u=D.useRef(null),f=dn(n,u),d=g=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${g} before the mount of the component.`);return u.current};D.useImperativeHandle(a,()=>({getRoot(){return d("getRoot")},getSectionContainer(g){return d("getSectionContainer").querySelector(`.${b2.section}[data-sectionindex="${g}"]`)},getSectionContent(g){return d("getSectionContent").querySelector(`.${b2.section}[data-sectionindex="${g}"] .${b2.sectionContent}`)},getSectionIndexFromDOMElement(g){const m=d("getSectionIndexFromDOMElement");if(g==null||!m.contains(g))return null;let v=null;return g.classList.contains(b2.section)?v=g:g.classList.contains(b2.sectionContent)&&(v=g.parentElement),v==null?null:Number(v.dataset.sectionindex)}}));const h=(i==null?void 0:i.root)??wVe,p=Zt({elementType:h,externalSlotProps:o==null?void 0:o.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return C.jsx(h,ve({},p,{children:p.contentEditable?s.map(({content:g,before:m,after:v})=>`${m.children}${g.children}${v.children}`).join(""):C.jsx(D.Fragment,{children:s.map((g,m)=>C.jsx(Qsn,{slots:i,slotProps:o,element:g,classes:c},m))})}))}),Zsn=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],Jsn=t=>Math.round(t*1e5)/1e5,SU=be("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>ve({},t.typography.body1,{color:(t.vars||t).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Jsn(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),$le=be(wVe,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})(({theme:t})=>({padding:"4px 0 5px",fontFamily:t.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:n,filled:r,label:i})=>!e&&!n&&!r&&i==null,style:t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:t.palette.mode==="light"?.42:.5}}]})),ean=be(_Ve,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(t,e)=>e.section})(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"flex"})),tan=be(CVe,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(t,e)=>e.content})(({theme:t})=>({fontFamily:t.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),nan=be(SVe,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(t,e)=>e.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),ran=be("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(t,e)=>e.hiddenInput})(ve({},jAe)),ian=t=>{const{focused:e,disabled:n,error:r,classes:i,fullWidth:o,readOnly:s,color:a,size:l,endAdornment:c,startAdornment:u}=t,f={root:["root",e&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",o&&"fullWidth",`color${Me(a)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return qe(f,Hsn,i)},Fle=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:o,value:s,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:f,slots:d,slotProps:h,contentEditable:p,tabIndex:g,onInput:m,onPaste:v,onKeyDown:y,name:x,readOnly:b,inputProps:w,inputRef:_,sectionListRef:S}=r,O=Dt(r,Zsn),k=D.useRef(null),E=dn(n,k),P=dn(w==null?void 0:w.ref,_),A=Eo(),R=Na();if(!R)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const T=L=>{var B;if(R.disabled){L.stopPropagation();return}(B=R.onFocus)==null||B.call(R,L)};D.useEffect(()=>{R&&R.setAdornedStart(!!u)},[R,u]),D.useEffect(()=>{R&&(o?R.onEmpty():R.onFilled())},[R,o]);const M=ve({},r,R,{isRtl:A}),I=ian(M),z=(d==null?void 0:d.root)||SU,F=Zt({elementType:z,externalSlotProps:h==null?void 0:h.root,externalForwardedProps:O,additionalProps:{"aria-invalid":R.error,ref:E},className:I.root,ownerState:M}),N=(d==null?void 0:d.input)||$le;return C.jsxs(z,ve({},F,{children:[u,C.jsx(Ksn,{sectionListRef:S,elements:i,contentEditable:p,tabIndex:g,className:I.sectionsContainer,onFocus:T,onBlur:R.onBlur,onInput:m,onPaste:v,onKeyDown:y,slots:{root:N,section:ean,sectionContent:tan,sectionSeparator:nan},slotProps:{root:{ownerState:M},sectionContent:{className:K_.sectionContent},sectionSeparator:({position:L})=>({className:L==="before"?K_.sectionBefore:K_.sectionAfter})}}),c,f?f(ve({},R)):null,C.jsx(ran,ve({name:x,className:I.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:b,required:R.required,disabled:R.disabled},w,{ref:P}))]}))});function oan(t){return Xe("MuiPickersOutlinedInput",t)}const Yu=ve({},K_,He("MuiPickersOutlinedInput",["root","notchedOutline","input"])),san=["children","className","label","notched","shrink"],aan=be("fieldset",{name:"MuiPickersOutlinedInput",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{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%",borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),zbe=be("span")(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit"})),lan=be("legend")(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}));function can(t){const{className:e,label:n}=t,r=Dt(t,san),i=n!=null&&n!=="",o=ve({},t,{withLabel:i});return C.jsx(aan,ve({"aria-hidden":!0,className:e},r,{ownerState:o,children:C.jsx(lan,{ownerState:o,children:i?C.jsx(zbe,{children:n}):C.jsx(zbe,{className:"notranslate",children:"​"})})}))}const uan=["label","autoFocus","ownerState","notched"],fan=be(SU,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Yu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Yu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Yu.focused} .${Yu.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Yu.disabled}`]:{[`& .${Yu.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled},"*":{color:(t.vars||t).palette.action.disabled}},[`&.${Yu.error} .${Yu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},variants:Object.keys((t.vars??t).palette).filter(n=>{var r;return((r=(t.vars??t).palette[n])==null?void 0:r.main)??!1}).map(n=>({props:{color:n},style:{[`&.${Yu.focused}:not(.${Yu.error}) .${Yu.notchedOutline}`]:{borderColor:(t.vars||t).palette[n].main}}}))}}),dan=be($le,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),han=t=>{const{classes:e}=t,r=qe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},oan,e);return ve({},e,r)},OVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:o,notched:s}=r,a=Dt(r,uan),l=Na(),c=ve({},r,o,l,{color:(l==null?void 0:l.color)||"primary"}),u=han(c);return C.jsx(Fle,ve({slots:{root:fan,input:dan},renderSuffix:f=>C.jsx(can,{shrink:!!(s||f.adornedStart||f.focused||f.filled),notched:!!(s||f.adornedStart||f.focused||f.filled),className:u.notchedOutline,label:i!=null&&i!==""&&(l!=null&&l.required)?C.jsxs(D.Fragment,{children:[i," ","*"]}):i,ownerState:c})},a,{label:i,classes:u,ref:n}))});OVe.muiName="Input";function pan(t){return Xe("MuiPickersFilledInput",t)}const A0=ve({},K_,He("MuiPickersFilledInput",["root","underline","input"])),gan=["label","autoFocus","disableUnderline","ownerState"],man=be(SU,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>n3(t)&&t!=="disableUnderline"})(({theme:t})=>{const e=t.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r,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:i,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r}},[`&.${A0.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r},[`&.${A0.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[...Object.keys((t.vars??t).palette).filter(s=>(t.vars??t).palette[s].main).map(s=>{var a;return{props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(a=(t.vars||t).palette[s])==null?void 0:a.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{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"},[`&.${A0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${A0.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})`:n}`,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(.${A0.disabled}, .${A0.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${A0.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:s})=>!!s,style:{paddingLeft:12}},{props:({endAdornment:s})=>!!s,style:{paddingRight:12}}]}}),van=be($le,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:t})=>!!t,style:{paddingLeft:0}},{props:({endAdornment:t})=>!!t,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),yan=t=>{const{classes:e,disableUnderline:n}=t,i=qe({root:["root",!n&&"underline"],input:["input"]},pan,e);return ve({},e,i)},EVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=Dt(r,gan),l=Na(),c=ve({},r,s,l,{color:(l==null?void 0:l.color)||"primary"}),u=yan(c);return C.jsx(Fle,ve({slots:{root:man,input:van},slotProps:{root:{disableUnderline:o}}},a,{label:i,classes:u,ref:n}))});EVe.muiName="Input";function xan(t){return Xe("MuiPickersFilledInput",t)}const w2=ve({},K_,He("MuiPickersInput",["root","input"])),ban=["label","autoFocus","disableUnderline","ownerState"],wan=be(SU,{name:"MuiPickersInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{let n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((t.vars??t).palette).filter(r=>(t.vars??t).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",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"},[`&.${w2.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${w2.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,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(.${w2.disabled}, .${w2.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${w2.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),_an=t=>{const{classes:e,disableUnderline:n}=t,i=qe({root:["root",!n&&"underline"],input:["input"]},xan,e);return ve({},e,i)},TVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=Dt(r,ban),l=Na(),c=ve({},r,s,l,{disableUnderline:o,color:(l==null?void 0:l.color)||"primary"}),u=_an(c);return C.jsx(Fle,ve({slots:{root:wan}},a,{label:i,classes:u,ref:n}))});TVe.muiName="Input";const San=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],Can={standard:TVe,filled:EVe,outlined:OVe},Oan=be(td,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Ean=t=>{const{focused:e,disabled:n,classes:r,required:i}=t;return qe({root:["root",e&&!n&&"focused",n&&"disabled",i&&"required"]},Gsn,r)},Tan=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersTextField"}),{onFocus:i,onBlur:o,className:s,color:a="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:f=!1,InputProps:d,inputProps:h,inputRef:p,sectionListRef:g,elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:x,onKeyUp:b,onPaste:w,onInput:_,endAdornment:S,startAdornment:O,tabIndex:k,contentEditable:E,focused:P,value:A,onChange:R,fullWidth:T,id:M,name:I,helperText:z,FormHelperTextProps:F,label:N,InputLabelProps:L}=r,B=Dt(r,San),$=D.useRef(null),j=dn(n,$),X=Jf(M),V=z&&X?`${X}-helper-text`:void 0,Y=N&&X?`${X}-label`:void 0,le=ve({},r,{color:a,disabled:l,error:c,focused:P,required:f,variant:u}),K=Ean(le),ee=Can[u];return C.jsxs(Oan,ve({className:Oe(K.root,s),ref:j,focused:P,onFocus:i,onBlur:o,disabled:l,variant:u,error:c,color:a,fullWidth:T,required:f,ownerState:le},B,{children:[C.jsx(Fy,ve({htmlFor:X,id:Y},L,{children:N})),C.jsx(ee,ve({elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:x,onKeyUp:b,onInput:_,onPaste:w,endAdornment:S,startAdornment:O,tabIndex:k,contentEditable:E,value:A,onChange:R,id:X,fullWidth:T,inputProps:h,inputRef:p,sectionListRef:g,label:N,name:I,role:"group","aria-labelledby":Y},d)),z&&C.jsx(Xee,ve({id:V},F,{children:z}))]}))}),kan=["enableAccessibleFieldDOMStructure"],Aan=["InputProps","readOnly"],Pan=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],Man=t=>{let{enableAccessibleFieldDOMStructure:e}=t,n=Dt(t,kan);if(e){const{InputProps:f,readOnly:d}=n,h=Dt(n,Aan);return ve({},h,{InputProps:ve({},f??{},{readOnly:d})})}const{onPaste:r,onKeyDown:i,inputMode:o,readOnly:s,InputProps:a,inputProps:l,inputRef:c}=n,u=Dt(n,Pan);return ve({},u,{InputProps:ve({},a??{},{readOnly:s}),inputProps:ve({},l??{},{inputMode:o,onPaste:r,onKeyDown:i,ref:c})})},Ran=["slots","slotProps","InputProps","inputProps"],kVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiDateTimeField"}),{slots:i,slotProps:o,InputProps:s,inputProps:a}=r,l=Dt(r,Ran),c=r,u=(i==null?void 0:i.textField)??(e.enableAccessibleFieldDOMStructure?Tan:Jr),f=Zt({elementType:u,externalSlotProps:o==null?void 0:o.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});f.inputProps=ve({},a,f.inputProps),f.InputProps=ve({},s,f.InputProps);const d=Vsn(f),h=Man(d),p=zsn(ve({},h,{slots:i,slotProps:o}));return C.jsx(u,ve({},p))});function Dan(t){return Xe("MuiDateTimePickerTabs",t)}He("MuiDateTimePickerTabs",["root"]);const Ian=t=>vC(t)?"date":"time",Lan=t=>t==="date"?"day":"hours",$an=t=>{const{classes:e}=t;return qe({root:["root"]},Dan,e)},Fan=be(O4,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({boxShadow:`0 -1px 0 0 inset ${(t.vars||t).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(t.vars||t).palette.divider}`,[`& .${a3.indicator}`]:{bottom:"auto",top:0}}})),Nan=function(e){const n=kn({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:r=C.jsx(Isn,{}),onViewChange:i,timeIcon:o=C.jsx(Lsn,{}),view:s,hidden:a=typeof window>"u"||window.innerHeight<667,className:l,sx:c}=n,u=Ml(),f=$an(n),d=(h,p)=>{i(Lan(p))};return a?null:C.jsxs(Fan,{ownerState:n,variant:"fullWidth",value:Ian(s),onChange:d,className:Oe(l,f.root),sx:c,children:[C.jsx(sb,{value:"date","aria-label":u.dateTableLabel,icon:C.jsx(D.Fragment,{children:r})}),C.jsx(sb,{value:"time","aria-label":u.timeTableLabel,icon:C.jsx(D.Fragment,{children:o})})]})};function zan(t){return Xe("MuiPickersToolbarText",t)}const VQ=He("MuiPickersToolbarText",["root","selected"]),jan=["className","selected","value"],Ban=t=>{const{classes:e,selected:n}=t;return qe({root:["root",n&&"selected"]},zan,e)},Uan=be(Jt,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${VQ.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:(t.vars||t).palette.text.secondary,[`&.${VQ.selected}`]:{color:(t.vars||t).palette.text.primary}})),AVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersToolbarText"}),{className:i,value:o}=r,s=Dt(r,jan),a=Ban(r);return C.jsx(Uan,ve({ref:n,className:Oe(a.root,i),component:"span"},s,{children:o}))});function PVe(t){return Xe("MuiPickersToolbar",t)}const Wan=He("MuiPickersToolbar",["root","content"]),Van=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Gan=t=>{const{classes:e,isLandscape:n}=t;return qe({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},PVe,e)},Han=be("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),qan=be("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),Xan=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersToolbar"}),{children:i,className:o,toolbarTitle:s,hidden:a,titleId:l}=r,c=Dt(r,Van),u=r,f=Gan(u);return a?null:C.jsxs(Han,ve({ref:n,className:Oe(f.root,o),ownerState:u},c,{children:[C.jsx(Jt,{color:"text.secondary",variant:"overline",id:l,children:s}),C.jsx(qan,{className:f.content,ownerState:u,children:i})]}))}),Yan=["align","className","selected","typographyClassName","value","variant","width"],Qan=t=>{const{classes:e}=t;return qe({root:["root"]},PVe,e)},Kan=be(Hr,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),xm=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:o,selected:s,typographyClassName:a,value:l,variant:c,width:u}=r,f=Dt(r,Yan),d=Qan(r);return C.jsx(Kan,ve({variant:"text",ref:n,className:Oe(d.root,o)},u?{sx:{width:u}}:{},f,{children:C.jsx(AVe,{align:i,className:a,variant:c,value:l,selected:s})}))});function Zan(t){return Xe("MuiDateTimePickerToolbar",t)}const Y9=He("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]);function Jan(t,{disableFuture:e,maxDate:n,timezone:r}){const i=gr();return D.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(e&&i.isBefore(o,n)?o:n);return!i.isAfter(s,t)},[e,n,t,i,r])}function eln(t,{disablePast:e,minDate:n,timezone:r}){const i=gr();return D.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(e&&i.isAfter(o,n)?o:n);return!i.isBefore(s,t)},[e,n,t,i,r])}function Nle(t,e,n,r){const i=gr(),o=Hon(t,i),s=D.useCallback(a=>{const l=t==null?null:qon(t,a,!!e,i);n(l,r??"partial")},[e,t,n,r,i]);return{meridiemMode:o,handleMeridiemChange:s}}const iP=36,CU=2,OU=320,tln=280,EU=336,MVe=232,AT=48,nln=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],rln=t=>{const{classes:e,isLandscape:n,isRtl:r}=t;return qe({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},Zan,e)},iln=be(Xan,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,[`& .${Wan.content} .${VQ.selected}`]:{color:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(t.vars||t).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),oln=be("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(t,e)=>e.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),sln=be("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(t,e)=>e.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:t,toolbarVariant:e})=>t&&e!=="desktop",style:{flexDirection:"column"}},{props:({isLandscape:t,toolbarVariant:e,isRtl:n})=>t&&e!=="desktop"&&n,style:{flexDirection:"column-reverse"}}]}),aln=be("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(t,e)=>e.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),jbe=be(AVe,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),lln=be("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(t,e)=>[{[`.${Y9.ampmLabel}`]:e.ampmLabel},{[`&.${Y9.ampmLandscape}`]:e.ampmLandscape},e.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${Y9.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function cln(t){const e=kn({props:t,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:i,onChange:o,view:s,isLandscape:a,onViewChange:l,toolbarFormat:c,toolbarPlaceholder:u="––",views:f,disabled:d,readOnly:h,toolbarVariant:p="mobile",toolbarTitle:g,className:m}=e,v=Dt(e,nln),y=Eo(),x=ve({},e,{isRtl:y}),b=gr(),{meridiemMode:w,handleMeridiemChange:_}=Nle(i,n,o),S=!!(n&&!r),O=p==="desktop",k=Ml(),E=rln(x),P=g??k.dateTimePickerToolbarTitle,A=T=>n?b.format(T,"hours12h"):b.format(T,"hours24h"),R=D.useMemo(()=>i?c?b.formatByString(i,c):b.format(i,"shortDate"):u,[i,c,u,b]);return C.jsxs(iln,ve({isLandscape:a,className:Oe(E.root,m),toolbarTitle:P},v,{ownerState:x,children:[C.jsxs(oln,{className:E.dateContainer,ownerState:x,children:[f.includes("year")&&C.jsx(xm,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:s==="year",value:i?b.format(i,"year"):"–"}),f.includes("day")&&C.jsx(xm,{tabIndex:-1,variant:O?"h5":"h4",onClick:()=>l("day"),selected:s==="day",value:R})]}),C.jsxs(sln,{className:E.timeContainer,ownerState:x,children:[C.jsxs(aln,{className:E.timeDigitsContainer,ownerState:x,children:[f.includes("hours")&&C.jsxs(D.Fragment,{children:[C.jsx(xm,{variant:O?"h5":"h3",width:O&&!a?AT:void 0,onClick:()=>l("hours"),selected:s==="hours",value:i?A(i):"--"}),C.jsx(jbe,{variant:O?"h5":"h3",value:":",className:E.separator,ownerState:x}),C.jsx(xm,{variant:O?"h5":"h3",width:O&&!a?AT:void 0,onClick:()=>l("minutes"),selected:s==="minutes"||!f.includes("minutes")&&s==="hours",value:i?b.format(i,"minutes"):"--",disabled:!f.includes("minutes")})]}),f.includes("seconds")&&C.jsxs(D.Fragment,{children:[C.jsx(jbe,{variant:O?"h5":"h3",value:":",className:E.separator,ownerState:x}),C.jsx(xm,{variant:O?"h5":"h3",width:O&&!a?AT:void 0,onClick:()=>l("seconds"),selected:s==="seconds",value:i?b.format(i,"seconds"):"--"})]})]}),S&&!O&&C.jsxs(lln,{className:E.ampmSelection,ownerState:x,children:[C.jsx(xm,{variant:"subtitle2",selected:w==="am",typographyClassName:E.ampmLabel,value:tg(b,"am"),onClick:h?void 0:()=>_("am"),disabled:d}),C.jsx(xm,{variant:"subtitle2",selected:w==="pm",typographyClassName:E.ampmLabel,value:tg(b,"pm"),onClick:h?void 0:()=>_("pm"),disabled:d})]}),n&&O&&C.jsx(xm,{variant:"h5",onClick:()=>l("meridiem"),selected:s==="meridiem",value:i&&w?tg(b,w):"--",width:AT})]})]}))}function RVe(t,e){var a;const n=gr(),r=nD(),i=kn({props:t,name:e}),o=i.ampm??n.is12HourCycleInCurrentLocale(),s=D.useMemo(()=>{var l;return((l=i.localeText)==null?void 0:l.toolbarTitle)==null?i.localeText:ve({},i.localeText,{dateTimePickerToolbarTitle:i.localeText.toolbarTitle})},[i.localeText]);return ve({},i,Bon({views:i.views,openTo:i.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:s,orientation:i.orientation??"portrait",disableIgnoringDatePartForTimeValidation:i.disableIgnoringDatePartForTimeValidation??!!(i.minDateTime||i.maxDateTime||i.disablePast||i.disableFuture),disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,minDate:Ru(n,i.minDateTime??i.minDate,r.minDate),maxDate:Ru(n,i.maxDateTime??i.maxDate,r.maxDate),minTime:i.minDateTime??i.minTime,maxTime:i.maxDateTime??i.maxTime,slots:ve({toolbar:cln,tabs:Nan},i.slots),slotProps:ve({},i.slotProps,{toolbar:ve({ampm:o},(a=i.slotProps)==null?void 0:a.toolbar)})})}const DVe=({shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s,timezone:a})=>{const l=A1();return D.useCallback(c=>Ile({adapter:l,value:c,timezone:a,props:{shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s}})!==null,[l,t,e,n,r,i,o,s,a])},uln=(t,e,n)=>(r,i)=>{switch(i.type){case"changeMonth":return ve({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return ve({},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 ve({},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")}},fln=t=>{const{value:e,referenceDate:n,disableFuture:r,disablePast:i,disableSwitchToMonthOnDayFocus:o=!1,maxDate:s,minDate:a,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:f}=t,d=gr(),h=D.useRef(uln(!!c,o,d)).current,p=D.useMemo(()=>ia.getInitialReferenceValue({value:e,utils:d,timezone:f,props:t,referenceDate:n,granularity:xf.day}),[]),[g,m]=D.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:p,currentMonth:d.startOfMonth(p),slideDirection:"left"}),v=D.useCallback(_=>{m(ve({type:"changeMonth"},_)),l&&l(_.newMonth)},[l]),y=D.useCallback(_=>{const S=_;d.isSameMonth(S,g.currentMonth)||v({newMonth:d.startOfMonth(S),direction:d.isAfterDay(S,g.currentMonth)?"left":"right"})},[g.currentMonth,v,d]),x=DVe({shouldDisableDate:u,minDate:a,maxDate:s,disableFuture:r,disablePast:i,timezone:f}),b=D.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),w=st((_,S)=>{x(_)||m({type:"changeFocusedDay",focusedDay:_,withoutMonthSwitchingAnimation:S})});return{referenceDate:p,calendarState:g,changeMonth:y,changeFocusedDay:w,isDateDisabled:x,onMonthSwitchingAnimationEnd:b,handleChangeMonth:v}},dln=t=>Xe("MuiPickersFadeTransitionGroup",t);He("MuiPickersFadeTransitionGroup",["root"]);const hln=t=>{const{classes:e}=t;return qe({root:["root"]},dln,e)},pln=be(AM,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function IVe(t){const e=kn({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,s=hln(e),a=To();return i?n:C.jsx(pln,{className:Oe(s.root,r),children:C.jsx(eO,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},o)})}function gln(t){return Xe("MuiPickersDay",t)}const P0=He("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),mln=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],vln=t=>{const{selected:e,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=t,c=s&&!a;return qe({root:["root",e&&!c&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",s&&a&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},gln,l)},LVe=({theme:t})=>ve({},t.typography.caption,{width:iP,height:iP,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),color:(t.vars||t).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.primary.main,t.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.primary.main,t.palette.action.focusOpacity),[`&.${P0.selected}`]:{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${P0.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${P0.disabled}:not(.${P0.selected})`]:{color:(t.vars||t).palette.text.disabled},[`&.${P0.disabled}&.${P0.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${CU}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(t.vars||t).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${P0.selected})`]:{border:`1px solid ${(t.vars||t).palette.text.secondary}`}}}]}),$Ve=(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]},yln=be(Ff,{name:"MuiPickersDay",slot:"Root",overridesResolver:$Ve})(LVe),xln=be("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:$Ve})(({theme:t})=>ve({},LVe({theme:t}),{opacity:0,pointerEvents:"none"})),_2=()=>{},bln=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:o,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:d,onFocus:h=_2,onBlur:p=_2,onKeyDown:g=_2,onMouseDown:m=_2,onMouseEnter:v=_2,outsideCurrentMonth:y,selected:x=!1,showDaysOutsideCurrentMonth:b=!1,children:w,today:_=!1}=r,S=Dt(r,mln),O=ve({},r,{autoFocus:i,disabled:a,disableHighlightToday:l,disableMargin:c,selected:x,showDaysOutsideCurrentMonth:b,today:_}),k=vln(O),E=gr(),P=D.useRef(null),A=dn(P,n);Ei(()=>{i&&!a&&!u&&!y&&P.current.focus()},[i,a,u,y]);const R=M=>{m(M),y&&M.preventDefault()},T=M=>{a||d(s),y&&M.currentTarget.focus(),f&&f(M)};return y&&!b?C.jsx(xln,{className:Oe(k.root,k.hiddenDaySpacingFiller,o),ownerState:O,role:S.role}):C.jsx(yln,ve({className:Oe(k.root,o),ref:A,centerRipple:!0,disabled:a,tabIndex:x?0:-1,onKeyDown:M=>g(M,s),onFocus:M=>h(M,s),onBlur:M=>p(M,s),onMouseEnter:M=>v(M,s),onClick:T,onMouseDown:R},S,{ownerState:O,children:w||E.format(s,"dayOfMonth")}))}),wln=D.memo(bln),_ln=t=>Xe("MuiPickersSlideTransition",t),jc=He("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),Sln=["children","className","reduceAnimations","slideDirection","transKey","classes"],Cln=t=>{const{classes:e,slideDirection:n}=t,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return qe(r,_ln,e)},Oln=be(AM,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`.${jc["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${jc["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${jc.slideEnterActive}`]:e.slideEnterActive},{[`.${jc.slideExit}`]:e.slideExit},{[`.${jc["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${jc["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:t})=>{const e=t.transitions.create("transform",{duration:t.transitions.duration.complex,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},[`& .${jc["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${jc["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${jc.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${jc.slideExit}`]:{transform:"translate(0%)"},[`& .${jc["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${jc["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}});function Eln(t){const e=kn({props:t,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,s=Dt(e,Sln),a=Cln(e),l=To();if(i)return C.jsx("div",{className:Oe(a.root,r),children:n});const c={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return C.jsx(Oln,{className:Oe(a.root,r),childFactory:u=>D.cloneElement(u,{classNames:c}),role:"presentation",children:C.jsx(Lee,ve({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},s,{children:n}),o)})}const Tln=t=>Xe("MuiDayCalendar",t);He("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const kln=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],Aln=["ownerState"],Pln=t=>{const{classes:e}=t;return qe({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},Tln,e)},FVe=(iP+CU*2)*6,Mln=be("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Rln=be("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),Dln=be(Jt,{name:"MuiDayCalendar",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.vars||t).palette.text.secondary})),Iln=be(Jt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(t,e)=>e.weekNumberLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.disabled})),Lln=be(Jt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(t,e)=>e.weekNumber})(({theme:t})=>ve({},t.typography.caption,{width:iP,height:iP,padding:0,margin:`0 ${CU}px`,color:t.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),$ln=be("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:FVe}),Fln=be(Eln,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:FVe}),Nln=be("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),zln=be("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${CU}px 0`,display:"flex",justifyContent:"center"});function jln(t){let{parentProps:e,day:n,focusableDay:r,selectedDays:i,isDateDisabled:o,currentMonthNumber:s,isViewFocused:a}=t,l=Dt(t,kln);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:d,slots:h,slotProps:p,timezone:g}=e,m=gr(),v=P1(g),y=r!==null&&m.isSameDay(n,r),x=i.some(A=>m.isSameDay(A,n)),b=m.isSameDay(n,v),w=(h==null?void 0:h.day)??wln,_=Zt({elementType:w,externalSlotProps:p==null?void 0:p.day,additionalProps:ve({disableHighlightToday:u,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:f,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:ve({},e,{day:n,selected:x})}),S=Dt(_,Aln),O=D.useMemo(()=>c||o(n),[c,o,n]),k=D.useMemo(()=>m.getMonth(n)!==s,[m,n,s]),E=D.useMemo(()=>{const A=m.startOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.startOfWeek(A)):m.isSameDay(n,A)},[s,n,d,m]),P=D.useMemo(()=>{const A=m.endOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.endOfWeek(A)):m.isSameDay(n,A)},[s,n,d,m]);return C.jsx(w,ve({},S,{day:n,disabled:O,autoFocus:a&&y,today:b,outsideCurrentMonth:k,isFirstVisibleCell:E,isLastVisibleCell:P,selected:x,tabIndex:y?0:-1,"aria-selected":x,"aria-current":b?"date":void 0}))}function Bln(t){const e=kn({props:t,name:"MuiDayCalendar"}),n=gr(),{onFocusedDayChange:r,className:i,currentMonth:o,selectedDays:s,focusedDay:a,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:f,reduceAnimations:d,renderLoading:h=()=>C.jsx("span",{children:"..."}),slideDirection:p,TransitionProps:g,disablePast:m,disableFuture:v,minDate:y,maxDate:x,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:_,dayOfWeekFormatter:S=ne=>n.format(ne,"weekdayShort").charAt(0).toUpperCase(),hasFocus:O,onFocusedViewChange:k,gridLabelId:E,displayWeekNumber:P,fixedWeekNumber:A,autoFocus:R,timezone:T}=e,M=P1(T),I=Pln(e),z=Eo(),F=DVe({shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:_,minDate:y,maxDate:x,disablePast:m,disableFuture:v,timezone:T}),N=Ml(),[L,B]=bc({name:"DayCalendar",state:"hasFocus",controlled:O,default:R??!1}),[$,j]=D.useState(()=>a||M),X=st(ne=>{f||c(ne)}),V=ne=>{F(ne)||(r(ne),j(ne),k==null||k(!0),B(!0))},Y=st((ne,G)=>{switch(ne.key){case"ArrowUp":V(n.addDays(G,-7)),ne.preventDefault();break;case"ArrowDown":V(n.addDays(G,7)),ne.preventDefault();break;case"ArrowLeft":{const q=n.addDays(G,z?1:-1),Z=n.addMonths(G,z?1:-1),de=Sk({utils:n,date:q,minDate:z?q:n.startOfMonth(Z),maxDate:z?n.endOfMonth(Z):q,isDateDisabled:F,timezone:T});V(de||q),ne.preventDefault();break}case"ArrowRight":{const q=n.addDays(G,z?-1:1),Z=n.addMonths(G,z?-1:1),de=Sk({utils:n,date:q,minDate:z?n.startOfMonth(Z):q,maxDate:z?q:n.endOfMonth(Z),isDateDisabled:F,timezone:T});V(de||q),ne.preventDefault();break}case"Home":V(n.startOfWeek(G)),ne.preventDefault();break;case"End":V(n.endOfWeek(G)),ne.preventDefault();break;case"PageUp":V(n.addMonths(G,1)),ne.preventDefault();break;case"PageDown":V(n.addMonths(G,-1)),ne.preventDefault();break}}),le=st((ne,G)=>V(G)),K=st((ne,G)=>{L&&n.isSameDay($,G)&&(k==null||k(!1))}),ee=n.getMonth(o),re=n.getYear(o),me=D.useMemo(()=>s.filter(ne=>!!ne).map(ne=>n.startOfDay(ne)),[n,s]),te=`${re}-${ee}`,ae=D.useMemo(()=>D.createRef(),[te]),U=D.useMemo(()=>{const ne=n.startOfMonth(o),G=n.endOfMonth(o);return F($)||n.isAfterDay($,G)||n.isBeforeDay($,ne)?Sk({utils:n,date:$,minDate:ne,maxDate:G,disablePast:m,disableFuture:v,isDateDisabled:F,timezone:T}):$},[o,v,m,$,F,n,T]),oe=D.useMemo(()=>{const ne=n.setTimezone(o,T),G=n.getWeekArray(ne);let q=n.addMonths(ne,1);for(;A&&G.length{G.lengthC.jsx(Dln,{variant:"caption",role:"columnheader","aria-label":n.format(ne,"weekday"),className:I.weekDayLabel,children:S(ne)},G.toString()))]}),l?C.jsx($ln,{className:I.loadingContainer,children:h()}):C.jsx(Fln,ve({transKey:te,onExited:u,reduceAnimations:d,slideDirection:p,className:Oe(i,I.slideTransition)},g,{nodeRef:ae,children:C.jsx(Nln,{ref:ae,role:"rowgroup",className:I.monthContainer,children:oe.map((ne,G)=>C.jsxs(zln,{role:"row",className:I.weekContainer,"aria-rowindex":G+1,children:[P&&C.jsx(Lln,{className:I.weekNumber,role:"rowheader","aria-label":N.calendarWeekNumberAriaLabelText(n.getWeekNumber(ne[0])),children:N.calendarWeekNumberText(n.getWeekNumber(ne[0]))}),ne.map((q,Z)=>C.jsx(jln,{parentProps:e,day:q,selectedDays:me,focusableDay:U,onKeyDown:Y,onFocus:le,onBlur:K,onDaySelect:X,isDateDisabled:F,currentMonthNumber:ee,isViewFocused:L,"aria-colindex":Z+1},q.toString()))]},`week-${ne[0]}`))})}))]})}function Uln(t){return Xe("MuiPickersMonth",t)}const vL=He("MuiPickersMonth",["root","monthButton","disabled","selected"]),Wln=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],Vln=t=>{const{disabled:e,selected:n,classes:r}=t;return qe({root:["root"],monthButton:["monthButton",e&&"disabled",n&&"selected"]},Uln,r)},Gln=be("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),Hln=be("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(t,e)=>[e.monthButton,{[`&.${vL.disabled}`]:e.disabled},{[`&.${vL.selected}`]:e.selected}]})(({theme:t})=>ve({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${vL.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${vL.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),qln=D.memo(function(e){const n=kn({props:e,name:"MuiPickersMonth"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,"aria-label":g,slots:m,slotProps:v}=n,y=Dt(n,Wln),x=D.useRef(null),b=Vln(n);Ei(()=>{var S;r&&((S=x.current)==null||S.focus())},[r]);const w=(m==null?void 0:m.monthButton)??Hln,_=Zt({elementType:w,externalSlotProps:v==null?void 0:v.monthButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:x,type:"button",role:"radio","aria-current":p,"aria-checked":a,"aria-label":g,onClick:S=>u(S,l),onKeyDown:S=>f(S,l),onFocus:S=>d(S,l),onBlur:S=>h(S,l)},ownerState:n,className:b.monthButton});return C.jsx(Gln,ve({className:Oe(b.root,i),ownerState:n},y,{children:C.jsx(w,ve({},_))}))});function Xln(t){return Xe("MuiMonthCalendar",t)}He("MuiMonthCalendar",["root"]);const Yln=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],Qln=t=>{const{classes:e}=t;return qe({root:["root"]},Xln,e)};function Kln(t,e){const n=gr(),r=nD(),i=kn({props:t,name:e});return ve({disableFuture:!1,disablePast:!1},i,{minDate:Ru(n,i.minDate,r.minDate),maxDate:Ru(n,i.maxDate,r.maxDate)})}const Zln=be("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:OU,boxSizing:"border-box"}),Jln=D.forwardRef(function(e,n){const r=Kln(e,"MuiMonthCalendar"),{className:i,value:o,defaultValue:s,referenceDate:a,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:g,autoFocus:m=!1,onMonthFocus:v,hasFocus:y,onFocusedViewChange:x,monthsPerRow:b=3,timezone:w,gridLabelId:_,slots:S,slotProps:O}=r,k=Dt(r,Yln),{value:E,handleValueChange:P,timezone:A}=QO({name:"MonthCalendar",timezone:w,value:o,defaultValue:s,onChange:h,valueManager:ia}),R=P1(A),T=Eo(),M=gr(),I=D.useMemo(()=>ia.getInitialReferenceValue({value:E,utils:M,props:r,timezone:A,referenceDate:a,granularity:xf.month}),[]),z=r,F=Qln(z),N=D.useMemo(()=>M.getMonth(R),[M,R]),L=D.useMemo(()=>E!=null?M.getMonth(E):null,[E,M]),[B,$]=D.useState(()=>L||M.getMonth(I)),[j,X]=bc({name:"MonthCalendar",state:"hasFocus",controlled:y,default:m??!1}),V=st(te=>{X(te),x&&x(te)}),Y=D.useCallback(te=>{const ae=M.startOfMonth(u&&M.isAfter(R,d)?R:d),U=M.startOfMonth(c&&M.isBefore(R,f)?R:f),oe=M.startOfMonth(te);return M.isBefore(oe,ae)||M.isAfter(oe,U)?!0:p?p(oe):!1},[c,u,f,d,R,p,M]),le=st((te,ae)=>{if(g)return;const U=M.setMonth(E??I,ae);P(U)}),K=st(te=>{Y(M.setMonth(E??I,te))||($(te),V(!0),v&&v(te))});D.useEffect(()=>{$(te=>L!==null&&te!==L?L:te)},[L]);const ee=st((te,ae)=>{switch(te.key){case"ArrowUp":K((12+ae-3)%12),te.preventDefault();break;case"ArrowDown":K((12+ae+3)%12),te.preventDefault();break;case"ArrowLeft":K((12+ae+(T?1:-1))%12),te.preventDefault();break;case"ArrowRight":K((12+ae+(T?-1:1))%12),te.preventDefault();break}}),re=st((te,ae)=>{K(ae)}),me=st((te,ae)=>{B===ae&&V(!1)});return C.jsx(Zln,ve({ref:n,className:Oe(F.root,i),ownerState:z,role:"radiogroup","aria-labelledby":_},k,{children:Ple(M,E??I).map(te=>{const ae=M.getMonth(te),U=M.format(te,"monthShort"),oe=M.format(te,"month"),ne=ae===L,G=l||Y(te);return C.jsx(qln,{selected:ne,value:ae,onClick:le,onKeyDown:ee,autoFocus:j&&ae===B,disabled:G,tabIndex:ae===B&&!G?0:-1,onFocus:re,onBlur:me,"aria-current":N===ae?"date":void 0,"aria-label":oe,monthsPerRow:b,slots:S,slotProps:O,children:U},U)})}))});function ecn(t){return Xe("MuiPickersYear",t)}const yL=He("MuiPickersYear",["root","yearButton","selected","disabled"]),tcn=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],ncn=t=>{const{disabled:e,selected:n,classes:r}=t;return qe({root:["root"],yearButton:["yearButton",e&&"disabled",n&&"selected"]},ecn,r)},rcn=be("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),icn=be("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(t,e)=>[e.yearButton,{[`&.${yL.disabled}`]:e.disabled},{[`&.${yL.selected}`]:e.selected}]})(({theme:t})=>ve({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.action.active,t.palette.action.focusOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${yL.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${yL.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),ocn=D.memo(function(e){const n=kn({props:e,name:"MuiPickersYear"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,slots:g,slotProps:m}=n,v=Dt(n,tcn),y=D.useRef(null),x=ncn(n);Ei(()=>{var _;r&&((_=y.current)==null||_.focus())},[r]);const b=(g==null?void 0:g.yearButton)??icn,w=Zt({elementType:b,externalSlotProps:m==null?void 0:m.yearButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:y,type:"button",role:"radio","aria-current":p,"aria-checked":a,onClick:_=>u(_,l),onKeyDown:_=>f(_,l),onFocus:_=>d(_,l),onBlur:_=>h(_,l)},ownerState:n,className:x.yearButton});return C.jsx(rcn,ve({className:Oe(x.root,i),ownerState:n},v,{children:C.jsx(b,ve({},w))}))});function scn(t){return Xe("MuiYearCalendar",t)}He("MuiYearCalendar",["root"]);const acn=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],lcn=t=>{const{classes:e}=t;return qe({root:["root"]},scn,e)};function ccn(t,e){const n=gr(),r=nD(),i=kn({props:t,name:e});return ve({disablePast:!1,disableFuture:!1},i,{yearsPerRow:i.yearsPerRow??3,minDate:Ru(n,i.minDate,r.minDate),maxDate:Ru(n,i.maxDate,r.maxDate)})}const ucn=be("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:OU,maxHeight:tln,boxSizing:"border-box",position:"relative"}),fcn=D.forwardRef(function(e,n){const r=ccn(e,"MuiYearCalendar"),{autoFocus:i,className:o,value:s,defaultValue:a,referenceDate:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onChange:p,readOnly:g,shouldDisableYear:m,onYearFocus:v,hasFocus:y,onFocusedViewChange:x,yearsOrder:b="asc",yearsPerRow:w,timezone:_,gridLabelId:S,slots:O,slotProps:k}=r,E=Dt(r,acn),{value:P,handleValueChange:A,timezone:R}=QO({name:"YearCalendar",timezone:_,value:s,defaultValue:a,onChange:p,valueManager:ia}),T=P1(R),M=Eo(),I=gr(),z=D.useMemo(()=>ia.getInitialReferenceValue({value:P,utils:I,props:r,timezone:R,referenceDate:l,granularity:xf.year}),[]),F=r,N=lcn(F),L=D.useMemo(()=>I.getYear(T),[I,T]),B=D.useMemo(()=>P!=null?I.getYear(P):null,[P,I]),[$,j]=D.useState(()=>B||I.getYear(z)),[X,V]=bc({name:"YearCalendar",state:"hasFocus",controlled:y,default:i??!1}),Y=st(q=>{V(q),x&&x(q)}),le=D.useCallback(q=>{if(f&&I.isBeforeYear(q,T)||u&&I.isAfterYear(q,T)||h&&I.isBeforeYear(q,h)||d&&I.isAfterYear(q,d))return!0;if(!m)return!1;const Z=I.startOfYear(q);return m(Z)},[u,f,d,h,T,m,I]),K=st((q,Z)=>{if(g)return;const de=I.setYear(P??z,Z);A(de)}),ee=st(q=>{le(I.setYear(P??z,q))||(j(q),Y(!0),v==null||v(q))});D.useEffect(()=>{j(q=>B!==null&&q!==B?B:q)},[B]);const re=b!=="desc"?w*1:w*-1,me=M&&b==="asc"||!M&&b==="desc"?-1:1,te=st((q,Z)=>{switch(q.key){case"ArrowUp":ee(Z-re),q.preventDefault();break;case"ArrowDown":ee(Z+re),q.preventDefault();break;case"ArrowLeft":ee(Z-me),q.preventDefault();break;case"ArrowRight":ee(Z+me),q.preventDefault();break}}),ae=st((q,Z)=>{ee(Z)}),U=st((q,Z)=>{$===Z&&Y(!1)}),oe=D.useRef(null),ne=dn(n,oe);D.useEffect(()=>{if(i||oe.current===null)return;const q=oe.current.querySelector('[tabindex="0"]');if(!q)return;const Z=q.offsetHeight,de=q.offsetTop,xe=oe.current.clientHeight,H=oe.current.scrollTop,W=de+Z;Z>xe||de{const Z=I.getYear(q),de=Z===B,xe=c||le(q);return C.jsx(ocn,{selected:de,value:Z,onClick:K,onKeyDown:te,autoFocus:X&&Z===$,disabled:xe,tabIndex:Z===$&&!xe?0:-1,onFocus:ae,onBlur:U,"aria-current":L===Z?"date":void 0,yearsPerRow:w,slots:O,slotProps:k,children:I.format(q,"year")},I.format(q,"year"))})}))});function rD({onChange:t,onViewChange:e,openTo:n,view:r,views:i,autoFocus:o,focusedView:s,onFocusedViewChange:a}){const l=D.useRef(n),c=D.useRef(i),u=D.useRef(i.includes(n)?n:i[0]),[f,d]=bc({name:"useViews",state:"view",controlled:r,default:u.current}),h=D.useRef(o?f:null),[p,g]=bc({name:"useViews",state:"focusedView",controlled:s,default:h.current});D.useEffect(()=>{(l.current&&l.current!==n||c.current&&c.current.some(S=>!i.includes(S)))&&(d(i.includes(n)?n:i[0]),c.current=i,l.current=n)},[n,d,f,i]);const m=i.indexOf(f),v=i[m-1]??null,y=i[m+1]??null,x=st((S,O)=>{g(O?S:k=>S===k?null:k),a==null||a(S,O)}),b=st(S=>{x(S,!0),S!==f&&(d(S),e&&e(S))}),w=st(()=>{y&&b(y)}),_=st((S,O,k)=>{const E=O==="finish",P=k?i.indexOf(k)Xe("MuiPickersCalendarHeader",t),hcn=He("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function pcn(t){return Xe("MuiPickersArrowSwitcher",t)}He("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const gcn=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],mcn=["ownerState"],vcn=["ownerState"],ycn=be("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),xcn=be("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),Bbe=be(Gt,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),bcn=t=>{const{classes:e}=t;return qe({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},pcn,e)},NVe=D.forwardRef(function(e,n){const r=Eo(),i=kn({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:s,slots:a,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:f,nextLabel:d,isPreviousDisabled:h,isPreviousHidden:p,onGoToPrevious:g,previousLabel:m,labelId:v}=i,y=Dt(i,gcn),x=i,b=bcn(x),w={isDisabled:c,isHidden:u,goTo:f,label:d},_={isDisabled:h,isHidden:p,goTo:g,label:m},S=(a==null?void 0:a.previousIconButton)??Bbe,O=Zt({elementType:S,externalSlotProps:l==null?void 0:l.previousIconButton,additionalProps:{size:"medium",title:_.label,"aria-label":_.label,disabled:_.isDisabled,edge:"end",onClick:_.goTo},ownerState:ve({},x,{hidden:_.isHidden}),className:Oe(b.button,b.previousIconButton)}),k=(a==null?void 0:a.nextIconButton)??Bbe,E=Zt({elementType:k,externalSlotProps:l==null?void 0:l.nextIconButton,additionalProps:{size:"medium",title:w.label,"aria-label":w.label,disabled:w.isDisabled,edge:"start",onClick:w.goTo},ownerState:ve({},x,{hidden:w.isHidden}),className:Oe(b.button,b.nextIconButton)}),P=(a==null?void 0:a.leftArrowIcon)??Msn,A=Zt({elementType:P,externalSlotProps:l==null?void 0:l.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:b.leftArrowIcon}),R=Dt(A,mcn),T=(a==null?void 0:a.rightArrowIcon)??Rsn,M=Zt({elementType:T,externalSlotProps:l==null?void 0:l.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:b.rightArrowIcon}),I=Dt(M,vcn);return C.jsxs(ycn,ve({ref:n,className:Oe(b.root,s),ownerState:x},y,{children:[C.jsx(S,ve({},O,{children:r?C.jsx(T,ve({},I)):C.jsx(P,ve({},R))})),o?C.jsx(Jt,{variant:"subtitle1",component:"span",id:v,children:o}):C.jsx(xcn,{className:b.spacer,ownerState:x}),C.jsx(k,ve({},E,{children:r?C.jsx(P,ve({},R)):C.jsx(T,ve({},I))}))]}))}),wcn=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],_cn=["ownerState"],Scn=t=>{const{classes:e}=t;return qe({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},dcn,e)},Ccn=be("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),Ocn=be("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(t,e)=>e.labelContainer})(({theme:t})=>ve({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),Ecn=be("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),Tcn=be(Gt,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${hcn.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),kcn=be(Psn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(t,e)=>e.switchViewIcon})(({theme:t})=>({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"})),Acn=D.forwardRef(function(e,n){const r=Ml(),i=gr(),o=kn({props:e,name:"MuiPickersCalendarHeader"}),{slots:s,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onMonthChange:p,onViewChange:g,view:m,reduceAnimations:v,views:y,labelId:x,className:b,timezone:w,format:_=`${i.formats.month} ${i.formats.year}`}=o,S=Dt(o,wcn),O=o,k=Scn(o),E=(s==null?void 0:s.switchViewButton)??Tcn,P=Zt({elementType:E,externalSlotProps:a==null?void 0:a.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(m)},ownerState:O,className:k.switchViewButton}),A=(s==null?void 0:s.switchViewIcon)??kcn,R=Zt({elementType:A,externalSlotProps:a==null?void 0:a.switchViewIcon,ownerState:O,className:k.switchViewIcon}),T=Dt(R,_cn),M=()=>p(i.addMonths(l,1),"left"),I=()=>p(i.addMonths(l,-1),"right"),z=Jan(l,{disableFuture:u,maxDate:d,timezone:w}),F=eln(l,{disablePast:f,minDate:h,timezone:w}),N=()=>{if(!(y.length===1||!g||c))if(y.length===2)g(y.find(B=>B!==m)||y[0]);else{const B=y.indexOf(m)!==0?0:1;g(y[B])}};if(y.length===1&&y[0]==="year")return null;const L=i.formatByString(l,_);return C.jsxs(Ccn,ve({},S,{ownerState:O,className:Oe(k.root,b),ref:n,children:[C.jsxs(Ocn,{role:"presentation",onClick:N,ownerState:O,"aria-live":"polite",className:k.labelContainer,children:[C.jsx(IVe,{reduceAnimations:v,transKey:L,children:C.jsx(Ecn,{id:x,ownerState:O,className:k.label,children:L})}),y.length>1&&!c&&C.jsx(E,ve({},P,{children:C.jsx(A,ve({},T))}))]}),C.jsx(eO,{in:m==="day",children:C.jsx(NVe,{slots:s,slotProps:a,onGoToPrevious:I,isPreviousDisabled:F,previousLabel:r.previousMonth,onGoToNext:M,isNextDisabled:z,nextLabel:r.nextMonth})})]}))}),TU=be("div")({overflow:"hidden",width:OU,maxHeight:EU,display:"flex",flexDirection:"column",margin:"0 auto"}),Pcn="@media (prefers-reduced-motion: reduce)",Z_=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),Ube=Z_&&Z_[1]?parseInt(Z_[1],10):null,Wbe=Z_&&Z_[2]?parseInt(Z_[2],10):null,Mcn=Ube&&Ube<10||Wbe&&Wbe<13||!1,zVe=()=>Tee(Pcn,{defaultMatches:!1})||Mcn,Rcn=t=>Xe("MuiDateCalendar",t);He("MuiDateCalendar",["root","viewTransitionContainer"]);const Dcn=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],Icn=t=>{const{classes:e}=t;return qe({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Rcn,e)};function Lcn(t,e){const n=gr(),r=nD(),i=zVe(),o=kn({props:t,name:e});return ve({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??i,renderLoading:o.renderLoading??(()=>C.jsx("span",{children:"..."})),minDate:Ru(n,o.minDate,r.minDate),maxDate:Ru(n,o.maxDate,r.maxDate)})}const $cn=be(TU,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",height:EU}),Fcn=be(IVe,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),Ncn=D.forwardRef(function(e,n){const r=gr(),i=Jf(),o=Lcn(e,"MuiDateCalendar"),{autoFocus:s,onViewChange:a,value:l,defaultValue:c,referenceDate:u,disableFuture:f,disablePast:d,onChange:h,onYearChange:p,onMonthChange:g,reduceAnimations:m,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:x,view:b,views:w,openTo:_,className:S,disabled:O,readOnly:k,minDate:E,maxDate:P,disableHighlightToday:A,focusedView:R,onFocusedViewChange:T,showDaysOutsideCurrentMonth:M,fixedWeekNumber:I,dayOfWeekFormatter:z,slots:F,slotProps:N,loading:L,renderLoading:B,displayWeekNumber:$,yearsOrder:j,yearsPerRow:X,monthsPerRow:V,timezone:Y}=o,le=Dt(o,Dcn),{value:K,handleValueChange:ee,timezone:re}=QO({name:"DateCalendar",timezone:Y,value:l,defaultValue:c,onChange:h,valueManager:ia}),{view:me,setView:te,focusedView:ae,setFocusedView:U,goToNextView:oe,setValueAndGoToNextView:ne}=rD({view:b,views:w,openTo:_,onChange:ee,onViewChange:a,autoFocus:s,focusedView:R,onFocusedViewChange:T}),{referenceDate:G,calendarState:q,changeFocusedDay:Z,changeMonth:de,handleChangeMonth:xe,isDateDisabled:H,onMonthSwitchingAnimationEnd:W}=fln({value:K,referenceDate:u,reduceAnimations:m,onMonthChange:g,minDate:E,maxDate:P,shouldDisableDate:v,disablePast:d,disableFuture:f,timezone:re}),J=O&&K||E,se=O&&K||P,ye=`${i}-grid-label`,ie=ae!==null,fe=(F==null?void 0:F.calendarHeader)??Acn,Q=Zt({elementType:fe,externalSlotProps:N==null?void 0:N.calendarHeader,additionalProps:{views:w,view:me,currentMonth:q.currentMonth,onViewChange:te,onMonthChange:(Se,Ye)=>xe({newMonth:Se,direction:Ye}),minDate:J,maxDate:se,disabled:O,disablePast:d,disableFuture:f,reduceAnimations:m,timezone:re,labelId:ye},ownerState:o}),_e=st(Se=>{const Ye=r.startOfMonth(Se),tt=r.endOfMonth(Se),ut=H(Se)?Sk({utils:r,date:Se,minDate:r.isBefore(E,Ye)?Ye:E,maxDate:r.isAfter(P,tt)?tt:P,disablePast:d,disableFuture:f,isDateDisabled:H,timezone:re}):Se;ut?(ne(ut,"finish"),g==null||g(Ye)):(oe(),de(Ye)),Z(ut,!0)}),we=st(Se=>{const Ye=r.startOfYear(Se),tt=r.endOfYear(Se),ut=H(Se)?Sk({utils:r,date:Se,minDate:r.isBefore(E,Ye)?Ye:E,maxDate:r.isAfter(P,tt)?tt:P,disablePast:d,disableFuture:f,isDateDisabled:H,timezone:re}):Se;ut?(ne(ut,"finish"),p==null||p(ut)):(oe(),de(Ye)),Z(ut,!0)}),Ie=st(Se=>ee(Se&&Z5(r,Se,K??G),"finish",me));D.useEffect(()=>{K!=null&&r.isValid(K)&&de(K)},[K]);const Pe=o,Re=Icn(Pe),Te={disablePast:d,disableFuture:f,maxDate:P,minDate:E},Le={disableHighlightToday:A,readOnly:k,disabled:O,timezone:re,gridLabelId:ye,slots:F,slotProps:N},ue=D.useRef(me);D.useEffect(()=>{ue.current!==me&&(ae===ue.current&&U(me,!0),ue.current=me)},[ae,U,me]);const $e=D.useMemo(()=>[K],[K]);return C.jsxs($cn,ve({ref:n,className:Oe(Re.root,S),ownerState:Pe},le,{children:[C.jsx(fe,ve({},Q,{slots:F,slotProps:N})),C.jsx(Fcn,{reduceAnimations:m,className:Re.viewTransitionContainer,transKey:me,ownerState:Pe,children:C.jsxs("div",{children:[me==="year"&&C.jsx(fcn,ve({},Te,Le,{value:K,onChange:we,shouldDisableYear:x,hasFocus:ie,onFocusedViewChange:Se=>U("year",Se),yearsOrder:j,yearsPerRow:X,referenceDate:G})),me==="month"&&C.jsx(Jln,ve({},Te,Le,{hasFocus:ie,className:S,value:K,onChange:_e,shouldDisableMonth:y,onFocusedViewChange:Se=>U("month",Se),monthsPerRow:V,referenceDate:G})),me==="day"&&C.jsx(Bln,ve({},q,Te,Le,{onMonthSwitchingAnimationEnd:W,onFocusedDayChange:Z,reduceAnimations:m,selectedDays:$e,onSelectedDaysChange:Ie,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:x,hasFocus:ie,onFocusedViewChange:Se=>U("day",Se),showDaysOutsideCurrentMonth:M,fixedWeekNumber:I,dayOfWeekFormatter:z,displayWeekNumber:$,loading:L,renderLoading:B}))]})})]}))}),J_=({view:t,onViewChange:e,views:n,focusedView:r,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:_,yearsPerRow:S,slots:O,slotProps:k,loading:E,renderLoading:P,disableHighlightToday:A,readOnly:R,disabled:T,showDaysOutsideCurrentMonth:M,dayOfWeekFormatter:I,sx:z,autoFocus:F,fixedWeekNumber:N,displayWeekNumber:L,timezone:B})=>C.jsx(Ncn,{view:t,onViewChange:e,views:n.filter(vC),focusedView:r&&vC(r)?r:null,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:_,yearsPerRow:S,slots:O,slotProps:k,loading:E,renderLoading:P,disableHighlightToday:A,readOnly:R,disabled:T,showDaysOutsideCurrentMonth:M,dayOfWeekFormatter:I,sx:z,autoFocus:F,fixedWeekNumber:N,displayWeekNumber:L,timezone:B});function zcn(t){return Xe("MuiPickersPopper",t)}He("MuiPickersPopper",["root","paper"]);const jcn=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],Bcn=t=>{const{classes:e}=t;return qe({root:["root"],paper:["paper"]},zcn,e)},Ucn=be(Gee,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),Wcn=be(kl,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:t})=>["top","top-start","top-end"].includes(t),style:{transformOrigin:"bottom center"}}]});function Vcn(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 s=st(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=yi(i.current);if(!i.current||"clientX"in l&&Vcn(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)}),a=()=>{r.current=!0};return D.useEffect(()=>{if(t){const l=yi(i.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[t,s]),D.useEffect(()=>{if(t){const l=yi(i.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[t,s]),[i,a,a]}const Hcn=D.forwardRef((t,e)=>{const{PaperComponent:n,popperPlacement:r,ownerState:i,children:o,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:c}=t,u=Dt(t,jcn),f=ve({},i,{placement:r}),d=Zt({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:e},className:a,ownerState:f});return C.jsx(n,ve({},u,d,{onClick:h=>{var p;l(h),(p=d.onClick)==null||p.call(d,h)},onTouchStart:h=>{var p;c(h),(p=d.onTouchStart)==null||p.call(d,h)},ownerState:f,children:o}))});function qcn(t){const e=kn({props:t,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:i=null,shouldRestoreFocus:o,onBlur:s,onDismiss:a,open:l,role:c,placement:u,slots:f,slotProps:d,reduceAnimations:h}=e;D.useEffect(()=>{function M(I){l&&I.key==="Escape"&&a()}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[a,l]);const p=D.useRef(null);D.useEffect(()=>{c==="tooltip"||o&&!o()||(l?p.current=Ka(document):p.current&&p.current instanceof HTMLElement&&setTimeout(()=>{p.current instanceof HTMLElement&&p.current.focus()}))},[l,c,o]);const[g,m,v]=Gcn(l,s??a),y=D.useRef(null),x=dn(y,i),b=dn(x,g),w=e,_=Bcn(w),S=zVe(),O=h??S,k=M=>{M.key==="Escape"&&(M.stopPropagation(),a())},E=(f==null?void 0:f.desktopTransition)??O?eO:ob,P=(f==null?void 0:f.desktopTrapFocus)??wPe,A=(f==null?void 0:f.desktopPaper)??Wcn,R=(f==null?void 0:f.popper)??Ucn,T=Zt({elementType:R,externalSlotProps:d==null?void 0:d.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:n,placement:u,onKeyDown:k},className:_.root,ownerState:e});return C.jsx(R,ve({},T,{children:({TransitionProps:M,placement:I})=>C.jsx(P,ve({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},d==null?void 0:d.desktopTrapFocus,{children:C.jsx(E,ve({},M,d==null?void 0:d.desktopTransition,{children:C.jsx(Hcn,{PaperComponent:A,ownerState:w,popperPlacement:I,ref:b,onPaperClick:m,onPaperTouchStart:v,paperClasses:_.paper,paperSlotProps:d==null?void 0:d.desktopPaper,children:r})}))}))}))}const Xcn=({open:t,onOpen:e,onClose:n})=>{const r=D.useRef(typeof t=="boolean").current,[i,o]=D.useState(!1);D.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 s=D.useCallback(a=>{r||o(a),a&&e&&e(),!a&&n&&n()},[r,e,n]);return{isOpen:i,setIsOpen:s}},Ycn=t=>{const{action:e,hasChanged:n,dateState:r,isControlled:i}=t,o=!i&&!r.hasBeenModifiedSinceMount;return e.name==="setValueFromField"?!0:e.name==="setValueFromAction"?o&&["accept","today","clear"].includes(e.pickerAction)?!0:n(r.lastPublishedValue):e.name==="setValueFromView"&&e.selectionState!=="shallow"||e.name==="setValueFromShortcut"?o?!0:n(r.lastPublishedValue):!1},Qcn=t=>{const{action:e,hasChanged:n,dateState:r,isControlled:i,closeOnSelect:o}=t,s=!i&&!r.hasBeenModifiedSinceMount;return e.name==="setValueFromAction"?s&&["accept","today","clear"].includes(e.pickerAction)?!0:n(r.lastCommittedValue):e.name==="setValueFromView"&&e.selectionState==="finish"&&o?s?!0:n(r.lastCommittedValue):e.name==="setValueFromShortcut"?e.changeImportance==="accept"&&n(r.lastCommittedValue):!1},Kcn=t=>{const{action:e,closeOnSelect:n}=t;return e.name==="setValueFromAction"?!0:e.name==="setValueFromView"?e.selectionState==="finish"&&n:e.name==="setValueFromShortcut"?e.changeImportance==="accept":!1},Zcn=({props:t,valueManager:e,valueType:n,wrapperVariant:r,validator:i})=>{const{onAccept:o,onChange:s,value:a,defaultValue:l,closeOnSelect:c=r==="desktop",timezone:u}=t,{current:f}=D.useRef(l),{current:d}=D.useRef(a!==void 0),h=gr(),p=A1(),{isOpen:g,setIsOpen:m}=Xcn(t),{timezone:v,value:y,handleValueChange:x}=Lle({timezone:u,value:a,defaultValue:f,onChange:s,valueManager:e}),[b,w]=D.useState(()=>{let V;return y!==void 0?V=y:f!==void 0?V=f:V=e.emptyValue,{draft:V,lastPublishedValue:V,lastCommittedValue:V,lastControlledValue:y,hasBeenModifiedSinceMount:!1}}),{getValidationErrorForNewValue:_}=xVe({props:t,validator:i,timezone:v,value:b.draft,onError:t.onError}),S=st(V=>{const Y={action:V,dateState:b,hasChanged:te=>!e.areValuesEqual(h,V.value,te),isControlled:d,closeOnSelect:c},le=Ycn(Y),K=Qcn(Y),ee=Kcn(Y);w(te=>ve({},te,{draft:V.value,lastPublishedValue:le?V.value:te.lastPublishedValue,lastCommittedValue:K?V.value:te.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let re=null;const me=()=>(re||(re={validationError:V.name==="setValueFromField"?V.context.validationError:_(V.value)},V.name==="setValueFromShortcut"&&(re.shortcut=V.shortcut)),re);le&&x(V.value,me()),K&&o&&o(V.value,me()),ee&&m(!1)});if(y!==void 0&&(b.lastControlledValue===void 0||!e.areValuesEqual(h,b.lastControlledValue,y))){const V=e.areValuesEqual(h,b.draft,y);w(Y=>ve({},Y,{lastControlledValue:y},V?{}:{lastCommittedValue:y,lastPublishedValue:y,draft:y,hasBeenModifiedSinceMount:!0}))}const O=st(()=>{S({value:e.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),k=st(()=>{S({value:b.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),E=st(()=>{S({value:b.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),P=st(()=>{S({value:b.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),A=st(()=>{S({value:e.getTodayValue(h,v,n),name:"setValueFromAction",pickerAction:"today"})}),R=st(V=>{V.preventDefault(),m(!0)}),T=st(V=>{V==null||V.preventDefault(),m(!1)}),M=st((V,Y="partial")=>S({name:"setValueFromView",value:V,selectionState:Y})),I=st((V,Y,le)=>S({name:"setValueFromShortcut",value:V,changeImportance:Y,shortcut:le})),z=st((V,Y)=>S({name:"setValueFromField",value:V,context:Y})),F={onClear:O,onAccept:k,onDismiss:E,onCancel:P,onSetToday:A,onOpen:R,onClose:T},N={value:b.draft,onChange:z},L=D.useMemo(()=>e.cleanValue(h,b.draft),[h,e,b.draft]),B={value:L,onChange:M,onClose:T,open:g},j=ve({},F,{value:L,onChange:M,onSelectShortcut:I,isValid:V=>{const Y=i({adapter:p,value:V,timezone:v,props:t});return!e.hasError(Y)}}),X=D.useMemo(()=>({onOpen:R,onClose:T,open:g}),[g,T,R]);return{open:g,fieldProps:N,viewProps:B,layoutProps:j,actions:F,contextValue:X}},Jcn=["className","sx"],eun=({props:t,propsFromPickerValue:e,additionalViewProps:n,autoFocusView:r,rendererInterceptor:i,fieldRef:o})=>{const{onChange:s,open:a,onClose:l}=e,{view:c,views:u,openTo:f,onViewChange:d,viewRenderers:h,timezone:p}=t,g=Dt(t,Jcn),{view:m,setView:v,defaultView:y,focusedView:x,setFocusedView:b,setValueAndGoToNextView:w}=rD({view:c,views:u,openTo:f,onChange:s,onViewChange:d,autoFocus:r}),{hasUIView:_,viewModeLookup:S}=D.useMemo(()=>u.reduce((T,M)=>{let I;return h[M]!=null?I="UI":I="field",T.viewModeLookup[M]=I,I==="UI"&&(T.hasUIView=!0),T},{hasUIView:!1,viewModeLookup:{}}),[h,u]),O=D.useMemo(()=>u.reduce((T,M)=>h[M]!=null&&yC(M)?T+1:T,0),[h,u]),k=S[m],E=st(()=>k==="UI"),[P,A]=D.useState(k==="UI"?m:null);return P!==m&&S[m]==="UI"&&A(m),Ei(()=>{k==="field"&&a&&(l(),setTimeout(()=>{var T,M;(T=o==null?void 0:o.current)==null||T.setSelectedSections(m),(M=o==null?void 0:o.current)==null||M.focusField(m)}))},[m]),Ei(()=>{if(!a)return;let T=m;k==="field"&&P!=null&&(T=P),T!==y&&S[T]==="UI"&&S[y]==="UI"&&(T=y),T!==m&&v(T),b(T,!0)},[a]),{hasUIView:_,shouldRestoreFocus:E,layoutProps:{views:u,view:P,onViewChange:v},renderCurrentView:()=>{if(P==null)return null;const T=h[P];if(T==null)return null;const M=ve({},g,n,e,{views:u,timezone:p,onChange:w,view:P,onViewChange:v,focusedView:x,onFocusedViewChange:b,showViewSwitcher:O>1,timeViewsCount:O});return i?i(h,P,M):T(M)}}};function Vbe(){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 tun=(t,e)=>{const[n,r]=D.useState(Vbe);return Ei(()=>{const o=()=>{r(Vbe())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),Ssn(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},nun=({props:t,propsFromPickerValue:e,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:i}=t,o=tun(n.views,i),s=Eo();return{layoutProps:ve({},n,e,{isLandscape:o,isRtl:s,wrapperVariant:r,disabled:t.disabled,readOnly:t.readOnly})}};function run(t){const{props:e,pickerValueResponse:n}=t;return D.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:e.disabled??!1,readOnly:e.readOnly??!1}),[n.viewProps.value,n.open,e.disabled,e.readOnly])}const jVe=({props:t,valueManager:e,valueType:n,wrapperVariant:r,additionalViewProps:i,validator:o,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const c=Zcn({props:t,valueManager:e,valueType:n,wrapperVariant:r,validator:o}),u=eun({props:t,additionalViewProps:i,autoFocusView:s,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:a}),f=nun({props:t,wrapperVariant:r,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps}),d=run({props:t,pickerValueResponse:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:c.contextValue,ownerState:d}};function BVe(t){return Xe("MuiPickersLayout",t)}const hf=He("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),iun=["onAccept","onClear","onCancel","onSetToday","actions"];function oun(t){const{onAccept:e,onClear:n,onCancel:r,onSetToday:i,actions:o}=t,s=Dt(t,iun),a=Ml();if(o==null||o.length===0)return null;const l=o==null?void 0:o.map(c=>{switch(c){case"clear":return C.jsx(Hr,{onClick:n,children:a.clearButtonLabel},c);case"cancel":return C.jsx(Hr,{onClick:r,children:a.cancelButtonLabel},c);case"accept":return C.jsx(Hr,{onClick:e,children:a.okButtonLabel},c);case"today":return C.jsx(Hr,{onClick:i,children:a.todayButtonLabel},c);default:return null}});return C.jsx(Jb,ve({},s,{children:l}))}const sun=["items","changeImportance","isLandscape","onChange","isValid"],aun=["getValue"];function lun(t){const{items:e,changeImportance:n="accept",onChange:r,isValid:i}=t,o=Dt(t,sun);if(e==null||e.length===0)return null;const s=e.map(a=>{let{getValue:l}=a,c=Dt(a,aun);const u=l({isValid:i});return ve({},c,{label:c.label,onClick:()=>{r(u,n,c)},disabled:!i(u)})});return C.jsx(RM,ve({dense:!0,sx:[{maxHeight:EU,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:s.map(a=>C.jsx($_,{children:C.jsx(pPe,ve({},a))},a.id??a.label))}))}function cun(t){return t.view!==null}const uun=t=>{const{classes:e,isLandscape:n}=t;return qe({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},BVe,e)},UVe=t=>{const{wrapperVariant:e,onAccept:n,onClear:r,onCancel:i,onSetToday:o,view:s,views:a,onViewChange:l,value:c,onChange:u,onSelectShortcut:f,isValid:d,isLandscape:h,disabled:p,readOnly:g,children:m,slots:v,slotProps:y}=t,x=uun(t),b=(v==null?void 0:v.actionBar)??oun,w=Zt({elementType:b,externalSlotProps:y==null?void 0:y.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:i,onSetToday:o,actions:e==="desktop"?[]:["cancel","accept"]},className:x.actionBar,ownerState:ve({},t,{wrapperVariant:e})}),_=C.jsx(b,ve({},w)),S=v==null?void 0:v.toolbar,O=Zt({elementType:S,externalSlotProps:y==null?void 0:y.toolbar,additionalProps:{isLandscape:h,onChange:u,value:c,view:s,onViewChange:l,views:a,disabled:p,readOnly:g},className:x.toolbar,ownerState:ve({},t,{wrapperVariant:e})}),k=cun(O)&&S?C.jsx(S,ve({},O)):null,E=m,P=v==null?void 0:v.tabs,A=s&&P?C.jsx(P,ve({view:s,onViewChange:l,className:x.tabs},y==null?void 0:y.tabs)):null,R=(v==null?void 0:v.shortcuts)??lun,T=Zt({elementType:R,externalSlotProps:y==null?void 0:y.shortcuts,additionalProps:{isValid:d,isLandscape:h,onChange:f},className:x.shortcuts,ownerState:{isValid:d,isLandscape:h,onChange:f,wrapperVariant:e}}),M=s&&R?C.jsx(R,ve({},T)):null;return{toolbar:k,content:E,tabs:A,actionBar:_,shortcuts:M}},fun=t=>{const{isLandscape:e,classes:n}=t;return qe({root:["root",e&&"landscape"],contentWrapper:["contentWrapper"]},BVe,n)},WVe=be("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${hf.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${hf.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${hf.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${hf.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${hf.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${hf.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${hf.shortcuts}`]:{gridColumn:3}}}]}),VVe=be("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(t,e)=>e.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),GVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:o,tabs:s,actionBar:a,shortcuts:l}=UVe(r),{sx:c,className:u,isLandscape:f,wrapperVariant:d}=r,h=fun(r);return C.jsxs(WVe,{ref:n,sx:c,className:Oe(h.root,u),ownerState:r,children:[f?l:i,f?i:l,C.jsx(VVe,{className:h.contentWrapper,children:d==="desktop"?C.jsxs(D.Fragment,{children:[o,s]}):C.jsxs(D.Fragment,{children:[s,o]})}),a]})}),dun=["props","getOpenDialogAriaText"],hun=["ownerState"],pun=["ownerState"],gun=t=>{var oe;let{props:e,getOpenDialogAriaText:n}=t,r=Dt(t,dun);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,autoFocus:x,localeText:b,reduceAnimations:w}=e,_=D.useRef(null),S=D.useRef(null),O=Jf(),k=((oe=o==null?void 0:o.toolbar)==null?void 0:oe.hidden)??!1,{open:E,actions:P,hasUIView:A,layoutProps:R,renderCurrentView:T,shouldRestoreFocus:M,fieldProps:I,contextValue:z,ownerState:F}=jVe(ve({},r,{props:e,fieldRef:S,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),N=i.inputAdornment??EPe,L=Zt({elementType:N,externalSlotProps:o==null?void 0:o.inputAdornment,additionalProps:{position:"end"},ownerState:e}),B=Dt(L,hun),$=i.openPickerButton??Gt,j=Zt({elementType:$,externalSlotProps:o==null?void 0:o.openPickerButton,additionalProps:{disabled:y||v,onClick:E?P.onClose:P.onOpen,"aria-label":n(I.value),edge:B.position},ownerState:e}),X=Dt(j,pun),V=i.openPickerIcon,Y=Zt({elementType:V,externalSlotProps:o==null?void 0:o.openPickerIcon,ownerState:F}),le=i.field,K=Zt({elementType:le,externalSlotProps:o==null?void 0:o.field,additionalProps:ve({},I,k&&{id:O},{readOnly:v,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p,autoFocus:x&&!e.open,focused:E?!0:void 0},m?{inputRef:m}:{}),ownerState:e});A&&(K.InputProps=ve({},K.InputProps,{ref:_},!e.disableOpenPicker&&{[`${B.position}Adornment`]:C.jsx(N,ve({},B,{children:C.jsx($,ve({},X,{children:C.jsx(V,ve({},Y))}))}))}));const ee=ve({textField:i.textField,clearIcon:i.clearIcon,clearButton:i.clearButton},K.slots),re=i.layout??GVe;let me=O;k&&(g?me=`${O}-label`:me=void 0);const te=ve({},o,{toolbar:ve({},o==null?void 0:o.toolbar,{titleId:O}),popper:ve({"aria-labelledby":me},o==null?void 0:o.popper)}),ae=dn(S,K.unstableFieldRef);return{renderPicker:()=>C.jsxs(bVe,{contextValue:z,localeText:b,children:[C.jsx(le,ve({},K,{slots:ee,slotProps:te,unstableFieldRef:ae})),C.jsx(qcn,ve({role:"dialog",placement:"bottom-start",anchorEl:_.current},P,{open:E,slots:i,slotProps:te,shouldRestoreFocus:M,reduceAnimations:w,children:C.jsx(re,ve({},R,te==null?void 0:te.layout,{slots:i,slotProps:te,children:T()}))}))]})}},mun=["views","format"],HVe=(t,e,n)=>{let{views:r,format:i}=e,o=Dt(e,mun);if(i)return i;const s=[],a=[];if(r.forEach(u=>{yC(u)?a.push(u):vC(u)&&s.push(u)}),a.length===0)return Pbe(t,ve({views:s},o));if(s.length===0)return Rbe(t,ve({views:a},o));const l=Rbe(t,ve({views:a},o));return`${Pbe(t,ve({views:s},o))} ${l}`},vun=(t,e,n)=>n?e.filter(r=>!kT(r)||r==="hours"):t?[...e,"meridiem"]:e,yun=(t,e)=>24*60/((t.hours??1)*(t.minutes??5))<=e;function xun({thresholdToRenderTimeInASingleColumn:t,ampm:e,timeSteps:n,views:r}){const i=t??24,o=ve({hours:1,minutes:5,seconds:5},n),s=yun(o,i);return{thresholdToRenderTimeInASingleColumn:i,timeSteps:o,shouldRenderTimeInASingleColumn:s,views:vun(e,r,s)}}function bun(t){return Xe("MuiTimeClock",t)}He("MuiTimeClock",["root","arrowSwitcher"]);const xC=220,mg=36,oP={x:xC/2,y:xC/2},qVe={x:oP.x,y:0},wun=qVe.x-oP.x,_un=qVe.y-oP.y,Sun=t=>t*(180/Math.PI),XVe=(t,e,n)=>{const r=e-oP.x,i=n-oP.y,o=Math.atan2(wun,_un)-Math.atan2(r,i);let s=Sun(o);s=Math.round(s/t)*t,s%=360;const a=Math.floor(s/t)||0,l=r**2+i**2,c=Math.sqrt(l);return{value:a,distance:c}},Cun=(t,e,n=1)=>{const r=n*6;let{value:i}=XVe(r,t,e);return i=i*n%60,i},Oun=(t,e,n)=>{const{value:r,distance:i}=XVe(30,t,e);let o=r||12;return n?o%=12:i{const{classes:e}=t;return qe({root:["root"],thumb:["thumb"]},Eun,e)},Aun=be("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({width:2,backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:t.transitions.create(["transform","height"])}}]})),Pun=be("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({width:4,height:4,backgroundColor:(t.vars||t).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${mg/2}px)`,border:`${(mg-4)/2}px solid ${(t.vars||t).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(t.vars||t).palette.primary.main}}]}));function Mun(t){const e=kn({props:t,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,viewValue:o}=e,s=Dt(e,Tun),a=D.useRef(i);D.useEffect(()=>{a.current=i},[i]);const l=ve({},e,{shouldAnimate:a.current!==i}),c=kun(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*xC),transform:`rotateZ(${d}deg)`}};return C.jsx(Aun,ve({style:u(),className:Oe(c.root,n),ownerState:l},s,{children:C.jsx(Pun,{ownerState:l,className:c.thumb})}))}function Run(t){return Xe("MuiClock",t)}He("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);const Dun=t=>{const{classes:e,meridiemMode:n}=t;return qe({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton",n==="am"&&"selected"],pmButton:["pmButton",n==="pm"&&"selected"],meridiemText:["meridiemText"]},Run,e)},Iun=be("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),Lun=be("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"}),$un=be("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),Fun=be("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(t,e)=>e.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),Nun=be("div",{name:"MuiClock",slot:"Pin",overridesResolver:(t,e)=>e.pin})(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),YVe=(t,e)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:mg,variants:[{props:{meridiemMode:e},style:{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:hover":{backgroundColor:(t.vars||t).palette.primary.light}}}]}),zun=be(Gt,{name:"MuiClock",slot:"AmButton",overridesResolver:(t,e)=>e.amButton})(({theme:t})=>ve({},YVe(t,"am"),{position:"absolute",left:8})),jun=be(Gt,{name:"MuiClock",slot:"PmButton",overridesResolver:(t,e)=>e.pmButton})(({theme:t})=>ve({},YVe(t,"pm"),{position:"absolute",right:8})),Gbe=be(Jt,{name:"MuiClock",slot:"meridiemText",overridesResolver:(t,e)=>e.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function Bun(t){const e=kn({props:t,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,value:s,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:f,selectedId:d,type:h,viewValue:p,disabled:g=!1,readOnly:m,className:v}=e,y=e,x=gr(),b=Ml(),w=D.useRef(!1),_=Dun(y),S=l(p,h),O=!n&&h==="hours"&&(p<1||p>12),k=(N,L)=>{g||m||l(N,h)||f(N,L)},E=(N,L)=>{let{offsetX:B,offsetY:$}=N;if(B===void 0){const X=N.target.getBoundingClientRect();B=N.changedTouches[0].clientX-X.left,$=N.changedTouches[0].clientY-X.top}const j=h==="seconds"||h==="minutes"?Cun(B,$,u):Oun(B,$,!!n);k(j,L)},P=N=>{w.current=!0,E(N,"shallow")},A=N=>{w.current&&(E(N,"finish"),w.current=!1)},R=N=>{N.buttons>0&&E(N.nativeEvent,"shallow")},T=N=>{w.current&&(w.current=!1),E(N.nativeEvent,"finish")},M=D.useMemo(()=>h==="hours"?!0:p%5===0,[h,p]),I=h==="minutes"?u:1,z=D.useRef(null);Ei(()=>{i&&z.current.focus()},[i]);const F=N=>{if(!w.current)switch(N.key){case"Home":k(0,"partial"),N.preventDefault();break;case"End":k(h==="minutes"?59:23,"partial"),N.preventDefault();break;case"ArrowUp":k(p+I,"partial"),N.preventDefault();break;case"ArrowDown":k(p-I,"partial"),N.preventDefault();break;case"PageUp":k(p+5,"partial"),N.preventDefault();break;case"PageDown":k(p-5,"partial"),N.preventDefault();break;case"Enter":case" ":k(p,"finish"),N.preventDefault();break}};return C.jsxs(Iun,{className:Oe(_.root,v),children:[C.jsxs(Lun,{className:_.clock,children:[C.jsx(Fun,{onTouchMove:P,onTouchStart:P,onTouchEnd:A,onMouseUp:T,onMouseMove:R,ownerState:{disabled:g},className:_.squareMask}),!S&&C.jsxs(D.Fragment,{children:[C.jsx(Nun,{className:_.pin}),s!=null&&C.jsx(Mun,{type:h,viewValue:p,isInner:O,hasSelected:M})]}),C.jsx($un,{"aria-activedescendant":d,"aria-label":b.clockLabelText(h,s,x,s==null?null:x.format(s,"fullTime")),ref:z,role:"listbox",onKeyDown:F,tabIndex:0,className:_.wrapper,children:o})]}),n&&r&&C.jsxs(D.Fragment,{children:[C.jsx(zun,{onClick:m?void 0:()=>a("am"),disabled:g||c===null,ownerState:y,className:_.amButton,title:tg(x,"am"),children:C.jsx(Gbe,{variant:"caption",className:_.meridiemText,children:tg(x,"am")})}),C.jsx(jun,{disabled:g||c===null,onClick:m?void 0:()=>a("pm"),ownerState:y,className:_.pmButton,title:tg(x,"pm"),children:C.jsx(Gbe,{variant:"caption",className:_.meridiemText,children:tg(x,"pm")})})]})]})}function Uun(t){return Xe("MuiClockNumber",t)}const xL=He("MuiClockNumber",["root","selected","disabled"]),Wun=["className","disabled","index","inner","label","selected"],Vun=t=>{const{classes:e,selected:n,disabled:r}=t;return qe({root:["root",n&&"selected",r&&"disabled"]},Uun,e)},Gun=be("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${xL.disabled}`]:e.disabled},{[`&.${xL.selected}`]:e.selected}]})(({theme:t})=>({height:mg,width:mg,position:"absolute",left:`calc((100% - ${mg}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(t.vars||t).palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:(t.vars||t).palette.background.paper},[`&.${xL.selected}`]:{color:(t.vars||t).palette.primary.contrastText},[`&.${xL.disabled}`]:{pointerEvents:"none",color:(t.vars||t).palette.text.disabled},variants:[{props:{inner:!0},style:ve({},t.typography.body2,{color:(t.vars||t).palette.text.secondary})}]}));function QVe(t){const e=kn({props:t,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:s,selected:a}=e,l=Dt(e,Wun),c=e,u=Vun(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(xC-mg-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return C.jsx(Gun,ve({className:Oe(u.root,n),"aria-disabled":r?!0:void 0,"aria-selected":a?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(xC-mg)/2}px`},ownerState:c},l,{children:s}))}const Hun=({ampm:t,value:e,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{const s=e?o.getHours(e):null,a=[],l=t?1:0,c=t?12:23,u=f=>s===null?!1:t?f===12?s===12||s===0:s===f||s-12===f:s===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);a.push(C.jsx(QVe,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return a},Hbe=({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(([s,a],l)=>{const c=s===e;return C.jsx(QVe,{label:a,id:c?i:void 0,index:l+1,inner:!1,disabled:n(s),selected:c,"aria-label":r(a)},s)})},zle=({value:t,referenceDate:e,utils:n,props:r,timezone:i})=>{const o=D.useMemo(()=>ia.getInitialReferenceValue({value:t,utils:n,props:r,referenceDate:e,granularity:xf.day,timezone:i,getTodayDate:()=>Mle(n,i,"date")}),[]);return t??o},qun=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],Xun=t=>{const{classes:e}=t;return qe({root:["root"],arrowSwitcher:["arrowSwitcher"]},bun,e)},Yun=be(TU,{name:"MuiTimeClock",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",position:"relative"}),Qun=be(NVe,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),Kun=["hours","minutes"],Zun=D.forwardRef(function(e,n){const r=gr(),i=kn({props:e,name:"MuiTimeClock"}),{ampm:o=r.is12HourCycleInCurrentLocale(),ampmInClock:s=!1,autoFocus:a,slots:l,slotProps:c,value:u,defaultValue:f,referenceDate:d,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:p,minTime:g,disableFuture:m,disablePast:v,minutesStep:y=1,shouldDisableTime:x,showViewSwitcher:b,onChange:w,view:_,views:S=Kun,openTo:O,onViewChange:k,focusedView:E,onFocusedViewChange:P,className:A,disabled:R,readOnly:T,timezone:M}=i,I=Dt(i,qun),{value:z,handleValueChange:F,timezone:N}=QO({name:"TimeClock",timezone:M,value:u,defaultValue:f,onChange:w,valueManager:ia}),L=zle({value:z,referenceDate:d,utils:r,props:i,timezone:N}),B=Ml(),$=P1(N),{view:j,setView:X,previousView:V,nextView:Y,setValueAndGoToNextView:le}=rD({view:_,views:S,openTo:O,onViewChange:k,onChange:F,focusedView:E,onFocusedViewChange:P}),{meridiemMode:K,handleMeridiemChange:ee}=Nle(L,o,le),re=D.useCallback((oe,ne)=>{const G=tD(h,r),q=ne==="hours"||ne==="minutes"&&S.includes("seconds"),Z=({start:xe,end:H})=>!(g&&G(g,H)||p&&G(xe,p)||m&&G(xe,$)||v&&G($,q?H:xe)),de=(xe,H=1)=>{if(xe%H!==0)return!1;if(x)switch(ne){case"hours":return!x(r.setHours(L,xe),"hours");case"minutes":return!x(r.setMinutes(L,xe),"minutes");case"seconds":return!x(r.setSeconds(L,xe),"seconds");default:return!1}return!0};switch(ne){case"hours":{const xe=rP(oe,K,o),H=r.setHours(L,xe),W=r.setSeconds(r.setMinutes(H,0),0),J=r.setSeconds(r.setMinutes(H,59),59);return!Z({start:W,end:J})||!de(xe)}case"minutes":{const xe=r.setMinutes(L,oe),H=r.setSeconds(xe,0),W=r.setSeconds(xe,59);return!Z({start:H,end:W})||!de(oe,y)}case"seconds":{const xe=r.setSeconds(L,oe);return!Z({start:xe,end:xe})||!de(oe)}default:throw new Error("not supported")}},[o,L,h,p,K,g,y,x,r,m,v,$,S]),me=Jf(),te=D.useMemo(()=>{switch(j){case"hours":{const oe=(ne,G)=>{const q=rP(ne,K,o);le(r.setHours(L,q),G,"hours")};return{onChange:oe,viewValue:r.getHours(L),children:Hun({value:z,utils:r,ampm:o,onChange:oe,getClockNumberText:B.hoursClockNumberText,isDisabled:ne=>R||re(ne,"hours"),selectedId:me})}}case"minutes":{const oe=r.getMinutes(L),ne=(G,q)=>{le(r.setMinutes(L,G),q,"minutes")};return{viewValue:oe,onChange:ne,children:Hbe({utils:r,value:oe,onChange:ne,getClockNumberText:B.minutesClockNumberText,isDisabled:G=>R||re(G,"minutes"),selectedId:me})}}case"seconds":{const oe=r.getSeconds(L),ne=(G,q)=>{le(r.setSeconds(L,G),q,"seconds")};return{viewValue:oe,onChange:ne,children:Hbe({utils:r,value:oe,onChange:ne,getClockNumberText:B.secondsClockNumberText,isDisabled:G=>R||re(G,"seconds"),selectedId:me})}}default:throw new Error("You must provide the type for ClockView")}},[j,r,z,o,B.hoursClockNumberText,B.minutesClockNumberText,B.secondsClockNumberText,K,le,L,re,me,R]),ae=i,U=Xun(ae);return C.jsxs(Yun,ve({ref:n,className:Oe(U.root,A),ownerState:ae},I,{children:[C.jsx(Bun,ve({autoFocus:a??!!E,ampmInClock:s&&S.includes("hours"),value:z,type:j,ampm:o,minutesStep:y,isTimeDisabled:re,meridiemMode:K,handleMeridiemChange:ee,selectedId:me,disabled:R,readOnly:T},te)),b&&C.jsx(Qun,{className:U.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>X(V),isPreviousDisabled:!V,previousLabel:B.openPreviousView,onGoToNext:()=>X(Y),isNextDisabled:!Y,nextLabel:B.openNextView,ownerState:ae})]}))});function Jun(t){return Xe("MuiDigitalClock",t)}const efn=He("MuiDigitalClock",["root","list","item"]),tfn=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],nfn=t=>{const{classes:e}=t;return qe({root:["root"],list:["list"],item:["item"]},Jun,e)},rfn=be(TU,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:MVe,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),ifn=be(w4,{name:"MuiDigitalClock",slot:"List",overridesResolver:(t,e)=>e.list})({padding:0}),ofn=be(Br,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.primary.main,t.palette.action.focusOpacity)}})),sfn=D.forwardRef(function(e,n){const r=gr(),i=D.useRef(null),o=dn(n,i),s=D.useRef(null),a=kn({props:e,name:"MuiDigitalClock"}),{ampm:l=r.is12HourCycleInCurrentLocale(),timeStep:c=30,autoFocus:u,slots:f,slotProps:d,value:h,defaultValue:p,referenceDate:g,disableIgnoringDatePartForTimeValidation:m=!1,maxTime:v,minTime:y,disableFuture:x,disablePast:b,minutesStep:w=1,shouldDisableTime:_,onChange:S,view:O,openTo:k,onViewChange:E,focusedView:P,onFocusedViewChange:A,className:R,disabled:T,readOnly:M,views:I=["hours"],skipDisabled:z=!1,timezone:F}=a,N=Dt(a,tfn),{value:L,handleValueChange:B,timezone:$}=QO({name:"DigitalClock",timezone:F,value:h,defaultValue:p,onChange:S,valueManager:ia}),j=Ml(),X=P1($),V=D.useMemo(()=>ve({},a,{alreadyRendered:!!i.current}),[a]),Y=nfn(V),le=(f==null?void 0:f.digitalClockItem)??ofn,K=Zt({elementType:le,externalSlotProps:d==null?void 0:d.digitalClockItem,ownerState:{},className:Y.item}),ee=zle({value:L,referenceDate:g,utils:r,props:a,timezone:$}),re=st(G=>B(G,"finish","hours")),{setValueAndGoToNextView:me}=rD({view:O,views:I,openTo:k,onViewChange:E,onChange:re,focusedView:P,onFocusedViewChange:A}),te=st(G=>{me(G,"finish")});D.useEffect(()=>{if(i.current===null)return;const G=i.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!G)return;const q=G.offsetTop;(u||P)&&G.focus(),i.current.scrollTop=q-4});const ae=D.useCallback(G=>{const q=tD(m,r),Z=()=>!(y&&q(y,G)||v&&q(G,v)||x&&q(G,X)||b&&q(X,G)),de=()=>r.getMinutes(G)%w!==0?!1:_?!_(G,"hours"):!0;return!Z()||!de()},[m,r,y,v,x,X,b,w,_]),U=D.useMemo(()=>{const G=r.startOfDay(ee);return[G,...Array.from({length:Math.ceil(24*60/c)-1},(q,Z)=>r.addMinutes(G,c*(Z+1)))]},[ee,c,r]),oe=U.findIndex(G=>r.isEqual(G,ee)),ne=G=>{switch(G.key){case"PageUp":{const q=J5(s.current)-5,Z=s.current.children,de=Math.max(0,q),xe=Z[de];xe&&xe.focus(),G.preventDefault();break}case"PageDown":{const q=J5(s.current)+5,Z=s.current.children,de=Math.min(Z.length-1,q),xe=Z[de];xe&&xe.focus(),G.preventDefault();break}}};return C.jsx(rfn,ve({ref:o,className:Oe(Y.root,R),ownerState:V},N,{children:C.jsx(ifn,{ref:s,role:"listbox","aria-label":j.timePickerToolbarTitle,className:Y.list,onKeyDown:ne,children:U.map((G,q)=>{if(z&&ae(G))return null;const Z=r.isEqual(G,L),de=r.format(G,l?"fullTime12h":"fullTime24h"),xe=oe===q||oe===-1&&q===0?0:-1;return C.jsx(le,ve({onClick:()=>!M&&te(G),selected:Z,disabled:T||ae(G),disableRipple:M,role:"option","aria-disabled":M,"aria-selected":Z,tabIndex:xe},K,{children:de}),de)})})}))});function afn(t){return Xe("MuiMultiSectionDigitalClock",t)}const qbe=He("MuiMultiSectionDigitalClock",["root"]);function lfn(t){return Xe("MuiMultiSectionDigitalClockSection",t)}const cfn=He("MuiMultiSectionDigitalClockSection",["root","item"]),ufn=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],ffn=t=>{const{classes:e}=t;return qe({root:["root"],item:["item"]},lfn,e)},dfn=be(w4,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({maxHeight:MVe,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),hfn=be(Br,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:8,margin:"2px 4px",width:AT,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.primary.main,t.palette.action.focusOpacity)}})),pfn=D.forwardRef(function(e,n){const r=D.useRef(null),i=dn(n,r),o=D.useRef(null),s=kn({props:e,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:a,onChange:l,className:c,disabled:u,readOnly:f,items:d,active:h,slots:p,slotProps:g,skipDisabled:m}=s,v=Dt(s,ufn),y=D.useMemo(()=>ve({},s,{alreadyRendered:!!r.current}),[s]),x=ffn(y),b=(p==null?void 0:p.digitalClockSectionItem)??hfn;D.useEffect(()=>{if(r.current===null)return;const S=r.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(h&&a&&S&&S.focus(),!S||o.current===S)return;o.current=S;const O=S.offsetTop;r.current.scrollTop=O-4});const w=d.findIndex(S=>S.isFocused(S.value)),_=S=>{switch(S.key){case"PageUp":{const O=J5(r.current)-5,k=r.current.children,E=Math.max(0,O),P=k[E];P&&P.focus(),S.preventDefault();break}case"PageDown":{const O=J5(r.current)+5,k=r.current.children,E=Math.min(k.length-1,O),P=k[E];P&&P.focus(),S.preventDefault();break}}};return C.jsx(dfn,ve({ref:i,className:Oe(x.root,c),ownerState:y,autoFocusItem:a&&h,role:"listbox",onKeyDown:_},v,{children:d.map((S,O)=>{var R;const k=(R=S.isDisabled)==null?void 0:R.call(S,S.value),E=u||k;if(m&&E)return null;const P=S.isSelected(S.value),A=w===O||w===-1&&O===0?0:-1;return C.jsx(b,ve({onClick:()=>!f&&l(S.value),selected:P,disabled:E,disableRipple:f,role:"option","aria-disabled":f||E||void 0,"aria-label":S.ariaLabel,"aria-selected":P,tabIndex:A,className:x.item},g==null?void 0:g.digitalClockSectionItem,{children:S.label}),S.label)})}))}),gfn=({now:t,value:e,utils:n,ampm:r,isDisabled:i,resolveAriaLabel:o,timeStep:s,valueOrReferenceDate:a})=>{const l=e?n.getHours(e):null,c=[],u=(h,p)=>{const g=p??l;return g===null?!1:r?h===12?g===12||g===0:g===h||g-12===h:g===h},f=h=>u(h,n.getHours(a)),d=r?11:23;for(let h=0;h<=d;h+=s){let p=n.format(n.setHours(t,h),r?"hours12h":"hours24h");const g=o(parseInt(p,10).toString());p=n.formatNumber(p),c.push({value:h,label:p,isSelected:u,isDisabled:i,isFocused:f,ariaLabel:g})}return c},Xbe=({value:t,utils:e,isDisabled:n,timeStep:r,resolveLabel:i,resolveAriaLabel:o,hasValue:s=!0})=>{const a=c=>t===null?!1:s&&t===c,l=c=>t===c;return[...Array.from({length:Math.ceil(60/r)},(c,u)=>{const f=r*u;return{value:f,label:e.formatNumber(i(f)),isDisabled:n,isSelected:a,isFocused:l,ariaLabel:o(f.toString())}})]},mfn=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],vfn=t=>{const{classes:e}=t;return qe({root:["root"]},afn,e)},yfn=be(TU,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(t.vars||t).palette.divider}`})),xfn=D.forwardRef(function(e,n){const r=gr(),i=Eo(),o=kn({props:e,name:"MuiMultiSectionDigitalClock"}),{ampm:s=r.is12HourCycleInCurrentLocale(),timeSteps:a,autoFocus:l,slots:c,slotProps:u,value:f,defaultValue:d,referenceDate:h,disableIgnoringDatePartForTimeValidation:p=!1,maxTime:g,minTime:m,disableFuture:v,disablePast:y,minutesStep:x=1,shouldDisableTime:b,onChange:w,view:_,views:S=["hours","minutes"],openTo:O,onViewChange:k,focusedView:E,onFocusedViewChange:P,className:A,disabled:R,readOnly:T,skipDisabled:M=!1,timezone:I}=o,z=Dt(o,mfn),{value:F,handleValueChange:N,timezone:L}=QO({name:"MultiSectionDigitalClock",timezone:I,value:f,defaultValue:d,onChange:w,valueManager:ia}),B=Ml(),$=P1(L),j=D.useMemo(()=>ve({hours:1,minutes:5,seconds:5},a),[a]),X=zle({value:F,referenceDate:h,utils:r,props:o,timezone:L}),V=st((Z,de,xe)=>N(Z,de,xe)),Y=D.useMemo(()=>!s||!S.includes("hours")||S.includes("meridiem")?S:[...S,"meridiem"],[s,S]),{view:le,setValueAndGoToNextView:K,focusedView:ee}=rD({view:_,views:Y,openTo:O,onViewChange:k,onChange:V,focusedView:E,onFocusedViewChange:P}),re=st(Z=>{K(Z,"finish","meridiem")}),{meridiemMode:me,handleMeridiemChange:te}=Nle(X,s,re,"finish"),ae=D.useCallback((Z,de)=>{const xe=tD(p,r),H=de==="hours"||de==="minutes"&&Y.includes("seconds"),W=({start:se,end:ye})=>!(m&&xe(m,ye)||g&&xe(se,g)||v&&xe(se,$)||y&&xe($,H?ye:se)),J=(se,ye=1)=>{if(se%ye!==0)return!1;if(b)switch(de){case"hours":return!b(r.setHours(X,se),"hours");case"minutes":return!b(r.setMinutes(X,se),"minutes");case"seconds":return!b(r.setSeconds(X,se),"seconds");default:return!1}return!0};switch(de){case"hours":{const se=rP(Z,me,s),ye=r.setHours(X,se),ie=r.setSeconds(r.setMinutes(ye,0),0),fe=r.setSeconds(r.setMinutes(ye,59),59);return!W({start:ie,end:fe})||!J(se)}case"minutes":{const se=r.setMinutes(X,Z),ye=r.setSeconds(se,0),ie=r.setSeconds(se,59);return!W({start:ye,end:ie})||!J(Z,x)}case"seconds":{const se=r.setSeconds(X,Z);return!W({start:se,end:se})||!J(Z)}default:throw new Error("not supported")}},[s,X,p,g,me,m,x,b,r,v,y,$,Y]),U=D.useCallback(Z=>{switch(Z){case"hours":return{onChange:de=>{const xe=rP(de,me,s);K(r.setHours(X,xe),"finish","hours")},items:gfn({now:$,value:F,ampm:s,utils:r,isDisabled:de=>ae(de,"hours"),timeStep:j.hours,resolveAriaLabel:B.hoursClockNumberText,valueOrReferenceDate:X})};case"minutes":return{onChange:de=>{K(r.setMinutes(X,de),"finish","minutes")},items:Xbe({value:r.getMinutes(X),utils:r,isDisabled:de=>ae(de,"minutes"),resolveLabel:de=>r.format(r.setMinutes($,de),"minutes"),timeStep:j.minutes,hasValue:!!F,resolveAriaLabel:B.minutesClockNumberText})};case"seconds":return{onChange:de=>{K(r.setSeconds(X,de),"finish","seconds")},items:Xbe({value:r.getSeconds(X),utils:r,isDisabled:de=>ae(de,"seconds"),resolveLabel:de=>r.format(r.setSeconds($,de),"seconds"),timeStep:j.seconds,hasValue:!!F,resolveAriaLabel:B.secondsClockNumberText})};case"meridiem":{const de=tg(r,"am"),xe=tg(r,"pm");return{onChange:te,items:[{value:"am",label:de,isSelected:()=>!!F&&me==="am",isFocused:()=>!!X&&me==="am",ariaLabel:de},{value:"pm",label:xe,isSelected:()=>!!F&&me==="pm",isFocused:()=>!!X&&me==="pm",ariaLabel:xe}]}}default:throw new Error(`Unknown view: ${Z} found.`)}},[$,F,s,r,j.hours,j.minutes,j.seconds,B.hoursClockNumberText,B.minutesClockNumberText,B.secondsClockNumberText,me,K,X,ae,te]),oe=D.useMemo(()=>{if(!i)return Y;const Z=Y.filter(de=>de!=="meridiem");return Z.reverse(),Y.includes("meridiem")&&Z.push("meridiem"),Z},[i,Y]),ne=D.useMemo(()=>Y.reduce((Z,de)=>ve({},Z,{[de]:U(de)}),{}),[Y,U]),G=o,q=vfn(G);return C.jsx(yfn,ve({ref:n,className:Oe(q.root,A),ownerState:G,role:"group"},z,{children:oe.map(Z=>C.jsx(pfn,{items:ne[Z].items,onChange:ne[Z].onChange,active:le===Z,autoFocus:l??ee===Z,disabled:R,readOnly:T,slots:c,slotProps:u,skipDisabled:M,"aria-label":B.selectViewText(Z)},Z))}))}),Q9=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:_,sx:S,autoFocus:O,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:E,timezone:P})=>C.jsx(Zun,{view:t,onViewChange:e,focusedView:n&&yC(n)?n:null,onFocusedViewChange:r,views:i.filter(yC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:_,sx:S,autoFocus:O,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:E,timezone:P}),bfn=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:P})=>C.jsx(sfn,{view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i.filter(yC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeStep:k==null?void 0:k.minutes,skipDisabled:E,timezone:P}),Ybe=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:P})=>C.jsx(xfn,{view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i.filter(yC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:P}),wfn=D.forwardRef(function(e,n){var g;const r=Eo(),{toolbar:i,tabs:o,content:s,actionBar:a,shortcuts:l}=UVe(e),{sx:c,className:u,isLandscape:f,classes:d}=e,h=a&&(((g=a.props.actions)==null?void 0:g.length)??0)>0,p=ve({},e,{isRtl:r});return C.jsxs(WVe,{ref:n,className:Oe(hf.root,d==null?void 0:d.root,u),sx:[{[`& .${hf.tabs}`]:{gridRow:4,gridColumn:"1 / 4"},[`& .${hf.actionBar}`]:{gridRow:5}},...Array.isArray(c)?c:[c]],ownerState:p,children:[f?l:i,f?i:l,C.jsxs(VVe,{className:Oe(hf.contentWrapper,d==null?void 0:d.contentWrapper),sx:{display:"grid"},children:[s,o,h&&C.jsx(zf,{sx:{gridRow:3,gridColumn:"1 / 4"}})]}),a]})}),_fn=["openTo","focusedView","timeViewsCount"],Sfn=function(e,n,r){var u,f;const{openTo:i,focusedView:o,timeViewsCount:s}=r,a=Dt(r,_fn),l=ve({},a,{focusedView:null,sx:[{[`&.${qbe.root}`]:{borderBottom:0},[`&.${qbe.root}, .${cfn.root}, &.${efn.root}`]:{maxHeight:EU}}]}),c=kT(n);return C.jsxs(D.Fragment,{children:[(u=e[c?"day":n])==null?void 0:u.call(e,ve({},r,{view:c?"day":n,focusedView:o&&vC(o)?o:null,views:r.views.filter(vC),sx:[{gridColumn:1},...l.sx]})),s>0&&C.jsxs(D.Fragment,{children:[C.jsx(zf,{orientation:"vertical",sx:{gridColumn:2}}),(f=e[c?n:"hours"])==null?void 0:f.call(e,ve({},l,{view:c?n:"hours",focusedView:o&&kT(o)?o:null,openTo:kT(i)?i:"hours",views:r.views.filter(kT),sx:[{gridColumn:3},...l.sx]}))]})]})},KVe=D.forwardRef(function(e,n){var y,x,b,w;const r=Ml(),i=gr(),o=RVe(e,"MuiDesktopDateTimePicker"),{shouldRenderTimeInASingleColumn:s,thresholdToRenderTimeInASingleColumn:a,views:l,timeSteps:c}=xun(o),u=s?bfn:Ybe,f=ve({day:J_,month:J_,year:J_,hours:u,minutes:u,seconds:u,meridiem:u},o.viewRenderers),d=o.ampmInClock??!0,p=((y=f.hours)==null?void 0:y.name)===Ybe.name?l:l.filter(_=>_!=="meridiem"),g=s?[]:["accept"],m=ve({},o,{viewRenderers:f,format:HVe(i,o),views:p,yearsPerRow:o.yearsPerRow??4,ampmInClock:d,timeSteps:c,thresholdToRenderTimeInASingleColumn:a,shouldRenderTimeInASingleColumn:s,slots:ve({field:kVe,layout:wfn,openPickerIcon:Dsn},o.slots),slotProps:ve({},o.slotProps,{field:_=>{var S;return ve({},rA((S=o.slotProps)==null?void 0:S.field,_),mVe(o),{ref:n})},toolbar:ve({hidden:!0,ampmInClock:d,toolbarVariant:"desktop"},(x=o.slotProps)==null?void 0:x.toolbar),tabs:ve({hidden:!0},(b=o.slotProps)==null?void 0:b.tabs),actionBar:_=>{var S;return ve({actions:g},rA((S=o.slotProps)==null?void 0:S.actionBar,_))}})}),{renderPicker:v}=gun({props:m,valueManager:ia,valueType:"date-time",getOpenDialogAriaText:vVe({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(w=m.localeText)==null?void 0:w.openDatePickerDialogue}),validator:_U,rendererInterceptor:Sfn});return v()});KVe.propTypes={ampm:ge.bool,ampmInClock:ge.bool,autoFocus:ge.bool,className:ge.string,closeOnSelect:ge.bool,dayOfWeekFormatter:ge.func,defaultValue:ge.object,disabled:ge.bool,disableFuture:ge.bool,disableHighlightToday:ge.bool,disableIgnoringDatePartForTimeValidation:ge.bool,disableOpenPicker:ge.bool,disablePast:ge.bool,displayWeekNumber:ge.bool,enableAccessibleFieldDOMStructure:ge.any,fixedWeekNumber:ge.number,format:ge.string,formatDensity:ge.oneOf(["dense","spacious"]),inputRef:FAe,label:ge.node,loading:ge.bool,localeText:ge.object,maxDate:ge.object,maxDateTime:ge.object,maxTime:ge.object,minDate:ge.object,minDateTime:ge.object,minTime:ge.object,minutesStep:ge.number,monthsPerRow:ge.oneOf([3,4]),name:ge.string,onAccept:ge.func,onChange:ge.func,onClose:ge.func,onError:ge.func,onMonthChange:ge.func,onOpen:ge.func,onSelectedSectionsChange:ge.func,onViewChange:ge.func,onYearChange:ge.func,open:ge.bool,openTo:ge.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:ge.oneOf(["landscape","portrait"]),readOnly:ge.bool,reduceAnimations:ge.bool,referenceDate:ge.object,renderLoading:ge.func,selectedSections:ge.oneOfType([ge.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),ge.number]),shouldDisableDate:ge.func,shouldDisableMonth:ge.func,shouldDisableTime:ge.func,shouldDisableYear:ge.func,showDaysOutsideCurrentMonth:ge.bool,skipDisabled:ge.bool,slotProps:ge.object,slots:ge.object,sx:ge.oneOfType([ge.arrayOf(ge.oneOfType([ge.func,ge.object,ge.bool])),ge.func,ge.object]),thresholdToRenderTimeInASingleColumn:ge.number,timeSteps:ge.shape({hours:ge.number,minutes:ge.number,seconds:ge.number}),timezone:ge.string,value:ge.object,view:ge.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:ge.shape({day:ge.func,hours:ge.func,meridiem:ge.func,minutes:ge.func,month:ge.func,seconds:ge.func,year:ge.func}),views:ge.arrayOf(ge.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:ge.oneOf(["asc","desc"]),yearsPerRow:ge.oneOf([3,4])};const Cfn=be(ed)({[`& .${JT.container}`]:{outline:0},[`& .${JT.paper}`]:{outline:0,minWidth:OU}}),Ofn=be(Nf)({"&:first-of-type":{padding:0}});function Efn(t){const{children:e,onDismiss:n,open:r,slots:i,slotProps:o}=t,s=(i==null?void 0:i.dialog)??Cfn,a=(i==null?void 0:i.mobileTransition)??eO;return C.jsx(s,ve({open:r,onClose:n},o==null?void 0:o.dialog,{TransitionComponent:a,TransitionProps:o==null?void 0:o.mobileTransition,PaperComponent:i==null?void 0:i.mobilePaper,PaperProps:o==null?void 0:o.mobilePaper,children:C.jsx(Ofn,{children:e})}))}const Tfn=["props","getOpenDialogAriaText"],kfn=t=>{var B;let{props:e,getOpenDialogAriaText:n}=t,r=Dt(t,Tfn);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,localeText:x}=e,b=D.useRef(null),w=Jf(),_=((B=o==null?void 0:o.toolbar)==null?void 0:B.hidden)??!1,{open:S,actions:O,layoutProps:k,renderCurrentView:E,fieldProps:P,contextValue:A}=jVe(ve({},r,{props:e,fieldRef:b,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),R=i.field,T=Zt({elementType:R,externalSlotProps:o==null?void 0:o.field,additionalProps:ve({},P,_&&{id:w},!(y||v)&&{onClick:O.onOpen,onKeyDown:Csn(O.onOpen)},{readOnly:v??!0,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p},m?{inputRef:m}:{}),ownerState:e});T.inputProps=ve({},T.inputProps,{"aria-label":n(P.value)});const M=ve({textField:i.textField},T.slots),I=i.layout??GVe;let z=w;_&&(g?z=`${w}-label`:z=void 0);const F=ve({},o,{toolbar:ve({},o==null?void 0:o.toolbar,{titleId:w}),mobilePaper:ve({"aria-labelledby":z},o==null?void 0:o.mobilePaper)}),N=dn(b,T.unstableFieldRef);return{renderPicker:()=>C.jsxs(bVe,{contextValue:A,localeText:x,children:[C.jsx(R,ve({},T,{slots:M,slotProps:F,unstableFieldRef:N})),C.jsx(Efn,ve({},O,{open:S,slots:i,slotProps:F,children:C.jsx(I,ve({},k,F==null?void 0:F.layout,{slots:i,slotProps:F,children:E()}))}))]})}},ZVe=D.forwardRef(function(e,n){var u,f,d;const r=Ml(),i=gr(),o=RVe(e,"MuiMobileDateTimePicker"),s=ve({day:J_,month:J_,year:J_,hours:Q9,minutes:Q9,seconds:Q9},o.viewRenderers),a=o.ampmInClock??!1,l=ve({},o,{viewRenderers:s,format:HVe(i,o),ampmInClock:a,slots:ve({field:kVe},o.slots),slotProps:ve({},o.slotProps,{field:h=>{var p;return ve({},rA((p=o.slotProps)==null?void 0:p.field,h),mVe(o),{ref:n})},toolbar:ve({hidden:!1,ampmInClock:a},(u=o.slotProps)==null?void 0:u.toolbar),tabs:ve({hidden:!1},(f=o.slotProps)==null?void 0:f.tabs)})}),{renderPicker:c}=kfn({props:l,valueManager:ia,valueType:"date-time",getOpenDialogAriaText:vVe({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(d=l.localeText)==null?void 0:d.openDatePickerDialogue}),validator:_U});return c()});ZVe.propTypes={ampm:ge.bool,ampmInClock:ge.bool,autoFocus:ge.bool,className:ge.string,closeOnSelect:ge.bool,dayOfWeekFormatter:ge.func,defaultValue:ge.object,disabled:ge.bool,disableFuture:ge.bool,disableHighlightToday:ge.bool,disableIgnoringDatePartForTimeValidation:ge.bool,disableOpenPicker:ge.bool,disablePast:ge.bool,displayWeekNumber:ge.bool,enableAccessibleFieldDOMStructure:ge.any,fixedWeekNumber:ge.number,format:ge.string,formatDensity:ge.oneOf(["dense","spacious"]),inputRef:FAe,label:ge.node,loading:ge.bool,localeText:ge.object,maxDate:ge.object,maxDateTime:ge.object,maxTime:ge.object,minDate:ge.object,minDateTime:ge.object,minTime:ge.object,minutesStep:ge.number,monthsPerRow:ge.oneOf([3,4]),name:ge.string,onAccept:ge.func,onChange:ge.func,onClose:ge.func,onError:ge.func,onMonthChange:ge.func,onOpen:ge.func,onSelectedSectionsChange:ge.func,onViewChange:ge.func,onYearChange:ge.func,open:ge.bool,openTo:ge.oneOf(["day","hours","minutes","month","seconds","year"]),orientation:ge.oneOf(["landscape","portrait"]),readOnly:ge.bool,reduceAnimations:ge.bool,referenceDate:ge.object,renderLoading:ge.func,selectedSections:ge.oneOfType([ge.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),ge.number]),shouldDisableDate:ge.func,shouldDisableMonth:ge.func,shouldDisableTime:ge.func,shouldDisableYear:ge.func,showDaysOutsideCurrentMonth:ge.bool,slotProps:ge.object,slots:ge.object,sx:ge.oneOfType([ge.arrayOf(ge.oneOfType([ge.func,ge.object,ge.bool])),ge.func,ge.object]),timezone:ge.string,value:ge.object,view:ge.oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:ge.shape({day:ge.func,hours:ge.func,minutes:ge.func,month:ge.func,seconds:ge.func,year:ge.func}),views:ge.arrayOf(ge.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:ge.oneOf(["asc","desc"]),yearsPerRow:ge.oneOf([3,4])};const Afn=["desktopModeMediaQuery"],Pfn=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:i=Osn}=r,o=Dt(r,Afn);return Tee(i,{defaultMatches:!0})?C.jsx(KVe,ve({ref:n},o)):C.jsx(ZVe,ve({ref:n},o))}),Mfn=t=>({dateTimePicker:{marginTop:t.spacing(2)}}),Rfn=({classes:t,hasTimeDimension:e,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?Cgt(d):null)},s=C.jsx(Fy,{shrink:!0,htmlFor:"time-select",children:`${pe.get("Time")} (UTC)`}),l=typeof n=="number"?uW(n):null;let c,u;Array.isArray(r)&&(c=uW(r[0]),u=uW(r[1]));const f=C.jsx(iVe,{dateAdapter:jon,children:C.jsx(Pfn,{disabled:!e,className:t.dateTimePicker,format:"yyyy-MM-dd hh:mm:ss",value:l,minDateTime:c,maxDateTime:u,onChange:o,ampm:!1,slotProps:{textField:{variant:"standard",size:"small"}},viewRenderers:{hours:null,minutes:null,seconds:null}})});return C.jsx(tP,{label:s,control:f})},Dfn=Don(Mfn)(Rfn),Ifn=t=>({locale:t.controlState.locale,hasTimeDimension:!!vO(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Lfn={selectTime:sU},$fn=Rn(Ifn,Lfn)(Dfn),Qbe=5,Ffn={box:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(Qbe),marginRight:t.spacing(Qbe),minWidth:200}),label:{color:"grey",fontSize:"1em"}};function Nfn({hasTimeDimension:t,selectedTime:e,selectTime:n,selectedTimeRange:r}){const[i,o]=D.useState(e);if(D.useEffect(()=>{o(e||(r?r[0]:0))},[e,r]),!t)return null;const s=(f,d)=>{typeof d=="number"&&o(d)},a=(f,d)=>{n&&typeof d=="number"&&n(d)},l=Array.isArray(r);l||(r=[Date.now()-2*ADe.years,Date.now()]);const c=[{value:r[0],label:dA(r[0])},{value:r[1],label:dA(r[1])}];function u(f){return aO(f)}return C.jsx(ot,{sx:Ffn.box,children:C.jsx(Mt,{arrow:!0,title:pe.get("Select time in dataset"),children:C.jsx(t1,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:s,onChangeCommitted:a,size:"small"})})})}const zfn=t=>({locale:t.controlState.locale,hasTimeDimension:!!vO(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),jfn={selectTime:sU,selectTimeRange:S8e},Bfn=Rn(zfn,jfn)(Nfn),Ufn=lt(C.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),Wfn=lt(C.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),Vfn=lt(C.jsx("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Gfn=lt(C.jsx("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Hfn=lt(C.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"),qfn=lt(C.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"),dw={formControl:t=>({marginTop:t.spacing(2.5),marginLeft:t.spacing(1),marginRight:t.spacing(1)}),iconButton:{padding:"2px"}};function Xfn({timeAnimationActive:t,timeAnimationInterval:e,updateTimeAnimation:n,selectedTime:r,selectedTimeRange:i,selectTime:o,incSelectedTime:s}){const a=D.useRef(null);D.useEffect(()=>(p(),m));const l=()=>{s(1)},c=()=>{n(!t,e)},u=()=>{s(1)},f=()=>{s(-1)},d=()=>{o(i?i[0]:null)},h=()=>{o(i?i[1]:null)},p=()=>{t?g():m()},g=()=>{m(),a.current=window.setInterval(l,e)},m=()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},v=typeof r=="number",y=t?C.jsx(Hfn,{}):C.jsx(qfn,{}),x=C.jsx(Gt,{disabled:!v,onClick:c,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Auto-step through times in the dataset"),children:y})}),b=C.jsx(Gt,{disabled:!v||t,onClick:d,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("First time step"),children:C.jsx(Vfn,{})})}),w=C.jsx(Gt,{disabled:!v||t,onClick:f,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Previous time step"),children:C.jsx(Ufn,{})})}),_=C.jsx(Gt,{disabled:!v||t,onClick:u,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Next time step"),children:C.jsx(Wfn,{})})}),S=C.jsx(Gt,{disabled:!v||t,onClick:h,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Last time step"),children:C.jsx(Gfn,{})})});return C.jsx(td,{sx:dw.formControl,variant:"standard",children:C.jsxs(ot,{children:[b,w,x,_,S]})})}const Yfn=t=>({locale:t.controlState.locale,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,timeAnimationActive:t.controlState.timeAnimationActive,timeAnimationInterval:t.controlState.timeAnimationInterval}),Qfn={selectTime:sU,incSelectedTime:cZt,updateTimeAnimation:fZt},Kfn=Rn(Yfn,Qfn)(Xfn),Zfn=lt(C.jsx("path",{d:"M16 20H2V4h14zm2-12h4V4h-4zm0 12h4v-4h-4zm0-6h4v-4h-4z"}),"ViewSidebar"),Jfn=oa(td)(({theme:t})=>({marginTop:t.spacing(2),marginRight:t.spacing(.5),marginLeft:"auto"}));function edn({visible:t,sidebarOpen:e,setSidebarOpen:n,openDialog:r,allowRefresh:i,updateResources:o,allowSharing:s,shareStatePermalink:a,compact:l}){if(!t)return null;const c=C.jsx(xr,{value:"sidebar",selected:e,onClick:()=>n(!e),size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Show or hide sidebar"),children:C.jsx(Zfn,{})})});let u,f,d,h;return l&&(u=i&&C.jsx(Gt,{onClick:o,size:"small",children:C.jsx(Mt,{arrow:!0,title:pe.get("Refresh"),children:C.jsx(rRe,{})})}),f=s&&C.jsx(Gt,{onClick:a,size:"small",children:C.jsx(Mt,{arrow:!0,title:pe.get("Share"),children:C.jsx(iRe,{})})}),d=Pn.instance.branding.allowDownloads&&C.jsx(Gt,{onClick:()=>r("export"),size:"small",children:C.jsx(Mt,{arrow:!0,title:pe.get("Export data"),children:C.jsx(oRe,{})})}),h=C.jsx(Gt,{onClick:()=>r("settings"),size:"small",children:C.jsx(Mt,{arrow:!0,title:pe.get("Settings"),children:C.jsx(nRe,{})})})),C.jsx(Jfn,{variant:"standard",children:C.jsxs(ot,{children:[u,f,d,h,c]})})}const tdn=t=>({locale:t.controlState.locale,visible:!!(t.controlState.selectedDatasetId||t.controlState.selectedPlaceId),sidebarOpen:t.controlState.sidebarOpen,compact:Pn.instance.branding.compact,allowRefresh:Pn.instance.branding.allowRefresh,allowSharing:Pn.instance.branding.allowSharing}),ndn={setSidebarOpen:cle,openDialog:T1,updateResources:BUe,shareStatePermalink:jUe},rdn=Rn(tdn,ndn)(edn),idn=t=>({locale:t.controlState.locale,show:t.dataState.datasets.length>0}),odn={},sdn=({show:t})=>t?C.jsxs(Ynn,{children:[C.jsx(ern,{}),C.jsx(crn,{}),C.jsx(prn,{}),C.jsx(wrn,{}),C.jsx(Mrn,{}),C.jsx($fn,{}),C.jsx(Kfn,{}),C.jsx(Bfn,{}),C.jsx(rdn,{})]}):null,adn=Rn(idn,odn)(sdn);function JVe(t){const e=D.useRef(null),n=D.useRef(o=>{if(o.buttons===1&&e.current!==null){o.preventDefault();const{screenX:s,screenY:a}=o,[l,c]=e.current,u=[s-l,a-c];e.current=[s,a],t(u)}}),r=D.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=D.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 Kbe={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 ldn({dir:t,onChange:e}){const r=JVe(([i,o])=>{e(i)});return C.jsx(ot,{sx:t==="hor"?Kbe.hor:Kbe.ver,onMouseDown:r})}const bL={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 cdn({dir:t,splitPosition:e,setSplitPosition:n,children:r,style:i,child1Style:o,child2Style:s}){const a=D.useRef(null);if(!r||!Array.isArray(r)||r.length!==2)return null;const l=t==="hor"?bL.childHor:bL.childVer,c=t==="hor"?{width:e}:{height:e},u=f=>{a.current&&yr(a.current.clientWidth)&&n(a.current.clientWidth+f)};return C.jsxs("div",{id:"SplitPane",style:{...i,...t==="hor"?bL.hor:bL.ver},children:[C.jsx("div",{ref:a,id:"SplitPane-Child-1",style:{...l,...o,...c},children:r[0]}),C.jsx(ldn,{dir:t,onChange:u}),C.jsx("div",{id:"SplitPane-Child-2",style:{...l,...s},children:r[1]})]})}const udn=({placeGroup:t,mapProjection:e,visible:n})=>{const r=D.useRef(new GM);return D.useEffect(()=>{const i=r.current,o=t.features;if(o.length===0)i.clear();else{const s=i.getFeatures(),a=new Set(s.map(f=>f.getId())),l=new Set(o.map(f=>f.id)),c=o.filter(f=>!a.has(f.id));s.filter(f=>!l.has(f.getId()+"")).forEach(f=>i.removeFeature(f)),c.forEach(f=>{const d=new s1().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,g=(f.properties||{}).source?"diamond":"circle";Zae(d,h,nte(p),g),i.addFeature(d)})}},[t,e]),C.jsx(z4,{id:t.id,opacity:t.id===wf?1:.8,visible:n,zIndex:501,source:r.current})};class fdn extends hO{addMapObject(e){const n=new H0t(this.getOptions());return e.addControl(n),n}updateMapObject(e,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(e,n){e.removeControl(n)}}class K9 extends hO{addMapObject(e){const n=new _xt(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 ddn extends hO{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 jd({...this.props,center:T4(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});e.getLayers().forEach(s=>{s instanceof L4&&s.getSource().forEachFeature(a=>{var l;(l=a.getGeometry())==null||l.transform(r,n)})}),e.setView(o)}else e.getView().setProperties(this.props);return e.getView()}}function wL(t,e){const n=t.getLayers();for(let r=0;r{if(R){const B=O||null;if(B!==M&&Hs[Z9]){const j=Hs[Z9].getSource();if(j.clear(),B){const X=vdn(R,B);if(X){const V=X.clone();V.setId("select-"+X.getId()),V.setStyle(void 0),j.addFeature(V)}}I(B)}}},[R,O,M]),D.useEffect(()=>{R&&R.getLayers().forEach(B=>{B instanceof oDe?B.getSource().changed():B.changed()})},[R,E]),D.useEffect(()=>{if(R===null||!yr(P))return;const B=ee=>{Jbe(R,ee,P,0)},$=ee=>{Jbe(R,ee,P,1)},j=ee=>{ee.context.restore()},X=wL(R,"rgb2"),V=wL(R,"variable2"),Y=wL(R,"rgb"),le=wL(R,"variable"),K=[[X,B],[V,B],[Y,$],[le,$]];for(const[ee,re]of K)ee&&(ee.on("prerender",re),ee.on("postrender",j));return()=>{for(const[ee,re]of K)ee&&(ee.un("prerender",re),ee.un("postrender",j))}});const z=B=>{if(n==="Select"){const $=B.map;let j=null;const X=$.getFeaturesAtPixel(B.pixel);if(X){for(const V of X)if(typeof V.getId=="function"){j=V.getId()+"";break}}S&&S(j,k,!1)}},F=B=>{var $;if(R!==null&&y&&n!=="Select"){const j=B.feature;let X=j.getGeometry();if(!X)return;const V=Uf(oO+n.toLowerCase()+"-"),Y=R.getView().getProjection();if(X instanceof Qte){const te=lpt(X);j.setGeometry(te)}X=j.clone().getGeometry().transform(Y,rO);const le=new s1().writeGeometryObject(X);j.setId(V);let K=0;if(Hs[wf]){const te=Hs[wf],ae=($=te==null?void 0:te.getSource())==null?void 0:$.getFeatures();ae&&(K=ae.length)}const ee=ydn(b,n),re=ab(K),me=UPe(re,t.palette.mode);Zae(j,me,nte()),y(v,V,{label:ee,color:re},le,!0)}return!0};function N(B){A&&A(B),T(B)}const L=B=>{x&&B.forEach($=>{const j=new FileReader;j.onloadend=()=>{typeof j.result=="string"&&x(j.result)},j.readAsText($,"UTF-8")})};return C.jsx(eRe,{children:C.jsxs(fbt,{id:e,onClick:B=>z(B),onMapRef:N,mapObjects:Hs,isStale:!0,onDropFiles:L,children:[C.jsx(ddn,{id:"view",projection:r}),C.jsxs(iDe,{children:[i,o,s,a,l,f,c,C.jsx(z4,{id:Z9,opacity:.7,zIndex:500,style:gdn,source:hdn}),C.jsx(C.Fragment,{children:b.map(B=>C.jsx(udn,{placeGroup:B,mapProjection:r,visible:_&&w[B.id]},B.id))})]}),u,C.jsx(K9,{id:"drawPoint",layerId:wf,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:F}),C.jsx(K9,{id:"drawPolygon",layerId:wf,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:F}),C.jsx(K9,{id:"drawCircle",layerId:wf,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:F}),d,h,g,m,p,C.jsx(fdn,{bar:!1})]})})}function vdn(t,e){var n;for(const r of t.getLayers().getArray())if(r instanceof L4){const o=(n=r.getSource())==null?void 0:n.getFeatureById(e);if(o)return o}return null}function ydn(t,e){const n=pe.get(e),r=t.find(i=>i.id===wf);if(r)for(let i=1;;i++){const o=`${n} ${i}`;if(!!!r.features.find(a=>a.properties?a.properties.label===o:!1))return o}return`${n} 1`}function Jbe(t,e,n,r){const i=t.getSize();if(!i)return;const o=i[0],s=i[1];let a,l,c,u;r===0?(a=hm(e,[0,0]),l=hm(e,[n,0]),c=hm(e,[0,s]),u=hm(e,[n,s])):(a=hm(e,[n,0]),l=hm(e,[o,0]),c=hm(e,[n,s]),u=hm(e,[o,s]));const f=e.context;f.save(),f.beginPath(),f.moveTo(a[0],a[1]),f.lineTo(c[0],c[1]),f.lineTo(u[0],u[1]),f.lineTo(l[0],l[1]),f.closePath(),f.clip()}const _L=1,sP=.2,KO=240,t9e=20,SL={container:{width:KO},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 xdn({categories:t,onOpenColorBarEditor:e}){return!t||t.length===0?null:C.jsx(ot,{sx:SL.container,children:t.map((n,r)=>C.jsxs(ot,{onClick:e,sx:SL.itemContainer,children:[C.jsx(ot,{sx:SL.itemColorBox,style:{backgroundColor:n.color}}),C.jsx(ot,{component:"span",sx:SL.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const e1e={nominal:{cursor:"pointer"},error:{cursor:"pointer",border:"0.5px solid red"}};function bdn({colorBar:t,opacity:e,width:n,height:r,onClick:i}){const o=D.useRef(null);D.useEffect(()=>{const c=o.current;c!==null&&g_t(t,e,c)},[t,e]);const{baseName:s,imageData:a}=t,l=a?s:pe.get("Unknown color bar")+`: ${s}`;return C.jsx(Mt,{title:l,children:C.jsx("canvas",{ref:o,width:n||KO,height:r||t9e+4,onClick:i,style:a?e1e.nominal:e1e.error})})}function wdn(t,e,n=5,r=!1,i=!1){return GQ(Sdn(t,e,n,r),i)}function GQ(t,e=!1){return t.map(n=>by(n,void 0,e))}function by(t,e,n){if(e===void 0&&(e=n?2:_dn(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 _dn(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 Sdn(t,e,n,r){const i=new Array(n);if(r){const o=Math.log10(t),a=(Math.log10(e)-o)/(n-1);for(let l=1;lwdn(t,e,n,r),[t,e,n,r]);return C.jsx(ot,{sx:Cdn.container,onClick:i,children:o.map((s,a)=>C.jsx("span",{children:s},a))})}const Edn=lt(C.jsx("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress"),t1e=t=>t,Tdn=t=>Math.pow(10,t),kdn=Math.log10,n1e=(t,e)=>typeof t=="number"?e(t):t.map(e);class Adn{constructor(e){gn(this,"_fn");gn(this,"_invFn");e?(this._fn=kdn,this._invFn=Tdn):(this._fn=t1e,this._invFn=t1e)}scale(e){return n1e(e,this._fn)}scaleInv(e){return n1e(e,this._invFn)}}function Pdn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const s=D.useMemo(()=>new Adn(n==="log"),[n]),[a,l]=D.useState(()=>s.scale(e));D.useEffect(()=>{l(s.scale(e))},[s,e]);const c=(k,E)=>{Array.isArray(E)&&l(E)},u=(k,E)=>{if(Array.isArray(E)){const A=GQ(s.scaleInv(E)).map(R=>Number.parseFloat(R));i(t,A,n,r)}},[f,d]=s.scale(o),h=f=2?v=Math.max(2,Math.round(m/2)):(v=4,m=8);const y=f({value:S[E],label:k}));return C.jsx(t1,{min:b,max:w,value:a,marks:O,step:_,valueLabelFormat:k=>by(s.scaleInv(k)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const J9=5,bm={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(J9),marginRight:t.spacing(J9),minWidth:320,width:`calc(100% - ${t.spacing(2*(J9+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 Mdn({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o}){const[s,a]=D.useState(n),[l,c]=D.useState(n),[u,f]=D.useState(r1e(n)),[d,h]=D.useState([!1,!1]);D.useEffect(()=>{f(r1e(n))},[n]);const p=y=>{const x=y.target.value;f([x,u[1]]);const b=Number.parseFloat(x);let w=!1;if(!Number.isNaN(b)&&b{const x=y.target.value;f([u[0],x]);const b=Number.parseFloat(x);let w=!1;if(!Number.isNaN(b)&&b>s[0]){if(b!==s[1]){const _=[s[0],b];a(_),c(_),o(e,_,r,i)}}else w=!0;h([d[0],w])},m=()=>{const y=t.colorRecords,x=y[0].value,b=y[y.length-1].value,w=[x,b];a(w),c(w),o(e,w,r,i),h([!1,!1])},v=(y,x)=>{o(e,n,x?"log":"lin",i)};return C.jsxs(ot,{sx:bm.container,children:[C.jsxs(ot,{sx:bm.header,children:[C.jsx(Jt,{sx:bm.title,children:pe.get("Value Range")}),C.jsx("span",{style:{flexGrow:1}}),t.colorRecords&&C.jsx(au,{sx:{marginRight:1},icon:C.jsx(Edn,{}),onClick:m,tooltipText:pe.get("Set min/max from color mapping values")}),C.jsx(sg,{sx:bm.logLabel,control:C.jsx(Mt,{title:pe.get("Logarithmic scaling"),children:C.jsx(Zee,{checked:r==="log",onChange:v,size:"small"})}),label:C.jsx(Jt,{variant:"body2",children:pe.get("Log-scaled")}),labelPlacement:"start"})]}),C.jsx(ot,{sx:bm.sliderBox,children:C.jsx(Pdn,{variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),C.jsxs(ot,{component:"form",sx:bm.minMaxBox,children:[C.jsx(Jr,{sx:bm.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),C.jsx(Jr,{sx:bm.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>g(y)})]})]})}function r1e(t){return[t[0]+"",t[1]+""]}function Rdn({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o,onOpenColorBarEditor:s}){const[a,l]=D.useState(null),c=f=>{l(f.currentTarget)},u=()=>{l(null)};return C.jsxs(C.Fragment,{children:[C.jsx(bdn,{colorBar:t,opacity:i,onClick:s}),C.jsx(Odn,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),C.jsx(e1,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:C.jsx(Mdn,{variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}const Ddn=lt(C.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"),Idn=lt(C.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"),S2={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 Ldn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const s=()=>{const c=!r.isAlpha;t=uN({...r,isAlpha:c}),o(t,e,n,i)},a=()=>{const c=!r.isReversed;t=uN({...r,isReversed:c}),o(t,e,n,i)},l=(c,u)=>{o(t,e,n,u)};return C.jsxs(C.Fragment,{children:[C.jsx(ot,{sx:S2.container,children:C.jsxs(ot,{sx:S2.settingsBar,children:[C.jsx(Mt,{arrow:!0,title:pe.get("Hide small values"),children:C.jsx(xr,{value:"alpha",selected:r.isAlpha,onChange:s,size:"small",children:C.jsx(Idn,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Reverse"),children:C.jsx(xr,{value:"reverse",selected:r.isReversed,onChange:a,size:"small",children:C.jsx(Ddn,{fontSize:"inherit"})})})]})}),C.jsxs(ot,{component:"div",sx:S2.opacityContainer,children:[C.jsx(ot,{component:"span",fontSize:"small",sx:S2.opacityLabel,children:pe.get("Opacity")}),C.jsx(t1,{min:0,max:1,value:i,step:.01,sx:S2.opacitySlider,onChange:l,size:"small"})]})]})}const $dn={colorBarGroupTitle:t=>({marginTop:t.spacing(2*sP),fontSize:"small",color:t.palette.text.secondary})};function n9e({title:t,description:e}){return C.jsx(Mt,{arrow:!0,title:e,placement:"left",children:C.jsx(ot,{sx:$dn.colorBarGroupTitle,children:t})})}const i1e=t=>({marginTop:t.spacing(sP),height:20,borderWidth:1,borderStyle:"solid",cursor:"pointer"}),o1e={colorBarItem:t=>({...i1e(t),borderColor:t.palette.mode==="dark"?"lightgray":"darkgray"}),colorBarItemSelected:t=>({...i1e(t),borderColor:"blue"})};function jle({imageData:t,selected:e,onSelect:n,width:r,title:i}){let o=C.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=C.jsx(Mt,{arrow:!0,title:i,placement:"left",children:o})),C.jsx(ot,{width:r||KO,sx:e?o1e.colorBarItemSelected:o1e.colorBarItem,children:o})}function Fdn({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,images:r}){return C.jsxs(C.Fragment,{children:[C.jsx(n9e,{title:t.title,description:t.description}),t.names.map(i=>C.jsx(jle,{title:i,imageData:r[i],selected:i===e,onSelect:()=>n(i)},i))]})}const kU=lt(C.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 r9e(){const t=D.useRef(),e=D.useRef(()=>{t.current&&(t.current(),t.current=void 0)}),n=D.useRef(r=>{t.current=r});return D.useEffect(()=>e.current,[]),[e.current,n.current]}const Ndn=lt(C.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"),zdn=lt(C.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function jdn({anchorEl:t,markdownText:e,open:n,onClose:r}){return e?C.jsx(e1,{anchorEl:t,open:n,onClose:r,children:C.jsx(kl,{sx:{width:"32em",overflowY:"auto",fontSize:"smaller",paddingLeft:2,paddingRight:2},children:C.jsx(Cle,{text:e})})}):null}function i9e({size:t,helpUrl:e}){const[n,r]=D.useState(null),i=D.useRef(null),o=Ole(e),s=()=>{r(i.current)},a=()=>{r(null)};return C.jsxs(C.Fragment,{children:[C.jsx(Gt,{onClick:s,size:t,ref:i,children:C.jsx(tRe,{fontSize:"inherit"})}),C.jsx(jdn,{anchorEl:n,open:!!n,onClose:a,markdownText:o})]})}const s1e={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function iD({onDone:t,onCancel:e,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return C.jsxs(ot,{sx:s1e.container,children:[C.jsx(ot,{children:o&&C.jsx(i9e,{size:i,helpUrl:o})}),C.jsxs(ot,{sx:s1e.doneCancel,children:[C.jsx(Gt,{onClick:t,color:"primary",disabled:n,size:i,children:C.jsx(zdn,{fontSize:"inherit"})}),C.jsx(Gt,{onClick:e,color:"primary",disabled:r,size:i,children:C.jsx(Ndn,{fontSize:"inherit"})})]})]})}const e7={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},Bdn=[["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 Udn({colorMapType:t,setColorMapType:e}){return C.jsx(_4,{row:!0,value:t,onChange:(n,r)=>{e(r)},sx:e7.radioGroup,children:Bdn.map(([n,r,i])=>C.jsx(Mt,{arrow:!0,title:pe.get(i),children:C.jsx(sg,{value:n,control:C.jsx(F_,{size:"small",sx:e7.radio}),label:C.jsx(ot,{component:"span",sx:e7.label,children:pe.get(r)})})},n))})}function Wdn({userColorBar:t,updateUserColorBar:e,selected:n,onSelect:r,onDone:i,onCancel:o}){const s=l=>{e({...t,code:l.currentTarget.value})},a=l=>{e({...t,type:l})};return C.jsxs(ot,{children:[C.jsx(jle,{imageData:t.imageData,title:t.errorMessage,selected:n,onSelect:r}),C.jsx(Udn,{colorMapType:t.type,setColorMapType:a}),C.jsx(Jr,{label:"Color mapping",placeholder:hRe,multiline:!0,fullWidth:!0,size:"small",minRows:3,sx:{marginTop:1,fontFamily:"monospace"},value:t.code,onChange:s,color:t.errorMessage?"error":"primary",inputProps:{style:{fontFamily:"monospace",fontSize:12}}}),C.jsx(iD,{onDone:i,onCancel:o,doneDisabled:!!t.errorMessage,size:"small",helpUrl:pe.get("docs/color-mappings.en.md")})]})}const Vdn=lt(C.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"),Gdn={container:{display:"flex",alignItems:"center",width:KO,height:t9e,gap:sP,marginTop:sP}};function Hdn({imageData:t,title:e,selected:n,onEdit:r,onRemove:i,onSelect:o,disabled:s}){const[a,l]=D.useState(null),c=p=>{l(p.currentTarget)},u=()=>{l(null)},f=()=>{l(null),r()},d=()=>{l(null),i()},h=!!a;return C.jsxs(C.Fragment,{children:[C.jsxs(ot,{sx:Gdn.container,children:[C.jsx(jle,{imageData:t,selected:n,onSelect:o,width:KO-20,title:e}),C.jsx(Gt,{size:"small",onClick:c,children:C.jsx(Vdn,{fontSize:"inherit"})})]}),C.jsx(e1,{anchorOrigin:{vertical:"center",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},open:h,anchorEl:a,onClose:u,children:C.jsxs(ot,{children:[C.jsx(Gt,{onClick:f,size:"small",disabled:s,children:C.jsx(XO,{fontSize:"inherit"})}),C.jsx(Gt,{onClick:d,size:"small",disabled:s,children:C.jsx(xU,{fontSize:"inherit"})})]})})]})}const qdn={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function Xdn({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,userColorBars:r,addUserColorBar:i,removeUserColorBar:o,updateUserColorBar:s,updateUserColorBars:a,storeSettings:l}){const[c,u]=D.useState({}),[f,d]=r9e(),h=D.useMemo(()=>r.findIndex(x=>x.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>a(r));const x=Uf("ucb");i(x),u({action:"add",colorBarId:x})},g=x=>{d(()=>a(r)),u({action:"edit",colorBarId:x})},m=x=>{d(void 0),o(x)},v=()=>{d(void 0),u({}),l()},y=()=>{f(),u({})};return C.jsxs(C.Fragment,{children:[C.jsxs(ot,{sx:qdn.container,children:[C.jsx(n9e,{title:pe.get(t.title),description:pe.get(t.description)}),C.jsx(Gt,{onClick:p,size:"small",color:"primary",disabled:!!c.action,children:C.jsx(kU,{fontSize:"inherit"})})]}),r.map(x=>x.id===c.colorBarId&&h>=0?C.jsx(Wdn,{userColorBar:x,updateUserColorBar:s,selected:x.id===e,onSelect:()=>n(x.id),onDone:v,onCancel:y},x.id):C.jsx(Hdn,{imageData:x.imageData,title:x.errorMessage,disabled:!!c.action,selected:x.id===e,onSelect:()=>n(x.id),onEdit:()=>g(x.id),onRemove:()=>m(x.id)},x.id))]})}function Ydn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o,colorBars:s,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d}){const h=p=>{t=uN({...r,baseName:p}),o(t,e,n,i)};return C.jsx(C.Fragment,{children:s.groups.map(p=>p.title===dRe?C.jsx(Xdn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):C.jsx(Fdn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:s.images},p.title))})}const Qdn={colorBarBox:t=>({marginTop:t.spacing(_L-2*sP),marginLeft:t.spacing(_L),marginRight:t.spacing(_L),marginBottom:t.spacing(_L)})};function Kdn(t){const{colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s,...a}=t;return C.jsxs(ot,{sx:Qdn.colorBarBox,children:[C.jsx(Ldn,{...a}),C.jsx(Ydn,{...a,colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s})]})}const a1e={container:t=>({position:"absolute",zIndex:1e3,top:10,borderRadius:"5px",borderWidth:"1px",borderStyle:"solid",borderColor:"#00000020",backgroundColor:"#FFFFFFAA",color:"black",maxWidth:`${KO+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 o9e(t){const{variableName:e,variableTitle:n,variableUnits:r,variableColorBar:i,style:o}=t,s=D.useRef(null),[a,l]=D.useState(null),c=()=>{l(s.current)},u=()=>{l(null)};if(!e)return null;const f=i.type==="categorical"?n||e:`${n||e} (${r||"-"})`;return C.jsxs(ot,{sx:a1e.container,style:o,ref:s,children:[C.jsx(Jt,{sx:a1e.title,children:f}),i.type==="categorical"?C.jsx(xdn,{categories:i.colorRecords,onOpenColorBarEditor:c,...t}):C.jsx(Rdn,{onOpenColorBarEditor:c,...t}),C.jsx(e1,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:C.jsx(Kdn,{...t})})]})}const Zdn=t=>({variableName:a1(t),variableTitle:X_t(t),variableUnits:Q_t(t),variableColorBarName:U4(t),variableColorBarMinMax:UDe(t),variableColorBarNorm:GDe(t),variableColorBar:une(t),variableOpacity:KDe(t),userColorBars:l1(t),colorBars:V4(t),style:{right:10}}),Jdn={updateVariableColorBar:WKt,addUserColorBar:V8e,removeUserColorBar:q8e,updateUserColorBar:X8e,updateUserColorBars:K8e,storeSettings:W8e},ehn=Rn(Zdn,Jdn)(o9e),thn=t=>{const e=t.controlState.variableSplitPos;return{variableName:e?sne(t):null,variableTitle:Y_t(t),variableUnits:K_t(t),variableColorBarName:W4(t),variableColorBarMinMax:WDe(t),variableColorBarNorm:HDe(t),variableColorBar:XDe(t),variableOpacity:ZDe(t),userColorBars:l1(t),colorBars:V4(t),style:{left:e?e-280:0}}},nhn={updateVariableColorBar:VKt,addUserColorBar:V8e,removeUserColorBar:q8e,updateUserColorBar:X8e,updateUserColorBars:K8e,storeSettings:W8e},rhn=Rn(thn,nhn)(o9e),ihn={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 ohn({hidden:t,position:e,onPositionChange:n}){const r=D.useRef(null),i=D.useRef(([s,a])=>{r.current!==null&&n(r.current.offsetLeft+s)}),o=JVe(i.current);return D.useEffect(()=>{!t&&!yr(e)&&r.current!==null&&r.current.parentElement!==null&&n(Math.round(r.current.parentElement.clientWidth/2))},[t,e,n]),t?null:C.jsx(ot,{id:"MapSplitter",ref:r,sx:ihn.splitter,style:{left:yr(e)?e:"50%"},onMouseDown:o})}const shn=t=>({hidden:!t.controlState.variableCompareMode,position:t.controlState.variableSplitPos}),ahn={onPositionChange:aZt},lhn=Rn(shn,ahn)(ohn);function chn(t,e,n,r,i,o,s){const a=D.useRef(0),[l,c]=D.useState(),[u,f]=D.useState(),[d,h]=D.useState(),p=D.useCallback(async(v,y,x,b,w)=>{w({dataset:v,variable:y,result:{fetching:!0}});try{const _=await lvt(e,v,y,x,b,s,null);console.info(y.name,"=",_),w({dataset:v,variable:y,result:{value:_.value}})}catch(_){w({dataset:v,variable:y,result:{error:_}})}},[e,s]),g=D.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],w=T4(v.coordinate,y.getView().getProjection().getCode(),"EPSG:4326"),_=w[0],S=w[1];c({pixelX:x,pixelY:b,lon:_,lat:S});const O=new Date().getTime();O-a.current>=500&&(a.current=O,p(n,r,_,S,f).finally(()=>{i&&o&&p(i,o,_,S,h)}))},[p,t,n,r,i,o]),m=Hs.map;return D.useEffect(()=>{if(t&&m){const v=y=>{y.dragging?c(void 0):g(y)};return m.on("pointermove",v),()=>{m.un("pointermove",v)}}else c(void 0)},[t,m,g]),D.useMemo(()=>l&&u?{location:l,payload:u,payload2:d}:null,[l,u,d])}const gp={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function uhn({location:t,payload:e,payload2:n}){return C.jsxs(ot,{sx:gp.container,children:[C.jsx(ot,{sx:gp.labelItem,children:"Longitude"}),C.jsx(ot,{sx:gp.valueItem,children:by(t.lon,4)}),C.jsx(ot,{sx:gp.labelItem,children:"Latitude"}),C.jsx(ot,{sx:gp.valueItem,children:by(t.lat,4)}),C.jsx(ot,{sx:gp.labelItem,children:l1e(e)}),C.jsx(ot,{sx:gp.valueItem,children:c1e(e)}),n&&C.jsx(ot,{sx:gp.labelItem,children:l1e(n)}),n&&C.jsx(ot,{sx:gp.valueItem,children:c1e(n)})]})}function l1e(t){const e=t.variable;return e.title||e.name}function c1e(t){const e=t.result;return e.error?`${e.error}`:e.fetching?"...":yr(e.value)?by(e.value,4):"---"}const fhn={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function dhn({enabled:t,serverUrl:e,dataset1:n,variable1:r,dataset2:i,variable2:o,time:s}){const a=chn(t,e,n,r,i,o,s);if(!a)return null;const{pixelX:l,pixelY:c}=a.location;return C.jsx(ot,{sx:{...fhn.container,left:l,top:c},children:C.jsx(uhn,{...a})})}const hhn=t=>({enabled:t.controlState.mapPointInfoBoxEnabled,serverUrl:zi(t).url,dataset1:fo(t),variable1:za(t),dataset2:Wy(t),variable2:qg(t),time:c1(t)}),phn={},ghn=Rn(hhn,phn)(dhn),mhn=lt(C.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"),s9e=lt(C.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"),vhn=lt(C.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"),u1e={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function yhn({style:t,sx:e,children:n}){return C.jsx(ot,{className:"ol-unselectable ol-control",sx:e,style:t?{...u1e,...t}:u1e,children:n})}const a9e={width:"1.375em",height:"1.375em"},xhn={...a9e,backgroundColor:"rgba(0,80,180,0.9)"},bhn={tooltip:{sx:{backgroundColor:"#4A4A4A",border:"1px solid white",borderRadius:0}}};function t7({icon:t,tooltipTitle:e,onClick:n,selected:r,onSelect:i}){const o=s=>{i&&i(s,!r),n&&n(s)};return e&&(t=C.jsx(Mt,{title:e,componentsProps:bhn,children:t})),C.jsx(Gt,{onClick:o,style:r?xhn:a9e,children:t})}const whn={left:"0.5em",top:65};function _hn({layerMenuOpen:t,setLayerMenuOpen:e,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o}){return C.jsxs(yhn,{style:whn,children:[C.jsx(t7,{icon:C.jsx(s9e,{fontSize:"small"}),tooltipTitle:pe.get("Show or hide layers panel"),selected:t,onSelect:(s,a)=>void e(a)}),C.jsx(t7,{icon:C.jsx(mhn,{fontSize:"small"}),tooltipTitle:pe.get("Turn layer split mode on or off"),selected:n,onSelect:(s,a)=>void r(a)}),C.jsx(t7,{icon:C.jsx(vhn,{fontSize:"small"}),tooltipTitle:pe.get("Turn info box on or off"),selected:i,onSelect:(s,a)=>void o(a)})]})}const Shn=t=>({layerMenuOpen:t.controlState.layerMenuOpen,variableCompareMode:t.controlState.variableCompareMode,mapPointInfoBoxEnabled:t.controlState.mapPointInfoBoxEnabled}),Chn={setLayerMenuOpen:k8e,setVariableCompareMode:sZt,setMapPointInfoBoxEnabled:oZt},Ohn=Rn(Shn,Chn)(_hn),Ehn=(t,e)=>({mapId:"map",locale:t.controlState.locale,variableLayer:_St(t),variable2Layer:SSt(t),rgbLayer:CSt(t),rgb2Layer:OSt(t),datasetBoundaryLayer:wSt(t),placeGroupLayers:ASt(t),colorBarLegend:C.jsx(ehn,{}),colorBarLegend2:C.jsx(rhn,{}),mapSplitter:C.jsx(lhn,{}),mapPointInfoBox:C.jsx(ghn,{}),mapControlActions:C.jsx(Ohn,{}),userDrawnPlaceGroupName:t.controlState.userDrawnPlaceGroupName,userPlaceGroups:XM(t),userPlaceGroupsVisibility:rSt(t),showUserPlaces:LDe(t),mapInteraction:t.controlState.mapInteraction,mapProjection:Uy(t),selectedPlaceId:t.controlState.selectedPlaceId,places:KM(t),baseMapLayer:DSt(t),overlayLayer:ISt(t),imageSmoothing:QM(t),variableSplitPos:t.controlState.variableSplitPos,onMapRef:e.onMapRef}),Thn={addDrawnUserPlace:wKt,importUserPlacesFromText:VUe,selectPlace:oU},f1e=Rn(Ehn,Thn)(mdn),l9e=lt(C.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"),khn=lt(C.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"),Ahn=lt(C.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.95s.33.5.56.69c.24.18.51.32.82.41q.45.15.96.15c.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72.2-.61.2-.97c0-.19-.02-.38-.07-.56s-.12-.35-.23-.51c-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33s.27-.27.37-.42.17-.3.22-.46.07-.32.07-.48q0-.54-.18-.96t-.51-.69c-.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.3q0-.255.09-.45c.09-.195.14-.25.25-.34s.23-.17.38-.22.3-.08.48-.08c.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49s-.14.27-.25.37-.25.18-.41.24-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4s.1.35.1.57c0 .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-.27s.84-.43 1.16-.76.57-.73.74-1.19c.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57q-.27-.705-.75-1.2m-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85s-.43.41-.71.53q-.435.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"),Phn=({contribution:t,panelIndex:e})=>{const n=t.componentResult;return n.status==="pending"?C.jsx(Ly,{},t.name):n.error?C.jsx("div",{children:C.jsx(Jt,{color:"error",children:n.error.message})},t.name):t.component?C.jsx(IIe,{...t.component,onChange:r=>{uCt("panels",e,r)}},t.name):null},Mhn=lt(C.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"),Rhn=lt(C.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"),Dhn=lt(C.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"),Ihn=lt(C.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),Lhn=lt(C.jsx("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");let ar=class c9e{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]=bC(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),Xd.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]=bC(this,e,n);let r=[];return this.decompose(e,n,r,0),Xd.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 Ck(this),o=new Ck(e);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new Ck(this,e)}iterRange(e,n=this.length){return new u9e(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 f9e(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]?c9e.empty:e.length<=32?new Wi(e):Xd.from(Wi.split(e,[]))}};class Wi extends ar{constructor(e,n=$hn(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 s=this.text[o],a=i+s.length;if((n?r:a)>=e)return new Fhn(i,a,r,s);i=a+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Wi(d1e(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),a=z3(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new Wi(a,s.length+o.length));else{let l=a.length>>1;r.push(new Wi(a.slice(0,l)),new Wi(a.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Wi))return super.replace(e,n,r);[e,n]=bC(this,e,n);let i=z3(this.text,z3(r.text,d1e(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Wi(i,o):Xd.from(Wi.split(i,[]),o)}sliceString(e,n=this.length,r=` +`));const e=D.useMemo(()=>ve({},hsn,t.localeText),[t.localeText]);return D.useMemo(()=>ve({},t,{localeText:e}),[t,e])},gr=()=>A1().utils,nD=()=>A1().defaultDates,P1=t=>{const e=gr(),n=D.useRef();return n.current===void 0&&(n.current=e.date(void 0,t)),n.current};function xVe(t){const{props:e,validator:n,value:r,timezone:i,onError:o}=t,s=A1(),a=D.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:i,props:e}),c=n.valueManager.hasError(l);D.useEffect(()=>{o&&!n.valueManager.isSameError(l,a.current)&&o(l,r),a.current=l},[n,o,l,r]);const u=st(f=>n({adapter:s,value:f,timezone:i,props:e}));return{validationError:l,hasValidationError:c,getValidationErrorForNewValue:u}}const Ml=()=>A1().localeText,psn=({utils:t,format:e})=>{let n=10,r=e,i=t.expandFormat(e);for(;i!==r;)if(r=i,i=t.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return i},gsn=({utils:t,expandedFormat:e})=>{const n=[],{start:r,end:i}=t.escapedCharacters,o=new RegExp(`(\\${r}[^\\${i}]*\\${i})+`,"g");let s=null;for(;s=o.exec(e);)n.push({start:s.index,end:o.lastIndex-1});return n},msn=(t,e,n,r)=>{switch(n.type){case"year":return e.fieldYearPlaceholder({digitAmount:t.formatByString(t.date(void 0,"default"),r).length,format:r});case"month":return e.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return e.fieldDayPlaceholder({format:r});case"weekDay":return e.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return e.fieldHoursPlaceholder({format:r});case"minutes":return e.fieldMinutesPlaceholder({format:r});case"seconds":return e.fieldSecondsPlaceholder({format:r});case"meridiem":return e.fieldMeridiemPlaceholder({format:r});default:return r}},vsn=({utils:t,date:e,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:i,now:o,token:s,startSeparator:a})=>{if(s==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=sVe(t,s),c=fVe(t,l.contentType,l.type,s),u=n?c:l.contentType==="digit",f=e!=null&&t.isValid(e);let d=f?t.formatByString(e,s):"",h=null;if(u)if(c)h=d===""?t.formatByString(o,s).length:d.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);h=l.maxLength,f&&(d=Rle(lVe(Ib(d,i),h),i))}return ve({},l,{format:s,maxLength:h,value:d,placeholder:msn(t,r,l,s),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:a,endSeparator:"",modified:!1})},ysn=t=>{var h;const{utils:e,expandedFormat:n,escapedParts:r}=t,i=e.date(void 0),o=[];let s="";const a=Object.keys(e.formatTokenMap).sort((p,g)=>g.length-p.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${a.join("|")})*$`),u=new RegExp(`^(${a.join("|")})`),f=p=>r.find(g=>g.start<=p&&g.end>=p);let d=0;for(;d0;){const y=u.exec(v)[1];v=v.slice(y.length),o.push(vsn(ve({},t,{now:i,token:y,startSeparator:s}))),s=""}d+=m.length}else{const v=n[d];g&&(p==null?void 0:p.start)===d||(p==null?void 0:p.end)===d||(o.length===0?s+=v:o[o.length-1].endSeparator+=v),d+=1}}return o.length===0&&s.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),o},xsn=({isRtl:t,formatDensity:e,sections:n})=>n.map(r=>{const i=o=>{let s=o;return t&&s!==null&&s.includes(" ")&&(s=`⁩${s}⁦`),e==="spacious"&&["/",".","-"].includes(s)&&(s=` ${s} `),s};return r.startSeparator=i(r.startSeparator),r.endSeparator=i(r.endSeparator),r}),Nbe=t=>{let e=psn(t);t.isRtl&&t.enableAccessibleFieldDOMStructure&&(e=e.split(" ").reverse().join(" "));const n=gsn(ve({},t,{expandedFormat:e})),r=ysn(ve({},t,{expandedFormat:e,escapedParts:n}));return xsn(ve({},t,{sections:r}))},Lle=({timezone:t,value:e,defaultValue:n,onChange:r,valueManager:i})=>{const o=gr(),s=D.useRef(n),a=e??s.current??i.emptyValue,l=D.useMemo(()=>i.getTimezone(o,a),[o,i,a]),c=st(h=>l==null?h:i.setTimezone(o,l,h)),u=t??l??"default",f=D.useMemo(()=>i.setTimezone(o,u,a),[i,o,u,a]),d=st((h,...p)=>{const g=c(h);r==null||r(g,...p)});return{value:f,handleValueChange:d,timezone:u}},YO=({name:t,timezone:e,value:n,defaultValue:r,onChange:i,valueManager:o})=>{const[s,a]=bc({name:t,state:"value",controlled:n,default:r??o.emptyValue}),l=st((c,...u)=>{a(c),i==null||i(c,...u)});return Lle({timezone:e,value:s,defaultValue:void 0,onChange:l,valueManager:o})},bsn=t=>{const e=gr(),n=Ml(),r=A1(),i=Eo(),{valueManager:o,fieldValueManager:s,valueType:a,validator:l,internalProps:c,internalProps:{value:u,defaultValue:f,referenceDate:d,onChange:h,format:p,formatDensity:g="dense",selectedSections:m,onSelectedSectionsChange:v,shouldRespectLeadingZeros:y=!1,timezone:x,enableAccessibleFieldDOMStructure:b=!1}}=t,{timezone:w,value:_,handleValueChange:S}=Lle({timezone:x,value:u,defaultValue:f,onChange:h,valueManager:o}),O=D.useMemo(()=>Zon(e),[e]),k=D.useMemo(()=>rsn(e,O,w),[e,O,w]),E=D.useCallback((V,Y=null)=>s.getSectionsFromValue(e,V,Y,le=>Nbe({utils:e,localeText:n,localizedDigits:O,format:p,date:le,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i})),[s,p,n,O,i,y,e,g,b]),[P,A]=D.useState(()=>{const V=E(_),Y={sections:V,value:_,referenceValue:o.emptyValue,tempValueStrAndroid:null},le=Xon(V),K=o.getInitialReferenceValue({referenceDate:d,value:_,utils:e,props:c,granularity:le,timezone:w});return ve({},Y,{referenceValue:K})}),[R,T]=bc({controlled:m,default:null,name:"useField",state:"selectedSections"}),M=V=>{T(V),v==null||v(V)},I=D.useMemo(()=>WQ(R,P.sections),[R,P.sections]),z=I==="all"?0:I,F=({value:V,referenceValue:Y,sections:le})=>{if(A(ee=>ve({},ee,{sections:le,value:V,referenceValue:Y,tempValueStrAndroid:null})),o.areValuesEqual(e,P.value,V))return;const K={validationError:l({adapter:r,value:V,timezone:w,props:c})};S(V,K)},N=(V,Y)=>{const le=[...P.sections];return le[V]=ve({},le[V],{value:Y,modified:!0}),le},L=()=>{F({value:o.emptyValue,referenceValue:P.referenceValue,sections:E(o.emptyValue)})},B=()=>{if(z==null)return;const V=P.sections[z],Y=s.getActiveDateManager(e,P,V),K=Y.getSections(P.sections).filter(te=>te.value!=="").length===(V.value===""?0:1),ee=N(z,""),re=K?null:e.getInvalidDate(),me=Y.getNewValuesFromNewActiveDate(re);F(ve({},me,{sections:ee}))},$=V=>{const Y=(ee,re)=>{const me=e.parse(ee,p);if(me==null||!e.isValid(me))return null;const te=Nbe({utils:e,localeText:n,localizedDigits:O,format:p,date:me,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i});return Fbe(e,me,te,re,!1)},le=s.parseValueStr(V,P.referenceValue,Y),K=s.updateReferenceValue(e,le,P.referenceValue);F({value:le,referenceValue:K,sections:E(le,P.sections)})},j=({activeSection:V,newSectionValue:Y,shouldGoToNextSection:le})=>{le&&zve({},U,te,{sections:ee,tempValueStrAndroid:null}))},X=V=>A(Y=>ve({},Y,{tempValueStrAndroid:V}));return D.useEffect(()=>{const V=E(P.value);A(Y=>ve({},Y,{sections:V}))},[p,e.locale,i]),D.useEffect(()=>{let V;o.areValuesEqual(e,P.value,_)?V=o.getTimezone(e,P.value)!==o.getTimezone(e,_):V=!0,V&&A(Y=>ve({},Y,{value:_,referenceValue:s.updateReferenceValue(e,_,Y.referenceValue),sections:E(_)}))},[_]),{state:P,activeSectionIndex:z,parsedSelectedSections:I,setSelectedSections:M,clearValue:L,clearActiveSection:B,updateSectionValue:j,updateValueFromValueStr:$,setTempAndroidValueStr:X,getSectionsFromValue:E,sectionsValueBoundaries:k,localizedDigits:O,timezone:w}},wsn=5e3,fw=t=>t.saveQuery!=null,_sn=({sections:t,updateSectionValue:e,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:i,timezone:o})=>{const s=gr(),[a,l]=D.useState(null),c=st(()=>l(null));D.useEffect(()=>{var p;a!=null&&((p=t[a.sectionIndex])==null?void 0:p.type)!==a.sectionType&&c()},[t,a,c]),D.useEffect(()=>{if(a!=null){const p=setTimeout(()=>c(),wsn);return()=>{clearTimeout(p)}}return()=>{}},[a,c]);const u=({keyPressed:p,sectionIndex:g},m,v)=>{const y=p.toLowerCase(),x=t[g];if(a!=null&&(!v||v(a.value))&&a.sectionIndex===g){const w=`${a.value}${y}`,_=m(w,x);if(!fw(_))return l({sectionIndex:g,value:w,sectionType:x.type}),_}const b=m(y,x);return fw(b)&&!b.saveQuery?(c(),null):(l({sectionIndex:g,value:y,sectionType:x.type}),fw(b)?null:b)},f=p=>{const g=(y,x,b)=>{const w=x.filter(_=>_.toLowerCase().startsWith(b));return w.length===0?{saveQuery:!1}:{sectionValue:w[0],shouldGoToNextSection:w.length===1}},m=(y,x,b,w)=>{const _=S=>aVe(s,o,x.type,S);if(x.contentType==="letter")return g(x.format,_(x.format),y);if(b&&w!=null&&sVe(s,b).contentType==="letter"){const S=_(b),O=g(b,S,y);return fw(O)?{saveQuery:!1}:ve({},O,{sectionValue:w(O.sectionValue,S)})}return{saveQuery:!1}};return u(p,(y,x)=>{switch(x.type){case"month":{const b=w=>Lbe(s,w,s.formats.month,x.format);return m(y,x,s.formats.month,b)}case"weekDay":{const b=(w,_)=>_.indexOf(w).toString();return m(y,x,s.formats.weekday,b)}case"meridiem":return m(y,x);default:return{saveQuery:!1}}})},d=p=>{const g=(v,y)=>{const x=Ib(v,r),b=Number(x),w=n[y.type]({currentDate:null,format:y.format,contentType:y.contentType});if(b>w.maximum)return{saveQuery:!1};if(bw.maximum||x.length===w.maximum.toString().length;return{sectionValue:cVe(s,b,w,r,y),shouldGoToNextSection:_}};return u(p,(v,y)=>{if(y.contentType==="digit"||y.contentType==="digit-with-letter")return g(v,y);if(y.type==="month"){const x=fVe(s,"digit","month","MM"),b=g(v,{type:y.type,format:"MM",hasLeadingZerosInFormat:x,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(fw(b))return b;const w=Lbe(s,b.sectionValue,"MM",y.format);return ve({},b,{sectionValue:w})}if(y.type==="weekDay"){const x=g(v,y);if(fw(x))return x;const b=wU(s,y.format)[Number(x.sectionValue)-1];return ve({},x,{sectionValue:b})}return{saveQuery:!1}},v=>Ibe(v,r))};return{applyCharacterEditing:st(p=>{const g=t[p.sectionIndex],v=Ibe(p.keyPressed,r)?d(ve({},p,{keyPressed:Rle(p.keyPressed,r)})):f(p);if(v==null){i(null);return}e({activeSection:g,newSectionValue:v.sectionValue,shouldGoToNextSection:v.shouldGoToNextSection})}),resetCharacterQuery:c}};function Ssn(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const Csn=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(n),n.preventDefault(),n.stopPropagation())},Ka=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?Ka(e.shadowRoot):e:null},J5=t=>Array.from(t.children).indexOf(Ka(document)),Osn="@media (pointer: fine)",Esn=t=>{const{internalProps:{disabled:e,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:i,onClick:o,onFocus:s,onInput:a,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:f,applyCharacterEditing:d,resetCharacterQuery:h,setSelectedSections:p,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:x,updateValueFromValueStr:b,sectionOrder:w,areAllSectionsEmpty:_,sectionsValueBoundaries:S}=t,O=D.useRef(null),k=dn(r,O),E=Ml(),P=gr(),A=Jf(),[R,T]=D.useState(!1),M=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!O.current)return;const ae=document.getSelection();if(!ae)return;if(g==null){ae.rangeCount>0&&O.current.getRoot().contains(ae.getRangeAt(0).startContainer)&&ae.removeAllRanges(),R&&O.current.getRoot().blur();return}if(!O.current.getRoot().contains(Ka(document)))return;const U=new window.Range;let oe;g==="all"?oe=O.current.getRoot():m.sections[g].type==="empty"?oe=O.current.getSectionContainer(g):oe=O.current.getSectionContent(g),U.selectNodeContents(oe),oe.focus(),ae.removeAllRanges(),ae.addRange(U)},getActiveSectionIndexFromDOM:()=>{const ae=Ka(document);return!ae||!O.current||!O.current.getRoot().contains(ae)?null:O.current.getSectionIndexFromDOMElement(ae)},focusField:(ae=0)=>{if(!O.current)return;const U=WQ(ae,m.sections);T(!0),O.current.getSectionContent(U).focus()},setSelectedSections:ae=>{if(!O.current)return;const U=WQ(ae,m.sections);T((U==="all"?0:U)!==null),p(ae)},isFieldFocused:()=>{const ae=Ka(document);return!!O.current&&O.current.getRoot().contains(ae)}}),[g,p,m.sections,R]),I=st(ae=>{if(!O.current)return;const U=m.sections[ae];O.current.getSectionContent(ae).innerHTML=U.value||U.placeholder,M.syncSelectionToDOM()}),z=st((ae,...U)=>{ae.isDefaultPrevented()||!O.current||(T(!0),o==null||o(ae,...U),g==="all"?setTimeout(()=>{const oe=document.getSelection().getRangeAt(0).startOffset;if(oe===0){p(w.startIndex);return}let ne=0,G=0;for(;G{if(a==null||a(ae),!O.current||g!=="all")return;const oe=ae.target.textContent??"";O.current.getRoot().innerHTML=m.sections.map(ne=>`${ne.startSeparator}${ne.value||ne.placeholder}${ne.endSeparator}`).join(""),M.syncSelectionToDOM(),oe.length===0||oe.charCodeAt(0)===10?(h(),y(),p("all")):oe.length>1?b(oe):d({keyPressed:oe,sectionIndex:0})}),N=st(ae=>{if(l==null||l(ae),n||g!=="all"){ae.preventDefault();return}const U=ae.clipboardData.getData("text");ae.preventDefault(),h(),b(U)}),L=st((...ae)=>{if(s==null||s(...ae),R||!O.current)return;T(!0),O.current.getSectionIndexFromDOMElement(Ka(document))!=null||p(w.startIndex)}),B=st((...ae)=>{i==null||i(...ae),setTimeout(()=>{if(!O.current)return;const U=Ka(document);!O.current.getRoot().contains(U)&&(T(!1),p(null))})}),$=st(ae=>U=>{U.isDefaultPrevented()||p(ae)}),j=st(ae=>{ae.preventDefault()}),X=st(ae=>()=>{p(ae)}),V=st(ae=>{if(ae.preventDefault(),n||e||typeof g!="number")return;const U=m.sections[g],oe=ae.clipboardData.getData("text"),ne=/^[a-zA-Z]+$/.test(oe),G=/^[0-9]+$/.test(oe),q=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(oe);U.contentType==="letter"&&ne||U.contentType==="digit"&&G||U.contentType==="digit-with-letter"&&q?(h(),x({activeSection:U,newSectionValue:oe,shouldGoToNextSection:!0})):!ne&&!G&&(h(),b(oe))}),Y=st(ae=>{ae.preventDefault(),ae.dataTransfer.dropEffect="none"}),le=st(ae=>{if(!O.current)return;const U=ae.target,oe=U.textContent??"",ne=O.current.getSectionIndexFromDOMElement(U),G=m.sections[ne];if(n||!O.current){I(ne);return}if(oe.length===0){if(G.value===""){I(ne);return}const q=ae.nativeEvent.inputType;if(q==="insertParagraph"||q==="insertLineBreak"){I(ne);return}h(),v();return}d({keyPressed:oe,sectionIndex:ne}),I(ne)});Ei(()=>{if(!(!R||!O.current)){if(g==="all")O.current.getRoot().focus();else if(typeof g=="number"){const ae=O.current.getSectionContent(g);ae&&ae.focus()}}},[g,R]);const K=D.useMemo(()=>m.sections.reduce((ae,U)=>(ae[U.type]=S[U.type]({currentDate:null,contentType:U.contentType,format:U.format}),ae),{}),[S,m.sections]),ee=g==="all",re=D.useMemo(()=>m.sections.map((ae,U)=>{const oe=!ee&&!e&&!n;return{container:{"data-sectionindex":U,onClick:$(U)},content:{tabIndex:ee||U>0?-1:0,contentEditable:!ee&&!e&&!n,role:"spinbutton",id:`${A}-${ae.type}`,"aria-labelledby":`${A}-${ae.type}`,"aria-readonly":n,"aria-valuenow":lsn(ae,P),"aria-valuemin":K[ae.type].minimum,"aria-valuemax":K[ae.type].maximum,"aria-valuetext":ae.value?asn(ae,P):E.empty,"aria-label":E[ae.type],"aria-disabled":e,spellCheck:oe?!1:void 0,autoCapitalize:oe?"off":void 0,autoCorrect:oe?"off":void 0,[parseInt(D.version,10)>=17?"enterKeyHint":"enterkeyhint"]:oe?"next":void 0,children:ae.value||ae.placeholder,onInput:le,onPaste:V,onFocus:X(U),onDragOver:Y,onMouseUp:j,inputMode:ae.contentType==="letter"?"text":"numeric"},before:{children:ae.startSeparator},after:{children:ae.endSeparator}}}),[m.sections,X,V,Y,le,$,j,e,n,ee,E,P,K,A]),me=st(ae=>{b(ae.target.value)}),te=D.useMemo(()=>_?"":f.getV7HiddenInputValueFromSections(m.sections),[_,m.sections,f]);return D.useEffect(()=>{if(O.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `` element instead of a `PickersSectionList`.","","If you want to keep using an `` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(` +`));u&&O.current&&O.current.getSectionContent(w.startIndex).focus()},[]),{interactions:M,returnedValue:{autoFocus:u,readOnly:n,focused:c??R,sectionListRef:k,onBlur:B,onClick:z,onFocus:L,onInput:F,onPaste:N,enableAccessibleFieldDOMStructure:!0,elements:re,tabIndex:g===0?-1:0,contentEditable:ee,value:te,onChange:me,areAllSectionsEmpty:_}}},x_=t=>t.replace(/[\u2066\u2067\u2068\u2069]/g,""),Tsn=(t,e,n)=>{let r=0,i=n?1:0;const o=[];for(let s=0;s{const e=Eo(),n=D.useRef(),r=D.useRef(),{forwardedProps:{onFocus:i,onClick:o,onPaste:s,onBlur:a,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:f=!1},parsedSelectedSections:d,activeSectionIndex:h,state:p,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:x,updateValueFromValueStr:b,clearActiveSection:w,clearValue:_,setTempAndroidValueStr:S,setSelectedSections:O,getSectionsFromValue:k,areAllSectionsEmpty:E,localizedDigits:P}=t,A=D.useRef(null),R=dn(l,A),T=D.useMemo(()=>Tsn(p.sections,P,e),[p.sections,P,e]),M=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!A.current)return;if(d==null){A.current.scrollLeft&&(A.current.scrollLeft=0);return}if(A.current!==Ka(document))return;const le=A.current.scrollTop;if(d==="all")A.current.select();else{const K=T[d],ee=K.type==="empty"?K.startInInput-K.startSeparator.length:K.startInInput,re=K.type==="empty"?K.endInInput+K.endSeparator.length:K.endInInput;(ee!==A.current.selectionStart||re!==A.current.selectionEnd)&&A.current===Ka(document)&&A.current.setSelectionRange(ee,re),clearTimeout(r.current),r.current=setTimeout(()=>{A.current&&A.current===Ka(document)&&A.current.selectionStart===A.current.selectionEnd&&(A.current.selectionStart!==ee||A.current.selectionEnd!==re)&&M.syncSelectionToDOM()})}A.current.scrollTop=le},getActiveSectionIndexFromDOM:()=>{const le=A.current.selectionStart??0,K=A.current.selectionEnd??0;if(le===0&&K===0)return null;const ee=le<=T[0].startInInput?1:T.findIndex(re=>re.startInInput-re.startSeparator.length>le);return ee===-1?T.length-1:ee-1},focusField:(le=0)=>{var K;(K=A.current)==null||K.focus(),O(le)},setSelectedSections:le=>O(le),isFieldFocused:()=>A.current===Ka(document)}),[A,d,T,O]),I=()=>{const le=A.current.selectionStart??0;let K;le<=T[0].startInInput||le>=T[T.length-1].endInInput?K=1:K=T.findIndex(re=>re.startInInput-re.startSeparator.length>le);const ee=K===-1?T.length-1:K-1;O(ee)},z=st((...le)=>{i==null||i(...le);const K=A.current;clearTimeout(n.current),n.current=setTimeout(()=>{!K||K!==A.current||h==null&&(K.value.length&&Number(K.selectionEnd)-Number(K.selectionStart)===K.value.length?O("all"):I())})}),F=st((le,...K)=>{le.isDefaultPrevented()||(o==null||o(le,...K),I())}),N=st(le=>{if(s==null||s(le),le.preventDefault(),u||f)return;const K=le.clipboardData.getData("text");if(typeof d=="number"){const ee=p.sections[d],re=/^[a-zA-Z]+$/.test(K),me=/^[0-9]+$/.test(K),te=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(K);if(ee.contentType==="letter"&&re||ee.contentType==="digit"&&me||ee.contentType==="digit-with-letter"&&te){y(),x({activeSection:ee,newSectionValue:K,shouldGoToNextSection:!0});return}if(re||me)return}y(),b(K)}),L=st((...le)=>{a==null||a(...le),O(null)}),B=st(le=>{if(u)return;const K=le.target.value;if(K===""){y(),_();return}const ee=le.nativeEvent.data,re=ee&&ee.length>1,me=re?ee:K,te=x_(me);if(h==null||re){b(re?ee:te);return}let ae;if(d==="all"&&te.length===1)ae=te;else{const U=x_(g.getV6InputValueFromSections(T,P,e));let oe=-1,ne=-1;for(let de=0;deG.end)return;const Z=te.length-U.length+G.end-x_(G.endSeparator||"").length;ae=te.slice(G.start+x_(G.startSeparator||"").length,Z)}if(ae.length===0){osn()&&S(me),y(),w();return}v({keyPressed:ae,sectionIndex:h})}),$=D.useMemo(()=>c!==void 0?c:g.getV6InputValueFromSections(k(m.emptyValue),P,e),[c,g,k,m.emptyValue,P,e]),j=D.useMemo(()=>p.tempValueStrAndroid??g.getV6InputValueFromSections(p.sections,P,e),[p.sections,g,p.tempValueStrAndroid,P,e]);D.useEffect(()=>(A.current&&A.current===Ka(document)&&O("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const X=D.useMemo(()=>h==null||p.sections[h].contentType==="letter"?"text":"numeric",[h,p.sections]),Y=!(A.current&&A.current===Ka(document))&&E;return{interactions:M,returnedValue:{readOnly:u,onBlur:L,onClick:F,onFocus:z,onPaste:N,inputRef:R,enableAccessibleFieldDOMStructure:!1,placeholder:$,inputMode:X,autoComplete:"off",value:Y?"":j,onChange:B}}},Asn=t=>{const e=gr(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:i,enableAccessibleFieldDOMStructure:o=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:f},fieldValueManager:d,valueManager:h,validator:p}=t,g=Eo(),m=bsn(t),{state:v,activeSectionIndex:y,parsedSelectedSections:x,setSelectedSections:b,clearValue:w,clearActiveSection:_,updateSectionValue:S,setTempAndroidValueStr:O,sectionsValueBoundaries:k,localizedDigits:E,timezone:P}=m,A=_sn({sections:v.sections,updateSectionValue:S,sectionsValueBoundaries:k,localizedDigits:E,setTempAndroidValueStr:O,timezone:P}),{resetCharacterQuery:R}=A,T=h.areValuesEqual(e,v.value,h.emptyValue),M=o?Esn:ksn,I=D.useMemo(()=>ssn(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:z,interactions:F}=M(ve({},t,m,A,{areAllSectionsEmpty:T,sectionOrder:I})),N=st(V=>{if(l==null||l(V),!s)switch(!0){case((V.ctrlKey||V.metaKey)&&String.fromCharCode(V.keyCode)==="A"&&!V.shiftKey&&!V.altKey):{V.preventDefault(),b("all");break}case V.key==="ArrowRight":{if(V.preventDefault(),x==null)b(I.startIndex);else if(x==="all")b(I.endIndex);else{const Y=I.neighbors[x].rightIndex;Y!==null&&b(Y)}break}case V.key==="ArrowLeft":{if(V.preventDefault(),x==null)b(I.endIndex);else if(x==="all")b(I.startIndex);else{const Y=I.neighbors[x].leftIndex;Y!==null&&b(Y)}break}case V.key==="Delete":{if(V.preventDefault(),a)break;x==null||x==="all"?w():_(),R();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(V.key):{if(V.preventDefault(),a||y==null)break;const Y=v.sections[y],le=d.getActiveDateManager(e,v,Y),K=Jon(e,P,Y,V.key,k,E,le.date,{minutesStep:i});S({activeSection:Y,newSectionValue:K,shouldGoToNextSection:!1});break}}});Ei(()=>{F.syncSelectionToDOM()});const{hasValidationError:L}=xVe({props:n,validator:p,timezone:P,value:v.value,onError:n.onError}),B=D.useMemo(()=>c!==void 0?c:L,[L,c]);D.useEffect(()=>{!B&&y==null&&R()},[v.referenceValue,y,B]),D.useEffect(()=>{v.tempValueStrAndroid!=null&&y!=null&&(R(),_())},[v.sections]),D.useImperativeHandle(r,()=>({getSections:()=>v.sections,getActiveSectionIndex:F.getActiveSectionIndexFromDOM,setSelectedSections:F.setSelectedSections,focusField:F.focusField,isFieldFocused:F.isFieldFocused}));const $=st((V,...Y)=>{V.preventDefault(),f==null||f(V,...Y),w(),F.isFieldFocused()?b(I.startIndex):F.focusField(0)}),j={onKeyDown:N,onClear:$,error:B,clearable:!!(u&&!T&&!a&&!s)},X={disabled:s,readOnly:a};return ve({},t.forwardedProps,j,X,z)},Psn=lt(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Msn=lt(C.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),Rsn=lt(C.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),Dsn=lt(C.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");lt(C.jsxs(D.Fragment,{children:[C.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"}),C.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");const Isn=lt(C.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"),Lsn=lt(C.jsxs(D.Fragment,{children:[C.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"}),C.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),$sn=lt(C.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"}),"Clear"),Fsn=["clearable","onClear","InputProps","sx","slots","slotProps"],Nsn=["ownerState"],zsn=t=>{const e=Ml(),{clearable:n,onClear:r,InputProps:i,sx:o,slots:s,slotProps:a}=t,l=Dt(t,Fsn),c=(s==null?void 0:s.clearButton)??Gt,u=Zt({elementType:c,externalSlotProps:a==null?void 0:a.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:e.fieldClearLabel}}),f=Dt(u,Nsn),d=(s==null?void 0:s.clearIcon)??$sn,h=Zt({elementType:d,externalSlotProps:a==null?void 0:a.clearIcon,ownerState:{}});return ve({},l,{InputProps:ve({},i,{endAdornment:C.jsxs(D.Fragment,{children:[n&&C.jsx(EPe,{position:"end",sx:{marginRight:i!=null&&i.endAdornment?-1:-1.5},children:C.jsx(c,ve({},f,{onClick:r,children:C.jsx(d,ve({fontSize:"small"},h))}))}),i==null?void 0:i.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})},jsn=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],Bsn=(t,e)=>D.useMemo(()=>{const n=ve({},t),r={},i=o=>{n.hasOwnProperty(o)&&(r[o]=n[o],delete n[o])};return jsn.forEach(i),hVe.forEach(i),pVe.forEach(i),gVe.forEach(i),{forwardedProps:n,internalProps:r}},[t,e]),Usn=D.createContext(null);function bVe(t){const{contextValue:e,localeText:n,children:r}=t;return C.jsx(Usn.Provider,{value:e,children:C.jsx(iVe,{localeText:n,children:r})})}const Wsn=t=>{const e=gr(),n=nD(),i=t.ampm??e.is12HourCycleInCurrentLocale()?e.formats.keyboardDateTime12h:e.formats.keyboardDateTime24h;return ve({},t,{disablePast:t.disablePast??!1,disableFuture:t.disableFuture??!1,format:t.format??i,disableIgnoringDatePartForTimeValidation:!!(t.minDateTime||t.maxDateTime),minDate:Ru(e,t.minDateTime??t.minDate,n.minDate),maxDate:Ru(e,t.maxDateTime??t.maxDate,n.maxDate),minTime:t.minDateTime??t.minTime,maxTime:t.maxDateTime??t.maxTime})},Vsn=t=>{const e=Wsn(t),{forwardedProps:n,internalProps:r}=Bsn(e,"date-time");return Asn({forwardedProps:n,internalProps:r,valueManager:ia,fieldValueManager:usn,validator:_U,valueType:"date-time"})};function Gsn(t){return Xe("MuiPickersTextField",t)}He("MuiPickersTextField",["root","focused","disabled","error","required"]);function Hsn(t){return Xe("MuiPickersInputBase",t)}const K_=He("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function qsn(t){return Xe("MuiPickersSectionList",t)}const x2=He("MuiPickersSectionList",["root","section","sectionContent"]),Xsn=["slots","slotProps","elements","sectionListRef"],wVe=be("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(t,e)=>e.root})({direction:"ltr /*! @noflip */",outline:"none"}),_Ve=be("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(t,e)=>e.section})({}),SVe=be("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(t,e)=>e.sectionSeparator})({whiteSpace:"pre"}),CVe=be("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(t,e)=>e.sectionContent})({outline:"none"}),Ysn=t=>{const{classes:e}=t;return qe({root:["root"],section:["section"],sectionContent:["sectionContent"]},qsn,e)};function Qsn(t){const{slots:e,slotProps:n,element:r,classes:i}=t,o=(e==null?void 0:e.section)??_Ve,s=Zt({elementType:o,externalSlotProps:n==null?void 0:n.section,externalForwardedProps:r.container,className:i.section,ownerState:{}}),a=(e==null?void 0:e.sectionContent)??CVe,l=Zt({elementType:a,externalSlotProps:n==null?void 0:n.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:i.sectionContent,ownerState:{}}),c=(e==null?void 0:e.sectionSeparator)??SVe,u=Zt({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Zt({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return C.jsxs(o,ve({},s,{children:[C.jsx(c,ve({},u)),C.jsx(a,ve({},l)),C.jsx(c,ve({},f))]}))}const Ksn=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersSectionList"}),{slots:i,slotProps:o,elements:s,sectionListRef:a}=r,l=Dt(r,Xsn),c=Ysn(r),u=D.useRef(null),f=dn(n,u),d=g=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${g} before the mount of the component.`);return u.current};D.useImperativeHandle(a,()=>({getRoot(){return d("getRoot")},getSectionContainer(g){return d("getSectionContainer").querySelector(`.${x2.section}[data-sectionindex="${g}"]`)},getSectionContent(g){return d("getSectionContent").querySelector(`.${x2.section}[data-sectionindex="${g}"] .${x2.sectionContent}`)},getSectionIndexFromDOMElement(g){const m=d("getSectionIndexFromDOMElement");if(g==null||!m.contains(g))return null;let v=null;return g.classList.contains(x2.section)?v=g:g.classList.contains(x2.sectionContent)&&(v=g.parentElement),v==null?null:Number(v.dataset.sectionindex)}}));const h=(i==null?void 0:i.root)??wVe,p=Zt({elementType:h,externalSlotProps:o==null?void 0:o.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return C.jsx(h,ve({},p,{children:p.contentEditable?s.map(({content:g,before:m,after:v})=>`${m.children}${g.children}${v.children}`).join(""):C.jsx(D.Fragment,{children:s.map((g,m)=>C.jsx(Qsn,{slots:i,slotProps:o,element:g,classes:c},m))})}))}),Zsn=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],Jsn=t=>Math.round(t*1e5)/1e5,SU=be("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>ve({},t.typography.body1,{color:(t.vars||t).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Jsn(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),$le=be(wVe,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})(({theme:t})=>({padding:"4px 0 5px",fontFamily:t.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:n,filled:r,label:i})=>!e&&!n&&!r&&i==null,style:t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:t.palette.mode==="light"?.42:.5}}]})),ean=be(_Ve,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(t,e)=>e.section})(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"flex"})),tan=be(CVe,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(t,e)=>e.content})(({theme:t})=>({fontFamily:t.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),nan=be(SVe,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(t,e)=>e.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),ran=be("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(t,e)=>e.hiddenInput})(ve({},jAe)),ian=t=>{const{focused:e,disabled:n,error:r,classes:i,fullWidth:o,readOnly:s,color:a,size:l,endAdornment:c,startAdornment:u}=t,f={root:["root",e&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",o&&"fullWidth",`color${Me(a)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return qe(f,Hsn,i)},Fle=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:o,value:s,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:f,slots:d,slotProps:h,contentEditable:p,tabIndex:g,onInput:m,onPaste:v,onKeyDown:y,name:x,readOnly:b,inputProps:w,inputRef:_,sectionListRef:S}=r,O=Dt(r,Zsn),k=D.useRef(null),E=dn(n,k),P=dn(w==null?void 0:w.ref,_),A=Eo(),R=Na();if(!R)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const T=L=>{var B;if(R.disabled){L.stopPropagation();return}(B=R.onFocus)==null||B.call(R,L)};D.useEffect(()=>{R&&R.setAdornedStart(!!u)},[R,u]),D.useEffect(()=>{R&&(o?R.onEmpty():R.onFilled())},[R,o]);const M=ve({},r,R,{isRtl:A}),I=ian(M),z=(d==null?void 0:d.root)||SU,F=Zt({elementType:z,externalSlotProps:h==null?void 0:h.root,externalForwardedProps:O,additionalProps:{"aria-invalid":R.error,ref:E},className:I.root,ownerState:M}),N=(d==null?void 0:d.input)||$le;return C.jsxs(z,ve({},F,{children:[u,C.jsx(Ksn,{sectionListRef:S,elements:i,contentEditable:p,tabIndex:g,className:I.sectionsContainer,onFocus:T,onBlur:R.onBlur,onInput:m,onPaste:v,onKeyDown:y,slots:{root:N,section:ean,sectionContent:tan,sectionSeparator:nan},slotProps:{root:{ownerState:M},sectionContent:{className:K_.sectionContent},sectionSeparator:({position:L})=>({className:L==="before"?K_.sectionBefore:K_.sectionAfter})}}),c,f?f(ve({},R)):null,C.jsx(ran,ve({name:x,className:I.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:b,required:R.required,disabled:R.disabled},w,{ref:P}))]}))});function oan(t){return Xe("MuiPickersOutlinedInput",t)}const Yu=ve({},K_,He("MuiPickersOutlinedInput",["root","notchedOutline","input"])),san=["children","className","label","notched","shrink"],aan=be("fieldset",{name:"MuiPickersOutlinedInput",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{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%",borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),zbe=be("span")(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit"})),lan=be("legend")(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}));function can(t){const{className:e,label:n}=t,r=Dt(t,san),i=n!=null&&n!=="",o=ve({},t,{withLabel:i});return C.jsx(aan,ve({"aria-hidden":!0,className:e},r,{ownerState:o,children:C.jsx(lan,{ownerState:o,children:i?C.jsx(zbe,{children:n}):C.jsx(zbe,{className:"notranslate",children:"​"})})}))}const uan=["label","autoFocus","ownerState","notched"],fan=be(SU,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Yu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Yu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Yu.focused} .${Yu.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Yu.disabled}`]:{[`& .${Yu.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled},"*":{color:(t.vars||t).palette.action.disabled}},[`&.${Yu.error} .${Yu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},variants:Object.keys((t.vars??t).palette).filter(n=>{var r;return((r=(t.vars??t).palette[n])==null?void 0:r.main)??!1}).map(n=>({props:{color:n},style:{[`&.${Yu.focused}:not(.${Yu.error}) .${Yu.notchedOutline}`]:{borderColor:(t.vars||t).palette[n].main}}}))}}),dan=be($le,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),han=t=>{const{classes:e}=t,r=qe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},oan,e);return ve({},e,r)},OVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:o,notched:s}=r,a=Dt(r,uan),l=Na(),c=ve({},r,o,l,{color:(l==null?void 0:l.color)||"primary"}),u=han(c);return C.jsx(Fle,ve({slots:{root:fan,input:dan},renderSuffix:f=>C.jsx(can,{shrink:!!(s||f.adornedStart||f.focused||f.filled),notched:!!(s||f.adornedStart||f.focused||f.filled),className:u.notchedOutline,label:i!=null&&i!==""&&(l!=null&&l.required)?C.jsxs(D.Fragment,{children:[i," ","*"]}):i,ownerState:c})},a,{label:i,classes:u,ref:n}))});OVe.muiName="Input";function pan(t){return Xe("MuiPickersFilledInput",t)}const A0=ve({},K_,He("MuiPickersFilledInput",["root","underline","input"])),gan=["label","autoFocus","disableUnderline","ownerState"],man=be(SU,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>n3(t)&&t!=="disableUnderline"})(({theme:t})=>{const e=t.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r,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:i,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r}},[`&.${A0.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r},[`&.${A0.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[...Object.keys((t.vars??t).palette).filter(s=>(t.vars??t).palette[s].main).map(s=>{var a;return{props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(a=(t.vars||t).palette[s])==null?void 0:a.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{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"},[`&.${A0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${A0.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})`:n}`,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(.${A0.disabled}, .${A0.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${A0.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:s})=>!!s,style:{paddingLeft:12}},{props:({endAdornment:s})=>!!s,style:{paddingRight:12}}]}}),van=be($le,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:t})=>!!t,style:{paddingLeft:0}},{props:({endAdornment:t})=>!!t,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),yan=t=>{const{classes:e,disableUnderline:n}=t,i=qe({root:["root",!n&&"underline"],input:["input"]},pan,e);return ve({},e,i)},EVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=Dt(r,gan),l=Na(),c=ve({},r,s,l,{color:(l==null?void 0:l.color)||"primary"}),u=yan(c);return C.jsx(Fle,ve({slots:{root:man,input:van},slotProps:{root:{disableUnderline:o}}},a,{label:i,classes:u,ref:n}))});EVe.muiName="Input";function xan(t){return Xe("MuiPickersFilledInput",t)}const b2=ve({},K_,He("MuiPickersInput",["root","input"])),ban=["label","autoFocus","disableUnderline","ownerState"],wan=be(SU,{name:"MuiPickersInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{let n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((t.vars??t).palette).filter(r=>(t.vars??t).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",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"},[`&.${b2.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${b2.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,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(.${b2.disabled}, .${b2.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${b2.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),_an=t=>{const{classes:e,disableUnderline:n}=t,i=qe({root:["root",!n&&"underline"],input:["input"]},xan,e);return ve({},e,i)},TVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=Dt(r,ban),l=Na(),c=ve({},r,s,l,{disableUnderline:o,color:(l==null?void 0:l.color)||"primary"}),u=_an(c);return C.jsx(Fle,ve({slots:{root:wan}},a,{label:i,classes:u,ref:n}))});TVe.muiName="Input";const San=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],Can={standard:TVe,filled:EVe,outlined:OVe},Oan=be(td,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Ean=t=>{const{focused:e,disabled:n,classes:r,required:i}=t;return qe({root:["root",e&&!n&&"focused",n&&"disabled",i&&"required"]},Gsn,r)},Tan=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersTextField"}),{onFocus:i,onBlur:o,className:s,color:a="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:f=!1,InputProps:d,inputProps:h,inputRef:p,sectionListRef:g,elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:x,onKeyUp:b,onPaste:w,onInput:_,endAdornment:S,startAdornment:O,tabIndex:k,contentEditable:E,focused:P,value:A,onChange:R,fullWidth:T,id:M,name:I,helperText:z,FormHelperTextProps:F,label:N,InputLabelProps:L}=r,B=Dt(r,San),$=D.useRef(null),j=dn(n,$),X=Jf(M),V=z&&X?`${X}-helper-text`:void 0,Y=N&&X?`${X}-label`:void 0,le=ve({},r,{color:a,disabled:l,error:c,focused:P,required:f,variant:u}),K=Ean(le),ee=Can[u];return C.jsxs(Oan,ve({className:Oe(K.root,s),ref:j,focused:P,onFocus:i,onBlur:o,disabled:l,variant:u,error:c,color:a,fullWidth:T,required:f,ownerState:le},B,{children:[C.jsx(Fy,ve({htmlFor:X,id:Y},L,{children:N})),C.jsx(ee,ve({elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:x,onKeyUp:b,onInput:_,onPaste:w,endAdornment:S,startAdornment:O,tabIndex:k,contentEditable:E,value:A,onChange:R,id:X,fullWidth:T,inputProps:h,inputRef:p,sectionListRef:g,label:N,name:I,role:"group","aria-labelledby":Y},d)),z&&C.jsx(Xee,ve({id:V},F,{children:z}))]}))}),kan=["enableAccessibleFieldDOMStructure"],Aan=["InputProps","readOnly"],Pan=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],Man=t=>{let{enableAccessibleFieldDOMStructure:e}=t,n=Dt(t,kan);if(e){const{InputProps:f,readOnly:d}=n,h=Dt(n,Aan);return ve({},h,{InputProps:ve({},f??{},{readOnly:d})})}const{onPaste:r,onKeyDown:i,inputMode:o,readOnly:s,InputProps:a,inputProps:l,inputRef:c}=n,u=Dt(n,Pan);return ve({},u,{InputProps:ve({},a??{},{readOnly:s}),inputProps:ve({},l??{},{inputMode:o,onPaste:r,onKeyDown:i,ref:c})})},Ran=["slots","slotProps","InputProps","inputProps"],kVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiDateTimeField"}),{slots:i,slotProps:o,InputProps:s,inputProps:a}=r,l=Dt(r,Ran),c=r,u=(i==null?void 0:i.textField)??(e.enableAccessibleFieldDOMStructure?Tan:Jr),f=Zt({elementType:u,externalSlotProps:o==null?void 0:o.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});f.inputProps=ve({},a,f.inputProps),f.InputProps=ve({},s,f.InputProps);const d=Vsn(f),h=Man(d),p=zsn(ve({},h,{slots:i,slotProps:o}));return C.jsx(u,ve({},p))});function Dan(t){return Xe("MuiDateTimePickerTabs",t)}He("MuiDateTimePickerTabs",["root"]);const Ian=t=>vC(t)?"date":"time",Lan=t=>t==="date"?"day":"hours",$an=t=>{const{classes:e}=t;return qe({root:["root"]},Dan,e)},Fan=be(O4,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({boxShadow:`0 -1px 0 0 inset ${(t.vars||t).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(t.vars||t).palette.divider}`,[`& .${a3.indicator}`]:{bottom:"auto",top:0}}})),Nan=function(e){const n=kn({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:r=C.jsx(Isn,{}),onViewChange:i,timeIcon:o=C.jsx(Lsn,{}),view:s,hidden:a=typeof window>"u"||window.innerHeight<667,className:l,sx:c}=n,u=Ml(),f=$an(n),d=(h,p)=>{i(Lan(p))};return a?null:C.jsxs(Fan,{ownerState:n,variant:"fullWidth",value:Ian(s),onChange:d,className:Oe(l,f.root),sx:c,children:[C.jsx(sb,{value:"date","aria-label":u.dateTableLabel,icon:C.jsx(D.Fragment,{children:r})}),C.jsx(sb,{value:"time","aria-label":u.timeTableLabel,icon:C.jsx(D.Fragment,{children:o})})]})};function zan(t){return Xe("MuiPickersToolbarText",t)}const VQ=He("MuiPickersToolbarText",["root","selected"]),jan=["className","selected","value"],Ban=t=>{const{classes:e,selected:n}=t;return qe({root:["root",n&&"selected"]},zan,e)},Uan=be(Jt,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${VQ.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:(t.vars||t).palette.text.secondary,[`&.${VQ.selected}`]:{color:(t.vars||t).palette.text.primary}})),AVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersToolbarText"}),{className:i,value:o}=r,s=Dt(r,jan),a=Ban(r);return C.jsx(Uan,ve({ref:n,className:Oe(a.root,i),component:"span"},s,{children:o}))});function PVe(t){return Xe("MuiPickersToolbar",t)}const Wan=He("MuiPickersToolbar",["root","content"]),Van=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Gan=t=>{const{classes:e,isLandscape:n}=t;return qe({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},PVe,e)},Han=be("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),qan=be("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),Xan=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersToolbar"}),{children:i,className:o,toolbarTitle:s,hidden:a,titleId:l}=r,c=Dt(r,Van),u=r,f=Gan(u);return a?null:C.jsxs(Han,ve({ref:n,className:Oe(f.root,o),ownerState:u},c,{children:[C.jsx(Jt,{color:"text.secondary",variant:"overline",id:l,children:s}),C.jsx(qan,{className:f.content,ownerState:u,children:i})]}))}),Yan=["align","className","selected","typographyClassName","value","variant","width"],Qan=t=>{const{classes:e}=t;return qe({root:["root"]},PVe,e)},Kan=be(Hr,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),xm=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:o,selected:s,typographyClassName:a,value:l,variant:c,width:u}=r,f=Dt(r,Yan),d=Qan(r);return C.jsx(Kan,ve({variant:"text",ref:n,className:Oe(d.root,o)},u?{sx:{width:u}}:{},f,{children:C.jsx(AVe,{align:i,className:a,variant:c,value:l,selected:s})}))});function Zan(t){return Xe("MuiDateTimePickerToolbar",t)}const Y9=He("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]);function Jan(t,{disableFuture:e,maxDate:n,timezone:r}){const i=gr();return D.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(e&&i.isBefore(o,n)?o:n);return!i.isAfter(s,t)},[e,n,t,i,r])}function eln(t,{disablePast:e,minDate:n,timezone:r}){const i=gr();return D.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(e&&i.isAfter(o,n)?o:n);return!i.isBefore(s,t)},[e,n,t,i,r])}function Nle(t,e,n,r){const i=gr(),o=Hon(t,i),s=D.useCallback(a=>{const l=t==null?null:qon(t,a,!!e,i);n(l,r??"partial")},[e,t,n,r,i]);return{meridiemMode:o,handleMeridiemChange:s}}const rP=36,CU=2,OU=320,tln=280,EU=336,MVe=232,kT=48,nln=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],rln=t=>{const{classes:e,isLandscape:n,isRtl:r}=t;return qe({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},Zan,e)},iln=be(Xan,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,[`& .${Wan.content} .${VQ.selected}`]:{color:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(t.vars||t).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),oln=be("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(t,e)=>e.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),sln=be("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(t,e)=>e.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:t,toolbarVariant:e})=>t&&e!=="desktop",style:{flexDirection:"column"}},{props:({isLandscape:t,toolbarVariant:e,isRtl:n})=>t&&e!=="desktop"&&n,style:{flexDirection:"column-reverse"}}]}),aln=be("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(t,e)=>e.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),jbe=be(AVe,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),lln=be("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(t,e)=>[{[`.${Y9.ampmLabel}`]:e.ampmLabel},{[`&.${Y9.ampmLandscape}`]:e.ampmLandscape},e.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${Y9.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function cln(t){const e=kn({props:t,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:i,onChange:o,view:s,isLandscape:a,onViewChange:l,toolbarFormat:c,toolbarPlaceholder:u="––",views:f,disabled:d,readOnly:h,toolbarVariant:p="mobile",toolbarTitle:g,className:m}=e,v=Dt(e,nln),y=Eo(),x=ve({},e,{isRtl:y}),b=gr(),{meridiemMode:w,handleMeridiemChange:_}=Nle(i,n,o),S=!!(n&&!r),O=p==="desktop",k=Ml(),E=rln(x),P=g??k.dateTimePickerToolbarTitle,A=T=>n?b.format(T,"hours12h"):b.format(T,"hours24h"),R=D.useMemo(()=>i?c?b.formatByString(i,c):b.format(i,"shortDate"):u,[i,c,u,b]);return C.jsxs(iln,ve({isLandscape:a,className:Oe(E.root,m),toolbarTitle:P},v,{ownerState:x,children:[C.jsxs(oln,{className:E.dateContainer,ownerState:x,children:[f.includes("year")&&C.jsx(xm,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:s==="year",value:i?b.format(i,"year"):"–"}),f.includes("day")&&C.jsx(xm,{tabIndex:-1,variant:O?"h5":"h4",onClick:()=>l("day"),selected:s==="day",value:R})]}),C.jsxs(sln,{className:E.timeContainer,ownerState:x,children:[C.jsxs(aln,{className:E.timeDigitsContainer,ownerState:x,children:[f.includes("hours")&&C.jsxs(D.Fragment,{children:[C.jsx(xm,{variant:O?"h5":"h3",width:O&&!a?kT:void 0,onClick:()=>l("hours"),selected:s==="hours",value:i?A(i):"--"}),C.jsx(jbe,{variant:O?"h5":"h3",value:":",className:E.separator,ownerState:x}),C.jsx(xm,{variant:O?"h5":"h3",width:O&&!a?kT:void 0,onClick:()=>l("minutes"),selected:s==="minutes"||!f.includes("minutes")&&s==="hours",value:i?b.format(i,"minutes"):"--",disabled:!f.includes("minutes")})]}),f.includes("seconds")&&C.jsxs(D.Fragment,{children:[C.jsx(jbe,{variant:O?"h5":"h3",value:":",className:E.separator,ownerState:x}),C.jsx(xm,{variant:O?"h5":"h3",width:O&&!a?kT:void 0,onClick:()=>l("seconds"),selected:s==="seconds",value:i?b.format(i,"seconds"):"--"})]})]}),S&&!O&&C.jsxs(lln,{className:E.ampmSelection,ownerState:x,children:[C.jsx(xm,{variant:"subtitle2",selected:w==="am",typographyClassName:E.ampmLabel,value:tg(b,"am"),onClick:h?void 0:()=>_("am"),disabled:d}),C.jsx(xm,{variant:"subtitle2",selected:w==="pm",typographyClassName:E.ampmLabel,value:tg(b,"pm"),onClick:h?void 0:()=>_("pm"),disabled:d})]}),n&&O&&C.jsx(xm,{variant:"h5",onClick:()=>l("meridiem"),selected:s==="meridiem",value:i&&w?tg(b,w):"--",width:kT})]})]}))}function RVe(t,e){var a;const n=gr(),r=nD(),i=kn({props:t,name:e}),o=i.ampm??n.is12HourCycleInCurrentLocale(),s=D.useMemo(()=>{var l;return((l=i.localeText)==null?void 0:l.toolbarTitle)==null?i.localeText:ve({},i.localeText,{dateTimePickerToolbarTitle:i.localeText.toolbarTitle})},[i.localeText]);return ve({},i,Bon({views:i.views,openTo:i.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:s,orientation:i.orientation??"portrait",disableIgnoringDatePartForTimeValidation:i.disableIgnoringDatePartForTimeValidation??!!(i.minDateTime||i.maxDateTime||i.disablePast||i.disableFuture),disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,minDate:Ru(n,i.minDateTime??i.minDate,r.minDate),maxDate:Ru(n,i.maxDateTime??i.maxDate,r.maxDate),minTime:i.minDateTime??i.minTime,maxTime:i.maxDateTime??i.maxTime,slots:ve({toolbar:cln,tabs:Nan},i.slots),slotProps:ve({},i.slotProps,{toolbar:ve({ampm:o},(a=i.slotProps)==null?void 0:a.toolbar)})})}const DVe=({shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s,timezone:a})=>{const l=A1();return D.useCallback(c=>Ile({adapter:l,value:c,timezone:a,props:{shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s}})!==null,[l,t,e,n,r,i,o,s,a])},uln=(t,e,n)=>(r,i)=>{switch(i.type){case"changeMonth":return ve({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return ve({},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 ve({},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")}},fln=t=>{const{value:e,referenceDate:n,disableFuture:r,disablePast:i,disableSwitchToMonthOnDayFocus:o=!1,maxDate:s,minDate:a,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:f}=t,d=gr(),h=D.useRef(uln(!!c,o,d)).current,p=D.useMemo(()=>ia.getInitialReferenceValue({value:e,utils:d,timezone:f,props:t,referenceDate:n,granularity:xf.day}),[]),[g,m]=D.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:p,currentMonth:d.startOfMonth(p),slideDirection:"left"}),v=D.useCallback(_=>{m(ve({type:"changeMonth"},_)),l&&l(_.newMonth)},[l]),y=D.useCallback(_=>{const S=_;d.isSameMonth(S,g.currentMonth)||v({newMonth:d.startOfMonth(S),direction:d.isAfterDay(S,g.currentMonth)?"left":"right"})},[g.currentMonth,v,d]),x=DVe({shouldDisableDate:u,minDate:a,maxDate:s,disableFuture:r,disablePast:i,timezone:f}),b=D.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),w=st((_,S)=>{x(_)||m({type:"changeFocusedDay",focusedDay:_,withoutMonthSwitchingAnimation:S})});return{referenceDate:p,calendarState:g,changeMonth:y,changeFocusedDay:w,isDateDisabled:x,onMonthSwitchingAnimationEnd:b,handleChangeMonth:v}},dln=t=>Xe("MuiPickersFadeTransitionGroup",t);He("MuiPickersFadeTransitionGroup",["root"]);const hln=t=>{const{classes:e}=t;return qe({root:["root"]},dln,e)},pln=be(kM,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function IVe(t){const e=kn({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,s=hln(e),a=To();return i?n:C.jsx(pln,{className:Oe(s.root,r),children:C.jsx(eO,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},o)})}function gln(t){return Xe("MuiPickersDay",t)}const P0=He("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),mln=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],vln=t=>{const{selected:e,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=t,c=s&&!a;return qe({root:["root",e&&!c&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",s&&a&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},gln,l)},LVe=({theme:t})=>ve({},t.typography.caption,{width:rP,height:rP,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),color:(t.vars||t).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.primary.main,t.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.primary.main,t.palette.action.focusOpacity),[`&.${P0.selected}`]:{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${P0.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${P0.disabled}:not(.${P0.selected})`]:{color:(t.vars||t).palette.text.disabled},[`&.${P0.disabled}&.${P0.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${CU}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(t.vars||t).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${P0.selected})`]:{border:`1px solid ${(t.vars||t).palette.text.secondary}`}}}]}),$Ve=(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]},yln=be(Ff,{name:"MuiPickersDay",slot:"Root",overridesResolver:$Ve})(LVe),xln=be("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:$Ve})(({theme:t})=>ve({},LVe({theme:t}),{opacity:0,pointerEvents:"none"})),w2=()=>{},bln=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:o,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:d,onFocus:h=w2,onBlur:p=w2,onKeyDown:g=w2,onMouseDown:m=w2,onMouseEnter:v=w2,outsideCurrentMonth:y,selected:x=!1,showDaysOutsideCurrentMonth:b=!1,children:w,today:_=!1}=r,S=Dt(r,mln),O=ve({},r,{autoFocus:i,disabled:a,disableHighlightToday:l,disableMargin:c,selected:x,showDaysOutsideCurrentMonth:b,today:_}),k=vln(O),E=gr(),P=D.useRef(null),A=dn(P,n);Ei(()=>{i&&!a&&!u&&!y&&P.current.focus()},[i,a,u,y]);const R=M=>{m(M),y&&M.preventDefault()},T=M=>{a||d(s),y&&M.currentTarget.focus(),f&&f(M)};return y&&!b?C.jsx(xln,{className:Oe(k.root,k.hiddenDaySpacingFiller,o),ownerState:O,role:S.role}):C.jsx(yln,ve({className:Oe(k.root,o),ref:A,centerRipple:!0,disabled:a,tabIndex:x?0:-1,onKeyDown:M=>g(M,s),onFocus:M=>h(M,s),onBlur:M=>p(M,s),onMouseEnter:M=>v(M,s),onClick:T,onMouseDown:R},S,{ownerState:O,children:w||E.format(s,"dayOfMonth")}))}),wln=D.memo(bln),_ln=t=>Xe("MuiPickersSlideTransition",t),jc=He("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),Sln=["children","className","reduceAnimations","slideDirection","transKey","classes"],Cln=t=>{const{classes:e,slideDirection:n}=t,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return qe(r,_ln,e)},Oln=be(kM,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`.${jc["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${jc["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${jc.slideEnterActive}`]:e.slideEnterActive},{[`.${jc.slideExit}`]:e.slideExit},{[`.${jc["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${jc["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:t})=>{const e=t.transitions.create("transform",{duration:t.transitions.duration.complex,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},[`& .${jc["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${jc["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${jc.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${jc.slideExit}`]:{transform:"translate(0%)"},[`& .${jc["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${jc["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}});function Eln(t){const e=kn({props:t,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,s=Dt(e,Sln),a=Cln(e),l=To();if(i)return C.jsx("div",{className:Oe(a.root,r),children:n});const c={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return C.jsx(Oln,{className:Oe(a.root,r),childFactory:u=>D.cloneElement(u,{classNames:c}),role:"presentation",children:C.jsx(Lee,ve({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},s,{children:n}),o)})}const Tln=t=>Xe("MuiDayCalendar",t);He("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const kln=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],Aln=["ownerState"],Pln=t=>{const{classes:e}=t;return qe({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},Tln,e)},FVe=(rP+CU*2)*6,Mln=be("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Rln=be("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),Dln=be(Jt,{name:"MuiDayCalendar",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.vars||t).palette.text.secondary})),Iln=be(Jt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(t,e)=>e.weekNumberLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.disabled})),Lln=be(Jt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(t,e)=>e.weekNumber})(({theme:t})=>ve({},t.typography.caption,{width:rP,height:rP,padding:0,margin:`0 ${CU}px`,color:t.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),$ln=be("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:FVe}),Fln=be(Eln,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:FVe}),Nln=be("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),zln=be("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${CU}px 0`,display:"flex",justifyContent:"center"});function jln(t){let{parentProps:e,day:n,focusableDay:r,selectedDays:i,isDateDisabled:o,currentMonthNumber:s,isViewFocused:a}=t,l=Dt(t,kln);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:d,slots:h,slotProps:p,timezone:g}=e,m=gr(),v=P1(g),y=r!==null&&m.isSameDay(n,r),x=i.some(A=>m.isSameDay(A,n)),b=m.isSameDay(n,v),w=(h==null?void 0:h.day)??wln,_=Zt({elementType:w,externalSlotProps:p==null?void 0:p.day,additionalProps:ve({disableHighlightToday:u,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:f,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:ve({},e,{day:n,selected:x})}),S=Dt(_,Aln),O=D.useMemo(()=>c||o(n),[c,o,n]),k=D.useMemo(()=>m.getMonth(n)!==s,[m,n,s]),E=D.useMemo(()=>{const A=m.startOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.startOfWeek(A)):m.isSameDay(n,A)},[s,n,d,m]),P=D.useMemo(()=>{const A=m.endOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.endOfWeek(A)):m.isSameDay(n,A)},[s,n,d,m]);return C.jsx(w,ve({},S,{day:n,disabled:O,autoFocus:a&&y,today:b,outsideCurrentMonth:k,isFirstVisibleCell:E,isLastVisibleCell:P,selected:x,tabIndex:y?0:-1,"aria-selected":x,"aria-current":b?"date":void 0}))}function Bln(t){const e=kn({props:t,name:"MuiDayCalendar"}),n=gr(),{onFocusedDayChange:r,className:i,currentMonth:o,selectedDays:s,focusedDay:a,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:f,reduceAnimations:d,renderLoading:h=()=>C.jsx("span",{children:"..."}),slideDirection:p,TransitionProps:g,disablePast:m,disableFuture:v,minDate:y,maxDate:x,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:_,dayOfWeekFormatter:S=ne=>n.format(ne,"weekdayShort").charAt(0).toUpperCase(),hasFocus:O,onFocusedViewChange:k,gridLabelId:E,displayWeekNumber:P,fixedWeekNumber:A,autoFocus:R,timezone:T}=e,M=P1(T),I=Pln(e),z=Eo(),F=DVe({shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:_,minDate:y,maxDate:x,disablePast:m,disableFuture:v,timezone:T}),N=Ml(),[L,B]=bc({name:"DayCalendar",state:"hasFocus",controlled:O,default:R??!1}),[$,j]=D.useState(()=>a||M),X=st(ne=>{f||c(ne)}),V=ne=>{F(ne)||(r(ne),j(ne),k==null||k(!0),B(!0))},Y=st((ne,G)=>{switch(ne.key){case"ArrowUp":V(n.addDays(G,-7)),ne.preventDefault();break;case"ArrowDown":V(n.addDays(G,7)),ne.preventDefault();break;case"ArrowLeft":{const q=n.addDays(G,z?1:-1),Z=n.addMonths(G,z?1:-1),de=_k({utils:n,date:q,minDate:z?q:n.startOfMonth(Z),maxDate:z?n.endOfMonth(Z):q,isDateDisabled:F,timezone:T});V(de||q),ne.preventDefault();break}case"ArrowRight":{const q=n.addDays(G,z?-1:1),Z=n.addMonths(G,z?-1:1),de=_k({utils:n,date:q,minDate:z?n.startOfMonth(Z):q,maxDate:z?q:n.endOfMonth(Z),isDateDisabled:F,timezone:T});V(de||q),ne.preventDefault();break}case"Home":V(n.startOfWeek(G)),ne.preventDefault();break;case"End":V(n.endOfWeek(G)),ne.preventDefault();break;case"PageUp":V(n.addMonths(G,1)),ne.preventDefault();break;case"PageDown":V(n.addMonths(G,-1)),ne.preventDefault();break}}),le=st((ne,G)=>V(G)),K=st((ne,G)=>{L&&n.isSameDay($,G)&&(k==null||k(!1))}),ee=n.getMonth(o),re=n.getYear(o),me=D.useMemo(()=>s.filter(ne=>!!ne).map(ne=>n.startOfDay(ne)),[n,s]),te=`${re}-${ee}`,ae=D.useMemo(()=>D.createRef(),[te]),U=D.useMemo(()=>{const ne=n.startOfMonth(o),G=n.endOfMonth(o);return F($)||n.isAfterDay($,G)||n.isBeforeDay($,ne)?_k({utils:n,date:$,minDate:ne,maxDate:G,disablePast:m,disableFuture:v,isDateDisabled:F,timezone:T}):$},[o,v,m,$,F,n,T]),oe=D.useMemo(()=>{const ne=n.setTimezone(o,T),G=n.getWeekArray(ne);let q=n.addMonths(ne,1);for(;A&&G.length{G.lengthC.jsx(Dln,{variant:"caption",role:"columnheader","aria-label":n.format(ne,"weekday"),className:I.weekDayLabel,children:S(ne)},G.toString()))]}),l?C.jsx($ln,{className:I.loadingContainer,children:h()}):C.jsx(Fln,ve({transKey:te,onExited:u,reduceAnimations:d,slideDirection:p,className:Oe(i,I.slideTransition)},g,{nodeRef:ae,children:C.jsx(Nln,{ref:ae,role:"rowgroup",className:I.monthContainer,children:oe.map((ne,G)=>C.jsxs(zln,{role:"row",className:I.weekContainer,"aria-rowindex":G+1,children:[P&&C.jsx(Lln,{className:I.weekNumber,role:"rowheader","aria-label":N.calendarWeekNumberAriaLabelText(n.getWeekNumber(ne[0])),children:N.calendarWeekNumberText(n.getWeekNumber(ne[0]))}),ne.map((q,Z)=>C.jsx(jln,{parentProps:e,day:q,selectedDays:me,focusableDay:U,onKeyDown:Y,onFocus:le,onBlur:K,onDaySelect:X,isDateDisabled:F,currentMonthNumber:ee,isViewFocused:L,"aria-colindex":Z+1},q.toString()))]},`week-${ne[0]}`))})}))]})}function Uln(t){return Xe("MuiPickersMonth",t)}const vL=He("MuiPickersMonth",["root","monthButton","disabled","selected"]),Wln=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],Vln=t=>{const{disabled:e,selected:n,classes:r}=t;return qe({root:["root"],monthButton:["monthButton",e&&"disabled",n&&"selected"]},Uln,r)},Gln=be("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),Hln=be("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(t,e)=>[e.monthButton,{[`&.${vL.disabled}`]:e.disabled},{[`&.${vL.selected}`]:e.selected}]})(({theme:t})=>ve({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${vL.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${vL.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),qln=D.memo(function(e){const n=kn({props:e,name:"MuiPickersMonth"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,"aria-label":g,slots:m,slotProps:v}=n,y=Dt(n,Wln),x=D.useRef(null),b=Vln(n);Ei(()=>{var S;r&&((S=x.current)==null||S.focus())},[r]);const w=(m==null?void 0:m.monthButton)??Hln,_=Zt({elementType:w,externalSlotProps:v==null?void 0:v.monthButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:x,type:"button",role:"radio","aria-current":p,"aria-checked":a,"aria-label":g,onClick:S=>u(S,l),onKeyDown:S=>f(S,l),onFocus:S=>d(S,l),onBlur:S=>h(S,l)},ownerState:n,className:b.monthButton});return C.jsx(Gln,ve({className:Oe(b.root,i),ownerState:n},y,{children:C.jsx(w,ve({},_))}))});function Xln(t){return Xe("MuiMonthCalendar",t)}He("MuiMonthCalendar",["root"]);const Yln=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],Qln=t=>{const{classes:e}=t;return qe({root:["root"]},Xln,e)};function Kln(t,e){const n=gr(),r=nD(),i=kn({props:t,name:e});return ve({disableFuture:!1,disablePast:!1},i,{minDate:Ru(n,i.minDate,r.minDate),maxDate:Ru(n,i.maxDate,r.maxDate)})}const Zln=be("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:OU,boxSizing:"border-box"}),Jln=D.forwardRef(function(e,n){const r=Kln(e,"MuiMonthCalendar"),{className:i,value:o,defaultValue:s,referenceDate:a,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:g,autoFocus:m=!1,onMonthFocus:v,hasFocus:y,onFocusedViewChange:x,monthsPerRow:b=3,timezone:w,gridLabelId:_,slots:S,slotProps:O}=r,k=Dt(r,Yln),{value:E,handleValueChange:P,timezone:A}=YO({name:"MonthCalendar",timezone:w,value:o,defaultValue:s,onChange:h,valueManager:ia}),R=P1(A),T=Eo(),M=gr(),I=D.useMemo(()=>ia.getInitialReferenceValue({value:E,utils:M,props:r,timezone:A,referenceDate:a,granularity:xf.month}),[]),z=r,F=Qln(z),N=D.useMemo(()=>M.getMonth(R),[M,R]),L=D.useMemo(()=>E!=null?M.getMonth(E):null,[E,M]),[B,$]=D.useState(()=>L||M.getMonth(I)),[j,X]=bc({name:"MonthCalendar",state:"hasFocus",controlled:y,default:m??!1}),V=st(te=>{X(te),x&&x(te)}),Y=D.useCallback(te=>{const ae=M.startOfMonth(u&&M.isAfter(R,d)?R:d),U=M.startOfMonth(c&&M.isBefore(R,f)?R:f),oe=M.startOfMonth(te);return M.isBefore(oe,ae)||M.isAfter(oe,U)?!0:p?p(oe):!1},[c,u,f,d,R,p,M]),le=st((te,ae)=>{if(g)return;const U=M.setMonth(E??I,ae);P(U)}),K=st(te=>{Y(M.setMonth(E??I,te))||($(te),V(!0),v&&v(te))});D.useEffect(()=>{$(te=>L!==null&&te!==L?L:te)},[L]);const ee=st((te,ae)=>{switch(te.key){case"ArrowUp":K((12+ae-3)%12),te.preventDefault();break;case"ArrowDown":K((12+ae+3)%12),te.preventDefault();break;case"ArrowLeft":K((12+ae+(T?1:-1))%12),te.preventDefault();break;case"ArrowRight":K((12+ae+(T?-1:1))%12),te.preventDefault();break}}),re=st((te,ae)=>{K(ae)}),me=st((te,ae)=>{B===ae&&V(!1)});return C.jsx(Zln,ve({ref:n,className:Oe(F.root,i),ownerState:z,role:"radiogroup","aria-labelledby":_},k,{children:Ple(M,E??I).map(te=>{const ae=M.getMonth(te),U=M.format(te,"monthShort"),oe=M.format(te,"month"),ne=ae===L,G=l||Y(te);return C.jsx(qln,{selected:ne,value:ae,onClick:le,onKeyDown:ee,autoFocus:j&&ae===B,disabled:G,tabIndex:ae===B&&!G?0:-1,onFocus:re,onBlur:me,"aria-current":N===ae?"date":void 0,"aria-label":oe,monthsPerRow:b,slots:S,slotProps:O,children:U},U)})}))});function ecn(t){return Xe("MuiPickersYear",t)}const yL=He("MuiPickersYear",["root","yearButton","selected","disabled"]),tcn=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],ncn=t=>{const{disabled:e,selected:n,classes:r}=t;return qe({root:["root"],yearButton:["yearButton",e&&"disabled",n&&"selected"]},ecn,r)},rcn=be("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),icn=be("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(t,e)=>[e.yearButton,{[`&.${yL.disabled}`]:e.disabled},{[`&.${yL.selected}`]:e.selected}]})(({theme:t})=>ve({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.action.active,t.palette.action.focusOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${yL.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${yL.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),ocn=D.memo(function(e){const n=kn({props:e,name:"MuiPickersYear"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,slots:g,slotProps:m}=n,v=Dt(n,tcn),y=D.useRef(null),x=ncn(n);Ei(()=>{var _;r&&((_=y.current)==null||_.focus())},[r]);const b=(g==null?void 0:g.yearButton)??icn,w=Zt({elementType:b,externalSlotProps:m==null?void 0:m.yearButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:y,type:"button",role:"radio","aria-current":p,"aria-checked":a,onClick:_=>u(_,l),onKeyDown:_=>f(_,l),onFocus:_=>d(_,l),onBlur:_=>h(_,l)},ownerState:n,className:x.yearButton});return C.jsx(rcn,ve({className:Oe(x.root,i),ownerState:n},v,{children:C.jsx(b,ve({},w))}))});function scn(t){return Xe("MuiYearCalendar",t)}He("MuiYearCalendar",["root"]);const acn=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],lcn=t=>{const{classes:e}=t;return qe({root:["root"]},scn,e)};function ccn(t,e){const n=gr(),r=nD(),i=kn({props:t,name:e});return ve({disablePast:!1,disableFuture:!1},i,{yearsPerRow:i.yearsPerRow??3,minDate:Ru(n,i.minDate,r.minDate),maxDate:Ru(n,i.maxDate,r.maxDate)})}const ucn=be("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:OU,maxHeight:tln,boxSizing:"border-box",position:"relative"}),fcn=D.forwardRef(function(e,n){const r=ccn(e,"MuiYearCalendar"),{autoFocus:i,className:o,value:s,defaultValue:a,referenceDate:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onChange:p,readOnly:g,shouldDisableYear:m,onYearFocus:v,hasFocus:y,onFocusedViewChange:x,yearsOrder:b="asc",yearsPerRow:w,timezone:_,gridLabelId:S,slots:O,slotProps:k}=r,E=Dt(r,acn),{value:P,handleValueChange:A,timezone:R}=YO({name:"YearCalendar",timezone:_,value:s,defaultValue:a,onChange:p,valueManager:ia}),T=P1(R),M=Eo(),I=gr(),z=D.useMemo(()=>ia.getInitialReferenceValue({value:P,utils:I,props:r,timezone:R,referenceDate:l,granularity:xf.year}),[]),F=r,N=lcn(F),L=D.useMemo(()=>I.getYear(T),[I,T]),B=D.useMemo(()=>P!=null?I.getYear(P):null,[P,I]),[$,j]=D.useState(()=>B||I.getYear(z)),[X,V]=bc({name:"YearCalendar",state:"hasFocus",controlled:y,default:i??!1}),Y=st(q=>{V(q),x&&x(q)}),le=D.useCallback(q=>{if(f&&I.isBeforeYear(q,T)||u&&I.isAfterYear(q,T)||h&&I.isBeforeYear(q,h)||d&&I.isAfterYear(q,d))return!0;if(!m)return!1;const Z=I.startOfYear(q);return m(Z)},[u,f,d,h,T,m,I]),K=st((q,Z)=>{if(g)return;const de=I.setYear(P??z,Z);A(de)}),ee=st(q=>{le(I.setYear(P??z,q))||(j(q),Y(!0),v==null||v(q))});D.useEffect(()=>{j(q=>B!==null&&q!==B?B:q)},[B]);const re=b!=="desc"?w*1:w*-1,me=M&&b==="asc"||!M&&b==="desc"?-1:1,te=st((q,Z)=>{switch(q.key){case"ArrowUp":ee(Z-re),q.preventDefault();break;case"ArrowDown":ee(Z+re),q.preventDefault();break;case"ArrowLeft":ee(Z-me),q.preventDefault();break;case"ArrowRight":ee(Z+me),q.preventDefault();break}}),ae=st((q,Z)=>{ee(Z)}),U=st((q,Z)=>{$===Z&&Y(!1)}),oe=D.useRef(null),ne=dn(n,oe);D.useEffect(()=>{if(i||oe.current===null)return;const q=oe.current.querySelector('[tabindex="0"]');if(!q)return;const Z=q.offsetHeight,de=q.offsetTop,xe=oe.current.clientHeight,H=oe.current.scrollTop,W=de+Z;Z>xe||de{const Z=I.getYear(q),de=Z===B,xe=c||le(q);return C.jsx(ocn,{selected:de,value:Z,onClick:K,onKeyDown:te,autoFocus:X&&Z===$,disabled:xe,tabIndex:Z===$&&!xe?0:-1,onFocus:ae,onBlur:U,"aria-current":L===Z?"date":void 0,yearsPerRow:w,slots:O,slotProps:k,children:I.format(q,"year")},I.format(q,"year"))})}))});function rD({onChange:t,onViewChange:e,openTo:n,view:r,views:i,autoFocus:o,focusedView:s,onFocusedViewChange:a}){const l=D.useRef(n),c=D.useRef(i),u=D.useRef(i.includes(n)?n:i[0]),[f,d]=bc({name:"useViews",state:"view",controlled:r,default:u.current}),h=D.useRef(o?f:null),[p,g]=bc({name:"useViews",state:"focusedView",controlled:s,default:h.current});D.useEffect(()=>{(l.current&&l.current!==n||c.current&&c.current.some(S=>!i.includes(S)))&&(d(i.includes(n)?n:i[0]),c.current=i,l.current=n)},[n,d,f,i]);const m=i.indexOf(f),v=i[m-1]??null,y=i[m+1]??null,x=st((S,O)=>{g(O?S:k=>S===k?null:k),a==null||a(S,O)}),b=st(S=>{x(S,!0),S!==f&&(d(S),e&&e(S))}),w=st(()=>{y&&b(y)}),_=st((S,O,k)=>{const E=O==="finish",P=k?i.indexOf(k)Xe("MuiPickersCalendarHeader",t),hcn=He("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function pcn(t){return Xe("MuiPickersArrowSwitcher",t)}He("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const gcn=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],mcn=["ownerState"],vcn=["ownerState"],ycn=be("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),xcn=be("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),Bbe=be(Gt,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),bcn=t=>{const{classes:e}=t;return qe({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},pcn,e)},NVe=D.forwardRef(function(e,n){const r=Eo(),i=kn({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:s,slots:a,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:f,nextLabel:d,isPreviousDisabled:h,isPreviousHidden:p,onGoToPrevious:g,previousLabel:m,labelId:v}=i,y=Dt(i,gcn),x=i,b=bcn(x),w={isDisabled:c,isHidden:u,goTo:f,label:d},_={isDisabled:h,isHidden:p,goTo:g,label:m},S=(a==null?void 0:a.previousIconButton)??Bbe,O=Zt({elementType:S,externalSlotProps:l==null?void 0:l.previousIconButton,additionalProps:{size:"medium",title:_.label,"aria-label":_.label,disabled:_.isDisabled,edge:"end",onClick:_.goTo},ownerState:ve({},x,{hidden:_.isHidden}),className:Oe(b.button,b.previousIconButton)}),k=(a==null?void 0:a.nextIconButton)??Bbe,E=Zt({elementType:k,externalSlotProps:l==null?void 0:l.nextIconButton,additionalProps:{size:"medium",title:w.label,"aria-label":w.label,disabled:w.isDisabled,edge:"start",onClick:w.goTo},ownerState:ve({},x,{hidden:w.isHidden}),className:Oe(b.button,b.nextIconButton)}),P=(a==null?void 0:a.leftArrowIcon)??Msn,A=Zt({elementType:P,externalSlotProps:l==null?void 0:l.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:b.leftArrowIcon}),R=Dt(A,mcn),T=(a==null?void 0:a.rightArrowIcon)??Rsn,M=Zt({elementType:T,externalSlotProps:l==null?void 0:l.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:b.rightArrowIcon}),I=Dt(M,vcn);return C.jsxs(ycn,ve({ref:n,className:Oe(b.root,s),ownerState:x},y,{children:[C.jsx(S,ve({},O,{children:r?C.jsx(T,ve({},I)):C.jsx(P,ve({},R))})),o?C.jsx(Jt,{variant:"subtitle1",component:"span",id:v,children:o}):C.jsx(xcn,{className:b.spacer,ownerState:x}),C.jsx(k,ve({},E,{children:r?C.jsx(P,ve({},R)):C.jsx(T,ve({},I))}))]}))}),wcn=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],_cn=["ownerState"],Scn=t=>{const{classes:e}=t;return qe({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},dcn,e)},Ccn=be("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),Ocn=be("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(t,e)=>e.labelContainer})(({theme:t})=>ve({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),Ecn=be("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),Tcn=be(Gt,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${hcn.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),kcn=be(Psn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(t,e)=>e.switchViewIcon})(({theme:t})=>({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"})),Acn=D.forwardRef(function(e,n){const r=Ml(),i=gr(),o=kn({props:e,name:"MuiPickersCalendarHeader"}),{slots:s,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onMonthChange:p,onViewChange:g,view:m,reduceAnimations:v,views:y,labelId:x,className:b,timezone:w,format:_=`${i.formats.month} ${i.formats.year}`}=o,S=Dt(o,wcn),O=o,k=Scn(o),E=(s==null?void 0:s.switchViewButton)??Tcn,P=Zt({elementType:E,externalSlotProps:a==null?void 0:a.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(m)},ownerState:O,className:k.switchViewButton}),A=(s==null?void 0:s.switchViewIcon)??kcn,R=Zt({elementType:A,externalSlotProps:a==null?void 0:a.switchViewIcon,ownerState:O,className:k.switchViewIcon}),T=Dt(R,_cn),M=()=>p(i.addMonths(l,1),"left"),I=()=>p(i.addMonths(l,-1),"right"),z=Jan(l,{disableFuture:u,maxDate:d,timezone:w}),F=eln(l,{disablePast:f,minDate:h,timezone:w}),N=()=>{if(!(y.length===1||!g||c))if(y.length===2)g(y.find(B=>B!==m)||y[0]);else{const B=y.indexOf(m)!==0?0:1;g(y[B])}};if(y.length===1&&y[0]==="year")return null;const L=i.formatByString(l,_);return C.jsxs(Ccn,ve({},S,{ownerState:O,className:Oe(k.root,b),ref:n,children:[C.jsxs(Ocn,{role:"presentation",onClick:N,ownerState:O,"aria-live":"polite",className:k.labelContainer,children:[C.jsx(IVe,{reduceAnimations:v,transKey:L,children:C.jsx(Ecn,{id:x,ownerState:O,className:k.label,children:L})}),y.length>1&&!c&&C.jsx(E,ve({},P,{children:C.jsx(A,ve({},T))}))]}),C.jsx(eO,{in:m==="day",children:C.jsx(NVe,{slots:s,slotProps:a,onGoToPrevious:I,isPreviousDisabled:F,previousLabel:r.previousMonth,onGoToNext:M,isNextDisabled:z,nextLabel:r.nextMonth})})]}))}),TU=be("div")({overflow:"hidden",width:OU,maxHeight:EU,display:"flex",flexDirection:"column",margin:"0 auto"}),Pcn="@media (prefers-reduced-motion: reduce)",Z_=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),Ube=Z_&&Z_[1]?parseInt(Z_[1],10):null,Wbe=Z_&&Z_[2]?parseInt(Z_[2],10):null,Mcn=Ube&&Ube<10||Wbe&&Wbe<13||!1,zVe=()=>Tee(Pcn,{defaultMatches:!1})||Mcn,Rcn=t=>Xe("MuiDateCalendar",t);He("MuiDateCalendar",["root","viewTransitionContainer"]);const Dcn=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],Icn=t=>{const{classes:e}=t;return qe({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Rcn,e)};function Lcn(t,e){const n=gr(),r=nD(),i=zVe(),o=kn({props:t,name:e});return ve({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??i,renderLoading:o.renderLoading??(()=>C.jsx("span",{children:"..."})),minDate:Ru(n,o.minDate,r.minDate),maxDate:Ru(n,o.maxDate,r.maxDate)})}const $cn=be(TU,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",height:EU}),Fcn=be(IVe,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),Ncn=D.forwardRef(function(e,n){const r=gr(),i=Jf(),o=Lcn(e,"MuiDateCalendar"),{autoFocus:s,onViewChange:a,value:l,defaultValue:c,referenceDate:u,disableFuture:f,disablePast:d,onChange:h,onYearChange:p,onMonthChange:g,reduceAnimations:m,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:x,view:b,views:w,openTo:_,className:S,disabled:O,readOnly:k,minDate:E,maxDate:P,disableHighlightToday:A,focusedView:R,onFocusedViewChange:T,showDaysOutsideCurrentMonth:M,fixedWeekNumber:I,dayOfWeekFormatter:z,slots:F,slotProps:N,loading:L,renderLoading:B,displayWeekNumber:$,yearsOrder:j,yearsPerRow:X,monthsPerRow:V,timezone:Y}=o,le=Dt(o,Dcn),{value:K,handleValueChange:ee,timezone:re}=YO({name:"DateCalendar",timezone:Y,value:l,defaultValue:c,onChange:h,valueManager:ia}),{view:me,setView:te,focusedView:ae,setFocusedView:U,goToNextView:oe,setValueAndGoToNextView:ne}=rD({view:b,views:w,openTo:_,onChange:ee,onViewChange:a,autoFocus:s,focusedView:R,onFocusedViewChange:T}),{referenceDate:G,calendarState:q,changeFocusedDay:Z,changeMonth:de,handleChangeMonth:xe,isDateDisabled:H,onMonthSwitchingAnimationEnd:W}=fln({value:K,referenceDate:u,reduceAnimations:m,onMonthChange:g,minDate:E,maxDate:P,shouldDisableDate:v,disablePast:d,disableFuture:f,timezone:re}),J=O&&K||E,se=O&&K||P,ye=`${i}-grid-label`,ie=ae!==null,fe=(F==null?void 0:F.calendarHeader)??Acn,Q=Zt({elementType:fe,externalSlotProps:N==null?void 0:N.calendarHeader,additionalProps:{views:w,view:me,currentMonth:q.currentMonth,onViewChange:te,onMonthChange:(Se,Ye)=>xe({newMonth:Se,direction:Ye}),minDate:J,maxDate:se,disabled:O,disablePast:d,disableFuture:f,reduceAnimations:m,timezone:re,labelId:ye},ownerState:o}),_e=st(Se=>{const Ye=r.startOfMonth(Se),tt=r.endOfMonth(Se),ut=H(Se)?_k({utils:r,date:Se,minDate:r.isBefore(E,Ye)?Ye:E,maxDate:r.isAfter(P,tt)?tt:P,disablePast:d,disableFuture:f,isDateDisabled:H,timezone:re}):Se;ut?(ne(ut,"finish"),g==null||g(Ye)):(oe(),de(Ye)),Z(ut,!0)}),we=st(Se=>{const Ye=r.startOfYear(Se),tt=r.endOfYear(Se),ut=H(Se)?_k({utils:r,date:Se,minDate:r.isBefore(E,Ye)?Ye:E,maxDate:r.isAfter(P,tt)?tt:P,disablePast:d,disableFuture:f,isDateDisabled:H,timezone:re}):Se;ut?(ne(ut,"finish"),p==null||p(ut)):(oe(),de(Ye)),Z(ut,!0)}),Ie=st(Se=>ee(Se&&Z5(r,Se,K??G),"finish",me));D.useEffect(()=>{K!=null&&r.isValid(K)&&de(K)},[K]);const Pe=o,Re=Icn(Pe),Te={disablePast:d,disableFuture:f,maxDate:P,minDate:E},Le={disableHighlightToday:A,readOnly:k,disabled:O,timezone:re,gridLabelId:ye,slots:F,slotProps:N},ue=D.useRef(me);D.useEffect(()=>{ue.current!==me&&(ae===ue.current&&U(me,!0),ue.current=me)},[ae,U,me]);const $e=D.useMemo(()=>[K],[K]);return C.jsxs($cn,ve({ref:n,className:Oe(Re.root,S),ownerState:Pe},le,{children:[C.jsx(fe,ve({},Q,{slots:F,slotProps:N})),C.jsx(Fcn,{reduceAnimations:m,className:Re.viewTransitionContainer,transKey:me,ownerState:Pe,children:C.jsxs("div",{children:[me==="year"&&C.jsx(fcn,ve({},Te,Le,{value:K,onChange:we,shouldDisableYear:x,hasFocus:ie,onFocusedViewChange:Se=>U("year",Se),yearsOrder:j,yearsPerRow:X,referenceDate:G})),me==="month"&&C.jsx(Jln,ve({},Te,Le,{hasFocus:ie,className:S,value:K,onChange:_e,shouldDisableMonth:y,onFocusedViewChange:Se=>U("month",Se),monthsPerRow:V,referenceDate:G})),me==="day"&&C.jsx(Bln,ve({},q,Te,Le,{onMonthSwitchingAnimationEnd:W,onFocusedDayChange:Z,reduceAnimations:m,selectedDays:$e,onSelectedDaysChange:Ie,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:x,hasFocus:ie,onFocusedViewChange:Se=>U("day",Se),showDaysOutsideCurrentMonth:M,fixedWeekNumber:I,dayOfWeekFormatter:z,displayWeekNumber:$,loading:L,renderLoading:B}))]})})]}))}),J_=({view:t,onViewChange:e,views:n,focusedView:r,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:_,yearsPerRow:S,slots:O,slotProps:k,loading:E,renderLoading:P,disableHighlightToday:A,readOnly:R,disabled:T,showDaysOutsideCurrentMonth:M,dayOfWeekFormatter:I,sx:z,autoFocus:F,fixedWeekNumber:N,displayWeekNumber:L,timezone:B})=>C.jsx(Ncn,{view:t,onViewChange:e,views:n.filter(vC),focusedView:r&&vC(r)?r:null,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:_,yearsPerRow:S,slots:O,slotProps:k,loading:E,renderLoading:P,disableHighlightToday:A,readOnly:R,disabled:T,showDaysOutsideCurrentMonth:M,dayOfWeekFormatter:I,sx:z,autoFocus:F,fixedWeekNumber:N,displayWeekNumber:L,timezone:B});function zcn(t){return Xe("MuiPickersPopper",t)}He("MuiPickersPopper",["root","paper"]);const jcn=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],Bcn=t=>{const{classes:e}=t;return qe({root:["root"],paper:["paper"]},zcn,e)},Ucn=be(Gee,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),Wcn=be(kl,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:t})=>["top","top-start","top-end"].includes(t),style:{transformOrigin:"bottom center"}}]});function Vcn(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 s=st(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=yi(i.current);if(!i.current||"clientX"in l&&Vcn(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)}),a=()=>{r.current=!0};return D.useEffect(()=>{if(t){const l=yi(i.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[t,s]),D.useEffect(()=>{if(t){const l=yi(i.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[t,s]),[i,a,a]}const Hcn=D.forwardRef((t,e)=>{const{PaperComponent:n,popperPlacement:r,ownerState:i,children:o,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:c}=t,u=Dt(t,jcn),f=ve({},i,{placement:r}),d=Zt({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:e},className:a,ownerState:f});return C.jsx(n,ve({},u,d,{onClick:h=>{var p;l(h),(p=d.onClick)==null||p.call(d,h)},onTouchStart:h=>{var p;c(h),(p=d.onTouchStart)==null||p.call(d,h)},ownerState:f,children:o}))});function qcn(t){const e=kn({props:t,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:i=null,shouldRestoreFocus:o,onBlur:s,onDismiss:a,open:l,role:c,placement:u,slots:f,slotProps:d,reduceAnimations:h}=e;D.useEffect(()=>{function M(I){l&&I.key==="Escape"&&a()}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[a,l]);const p=D.useRef(null);D.useEffect(()=>{c==="tooltip"||o&&!o()||(l?p.current=Ka(document):p.current&&p.current instanceof HTMLElement&&setTimeout(()=>{p.current instanceof HTMLElement&&p.current.focus()}))},[l,c,o]);const[g,m,v]=Gcn(l,s??a),y=D.useRef(null),x=dn(y,i),b=dn(x,g),w=e,_=Bcn(w),S=zVe(),O=h??S,k=M=>{M.key==="Escape"&&(M.stopPropagation(),a())},E=(f==null?void 0:f.desktopTransition)??O?eO:ob,P=(f==null?void 0:f.desktopTrapFocus)??wPe,A=(f==null?void 0:f.desktopPaper)??Wcn,R=(f==null?void 0:f.popper)??Ucn,T=Zt({elementType:R,externalSlotProps:d==null?void 0:d.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:n,placement:u,onKeyDown:k},className:_.root,ownerState:e});return C.jsx(R,ve({},T,{children:({TransitionProps:M,placement:I})=>C.jsx(P,ve({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},d==null?void 0:d.desktopTrapFocus,{children:C.jsx(E,ve({},M,d==null?void 0:d.desktopTransition,{children:C.jsx(Hcn,{PaperComponent:A,ownerState:w,popperPlacement:I,ref:b,onPaperClick:m,onPaperTouchStart:v,paperClasses:_.paper,paperSlotProps:d==null?void 0:d.desktopPaper,children:r})}))}))}))}const Xcn=({open:t,onOpen:e,onClose:n})=>{const r=D.useRef(typeof t=="boolean").current,[i,o]=D.useState(!1);D.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 s=D.useCallback(a=>{r||o(a),a&&e&&e(),!a&&n&&n()},[r,e,n]);return{isOpen:i,setIsOpen:s}},Ycn=t=>{const{action:e,hasChanged:n,dateState:r,isControlled:i}=t,o=!i&&!r.hasBeenModifiedSinceMount;return e.name==="setValueFromField"?!0:e.name==="setValueFromAction"?o&&["accept","today","clear"].includes(e.pickerAction)?!0:n(r.lastPublishedValue):e.name==="setValueFromView"&&e.selectionState!=="shallow"||e.name==="setValueFromShortcut"?o?!0:n(r.lastPublishedValue):!1},Qcn=t=>{const{action:e,hasChanged:n,dateState:r,isControlled:i,closeOnSelect:o}=t,s=!i&&!r.hasBeenModifiedSinceMount;return e.name==="setValueFromAction"?s&&["accept","today","clear"].includes(e.pickerAction)?!0:n(r.lastCommittedValue):e.name==="setValueFromView"&&e.selectionState==="finish"&&o?s?!0:n(r.lastCommittedValue):e.name==="setValueFromShortcut"?e.changeImportance==="accept"&&n(r.lastCommittedValue):!1},Kcn=t=>{const{action:e,closeOnSelect:n}=t;return e.name==="setValueFromAction"?!0:e.name==="setValueFromView"?e.selectionState==="finish"&&n:e.name==="setValueFromShortcut"?e.changeImportance==="accept":!1},Zcn=({props:t,valueManager:e,valueType:n,wrapperVariant:r,validator:i})=>{const{onAccept:o,onChange:s,value:a,defaultValue:l,closeOnSelect:c=r==="desktop",timezone:u}=t,{current:f}=D.useRef(l),{current:d}=D.useRef(a!==void 0),h=gr(),p=A1(),{isOpen:g,setIsOpen:m}=Xcn(t),{timezone:v,value:y,handleValueChange:x}=Lle({timezone:u,value:a,defaultValue:f,onChange:s,valueManager:e}),[b,w]=D.useState(()=>{let V;return y!==void 0?V=y:f!==void 0?V=f:V=e.emptyValue,{draft:V,lastPublishedValue:V,lastCommittedValue:V,lastControlledValue:y,hasBeenModifiedSinceMount:!1}}),{getValidationErrorForNewValue:_}=xVe({props:t,validator:i,timezone:v,value:b.draft,onError:t.onError}),S=st(V=>{const Y={action:V,dateState:b,hasChanged:te=>!e.areValuesEqual(h,V.value,te),isControlled:d,closeOnSelect:c},le=Ycn(Y),K=Qcn(Y),ee=Kcn(Y);w(te=>ve({},te,{draft:V.value,lastPublishedValue:le?V.value:te.lastPublishedValue,lastCommittedValue:K?V.value:te.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let re=null;const me=()=>(re||(re={validationError:V.name==="setValueFromField"?V.context.validationError:_(V.value)},V.name==="setValueFromShortcut"&&(re.shortcut=V.shortcut)),re);le&&x(V.value,me()),K&&o&&o(V.value,me()),ee&&m(!1)});if(y!==void 0&&(b.lastControlledValue===void 0||!e.areValuesEqual(h,b.lastControlledValue,y))){const V=e.areValuesEqual(h,b.draft,y);w(Y=>ve({},Y,{lastControlledValue:y},V?{}:{lastCommittedValue:y,lastPublishedValue:y,draft:y,hasBeenModifiedSinceMount:!0}))}const O=st(()=>{S({value:e.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),k=st(()=>{S({value:b.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),E=st(()=>{S({value:b.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),P=st(()=>{S({value:b.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),A=st(()=>{S({value:e.getTodayValue(h,v,n),name:"setValueFromAction",pickerAction:"today"})}),R=st(V=>{V.preventDefault(),m(!0)}),T=st(V=>{V==null||V.preventDefault(),m(!1)}),M=st((V,Y="partial")=>S({name:"setValueFromView",value:V,selectionState:Y})),I=st((V,Y,le)=>S({name:"setValueFromShortcut",value:V,changeImportance:Y,shortcut:le})),z=st((V,Y)=>S({name:"setValueFromField",value:V,context:Y})),F={onClear:O,onAccept:k,onDismiss:E,onCancel:P,onSetToday:A,onOpen:R,onClose:T},N={value:b.draft,onChange:z},L=D.useMemo(()=>e.cleanValue(h,b.draft),[h,e,b.draft]),B={value:L,onChange:M,onClose:T,open:g},j=ve({},F,{value:L,onChange:M,onSelectShortcut:I,isValid:V=>{const Y=i({adapter:p,value:V,timezone:v,props:t});return!e.hasError(Y)}}),X=D.useMemo(()=>({onOpen:R,onClose:T,open:g}),[g,T,R]);return{open:g,fieldProps:N,viewProps:B,layoutProps:j,actions:F,contextValue:X}},Jcn=["className","sx"],eun=({props:t,propsFromPickerValue:e,additionalViewProps:n,autoFocusView:r,rendererInterceptor:i,fieldRef:o})=>{const{onChange:s,open:a,onClose:l}=e,{view:c,views:u,openTo:f,onViewChange:d,viewRenderers:h,timezone:p}=t,g=Dt(t,Jcn),{view:m,setView:v,defaultView:y,focusedView:x,setFocusedView:b,setValueAndGoToNextView:w}=rD({view:c,views:u,openTo:f,onChange:s,onViewChange:d,autoFocus:r}),{hasUIView:_,viewModeLookup:S}=D.useMemo(()=>u.reduce((T,M)=>{let I;return h[M]!=null?I="UI":I="field",T.viewModeLookup[M]=I,I==="UI"&&(T.hasUIView=!0),T},{hasUIView:!1,viewModeLookup:{}}),[h,u]),O=D.useMemo(()=>u.reduce((T,M)=>h[M]!=null&&yC(M)?T+1:T,0),[h,u]),k=S[m],E=st(()=>k==="UI"),[P,A]=D.useState(k==="UI"?m:null);return P!==m&&S[m]==="UI"&&A(m),Ei(()=>{k==="field"&&a&&(l(),setTimeout(()=>{var T,M;(T=o==null?void 0:o.current)==null||T.setSelectedSections(m),(M=o==null?void 0:o.current)==null||M.focusField(m)}))},[m]),Ei(()=>{if(!a)return;let T=m;k==="field"&&P!=null&&(T=P),T!==y&&S[T]==="UI"&&S[y]==="UI"&&(T=y),T!==m&&v(T),b(T,!0)},[a]),{hasUIView:_,shouldRestoreFocus:E,layoutProps:{views:u,view:P,onViewChange:v},renderCurrentView:()=>{if(P==null)return null;const T=h[P];if(T==null)return null;const M=ve({},g,n,e,{views:u,timezone:p,onChange:w,view:P,onViewChange:v,focusedView:x,onFocusedViewChange:b,showViewSwitcher:O>1,timeViewsCount:O});return i?i(h,P,M):T(M)}}};function Vbe(){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 tun=(t,e)=>{const[n,r]=D.useState(Vbe);return Ei(()=>{const o=()=>{r(Vbe())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),Ssn(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},nun=({props:t,propsFromPickerValue:e,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:i}=t,o=tun(n.views,i),s=Eo();return{layoutProps:ve({},n,e,{isLandscape:o,isRtl:s,wrapperVariant:r,disabled:t.disabled,readOnly:t.readOnly})}};function run(t){const{props:e,pickerValueResponse:n}=t;return D.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:e.disabled??!1,readOnly:e.readOnly??!1}),[n.viewProps.value,n.open,e.disabled,e.readOnly])}const jVe=({props:t,valueManager:e,valueType:n,wrapperVariant:r,additionalViewProps:i,validator:o,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const c=Zcn({props:t,valueManager:e,valueType:n,wrapperVariant:r,validator:o}),u=eun({props:t,additionalViewProps:i,autoFocusView:s,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:a}),f=nun({props:t,wrapperVariant:r,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps}),d=run({props:t,pickerValueResponse:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:c.contextValue,ownerState:d}};function BVe(t){return Xe("MuiPickersLayout",t)}const hf=He("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),iun=["onAccept","onClear","onCancel","onSetToday","actions"];function oun(t){const{onAccept:e,onClear:n,onCancel:r,onSetToday:i,actions:o}=t,s=Dt(t,iun),a=Ml();if(o==null||o.length===0)return null;const l=o==null?void 0:o.map(c=>{switch(c){case"clear":return C.jsx(Hr,{onClick:n,children:a.clearButtonLabel},c);case"cancel":return C.jsx(Hr,{onClick:r,children:a.cancelButtonLabel},c);case"accept":return C.jsx(Hr,{onClick:e,children:a.okButtonLabel},c);case"today":return C.jsx(Hr,{onClick:i,children:a.todayButtonLabel},c);default:return null}});return C.jsx(Jb,ve({},s,{children:l}))}const sun=["items","changeImportance","isLandscape","onChange","isValid"],aun=["getValue"];function lun(t){const{items:e,changeImportance:n="accept",onChange:r,isValid:i}=t,o=Dt(t,sun);if(e==null||e.length===0)return null;const s=e.map(a=>{let{getValue:l}=a,c=Dt(a,aun);const u=l({isValid:i});return ve({},c,{label:c.label,onClick:()=>{r(u,n,c)},disabled:!i(u)})});return C.jsx(MM,ve({dense:!0,sx:[{maxHeight:EU,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:s.map(a=>C.jsx($_,{children:C.jsx(pPe,ve({},a))},a.id??a.label))}))}function cun(t){return t.view!==null}const uun=t=>{const{classes:e,isLandscape:n}=t;return qe({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},BVe,e)},UVe=t=>{const{wrapperVariant:e,onAccept:n,onClear:r,onCancel:i,onSetToday:o,view:s,views:a,onViewChange:l,value:c,onChange:u,onSelectShortcut:f,isValid:d,isLandscape:h,disabled:p,readOnly:g,children:m,slots:v,slotProps:y}=t,x=uun(t),b=(v==null?void 0:v.actionBar)??oun,w=Zt({elementType:b,externalSlotProps:y==null?void 0:y.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:i,onSetToday:o,actions:e==="desktop"?[]:["cancel","accept"]},className:x.actionBar,ownerState:ve({},t,{wrapperVariant:e})}),_=C.jsx(b,ve({},w)),S=v==null?void 0:v.toolbar,O=Zt({elementType:S,externalSlotProps:y==null?void 0:y.toolbar,additionalProps:{isLandscape:h,onChange:u,value:c,view:s,onViewChange:l,views:a,disabled:p,readOnly:g},className:x.toolbar,ownerState:ve({},t,{wrapperVariant:e})}),k=cun(O)&&S?C.jsx(S,ve({},O)):null,E=m,P=v==null?void 0:v.tabs,A=s&&P?C.jsx(P,ve({view:s,onViewChange:l,className:x.tabs},y==null?void 0:y.tabs)):null,R=(v==null?void 0:v.shortcuts)??lun,T=Zt({elementType:R,externalSlotProps:y==null?void 0:y.shortcuts,additionalProps:{isValid:d,isLandscape:h,onChange:f},className:x.shortcuts,ownerState:{isValid:d,isLandscape:h,onChange:f,wrapperVariant:e}}),M=s&&R?C.jsx(R,ve({},T)):null;return{toolbar:k,content:E,tabs:A,actionBar:_,shortcuts:M}},fun=t=>{const{isLandscape:e,classes:n}=t;return qe({root:["root",e&&"landscape"],contentWrapper:["contentWrapper"]},BVe,n)},WVe=be("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${hf.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${hf.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${hf.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${hf.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${hf.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${hf.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${hf.shortcuts}`]:{gridColumn:3}}}]}),VVe=be("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(t,e)=>e.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),GVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:o,tabs:s,actionBar:a,shortcuts:l}=UVe(r),{sx:c,className:u,isLandscape:f,wrapperVariant:d}=r,h=fun(r);return C.jsxs(WVe,{ref:n,sx:c,className:Oe(h.root,u),ownerState:r,children:[f?l:i,f?i:l,C.jsx(VVe,{className:h.contentWrapper,children:d==="desktop"?C.jsxs(D.Fragment,{children:[o,s]}):C.jsxs(D.Fragment,{children:[s,o]})}),a]})}),dun=["props","getOpenDialogAriaText"],hun=["ownerState"],pun=["ownerState"],gun=t=>{var oe;let{props:e,getOpenDialogAriaText:n}=t,r=Dt(t,dun);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,autoFocus:x,localeText:b,reduceAnimations:w}=e,_=D.useRef(null),S=D.useRef(null),O=Jf(),k=((oe=o==null?void 0:o.toolbar)==null?void 0:oe.hidden)??!1,{open:E,actions:P,hasUIView:A,layoutProps:R,renderCurrentView:T,shouldRestoreFocus:M,fieldProps:I,contextValue:z,ownerState:F}=jVe(ve({},r,{props:e,fieldRef:S,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),N=i.inputAdornment??EPe,L=Zt({elementType:N,externalSlotProps:o==null?void 0:o.inputAdornment,additionalProps:{position:"end"},ownerState:e}),B=Dt(L,hun),$=i.openPickerButton??Gt,j=Zt({elementType:$,externalSlotProps:o==null?void 0:o.openPickerButton,additionalProps:{disabled:y||v,onClick:E?P.onClose:P.onOpen,"aria-label":n(I.value),edge:B.position},ownerState:e}),X=Dt(j,pun),V=i.openPickerIcon,Y=Zt({elementType:V,externalSlotProps:o==null?void 0:o.openPickerIcon,ownerState:F}),le=i.field,K=Zt({elementType:le,externalSlotProps:o==null?void 0:o.field,additionalProps:ve({},I,k&&{id:O},{readOnly:v,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p,autoFocus:x&&!e.open,focused:E?!0:void 0},m?{inputRef:m}:{}),ownerState:e});A&&(K.InputProps=ve({},K.InputProps,{ref:_},!e.disableOpenPicker&&{[`${B.position}Adornment`]:C.jsx(N,ve({},B,{children:C.jsx($,ve({},X,{children:C.jsx(V,ve({},Y))}))}))}));const ee=ve({textField:i.textField,clearIcon:i.clearIcon,clearButton:i.clearButton},K.slots),re=i.layout??GVe;let me=O;k&&(g?me=`${O}-label`:me=void 0);const te=ve({},o,{toolbar:ve({},o==null?void 0:o.toolbar,{titleId:O}),popper:ve({"aria-labelledby":me},o==null?void 0:o.popper)}),ae=dn(S,K.unstableFieldRef);return{renderPicker:()=>C.jsxs(bVe,{contextValue:z,localeText:b,children:[C.jsx(le,ve({},K,{slots:ee,slotProps:te,unstableFieldRef:ae})),C.jsx(qcn,ve({role:"dialog",placement:"bottom-start",anchorEl:_.current},P,{open:E,slots:i,slotProps:te,shouldRestoreFocus:M,reduceAnimations:w,children:C.jsx(re,ve({},R,te==null?void 0:te.layout,{slots:i,slotProps:te,children:T()}))}))]})}},mun=["views","format"],HVe=(t,e,n)=>{let{views:r,format:i}=e,o=Dt(e,mun);if(i)return i;const s=[],a=[];if(r.forEach(u=>{yC(u)?a.push(u):vC(u)&&s.push(u)}),a.length===0)return Pbe(t,ve({views:s},o));if(s.length===0)return Rbe(t,ve({views:a},o));const l=Rbe(t,ve({views:a},o));return`${Pbe(t,ve({views:s},o))} ${l}`},vun=(t,e,n)=>n?e.filter(r=>!TT(r)||r==="hours"):t?[...e,"meridiem"]:e,yun=(t,e)=>24*60/((t.hours??1)*(t.minutes??5))<=e;function xun({thresholdToRenderTimeInASingleColumn:t,ampm:e,timeSteps:n,views:r}){const i=t??24,o=ve({hours:1,minutes:5,seconds:5},n),s=yun(o,i);return{thresholdToRenderTimeInASingleColumn:i,timeSteps:o,shouldRenderTimeInASingleColumn:s,views:vun(e,r,s)}}function bun(t){return Xe("MuiTimeClock",t)}He("MuiTimeClock",["root","arrowSwitcher"]);const xC=220,mg=36,iP={x:xC/2,y:xC/2},qVe={x:iP.x,y:0},wun=qVe.x-iP.x,_un=qVe.y-iP.y,Sun=t=>t*(180/Math.PI),XVe=(t,e,n)=>{const r=e-iP.x,i=n-iP.y,o=Math.atan2(wun,_un)-Math.atan2(r,i);let s=Sun(o);s=Math.round(s/t)*t,s%=360;const a=Math.floor(s/t)||0,l=r**2+i**2,c=Math.sqrt(l);return{value:a,distance:c}},Cun=(t,e,n=1)=>{const r=n*6;let{value:i}=XVe(r,t,e);return i=i*n%60,i},Oun=(t,e,n)=>{const{value:r,distance:i}=XVe(30,t,e);let o=r||12;return n?o%=12:i{const{classes:e}=t;return qe({root:["root"],thumb:["thumb"]},Eun,e)},Aun=be("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({width:2,backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:t.transitions.create(["transform","height"])}}]})),Pun=be("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({width:4,height:4,backgroundColor:(t.vars||t).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${mg/2}px)`,border:`${(mg-4)/2}px solid ${(t.vars||t).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(t.vars||t).palette.primary.main}}]}));function Mun(t){const e=kn({props:t,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,viewValue:o}=e,s=Dt(e,Tun),a=D.useRef(i);D.useEffect(()=>{a.current=i},[i]);const l=ve({},e,{shouldAnimate:a.current!==i}),c=kun(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*xC),transform:`rotateZ(${d}deg)`}};return C.jsx(Aun,ve({style:u(),className:Oe(c.root,n),ownerState:l},s,{children:C.jsx(Pun,{ownerState:l,className:c.thumb})}))}function Run(t){return Xe("MuiClock",t)}He("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);const Dun=t=>{const{classes:e,meridiemMode:n}=t;return qe({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton",n==="am"&&"selected"],pmButton:["pmButton",n==="pm"&&"selected"],meridiemText:["meridiemText"]},Run,e)},Iun=be("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),Lun=be("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"}),$un=be("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),Fun=be("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(t,e)=>e.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),Nun=be("div",{name:"MuiClock",slot:"Pin",overridesResolver:(t,e)=>e.pin})(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),YVe=(t,e)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:mg,variants:[{props:{meridiemMode:e},style:{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:hover":{backgroundColor:(t.vars||t).palette.primary.light}}}]}),zun=be(Gt,{name:"MuiClock",slot:"AmButton",overridesResolver:(t,e)=>e.amButton})(({theme:t})=>ve({},YVe(t,"am"),{position:"absolute",left:8})),jun=be(Gt,{name:"MuiClock",slot:"PmButton",overridesResolver:(t,e)=>e.pmButton})(({theme:t})=>ve({},YVe(t,"pm"),{position:"absolute",right:8})),Gbe=be(Jt,{name:"MuiClock",slot:"meridiemText",overridesResolver:(t,e)=>e.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function Bun(t){const e=kn({props:t,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,value:s,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:f,selectedId:d,type:h,viewValue:p,disabled:g=!1,readOnly:m,className:v}=e,y=e,x=gr(),b=Ml(),w=D.useRef(!1),_=Dun(y),S=l(p,h),O=!n&&h==="hours"&&(p<1||p>12),k=(N,L)=>{g||m||l(N,h)||f(N,L)},E=(N,L)=>{let{offsetX:B,offsetY:$}=N;if(B===void 0){const X=N.target.getBoundingClientRect();B=N.changedTouches[0].clientX-X.left,$=N.changedTouches[0].clientY-X.top}const j=h==="seconds"||h==="minutes"?Cun(B,$,u):Oun(B,$,!!n);k(j,L)},P=N=>{w.current=!0,E(N,"shallow")},A=N=>{w.current&&(E(N,"finish"),w.current=!1)},R=N=>{N.buttons>0&&E(N.nativeEvent,"shallow")},T=N=>{w.current&&(w.current=!1),E(N.nativeEvent,"finish")},M=D.useMemo(()=>h==="hours"?!0:p%5===0,[h,p]),I=h==="minutes"?u:1,z=D.useRef(null);Ei(()=>{i&&z.current.focus()},[i]);const F=N=>{if(!w.current)switch(N.key){case"Home":k(0,"partial"),N.preventDefault();break;case"End":k(h==="minutes"?59:23,"partial"),N.preventDefault();break;case"ArrowUp":k(p+I,"partial"),N.preventDefault();break;case"ArrowDown":k(p-I,"partial"),N.preventDefault();break;case"PageUp":k(p+5,"partial"),N.preventDefault();break;case"PageDown":k(p-5,"partial"),N.preventDefault();break;case"Enter":case" ":k(p,"finish"),N.preventDefault();break}};return C.jsxs(Iun,{className:Oe(_.root,v),children:[C.jsxs(Lun,{className:_.clock,children:[C.jsx(Fun,{onTouchMove:P,onTouchStart:P,onTouchEnd:A,onMouseUp:T,onMouseMove:R,ownerState:{disabled:g},className:_.squareMask}),!S&&C.jsxs(D.Fragment,{children:[C.jsx(Nun,{className:_.pin}),s!=null&&C.jsx(Mun,{type:h,viewValue:p,isInner:O,hasSelected:M})]}),C.jsx($un,{"aria-activedescendant":d,"aria-label":b.clockLabelText(h,s,x,s==null?null:x.format(s,"fullTime")),ref:z,role:"listbox",onKeyDown:F,tabIndex:0,className:_.wrapper,children:o})]}),n&&r&&C.jsxs(D.Fragment,{children:[C.jsx(zun,{onClick:m?void 0:()=>a("am"),disabled:g||c===null,ownerState:y,className:_.amButton,title:tg(x,"am"),children:C.jsx(Gbe,{variant:"caption",className:_.meridiemText,children:tg(x,"am")})}),C.jsx(jun,{disabled:g||c===null,onClick:m?void 0:()=>a("pm"),ownerState:y,className:_.pmButton,title:tg(x,"pm"),children:C.jsx(Gbe,{variant:"caption",className:_.meridiemText,children:tg(x,"pm")})})]})]})}function Uun(t){return Xe("MuiClockNumber",t)}const xL=He("MuiClockNumber",["root","selected","disabled"]),Wun=["className","disabled","index","inner","label","selected"],Vun=t=>{const{classes:e,selected:n,disabled:r}=t;return qe({root:["root",n&&"selected",r&&"disabled"]},Uun,e)},Gun=be("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${xL.disabled}`]:e.disabled},{[`&.${xL.selected}`]:e.selected}]})(({theme:t})=>({height:mg,width:mg,position:"absolute",left:`calc((100% - ${mg}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(t.vars||t).palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:(t.vars||t).palette.background.paper},[`&.${xL.selected}`]:{color:(t.vars||t).palette.primary.contrastText},[`&.${xL.disabled}`]:{pointerEvents:"none",color:(t.vars||t).palette.text.disabled},variants:[{props:{inner:!0},style:ve({},t.typography.body2,{color:(t.vars||t).palette.text.secondary})}]}));function QVe(t){const e=kn({props:t,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:s,selected:a}=e,l=Dt(e,Wun),c=e,u=Vun(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(xC-mg-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return C.jsx(Gun,ve({className:Oe(u.root,n),"aria-disabled":r?!0:void 0,"aria-selected":a?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(xC-mg)/2}px`},ownerState:c},l,{children:s}))}const Hun=({ampm:t,value:e,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{const s=e?o.getHours(e):null,a=[],l=t?1:0,c=t?12:23,u=f=>s===null?!1:t?f===12?s===12||s===0:s===f||s-12===f:s===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);a.push(C.jsx(QVe,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return a},Hbe=({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(([s,a],l)=>{const c=s===e;return C.jsx(QVe,{label:a,id:c?i:void 0,index:l+1,inner:!1,disabled:n(s),selected:c,"aria-label":r(a)},s)})},zle=({value:t,referenceDate:e,utils:n,props:r,timezone:i})=>{const o=D.useMemo(()=>ia.getInitialReferenceValue({value:t,utils:n,props:r,referenceDate:e,granularity:xf.day,timezone:i,getTodayDate:()=>Mle(n,i,"date")}),[]);return t??o},qun=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],Xun=t=>{const{classes:e}=t;return qe({root:["root"],arrowSwitcher:["arrowSwitcher"]},bun,e)},Yun=be(TU,{name:"MuiTimeClock",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",position:"relative"}),Qun=be(NVe,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),Kun=["hours","minutes"],Zun=D.forwardRef(function(e,n){const r=gr(),i=kn({props:e,name:"MuiTimeClock"}),{ampm:o=r.is12HourCycleInCurrentLocale(),ampmInClock:s=!1,autoFocus:a,slots:l,slotProps:c,value:u,defaultValue:f,referenceDate:d,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:p,minTime:g,disableFuture:m,disablePast:v,minutesStep:y=1,shouldDisableTime:x,showViewSwitcher:b,onChange:w,view:_,views:S=Kun,openTo:O,onViewChange:k,focusedView:E,onFocusedViewChange:P,className:A,disabled:R,readOnly:T,timezone:M}=i,I=Dt(i,qun),{value:z,handleValueChange:F,timezone:N}=YO({name:"TimeClock",timezone:M,value:u,defaultValue:f,onChange:w,valueManager:ia}),L=zle({value:z,referenceDate:d,utils:r,props:i,timezone:N}),B=Ml(),$=P1(N),{view:j,setView:X,previousView:V,nextView:Y,setValueAndGoToNextView:le}=rD({view:_,views:S,openTo:O,onViewChange:k,onChange:F,focusedView:E,onFocusedViewChange:P}),{meridiemMode:K,handleMeridiemChange:ee}=Nle(L,o,le),re=D.useCallback((oe,ne)=>{const G=tD(h,r),q=ne==="hours"||ne==="minutes"&&S.includes("seconds"),Z=({start:xe,end:H})=>!(g&&G(g,H)||p&&G(xe,p)||m&&G(xe,$)||v&&G($,q?H:xe)),de=(xe,H=1)=>{if(xe%H!==0)return!1;if(x)switch(ne){case"hours":return!x(r.setHours(L,xe),"hours");case"minutes":return!x(r.setMinutes(L,xe),"minutes");case"seconds":return!x(r.setSeconds(L,xe),"seconds");default:return!1}return!0};switch(ne){case"hours":{const xe=nP(oe,K,o),H=r.setHours(L,xe),W=r.setSeconds(r.setMinutes(H,0),0),J=r.setSeconds(r.setMinutes(H,59),59);return!Z({start:W,end:J})||!de(xe)}case"minutes":{const xe=r.setMinutes(L,oe),H=r.setSeconds(xe,0),W=r.setSeconds(xe,59);return!Z({start:H,end:W})||!de(oe,y)}case"seconds":{const xe=r.setSeconds(L,oe);return!Z({start:xe,end:xe})||!de(oe)}default:throw new Error("not supported")}},[o,L,h,p,K,g,y,x,r,m,v,$,S]),me=Jf(),te=D.useMemo(()=>{switch(j){case"hours":{const oe=(ne,G)=>{const q=nP(ne,K,o);le(r.setHours(L,q),G,"hours")};return{onChange:oe,viewValue:r.getHours(L),children:Hun({value:z,utils:r,ampm:o,onChange:oe,getClockNumberText:B.hoursClockNumberText,isDisabled:ne=>R||re(ne,"hours"),selectedId:me})}}case"minutes":{const oe=r.getMinutes(L),ne=(G,q)=>{le(r.setMinutes(L,G),q,"minutes")};return{viewValue:oe,onChange:ne,children:Hbe({utils:r,value:oe,onChange:ne,getClockNumberText:B.minutesClockNumberText,isDisabled:G=>R||re(G,"minutes"),selectedId:me})}}case"seconds":{const oe=r.getSeconds(L),ne=(G,q)=>{le(r.setSeconds(L,G),q,"seconds")};return{viewValue:oe,onChange:ne,children:Hbe({utils:r,value:oe,onChange:ne,getClockNumberText:B.secondsClockNumberText,isDisabled:G=>R||re(G,"seconds"),selectedId:me})}}default:throw new Error("You must provide the type for ClockView")}},[j,r,z,o,B.hoursClockNumberText,B.minutesClockNumberText,B.secondsClockNumberText,K,le,L,re,me,R]),ae=i,U=Xun(ae);return C.jsxs(Yun,ve({ref:n,className:Oe(U.root,A),ownerState:ae},I,{children:[C.jsx(Bun,ve({autoFocus:a??!!E,ampmInClock:s&&S.includes("hours"),value:z,type:j,ampm:o,minutesStep:y,isTimeDisabled:re,meridiemMode:K,handleMeridiemChange:ee,selectedId:me,disabled:R,readOnly:T},te)),b&&C.jsx(Qun,{className:U.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>X(V),isPreviousDisabled:!V,previousLabel:B.openPreviousView,onGoToNext:()=>X(Y),isNextDisabled:!Y,nextLabel:B.openNextView,ownerState:ae})]}))});function Jun(t){return Xe("MuiDigitalClock",t)}const efn=He("MuiDigitalClock",["root","list","item"]),tfn=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],nfn=t=>{const{classes:e}=t;return qe({root:["root"],list:["list"],item:["item"]},Jun,e)},rfn=be(TU,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:MVe,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),ifn=be(w4,{name:"MuiDigitalClock",slot:"List",overridesResolver:(t,e)=>e.list})({padding:0}),ofn=be(Br,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.primary.main,t.palette.action.focusOpacity)}})),sfn=D.forwardRef(function(e,n){const r=gr(),i=D.useRef(null),o=dn(n,i),s=D.useRef(null),a=kn({props:e,name:"MuiDigitalClock"}),{ampm:l=r.is12HourCycleInCurrentLocale(),timeStep:c=30,autoFocus:u,slots:f,slotProps:d,value:h,defaultValue:p,referenceDate:g,disableIgnoringDatePartForTimeValidation:m=!1,maxTime:v,minTime:y,disableFuture:x,disablePast:b,minutesStep:w=1,shouldDisableTime:_,onChange:S,view:O,openTo:k,onViewChange:E,focusedView:P,onFocusedViewChange:A,className:R,disabled:T,readOnly:M,views:I=["hours"],skipDisabled:z=!1,timezone:F}=a,N=Dt(a,tfn),{value:L,handleValueChange:B,timezone:$}=YO({name:"DigitalClock",timezone:F,value:h,defaultValue:p,onChange:S,valueManager:ia}),j=Ml(),X=P1($),V=D.useMemo(()=>ve({},a,{alreadyRendered:!!i.current}),[a]),Y=nfn(V),le=(f==null?void 0:f.digitalClockItem)??ofn,K=Zt({elementType:le,externalSlotProps:d==null?void 0:d.digitalClockItem,ownerState:{},className:Y.item}),ee=zle({value:L,referenceDate:g,utils:r,props:a,timezone:$}),re=st(G=>B(G,"finish","hours")),{setValueAndGoToNextView:me}=rD({view:O,views:I,openTo:k,onViewChange:E,onChange:re,focusedView:P,onFocusedViewChange:A}),te=st(G=>{me(G,"finish")});D.useEffect(()=>{if(i.current===null)return;const G=i.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!G)return;const q=G.offsetTop;(u||P)&&G.focus(),i.current.scrollTop=q-4});const ae=D.useCallback(G=>{const q=tD(m,r),Z=()=>!(y&&q(y,G)||v&&q(G,v)||x&&q(G,X)||b&&q(X,G)),de=()=>r.getMinutes(G)%w!==0?!1:_?!_(G,"hours"):!0;return!Z()||!de()},[m,r,y,v,x,X,b,w,_]),U=D.useMemo(()=>{const G=r.startOfDay(ee);return[G,...Array.from({length:Math.ceil(24*60/c)-1},(q,Z)=>r.addMinutes(G,c*(Z+1)))]},[ee,c,r]),oe=U.findIndex(G=>r.isEqual(G,ee)),ne=G=>{switch(G.key){case"PageUp":{const q=J5(s.current)-5,Z=s.current.children,de=Math.max(0,q),xe=Z[de];xe&&xe.focus(),G.preventDefault();break}case"PageDown":{const q=J5(s.current)+5,Z=s.current.children,de=Math.min(Z.length-1,q),xe=Z[de];xe&&xe.focus(),G.preventDefault();break}}};return C.jsx(rfn,ve({ref:o,className:Oe(Y.root,R),ownerState:V},N,{children:C.jsx(ifn,{ref:s,role:"listbox","aria-label":j.timePickerToolbarTitle,className:Y.list,onKeyDown:ne,children:U.map((G,q)=>{if(z&&ae(G))return null;const Z=r.isEqual(G,L),de=r.format(G,l?"fullTime12h":"fullTime24h"),xe=oe===q||oe===-1&&q===0?0:-1;return C.jsx(le,ve({onClick:()=>!M&&te(G),selected:Z,disabled:T||ae(G),disableRipple:M,role:"option","aria-disabled":M,"aria-selected":Z,tabIndex:xe},K,{children:de}),de)})})}))});function afn(t){return Xe("MuiMultiSectionDigitalClock",t)}const qbe=He("MuiMultiSectionDigitalClock",["root"]);function lfn(t){return Xe("MuiMultiSectionDigitalClockSection",t)}const cfn=He("MuiMultiSectionDigitalClockSection",["root","item"]),ufn=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],ffn=t=>{const{classes:e}=t;return qe({root:["root"],item:["item"]},lfn,e)},dfn=be(w4,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({maxHeight:MVe,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),hfn=be(Br,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:8,margin:"2px 4px",width:kT,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.primary.main,t.palette.action.focusOpacity)}})),pfn=D.forwardRef(function(e,n){const r=D.useRef(null),i=dn(n,r),o=D.useRef(null),s=kn({props:e,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:a,onChange:l,className:c,disabled:u,readOnly:f,items:d,active:h,slots:p,slotProps:g,skipDisabled:m}=s,v=Dt(s,ufn),y=D.useMemo(()=>ve({},s,{alreadyRendered:!!r.current}),[s]),x=ffn(y),b=(p==null?void 0:p.digitalClockSectionItem)??hfn;D.useEffect(()=>{if(r.current===null)return;const S=r.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(h&&a&&S&&S.focus(),!S||o.current===S)return;o.current=S;const O=S.offsetTop;r.current.scrollTop=O-4});const w=d.findIndex(S=>S.isFocused(S.value)),_=S=>{switch(S.key){case"PageUp":{const O=J5(r.current)-5,k=r.current.children,E=Math.max(0,O),P=k[E];P&&P.focus(),S.preventDefault();break}case"PageDown":{const O=J5(r.current)+5,k=r.current.children,E=Math.min(k.length-1,O),P=k[E];P&&P.focus(),S.preventDefault();break}}};return C.jsx(dfn,ve({ref:i,className:Oe(x.root,c),ownerState:y,autoFocusItem:a&&h,role:"listbox",onKeyDown:_},v,{children:d.map((S,O)=>{var R;const k=(R=S.isDisabled)==null?void 0:R.call(S,S.value),E=u||k;if(m&&E)return null;const P=S.isSelected(S.value),A=w===O||w===-1&&O===0?0:-1;return C.jsx(b,ve({onClick:()=>!f&&l(S.value),selected:P,disabled:E,disableRipple:f,role:"option","aria-disabled":f||E||void 0,"aria-label":S.ariaLabel,"aria-selected":P,tabIndex:A,className:x.item},g==null?void 0:g.digitalClockSectionItem,{children:S.label}),S.label)})}))}),gfn=({now:t,value:e,utils:n,ampm:r,isDisabled:i,resolveAriaLabel:o,timeStep:s,valueOrReferenceDate:a})=>{const l=e?n.getHours(e):null,c=[],u=(h,p)=>{const g=p??l;return g===null?!1:r?h===12?g===12||g===0:g===h||g-12===h:g===h},f=h=>u(h,n.getHours(a)),d=r?11:23;for(let h=0;h<=d;h+=s){let p=n.format(n.setHours(t,h),r?"hours12h":"hours24h");const g=o(parseInt(p,10).toString());p=n.formatNumber(p),c.push({value:h,label:p,isSelected:u,isDisabled:i,isFocused:f,ariaLabel:g})}return c},Xbe=({value:t,utils:e,isDisabled:n,timeStep:r,resolveLabel:i,resolveAriaLabel:o,hasValue:s=!0})=>{const a=c=>t===null?!1:s&&t===c,l=c=>t===c;return[...Array.from({length:Math.ceil(60/r)},(c,u)=>{const f=r*u;return{value:f,label:e.formatNumber(i(f)),isDisabled:n,isSelected:a,isFocused:l,ariaLabel:o(f.toString())}})]},mfn=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],vfn=t=>{const{classes:e}=t;return qe({root:["root"]},afn,e)},yfn=be(TU,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(t.vars||t).palette.divider}`})),xfn=D.forwardRef(function(e,n){const r=gr(),i=Eo(),o=kn({props:e,name:"MuiMultiSectionDigitalClock"}),{ampm:s=r.is12HourCycleInCurrentLocale(),timeSteps:a,autoFocus:l,slots:c,slotProps:u,value:f,defaultValue:d,referenceDate:h,disableIgnoringDatePartForTimeValidation:p=!1,maxTime:g,minTime:m,disableFuture:v,disablePast:y,minutesStep:x=1,shouldDisableTime:b,onChange:w,view:_,views:S=["hours","minutes"],openTo:O,onViewChange:k,focusedView:E,onFocusedViewChange:P,className:A,disabled:R,readOnly:T,skipDisabled:M=!1,timezone:I}=o,z=Dt(o,mfn),{value:F,handleValueChange:N,timezone:L}=YO({name:"MultiSectionDigitalClock",timezone:I,value:f,defaultValue:d,onChange:w,valueManager:ia}),B=Ml(),$=P1(L),j=D.useMemo(()=>ve({hours:1,minutes:5,seconds:5},a),[a]),X=zle({value:F,referenceDate:h,utils:r,props:o,timezone:L}),V=st((Z,de,xe)=>N(Z,de,xe)),Y=D.useMemo(()=>!s||!S.includes("hours")||S.includes("meridiem")?S:[...S,"meridiem"],[s,S]),{view:le,setValueAndGoToNextView:K,focusedView:ee}=rD({view:_,views:Y,openTo:O,onViewChange:k,onChange:V,focusedView:E,onFocusedViewChange:P}),re=st(Z=>{K(Z,"finish","meridiem")}),{meridiemMode:me,handleMeridiemChange:te}=Nle(X,s,re,"finish"),ae=D.useCallback((Z,de)=>{const xe=tD(p,r),H=de==="hours"||de==="minutes"&&Y.includes("seconds"),W=({start:se,end:ye})=>!(m&&xe(m,ye)||g&&xe(se,g)||v&&xe(se,$)||y&&xe($,H?ye:se)),J=(se,ye=1)=>{if(se%ye!==0)return!1;if(b)switch(de){case"hours":return!b(r.setHours(X,se),"hours");case"minutes":return!b(r.setMinutes(X,se),"minutes");case"seconds":return!b(r.setSeconds(X,se),"seconds");default:return!1}return!0};switch(de){case"hours":{const se=nP(Z,me,s),ye=r.setHours(X,se),ie=r.setSeconds(r.setMinutes(ye,0),0),fe=r.setSeconds(r.setMinutes(ye,59),59);return!W({start:ie,end:fe})||!J(se)}case"minutes":{const se=r.setMinutes(X,Z),ye=r.setSeconds(se,0),ie=r.setSeconds(se,59);return!W({start:ye,end:ie})||!J(Z,x)}case"seconds":{const se=r.setSeconds(X,Z);return!W({start:se,end:se})||!J(Z)}default:throw new Error("not supported")}},[s,X,p,g,me,m,x,b,r,v,y,$,Y]),U=D.useCallback(Z=>{switch(Z){case"hours":return{onChange:de=>{const xe=nP(de,me,s);K(r.setHours(X,xe),"finish","hours")},items:gfn({now:$,value:F,ampm:s,utils:r,isDisabled:de=>ae(de,"hours"),timeStep:j.hours,resolveAriaLabel:B.hoursClockNumberText,valueOrReferenceDate:X})};case"minutes":return{onChange:de=>{K(r.setMinutes(X,de),"finish","minutes")},items:Xbe({value:r.getMinutes(X),utils:r,isDisabled:de=>ae(de,"minutes"),resolveLabel:de=>r.format(r.setMinutes($,de),"minutes"),timeStep:j.minutes,hasValue:!!F,resolveAriaLabel:B.minutesClockNumberText})};case"seconds":return{onChange:de=>{K(r.setSeconds(X,de),"finish","seconds")},items:Xbe({value:r.getSeconds(X),utils:r,isDisabled:de=>ae(de,"seconds"),resolveLabel:de=>r.format(r.setSeconds($,de),"seconds"),timeStep:j.seconds,hasValue:!!F,resolveAriaLabel:B.secondsClockNumberText})};case"meridiem":{const de=tg(r,"am"),xe=tg(r,"pm");return{onChange:te,items:[{value:"am",label:de,isSelected:()=>!!F&&me==="am",isFocused:()=>!!X&&me==="am",ariaLabel:de},{value:"pm",label:xe,isSelected:()=>!!F&&me==="pm",isFocused:()=>!!X&&me==="pm",ariaLabel:xe}]}}default:throw new Error(`Unknown view: ${Z} found.`)}},[$,F,s,r,j.hours,j.minutes,j.seconds,B.hoursClockNumberText,B.minutesClockNumberText,B.secondsClockNumberText,me,K,X,ae,te]),oe=D.useMemo(()=>{if(!i)return Y;const Z=Y.filter(de=>de!=="meridiem");return Z.reverse(),Y.includes("meridiem")&&Z.push("meridiem"),Z},[i,Y]),ne=D.useMemo(()=>Y.reduce((Z,de)=>ve({},Z,{[de]:U(de)}),{}),[Y,U]),G=o,q=vfn(G);return C.jsx(yfn,ve({ref:n,className:Oe(q.root,A),ownerState:G,role:"group"},z,{children:oe.map(Z=>C.jsx(pfn,{items:ne[Z].items,onChange:ne[Z].onChange,active:le===Z,autoFocus:l??ee===Z,disabled:R,readOnly:T,slots:c,slotProps:u,skipDisabled:M,"aria-label":B.selectViewText(Z)},Z))}))}),Q9=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:_,sx:S,autoFocus:O,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:E,timezone:P})=>C.jsx(Zun,{view:t,onViewChange:e,focusedView:n&&yC(n)?n:null,onFocusedViewChange:r,views:i.filter(yC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:_,sx:S,autoFocus:O,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:E,timezone:P}),bfn=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:P})=>C.jsx(sfn,{view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i.filter(yC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeStep:k==null?void 0:k.minutes,skipDisabled:E,timezone:P}),Ybe=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:P})=>C.jsx(xfn,{view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i.filter(yC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:P}),wfn=D.forwardRef(function(e,n){var g;const r=Eo(),{toolbar:i,tabs:o,content:s,actionBar:a,shortcuts:l}=UVe(e),{sx:c,className:u,isLandscape:f,classes:d}=e,h=a&&(((g=a.props.actions)==null?void 0:g.length)??0)>0,p=ve({},e,{isRtl:r});return C.jsxs(WVe,{ref:n,className:Oe(hf.root,d==null?void 0:d.root,u),sx:[{[`& .${hf.tabs}`]:{gridRow:4,gridColumn:"1 / 4"},[`& .${hf.actionBar}`]:{gridRow:5}},...Array.isArray(c)?c:[c]],ownerState:p,children:[f?l:i,f?i:l,C.jsxs(VVe,{className:Oe(hf.contentWrapper,d==null?void 0:d.contentWrapper),sx:{display:"grid"},children:[s,o,h&&C.jsx(zf,{sx:{gridRow:3,gridColumn:"1 / 4"}})]}),a]})}),_fn=["openTo","focusedView","timeViewsCount"],Sfn=function(e,n,r){var u,f;const{openTo:i,focusedView:o,timeViewsCount:s}=r,a=Dt(r,_fn),l=ve({},a,{focusedView:null,sx:[{[`&.${qbe.root}`]:{borderBottom:0},[`&.${qbe.root}, .${cfn.root}, &.${efn.root}`]:{maxHeight:EU}}]}),c=TT(n);return C.jsxs(D.Fragment,{children:[(u=e[c?"day":n])==null?void 0:u.call(e,ve({},r,{view:c?"day":n,focusedView:o&&vC(o)?o:null,views:r.views.filter(vC),sx:[{gridColumn:1},...l.sx]})),s>0&&C.jsxs(D.Fragment,{children:[C.jsx(zf,{orientation:"vertical",sx:{gridColumn:2}}),(f=e[c?n:"hours"])==null?void 0:f.call(e,ve({},l,{view:c?n:"hours",focusedView:o&&TT(o)?o:null,openTo:TT(i)?i:"hours",views:r.views.filter(TT),sx:[{gridColumn:3},...l.sx]}))]})]})},KVe=D.forwardRef(function(e,n){var y,x,b,w;const r=Ml(),i=gr(),o=RVe(e,"MuiDesktopDateTimePicker"),{shouldRenderTimeInASingleColumn:s,thresholdToRenderTimeInASingleColumn:a,views:l,timeSteps:c}=xun(o),u=s?bfn:Ybe,f=ve({day:J_,month:J_,year:J_,hours:u,minutes:u,seconds:u,meridiem:u},o.viewRenderers),d=o.ampmInClock??!0,p=((y=f.hours)==null?void 0:y.name)===Ybe.name?l:l.filter(_=>_!=="meridiem"),g=s?[]:["accept"],m=ve({},o,{viewRenderers:f,format:HVe(i,o),views:p,yearsPerRow:o.yearsPerRow??4,ampmInClock:d,timeSteps:c,thresholdToRenderTimeInASingleColumn:a,shouldRenderTimeInASingleColumn:s,slots:ve({field:kVe,layout:wfn,openPickerIcon:Dsn},o.slots),slotProps:ve({},o.slotProps,{field:_=>{var S;return ve({},nA((S=o.slotProps)==null?void 0:S.field,_),mVe(o),{ref:n})},toolbar:ve({hidden:!0,ampmInClock:d,toolbarVariant:"desktop"},(x=o.slotProps)==null?void 0:x.toolbar),tabs:ve({hidden:!0},(b=o.slotProps)==null?void 0:b.tabs),actionBar:_=>{var S;return ve({actions:g},nA((S=o.slotProps)==null?void 0:S.actionBar,_))}})}),{renderPicker:v}=gun({props:m,valueManager:ia,valueType:"date-time",getOpenDialogAriaText:vVe({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(w=m.localeText)==null?void 0:w.openDatePickerDialogue}),validator:_U,rendererInterceptor:Sfn});return v()});KVe.propTypes={ampm:ge.bool,ampmInClock:ge.bool,autoFocus:ge.bool,className:ge.string,closeOnSelect:ge.bool,dayOfWeekFormatter:ge.func,defaultValue:ge.object,disabled:ge.bool,disableFuture:ge.bool,disableHighlightToday:ge.bool,disableIgnoringDatePartForTimeValidation:ge.bool,disableOpenPicker:ge.bool,disablePast:ge.bool,displayWeekNumber:ge.bool,enableAccessibleFieldDOMStructure:ge.any,fixedWeekNumber:ge.number,format:ge.string,formatDensity:ge.oneOf(["dense","spacious"]),inputRef:FAe,label:ge.node,loading:ge.bool,localeText:ge.object,maxDate:ge.object,maxDateTime:ge.object,maxTime:ge.object,minDate:ge.object,minDateTime:ge.object,minTime:ge.object,minutesStep:ge.number,monthsPerRow:ge.oneOf([3,4]),name:ge.string,onAccept:ge.func,onChange:ge.func,onClose:ge.func,onError:ge.func,onMonthChange:ge.func,onOpen:ge.func,onSelectedSectionsChange:ge.func,onViewChange:ge.func,onYearChange:ge.func,open:ge.bool,openTo:ge.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:ge.oneOf(["landscape","portrait"]),readOnly:ge.bool,reduceAnimations:ge.bool,referenceDate:ge.object,renderLoading:ge.func,selectedSections:ge.oneOfType([ge.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),ge.number]),shouldDisableDate:ge.func,shouldDisableMonth:ge.func,shouldDisableTime:ge.func,shouldDisableYear:ge.func,showDaysOutsideCurrentMonth:ge.bool,skipDisabled:ge.bool,slotProps:ge.object,slots:ge.object,sx:ge.oneOfType([ge.arrayOf(ge.oneOfType([ge.func,ge.object,ge.bool])),ge.func,ge.object]),thresholdToRenderTimeInASingleColumn:ge.number,timeSteps:ge.shape({hours:ge.number,minutes:ge.number,seconds:ge.number}),timezone:ge.string,value:ge.object,view:ge.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:ge.shape({day:ge.func,hours:ge.func,meridiem:ge.func,minutes:ge.func,month:ge.func,seconds:ge.func,year:ge.func}),views:ge.arrayOf(ge.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:ge.oneOf(["asc","desc"]),yearsPerRow:ge.oneOf([3,4])};const Cfn=be(ed)({[`& .${ZT.container}`]:{outline:0},[`& .${ZT.paper}`]:{outline:0,minWidth:OU}}),Ofn=be(Nf)({"&:first-of-type":{padding:0}});function Efn(t){const{children:e,onDismiss:n,open:r,slots:i,slotProps:o}=t,s=(i==null?void 0:i.dialog)??Cfn,a=(i==null?void 0:i.mobileTransition)??eO;return C.jsx(s,ve({open:r,onClose:n},o==null?void 0:o.dialog,{TransitionComponent:a,TransitionProps:o==null?void 0:o.mobileTransition,PaperComponent:i==null?void 0:i.mobilePaper,PaperProps:o==null?void 0:o.mobilePaper,children:C.jsx(Ofn,{children:e})}))}const Tfn=["props","getOpenDialogAriaText"],kfn=t=>{var B;let{props:e,getOpenDialogAriaText:n}=t,r=Dt(t,Tfn);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,localeText:x}=e,b=D.useRef(null),w=Jf(),_=((B=o==null?void 0:o.toolbar)==null?void 0:B.hidden)??!1,{open:S,actions:O,layoutProps:k,renderCurrentView:E,fieldProps:P,contextValue:A}=jVe(ve({},r,{props:e,fieldRef:b,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),R=i.field,T=Zt({elementType:R,externalSlotProps:o==null?void 0:o.field,additionalProps:ve({},P,_&&{id:w},!(y||v)&&{onClick:O.onOpen,onKeyDown:Csn(O.onOpen)},{readOnly:v??!0,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p},m?{inputRef:m}:{}),ownerState:e});T.inputProps=ve({},T.inputProps,{"aria-label":n(P.value)});const M=ve({textField:i.textField},T.slots),I=i.layout??GVe;let z=w;_&&(g?z=`${w}-label`:z=void 0);const F=ve({},o,{toolbar:ve({},o==null?void 0:o.toolbar,{titleId:w}),mobilePaper:ve({"aria-labelledby":z},o==null?void 0:o.mobilePaper)}),N=dn(b,T.unstableFieldRef);return{renderPicker:()=>C.jsxs(bVe,{contextValue:A,localeText:x,children:[C.jsx(R,ve({},T,{slots:M,slotProps:F,unstableFieldRef:N})),C.jsx(Efn,ve({},O,{open:S,slots:i,slotProps:F,children:C.jsx(I,ve({},k,F==null?void 0:F.layout,{slots:i,slotProps:F,children:E()}))}))]})}},ZVe=D.forwardRef(function(e,n){var u,f,d;const r=Ml(),i=gr(),o=RVe(e,"MuiMobileDateTimePicker"),s=ve({day:J_,month:J_,year:J_,hours:Q9,minutes:Q9,seconds:Q9},o.viewRenderers),a=o.ampmInClock??!1,l=ve({},o,{viewRenderers:s,format:HVe(i,o),ampmInClock:a,slots:ve({field:kVe},o.slots),slotProps:ve({},o.slotProps,{field:h=>{var p;return ve({},nA((p=o.slotProps)==null?void 0:p.field,h),mVe(o),{ref:n})},toolbar:ve({hidden:!1,ampmInClock:a},(u=o.slotProps)==null?void 0:u.toolbar),tabs:ve({hidden:!1},(f=o.slotProps)==null?void 0:f.tabs)})}),{renderPicker:c}=kfn({props:l,valueManager:ia,valueType:"date-time",getOpenDialogAriaText:vVe({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(d=l.localeText)==null?void 0:d.openDatePickerDialogue}),validator:_U});return c()});ZVe.propTypes={ampm:ge.bool,ampmInClock:ge.bool,autoFocus:ge.bool,className:ge.string,closeOnSelect:ge.bool,dayOfWeekFormatter:ge.func,defaultValue:ge.object,disabled:ge.bool,disableFuture:ge.bool,disableHighlightToday:ge.bool,disableIgnoringDatePartForTimeValidation:ge.bool,disableOpenPicker:ge.bool,disablePast:ge.bool,displayWeekNumber:ge.bool,enableAccessibleFieldDOMStructure:ge.any,fixedWeekNumber:ge.number,format:ge.string,formatDensity:ge.oneOf(["dense","spacious"]),inputRef:FAe,label:ge.node,loading:ge.bool,localeText:ge.object,maxDate:ge.object,maxDateTime:ge.object,maxTime:ge.object,minDate:ge.object,minDateTime:ge.object,minTime:ge.object,minutesStep:ge.number,monthsPerRow:ge.oneOf([3,4]),name:ge.string,onAccept:ge.func,onChange:ge.func,onClose:ge.func,onError:ge.func,onMonthChange:ge.func,onOpen:ge.func,onSelectedSectionsChange:ge.func,onViewChange:ge.func,onYearChange:ge.func,open:ge.bool,openTo:ge.oneOf(["day","hours","minutes","month","seconds","year"]),orientation:ge.oneOf(["landscape","portrait"]),readOnly:ge.bool,reduceAnimations:ge.bool,referenceDate:ge.object,renderLoading:ge.func,selectedSections:ge.oneOfType([ge.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),ge.number]),shouldDisableDate:ge.func,shouldDisableMonth:ge.func,shouldDisableTime:ge.func,shouldDisableYear:ge.func,showDaysOutsideCurrentMonth:ge.bool,slotProps:ge.object,slots:ge.object,sx:ge.oneOfType([ge.arrayOf(ge.oneOfType([ge.func,ge.object,ge.bool])),ge.func,ge.object]),timezone:ge.string,value:ge.object,view:ge.oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:ge.shape({day:ge.func,hours:ge.func,minutes:ge.func,month:ge.func,seconds:ge.func,year:ge.func}),views:ge.arrayOf(ge.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:ge.oneOf(["asc","desc"]),yearsPerRow:ge.oneOf([3,4])};const Afn=["desktopModeMediaQuery"],Pfn=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:i=Osn}=r,o=Dt(r,Afn);return Tee(i,{defaultMatches:!0})?C.jsx(KVe,ve({ref:n},o)):C.jsx(ZVe,ve({ref:n},o))}),Mfn=t=>({dateTimePicker:{marginTop:t.spacing(2)}}),Rfn=({classes:t,hasTimeDimension:e,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?Cgt(d):null)},s=C.jsx(Fy,{shrink:!0,htmlFor:"time-select",children:`${pe.get("Time")} (UTC)`}),l=typeof n=="number"?uW(n):null;let c,u;Array.isArray(r)&&(c=uW(r[0]),u=uW(r[1]));const f=C.jsx(iVe,{dateAdapter:jon,children:C.jsx(Pfn,{disabled:!e,className:t.dateTimePicker,format:"yyyy-MM-dd hh:mm:ss",value:l,minDateTime:c,maxDateTime:u,onChange:o,ampm:!1,slotProps:{textField:{variant:"standard",size:"small"}},viewRenderers:{hours:null,minutes:null,seconds:null}})});return C.jsx(eP,{label:s,control:f})},Dfn=Don(Mfn)(Rfn),Ifn=t=>({locale:t.controlState.locale,hasTimeDimension:!!mO(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Lfn={selectTime:sU},$fn=Rn(Ifn,Lfn)(Dfn),Qbe=5,Ffn={box:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(Qbe),marginRight:t.spacing(Qbe),minWidth:200}),label:{color:"grey",fontSize:"1em"}};function Nfn({hasTimeDimension:t,selectedTime:e,selectTime:n,selectedTimeRange:r}){const[i,o]=D.useState(e);if(D.useEffect(()=>{o(e||(r?r[0]:0))},[e,r]),!t)return null;const s=(f,d)=>{typeof d=="number"&&o(d)},a=(f,d)=>{n&&typeof d=="number"&&n(d)},l=Array.isArray(r);l||(r=[Date.now()-2*ADe.years,Date.now()]);const c=[{value:r[0],label:fA(r[0])},{value:r[1],label:fA(r[1])}];function u(f){return sO(f)}return C.jsx(ot,{sx:Ffn.box,children:C.jsx(Mt,{arrow:!0,title:pe.get("Select time in dataset"),children:C.jsx(t1,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:s,onChangeCommitted:a,size:"small"})})})}const zfn=t=>({locale:t.controlState.locale,hasTimeDimension:!!mO(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),jfn={selectTime:sU,selectTimeRange:S8e},Bfn=Rn(zfn,jfn)(Nfn),Ufn=lt(C.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),Wfn=lt(C.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),Vfn=lt(C.jsx("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Gfn=lt(C.jsx("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Hfn=lt(C.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"),qfn=lt(C.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"),dw={formControl:t=>({marginTop:t.spacing(2.5),marginLeft:t.spacing(1),marginRight:t.spacing(1)}),iconButton:{padding:"2px"}};function Xfn({timeAnimationActive:t,timeAnimationInterval:e,updateTimeAnimation:n,selectedTime:r,selectedTimeRange:i,selectTime:o,incSelectedTime:s}){const a=D.useRef(null);D.useEffect(()=>(p(),m));const l=()=>{s(1)},c=()=>{n(!t,e)},u=()=>{s(1)},f=()=>{s(-1)},d=()=>{o(i?i[0]:null)},h=()=>{o(i?i[1]:null)},p=()=>{t?g():m()},g=()=>{m(),a.current=window.setInterval(l,e)},m=()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},v=typeof r=="number",y=t?C.jsx(Hfn,{}):C.jsx(qfn,{}),x=C.jsx(Gt,{disabled:!v,onClick:c,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Auto-step through times in the dataset"),children:y})}),b=C.jsx(Gt,{disabled:!v||t,onClick:d,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("First time step"),children:C.jsx(Vfn,{})})}),w=C.jsx(Gt,{disabled:!v||t,onClick:f,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Previous time step"),children:C.jsx(Ufn,{})})}),_=C.jsx(Gt,{disabled:!v||t,onClick:u,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Next time step"),children:C.jsx(Wfn,{})})}),S=C.jsx(Gt,{disabled:!v||t,onClick:h,size:"small",sx:dw.iconButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Last time step"),children:C.jsx(Gfn,{})})});return C.jsx(td,{sx:dw.formControl,variant:"standard",children:C.jsxs(ot,{children:[b,w,x,_,S]})})}const Yfn=t=>({locale:t.controlState.locale,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,timeAnimationActive:t.controlState.timeAnimationActive,timeAnimationInterval:t.controlState.timeAnimationInterval}),Qfn={selectTime:sU,incSelectedTime:cZt,updateTimeAnimation:fZt},Kfn=Rn(Yfn,Qfn)(Xfn),Zfn=lt(C.jsx("path",{d:"M16 20H2V4h14zm2-12h4V4h-4zm0 12h4v-4h-4zm0-6h4v-4h-4z"}),"ViewSidebar"),Jfn=oa(td)(({theme:t})=>({marginTop:t.spacing(2),marginRight:t.spacing(.5),marginLeft:"auto"}));function edn({visible:t,sidebarOpen:e,setSidebarOpen:n,openDialog:r,allowRefresh:i,updateResources:o,allowSharing:s,shareStatePermalink:a,compact:l}){if(!t)return null;const c=C.jsx(xr,{value:"sidebar",selected:e,onClick:()=>n(!e),size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Show or hide sidebar"),children:C.jsx(Zfn,{})})});let u,f,d,h;return l&&(u=i&&C.jsx(Gt,{onClick:o,size:"small",children:C.jsx(Mt,{arrow:!0,title:pe.get("Refresh"),children:C.jsx(rRe,{})})}),f=s&&C.jsx(Gt,{onClick:a,size:"small",children:C.jsx(Mt,{arrow:!0,title:pe.get("Share"),children:C.jsx(iRe,{})})}),d=Pn.instance.branding.allowDownloads&&C.jsx(Gt,{onClick:()=>r("export"),size:"small",children:C.jsx(Mt,{arrow:!0,title:pe.get("Export data"),children:C.jsx(oRe,{})})}),h=C.jsx(Gt,{onClick:()=>r("settings"),size:"small",children:C.jsx(Mt,{arrow:!0,title:pe.get("Settings"),children:C.jsx(nRe,{})})})),C.jsx(Jfn,{variant:"standard",children:C.jsxs(ot,{children:[u,f,d,h,c]})})}const tdn=t=>({locale:t.controlState.locale,visible:!!(t.controlState.selectedDatasetId||t.controlState.selectedPlaceId),sidebarOpen:t.controlState.sidebarOpen,compact:Pn.instance.branding.compact,allowRefresh:Pn.instance.branding.allowRefresh,allowSharing:Pn.instance.branding.allowSharing}),ndn={setSidebarOpen:cle,openDialog:T1,updateResources:BUe,shareStatePermalink:jUe},rdn=Rn(tdn,ndn)(edn),idn=t=>({locale:t.controlState.locale,show:t.dataState.datasets.length>0}),odn={},sdn=({show:t})=>t?C.jsxs(Ynn,{children:[C.jsx(ern,{}),C.jsx(crn,{}),C.jsx(prn,{}),C.jsx(wrn,{}),C.jsx(Mrn,{}),C.jsx($fn,{}),C.jsx(Kfn,{}),C.jsx(Bfn,{}),C.jsx(rdn,{})]}):null,adn=Rn(idn,odn)(sdn);function JVe(t){const e=D.useRef(null),n=D.useRef(o=>{if(o.buttons===1&&e.current!==null){o.preventDefault();const{screenX:s,screenY:a}=o,[l,c]=e.current,u=[s-l,a-c];e.current=[s,a],t(u)}}),r=D.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=D.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 Kbe={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 ldn({dir:t,onChange:e}){const r=JVe(([i,o])=>{e(i)});return C.jsx(ot,{sx:t==="hor"?Kbe.hor:Kbe.ver,onMouseDown:r})}const bL={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 cdn({dir:t,splitPosition:e,setSplitPosition:n,children:r,style:i,child1Style:o,child2Style:s}){const a=D.useRef(null);if(!r||!Array.isArray(r)||r.length!==2)return null;const l=t==="hor"?bL.childHor:bL.childVer,c=t==="hor"?{width:e}:{height:e},u=f=>{a.current&&yr(a.current.clientWidth)&&n(a.current.clientWidth+f)};return C.jsxs("div",{id:"SplitPane",style:{...i,...t==="hor"?bL.hor:bL.ver},children:[C.jsx("div",{ref:a,id:"SplitPane-Child-1",style:{...l,...o,...c},children:r[0]}),C.jsx(ldn,{dir:t,onChange:u}),C.jsx("div",{id:"SplitPane-Child-2",style:{...l,...s},children:r[1]})]})}const udn=({placeGroup:t,mapProjection:e,visible:n})=>{const r=D.useRef(new GM);return D.useEffect(()=>{const i=r.current,o=t.features;if(o.length===0)i.clear();else{const s=i.getFeatures(),a=new Set(s.map(f=>f.getId())),l=new Set(o.map(f=>f.id)),c=o.filter(f=>!a.has(f.id));s.filter(f=>!l.has(f.getId()+"")).forEach(f=>i.removeFeature(f)),c.forEach(f=>{const d=new s1().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,g=(f.properties||{}).source?"diamond":"circle";Zae(d,h,nte(p),g),i.addFeature(d)})}},[t,e]),C.jsx(z4,{id:t.id,opacity:t.id===wf?1:.8,visible:n,zIndex:501,source:r.current})};class fdn extends dO{addMapObject(e){const n=new H0t(this.getOptions());return e.addControl(n),n}updateMapObject(e,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(e,n){e.removeControl(n)}}class K9 extends dO{addMapObject(e){const n=new _xt(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 ddn extends dO{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 jd({...this.props,center:T4(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});e.getLayers().forEach(s=>{s instanceof L4&&s.getSource().forEachFeature(a=>{var l;(l=a.getGeometry())==null||l.transform(r,n)})}),e.setView(o)}else e.getView().setProperties(this.props);return e.getView()}}function wL(t,e){const n=t.getLayers();for(let r=0;r{if(R){const B=O||null;if(B!==M&&Hs[Z9]){const j=Hs[Z9].getSource();if(j.clear(),B){const X=vdn(R,B);if(X){const V=X.clone();V.setId("select-"+X.getId()),V.setStyle(void 0),j.addFeature(V)}}I(B)}}},[R,O,M]),D.useEffect(()=>{R&&R.getLayers().forEach(B=>{B instanceof oDe?B.getSource().changed():B.changed()})},[R,E]),D.useEffect(()=>{if(R===null||!yr(P))return;const B=ee=>{Jbe(R,ee,P,0)},$=ee=>{Jbe(R,ee,P,1)},j=ee=>{ee.context.restore()},X=wL(R,"rgb2"),V=wL(R,"variable2"),Y=wL(R,"rgb"),le=wL(R,"variable"),K=[[X,B],[V,B],[Y,$],[le,$]];for(const[ee,re]of K)ee&&(ee.on("prerender",re),ee.on("postrender",j));return()=>{for(const[ee,re]of K)ee&&(ee.un("prerender",re),ee.un("postrender",j))}});const z=B=>{if(n==="Select"){const $=B.map;let j=null;const X=$.getFeaturesAtPixel(B.pixel);if(X){for(const V of X)if(typeof V.getId=="function"){j=V.getId()+"";break}}S&&S(j,k,!1)}},F=B=>{var $;if(R!==null&&y&&n!=="Select"){const j=B.feature;let X=j.getGeometry();if(!X)return;const V=Uf(iO+n.toLowerCase()+"-"),Y=R.getView().getProjection();if(X instanceof Qte){const te=lpt(X);j.setGeometry(te)}X=j.clone().getGeometry().transform(Y,nO);const le=new s1().writeGeometryObject(X);j.setId(V);let K=0;if(Hs[wf]){const te=Hs[wf],ae=($=te==null?void 0:te.getSource())==null?void 0:$.getFeatures();ae&&(K=ae.length)}const ee=ydn(b,n),re=ab(K),me=UPe(re,t.palette.mode);Zae(j,me,nte()),y(v,V,{label:ee,color:re},le,!0)}return!0};function N(B){A&&A(B),T(B)}const L=B=>{x&&B.forEach($=>{const j=new FileReader;j.onloadend=()=>{typeof j.result=="string"&&x(j.result)},j.readAsText($,"UTF-8")})};return C.jsx(eRe,{children:C.jsxs(fbt,{id:e,onClick:B=>z(B),onMapRef:N,mapObjects:Hs,isStale:!0,onDropFiles:L,children:[C.jsx(ddn,{id:"view",projection:r}),C.jsxs(iDe,{children:[i,o,s,a,l,f,c,C.jsx(z4,{id:Z9,opacity:.7,zIndex:500,style:gdn,source:hdn}),C.jsx(C.Fragment,{children:b.map(B=>C.jsx(udn,{placeGroup:B,mapProjection:r,visible:_&&w[B.id]},B.id))})]}),u,C.jsx(K9,{id:"drawPoint",layerId:wf,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:F}),C.jsx(K9,{id:"drawPolygon",layerId:wf,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:F}),C.jsx(K9,{id:"drawCircle",layerId:wf,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:F}),d,h,g,m,p,C.jsx(fdn,{bar:!1})]})})}function vdn(t,e){var n;for(const r of t.getLayers().getArray())if(r instanceof L4){const o=(n=r.getSource())==null?void 0:n.getFeatureById(e);if(o)return o}return null}function ydn(t,e){const n=pe.get(e),r=t.find(i=>i.id===wf);if(r)for(let i=1;;i++){const o=`${n} ${i}`;if(!!!r.features.find(a=>a.properties?a.properties.label===o:!1))return o}return`${n} 1`}function Jbe(t,e,n,r){const i=t.getSize();if(!i)return;const o=i[0],s=i[1];let a,l,c,u;r===0?(a=hm(e,[0,0]),l=hm(e,[n,0]),c=hm(e,[0,s]),u=hm(e,[n,s])):(a=hm(e,[n,0]),l=hm(e,[o,0]),c=hm(e,[n,s]),u=hm(e,[o,s]));const f=e.context;f.save(),f.beginPath(),f.moveTo(a[0],a[1]),f.lineTo(c[0],c[1]),f.lineTo(u[0],u[1]),f.lineTo(l[0],l[1]),f.closePath(),f.clip()}const _L=1,oP=.2,QO=240,t9e=20,SL={container:{width:QO},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 xdn({categories:t,onOpenColorBarEditor:e}){return!t||t.length===0?null:C.jsx(ot,{sx:SL.container,children:t.map((n,r)=>C.jsxs(ot,{onClick:e,sx:SL.itemContainer,children:[C.jsx(ot,{sx:SL.itemColorBox,style:{backgroundColor:n.color}}),C.jsx(ot,{component:"span",sx:SL.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const e1e={nominal:{cursor:"pointer"},error:{cursor:"pointer",border:"0.5px solid red"}};function bdn({colorBar:t,opacity:e,width:n,height:r,onClick:i}){const o=D.useRef(null);D.useEffect(()=>{const c=o.current;c!==null&&g_t(t,e,c)},[t,e]);const{baseName:s,imageData:a}=t,l=a?s:pe.get("Unknown color bar")+`: ${s}`;return C.jsx(Mt,{title:l,children:C.jsx("canvas",{ref:o,width:n||QO,height:r||t9e+4,onClick:i,style:a?e1e.nominal:e1e.error})})}function wdn(t,e,n=5,r=!1,i=!1){return GQ(Sdn(t,e,n,r),i)}function GQ(t,e=!1){return t.map(n=>by(n,void 0,e))}function by(t,e,n){if(e===void 0&&(e=n?2:_dn(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 _dn(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 Sdn(t,e,n,r){const i=new Array(n);if(r){const o=Math.log10(t),a=(Math.log10(e)-o)/(n-1);for(let l=1;lwdn(t,e,n,r),[t,e,n,r]);return C.jsx(ot,{sx:Cdn.container,onClick:i,children:o.map((s,a)=>C.jsx("span",{children:s},a))})}const Edn=lt(C.jsx("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress"),t1e=t=>t,Tdn=t=>Math.pow(10,t),kdn=Math.log10,n1e=(t,e)=>typeof t=="number"?e(t):t.map(e);class Adn{constructor(e){gn(this,"_fn");gn(this,"_invFn");e?(this._fn=kdn,this._invFn=Tdn):(this._fn=t1e,this._invFn=t1e)}scale(e){return n1e(e,this._fn)}scaleInv(e){return n1e(e,this._invFn)}}function Pdn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const s=D.useMemo(()=>new Adn(n==="log"),[n]),[a,l]=D.useState(()=>s.scale(e));D.useEffect(()=>{l(s.scale(e))},[s,e]);const c=(k,E)=>{Array.isArray(E)&&l(E)},u=(k,E)=>{if(Array.isArray(E)){const A=GQ(s.scaleInv(E)).map(R=>Number.parseFloat(R));i(t,A,n,r)}},[f,d]=s.scale(o),h=f=2?v=Math.max(2,Math.round(m/2)):(v=4,m=8);const y=f({value:S[E],label:k}));return C.jsx(t1,{min:b,max:w,value:a,marks:O,step:_,valueLabelFormat:k=>by(s.scaleInv(k)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const J9=5,bm={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(J9),marginRight:t.spacing(J9),minWidth:320,width:`calc(100% - ${t.spacing(2*(J9+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 Mdn({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o}){const[s,a]=D.useState(n),[l,c]=D.useState(n),[u,f]=D.useState(r1e(n)),[d,h]=D.useState([!1,!1]);D.useEffect(()=>{f(r1e(n))},[n]);const p=y=>{const x=y.target.value;f([x,u[1]]);const b=Number.parseFloat(x);let w=!1;if(!Number.isNaN(b)&&b{const x=y.target.value;f([u[0],x]);const b=Number.parseFloat(x);let w=!1;if(!Number.isNaN(b)&&b>s[0]){if(b!==s[1]){const _=[s[0],b];a(_),c(_),o(e,_,r,i)}}else w=!0;h([d[0],w])},m=()=>{const y=t.colorRecords,x=y[0].value,b=y[y.length-1].value,w=[x,b];a(w),c(w),o(e,w,r,i),h([!1,!1])},v=(y,x)=>{o(e,n,x?"log":"lin",i)};return C.jsxs(ot,{sx:bm.container,children:[C.jsxs(ot,{sx:bm.header,children:[C.jsx(Jt,{sx:bm.title,children:pe.get("Value Range")}),C.jsx("span",{style:{flexGrow:1}}),t.colorRecords&&C.jsx(au,{sx:{marginRight:1},icon:C.jsx(Edn,{}),onClick:m,tooltipText:pe.get("Set min/max from color mapping values")}),C.jsx(sg,{sx:bm.logLabel,control:C.jsx(Mt,{title:pe.get("Logarithmic scaling"),children:C.jsx(Zee,{checked:r==="log",onChange:v,size:"small"})}),label:C.jsx(Jt,{variant:"body2",children:pe.get("Log-scaled")}),labelPlacement:"start"})]}),C.jsx(ot,{sx:bm.sliderBox,children:C.jsx(Pdn,{variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),C.jsxs(ot,{component:"form",sx:bm.minMaxBox,children:[C.jsx(Jr,{sx:bm.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),C.jsx(Jr,{sx:bm.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>g(y)})]})]})}function r1e(t){return[t[0]+"",t[1]+""]}function Rdn({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o,onOpenColorBarEditor:s}){const[a,l]=D.useState(null),c=f=>{l(f.currentTarget)},u=()=>{l(null)};return C.jsxs(C.Fragment,{children:[C.jsx(bdn,{colorBar:t,opacity:i,onClick:s}),C.jsx(Odn,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),C.jsx(e1,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:C.jsx(Mdn,{variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}const Ddn=lt(C.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"),Idn=lt(C.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"),_2={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 Ldn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const s=()=>{const c=!r.isAlpha;t=uN({...r,isAlpha:c}),o(t,e,n,i)},a=()=>{const c=!r.isReversed;t=uN({...r,isReversed:c}),o(t,e,n,i)},l=(c,u)=>{o(t,e,n,u)};return C.jsxs(C.Fragment,{children:[C.jsx(ot,{sx:_2.container,children:C.jsxs(ot,{sx:_2.settingsBar,children:[C.jsx(Mt,{arrow:!0,title:pe.get("Hide small values"),children:C.jsx(xr,{value:"alpha",selected:r.isAlpha,onChange:s,size:"small",children:C.jsx(Idn,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Reverse"),children:C.jsx(xr,{value:"reverse",selected:r.isReversed,onChange:a,size:"small",children:C.jsx(Ddn,{fontSize:"inherit"})})})]})}),C.jsxs(ot,{component:"div",sx:_2.opacityContainer,children:[C.jsx(ot,{component:"span",fontSize:"small",sx:_2.opacityLabel,children:pe.get("Opacity")}),C.jsx(t1,{min:0,max:1,value:i,step:.01,sx:_2.opacitySlider,onChange:l,size:"small"})]})]})}const $dn={colorBarGroupTitle:t=>({marginTop:t.spacing(2*oP),fontSize:"small",color:t.palette.text.secondary})};function n9e({title:t,description:e}){return C.jsx(Mt,{arrow:!0,title:e,placement:"left",children:C.jsx(ot,{sx:$dn.colorBarGroupTitle,children:t})})}const i1e=t=>({marginTop:t.spacing(oP),height:20,borderWidth:1,borderStyle:"solid",cursor:"pointer"}),o1e={colorBarItem:t=>({...i1e(t),borderColor:t.palette.mode==="dark"?"lightgray":"darkgray"}),colorBarItemSelected:t=>({...i1e(t),borderColor:"blue"})};function jle({imageData:t,selected:e,onSelect:n,width:r,title:i}){let o=C.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=C.jsx(Mt,{arrow:!0,title:i,placement:"left",children:o})),C.jsx(ot,{width:r||QO,sx:e?o1e.colorBarItemSelected:o1e.colorBarItem,children:o})}function Fdn({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,images:r}){return C.jsxs(C.Fragment,{children:[C.jsx(n9e,{title:t.title,description:t.description}),t.names.map(i=>C.jsx(jle,{title:i,imageData:r[i],selected:i===e,onSelect:()=>n(i)},i))]})}const kU=lt(C.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 r9e(){const t=D.useRef(),e=D.useRef(()=>{t.current&&(t.current(),t.current=void 0)}),n=D.useRef(r=>{t.current=r});return D.useEffect(()=>e.current,[]),[e.current,n.current]}const Ndn=lt(C.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"),zdn=lt(C.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function jdn({anchorEl:t,markdownText:e,open:n,onClose:r}){return e?C.jsx(e1,{anchorEl:t,open:n,onClose:r,children:C.jsx(kl,{sx:{width:"32em",overflowY:"auto",fontSize:"smaller",paddingLeft:2,paddingRight:2},children:C.jsx(Cle,{text:e})})}):null}function i9e({size:t,helpUrl:e}){const[n,r]=D.useState(null),i=D.useRef(null),o=Ole(e),s=()=>{r(i.current)},a=()=>{r(null)};return C.jsxs(C.Fragment,{children:[C.jsx(Gt,{onClick:s,size:t,ref:i,children:C.jsx(tRe,{fontSize:"inherit"})}),C.jsx(jdn,{anchorEl:n,open:!!n,onClose:a,markdownText:o})]})}const s1e={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function iD({onDone:t,onCancel:e,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return C.jsxs(ot,{sx:s1e.container,children:[C.jsx(ot,{children:o&&C.jsx(i9e,{size:i,helpUrl:o})}),C.jsxs(ot,{sx:s1e.doneCancel,children:[C.jsx(Gt,{onClick:t,color:"primary",disabled:n,size:i,children:C.jsx(zdn,{fontSize:"inherit"})}),C.jsx(Gt,{onClick:e,color:"primary",disabled:r,size:i,children:C.jsx(Ndn,{fontSize:"inherit"})})]})]})}const e7={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},Bdn=[["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 Udn({colorMapType:t,setColorMapType:e}){return C.jsx(_4,{row:!0,value:t,onChange:(n,r)=>{e(r)},sx:e7.radioGroup,children:Bdn.map(([n,r,i])=>C.jsx(Mt,{arrow:!0,title:pe.get(i),children:C.jsx(sg,{value:n,control:C.jsx(F_,{size:"small",sx:e7.radio}),label:C.jsx(ot,{component:"span",sx:e7.label,children:pe.get(r)})})},n))})}function Wdn({userColorBar:t,updateUserColorBar:e,selected:n,onSelect:r,onDone:i,onCancel:o}){const s=l=>{e({...t,code:l.currentTarget.value})},a=l=>{e({...t,type:l})};return C.jsxs(ot,{children:[C.jsx(jle,{imageData:t.imageData,title:t.errorMessage,selected:n,onSelect:r}),C.jsx(Udn,{colorMapType:t.type,setColorMapType:a}),C.jsx(Jr,{label:"Color mapping",placeholder:hRe,multiline:!0,fullWidth:!0,size:"small",minRows:3,sx:{marginTop:1,fontFamily:"monospace"},value:t.code,onChange:s,color:t.errorMessage?"error":"primary",inputProps:{style:{fontFamily:"monospace",fontSize:12}}}),C.jsx(iD,{onDone:i,onCancel:o,doneDisabled:!!t.errorMessage,size:"small",helpUrl:pe.get("docs/color-mappings.en.md")})]})}const Vdn=lt(C.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"),Gdn={container:{display:"flex",alignItems:"center",width:QO,height:t9e,gap:oP,marginTop:oP}};function Hdn({imageData:t,title:e,selected:n,onEdit:r,onRemove:i,onSelect:o,disabled:s}){const[a,l]=D.useState(null),c=p=>{l(p.currentTarget)},u=()=>{l(null)},f=()=>{l(null),r()},d=()=>{l(null),i()},h=!!a;return C.jsxs(C.Fragment,{children:[C.jsxs(ot,{sx:Gdn.container,children:[C.jsx(jle,{imageData:t,selected:n,onSelect:o,width:QO-20,title:e}),C.jsx(Gt,{size:"small",onClick:c,children:C.jsx(Vdn,{fontSize:"inherit"})})]}),C.jsx(e1,{anchorOrigin:{vertical:"center",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},open:h,anchorEl:a,onClose:u,children:C.jsxs(ot,{children:[C.jsx(Gt,{onClick:f,size:"small",disabled:s,children:C.jsx(qO,{fontSize:"inherit"})}),C.jsx(Gt,{onClick:d,size:"small",disabled:s,children:C.jsx(xU,{fontSize:"inherit"})})]})})]})}const qdn={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function Xdn({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,userColorBars:r,addUserColorBar:i,removeUserColorBar:o,updateUserColorBar:s,updateUserColorBars:a,storeSettings:l}){const[c,u]=D.useState({}),[f,d]=r9e(),h=D.useMemo(()=>r.findIndex(x=>x.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>a(r));const x=Uf("ucb");i(x),u({action:"add",colorBarId:x})},g=x=>{d(()=>a(r)),u({action:"edit",colorBarId:x})},m=x=>{d(void 0),o(x)},v=()=>{d(void 0),u({}),l()},y=()=>{f(),u({})};return C.jsxs(C.Fragment,{children:[C.jsxs(ot,{sx:qdn.container,children:[C.jsx(n9e,{title:pe.get(t.title),description:pe.get(t.description)}),C.jsx(Gt,{onClick:p,size:"small",color:"primary",disabled:!!c.action,children:C.jsx(kU,{fontSize:"inherit"})})]}),r.map(x=>x.id===c.colorBarId&&h>=0?C.jsx(Wdn,{userColorBar:x,updateUserColorBar:s,selected:x.id===e,onSelect:()=>n(x.id),onDone:v,onCancel:y},x.id):C.jsx(Hdn,{imageData:x.imageData,title:x.errorMessage,disabled:!!c.action,selected:x.id===e,onSelect:()=>n(x.id),onEdit:()=>g(x.id),onRemove:()=>m(x.id)},x.id))]})}function Ydn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o,colorBars:s,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d}){const h=p=>{t=uN({...r,baseName:p}),o(t,e,n,i)};return C.jsx(C.Fragment,{children:s.groups.map(p=>p.title===dRe?C.jsx(Xdn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):C.jsx(Fdn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:s.images},p.title))})}const Qdn={colorBarBox:t=>({marginTop:t.spacing(_L-2*oP),marginLeft:t.spacing(_L),marginRight:t.spacing(_L),marginBottom:t.spacing(_L)})};function Kdn(t){const{colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s,...a}=t;return C.jsxs(ot,{sx:Qdn.colorBarBox,children:[C.jsx(Ldn,{...a}),C.jsx(Ydn,{...a,colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s})]})}const a1e={container:t=>({position:"absolute",zIndex:1e3,top:10,borderRadius:"5px",borderWidth:"1px",borderStyle:"solid",borderColor:"#00000020",backgroundColor:"#FFFFFFAA",color:"black",maxWidth:`${QO+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 o9e(t){const{variableName:e,variableTitle:n,variableUnits:r,variableColorBar:i,style:o}=t,s=D.useRef(null),[a,l]=D.useState(null),c=()=>{l(s.current)},u=()=>{l(null)};if(!e)return null;const f=i.type==="categorical"?n||e:`${n||e} (${r||"-"})`;return C.jsxs(ot,{sx:a1e.container,style:o,ref:s,children:[C.jsx(Jt,{sx:a1e.title,children:f}),i.type==="categorical"?C.jsx(xdn,{categories:i.colorRecords,onOpenColorBarEditor:c,...t}):C.jsx(Rdn,{onOpenColorBarEditor:c,...t}),C.jsx(e1,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:C.jsx(Kdn,{...t})})]})}const Zdn=t=>({variableName:a1(t),variableTitle:X_t(t),variableUnits:Q_t(t),variableColorBarName:U4(t),variableColorBarMinMax:UDe(t),variableColorBarNorm:GDe(t),variableColorBar:une(t),variableOpacity:KDe(t),userColorBars:l1(t),colorBars:V4(t),style:{right:10}}),Jdn={updateVariableColorBar:WKt,addUserColorBar:V8e,removeUserColorBar:q8e,updateUserColorBar:X8e,updateUserColorBars:K8e,storeSettings:W8e},ehn=Rn(Zdn,Jdn)(o9e),thn=t=>{const e=t.controlState.variableSplitPos;return{variableName:e?sne(t):null,variableTitle:Y_t(t),variableUnits:K_t(t),variableColorBarName:W4(t),variableColorBarMinMax:WDe(t),variableColorBarNorm:HDe(t),variableColorBar:XDe(t),variableOpacity:ZDe(t),userColorBars:l1(t),colorBars:V4(t),style:{left:e?e-280:0}}},nhn={updateVariableColorBar:VKt,addUserColorBar:V8e,removeUserColorBar:q8e,updateUserColorBar:X8e,updateUserColorBars:K8e,storeSettings:W8e},rhn=Rn(thn,nhn)(o9e),ihn={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 ohn({hidden:t,position:e,onPositionChange:n}){const r=D.useRef(null),i=D.useRef(([s,a])=>{r.current!==null&&n(r.current.offsetLeft+s)}),o=JVe(i.current);return D.useEffect(()=>{!t&&!yr(e)&&r.current!==null&&r.current.parentElement!==null&&n(Math.round(r.current.parentElement.clientWidth/2))},[t,e,n]),t?null:C.jsx(ot,{id:"MapSplitter",ref:r,sx:ihn.splitter,style:{left:yr(e)?e:"50%"},onMouseDown:o})}const shn=t=>({hidden:!t.controlState.variableCompareMode,position:t.controlState.variableSplitPos}),ahn={onPositionChange:aZt},lhn=Rn(shn,ahn)(ohn);function chn(t,e,n,r,i,o,s){const a=D.useRef(0),[l,c]=D.useState(),[u,f]=D.useState(),[d,h]=D.useState(),p=D.useCallback(async(v,y,x,b,w)=>{w({dataset:v,variable:y,result:{fetching:!0}});try{const _=await lvt(e,v,y,x,b,s,null);console.info(y.name,"=",_),w({dataset:v,variable:y,result:{value:_.value}})}catch(_){w({dataset:v,variable:y,result:{error:_}})}},[e,s]),g=D.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],w=T4(v.coordinate,y.getView().getProjection().getCode(),"EPSG:4326"),_=w[0],S=w[1];c({pixelX:x,pixelY:b,lon:_,lat:S});const O=new Date().getTime();O-a.current>=500&&(a.current=O,p(n,r,_,S,f).finally(()=>{i&&o&&p(i,o,_,S,h)}))},[p,t,n,r,i,o]),m=Hs.map;return D.useEffect(()=>{if(t&&m){const v=y=>{y.dragging?c(void 0):g(y)};return m.on("pointermove",v),()=>{m.un("pointermove",v)}}else c(void 0)},[t,m,g]),D.useMemo(()=>l&&u?{location:l,payload:u,payload2:d}:null,[l,u,d])}const gp={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function uhn({location:t,payload:e,payload2:n}){return C.jsxs(ot,{sx:gp.container,children:[C.jsx(ot,{sx:gp.labelItem,children:"Longitude"}),C.jsx(ot,{sx:gp.valueItem,children:by(t.lon,4)}),C.jsx(ot,{sx:gp.labelItem,children:"Latitude"}),C.jsx(ot,{sx:gp.valueItem,children:by(t.lat,4)}),C.jsx(ot,{sx:gp.labelItem,children:l1e(e)}),C.jsx(ot,{sx:gp.valueItem,children:c1e(e)}),n&&C.jsx(ot,{sx:gp.labelItem,children:l1e(n)}),n&&C.jsx(ot,{sx:gp.valueItem,children:c1e(n)})]})}function l1e(t){const e=t.variable;return e.title||e.name}function c1e(t){const e=t.result;return e.error?`${e.error}`:e.fetching?"...":yr(e.value)?by(e.value,4):"---"}const fhn={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function dhn({enabled:t,serverUrl:e,dataset1:n,variable1:r,dataset2:i,variable2:o,time:s}){const a=chn(t,e,n,r,i,o,s);if(!a)return null;const{pixelX:l,pixelY:c}=a.location;return C.jsx(ot,{sx:{...fhn.container,left:l,top:c},children:C.jsx(uhn,{...a})})}const hhn=t=>({enabled:t.controlState.mapPointInfoBoxEnabled,serverUrl:zi(t).url,dataset1:fo(t),variable1:za(t),dataset2:Wy(t),variable2:qg(t),time:c1(t)}),phn={},ghn=Rn(hhn,phn)(dhn),mhn=lt(C.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"),s9e=lt(C.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"),vhn=lt(C.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"),u1e={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function yhn({style:t,sx:e,children:n}){return C.jsx(ot,{className:"ol-unselectable ol-control",sx:e,style:t?{...u1e,...t}:u1e,children:n})}const a9e={width:"1.375em",height:"1.375em"},xhn={...a9e,backgroundColor:"rgba(0,80,180,0.9)"},bhn={tooltip:{sx:{backgroundColor:"#4A4A4A",border:"1px solid white",borderRadius:0}}};function t7({icon:t,tooltipTitle:e,onClick:n,selected:r,onSelect:i}){const o=s=>{i&&i(s,!r),n&&n(s)};return e&&(t=C.jsx(Mt,{title:e,componentsProps:bhn,children:t})),C.jsx(Gt,{onClick:o,style:r?xhn:a9e,children:t})}const whn={left:"0.5em",top:65};function _hn({layerMenuOpen:t,setLayerMenuOpen:e,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o}){return C.jsxs(yhn,{style:whn,children:[C.jsx(t7,{icon:C.jsx(s9e,{fontSize:"small"}),tooltipTitle:pe.get("Show or hide layers panel"),selected:t,onSelect:(s,a)=>void e(a)}),C.jsx(t7,{icon:C.jsx(mhn,{fontSize:"small"}),tooltipTitle:pe.get("Turn layer split mode on or off"),selected:n,onSelect:(s,a)=>void r(a)}),C.jsx(t7,{icon:C.jsx(vhn,{fontSize:"small"}),tooltipTitle:pe.get("Turn info box on or off"),selected:i,onSelect:(s,a)=>void o(a)})]})}const Shn=t=>({layerMenuOpen:t.controlState.layerMenuOpen,variableCompareMode:t.controlState.variableCompareMode,mapPointInfoBoxEnabled:t.controlState.mapPointInfoBoxEnabled}),Chn={setLayerMenuOpen:k8e,setVariableCompareMode:sZt,setMapPointInfoBoxEnabled:oZt},Ohn=Rn(Shn,Chn)(_hn),Ehn=(t,e)=>({mapId:"map",locale:t.controlState.locale,variableLayer:_St(t),variable2Layer:SSt(t),rgbLayer:CSt(t),rgb2Layer:OSt(t),datasetBoundaryLayer:wSt(t),placeGroupLayers:ASt(t),colorBarLegend:C.jsx(ehn,{}),colorBarLegend2:C.jsx(rhn,{}),mapSplitter:C.jsx(lhn,{}),mapPointInfoBox:C.jsx(ghn,{}),mapControlActions:C.jsx(Ohn,{}),userDrawnPlaceGroupName:t.controlState.userDrawnPlaceGroupName,userPlaceGroups:XM(t),userPlaceGroupsVisibility:rSt(t),showUserPlaces:LDe(t),mapInteraction:t.controlState.mapInteraction,mapProjection:Uy(t),selectedPlaceId:t.controlState.selectedPlaceId,places:KM(t),baseMapLayer:DSt(t),overlayLayer:ISt(t),imageSmoothing:QM(t),variableSplitPos:t.controlState.variableSplitPos,onMapRef:e.onMapRef}),Thn={addDrawnUserPlace:wKt,importUserPlacesFromText:VUe,selectPlace:oU},f1e=Rn(Ehn,Thn)(mdn),l9e=lt(C.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"),khn=lt(C.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"),Ahn=lt(C.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.95s.33.5.56.69c.24.18.51.32.82.41q.45.15.96.15c.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72.2-.61.2-.97c0-.19-.02-.38-.07-.56s-.12-.35-.23-.51c-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33s.27-.27.37-.42.17-.3.22-.46.07-.32.07-.48q0-.54-.18-.96t-.51-.69c-.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.3q0-.255.09-.45c.09-.195.14-.25.25-.34s.23-.17.38-.22.3-.08.48-.08c.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49s-.14.27-.25.37-.25.18-.41.24-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4s.1.35.1.57c0 .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-.27s.84-.43 1.16-.76.57-.73.74-1.19c.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57q-.27-.705-.75-1.2m-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85s-.43.41-.71.53q-.435.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"),Phn=({contribution:t,panelIndex:e})=>{const n=t.componentResult;return n.status==="pending"?C.jsx(Ly,{},t.name):n.error?C.jsx("div",{children:C.jsx(Jt,{color:"error",children:n.error.message})},t.name):t.component?C.jsx(IIe,{...t.component,onChange:r=>{uCt("panels",e,r)}},t.name):null},Mhn=lt(C.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"),Rhn=lt(C.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"),Dhn=lt(C.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"),Ihn=lt(C.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),Lhn=lt(C.jsx("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");let ar=class c9e{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]=bC(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),Xd.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]=bC(this,e,n);let r=[];return this.decompose(e,n,r,0),Xd.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 Sk(this),o=new Sk(e);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new Sk(this,e)}iterRange(e,n=this.length){return new u9e(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 f9e(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]?c9e.empty:e.length<=32?new Wi(e):Xd.from(Wi.split(e,[]))}};class Wi extends ar{constructor(e,n=$hn(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 s=this.text[o],a=i+s.length;if((n?r:a)>=e)return new Fhn(i,a,r,s);i=a+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Wi(d1e(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),a=z3(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new Wi(a,s.length+o.length));else{let l=a.length>>1;r.push(new Wi(a.slice(0,l)),new Wi(a.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Wi))return super.replace(e,n,r);[e,n]=bC(this,e,n);let i=z3(this.text,z3(r.text,d1e(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Wi(i,o):Xd.from(Wi.split(i,[]),o)}sliceString(e,n=this.length,r=` `){[e,n]=bC(this,e,n);let i="";for(let o=0,s=0;o<=n&&se&&s&&(i+=r),eo&&(i+=a.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 Wi(r,i)),r=[],i=-1);return i>-1&&n.push(new Wi(r,i)),n}}class Xd extends ar{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 s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=e)return s.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let o=0,s=0;s<=n&&o=s){let c=i&((s<=e?1:0)|(l>=n?2:0));s>=e&&l<=n&&!c?r.push(a):a.decompose(e-s,n-s,r,c)}s=l+1}}replace(e,n,r){if([e,n]=bC(this,e,n),r.lines=o&&n<=a){let l=s.replace(e-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Xd(u,this.length-(n-e)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` -`){[e,n]=bC(this,e,n);let i="";for(let o=0,s=0;oe&&o&&(i+=r),es&&(i+=a.sliceString(e-s,n-s,r)),s=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Xd))return 0;let r=0,[i,o,s,a]=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==s||o==a)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 Wi(h,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof Xd)for(let g of h.children)f(g);else h.lines>s&&(l>s||!l)?(d(),a.push(h)):h instanceof Wi&&l&&(p=u[u.length-1])instanceof Wi&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Wi(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&&(a.push(u.length==1?u[0]:Xd.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new Xd(a,n)}}ar.empty=new Wi([""],0);function $hn(t){let e=-1;for(let n of t)e+=n.length+1;return e}function z3(t,e,n=0,r=1e9){for(let i=0,o=0,s=!0;o=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof Wi?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],s=o>>1,a=i instanceof Wi?i.text.length:i.children.length;if(s==(n>0?a: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 Wi){let l=i.text[s+(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[s+(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 Wi?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 u9e{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Ck(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 f9e{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"&&(ar.prototype[Symbol.iterator]=function(){return this.iter()},Ck.prototype[Symbol.iterator]=u9e.prototype[Symbol.iterator]=f9e.prototype[Symbol.iterator]=function(){return this});let Fhn=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 bC(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let eS="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 eS[e-1]<=t;return!1}function h1e(t){return t>=127462&&t<=127487}const p1e=8205;function ms(t,e,n=!0,r=!0){return(n?d9e:zhn)(t,e,r)}function d9e(t,e,n){if(e==t.length)return e;e&&h9e(t.charCodeAt(e))&&p9e(t.charCodeAt(e-1))&&e--;let r=as(t,e);for(e+=Zc(r);e=0&&h1e(as(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function zhn(t,e,n){for(;e>0;){let r=d9e(t,e-2,n);if(r=56320&&t<57344}function p9e(t){return t>=55296&&t<56320}function as(t,e){let n=t.charCodeAt(e);if(!p9e(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return h9e(r)?(n-55296<<10)+(r-56320)+65536:n}function Ble(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Zc(t){return t<65536?1:2}const HQ=/\r\n?|\n/;var fs=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(fs||(fs={}));class _h{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return o+(e-i);o+=a}else{if(r!=fs.Simple&&c>=e&&(r==fs.TrackDel&&ie||r==fs.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!a)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&&a>=e)return in?"cover":!0;i=a}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 _h(e)}static create(e){return new _h(e)}}class mo extends _h{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 qQ(this,(n,r,i,o,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return XQ(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length0&&wv(r,n,o.text),o.forward(u),a+=u}let c=e[s++];for(;a>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;sd||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?ar.of(h.split(r||HQ)):h:ar.empty,g=p.length;if(f==d&&g==0)return;fs&&Us(i,f-s,-1),Us(i,d-f,g),wv(o,i,p),s=d}}return c(e),l(!a),a}static empty(e){return new mo(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;ia&&typeof s!="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 wv(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(i,c,o,u,f),i=c,o=u}}}function XQ(t,e,n,r=!1){let i=[],o=r?[]:null,s=new aP(t),a=new aP(e);for(let l=-1;;)if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);Us(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len=0&&l=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.lenl||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class aP{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?ar.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?ar.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 bx{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 bx(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Ve.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ve.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 Ve.range(e.anchor,e.head)}static create(e,n,r){return new bx(e,n,r)}}class Ve{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ve.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 Ve(e.ranges.map(n=>bx.fromJSON(n)),e.main)}static single(e,n=e){return new Ve([Ve.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?Ve.range(l,a):Ve.range(a,l))}}return new Ve(e,n)}}function m9e(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Ule=0;class St{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Ule++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new St(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:Wle),!!e.static,e.enables)}of(e){return new j3([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new j3(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new j3(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function Wle(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class j3{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=Ule++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=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[s]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||YQ(f,u)){let h=r(f);if(a?!g1e(h,f.values[s],i):!i(h,f.values[s]))return f.values[s]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let g=tz(d,p);if(this.dependencies.every(m=>m instanceof St?d.facet(m)===f.facet(m):m instanceof Ko?d.field(m,!1)==f.field(m,!1):!0)||(a?g1e(h=r(f),g,i):i(h=r(f),g)))return f.values[s]=g,0}else h=r(f);return f.values[s]=h,1}}}}function g1e(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)),s=t[e.id]>>1;function a(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(m1e).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],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,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,m1e.of({field:this,create:e})]}get extension(){return this}}const ox={lowest:4,low:3,default:2,high:1,highest:0};function C2(t){return e=>new v9e(e,t)}const o0={highest:C2(ox.highest),high:C2(ox.high),default:C2(ox.default),low:C2(ox.low),lowest:C2(ox.lowest)};class v9e{constructor(e,n){this.inner=e,this.prec=n}}class AU{of(e){return new QQ(this,e)}reconfigure(e){return AU.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class QQ{constructor(e,n){this.compartment=e,this.inner=n}}class ez{constructor(e,n,r,i,o,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],o=Object.create(null),s=new Map;for(let d of Bhn(e,n,s))d instanceof Ko?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[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,g=u&&u[d]||[];if(h.every(m=>m.type==0))if(a[p.id]=l.length<<1|1,Wle(g,h))l.push(r.facet(p));else{let m=p.combine(h.map(v=>v.value));l.push(r&&p.compare(m,r.facet(p))?r.facet(p):m)}else{for(let m of h)m.type==0?(a[m.id]=l.length<<1|1,l.push(m.value)):(a[m.id]=c.length<<1,c.push(v=>m.dynamicSlot(v)));a[p.id]=c.length<<1,c.push(m=>jhn(m,p,h))}}let f=c.map(d=>d(a));return new ez(e,s,f,a,l,o)}}function Bhn(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof QQ&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof QQ){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof v9e)o(s.inner,s.prec);else if(s instanceof Ko)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof j3)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,ox.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(t,ox.default),r.reduce((s,a)=>s.concat(a))}function Ok(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 tz(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const y9e=St.define(),KQ=St.define({combine:t=>t.some(e=>e),static:!0}),x9e=St.define({combine:t=>t.length?t[0]:void 0,static:!0}),b9e=St.define(),w9e=St.define(),_9e=St.define(),S9e=St.define({combine:t=>t.length?t[0]:!1});class tp{constructor(e,n){this.type=e,this.value=n}static define(){return new Uhn}}class Uhn{of(e){return new tp(this,e)}}class Whn{constructor(e){this.map=e}of(e){return new rn(this,e)}}class rn{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 rn(this.type,n)}is(e){return this.type==e}static define(e={}){return new Whn(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}}rn.reconfigure=rn.define();rn.appendConfig=rn.define();class ao{constructor(e,n,r,i,o,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&m9e(r,n.newLength),o.some(a=>a.type==ao.time)||(this.annotations=o.concat(ao.time.of(Date.now())))}static create(e,n,r,i,o,s){return new ao(e,n,r,i,o,s)}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(ao.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}ao.time=tp.define();ao.userEvent=tp.define();ao.addToHistory=tp.define();ao.remote=tp.define();function Vhn(t,e){let n=[];for(let r=0,i=0;;){let o,s;if(r=t[r]))o=t[r++],s=t[r++];else if(i=0;i--){let o=r[i](t);o instanceof ao?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof ao?t=o[0]:t=O9e(e,tS(o),!1)}return t}function Hhn(t){let e=t.startState,n=e.facet(_9e),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=C9e(r,ZQ(e,o,t.changes.newLength),!0))}return r==t?t:ao.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const qhn=[];function tS(t){return t==null?qhn:Array.isArray(t)?t:[t]}var mi=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(mi||(mi={}));const Xhn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let JQ;try{JQ=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Yhn(t){if(JQ)return JQ.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Xhn.test(n)))return!0}return!1}function Qhn(t){return e=>{if(!/\S/.test(e))return mi.Space;if(Yhn(e))return mi.Word;for(let n=0;n-1)return mi.Word;return mi.Other}}class In{constructor(e,n,r,i,o,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;ai.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(rn.reconfigure)?(n=null,r=a.value):a.is(rn.appendConfig)&&(n=null,r=tS(r).concat(a.value));let o;n?o=e.startState.values.slice():(n=ez.resolve(r,i,this),o=new In(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(KQ)?e.newSelection:e.newSelection.asSingle();new In(n,e.newDoc,s,o,(a,l)=>l.update(a,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:Ve.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=tS(r.effects);for(let a=1;as.spec.fromJSON(a,l)))}}return In.create({doc:e.doc,selection:Ve.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=ez.resolve(e.extensions||[],new Map),r=e.doc instanceof ar?e.doc:ar.of((e.doc||"").split(n.staticFacet(In.lineSeparator)||HQ)),i=e.selection?e.selection instanceof Ve?e.selection:Ve.single(e.selection.anchor,e.selection.head):Ve.single(0);return m9e(i,r.length),n.staticFacet(KQ)||(i=i.asSingle()),new In(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(In.tabSize)}get lineBreak(){return this.facet(In.lineSeparator)||` -`}get readOnly(){return this.facet(S9e)}phrase(e,...n){for(let r of this.facet(In.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(y9e))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return Qhn(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=ms(n,s,!1);if(o(n.slice(l,s))!=mi.Word)break;s=l}for(;at.length?t[0]:4});In.lineSeparator=x9e;In.readOnly=S9e;In.phrases=St.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])}});In.languageData=y9e;In.changeFilter=b9e;In.transactionFilter=w9e;In.transactionExtender=_9e;AU.reconfigure=rn.define();function np(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);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 Lb{eq(e){return this==e}range(e,n=e){return eK.create(e,n,this)}}Lb.prototype.startSide=Lb.prototype.endSide=0;Lb.prototype.point=!1;Lb.prototype.mapMode=fs.TrackDel;let eK=class E9e{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new E9e(e,n,r)}};function tK(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Vle{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 s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(s<0&&(s=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-s),o.push(h-s))}return{mapped:r.length?new Vle(i,o,r,a):null,pos:s}}}class Gn{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 Gn(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,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(tK)),this.isEmpty)return n.length?Gn.of(n):this;let a=new T9e(this,null,-1).goto(0),l=0,c=[],u=new wy;for(;a.value||l=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||oa.to||o=o&&e<=o+s.length&&s.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return lP.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return lP.from(e).goto(n)}static compare(e,n,r,i,o=-1){let s=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=v1e(s,a,r),c=new O2(s,l,o),u=new O2(a,l,o);r.iterGaps((f,d,h)=>y1e(c,f,u,d,h,i)),r.empty&&r.length==0&&y1e(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),s=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=v1e(o,s),l=new O2(o,a,0).goto(r),c=new O2(s,a,0).goto(r);for(;;){if(l.to!=c.to||!nK(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 s=new O2(e,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFroma&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,n=!1){let r=new wy;for(let i of e instanceof eK?[e]:n?Khn(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Gn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Gn.empty;i=i.nextLayer)n=new Gn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Gn.empty=new Gn([],[],null,-1);function Khn(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(tK);e=r}return t}Gn.empty.nextLayer=Gn.empty;class wy{finishChunk(e){this.chunks.push(new Vle(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 wy)).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(Gn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Gn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function v1e(t,e,n){let r=new Map;for(let o of t)for(let s=0;s=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 T9e(s,n,r,o));return i.length==1?i[0]:new lP(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--)n7(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--)n7(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(),n7(this.heap,0)}}}function n7(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 O2{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=lP.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){CL(this.active,e),CL(this.activeTo,e),CL(this.activeRank,e),this.minActive=x1e(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;OL(this.active,n,r),OL(this.activeTo,n,i),OL(this.activeRank,n,o),e&&OL(e,n,this.cursor.from),this.minActive=x1e(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&&CL(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 y1e(t,e,n,r,i,o){t.goto(e),n.goto(r);let s=r+i,a=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,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&nK(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(a,f,t.point,n.point):f>a&&!nK(t.active,n.active)&&o.compareRange(a,f,t.active,n.active),u>s)break;a=u,c<=0&&t.next(),c>=0&&n.next()}}function nK(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 x1e(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=ms(t,i)}return r===!0?-1:t.length}const iK="ͼ",b1e=typeof Symbol>"u"?"__"+iK:Symbol.for(iK),oK=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),w1e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class _y{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(g=>s.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),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,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(` +`){[e,n]=bC(this,e,n);let i="";for(let o=0,s=0;oe&&o&&(i+=r),es&&(i+=a.sliceString(e-s,n-s,r)),s=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Xd))return 0;let r=0,[i,o,s,a]=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==s||o==a)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 Wi(h,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof Xd)for(let g of h.children)f(g);else h.lines>s&&(l>s||!l)?(d(),a.push(h)):h instanceof Wi&&l&&(p=u[u.length-1])instanceof Wi&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Wi(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&&(a.push(u.length==1?u[0]:Xd.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new Xd(a,n)}}ar.empty=new Wi([""],0);function $hn(t){let e=-1;for(let n of t)e+=n.length+1;return e}function z3(t,e,n=0,r=1e9){for(let i=0,o=0,s=!0;o=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof Wi?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],s=o>>1,a=i instanceof Wi?i.text.length:i.children.length;if(s==(n>0?a: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 Wi){let l=i.text[s+(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[s+(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 Wi?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 u9e{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Sk(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 f9e{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"&&(ar.prototype[Symbol.iterator]=function(){return this.iter()},Sk.prototype[Symbol.iterator]=u9e.prototype[Symbol.iterator]=f9e.prototype[Symbol.iterator]=function(){return this});let Fhn=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 bC(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let eS="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 eS[e-1]<=t;return!1}function h1e(t){return t>=127462&&t<=127487}const p1e=8205;function ms(t,e,n=!0,r=!0){return(n?d9e:zhn)(t,e,r)}function d9e(t,e,n){if(e==t.length)return e;e&&h9e(t.charCodeAt(e))&&p9e(t.charCodeAt(e-1))&&e--;let r=as(t,e);for(e+=Zc(r);e=0&&h1e(as(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function zhn(t,e,n){for(;e>0;){let r=d9e(t,e-2,n);if(r=56320&&t<57344}function p9e(t){return t>=55296&&t<56320}function as(t,e){let n=t.charCodeAt(e);if(!p9e(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return h9e(r)?(n-55296<<10)+(r-56320)+65536:n}function Ble(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Zc(t){return t<65536?1:2}const HQ=/\r\n?|\n/;var fs=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(fs||(fs={}));class _h{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return o+(e-i);o+=a}else{if(r!=fs.Simple&&c>=e&&(r==fs.TrackDel&&ie||r==fs.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!a)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&&a>=e)return in?"cover":!0;i=a}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 _h(e)}static create(e){return new _h(e)}}class mo extends _h{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 qQ(this,(n,r,i,o,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return XQ(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length0&&wv(r,n,o.text),o.forward(u),a+=u}let c=e[s++];for(;a>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;sd||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?ar.of(h.split(r||HQ)):h:ar.empty,g=p.length;if(f==d&&g==0)return;fs&&Us(i,f-s,-1),Us(i,d-f,g),wv(o,i,p),s=d}}return c(e),l(!a),a}static empty(e){return new mo(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;ia&&typeof s!="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 wv(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(i,c,o,u,f),i=c,o=u}}}function XQ(t,e,n,r=!1){let i=[],o=r?[]:null,s=new sP(t),a=new sP(e);for(let l=-1;;)if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);Us(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len=0&&l=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.lenl||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class sP{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?ar.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?ar.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 bx{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 bx(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Ve.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ve.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 Ve.range(e.anchor,e.head)}static create(e,n,r){return new bx(e,n,r)}}class Ve{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ve.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 Ve(e.ranges.map(n=>bx.fromJSON(n)),e.main)}static single(e,n=e){return new Ve([Ve.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?Ve.range(l,a):Ve.range(a,l))}}return new Ve(e,n)}}function m9e(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Ule=0;class St{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Ule++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new St(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:Wle),!!e.static,e.enables)}of(e){return new j3([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new j3(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new j3(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function Wle(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class j3{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=Ule++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=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[s]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||YQ(f,u)){let h=r(f);if(a?!g1e(h,f.values[s],i):!i(h,f.values[s]))return f.values[s]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let g=tz(d,p);if(this.dependencies.every(m=>m instanceof St?d.facet(m)===f.facet(m):m instanceof Ko?d.field(m,!1)==f.field(m,!1):!0)||(a?g1e(h=r(f),g,i):i(h=r(f),g)))return f.values[s]=g,0}else h=r(f);return f.values[s]=h,1}}}}function g1e(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)),s=t[e.id]>>1;function a(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(m1e).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],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,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,m1e.of({field:this,create:e})]}get extension(){return this}}const ox={lowest:4,low:3,default:2,high:1,highest:0};function S2(t){return e=>new v9e(e,t)}const o0={highest:S2(ox.highest),high:S2(ox.high),default:S2(ox.default),low:S2(ox.low),lowest:S2(ox.lowest)};class v9e{constructor(e,n){this.inner=e,this.prec=n}}class AU{of(e){return new QQ(this,e)}reconfigure(e){return AU.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class QQ{constructor(e,n){this.compartment=e,this.inner=n}}class ez{constructor(e,n,r,i,o,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],o=Object.create(null),s=new Map;for(let d of Bhn(e,n,s))d instanceof Ko?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[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,g=u&&u[d]||[];if(h.every(m=>m.type==0))if(a[p.id]=l.length<<1|1,Wle(g,h))l.push(r.facet(p));else{let m=p.combine(h.map(v=>v.value));l.push(r&&p.compare(m,r.facet(p))?r.facet(p):m)}else{for(let m of h)m.type==0?(a[m.id]=l.length<<1|1,l.push(m.value)):(a[m.id]=c.length<<1,c.push(v=>m.dynamicSlot(v)));a[p.id]=c.length<<1,c.push(m=>jhn(m,p,h))}}let f=c.map(d=>d(a));return new ez(e,s,f,a,l,o)}}function Bhn(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof QQ&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof QQ){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof v9e)o(s.inner,s.prec);else if(s instanceof Ko)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof j3)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,ox.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(t,ox.default),r.reduce((s,a)=>s.concat(a))}function Ck(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 tz(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const y9e=St.define(),KQ=St.define({combine:t=>t.some(e=>e),static:!0}),x9e=St.define({combine:t=>t.length?t[0]:void 0,static:!0}),b9e=St.define(),w9e=St.define(),_9e=St.define(),S9e=St.define({combine:t=>t.length?t[0]:!1});class tp{constructor(e,n){this.type=e,this.value=n}static define(){return new Uhn}}class Uhn{of(e){return new tp(this,e)}}class Whn{constructor(e){this.map=e}of(e){return new rn(this,e)}}class rn{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 rn(this.type,n)}is(e){return this.type==e}static define(e={}){return new Whn(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}}rn.reconfigure=rn.define();rn.appendConfig=rn.define();class ao{constructor(e,n,r,i,o,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&m9e(r,n.newLength),o.some(a=>a.type==ao.time)||(this.annotations=o.concat(ao.time.of(Date.now())))}static create(e,n,r,i,o,s){return new ao(e,n,r,i,o,s)}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(ao.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}ao.time=tp.define();ao.userEvent=tp.define();ao.addToHistory=tp.define();ao.remote=tp.define();function Vhn(t,e){let n=[];for(let r=0,i=0;;){let o,s;if(r=t[r]))o=t[r++],s=t[r++];else if(i=0;i--){let o=r[i](t);o instanceof ao?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof ao?t=o[0]:t=O9e(e,tS(o),!1)}return t}function Hhn(t){let e=t.startState,n=e.facet(_9e),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=C9e(r,ZQ(e,o,t.changes.newLength),!0))}return r==t?t:ao.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const qhn=[];function tS(t){return t==null?qhn:Array.isArray(t)?t:[t]}var mi=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(mi||(mi={}));const Xhn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let JQ;try{JQ=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Yhn(t){if(JQ)return JQ.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Xhn.test(n)))return!0}return!1}function Qhn(t){return e=>{if(!/\S/.test(e))return mi.Space;if(Yhn(e))return mi.Word;for(let n=0;n-1)return mi.Word;return mi.Other}}class In{constructor(e,n,r,i,o,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;ai.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(rn.reconfigure)?(n=null,r=a.value):a.is(rn.appendConfig)&&(n=null,r=tS(r).concat(a.value));let o;n?o=e.startState.values.slice():(n=ez.resolve(r,i,this),o=new In(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(KQ)?e.newSelection:e.newSelection.asSingle();new In(n,e.newDoc,s,o,(a,l)=>l.update(a,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:Ve.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=tS(r.effects);for(let a=1;as.spec.fromJSON(a,l)))}}return In.create({doc:e.doc,selection:Ve.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=ez.resolve(e.extensions||[],new Map),r=e.doc instanceof ar?e.doc:ar.of((e.doc||"").split(n.staticFacet(In.lineSeparator)||HQ)),i=e.selection?e.selection instanceof Ve?e.selection:Ve.single(e.selection.anchor,e.selection.head):Ve.single(0);return m9e(i,r.length),n.staticFacet(KQ)||(i=i.asSingle()),new In(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(In.tabSize)}get lineBreak(){return this.facet(In.lineSeparator)||` +`}get readOnly(){return this.facet(S9e)}phrase(e,...n){for(let r of this.facet(In.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(y9e))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return Qhn(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=ms(n,s,!1);if(o(n.slice(l,s))!=mi.Word)break;s=l}for(;at.length?t[0]:4});In.lineSeparator=x9e;In.readOnly=S9e;In.phrases=St.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])}});In.languageData=y9e;In.changeFilter=b9e;In.transactionFilter=w9e;In.transactionExtender=_9e;AU.reconfigure=rn.define();function np(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);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 Lb{eq(e){return this==e}range(e,n=e){return eK.create(e,n,this)}}Lb.prototype.startSide=Lb.prototype.endSide=0;Lb.prototype.point=!1;Lb.prototype.mapMode=fs.TrackDel;let eK=class E9e{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new E9e(e,n,r)}};function tK(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Vle{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 s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(s<0&&(s=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-s),o.push(h-s))}return{mapped:r.length?new Vle(i,o,r,a):null,pos:s}}}class Gn{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 Gn(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,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(tK)),this.isEmpty)return n.length?Gn.of(n):this;let a=new T9e(this,null,-1).goto(0),l=0,c=[],u=new wy;for(;a.value||l=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||oa.to||o=o&&e<=o+s.length&&s.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return aP.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return aP.from(e).goto(n)}static compare(e,n,r,i,o=-1){let s=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=v1e(s,a,r),c=new C2(s,l,o),u=new C2(a,l,o);r.iterGaps((f,d,h)=>y1e(c,f,u,d,h,i)),r.empty&&r.length==0&&y1e(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),s=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=v1e(o,s),l=new C2(o,a,0).goto(r),c=new C2(s,a,0).goto(r);for(;;){if(l.to!=c.to||!nK(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 s=new C2(e,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFroma&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,n=!1){let r=new wy;for(let i of e instanceof eK?[e]:n?Khn(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Gn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Gn.empty;i=i.nextLayer)n=new Gn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Gn.empty=new Gn([],[],null,-1);function Khn(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(tK);e=r}return t}Gn.empty.nextLayer=Gn.empty;class wy{finishChunk(e){this.chunks.push(new Vle(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 wy)).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(Gn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Gn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function v1e(t,e,n){let r=new Map;for(let o of t)for(let s=0;s=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 T9e(s,n,r,o));return i.length==1?i[0]:new aP(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--)n7(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--)n7(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(),n7(this.heap,0)}}}function n7(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 C2{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=aP.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){CL(this.active,e),CL(this.activeTo,e),CL(this.activeRank,e),this.minActive=x1e(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;OL(this.active,n,r),OL(this.activeTo,n,i),OL(this.activeRank,n,o),e&&OL(e,n,this.cursor.from),this.minActive=x1e(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&&CL(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 y1e(t,e,n,r,i,o){t.goto(e),n.goto(r);let s=r+i,a=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,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&nK(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(a,f,t.point,n.point):f>a&&!nK(t.active,n.active)&&o.compareRange(a,f,t.active,n.active),u>s)break;a=u,c<=0&&t.next(),c>=0&&n.next()}}function nK(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 x1e(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=ms(t,i)}return r===!0?-1:t.length}const iK="ͼ",b1e=typeof Symbol>"u"?"__"+iK:Symbol.for(iK),oK=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),w1e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class _y{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(g=>s.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),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,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=w1e[b1e]||1;return w1e[b1e]=e+1,iK+e.toString(36)}static mount(e,n,r){let i=e[oK],o=r&&r.nonce;i?o&&i.setNonce(o):i=new Zhn(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let _1e=new Map;class Zhn{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=_1e.get(r);if(o)return e[oK]=o;this.sheet=new i.CSSStyleSheet,_1e.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[oK]=this}mount(e,n){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Jhn=typeof navigator<"u"&&/Mac/.test(navigator.platform),epn=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ls=0;ls<10;ls++)Sy[48+ls]=Sy[96+ls]=String(ls);for(var ls=1;ls<=24;ls++)Sy[ls+111]="F"+ls;for(var ls=65;ls<=90;ls++)Sy[ls]=String.fromCharCode(ls+32),cP[ls]=String.fromCharCode(ls);for(var r7 in Sy)cP.hasOwnProperty(r7)||(cP[r7]=Sy[r7]);function tpn(t){var e=Jhn&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||epn&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?cP:Sy)[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 uP(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function sK(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function npn(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function B3(t,e){if(!e.anchorNode)return!1;try{return sK(t,e.anchorNode)}catch{return!1}}function wC(t){return t.nodeType==3?Fb(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Ek(t,e,n,r){return n?S1e(t,e,n,r,-1)||S1e(t,e,n,r,1):!1}function $b(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function nz(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function S1e(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Bg(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=$b(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?Bg(t):0}else return!1}}function Bg(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function oD(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function rpn(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 k9e(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 ipn(t,e,n,r,i,o,s,a){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,g=1;if(h)d=rpn(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:g}=k9e(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*g}}let m=0,v=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+v&&(v=e.bottom-d.bottom+v+s)):e.bottom>d.bottom&&(v=e.bottom-d.bottom+s,n<0&&e.top-v0&&e.right>d.right+m&&(m=e.right-d.right+m+o)):e.right>d.right&&(m=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 spn{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?Bg(n):0),r,Math.min(e.focusOffset,r?Bg(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let hw=null;function A9e(t){if(t.setActive)return t.setActive();if(hw)return t.focus(hw);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(hw==null?{get preventScroll(){return hw={preventScroll:!0},!0}}:void 0),!hw){hw=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function R9e(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=Bg(n)}else if(n.parentNode&&!nz(n))r=$b(n),n=n.parentNode;else return null}}function D9e(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){s=l,a=u;break}u=d,c=d+f.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].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=Gle){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 L9e(t,e,n,r,i,o,s,a,l){let{children:c}=t,u=c.length?c[e]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:s;if(!(e==r&&u&&!s&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,n==0,a,l))){if(r0&&(!s&&o.length&&u.merge(n,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(n2);var Ct={mac:k1e||/Mac/.test(Za.platform),windows:/Win/.test(Za.platform),linux:/Linux|X11/.test(Za.platform),ie:PU,ie_version:F9e?aK.documentMode||6:cK?+cK[1]:lK?+lK[1]:0,gecko:E1e,gecko_version:E1e?+(/Firefox\/(\d+)/.exec(Za.userAgent)||[0,0])[1]:0,chrome:!!i7,chrome_version:i7?+i7[1]:0,ios:k1e,android:/Android\b/.test(Za.userAgent),webkit:T1e,safari:N9e,webkit_version:T1e?+(/\bAppleWebKit\/(\d+)/.exec(Za.userAgent)||[0,0])[1]:0,tabSize:aK.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const cpn=256;class Qf extends Ir{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 Qf)||this.length-(n-e)+r.length>cpn||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 Qf(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 Xs(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 upn(this.dom,e,n)}}class Ug extends Ir{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(P9e(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,s){return r&&(!(r instanceof Ug&&r.mark.eq(this.mark))||e&&o<=0||ne&&n.push(r=e&&(i=o),r=l,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Ug(this.mark,n,s)}domAtPos(e){return z9e(this,e)}coordsAt(e,n){return B9e(this,e,n)}}function upn(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&n<0||e==r&&n>=0?Ct.chrome||Ct.gecko||(e?(i--,s=1):o=0)?0:a.length-1];return Ct.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?oD(l,s<0):l||null}class _v extends Ir{static create(e,n,r){return new _v(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=_v.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,s){return r&&(!(r instanceof _v)||!this.widget.compare(r.widget)||e>0&&o<=0||n0)?Xs.before(this.dom):Xs.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 s=this.side?this.side<0:e>0;for(let a=s?i.length-1:0;o=i[a],!(e>0?a==0:a==i.length-1||o.top0?Xs.before(this.dom):Xs.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return ar.empty}get isHidden(){return!0}}Qf.prototype.children=_v.prototype.children=_C.prototype.children=Gle;function z9e(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;io&&e0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o0&&e instanceof Ug&&i.length&&(r=i[i.length-1])instanceof Ug&&r.mark.eq(e.mark)?j9e(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function B9e(t,e,n){let r=null,i=-1,o=null,s=-1;function a(c,u){for(let f=0,d=0;f=u&&(h.children.length?a(h,u-d):(!o||o.isHidden&&n>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,s=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 fK(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 dpn(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Cy(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:s}=U9e(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new Cy(e,r,i,n,e.widget||null,!0)}static line(e){return new aD(e)}static set(e,n=!1){return Gn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}It.none=Gn.empty;class sD extends It{constructor(e){let{start:n,end:r}=U9e(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 sD&&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))&&rz(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)}}sD.prototype.point=!1;class aD extends It{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof aD&&this.spec.class==e.spec.class&&rz(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)}}aD.prototype.mapMode=fs.TrackBefore;aD.prototype.point=!0;class Cy extends It{constructor(e,n,r,i,o,s){super(n,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?fs.TrackBefore:fs.TrackAfter:fs.TrackDel}get type(){return this.startSide!=this.endSide?ka.WidgetRange:this.startSide<=0?ka.WidgetBefore:ka.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Cy&&hpn(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)}}Cy.prototype.point=!0;function U9e(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 hpn(t,e){return t==e||!!(t&&e&&t.compare(e))}function dK(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 no extends Ir{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,s){if(r){if(!(r instanceof no))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),$9e(this,e,n,r?r.children.slice():[],o,s),!0}split(e){let n=new no;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){rz(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){j9e(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=uK(n,this.attrs||{})),r&&(this.attrs=uK({class:r},this.attrs||{}))}domAtPos(e){return z9e(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(P9e(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&&(fK(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&&Ir.get(i)instanceof Ug;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Ir.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!Ct.ios||!this.children.some(o=>o instanceof Qf))){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 Qf)||/[^ -~]/.test(r.text))return null;let i=wC(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=B9e(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 no)return o;if(s>n)break}i=s+o.breakAfter}return null}}class vg extends Ir{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,s){return r&&(!(r instanceof vg)||!this.widget.compare(r.widget)||e>0&&o<=0||n0}}class hK extends rp{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 Tk{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 vg&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new no),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(EL(new _C(-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 vg)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){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(EL(new Qf(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,s){if(this.disallowBlockEffectsFor[s]&&r instanceof Cy){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 a=n-e;if(r instanceof Cy)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new vg(r.widget||SC.block,a,r));else{let l=_v.create(r.widget||SC.inline,a,a?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(EL(new _C(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(EL(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);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(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 s=new Tk(e,n,r,o);return s.openEnd=Gn.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function EL(t,e){for(let n of e)t=new Ug(n,[t],t.length);return t}class SC extends rp{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}}SC.inline=new SC("span");SC.block=new SC("div");var ai=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(ai||(ai={}));const Nb=ai.LTR,Hle=ai.RTL;function W9e(t){let e=[];for(let n=0;n=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.fromn:e[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function G9e(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;g-=3)if(xd[g+1]==-h){let m=xd[g+2],v=m&2?i:m&4?m&1?o:i:0;v&&(Dr[f]=Dr[xd[g]]=v),a=g;break}}else{if(xd.length==189)break;xd[a++]=f,xd[a++]=d,xd[a++]=l}else if((p=Dr[f])==2||p==1){let g=p==i;l=g?0:1;for(let m=a-3;m>=0;m-=3){let v=xd[m+2];if(v&2)break;if(g)xd[m+2]|=2;else{if(v&4)break;xd[m+2]|=4}}}}}function xpn(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:t,a=il;)p==m&&(p=n[--g].from,m=g?n[g-1].to:t),Dr[--p]=h;l=u}else o=c,l++}}}function gK(t,e,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&s.push(new Sv(l,g.from,h));let m=g.direction==Nb!=!(h%2);mK(t,m?r+1:r,i,g.inner,g.from,g.to,s),l=g.to}p=g.to}else{if(p==n||(u?Dr[p]!=a:Dr[p]==a))break;p++}d?gK(t,l,p,r+1,i,d,s):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let g=Dr[l-1];g!=a&&(u=!1,f=g==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let g=o[--c];if(!u)for(let m=g.from,v=c;;){if(m==e)break e;if(v&&o[v-1].to==m)m=o[--v].from;else{if(Dr[m-1]==a)break e;break}}if(d)d.push(g);else{g.toDr.length;)Dr[Dr.length]=256;let r=[],i=e==Nb?0:1;return mK(t,i,i,n,0,t.length,r),r}function H9e(t){return[new Sv(0,t,0)]}let q9e="";function wpn(t,e,n,r,i){var o;let s=r.head-t.from,a=Sv.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[a],c=l.side(i,n);if(s==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],s=l.side(!i,n),c=l.side(i,n)}let u=ms(t.text,s,l.forward(i,n));(ul.to)&&(u=c),q9e=t.text.slice(Math.min(s,u),Math.max(s,u));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)t.some(e=>e)}),t7e=St.define({combine:t=>t.some(e=>e)}),n7e=St.define();class rS{constructor(e,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new rS(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 rS(Ve.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const TL=rn.define({map:(t,e)=>t.map(e)}),r7e=rn.define();function al(t,e,n){let r=t.facet(K9e);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 iv=St.define({combine:t=>t.length?t[0]:!0});let Spn=0;const PT=St.define();class Yi{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:s}=n||{};return new Yi(Spn++,e,r,i,a=>{let l=[PT.of(a)];return s&&l.push(fP.of(c=>{let u=c.plugin(a);return u?s(u):It.none})),o&&l.push(o(a)),l})}static fromClass(e,n){return Yi.define(r=>new e(r),n)}}class o7{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(al(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){al(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){al(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const i7e=St.define(),qle=St.define(),fP=St.define(),o7e=St.define(),Xle=St.define(),s7e=St.define();function P1e(t,e){let n=t.state.facet(s7e);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return Gn.spans(r,e.from,e.to,{point(){},span(o,s,a,l){let c=o-e.from,u=s-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=_pn(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 g={from:c,to:u,direction:h,inner:[]};f.push(g),f=g.inner}}}}),i}const a7e=St.define();function l7e(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(a7e)){let s=o(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const MT=St.define();class gu{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new gu(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 gu(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class iz{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=mo.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new gu(o,s,a,l))),this.changedRanges=i}static create(e,n,r){return new iz(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 M1e extends Ir{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=It.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 no],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new gu(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:!Ppn(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?Opn(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new gu(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,(Ct.ie||Ct.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=kpn(s,a,e.changes);return r=gu.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 s=Ct.chrome||Ct.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:f}=a,d,h,p,g;if(r&&r.range.fromBu){let b=Tk.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),w=Tk.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=b.breakAtStart,p=b.openStart,g=w.openEnd;let _=this.compositionView(r);w.breakAtStart?_.breakAfter=1:w.content.length&&_.merge(_.length,_.length,w.content[0],!1,w.openStart,0)&&(_.breakAfter=w.content[0].breakAfter,w.content.shift()),b.content.length&&_.merge(0,0,b.content[b.content.length-1],!0,0,b.openEnd)&&b.content.pop(),d=b.content.concat(_).concat(w.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:g}=Tk.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:v}=o.findPos(c,1),{i:y,off:x}=o.findPos(l,-1);L9e(this,y,x,m,v,d,h,p,g)}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(r7e)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Qf(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Ug(i,[n],n.length);let r=new no;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=Ir.get(o);a&&a!=s&&(a.dom=null),s.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&&B3(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(Ct.gecko&&a.empty&&!this.hasComposition&&Cpn(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Xs(f,0),s=!0}let u=this.view.observer.selectionRange;(s||!u.focusNode||(!Ek(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Ek(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{Ct.android&&Ct.chrome&&this.dom.contains(u.focusNode)&&Apn(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=uP(this.view.root);if(f)if(a.empty){if(Ct.gecko){let d=Epn(l.node,l.offset);if(d&&d!=3){let h=(d==1?R9e:D9e)(l.node,l.offset);h&&(l=new Xs(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.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 Xs(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Xs(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Ek(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=uP(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=no.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.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=Ir.get(n.childNodes[i]);o instanceof no&&(r=o.domAtPos(o.length))}return r?new Xs(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Ir.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;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(le||a.covers(1))&&(!r||a instanceof no&&!(r instanceof no&&n>=0)))r=a,i=c;else if(r&&c==e&&l==e&&a instanceof vg&&Math.abs(n)<2){if(a.deco.startSide<0)break;s&&(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 no))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof Qf))return null;let o=ms(i.text,r);if(o==r)return null;let s=Fb(i.dom,r,o).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==ai.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),s){let p=f.dom.lastChild,g=p?wC(p):[];if(g.length){let m=g[g.length-1],v=l?m.right-h.left:h.right-m.left;v>a&&(a=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"?ai.RTL:ai.LTR}measureTextSize(){for(let o of this.children)if(o instanceof no){let s=o.measureTextSize();if(s)return s}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=wC(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 I9e(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],s=o?o.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(It.replace({widget:new hK(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return It.set(e)}updateDeco(){let e=1,n=this.view.state.facet(fP).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(o7e).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(Gn.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=l7e(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;ipn(this.view.scrollDOM,s,n.head{re.from&&(n=!0)}),n}function Mpn(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return Ve.cursor(e);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=ms(i.text,o,!1):a=ms(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=ms(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;at?e.left-t:Math.max(0,t-e.right)}function Dpn(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function s7(t,e){return t.tope.top+1}function R1e(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function yK(t,e,n){let r,i,o,s,a=!1,l,c,u,f;for(let p=t.firstChild;p;p=p.nextSibling){let g=wC(p);for(let m=0;mx||s==x&&o>y){r=p,i=v,o=y,s=x;let b=x?n0?m0)}y==0?n>v.bottom&&(!u||u.bottomv.top)&&(c=p,f=v):u&&s7(u,v)?u=D1e(u,v.bottom):f&&s7(f,v)&&(f=R1e(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 I1e(r,d,n);if(a&&r.contentEditable!="false")return yK(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 I1e(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;an?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((Ct.chrome||Ct.gecko)&&Fb(t,a).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:t,offset:a+(h?1:0)};i=a+(h?1:0),o=f}}}return{node:t,offset:i>-1?i:s>0?t.nodeValue.length:0}}function u7e(t,e,n,r=-1){var i,o;let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:u,y:f}=e,d=f-a;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let b=t.viewState.heightOracle.textHeight/2,w=!1;l=t.elementAtHeight(d),l.type!=ka.Text;)for(;d=r>0?l.bottom+b:l.top-b,!(d>=0&&d<=c);){if(w)return n?null:0;w=!0,r=-r}f=a+d;let h=l.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:L1e(t,s,l,u,f);let p=t.dom.ownerDocument,g=t.root.elementFromPoint?t.root:p,m=g.elementFromPoint(u,f);m&&!t.contentDOM.contains(m)&&(m=null),m||(u=Math.max(s.left+1,Math.min(s.right-1,u)),m=g.elementFromPoint(u,f),m&&!t.contentDOM.contains(m)&&(m=null));let v,y=-1;if(m&&((i=t.docView.nearest(m))===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)||Ct.safari&&Ipn(v,y,u)||Ct.chrome&&Lpn(v,y,u))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let b=no.find(t.docView,h);if(!b)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=yK(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 a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);o+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+rK(s,o,t.state.tabSize)}function Ipn(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 Fb(t,r-1,r).getBoundingClientRect().left>n}function Lpn(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():Fb(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function xK(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==ka.Text))return r}return n}function $pn(t,e,n,r){let i=xK(t,e.head),o=!r||i.type!=ka.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==ai.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return Ve.cursor(l,n?-1:1)}return Ve.cursor(n?i.to:i.from,n?-1:1)}function $1e(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=wpn(i,o,s,a,n),u=q9e;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;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 a}else{if(!r)return c;l=r(u)}a=c}}function Fpn(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let s=r(o);return i==mi.Space&&(i=s),i==s}}function Npn(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return Ve.cursor(i,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),u=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let h=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),a=(o<0?h.top:h.bottom)+u}let f=l.left+s,d=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*o,g=u7e(t,{x:f,y:p},!1,o);if(pl.bottom||(o<0?gi)){let m=t.docView.coordsForChar(g),v=!m||p{if(e>o&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ve.cursor(r,ro)&&this.lineBreak(),i=s}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,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let n=Ir.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+(jpn(e,r.node,r.offset)?n:0))}}function jpn(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=o||s?[]:Vpn(e),l=new zpn(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Gpn(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!sK(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!sK(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((Ct.ios||Ct.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=i.from,c=null;(o===8||Ct.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))}:(Ct.mac||Ct.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=Ve.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:ar.of([" "])}):Ct.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` - `&&t.lineWrapping&&(r&&(r=Ve.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:ar.of([" "])}),n)return Yle(t,n,r,o);if(r&&!r.main.eq(i)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function Yle(t,e,n,r=-1){if(Ct.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Ct.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&&nS(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&nS(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&nS(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=Upn(t,e,n));return t.state.facet(Z9e).some(l=>l(t,e.from,e.to,o,a))||t.dispatch(a()),!0}function Upn(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 a=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=i.changes(e),l=n&&n.main.to<=a.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&&c7e(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:a,range:l||p.map(a)};let g=p.to-d,m=g-c.length;if(p.to-p.from!=h||t.state.sliceDoc(m,g)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let v=i.changes({from:m,to:g,insert:e.insert}),y=p.to-o.to;return{changes:v,range:l?Ve.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):p.map(v)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Wpn(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function Vpn(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 F1e(n,r)),(i!=n||o!=r)&&e.push(new F1e(i,o))),e}function Gpn(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?Ve.single(n+e,r+e):null}class Hpn{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,Ct.safari&&e.contentDOM.addEventListener("input",()=>null),Ct.gecko&&lgn(e.contentDOM.ownerDocument)}handleEvent(e){!egn(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=qpn(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}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&&h7e.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ct.android&&Ct.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Ct.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=d7e.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Xpn.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:Ct.safari&&!Ct.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 N1e(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){al(n.state,i)}}}function qpn(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 s=i.domEventHandlers[o];s&&n(o).handlers.push(N1e(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&n(o).observers.push(N1e(r.value,s))}}for(let r in Kf)n(r).handlers.push(Kf[r]);for(let r in Du)n(r).observers.push(Du[r]);return e}const d7e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Xpn="dthko",h7e=[16,17,18,20,91,92,224,225],kL=6;function AL(t){return Math.max(0,t)*.7+8}function Ypn(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Qpn{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=opn(e.contentDOM),this.atoms=e.state.facet(Xle).map(s=>s(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(In.allowMultipleSelections)&&Kpn(e,n),this.dragging=Jpn(e,n)&&m7e(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&&Ypn(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=l7e(this.view);e.clientX-l.left<=i+kL?n=-AL(i-e.clientX):e.clientX+l.right>=s-kL&&(n=AL(e.clientX-s)),e.clientY-l.top<=o+kL?r=-AL(o-e.clientY):e.clientY+l.bottom>=a-kL&&(r=AL(e.clientY-a)),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 Kpn(t,e){let n=t.state.facet(X9e);return n.length?n[0](e):Ct.mac?e.metaKey:e.ctrlKey}function Zpn(t,e){let n=t.state.facet(Y9e);return n.length?n[0](e):Ct.mac?!e.altKey:!e.ctrlKey}function Jpn(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=uP(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function egn(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=Ir.get(n))&&r.ignoreEvent(e))return!1;return!0}const Kf=Object.create(null),Du=Object.create(null),p7e=Ct.ie&&Ct.ie_version<15||Ct.ios&&Ct.webkit_version<604;function tgn(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(),g7e(t,n.value)},50)}function g7e(t,e){let{state:n}=t,r,i=1,o=n.toText(e),s=o.lines==n.selection.ranges.length;if(bK!=null&&n.selection.ranges.every(l=>l.empty)&&bK==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((s?o.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:Ve.cursor(c.from+f.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:Ve.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Du.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Kf.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Du.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Du.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Kf.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(Q9e))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=ign(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Qpn(t,e,n,r)),r&&t.observer.ignore(()=>{A9e(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 z1e(t,e,n,r){if(r==1)return Ve.cursor(e,n);if(r==2)return Mpn(t.state,e,n);{let i=no.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return ae>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function ngn(t,e,n,r){let i=no.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 s=i.coordsAt(o,-1);if(s&&j1e(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&j1e(n,r,a)?1:s&&s.bottom>=r?-1:1}function B1e(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:ngn(t,n,e.clientX,e.clientY)}}const rgn=Ct.ie&&Ct.ie_version<=11;let U1e=null,W1e=0,V1e=0;function m7e(t){if(!rgn)return t.detail;let e=U1e,n=V1e;return U1e=t,V1e=Date.now(),W1e=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(W1e+1)%3:1}function ign(t,e){let n=B1e(t,e),r=m7e(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=B1e(t,o),c,u=z1e(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let f=z1e(t,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=ogn(i,l.pos))?c:a?i.addRange(u):Ve.create([u])}}}function ogn(t,e){for(let n=0;n=e)return Ve.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}Kf.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,s=o+i.length;(o>=n.to||s<=n.from)&&(n=Ve.range(o,s))}}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};Kf.dragend=t=>(t.inputState.draggedContent=null,!1);function G1e(t,e,n,r){if(!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=r&&o&&Zpn(t,e)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Kf.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&&G1e(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return G1e(t,e,r,!0),!0}return!1};Kf.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=p7e?null:e.clipboardData;return n?(g7e(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(tgn(t),!1)};function sgn(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 agn(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 s=t.doc.lineAt(o);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let bK=null;Kf.copy=Kf.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=agn(t.state);if(!n&&!i)return!1;bK=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=p7e?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(sgn(t,n),!1)};const v7e=tp.define();function y7e(t,e){let n=[];for(let r of t.facet(J9e)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:v7e.of(!0)}):null}function x7e(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=y7e(t.state,e);n?t.dispatch(n):t.update([])}},10)}Du.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),x7e(t)};Du.blur=t=>{t.observer.clearSelectionRange(),x7e(t)};Du.compositionstart=Du.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Du.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,Ct.chrome&&Ct.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Du.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Kf.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"),s=e.getTargetRanges();if(o&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return Yle(t,{from:l,to:c,insert:t.state.toText(o)},null),!0}}let i;if(Ct.chrome&&Ct.android&&(i=d7e.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 s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Ct.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Ct.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Du.compositionend(t,e),20),!1};const H1e=new Set;function lgn(t){H1e.has(t)||(H1e.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const q1e=["pre-wrap","normal","pre-line","break-spaces"];let CC=!1;function X1e(){CC=!1}class cgn{constructor(e){this.lineWrapping=e,this.doc=ar.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 q1e.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!=a;if(this.lineWrapping=a,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)>W3&&(CC=!0),this.height=e)}replace(e,n,r){return Aa.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=o.lineAt(l,Kr.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Kr.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,lo*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i=o&&s(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 Yl extends b7e{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new Yd(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Yl||i instanceof ns&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof ns?i=new Yl(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Aa.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 ns extends Aa{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,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let o=r[r.length-1];o instanceof ns?r[r.length-1]=new ns(o.length+i):r.push(null,new ns(i-1))}if(e>0){let o=r[0];o instanceof ns?r[0]=new ns(e+o.length):r.unshift(new ns(e-1),null)}return Aa.of(r)}decomposeLeft(e,n){n.push(new ns(e-1),null)}decomposeRight(e,n){n.push(null,new ns(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 s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new ns(i.from-n-1).updateHeight(e,n));a<=o&&i.more;){let u=e.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=W3&&(l=-2);let d=new Yl(u,f);d.outdated=!1,s.push(d),a+=u+1}a<=o&&s.push(null,new ns(o-a).updateHeight(e,a));let c=Aa.of(s);return(l<0||Math.abs(c.height-this.height)>=W3||Math.abs(l-this.heightMetrics(e,n).perLine)>=W3)&&(CC=!0),oz(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 fgn extends Aa{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 ea))return c;let u=n==Kr.ByPosNoHeight?Kr.ByPosNoHeight:Kr.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(e,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,a,l,s);else{let c=this.lineAt(l,Kr.ByPos,r,i,o);e=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}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 s=o.length;for(let a of r)o.push(a);if(e>0&&Y1e(o,s-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?Aa.of(this.break?[e,null,n]:[e,n]):(this.left=oz(this.left,e),this.right=oz(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:s}=this,a=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<=a+s.length&&i.more?l=s=s.updateHeight(e,a,r,i):s.updateHeight(e,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Y1e(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof ns&&(r=t[e+1])instanceof ns&&t.splice(e-1,3,new ns(n.length+1+r.length))}const dgn=5;class Qle{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 Yl?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Yl(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=dgn)&&this.addLineDeco(i,o,s)}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 Yl(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new ns(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 Yl)return e;let n=new Yl(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 Yl)&&!this.isCovered?this.nodes.push(new Yl(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),s=Math.min(s,d.right),a=Math.max(a,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,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function mgn(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class l7{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 cgn(n),this.stateDeco=e.facet(fP).filter(r=>typeof r!="function"),this.heightMap=Aa.empty().applyChanges(this.stateDeco,ar.empty,this.heightOracle.setDoc(e.doc),[new gu(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=It.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:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new PL(o,s))}}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?K1e:new Kle(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(DT(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(fP).filter(u=>typeof u!="function");let i=e.changedRanges,o=gu.extendWithRanges(i,hgn(r,this.stateDeco,e?e.changes:mo.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);X1e(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||CC)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.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(t7e)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?ai.RTL:ai.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:b,scaleY:w}=k9e(n,a);(b>.005&&Math.abs(this.scaleX-b)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=b,this.scaleY=w,c|=8,s=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=M9e(e.scrollDOM);let p=(this.printing?mgn:ggn)(n,this.paddingTop),g=p.top-this.pixelViewport.top,m=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=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let b=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(b)&&(s=!0),s||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:w,charWidth:_,textHeight:S}=e.docView.measureTextSize();s=w>0&&i.refresh(o,w,_,S,y/_,b),s&&(e.docView.minWidth=0,c|=8)}g>0&&m>0?u=Math.max(g,m):g<0&&m<0&&(u=Math.min(g,m)),X1e();for(let w of this.viewports){let _=w.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(w);this.heightMap=(s?Aa.empty().applyChanges(this.stateDeco,ar.empty,this.heightOracle,[new gu(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new ugn(w.from,_))}CC&&(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(s?[]: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:s,visibleBottom:a}=this,l=new PL(i.lineAt(s-r*1e3,Kr.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,Kr.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,Kr.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=ai.LTR&&!r)return[];let a=[],l=(u,f,d,h)=>{if(f-uu&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)v.fromy));if(!m){if(fv.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(Ve.cursor(f),!1,!0).head;v>u&&(f=v)}m=new l7(u,f,this.gapSize(d,u,f,h))}a.push(m)},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=[];Gn.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)||DT(this.heightMap.lineAt(e,Kr.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)||DT(this.heightMap.lineAt(this.scaler.fromDOM(e),Kr.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 DT(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 PL{constructor(e,n){this.from=e,this.to=n}}function ygn(t,e,n){let r=[],i=t,o=0;return Gn.spans(n,t,e,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:s}=e[i],a=s-o;if(r<=a)return o+r;r-=a}}function RL(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 xgn(t,e){for(let n of t)if(e(n))return n}const K1e={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Kle{constructor(e,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,Kr.ByPos,e,0,0).top,u=n.lineAt(l,Kr.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.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 DT(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Yd(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>DT(i,e)):t._content)}const DL=St.define({combine:t=>t.join(" ")}),wK=St.define({combine:t=>t.indexOf(!0)>-1}),_K=_y.newName(),w7e=_y.newName(),_7e=_y.newName(),S7e={"&light":"."+w7e,"&dark":"."+_7e};function SK(t,e,n){return new _y(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 bgn=SK("."+_K,{"&":{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"}},S7e),wgn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},c7=Ct.ie&&Ct.ie_version<=11;class _gn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new spn,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);(Ct.ie&&Ct.ie_version<=11||Ct.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&&!(Ct.chrome&&Ct.chrome_version<126)&&(this.editContext=new Cgn(e),e.state.facet(iv)&&(e.contentDOM.editContext=this.editContext.editContext)),c7&&(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(iv)?r.root.activeElement!=this.dom:!B3(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Ct.ie&&Ct.ie_version<=11||Ct.android&&Ct.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Ek(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=uP(e.root);if(!n)return!1;let r=Ct.safari&&e.root.nodeType==11&&npn(this.dom.ownerDocument)==this.dom&&Sgn(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=B3(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&&nS(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 s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&B3(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 Bpn(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=f7e(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=Z1e(n,e.previousSibling||e.target.previousSibling,-1),i=Z1e(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(iv)!=e.state.facet(iv)&&(e.view.contentDOM.editContext=e.state.facet(iv)?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 Z1e(t,e,n){for(;e;){let r=Ir.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 J1e(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return Ek(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Sgn(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return J1e(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?J1e(t,n):null}class Cgn{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:ar.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||Yle(e,o,Ve.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 s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(s!="None"&&a!="None"){let l=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(It.mark({attributes:{style:l}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:r7e.of(It.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=uP(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,s,a,l,c)=>{if(r)return;let u=c.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(o+=n,s+=n,s<=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(s),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 mt{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||apn(e.parent)||document,this.viewState=new Q1e(e.state||In.create(e)),e.scrollTo&&e.scrollTo.is(TL)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(PT).map(i=>new o7(i));for(let i of this.plugins)i.update(this);this.observer=new _gn(this),this.inputState=new Hpn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new M1e(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 ao?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 s=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(v7e))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=y7e(o,s),l||(a=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(In.phrases)!=this.state.facet(In.phrases))return this.setState(o);i=iz.create(this,o,e),i.flags|=a;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 rS(h.empty?h:Ve.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(TL)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=sz.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(MT)!=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(DL)!=i.state.facet(DL)&&(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(vK))try{d(i)}catch(h){al(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!f7e(this,u)&&c.force&&nS(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 Q1e(e),this.plugins=e.facet(PT).map(r=>new o7(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new M1e(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(PT),r=e.state.facet(PT);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new o7(o));else{let a=this.plugins[s];a.mustUpdate=e,i.push(a)}}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:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(M9e(r))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>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 al(this.state,p),ewe}}),f=iz.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,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(vK))a(n)}get themeClasses(){return _K+" "+(this.state.facet(wK)?_7e:w7e)+" "+this.state.facet(DL)}updateAttrs(){let e=twe(this,i7e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(iv)?"true":"false",class:"cm-content",style:`${Ct.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),twe(this,qle,n);let r=this.observer.ignore(()=>{let i=fK(this.contentDOM,this.contentAttrs,n),o=fK(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(mt.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(MT);let e=this.state.facet(mt.cspNonce);_y.mount(this.root,this.styleModules.concat(bgn).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 a7(this,e,$1e(this,e,n,r))}moveByGroup(e,n){return a7(this,e,$1e(this,e,n,r=>Fpn(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 Ve.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return $pn(this,e,n,r)}moveVertically(e,n,r){return a7(this,e,Npn(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(),u7e(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),s=o[Sv.find(o,e-i.from,-1,n)];return oD(r,s.dir==ai.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(e7e)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Ogn)return H9e(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||G9e(o.isolates,r=P1e(this,e))))return o.order;r||(r=P1e(this,e));let i=bpn(e.text,n,r);return this.bidiCache.push(new sz(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ct.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{A9e(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 TL.of(new rS(typeof e=="number"?Ve.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 TL.of(new rS(Ve.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 Yi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yi.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=_y.newName(),i=[DL.of(r),MT.of(SK(`.${r}`,e))];return n&&n.dark&&i.push(wK.of(!0)),i}static baseTheme(e){return o0.lowest(MT.of(SK("."+_K,e,S7e)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Ir.get(r)||Ir.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}mt.styleModule=MT;mt.inputHandler=Z9e;mt.scrollHandler=n7e;mt.focusChangeEffect=J9e;mt.perLineTextDirection=e7e;mt.exceptionSink=K9e;mt.updateListener=vK;mt.editable=iv;mt.mouseSelectionStyle=Q9e;mt.dragMovesSelection=Y9e;mt.clickAddsSelectionRange=X9e;mt.decorations=fP;mt.outerDecorations=o7e;mt.atomicRanges=Xle;mt.bidiIsolatedRanges=s7e;mt.scrollMargins=a7e;mt.darkTheme=wK;mt.cspNonce=St.define({combine:t=>t.length?t[0]:""});mt.contentAttributes=qle;mt.editorAttributes=i7e;mt.lineWrapping=mt.contentAttributes.of({class:"cm-lineWrapping"});mt.announce=rn.define();const Ogn=4096,ewe={};class sz{constructor(e,n,r,i,o,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:ai.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(t):o;s&&uK(s,n)}return n}const Egn=Ct.mac?"mac":Ct.windows?"win":Ct.linux?"linux":"key";function Tgn(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;lr.concat(i),[]))),n}function Agn(t,e,n){return O7e(C7e(t.state),e,t,n)}let ov=null;const Pgn=4e3;function Mgn(t,e=Egn){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var f,d;let h=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(v=>Tgn(v,e));for(let v=1;v{let b=ov={view:x,prefix:y,scope:s};return setTimeout(()=>{ov==b&&(ov=null)},Pgn),!0}]})}let g=p.join(" ");i(g,!1);let m=h[g]||(h[g]={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&&m.run.push(l),c&&(m.preventDefault=!0),u&&(m.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=s;for(let d in u)u[d].run.push(h=>f(h,CK))}let l=s[e]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let CK=null;function O7e(t,e,n,r){CK=e;let i=tpn(e),o=as(i,0),s=Zc(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;ov&&ov.view==n&&ov.scope==r&&(a=ov.prefix+" ",h7e.indexOf(e.keyCode)<0&&(c=!0,ov=null));let f=new Set,d=m=>{if(m){for(let v of m.run)if(!f.has(v)&&(f.add(v),v(n)))return m.stopPropagation&&(u=!0),!0;m.preventDefault&&(m.stopPropagation&&(u=!0),c=!0)}return!1},h=t[r],p,g;return h&&(d(h[a+IL(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ct.windows&&e.ctrlKey&&e.altKey)&&(p=Sy[e.keyCode])&&p!=i?(d(h[a+IL(p,e,!0)])||e.shiftKey&&(g=cP[e.keyCode])!=i&&g!=p&&d(h[a+IL(g,e,!1)]))&&(l=!0):s&&e.shiftKey&&d(h[a+IL(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),CK=null,l}class cD{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=E7e(e);return[new cD(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return Rgn(e,n,r)}}function E7e(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==ai.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function rwe(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let o=t.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=t.posAtCoords({x:o.left+1,y:s}),l=t.posAtCoords({x:o.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function Rgn(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==ai.LTR,s=t.contentDOM,a=s.getBoundingClientRect(),l=E7e(t),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=xK(t,r),p=xK(t,i),g=h.type==ka.Text?h:null,m=p.type==ka.Text?p:null;if(g&&(t.lineWrapping||h.widgetLineBreaks)&&(g=rwe(t,r,1,g)),m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=rwe(t,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(x(n.from,n.to,g));{let w=g?x(n.from,null,g):b(h,!1),_=m?x(null,n.to,m):b(p,!0),S=[];return(g||h).to<(m||p).from-(g&&m?1:0)||h.widgetLineBreaks>1&&w.bottom+t.defaultLineHeight/2<_.top?S.push(v(f,w.bottom,d,_.top)):w.bottom<_.top&&t.elementAtHeight((w.bottom+_.top)/2).type==ka.Text&&(w.bottom=_.top=(w.bottom+_.top)/2),y(w).concat(S).concat(y(_))}function v(w,_,S,O){return new cD(e,w-l.left,_-l.top-.01,S-w,O-_+.01)}function y({top:w,bottom:_,horizontal:S}){let O=[];for(let k=0;kA&&T.from=I)break;L>M&&P(Math.max(N,M),w==null&&N<=A,Math.min(L,I),_==null&&L>=R,F.dir)}if(M=z.to+1,M>=I)break}return E.length==0&&P(A,w==null,R,_==null,t.textDirection),{top:O,bottom:k,horizontal:E}}function b(w,_){let S=a.top+(_?w.top:w.bottom);return{top:S,bottom:S,horizontal:[]}}}function Dgn(t,e){return t.constructor==e.constructor&&t.eq(e)}class Ign{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(V3)!=e.state.facet(V3)&&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(V3);for(;n!Dgn(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 V3=St.define();function T7e(t){return[Yi.define(e=>new Ign(e,t)),V3.of(t)]}const k7e=!Ct.ios,dP=St.define({combine(t){return np(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Lgn(t={}){return[dP.of(t),$gn,Fgn,Ngn,t7e.of(!0)]}function A7e(t){return t.startState.facet(dP)!=t.state.facet(dP)}const $gn=T7e({above:!0,markers(t){let{state:e}=t,n=e.facet(dP),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||k7e:n.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:Ve.cursor(i.head,i.head>i.anchor?-1:1);for(let l of cD.forRange(t,s,a))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=A7e(t);return n&&iwe(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){iwe(e.state,t)},class:"cm-cursorLayer"});function iwe(t,e){e.style.animationDuration=t.facet(dP).cursorBlinkRate+"ms"}const Fgn=T7e({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:cD.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||A7e(t)},class:"cm-selectionLayer"}),OK={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};k7e&&(OK[".cm-line"].caretColor=OK[".cm-content"].caretColor="transparent !important");const Ngn=o0.highest(mt.theme(OK)),P7e=rn.define({map(t,e){return t==null?null:e.mapPos(t)}}),IT=Ko.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(P7e)?r.value:n,t)}}),zgn=Yi.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(IT);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(IT)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(IT),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(IT)!=t&&this.view.dispatch({effects:P7e.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 jgn(){return[IT,zgn]}function owe(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)i(s+a.index,a)}function Bgn(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 Ugn{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=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=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let n=new wy,r=n.add.bind(n);for(let{from:i,to:o}of Bgn(e,this.maxLength))owe(e.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,a,l)=>{l>e.view.viewport.from&&a1e3?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 s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=e.state.doc.lineAt(s),c=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;ad.push(v.range(g,m));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(m,e,g,p));n=n.update({filterFrom:u,filterTo:f,filter:(g,m)=>gf,add:d})}}return n}}const EK=/x/.unicode!=null?"gu":"g",Wgn=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,EK),Vgn={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 u7=null;function Ggn(){var t;if(u7==null&&typeof document<"u"&&document.body){let e=document.body.style;u7=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return u7||!1}const G3=St.define({combine(t){let e=np(t,{render:null,specialChars:Wgn,addSpecialChars:null});return(e.replaceTabs=!Ggn())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,EK)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,EK)),e}});function Hgn(t={}){return[G3.of(t),qgn()]}let swe=null;function qgn(){return swe||(swe=Yi.fromClass(class{constructor(t){this.view=t,this.decorations=It.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(G3)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Ugn({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=as(e[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=ZO(s.text,a,r-s.from);return It.replace({widget:new Kgn((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=It.replace({widget:new Qgn(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(G3);t.startState.facet(G3)!=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 Xgn="•";function Ygn(t){return t>=32?Xgn:t==10?"␤":String.fromCharCode(9216+t)}class Qgn extends rp{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Ygn(this.code),r=e.state.phrase("Control character")+" "+(Vgn[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 Kgn extends rp{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 Zgn(){return emn}const Jgn=It.line({class:"cm-activeLine"}),emn=Yi.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(Jgn.range(i.from)),e=i.from)}return It.set(n)}},{decorations:t=>t.decorations});class tmn extends rp{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?wC(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=oD(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 nmn(t){return Yi.fromClass(class{constructor(e){this.view=e,this.placeholder=t?It.set([It.widget({widget:new tmn(t),side:1}).range(0)]):It.none}get decorations(){return this.view.state.doc.length?It.none:this.placeholder}},{decorations:e=>e.decorations})}const TK=2e3;function rmn(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>TK||n.off>TK||e.col<0||n.col<0){let s=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=a&&o.push(Ve.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),u=rK(c.text,s,t.tabSize,!0);if(u<0)o.push(Ve.cursor(c.to));else{let f=rK(c.text,a,t.tabSize);o.push(Ve.range(c.from+u,c.from+f))}}}return o}function imn(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function awe(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>TK?-1:i==r.length?imn(t,e.clientX):ZO(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function omn(t,e){let n=awe(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),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=awe(t,i);if(!a)return r;let l=rmn(t.state,n,a);return l.length?s?Ve.create(l.concat(r.ranges)):Ve.create(l):r}}:null}function smn(t){let e=n=>n.altKey&&n.button==0;return mt.mouseSelectionStyle.of((n,r)=>e(r)?omn(n,r):null)}const amn={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},lmn={style:"cursor: crosshair"};function cmn(t={}){let[e,n]=amn[t.key||"Alt"],r=Yi.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,mt.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?lmn:null})]}const E2="-10000px";class M7e{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(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,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 s=[],a=n?[]:null;for(let l=0;ln[c]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function umn(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const f7=St.define({combine:t=>{var e,n,r;return{position:Ct.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)||umn}}}),lwe=new WeakMap,Zle=Yi.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(f7);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 M7e(t,Jle,(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(f7);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=E2,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(Ct.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==E2&&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 s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(f7).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=t,s=[];for(let a=0;a=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1){u.style.top=E2;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,g=d.right-d.left,m=(e=lwe.get(c))!==null&&e!==void 0?e:d.bottom-d.top,v=c.offset||dmn,y=this.view.textDirection==ai.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-g)):Math.min(Math.max(r.left,f.left-g+(h?14:0)-v.x),r.right-g),b=this.above[a];!l.strictSide&&(b?f.top-(d.bottom-d.top)-v.yr.bottom)&&b==r.bottom-f.bottom>f.top-r.top&&(b=this.above[a]=!b);let w=(b?f.top-r.top:r.bottom-f.bottom)-p;if(wx&&O.top<_+m&&O.bottom>_&&(_=b?O.top-m-2-p:O.bottom+p+2);if(this.position=="absolute"?(u.style.top=(_-t.parent.top)/o+"px",u.style.left=(x-t.parent.left)/i+"px"):(u.style.top=_/o+"px",u.style.left=x/i+"px"),h){let O=f.left+(y?v.x:-v.x)-(x+14-7);h.style.left=O/i+"px"}c.overlap!==!0&&s.push({left:x,top:_,right:S,bottom:_+m}),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=E2}},{eventObservers:{scroll(){this.maybeMeasure()}}}),fmn=mt.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"}}}),dmn={x:0,y:0},Jle=St.define({enables:[Zle,fmn]}),az=St.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class MU{static create(e){return new MU(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new M7e(e,az,(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 hmn=Jle.compute([az],t=>{let e=t.facet(az);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:MU.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class pmn{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;ea.bottom||n.xa.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==ai.RTL?-1:1;o=n.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>al(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(Zle),n=e?e.manager.tooltips.findIndex(r=>r.create==MU.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&&!gmn(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!mmn(this.view,s,a,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 LL=4;function gmn(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-LL&&e.clientX<=n.right+LL&&e.clientY>=n.top-LL&&e.clientY<=n.bottom+LL}function mmn(t,e,n,r,i,o){let s=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,a)=e&&l<=n}function vmn(t,e={}){let n=rn.define(),r=Ko.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,fs.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(ymn)&&(i=[]);return i},provide:i=>az.from(i)});return{active:r,extension:[r,Yi.define(i=>new pmn(i,t,r,n,e.hoverTime||300)),hmn]}}function R7e(t,e){let n=t.plugin(Zle);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const ymn=rn.define(),cwe=St.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 hP(t,e){let n=t.plugin(D7e),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const D7e=Yi.fromClass(class{constructor(t){this.input=t.state.facet(pP),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(cwe);this.top=new $L(t,!0,e.topContainer),this.bottom=new $L(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(cwe);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new $L(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new $L(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(pP);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(t.view),a.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)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=>mt.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class $L{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=uwe(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=uwe(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 uwe(t){let e=t.nextSibling;return t.remove(),e}const pP=St.define({enables:D7e});class Wg extends Lb{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Wg.prototype.elementClass="";Wg.prototype.toDOM=void 0;Wg.prototype.mapMode=fs.TrackBefore;Wg.prototype.startSide=Wg.prototype.endSide=-1;Wg.prototype.point=!0;const H3=St.define(),xmn=St.define(),bmn={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Gn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},kk=St.define();function wmn(t){return[I7e(),kk.of(Object.assign(Object.assign({},bmn),t))]}const fwe=St.define({combine:t=>t.some(e=>e)});function I7e(t){return[_mn]}const _mn=Yi.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(kk).map(e=>new hwe(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(fwe),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(fwe)!=!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=Gn.iter(this.view.state.facet(H3),this.view.viewport.from),r=[],i=this.gutters.map(o=>new Smn(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==ka.Text&&s){kK(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==ka.Text){kK(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.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(kk),n=t.state.facet(kk),r=t.docChanged||t.heightChanged||t.viewportChanged||!Gn.eq(t.startState.facet(H3),t.state.facet(H3),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 s=e.indexOf(o);s<0?i.push(new hwe(this.view,o)):(this.gutters[s].update(t),i.push(this.gutters[s]))}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=>mt.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==ai.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function dwe(t){return Array.isArray(t)?t:[t]}function kK(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Smn{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Gn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let a=new L7e(e,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,s,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];kK(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 s=this.gutter;i.length==0&&!s.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(xmn)){let s=o(e,n.widget,n);s&&(i||(i=[])).push(s)}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 hwe{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,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=dwe(n.markers(e)),n.initialSpacer&&(this.spacer=new L7e(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=dwe(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!Gn.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 L7e{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":""),Cmn(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=oo(a,l,c)||s(a,l,c):s}return r}})}});class d7 extends Wg{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function h7(t,e){return t.state.facet(b_).formatNumber(e,t.state)}const Tmn=kk.compute([b_],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Omn)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new d7(h7(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(Emn)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(b_)!=e.state.facet(b_),initialSpacer(e){return new d7(h7(e,pwe(e.state.doc.lines)))},updateSpacer(e,n){let r=h7(n.view,pwe(n.view.state.doc.lines));return r==e.number?e:new d7(r)},domEventHandlers:t.facet(b_).domEventHandlers}));function kmn(t={}){return[b_.of(t),I7e(),Tmn]}function pwe(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(Amn.range(i)))}return Gn.of(e)});function Mmn(){return Pmn}const $7e=1024;let Rmn=0;class p7{constructor(e,n){this.from=e,this.to=n}}class _n{constructor(e={}){this.id=Rmn++,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=Tl.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}_n.closedBy=new _n({deserialize:t=>t.split(" ")});_n.openedBy=new _n({deserialize:t=>t.split(" ")});_n.group=new _n({deserialize:t=>t.split(" ")});_n.isolate=new _n({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});_n.contextHash=new _n({perNode:!0});_n.lookAhead=new _n({perNode:!0});_n.mounted=new _n({perNode:!0});class lz{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[_n.mounted.id]}}const Dmn=Object.create(null);class Tl{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):Dmn,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Tl(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(_n.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(_n.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}Tl.none=new Tl("",Object.create(null),0,8);class ece{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(s|yo.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!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:rce(Tl.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new lo(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new lo(Tl.none,n,r,i)))}static build(e){return Fmn(e)}}lo.empty=new lo(Tl.none,[],[],0);class tce{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 tce(this.buffer,this.index)}}class Oy{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Tl.none}toString(){let e=[];for(let n=0;n0));l=s[l+3]);return a}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),s=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function gP(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?a.length:-1;e!=c;e+=n){let u=a[e],f=l[e]+s.from;if(F7e(i,r,f,f+u.length)){if(u instanceof Oy){if(o&yo.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new th(new Imn(s,u,e,f),null,d)}else if(o&yo.IncludeAnonymous||!u.type.isAnonymous||nce(u)){let d;if(!(o&yo.IgnoreMounts)&&(d=lz.get(u))&&!d.overlay)return new vl(d.tree,f,e,s);let h=new vl(u,f,e,s);return o&yo.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&yo.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))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&yo.IgnoreOverlays)&&(i=lz.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s=o:a>o))return new vl(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 mwe(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=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 AK(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 Imn{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class th extends N7e{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 th(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&yo.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 th(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 th(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 th(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 s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),n.push(0)}return new lo(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function z7e(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;on.from||s.to=e){let a=new vl(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(gP(a,e,n,!1))}}return i?z7e(i):r}class PK{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 vl)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 vl?(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&yo.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&yo.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&yo.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,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&yo.IncludeAnonymous||a instanceof Oy||!a.type.isAnonymous||nce(a))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 s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return AK(this.node,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function nce(t){return t.children.some(e=>e instanceof Oy||!e.type.isAnonymous||nce(e))}function Fmn(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=$7e,reused:o=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new tce(n,n.length):n,l=r.types,c=0,u=0;function f(w,_,S,O,k,E){let{id:P,start:A,end:R,size:T}=a,M=u;for(;T<0;)if(a.next(),T==-1){let L=o[P];S.push(L),O.push(A-w);return}else if(T==-3){c=P;return}else if(T==-4){u=P;return}else throw new RangeError(`Unrecognized record size: ${T}`);let I=l[P],z,F,N=A-w;if(R-A<=i&&(F=m(a.pos-_,k))){let L=new Uint16Array(F.size-F.skip),B=a.pos-F.size,$=L.length;for(;a.pos>B;)$=v(F.start,L,$);z=new Oy(L,R-F.start,r),N=F.start-w}else{let L=a.pos-T;a.next();let B=[],$=[],j=P>=s?P:-1,X=0,V=R;for(;a.pos>L;)j>=0&&a.id==j&&a.size>=0?(a.end<=V-i&&(p(B,$,A,X,a.end,V,j,M),X=B.length,V=a.end),a.next()):E>2500?d(A,L,B,$):f(A,L,B,$,j,E+1);if(j>=0&&X>0&&X-1&&X>0){let Y=h(I);z=rce(I,B,$,0,B.length,0,R-A,Y,Y)}else z=g(I,B,$,R-A,M-R)}S.push(z),O.push(N)}function d(w,_,S,O){let k=[],E=0,P=-1;for(;a.pos>_;){let{id:A,start:R,end:T,size:M}=a;if(M>4)a.next();else{if(P>-1&&R=0;T-=3)A[M++]=k[T],A[M++]=k[T+1]-R,A[M++]=k[T+2]-R,A[M++]=M;S.push(new Oy(A,k[2]-R,r)),O.push(R-w)}}function h(w){return(_,S,O)=>{let k=0,E=_.length-1,P,A;if(E>=0&&(P=_[E])instanceof lo){if(!E&&P.type==w&&P.length==O)return P;(A=P.prop(_n.lookAhead))&&(k=S[E]+P.length+A)}return g(w,_,S,O,k)}}function p(w,_,S,O,k,E,P,A){let R=[],T=[];for(;w.length>O;)R.push(w.pop()),T.push(_.pop()+S-k);w.push(g(r.types[P],R,T,E-k,A-E)),_.push(k-S)}function g(w,_,S,O,k=0,E){if(c){let P=[_n.contextHash,c];E=E?[P].concat(E):[P]}if(k>25){let P=[_n.lookAhead,k];E=E?[P].concat(E):[P]}return new lo(w,_,S,O,E)}function m(w,_){let S=a.fork(),O=0,k=0,E=0,P=S.end-i,A={size:0,start:0,skip:0};e:for(let R=S.pos-w;S.pos>R;){let T=S.size;if(S.id==_&&T>=0){A.size=O,A.start=k,A.skip=E,E+=4,O+=4,S.next();continue}let M=S.pos-T;if(T<0||M=s?4:0,z=S.start;for(S.next();S.pos>M;){if(S.size<0)if(S.size==-3)I+=4;else break e;else S.id>=s&&(I+=4);S.next()}k=z,O+=T,E+=I}return(_<0||O==w)&&(A.size=O,A.start=k,A.skip=E),A.size>4?A:void 0}function v(w,_,S){let{id:O,start:k,end:E,size:P}=a;if(a.next(),P>=0&&O4){let R=a.pos-(P-4);for(;a.pos>R;)S=v(w,_,S)}_[--S]=A,_[--S]=E-w,_[--S]=k-w,_[--S]=O}else P==-3?c=O:P==-4&&(u=O);return S}let y=[],x=[];for(;a.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 lo(l[t.topID],y.reverse(),x.reverse(),b)}const vwe=new WeakMap;function q3(t,e){if(!t.isAnonymous||e instanceof Oy||e.type!=t)return 1;let n=vwe.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof lo)){n=1;break}n+=q3(t,r)}vwe.set(e,n)}return n}function rce(t,e,n,r,i,o,s,a,l){let c=0;for(let p=r;p=u)break;_+=S}if(x==b+1){if(_>u){let S=p[b];h(S.children,S.positions,0,S.children.length,g[b]+y);continue}f.push(p[b])}else{let S=g[x-1]+p[x-1].length-w;f.push(rce(t,p,g,b,x,w,S,null,l))}d.push(w+y-o)}}return h(e,n,r,i,0),(a||l)(f,d,s)}class Nmn{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 th?this.setBuffer(e.context.buffer,e.index,n):e instanceof vl&&this.map.set(e.tree,n)}get(e){return e instanceof th?this.getBuffer(e.context.buffer,e.index):e instanceof vl?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 Yx{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?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 Yx(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,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;s&&s.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 Yx(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),s.to>f)break;s=onew p7(i.from,i.to)):[new p7(0,0)]:[new p7(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 zmn{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 _n({perNode:!0});let jmn=0;class Yc{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=jmn++}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 Yc&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new Yc(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 cz(e);return r=>r.modified.indexOf(n)>-1?r:cz.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Bmn=0;class cz{constructor(e){this.name=e,this.instances=[],this.id=Bmn++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&Umn(n,a.modified));if(r)return r;let i=[],o=new Yc(e.name,i,e,n);for(let a of n)a.instances.push(o);let s=Wmn(n);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(cz.get(a,l));return o}}function Umn(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Wmn(t){let e=[[]];for(let n=0;nr.length-n.length)}function ice(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=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);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=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new uz(r,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return B7e.add(e)}const B7e=new _n;class uz{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 s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function Vmn(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function Gmn(t,e,n,r=0,i=t.length){let o=new Hmn(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Hmn{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:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=qmn(e)||uz.empty,f=Vmn(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(_n.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(m=>!m.scope||m.scope(d.tree.type)),g=e.firstChild();for(let m=0,v=a;;m++){let y=m=x||!e.nextSibling())););if(!y||x>r)break;v=y.to+a,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),c))}g&&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 qmn(t){let e=t.type.prop(B7e);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const dt=Yc.define,NL=dt(),Zm=dt(),ywe=dt(Zm),xwe=dt(Zm),Jm=dt(),zL=dt(Jm),g7=dt(Jm),Sd=dt(),M0=dt(Sd),bd=dt(),wd=dt(),MK=dt(),T2=dt(MK),jL=dt(),Ee={comment:NL,lineComment:dt(NL),blockComment:dt(NL),docComment:dt(NL),name:Zm,variableName:dt(Zm),typeName:ywe,tagName:dt(ywe),propertyName:xwe,attributeName:dt(xwe),className:dt(Zm),labelName:dt(Zm),namespace:dt(Zm),macroName:dt(Zm),literal:Jm,string:zL,docString:dt(zL),character:dt(zL),attributeValue:dt(zL),number:g7,integer:dt(g7),float:dt(g7),bool:dt(Jm),regexp:dt(Jm),escape:dt(Jm),color:dt(Jm),url:dt(Jm),keyword:bd,self:dt(bd),null:dt(bd),atom:dt(bd),unit:dt(bd),modifier:dt(bd),operatorKeyword:dt(bd),controlKeyword:dt(bd),definitionKeyword:dt(bd),moduleKeyword:dt(bd),operator:wd,derefOperator:dt(wd),arithmeticOperator:dt(wd),logicOperator:dt(wd),bitwiseOperator:dt(wd),compareOperator:dt(wd),updateOperator:dt(wd),definitionOperator:dt(wd),typeOperator:dt(wd),controlOperator:dt(wd),punctuation:MK,separator:dt(MK),bracket:T2,angleBracket:dt(T2),squareBracket:dt(T2),paren:dt(T2),brace:dt(T2),content:Sd,heading:M0,heading1:dt(M0),heading2:dt(M0),heading3:dt(M0),heading4:dt(M0),heading5:dt(M0),heading6:dt(M0),contentSeparator:dt(Sd),list:dt(Sd),quote:dt(Sd),emphasis:dt(Sd),strong:dt(Sd),link:dt(Sd),monospace:dt(Sd),strikethrough:dt(Sd),inserted:dt(),deleted:dt(),changed:dt(),invalid:dt(),meta:jL,documentMeta:dt(jL),annotation:dt(jL),processingInstruction:dt(jL),definition:Yc.defineModifier("definition"),constant:Yc.defineModifier("constant"),function:Yc.defineModifier("function"),standard:Yc.defineModifier("standard"),local:Yc.defineModifier("local"),special:Yc.defineModifier("special")};for(let t in Ee){let e=Ee[t];e instanceof Yc&&(e.name=t)}U7e([{tag:Ee.link,class:"tok-link"},{tag:Ee.heading,class:"tok-heading"},{tag:Ee.emphasis,class:"tok-emphasis"},{tag:Ee.strong,class:"tok-strong"},{tag:Ee.keyword,class:"tok-keyword"},{tag:Ee.atom,class:"tok-atom"},{tag:Ee.bool,class:"tok-bool"},{tag:Ee.url,class:"tok-url"},{tag:Ee.labelName,class:"tok-labelName"},{tag:Ee.inserted,class:"tok-inserted"},{tag:Ee.deleted,class:"tok-deleted"},{tag:Ee.literal,class:"tok-literal"},{tag:Ee.string,class:"tok-string"},{tag:Ee.number,class:"tok-number"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],class:"tok-string2"},{tag:Ee.variableName,class:"tok-variableName"},{tag:Ee.local(Ee.variableName),class:"tok-variableName tok-local"},{tag:Ee.definition(Ee.variableName),class:"tok-variableName tok-definition"},{tag:Ee.special(Ee.variableName),class:"tok-variableName2"},{tag:Ee.definition(Ee.propertyName),class:"tok-propertyName tok-definition"},{tag:Ee.typeName,class:"tok-typeName"},{tag:Ee.namespace,class:"tok-namespace"},{tag:Ee.className,class:"tok-className"},{tag:Ee.macroName,class:"tok-macroName"},{tag:Ee.propertyName,class:"tok-propertyName"},{tag:Ee.operator,class:"tok-operator"},{tag:Ee.comment,class:"tok-comment"},{tag:Ee.meta,class:"tok-meta"},{tag:Ee.invalid,class:"tok-invalid"},{tag:Ee.punctuation,class:"tok-punctuation"}]);var m7;const w_=new _n;function Xmn(t){return St.define({combine:t?e=>e.concat(t):void 0})}const Ymn=new _n;class kf{constructor(e,n,r=[],i=""){this.data=e,this.name=i,In.prototype.hasOwnProperty("tree")||Object.defineProperty(In.prototype,"tree",{get(){return Ho(this)}}),this.parser=n,this.extension=[Ey.of(this),In.languageData.of((o,s,a)=>{let l=bwe(o,s,a),c=l.type.prop(w_);if(!c)return[];let u=o.facet(c),f=l.type.prop(Ymn);if(f){let d=l.resolve(s-l.from,a);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 bwe(e,n,r).type.prop(w_)==this.data}findRegions(e){let n=e.facet(Ey);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,s)=>{if(o.prop(w_)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(_n.mounted);if(a){if(a.tree.prop(w_)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new mP(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ho(t){let e=t.field(kf.state,!1);return e?e.tree:lo.empty}class Qmn{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 k2=null;class fz{constructor(e,n,r=[],i,o,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new fz(e,n,[],lo.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Qmn(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=lo.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(Yx.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=k2;k2=this;try{return e()}finally{k2=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=wwe(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=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=Yx.applyChanges(r,l),i=lo.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);ue.from&&(this.fragments=wwe(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 j7e{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=k2;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=s,new lo(Tl.none,[],[],s-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 k2}}function wwe(t,e,n){return Yx.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class OC{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 OC(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=fz.create(e.facet(Ey).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new OC(r)}}kf.state=Ko.define({create:OC.init,update(t,e){for(let n of e.effects)if(n.is(kf.setState))return n.value;return e.startState.facet(Ey)!=e.state.facet(Ey)?OC.init(e.state):t.apply(e)}});let W7e=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(W7e=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const v7=typeof navigator<"u"&&(!((m7=navigator.scheduling)===null||m7===void 0)&&m7.isInputPending)?()=>navigator.scheduling.isInputPending():null,Kmn=Yi.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(kf.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(kf.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=W7e(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>v7&&v7()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:kf.setState.of(new OC(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>al(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()}}}),Ey=St.define({combine(t){return t.length?t[0]:null},enables:t=>[kf.state,Kmn,mt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class V7e{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Zmn=St.define(),uD=St.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 dz(t){let e=t.facet(uD);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function vP(t,e){let n="",r=t.tabSize,i=t.facet(uD)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o=e?Jmn(t,n,e):null}class RU{constructor(e,n={}){this.state=e,this.options=n,this.unit=dz(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+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return ZO(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 s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const sce=new _n;function Jmn(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return G7e(r,t,n)}function G7e(t,e,n){for(let r=t;r;r=r.next){let i=tvn(r.node);if(i)return i(ace.create(e,n,r))}return 0}function evn(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function tvn(t){let e=t.type.prop(sce);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(_n.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>H7e(s,!0,1,void 0,o&&!evn(s)?i.from:void 0)}return t.parent==null?nvn:null}function nvn(){return 0}class ace extends RU{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 ace(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(rvn(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return G7e(this.context.next,this.base,this.pos)}}function rvn(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function ivn(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),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.fromH7e(r,e,n,t)}function H7e(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==t.pos+s,l=e?ivn(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function _we({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const ovn=200;function svn(){return In.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+ovn)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=oce(s,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=vP(s,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 avn=St.define(),lce=new _n;function q7e(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(o&&a.from=e&&c.to>n&&(o=c)}}return o}function cvn(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function hz(t,e,n){for(let r of t.facet(avn)){let i=r(t,e,n);if(i)return i}return lvn(t,e,n)}function X7e(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 DU=rn.define({map:X7e}),fD=rn.define({map:X7e});function Y7e(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 zb=Ko.define({create(){return It.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(DU)&&!uvn(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Z7e),i=r?It.replace({widget:new vvn(r(e.state,n.value))}):Swe;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(fD)&&(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=>mt.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:s})}),i}function uvn(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function Q7e(t,e){return t.field(zb,!1)?e:e.concat(rn.appendConfig.of(J7e()))}const fvn=t=>{for(let e of Y7e(t)){let n=hz(t.state,e.from,e.to);if(n)return t.dispatch({effects:Q7e(t.state,[DU.of(n),K7e(t,n)])}),!0}return!1},dvn=t=>{if(!t.state.field(zb,!1))return!1;let e=[];for(let n of Y7e(t)){let r=pz(t.state,n.from,n.to);r&&e.push(fD.of(r),K7e(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function K7e(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return mt.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const hvn=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(zb,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(fD.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},gvn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:fvn},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:dvn},{key:"Ctrl-Alt-[",run:hvn},{key:"Ctrl-Alt-]",run:pvn}],mvn={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Z7e=St.define({combine(t){return np(t,mvn)}});function J7e(t){return[zb,bvn]}function eGe(t,e){let{state:n}=t,r=n.facet(Z7e),i=s=>{let a=t.lineBlockAt(t.posAtDOM(s.target)),l=pz(t.state,a.from,a.to);l&&t.dispatch({effects:fD.of(l)}),s.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 Swe=It.replace({widget:new class extends rp{toDOM(t){return eGe(t,null)}}});class vvn extends rp{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return eGe(e,this.value)}}const yvn={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class x7 extends Wg{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 xvn(t={}){let e=Object.assign(Object.assign({},yvn),t),n=new x7(e,!0),r=new x7(e,!1),i=Yi.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Ey)!=s.state.facet(Ey)||s.startState.field(zb,!1)!=s.state.field(zb,!1)||Ho(s.startState)!=Ho(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new wy;for(let l of s.viewportLineBlocks){let c=pz(s.state,l.from,l.to)?r:hz(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,wmn({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Gn.empty},initialSpacer(){return new x7(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=pz(s.state,a.from,a.to);if(c)return s.dispatch({effects:fD.of(c)}),!0;let u=hz(s.state,a.from,a.to);return u?(s.dispatch({effects:DU.of(u)}),!0):!1}})}),J7e()]}const bvn=mt.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 dD{constructor(e,n){this.specs=e;let r;function i(a){let l=_y.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof kf?a=>a.prop(w_)==s.data:s?a=>a==s:void 0,this.style=U7e(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new _y(r):null,this.themeType=n.themeType}static define(e,n){return new dD(e,n||{})}}const RK=St.define(),tGe=St.define({combine(t){return t.length?[t[0]]:null}});function b7(t){let e=t.facet(RK);return e.length?e:t.facet(tGe)}function nGe(t,e){let n=[_vn],r;return t instanceof dD&&(t.module&&n.push(mt.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(tGe.of(t)):r?n.push(RK.computeN([mt.darkTheme],i=>i.facet(mt.darkTheme)==(r=="dark")?[t]:[])):n.push(RK.of(t)),n}class wvn{constructor(e){this.markCache=Object.create(null),this.tree=Ho(e.state),this.decorations=this.buildDeco(e,b7(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Ho(e.state),r=b7(e.state),i=r!=b7(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(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 It.none;let r=new wy;for(let{from:i,to:o}of e.visibleRanges)Gmn(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=It.mark({class:l})))},i,o);return r.finish()}}const _vn=o0.high(Yi.fromClass(wvn,{decorations:t=>t.decorations})),Svn=dD.define([{tag:Ee.meta,color:"#404740"},{tag:Ee.link,textDecoration:"underline"},{tag:Ee.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.keyword,color:"#708"},{tag:[Ee.atom,Ee.bool,Ee.url,Ee.contentSeparator,Ee.labelName],color:"#219"},{tag:[Ee.literal,Ee.inserted],color:"#164"},{tag:[Ee.string,Ee.deleted],color:"#a11"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],color:"#e40"},{tag:Ee.definition(Ee.variableName),color:"#00f"},{tag:Ee.local(Ee.variableName),color:"#30a"},{tag:[Ee.typeName,Ee.namespace],color:"#085"},{tag:Ee.className,color:"#167"},{tag:[Ee.special(Ee.variableName),Ee.macroName],color:"#256"},{tag:Ee.definition(Ee.propertyName),color:"#00c"},{tag:Ee.comment,color:"#940"},{tag:Ee.invalid,color:"#f00"}]),Cvn=mt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),rGe=1e4,iGe="()[]{}",oGe=St.define({combine(t){return np(t,{afterCursor:!0,brackets:iGe,maxScanDistance:rGe,renderMatch:Tvn})}}),Ovn=It.mark({class:"cm-matchingBracket"}),Evn=It.mark({class:"cm-nonmatchingBracket"});function Tvn(t){let e=[],n=t.matched?Ovn:Evn;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 kvn=Ko.define({create(){return It.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(oGe);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=nh(e.state,i.head,-1,r)||i.head>0&&nh(e.state,i.head-1,1,r)||r.afterCursor&&(nh(e.state,i.head,1,r)||i.headmt.decorations.from(t)}),Avn=[kvn,Cvn];function Pvn(t={}){return[oGe.of(t),Avn]}const Mvn=new _n;function DK(t,e,n){let r=t.prop(e<0?_n.openedBy:_n.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 IK(t){let e=t.type.prop(Mvn);return e?e(t.node):t}function nh(t,e,n,r={}){let i=r.maxScanDistance||rGe,o=r.brackets||iGe,s=Ho(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=DK(l.type,n,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return Rvn(t,e,n,l,u,c,o)}}return Dvn(t,e,n,s,a.type,i,o)}function Rvn(t,e,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.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 g=n>0?0:h.length-1,m=n>0?h.length:-1;g!=m;g+=n){let v=s.indexOf(h[g]);if(!(v<0||r.resolveInner(p+g,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:v>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const Ivn=Object.create(null),Cwe=[Tl.none],Owe=[],Ewe=Object.create(null),Lvn=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"]])Lvn[t]=$vn(Ivn,e);function w7(t,e){Owe.indexOf(t)>-1||(Owe.push(t),console.warn(e))}function $vn(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||Ee[c];u?typeof u=="function"?l.length?l=l.map(u):w7(c,`Modifier ${c} used at start of tag`):l.length?w7(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:w7(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(a=>a.id),o=Ewe[i];if(o)return o.id;let s=Ewe[i]=Tl.define({id:Cwe.length,name:r,props:[ice({[r]:n})]});return Cwe.push(s),s.id}ai.RTL,ai.LTR;const Fvn=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=uce(t.state,n.from);return r.line?Nvn(t):r.block?jvn(t):!1};function cce(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 Nvn=cce(Wvn,0),zvn=cce(sGe,0),jvn=cce((t,e)=>sGe(t,e,Uvn(e)),0);function uce(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const A2=50;function Bvn(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-A2,r),s=t.sliceDoc(i,i+A2),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*A2?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+A2),f=t.sliceDoc(i-A2,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 Uvn(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 sGe(t,e,n=e.selection.ranges){let r=n.map(o=>uce(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>Bvn(e,r[s],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let s=0,a;si&&(o==s||s>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:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:a.from+c,insert:l+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const LK=tp.define(),Vvn=tp.define(),Gvn=St.define(),aGe=St.define({combine(t){return np(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)})}}),lGe=Ko.define({create(){return rh.empty},update(t,e){let n=e.state.facet(aGe),r=e.annotation(LK);if(r){let l=ll.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=gz(u,u.length,n.minDepth,l):u=fGe(u,e.startState.selection),new rh(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(Vvn);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(ao.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=ll.fromTransaction(e),s=e.annotation(ao.time),a=e.annotation(ao.userEvent);return o?t=t.addChanges(o,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,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 rh(t.done.map(ll.fromJSON),t.undone.map(ll.fromJSON))}});function Hvn(t={}){return[lGe,aGe.of(t),mt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?cGe:e.inputType=="historyRedo"?$K:null;return r?(e.preventDefault(),r(n)):!1}})]}function IU(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(lGe,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const cGe=IU(0,!1),$K=IU(1,!1),qvn=IU(0,!0),Xvn=IU(1,!0);class ll{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 ll(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 ll(e.changes&&mo.fromJSON(e.changes),[],e.mapped&&_h.fromJSON(e.mapped),e.startSelection&&Ve.fromJSON(e.startSelection),e.selectionsAfter.map(Ve.fromJSON))}static fromTransaction(e,n){let r=lu;for(let i of e.startState.facet(Gvn)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new ll(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,lu)}static selection(e){return new ll(void 0,lu,void 0,void 0,e)}}function gz(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 Yvn(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,s,a)=>{for(let l=0;l=c&&s<=u&&(r=!0)}}),r}function Qvn(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function uGe(t,e){return t.length?e.length?t.concat(e):t:e}const lu=[],Kvn=200;function fGe(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Kvn));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),gz(t,t.length-1,1e9,n.setSelAfter(r)))}else return[ll.selection([e])]}function Zvn(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 _7(t,e){if(!t.length)return t;let n=t.length,r=lu;for(;n;){let i=Jvn(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?[ll.selection(r)]:lu}function Jvn(t,e,n){let r=uGe(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):lu,n);if(!t.changes)return ll.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new ll(i,rn.mapEffects(t.effects,e),s,t.startSelection.map(o),r)}const eyn=/^(input\.type|delete)($|\.)/;class rh{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 rh(this.done,this.undone):this}addChanges(e,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||eyn.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):LU(n,e))}function sa(t){return t.textDirectionAt(t.state.selection.main.head)==ai.LTR}const hGe=t=>dGe(t,!sa(t)),pGe=t=>dGe(t,sa(t));function gGe(t,e){return fd(t,n=>n.empty?t.moveByGroup(n,e):LU(n,e))}const nyn=t=>gGe(t,!sa(t)),ryn=t=>gGe(t,sa(t));function iyn(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 $U(t,e,n){let r=Ho(t).resolveInner(e.head),i=n?_n.closedBy:_n.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;iyn(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?nh(t,r.from,1):nh(t,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,Ve.cursor(a,n?-1:1)}const oyn=t=>fd(t,e=>$U(t.state,e,!sa(t))),syn=t=>fd(t,e=>$U(t.state,e,sa(t)));function mGe(t,e){return fd(t,n=>{if(!n.empty)return LU(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const vGe=t=>mGe(t,!1),yGe=t=>mGe(t,!0);function xGe(t){let e=t.scrollDOM.clientHeights.empty?t.moveVertically(s,e,n.height):LU(s,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottombGe(t,!1),FK=t=>bGe(t,!0);function s0(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=Ve.cursor(r.from+o))}return i}const ayn=t=>fd(t,e=>s0(t,e,!0)),lyn=t=>fd(t,e=>s0(t,e,!1)),cyn=t=>fd(t,e=>s0(t,e,!sa(t))),uyn=t=>fd(t,e=>s0(t,e,sa(t))),fyn=t=>fd(t,e=>Ve.cursor(t.lineBlockAt(e.head).from,1)),dyn=t=>fd(t,e=>Ve.cursor(t.lineBlockAt(e.head).to,-1));function hyn(t,e,n){let r=!1,i=JO(t.selection,o=>{let s=nh(t,o.head,-1)||nh(t,o.head,1)||o.head>0&&nh(t,o.head-1,1)||o.headhyn(t,e);function Vu(t,e){let n=JO(t.state.selection,r=>{let i=e(r);return Ve.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(ip(t.state,n)),!0)}function wGe(t,e){return Vu(t,n=>t.moveByChar(n,e))}const _Ge=t=>wGe(t,!sa(t)),SGe=t=>wGe(t,sa(t));function CGe(t,e){return Vu(t,n=>t.moveByGroup(n,e))}const gyn=t=>CGe(t,!sa(t)),myn=t=>CGe(t,sa(t)),vyn=t=>Vu(t,e=>$U(t.state,e,!sa(t))),yyn=t=>Vu(t,e=>$U(t.state,e,sa(t)));function OGe(t,e){return Vu(t,n=>t.moveVertically(n,e))}const EGe=t=>OGe(t,!1),TGe=t=>OGe(t,!0);function kGe(t,e){return Vu(t,n=>t.moveVertically(n,e,xGe(t).height))}const kwe=t=>kGe(t,!1),Awe=t=>kGe(t,!0),xyn=t=>Vu(t,e=>s0(t,e,!0)),byn=t=>Vu(t,e=>s0(t,e,!1)),wyn=t=>Vu(t,e=>s0(t,e,!sa(t))),_yn=t=>Vu(t,e=>s0(t,e,sa(t))),Syn=t=>Vu(t,e=>Ve.cursor(t.lineBlockAt(e.head).from)),Cyn=t=>Vu(t,e=>Ve.cursor(t.lineBlockAt(e.head).to)),Pwe=({state:t,dispatch:e})=>(e(ip(t,{anchor:0})),!0),Mwe=({state:t,dispatch:e})=>(e(ip(t,{anchor:t.doc.length})),!0),Rwe=({state:t,dispatch:e})=>(e(ip(t,{anchor:t.selection.main.anchor,head:0})),!0),Dwe=({state:t,dispatch:e})=>(e(ip(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Oyn=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Eyn=({state:t,dispatch:e})=>{let n=FU(t).map(({from:r,to:i})=>Ve.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Ve.create(n),userEvent:"select"})),!0},Tyn=({state:t,dispatch:e})=>{let n=JO(t.selection,r=>{var i;let o=Ho(t).resolveStack(r.from,1);for(let s=o;s;s=s.next){let{node:a}=s;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&(!((i=a.parent)===null||i===void 0)&&i.parent))return Ve.range(a.to,a.from)}return r});return e(ip(t,n)),!0},kyn=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ve.create([n.main]):n.main.empty||(r=Ve.create([Ve.cursor(n.main.head)])),r?(e(ip(t,r)),!0):!1};function hD(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=e(o);ls&&(n="delete.forward",l=BL(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=BL(t,s,!1),a=BL(t,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:Ve.cursor(s,si(t)))r.between(e,e,(i,o)=>{ie&&(e=n?o:i)});return e}const AGe=(t,e,n)=>hD(t,r=>{let i=r.from,{state:o}=t,s=o.doc.lineAt(i),a,l;if(n&&!e&&i>s.from&&iAGe(t,!1,!0),PGe=t=>AGe(t,!0,!1),MGe=(t,e)=>hD(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=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=ms(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=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),RGe=t=>MGe(t,!1),Ayn=t=>MGe(t,!0),Pyn=t=>hD(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headhD(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Ryn=t=>hD(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:ar.of(["",""])},range:Ve.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Iyn=({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),s=i==o.from?i-1:ms(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:ms(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(s,i))},range:Ve.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function FU(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 s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function DGe(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of FU(t)){if(n?o.to==t.doc.length:o.from==0)continue;let s=t.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+t.lineBreak});for(let l of o.ranges)i.push(Ve.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:t.lineBreak+s.text});for(let l of o.ranges)i.push(Ve.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ve.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Lyn=({state:t,dispatch:e})=>DGe(t,e,!1),$yn=({state:t,dispatch:e})=>DGe(t,e,!0);function IGe(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of FU(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 Fyn=({state:t,dispatch:e})=>IGe(t,e,!1),Nyn=({state:t,dispatch:e})=>IGe(t,e,!0),zyn=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(FU(e).map(({from:i,to:o})=>(i>0?i--:o{let o;if(t.lineWrapping){let s=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+t.documentTop-a.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 jyn(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Ho(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(_n.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 Byn=LGe(!1),Uyn=LGe(!0);function LGe(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,a=e.doc.lineAt(o),l=!t&&o==s&&jyn(e,o);t&&(o=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new RU(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=oce(c,o);for(u==null&&(u=ZO(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));sa.from&&o{let i=[];for(let s=r.from;s<=r.to;){let a=t.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),s=a.to+1}let o=t.changes(i);return{changes:i,range:Ve.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const Wyn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new RU(t,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=fce(t,(o,s,a)=>{let l=oce(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=vP(t,l);(c!=u||a.fromt.readOnly?!1:(e(t.update(fce(t,(n,r)=>{r.push({from:n.from,insert:t.facet(uD)})}),{userEvent:"input.indent"})),!0),FGe=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(fce(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=ZO(i,t.tabSize),s=0,a=vP(t,Math.max(0,o-dz(t)));for(;s(t.setTabFocusMode(),!0),Gyn=[{key:"Ctrl-b",run:hGe,shift:_Ge,preventDefault:!0},{key:"Ctrl-f",run:pGe,shift:SGe},{key:"Ctrl-p",run:vGe,shift:EGe},{key:"Ctrl-n",run:yGe,shift:TGe},{key:"Ctrl-a",run:fyn,shift:Syn},{key:"Ctrl-e",run:dyn,shift:Cyn},{key:"Ctrl-d",run:PGe},{key:"Ctrl-h",run:NK},{key:"Ctrl-k",run:Pyn},{key:"Ctrl-Alt-h",run:RGe},{key:"Ctrl-o",run:Dyn},{key:"Ctrl-t",run:Iyn},{key:"Ctrl-v",run:FK}],Hyn=[{key:"ArrowLeft",run:hGe,shift:_Ge,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:nyn,shift:gyn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:cyn,shift:wyn,preventDefault:!0},{key:"ArrowRight",run:pGe,shift:SGe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ryn,shift:myn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:uyn,shift:_yn,preventDefault:!0},{key:"ArrowUp",run:vGe,shift:EGe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Pwe,shift:Rwe},{mac:"Ctrl-ArrowUp",run:Twe,shift:kwe},{key:"ArrowDown",run:yGe,shift:TGe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Mwe,shift:Dwe},{mac:"Ctrl-ArrowDown",run:FK,shift:Awe},{key:"PageUp",run:Twe,shift:kwe},{key:"PageDown",run:FK,shift:Awe},{key:"Home",run:lyn,shift:byn,preventDefault:!0},{key:"Mod-Home",run:Pwe,shift:Rwe},{key:"End",run:ayn,shift:xyn,preventDefault:!0},{key:"Mod-End",run:Mwe,shift:Dwe},{key:"Enter",run:Byn},{key:"Mod-a",run:Oyn},{key:"Backspace",run:NK,shift:NK},{key:"Delete",run:PGe},{key:"Mod-Backspace",mac:"Alt-Backspace",run:RGe},{key:"Mod-Delete",mac:"Alt-Delete",run:Ayn},{mac:"Mod-Backspace",run:Myn},{mac:"Mod-Delete",run:Ryn}].concat(Gyn.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),qyn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:oyn,shift:vyn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:syn,shift:yyn},{key:"Alt-ArrowUp",run:Lyn},{key:"Shift-Alt-ArrowUp",run:Fyn},{key:"Alt-ArrowDown",run:$yn},{key:"Shift-Alt-ArrowDown",run:Nyn},{key:"Escape",run:kyn},{key:"Mod-Enter",run:Uyn},{key:"Alt-l",mac:"Ctrl-l",run:Eyn},{key:"Mod-i",run:Tyn,preventDefault:!0},{key:"Mod-[",run:FGe},{key:"Mod-]",run:$Ge},{key:"Mod-Alt-\\",run:Wyn},{key:"Shift-Mod-k",run:zyn},{key:"Shift-Mod-\\",run:pyn},{key:"Mod-/",run:Fvn},{key:"Alt-A",run:zvn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Vyn}].concat(Hyn),Xyn={key:"Tab",run:$Ge,shift:FGe};function zr(){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 EC{constructor(e,n,r=0,i=e.length,o,s){this.test=s,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?a=>o(Iwe(a)):Iwe,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 as(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=Ble(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Zc(e);let i=this.normalize(n);for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==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=mz(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 a=new iS(n,e.sliceString(n,r));return S7.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=e.sliceString(n,s)+o,s=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=mz(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=iS.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(jGe.prototype[Symbol.iterator]=BGe.prototype[Symbol.iterator]=function(){return this});function Yyn(t){try{return new RegExp(t,dce),!0}catch{return!1}}function mz(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function zK(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=zr("input",{class:"cm-textfield",name:"line",value:e}),r=zr("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:vz.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},zr("label",t.state.phrase("Go to line"),": ",n)," ",zr("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:s}=t,a=s.doc.lineAt(s.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let m=h/100;l&&(m=m*(l=="-"?-1:1)+a.number/s.doc.lines),h=Math.round(s.doc.lines*m)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),g=Ve.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[vz.of(!1),mt.scrollIntoView(g.from,{y:"center"})],selection:g}),t.focus()}return{dom:r}}const vz=rn.define(),Lwe=Ko.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(vz)&&(t=n.value);return t},provide:t=>pP.from(t,e=>e?zK:null)}),Qyn=t=>{let e=hP(t,zK);if(!e){let n=[vz.of(!0)];t.state.field(Lwe,!1)==null&&n.push(rn.appendConfig.of([Lwe,Kyn])),t.dispatch({effects:n}),e=hP(t,zK)}return e&&e.dom.querySelector("input").select(),!0},Kyn=mt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Zyn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Jyn=St.define({combine(t){return np(t,Zyn,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function e0n(t){return[o0n,i0n]}const t0n=It.mark({class:"cm-selectionMatch"}),n0n=It.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function $we(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=mi.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=mi.Word)}function r0n(t,e,n,r){return t(e.sliceDoc(n,n+1))==mi.Word&&t(e.sliceDoc(r-1,r))==mi.Word}const i0n=Yi.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(Jyn),{state:n}=t,r=n.selection;if(r.ranges.length>1)return It.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return It.none;let l=n.wordAt(i.head);if(!l)return It.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return It.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!($we(s,n,i.from,i.to)&&r0n(s,n,i.from,i.to)))return It.none}else if(o=n.sliceDoc(i.from,i.to),!o)return It.none}let a=[];for(let l of t.visibleRanges){let c=new EC(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||$we(s,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(n0n.range(u,f)):(u>=i.to||f<=i.from)&&a.push(t0n.range(u,f)),a.length>e.maxMatches))return It.none}}return It.set(a)}},{decorations:t=>t.decorations}),o0n=mt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),s0n=({state:t,dispatch:e})=>{let{selection:n}=t,r=Ve.create(n.ranges.map(i=>t.wordAt(i.head)||Ve.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function a0n(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 s=!1,a=new EC(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new EC(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const l0n=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return s0n({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=a0n(t,r);return i?(e(t.update({selection:t.selection.addRange(Ve.range(i.from,i.to),!1),effects:mt.scrollIntoView(i.to)})),!0):!1},eE=St.define({combine(t){return np(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new b0n(e),scrollToMatch:e=>mt.scrollIntoView(e)})}});class UGe{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||Yyn(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 d0n(this):new u0n(this)}getCursor(e,n=0,r){let i=e.doc?e:In.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Gw(this,i,n,r):Vw(this,i,n,r)}}class WGe{constructor(e){this.spec=e}}function Vw(t,e,n,r){return new EC(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?c0n(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function c0n(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=Vw(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 Gw(t,e,n,r){return new jGe(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?f0n(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function yz(t,e){return t.slice(ms(t,e,!1),e)}function xz(t,e){return t.slice(e,ms(t,e))}function f0n(t){return(e,n,r)=>!r[0].length||(t(yz(r.input,r.index))!=mi.Word||t(xz(r.input,r.index))!=mi.Word)&&(t(xz(r.input,r.index+r[0].length))!=mi.Word||t(yz(r.input,r.index+r[0].length))!=mi.Word)}class d0n extends WGe{nextMatch(e,n,r){let i=Gw(this.spec,e,r,e.doc.length).next();return i.done&&(i=Gw(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),s=Gw(this.spec,e,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;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=Gw(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 yP=rn.define(),hce=rn.define(),Gv=Ko.define({create(t){return new C7(jK(t).create(),null)},update(t,e){for(let n of e.effects)n.is(yP)?t=new C7(n.value.create(),t.panel):n.is(hce)&&(t=new C7(t.query,n.value?pce:null));return t},provide:t=>pP.from(t,e=>e.panel)});class C7{constructor(e,n){this.query=e,this.panel=n}}const h0n=It.mark({class:"cm-searchMatch"}),p0n=It.mark({class:"cm-searchMatch cm-searchMatch-selected"}),g0n=Yi.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Gv))}update(t){let e=t.state.field(Gv);(e!=t.startState.field(Gv)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return It.none;let{view:n}=this,r=new wy;for(let i=0,o=n.visibleRanges,s=o.length;io[i+1].from-2*250;)l=o[++i].to;t.highlight(n.state,a,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?p0n:h0n)})}return r.finish()}},{decorations:t=>t.decorations});function pD(t){return e=>{let n=e.state.field(Gv,!1);return n&&n.query.spec.valid?t(e,n):HGe(e)}}const bz=pD((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=Ve.single(r.from,r.to),o=t.state.facet(eE);return t.dispatch({selection:i,effects:[gce(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),GGe(t),!0}),wz=pD((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=Ve.single(i.from,i.to),s=t.state.facet(eE);return t.dispatch({selection:o,effects:[gce(t,i),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),GGe(t),!0}),m0n=pD((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Ve.create(n.map(r=>Ve.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),v0n=({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=[],s=0;for(let a=new EC(t.doc,t.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(Ve.range(a.value.from,a.value.to))}return e(t.update({selection:Ve.create(o,s),userEvent:"select.search.matches"})),!0},Fwe=pD((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 s=[],a,l,c=[];if(o.from==r&&o.to==i&&(l=n.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(n,o.from,o.to),c.push(mt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let u=s.length==0||s[0].from>=o.to?0:o.to-o.from-l.length;a=Ve.single(o.from-u,o.to-u),c.push(gce(t,o)),c.push(n.facet(eE).scrollToMatch(a.main,t))}return t.dispatch({changes:s,selection:a,effects:c,userEvent:"input.replace"}),!0}),y0n=pD((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:mt.announce.of(r),userEvent:"input.replace.all"}),!0});function pce(t){return t.state.facet(eE).createPanel(t)}function jK(t,e){var n,r,i,o,s;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(eE);return new UGe({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:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function VGe(t){let e=hP(t,pce);return e&&e.dom.querySelector("[main-field]")}function GGe(t){let e=VGe(t);e&&e==t.root.activeElement&&e.select()}const HGe=t=>{let e=t.state.field(Gv,!1);if(e&&e.panel){let n=VGe(t);if(n&&n!=t.root.activeElement){let r=jK(t.state,e.query.spec);r.valid&&t.dispatch({effects:yP.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[hce.of(!0),e?yP.of(jK(t.state,e.query.spec)):rn.appendConfig.of(_0n)]});return!0},qGe=t=>{let e=t.state.field(Gv,!1);if(!e||!e.panel)return!1;let n=hP(t,pce);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:hce.of(!1)}),!0},x0n=[{key:"Mod-f",run:HGe,scope:"editor search-panel"},{key:"F3",run:bz,shift:wz,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:bz,shift:wz,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:qGe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:v0n},{key:"Mod-Alt-g",run:Qyn},{key:"Mod-d",run:l0n,preventDefault:!0}];class b0n{constructor(e){this.view=e;let n=this.query=e.state.field(Gv).query.spec;this.commit=this.commit.bind(this),this.searchField=zr("input",{value:n.search,placeholder:Il(e,"Find"),"aria-label":Il(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=zr("input",{value:n.replace,placeholder:Il(e,"Replace"),"aria-label":Il(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=zr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=zr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=zr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return zr("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=zr("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>bz(e),[Il(e,"next")]),r("prev",()=>wz(e),[Il(e,"previous")]),r("select",()=>m0n(e),[Il(e,"all")]),zr("label",null,[this.caseField,Il(e,"match case")]),zr("label",null,[this.reField,Il(e,"regexp")]),zr("label",null,[this.wordField,Il(e,"by word")]),...e.state.readOnly?[]:[zr("br"),this.replaceField,r("replace",()=>Fwe(e),[Il(e,"replace")]),r("replaceAll",()=>y0n(e),[Il(e,"replace all")])],zr("button",{name:"close",onclick:()=>qGe(e),"aria-label":Il(e,"close"),type:"button"},["×"])])}commit(){let e=new UGe({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:yP.of(e)}))}keydown(e){Agn(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?wz:bz)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Fwe(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(yP)&&!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(eE).top}}function Il(t,e){return t.state.phrase(e)}const UL=30,WL=/[\s\.,:;?!]/;function gce(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-UL),s=Math.min(i,n+UL),a=t.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;la.length-UL;l--)if(!WL.test(a[l-1])&&WL.test(a[l])){a=a.slice(0,l);break}}return mt.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const w0n=mt.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"}}),_0n=[Gv,o0.low(g0n),w0n];class XGe{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=Ho(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(QGe(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 Nwe(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 S0n(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+$/]:S0n(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function C0n(t,e){return n=>{for(let r=Ho(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 zwe{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function Hv(t){return t.selection.main.from}function QGe(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 mce=tp.define();function O0n(t,e,n,r){let{main:i}=t.selection,o=n-i.from,s=r-i.from;return Object.assign(Object.assign({},t.changeByRange(a=>a!=i&&n!=r&&t.sliceDoc(a.from+o,a.from+s)!=t.sliceDoc(n,r)?{range:a}:{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:e},range:Ve.cursor(a.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const jwe=new WeakMap;function E0n(t){if(!Array.isArray(t))return t;let e=jwe.get(t);return e||jwe.set(t,e=YGe(t)),e}const _z=rn.define(),xP=rn.define();class T0n{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&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(_=Ble(w))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!y||S==1&&m||b==0&&S!=0)&&(n[f]==w||r[f]==w&&(d=!0)?s[f++]=y:s.length&&(v=!1)),b=S,y+=Zc(w)}return f==l&&s[0]==0&&v?this.result(-100+(d?-200:0),s,e):h==l&&p==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-900-e.length,[p,g]):f==l?this.result(-100+(d?-200:0)+-700+(v?0:-1100),s,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 s of n){let a=s+(this.astral?Zc(as(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(e-r.length,i)}}class k0n{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:A0n,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=>Bwe(e(r),n(r)),optionClass:(e,n)=>r=>Bwe(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function Bwe(t,e){return t?e?t+" "+e:t:e}function A0n(t,e,n,r,i,o){let s=t.textDirection==ai.RTL,a=s,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&d=g||y>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let m=(e.bottom-e.top)/o.offsetHeight,v=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/m}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function P0n(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 s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;cl&&s.appendChild(document.createTextNode(a.slice(l,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function O7(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 M0n{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:s}=i.open,a=e.state.facet(ds);this.optionContent=P0n(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=O7(o.length,s,a.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(ds).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:xP.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:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=O7(o.length,s,e.state.facet(ds).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}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=O7(n.options.length,n.selected,this.view.state.facet(ds).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(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>al(this.view.state,s,"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&&D0n(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 s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.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+"-"+s,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew M0n(n,t,e)}function D0n(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 Uwe(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function I0n(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(ds);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 zwe(f,c.source,u?u(f):[],1e9-n.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new k0n(f):new T0n(f);for(let p of c.result.options)if(d=h.match(p.label)){let g=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new zwe(p,c.source,g,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,g;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((g=h.rank)!==null&&g!==void 0?g:1e9)||(d.namef.score-u.score||l(u.completion,f.completion))){let u=c.completion;!a||a.label!=u.label||a.detail!=u.detail||a.type!=null&&u.type!=null&&a.type!=u.type||a.apply!=u.apply||a.boost!=u.boost?s.push(c):Uwe(c.completion)>Uwe(a)&&(s[s.length-1]=c),a=c.completion}return s}class __{constructor(e,n,r,i,o,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new __(this.options,Wwe(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let s=I0n(e,n);if(!s.length)return i&&e.some(l=>l.state==1)?new __(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let a=n.facet(ds).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(l,c.from):l,1e8),create:j0n,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new __(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Sz{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new Sz(N0n,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(ds),o=(r.override||n.languageDataAt("autocomplete",Hv(n)).map(E0n)).map(a=>(this.active.find(c=>c.source==a)||new nc(a,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((a,l)=>a==this.active[l])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!L0n(o,this.active)?s=__.build(o,n,this.id,s,r):s&&s.disabled&&!o.some(a=>a.state==1)&&(s=null),!s&&o.every(a=>a.state!=1)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new nc(a.source,0):a));for(let a of e.effects)a.is(JGe)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new Sz(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?$0n:F0n}}function L0n(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const N0n=[];function KGe(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(mce);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 nc{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=KGe(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new nc(i.source,0)),r&4&&i.state==0&&(i=new nc(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(_z))i=new nc(i.source,1,o.value?Hv(e.state):-1);else if(o.is(xP))i=new nc(i.source,0);else if(o.is(ZGe))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(e,n){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new nc(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(Hv(e.state))}}class oS extends nc{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),s=e.changes.mapPos(this.to,1),a=Hv(e.state);if((this.explicitPos<0?a<=o:as||!i||n&2&&Hv(e.startState)==this.from)return new nc(this.source,n&4?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return z0n(i.validFor,e.state,o,s)?new oS(this.source,l,i,o,s):i.update&&(i=i.update(i,o,s,new XGe(e.state,a,l>=0)))?new oS(this.source,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Hv(e.state)):new nc(this.source,1,l)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new oS(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new nc(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function z0n(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):QGe(t,!0).test(i)}const ZGe=rn.define({map(t,e){return t.map(n=>n.map(e))}}),JGe=rn.define(),Ja=Ko.define({create(){return Sz.start()},update(t,e){return t.update(e)},provide:t=>[Jle.from(t,e=>e.tooltip),mt.contentAttributes.from(t,e=>e.attrs)]});function vce(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(Ja).active.find(i=>i.source==e.source);return r instanceof oS?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},O0n(t.state,n,r.from,r.to)),{annotations:mce.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const j0n=R0n(Ja,vce);function VL(t,e="option"){return n=>{let r=n.state.field(Ja,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),n.dispatch({effects:JGe.of(a)}),!0}}const B0n=t=>{let e=t.state.field(Ja,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Ja,!1)?(t.dispatch({effects:_z.of(!0)}),!0):!1,W0n=t=>{let e=t.state.field(Ja,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:xP.of(null)}),!0)};class V0n{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const G0n=50,H0n=1e3,q0n=Yi.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(Ja).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(Ja),n=t.state.facet(ds);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Ja)==e)return;let r=t.transactions.some(o=>{let s=KGe(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;oG0n&&Date.now()-s.time>H0n){for(let a of s.context.abortListeners)try{a()}catch(l){al(this.view.state,l)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(o=>o.effects.some(s=>s.is(_z)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.state==1&&!this.running.some(s=>s.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(Ja);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=Hv(e),r=new XGe(e,n,t.explicitPos==n,this.view),i=new V0n(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:xP.of(null)}),al(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(ds).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(ds);for(let r=0;rs.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new nc(i.active.source,0);for(let a of i.updates)s=s.update(a,n);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:ZGe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Ja,!1);if(e&&e.tooltip&&this.view.state.facet(ds).closeOnBlur){let n=e.open&&R7e(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:xP.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:_z.of(!1)}),20),this.composing=0}}}),X0n=typeof navigator=="object"&&/Win/.test(navigator.platform),Y0n=o0.highest(mt.domEventHandlers({keydown(t,e){let n=e.state.field(Ja,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(X0n&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&vce(e,r),!1}})),eHe=mt.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 Q0n{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class yce{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,fs.TrackDel),r=e.mapPos(this.to,1,fs.TrackDel);return n==null||r==null?null:new yce(this.field,n,r)}}class xce{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=s,u=/^\t*/.exec(l)[0].length;for(let f=0;fnew yce(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],o;for(let s of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(s);){let a=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 Q0n(c,r.length,o.index,o.index+u.length)),s=s.slice(0,o.index)+l+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(s)}return new xce(r,i)}}let K0n=It.widget({widget:new class extends rp{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Z0n=It.mark({class:"cm-snippetField"});class tE{constructor(e,n){this.ranges=e,this.active=n,this.deco=It.set(e.map(r=>(r.from==r.to?K0n:Z0n).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 tE(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 gD=rn.define({map(t,e){return t&&t.map(e)}}),J0n=rn.define(),bP=Ko.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(gD))return n.value;if(n.is(J0n)&&t)return new tE(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=>mt.decorations.from(t,e=>e?e.deco:It.none)});function bce(t,e){return Ve.create(t.filter(n=>n.field==e).map(n=>Ve.range(n.from,n.to)))}function exn(t){let e=xce.parse(t);return(n,r,i,o)=>{let{text:s,ranges:a}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:ar.of(s)},scrollIntoView:!0,annotations:r?[mce.of(r),ao.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=bce(a,0)),a.some(c=>c.field>0)){let c=new tE(a,0),u=l.effects=[gD.of(c)];n.state.field(bP,!1)===void 0&&u.push(rn.appendConfig.of([bP,oxn,sxn,eHe]))}n.dispatch(n.state.update(l))}}function tHe(t){return({state:e,dispatch:n})=>{let r=e.field(bP,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(s=>s.field==i+t);return n(e.update({selection:bce(r.ranges,i),effects:gD.of(o?null:new tE(r.ranges,i)),scrollIntoView:!0})),!0}}const txn=({state:t,dispatch:e})=>t.field(bP,!1)?(e(t.update({effects:gD.of(null)})),!0):!1,nxn=tHe(1),rxn=tHe(-1),ixn=[{key:"Tab",run:nxn,shift:rxn},{key:"Escape",run:txn}],Vwe=St.define({combine(t){return t.length?t[0]:ixn}}),oxn=o0.highest(lD.compute([Vwe],t=>t.facet(Vwe)));function mp(t,e){return Object.assign(Object.assign({},e),{apply:exn(t)})}const sxn=mt.domEventHandlers({mousedown(t,e){let n=e.state.field(bP,!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:bce(n.ranges,i.field),effects:gD.of(n.ranges.some(o=>o.field>i.field)?new tE(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),wP={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},wx=rn.define({map(t,e){let n=e.mapPos(t,-1,fs.TrackAfter);return n??void 0}}),wce=new class extends Lb{};wce.startSide=1;wce.endSide=-1;const nHe=Ko.define({create(){return Gn.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(wx)&&(t=t.update({add:[wce.range(n.value,n.value+1)]}));return t}});function axn(){return[cxn,nHe]}const E7="()[]{}<>";function rHe(t){for(let e=0;e{if((lxn?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Zc(as(r,0))==1||e!=i.from||n!=i.to)return!1;let o=dxn(t.state,r);return o?(t.dispatch(o),!0):!1}),uxn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=iHe(t,t.selection.main.head).brackets||wP.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let a=hxn(t.doc,s.head);for(let l of r)if(l==a&&NU(t.doc,s.head)==rHe(as(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:Ve.cursor(s.head-l.length)}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},fxn=[{key:"Backspace",run:uxn}];function dxn(t,e){let n=iHe(t,t.selection.main.head),r=n.brackets||wP.brackets;for(let i of r){let o=rHe(as(i,0));if(e==i)return o==i?mxn(t,i,r.indexOf(i+i+i)>-1,n):pxn(t,i,o,n.before||wP.before);if(e==o&&oHe(t,t.selection.main.from))return gxn(t,i,o)}return null}function oHe(t,e){let n=!1;return t.field(nHe).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function NU(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Zc(as(n,0)))}function hxn(t,e){let n=t.sliceString(e-2,e);return Zc(as(n,0))==n.length?n:n.slice(1)}function pxn(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:wx.of(s.to+e.length),range:Ve.range(s.anchor+e.length,s.head+e.length)};let a=NU(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:wx.of(s.head+e.length),range:Ve.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function gxn(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&NU(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:Ve.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function mxn(t,e,n,r){let i=r.stringPrefixes||wP.stringPrefixes,o=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:wx.of(a.to+e.length),range:Ve.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=NU(t.doc,l),u;if(c==e){if(Gwe(t,l))return{changes:{insert:e+e,from:l},effects:wx.of(l+e.length),range:Ve.cursor(l+e.length)};if(oHe(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:Ve.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=Hwe(t,l-2*e.length,i))>-1&&Gwe(t,u))return{changes:{insert:e+e+e+e,from:l},effects:wx.of(l+e.length),range:Ve.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=mi.Word&&Hwe(t,l,i)>-1&&!vxn(t,l,e,i))return{changes:{insert:e+e,from:l},effects:wx.of(l+e.length),range:Ve.cursor(l+e.length)}}return{range:o=a}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Gwe(t,e){let n=Ho(t).resolveInner(e+1);return n.parent&&n.from==e}function vxn(t,e,n,r){let i=Ho(t).resolveInner(e,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.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 Hwe(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=mi.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))!=mi.Word)return o}return-1}function sHe(t={}){return[Y0n,Ja,ds.of(t),q0n,yxn,eHe]}const aHe=[{key:"Ctrl-Space",run:U0n},{key:"Escape",run:W0n},{key:"ArrowDown",run:VL(!0)},{key:"ArrowUp",run:VL(!1)},{key:"PageDown",run:VL(!0,"page")},{key:"PageUp",run:VL(!1,"page")},{key:"Enter",run:B0n}],yxn=o0.highest(lD.computeN([ds],t=>t.facet(ds).defaultKeymap?[aHe]:[]));class xxn{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class sx{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(_P).markerFilter;o&&(i=o(i,r));let s=It.set(i.map(a=>a.from==a.to||a.from==a.to-1&&r.doc.lineAt(a.from).to==a.from?It.widget({widget:new kxn(a),diagnostic:a}).range(a.from):It.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a}).range(a.from,a.to)),!0);return new sx(s,n,TC(s))}}function TC(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new xxn(i,o,s.diagnostic),!1}),r}function bxn(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(_P).hideOn(t,n,r);if(i!=null)return i;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(lHe))||t.changes.touchesRange(o.from,Math.max(o.to,r)))}function wxn(t,e){return t.field(cc,!1)?e:e.concat(rn.appendConfig.of(Mxn))}const lHe=rn.define(),_ce=rn.define(),cHe=rn.define(),cc=Ko.define({create(){return new sx(It.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=TC(n,t.selected.diagnostic,o)||TC(n,null,o)}!n.size&&i&&e.state.facet(_P).autoPanel&&(i=null),t=new sx(n,i,r)}for(let n of e.effects)if(n.is(lHe)){let r=e.state.facet(_P).autoPanel?n.value.length?SP.open:null:t.panel;t=sx.init(n.value,r,e.state)}else n.is(_ce)?t=new sx(t.diagnostics,n.value?SP.open:null,t.selected):n.is(cHe)&&(t=new sx(t.diagnostics,t.panel,n.value));return t},provide:t=>[pP.from(t,e=>e.panel),mt.decorations.from(t,e=>e.diagnostics)]}),_xn=It.mark({class:"cm-lintRange cm-lintRange-active"});function Sxn(t,e,n){let{diagnostics:r}=t.state.field(cc),i=[],o=2e8,s=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)&&(efHe(t,n,!1)))}const Oxn=t=>{let e=t.state.field(cc,!1);(!e||!e.panel)&&t.dispatch({effects:wxn(t.state,[_ce.of(!0)])});let n=hP(t,SP.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},qwe=t=>{let e=t.state.field(cc,!1);return!e||!e.panel?!1:(t.dispatch({effects:_ce.of(!1)}),!0)},Exn=t=>{let e=t.state.field(cc,!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)},Txn=[{key:"Mod-Shift-m",run:Oxn,preventDefault:!0},{key:"F8",run:Exn}],_P=St.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},np(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 uHe(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 fHe(t,e,n){var r;let i=n?uHe(e.actions):[];return zr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},zr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let h=TC(t.state.field(cc).diagnostics,e);h&&o.apply(t,h.from,h.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),zr("u",c.slice(u,u+1)),c.slice(u+1)];return zr("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),e.source&&zr("div",{class:"cm-diagnosticSource"},e.source))}class kxn extends rp{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return zr("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Xwe{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=fHe(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class SP{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)qwe(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],s=uHe(o.actions);for(let a=0;a{for(let o=0;oqwe(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(cc).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:s,panel:a})=>{let l=a.height/this.list.offsetHeight;s.topa.bottom&&(this.list.scrollTop+=(s.bottom-a.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(cc),r=TC(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:cHe.of(r)})}static open(e){return new SP(e)}}function Axn(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function GL(t){return Axn(``,'width="6" height="3"')}const Pxn=mt.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:GL("#d11")},".cm-lintRange-warning":{backgroundImage:GL("orange")},".cm-lintRange-info":{backgroundImage:GL("#999")},".cm-lintRange-hint":{backgroundImage:GL("#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}}}),Mxn=[cc,mt.decorations.compute([cc],t=>{let{selected:e,panel:n}=t.field(cc);return!e||!n||e.from==e.to?It.none:It.set([_xn.range(e.from,e.to)])}),vmn(Sxn,{hideOn:bxn}),Pxn];var Ywe=function(e){e===void 0&&(e={});var n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(fxn)),e.defaultKeymap!==!1&&(n=n.concat(qyn)),e.searchKeymap!==!1&&(n=n.concat(x0n)),e.historyKeymap!==!1&&(n=n.concat(tyn)),e.foldKeymap!==!1&&(n=n.concat(gvn)),e.completionKeymap!==!1&&(n=n.concat(aHe)),e.lintKeymap!==!1&&(n=n.concat(Txn));var r=[];return e.lineNumbers!==!1&&r.push(kmn()),e.highlightActiveLineGutter!==!1&&r.push(Mmn()),e.highlightSpecialChars!==!1&&r.push(Hgn()),e.history!==!1&&r.push(Hvn()),e.foldGutter!==!1&&r.push(xvn()),e.drawSelection!==!1&&r.push(Lgn()),e.dropCursor!==!1&&r.push(jgn()),e.allowMultipleSelections!==!1&&r.push(In.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(svn()),e.syntaxHighlighting!==!1&&r.push(nGe(Svn,{fallback:!0})),e.bracketMatching!==!1&&r.push(Pvn()),e.closeBrackets!==!1&&r.push(axn()),e.autocompletion!==!1&&r.push(sHe()),e.rectangularSelection!==!1&&r.push(smn()),e.crosshairCursor!==!1&&r.push(cmn()),e.highlightActiveLine!==!1&&r.push(Zgn()),e.highlightSelectionMatches!==!1&&r.push(e0n()),e.tabSize&&typeof e.tabSize=="number"&&r.push(uD.of(" ".repeat(e.tabSize))),r.concat([lD.of(n.flat())]).filter(Boolean)};const Rxn="#e5c07b",Qwe="#e06c75",Dxn="#56b6c2",Ixn="#ffffff",X3="#abb2bf",BK="#7d8799",Lxn="#61afef",$xn="#98c379",Kwe="#d19a66",Fxn="#c678dd",Nxn="#21252b",Zwe="#2c313a",Jwe="#282c34",T7="#353a42",zxn="#3E4451",e_e="#528bff",jxn=mt.theme({"&":{color:X3,backgroundColor:Jwe},".cm-content":{caretColor:e_e},".cm-cursor, .cm-dropCursor":{borderLeftColor:e_e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:zxn},".cm-panels":{backgroundColor:Nxn,color:X3},".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:Jwe,color:BK,border:"none"},".cm-activeLineGutter":{backgroundColor:Zwe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:T7},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:T7,borderBottomColor:T7},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Zwe,color:X3}}},{dark:!0}),Bxn=dD.define([{tag:Ee.keyword,color:Fxn},{tag:[Ee.name,Ee.deleted,Ee.character,Ee.propertyName,Ee.macroName],color:Qwe},{tag:[Ee.function(Ee.variableName),Ee.labelName],color:Lxn},{tag:[Ee.color,Ee.constant(Ee.name),Ee.standard(Ee.name)],color:Kwe},{tag:[Ee.definition(Ee.name),Ee.separator],color:X3},{tag:[Ee.typeName,Ee.className,Ee.number,Ee.changed,Ee.annotation,Ee.modifier,Ee.self,Ee.namespace],color:Rxn},{tag:[Ee.operator,Ee.operatorKeyword,Ee.url,Ee.escape,Ee.regexp,Ee.link,Ee.special(Ee.string)],color:Dxn},{tag:[Ee.meta,Ee.comment],color:BK},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.link,color:BK,textDecoration:"underline"},{tag:Ee.heading,fontWeight:"bold",color:Qwe},{tag:[Ee.atom,Ee.bool,Ee.special(Ee.variableName)],color:Kwe},{tag:[Ee.processingInstruction,Ee.string,Ee.inserted],color:$xn},{tag:Ee.invalid,color:Ixn}]),Uxn=[jxn,nGe(Bxn)];var Wxn=mt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Vxn=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(lD.of([Xyn])),a&&(typeof a=="boolean"?l.unshift(Ywe()):l.unshift(Ywe(a))),s&&l.unshift(nmn(s)),o){case"light":l.push(Wxn);break;case"dark":l.push(Uxn);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(mt.editable.of(!1)),i&&l.push(In.readOnly.of(!0)),[...l]},Gxn=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)}),t_e=tp.define(),Hxn=[];function qxn(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=Hxn,autoFocus:l,theme:c="light",height:u="",minHeight:f="",maxHeight:d="",placeholder:h="",width:p="",minWidth:g="",maxWidth:m="",editable:v=!0,readOnly:y=!1,indentWithTab:x=!0,basicSetup:b=!0,root:w,initialState:_}=t,[S,O]=D.useState(),[k,E]=D.useState(),[P,A]=D.useState(),R=mt.theme({"&":{height:u,minHeight:f,maxHeight:d,width:p,minWidth:g,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),T=mt.updateListener.of(z=>{if(z.docChanged&&typeof r=="function"&&!z.transactions.some(L=>L.annotation(t_e))){var F=z.state.doc,N=F.toString();r(N,z)}i&&i(Gxn(z))}),M=Vxn({theme:c,editable:v,readOnly:y,placeholder:h,indentWithTab:x,basicSetup:b}),I=[T,R,...M];return s&&typeof s=="function"&&I.push(mt.updateListener.of(s)),I=I.concat(a),D.useEffect(()=>{if(S&&!P){var z={doc:e,selection:n,extensions:I},F=_?In.fromJSON(_.json,z,_.fields):In.create(z);if(A(F),!k){var N=new mt({state:F,parent:S,root:w});E(N),o&&o(N,F)}}return()=>{k&&(A(void 0),E(void 0))}},[S,P]),D.useEffect(()=>O(t.container),[t.container]),D.useEffect(()=>()=>{k&&(k.destroy(),E(void 0))},[k]),D.useEffect(()=>{l&&k&&k.focus()},[l,k]),D.useEffect(()=>{k&&k.dispatch({effects:rn.reconfigure.of(I)})},[c,a,u,f,d,p,g,m,h,v,y,x,b,r,s]),D.useEffect(()=>{if(e!==void 0){var z=k?k.state.doc.toString():"";k&&e!==z&&k.dispatch({changes:{from:0,to:z.length,insert:e||""},annotations:[t_e.of(!0)]})}},[e,k]),{state:P,setState:A,view:k,setView:E,container:S,setContainer:O}}var Xxn=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],zU=D.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:w,readOnly:_,root:S,initialState:O}=t,k=Dt(t,Xxn),E=D.useRef(null),{state:P,view:A,container:R}=qxn({container:E.current,root:S,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:w,readOnly:_,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:O});if(D.useImperativeHandle(e,()=>({editor:E.current,state:P,view:A}),[E,R,P,A]),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 C.jsx("div",ve({ref:E,className:""+T+(n?" "+n:"")},k))});zU.displayName="CodeMirror";var n_e={};let Yxn=class UK{constructor(e,n,r,i,o,s,a,l,c,u=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,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 UK(e,[],n,r,r,0,[],0,i?new r_e(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,s=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&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+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:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.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 UK(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 Qxn(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,s;ol&1&&a==s)||i.push(n[o],s)}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 s=this.findForcedReduction();if(s==null)return!1;n=s}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,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};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 r_e{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Qxn{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 Cz{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 Cz(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 Cz(this.stack,this.pos,this.index)}}function HL(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class Y3{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const i_e=new Y3;class Kxn{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=i_e,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 s=this.ranges[++i];o+=s.from-r.to,r=s}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&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.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=i_e,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 sS{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Zxn(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}sS.prototype.contextual=sS.prototype.fallback=sS.prototype.extend=!1;sS.prototype.fallback=sS.prototype.extend=!1;class jU{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Zxn(t,e,n,r,i,o){let s=0,a=1<0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||Jxn(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,d=t[s+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){s=t[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),g=t[p],m=t[p+1]||65536;if(u=m)f=h+1;else{s=t[p+2],e.advance();continue e}}break}}function o_e(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function Jxn(t,e,n,r){let i=o_e(n,r,e);return i<0||o_e(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 ebn{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?s_e(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?s_e(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=s,null;if(o instanceof lo){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class tbn{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Y3)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=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 Y3,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 Y3,{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 s=0;s=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>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 ebn(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[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&obn(i);if(s)return Ll&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Ll&&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 s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return Ll&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s ":"";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(_n.contextHash)||0)==u))return e.useNode(f,d),Ll&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof lo)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof lo&&f.positions[0]==0)f=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ll&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&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 a_e(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let s=0;s ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),Ll&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&(Ll&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)Ll&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))Ll&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),Ll&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),a_e(a,r)):(!i||i.scoret;class ibn{constructor(e){this.start=e.start,this.shift=e.shift||A7,this.reduce=e.reduce||A7,this.reuse=e.reuse||A7,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class CP extends j7e{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 a=0;ae.topRules[a][1]),i=[];for(let a=0;a=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)o(a[c++],l,f);c++}}}this.nodeSet=new ece(n.map((a,l)=>Tl.define({name:l>=this.minRepeatTerm?void 0:a,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=$7e;let s=HL(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new sS(s,a):a),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 nbn(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 s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>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=jp(this.data,o+2);else break;i=n(jp(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=jp(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(CP.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(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=l_e(s),s})),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 s=n.indexOf(o);s>=0&&(r[s]=!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 sbn=ice({String:Ee.string,Number:Ee.number,"True False":Ee.bool,PropertyName:Ee.propertyName,Null:Ee.null,",":Ee.separator,"[ ]":Ee.squareBracket,"{ }":Ee.brace}),abn=CP.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:[sbn],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}),lbn=mP.define({name:"json",parser:abn.configure({props:[sce.add({Object:_we({except:/^\s*\}/}),Array:_we({except:/^\s*\]/})}),lce.add({"Object Array":q7e})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function dHe(){return new V7e(lbn)}const cbn=1,hHe=194,pHe=195,ubn=196,c_e=197,fbn=198,dbn=199,hbn=200,pbn=2,gHe=3,u_e=201,gbn=24,mbn=25,vbn=49,ybn=50,xbn=55,bbn=56,wbn=57,_bn=59,Sbn=60,Cbn=61,Obn=62,Ebn=63,Tbn=65,kbn=238,Abn=71,Pbn=241,Mbn=242,Rbn=243,Dbn=244,Ibn=245,Lbn=246,$bn=247,Fbn=248,mHe=72,Nbn=249,zbn=250,jbn=251,Bbn=252,Ubn=253,Wbn=254,Vbn=255,Gbn=256,Hbn=73,qbn=77,Xbn=263,Ybn=112,Qbn=130,Kbn=151,Zbn=152,Jbn=155,jb=10,OP=13,Sce=32,BU=9,Cce=35,e1n=40,t1n=46,WK=123,f_e=125,vHe=39,yHe=34,n1n=92,r1n=111,i1n=120,o1n=78,s1n=117,a1n=85,l1n=new Set([mbn,vbn,ybn,Xbn,Tbn,Qbn,bbn,wbn,kbn,Obn,Ebn,mHe,Hbn,qbn,Sbn,Cbn,Kbn,Zbn,Jbn,Ybn]);function P7(t){return t==jb||t==OP}function M7(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const c1n=new jU((t,e)=>{let n;if(t.next<0)t.acceptToken(dbn);else if(e.context.flags&Q3)P7(t.next)&&t.acceptToken(fbn,1);else if(((n=t.peek(-1))<0||P7(n))&&e.canShift(c_e)){let r=0;for(;t.next==Sce||t.next==BU;)t.advance(),r++;(t.next==jb||t.next==OP||t.next==Cce)&&t.acceptToken(c_e,-r)}else P7(t.next)&&t.acceptToken(ubn,1)},{contextual:!0}),u1n=new jU((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==jb||r==OP){let i=0,o=0;for(;;){if(t.next==Sce)i++;else if(t.next==BU)i+=8-i%8;else break;t.advance(),o++}i!=n.indent&&t.next!=jb&&t.next!=OP&&t.next!=Cce&&(i[t,e|xHe])),h1n=new ibn({start:f1n,reduce(t,e,n,r){return t.flags&Q3&&l1n.has(e)||(e==Abn||e==mHe)&&t.flags&xHe?t.parent:t},shift(t,e,n,r){return e==hHe?new K3(t,d1n(r.read(r.pos,n.pos)),0):e==pHe?t.parent:e==gbn||e==xbn||e==_bn||e==gHe?new K3(t,0,Q3):d_e.has(e)?new K3(t,0,d_e.get(e)|t.flags&Q3):t},hash(t){return t.hash}}),p1n=new jU(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==Sce||n==BU)){n!=e1n&&n!=t1n&&n!=jb&&n!=OP&&n!=Cce&&t.acceptToken(cbn);return}}}),g1n=new jU((t,e)=>{let{flags:n}=e.context,r=n&Op?yHe:vHe,i=(n&Ep)>0,o=!(n&Tp),s=(n&kp)>0,a=t.pos;for(;!(t.next<0);)if(s&&t.next==WK)if(t.peek(1)==WK)t.advance(2);else{if(t.pos==a){t.acceptToken(gHe,1);return}break}else if(o&&t.next==n1n){if(t.pos==a){t.advance();let l=t.next;l>=0&&(t.advance(),m1n(t,l)),t.acceptToken(pbn);return}break}else if(t.next==r&&(!i||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==a){t.acceptToken(u_e,i?3:1);return}break}else if(t.next==jb){if(i)t.advance();else if(t.pos==a){t.acceptToken(u_e);return}break}else t.advance();t.pos>a&&t.acceptToken(hbn)});function m1n(t,e){if(e==r1n)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==i1n)for(let n=0;n<2&&M7(t.next);n++)t.advance();else if(e==s1n)for(let n=0;n<4&&M7(t.next);n++)t.advance();else if(e==a1n)for(let n=0;n<8&&M7(t.next);n++)t.advance();else if(e==o1n&&t.next==WK){for(t.advance();t.next>=0&&t.next!=f_e&&t.next!=vHe&&t.next!=yHe&&t.next!=jb;)t.advance();t.next==f_e&&t.advance()}}const v1n=ice({'async "*" "**" FormatConversion FormatSpec':Ee.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Ee.controlKeyword,"in not and or is del":Ee.operatorKeyword,"from def class global nonlocal lambda":Ee.definitionKeyword,import:Ee.moduleKeyword,"with as print":Ee.keyword,Boolean:Ee.bool,None:Ee.null,VariableName:Ee.variableName,"CallExpression/VariableName":Ee.function(Ee.variableName),"FunctionDefinition/VariableName":Ee.function(Ee.definition(Ee.variableName)),"ClassDefinition/VariableName":Ee.definition(Ee.className),PropertyName:Ee.propertyName,"CallExpression/MemberExpression/PropertyName":Ee.function(Ee.propertyName),Comment:Ee.lineComment,Number:Ee.number,String:Ee.string,FormatString:Ee.special(Ee.string),Escape:Ee.escape,UpdateOp:Ee.updateOperator,"ArithOp!":Ee.arithmeticOperator,BitOp:Ee.bitwiseOperator,CompareOp:Ee.compareOperator,AssignOp:Ee.definitionOperator,Ellipsis:Ee.punctuation,At:Ee.meta,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace,".":Ee.derefOperator,", ;":Ee.separator}),y1n={__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},x1n=CP.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:[p1n,u1n,c1n,g1n,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>y1n[t]||-1}],tokenPrec:7652}),h_e=new Nmn,bHe=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function qL(t){return(e,n,r)=>{if(r)return!1;let i=e.node.getChild("VariableName");return i&&n(i,t),!0}}const b1n={FunctionDefinition:qL("function"),ClassDefinition:qL("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 s=i.getChild("import");s;s=s.nextSibling)s.name=="VariableName"&&((r=s.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(s,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:qL("variable"),AsPattern:qL("variable"),__proto__:null};function wHe(t,e){let n=h_e.get(e);if(n)return n;let r=[],i=!0;function o(s,a){let l=t.sliceString(s.from,s.to);r.push({label:l,type:a})}return e.cursor(yo.IncludeAnonymous).iterate(s=>{if(s.name){let a=b1n[s.name];if(a&&a(s,o,i)||!i&&bHe.has(s.name))return!1;i=!1}else if(s.to-s.from>8192){for(let a of wHe(t,s.node))r.push(a);return!1}}),h_e.set(e,r),r}const p_e=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,_He=["String","FormatString","Comment","PropertyName"];function w1n(t){let e=Ho(t.state).resolveInner(t.pos,-1);if(_He.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&p_e.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)bHe.has(i.name)&&(r=r.concat(wHe(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:p_e}}const _1n=["__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"}))),S1n=[mp("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),mp("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),mp("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),mp("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),mp(`if \${}: +`;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Sy={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},lP={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Jhn=typeof navigator<"u"&&/Mac/.test(navigator.platform),epn=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ls=0;ls<10;ls++)Sy[48+ls]=Sy[96+ls]=String(ls);for(var ls=1;ls<=24;ls++)Sy[ls+111]="F"+ls;for(var ls=65;ls<=90;ls++)Sy[ls]=String.fromCharCode(ls+32),lP[ls]=String.fromCharCode(ls);for(var r7 in Sy)lP.hasOwnProperty(r7)||(lP[r7]=Sy[r7]);function tpn(t){var e=Jhn&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||epn&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?lP:Sy)[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 cP(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function sK(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function npn(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function B3(t,e){if(!e.anchorNode)return!1;try{return sK(t,e.anchorNode)}catch{return!1}}function wC(t){return t.nodeType==3?Fb(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Ok(t,e,n,r){return n?S1e(t,e,n,r,-1)||S1e(t,e,n,r,1):!1}function $b(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function nz(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function S1e(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Bg(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=$b(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?Bg(t):0}else return!1}}function Bg(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function oD(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function rpn(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 k9e(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 ipn(t,e,n,r,i,o,s,a){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,g=1;if(h)d=rpn(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:g}=k9e(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*g}}let m=0,v=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+v&&(v=e.bottom-d.bottom+v+s)):e.bottom>d.bottom&&(v=e.bottom-d.bottom+s,n<0&&e.top-v0&&e.right>d.right+m&&(m=e.right-d.right+m+o)):e.right>d.right&&(m=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 spn{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?Bg(n):0),r,Math.min(e.focusOffset,r?Bg(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let hw=null;function A9e(t){if(t.setActive)return t.setActive();if(hw)return t.focus(hw);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(hw==null?{get preventScroll(){return hw={preventScroll:!0},!0}}:void 0),!hw){hw=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function R9e(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=Bg(n)}else if(n.parentNode&&!nz(n))r=$b(n),n=n.parentNode;else return null}}function D9e(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){s=l,a=u;break}u=d,c=d+f.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].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=Gle){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 L9e(t,e,n,r,i,o,s,a,l){let{children:c}=t,u=c.length?c[e]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:s;if(!(e==r&&u&&!s&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,n==0,a,l))){if(r0&&(!s&&o.length&&u.merge(n,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(n2);var Ct={mac:k1e||/Mac/.test(Za.platform),windows:/Win/.test(Za.platform),linux:/Linux|X11/.test(Za.platform),ie:PU,ie_version:F9e?aK.documentMode||6:cK?+cK[1]:lK?+lK[1]:0,gecko:E1e,gecko_version:E1e?+(/Firefox\/(\d+)/.exec(Za.userAgent)||[0,0])[1]:0,chrome:!!i7,chrome_version:i7?+i7[1]:0,ios:k1e,android:/Android\b/.test(Za.userAgent),webkit:T1e,safari:N9e,webkit_version:T1e?+(/\bAppleWebKit\/(\d+)/.exec(Za.userAgent)||[0,0])[1]:0,tabSize:aK.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const cpn=256;class Qf extends Ir{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 Qf)||this.length-(n-e)+r.length>cpn||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 Qf(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 Xs(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 upn(this.dom,e,n)}}class Ug extends Ir{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(P9e(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,s){return r&&(!(r instanceof Ug&&r.mark.eq(this.mark))||e&&o<=0||ne&&n.push(r=e&&(i=o),r=l,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Ug(this.mark,n,s)}domAtPos(e){return z9e(this,e)}coordsAt(e,n){return B9e(this,e,n)}}function upn(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&n<0||e==r&&n>=0?Ct.chrome||Ct.gecko||(e?(i--,s=1):o=0)?0:a.length-1];return Ct.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?oD(l,s<0):l||null}class _v extends Ir{static create(e,n,r){return new _v(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=_v.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,s){return r&&(!(r instanceof _v)||!this.widget.compare(r.widget)||e>0&&o<=0||n0)?Xs.before(this.dom):Xs.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 s=this.side?this.side<0:e>0;for(let a=s?i.length-1:0;o=i[a],!(e>0?a==0:a==i.length-1||o.top0?Xs.before(this.dom):Xs.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return ar.empty}get isHidden(){return!0}}Qf.prototype.children=_v.prototype.children=_C.prototype.children=Gle;function z9e(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;io&&e0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o0&&e instanceof Ug&&i.length&&(r=i[i.length-1])instanceof Ug&&r.mark.eq(e.mark)?j9e(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function B9e(t,e,n){let r=null,i=-1,o=null,s=-1;function a(c,u){for(let f=0,d=0;f=u&&(h.children.length?a(h,u-d):(!o||o.isHidden&&n>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,s=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 fK(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 dpn(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Cy(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:s}=U9e(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new Cy(e,r,i,n,e.widget||null,!0)}static line(e){return new aD(e)}static set(e,n=!1){return Gn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}It.none=Gn.empty;class sD extends It{constructor(e){let{start:n,end:r}=U9e(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 sD&&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))&&rz(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)}}sD.prototype.point=!1;class aD extends It{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof aD&&this.spec.class==e.spec.class&&rz(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)}}aD.prototype.mapMode=fs.TrackBefore;aD.prototype.point=!0;class Cy extends It{constructor(e,n,r,i,o,s){super(n,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?fs.TrackBefore:fs.TrackAfter:fs.TrackDel}get type(){return this.startSide!=this.endSide?ka.WidgetRange:this.startSide<=0?ka.WidgetBefore:ka.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Cy&&hpn(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)}}Cy.prototype.point=!0;function U9e(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 hpn(t,e){return t==e||!!(t&&e&&t.compare(e))}function dK(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 no extends Ir{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,s){if(r){if(!(r instanceof no))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),$9e(this,e,n,r?r.children.slice():[],o,s),!0}split(e){let n=new no;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){rz(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){j9e(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=uK(n,this.attrs||{})),r&&(this.attrs=uK({class:r},this.attrs||{}))}domAtPos(e){return z9e(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(P9e(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&&(fK(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&&Ir.get(i)instanceof Ug;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Ir.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!Ct.ios||!this.children.some(o=>o instanceof Qf))){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 Qf)||/[^ -~]/.test(r.text))return null;let i=wC(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=B9e(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 no)return o;if(s>n)break}i=s+o.breakAfter}return null}}class vg extends Ir{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,s){return r&&(!(r instanceof vg)||!this.widget.compare(r.widget)||e>0&&o<=0||n0}}class hK extends rp{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 Ek{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 vg&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new no),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(EL(new _C(-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 vg)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){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(EL(new Qf(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,s){if(this.disallowBlockEffectsFor[s]&&r instanceof Cy){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 a=n-e;if(r instanceof Cy)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new vg(r.widget||SC.block,a,r));else{let l=_v.create(r.widget||SC.inline,a,a?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(EL(new _C(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(EL(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);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(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 s=new Ek(e,n,r,o);return s.openEnd=Gn.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function EL(t,e){for(let n of e)t=new Ug(n,[t],t.length);return t}class SC extends rp{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}}SC.inline=new SC("span");SC.block=new SC("div");var ai=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(ai||(ai={}));const Nb=ai.LTR,Hle=ai.RTL;function W9e(t){let e=[];for(let n=0;n=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.fromn:e[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function G9e(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;g-=3)if(xd[g+1]==-h){let m=xd[g+2],v=m&2?i:m&4?m&1?o:i:0;v&&(Dr[f]=Dr[xd[g]]=v),a=g;break}}else{if(xd.length==189)break;xd[a++]=f,xd[a++]=d,xd[a++]=l}else if((p=Dr[f])==2||p==1){let g=p==i;l=g?0:1;for(let m=a-3;m>=0;m-=3){let v=xd[m+2];if(v&2)break;if(g)xd[m+2]|=2;else{if(v&4)break;xd[m+2]|=4}}}}}function xpn(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:t,a=il;)p==m&&(p=n[--g].from,m=g?n[g-1].to:t),Dr[--p]=h;l=u}else o=c,l++}}}function gK(t,e,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&s.push(new Sv(l,g.from,h));let m=g.direction==Nb!=!(h%2);mK(t,m?r+1:r,i,g.inner,g.from,g.to,s),l=g.to}p=g.to}else{if(p==n||(u?Dr[p]!=a:Dr[p]==a))break;p++}d?gK(t,l,p,r+1,i,d,s):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let g=Dr[l-1];g!=a&&(u=!1,f=g==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let g=o[--c];if(!u)for(let m=g.from,v=c;;){if(m==e)break e;if(v&&o[v-1].to==m)m=o[--v].from;else{if(Dr[m-1]==a)break e;break}}if(d)d.push(g);else{g.toDr.length;)Dr[Dr.length]=256;let r=[],i=e==Nb?0:1;return mK(t,i,i,n,0,t.length,r),r}function H9e(t){return[new Sv(0,t,0)]}let q9e="";function wpn(t,e,n,r,i){var o;let s=r.head-t.from,a=Sv.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[a],c=l.side(i,n);if(s==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],s=l.side(!i,n),c=l.side(i,n)}let u=ms(t.text,s,l.forward(i,n));(ul.to)&&(u=c),q9e=t.text.slice(Math.min(s,u),Math.max(s,u));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)t.some(e=>e)}),t7e=St.define({combine:t=>t.some(e=>e)}),n7e=St.define();class rS{constructor(e,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new rS(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 rS(Ve.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const TL=rn.define({map:(t,e)=>t.map(e)}),r7e=rn.define();function al(t,e,n){let r=t.facet(K9e);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 iv=St.define({combine:t=>t.length?t[0]:!0});let Spn=0;const AT=St.define();class Yi{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:s}=n||{};return new Yi(Spn++,e,r,i,a=>{let l=[AT.of(a)];return s&&l.push(uP.of(c=>{let u=c.plugin(a);return u?s(u):It.none})),o&&l.push(o(a)),l})}static fromClass(e,n){return Yi.define(r=>new e(r),n)}}class o7{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(al(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){al(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){al(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const i7e=St.define(),qle=St.define(),uP=St.define(),o7e=St.define(),Xle=St.define(),s7e=St.define();function P1e(t,e){let n=t.state.facet(s7e);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return Gn.spans(r,e.from,e.to,{point(){},span(o,s,a,l){let c=o-e.from,u=s-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=_pn(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 g={from:c,to:u,direction:h,inner:[]};f.push(g),f=g.inner}}}}),i}const a7e=St.define();function l7e(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(a7e)){let s=o(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const PT=St.define();class gu{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new gu(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 gu(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class iz{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=mo.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new gu(o,s,a,l))),this.changedRanges=i}static create(e,n,r){return new iz(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 M1e extends Ir{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=It.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 no],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new gu(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:!Ppn(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?Opn(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new gu(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,(Ct.ie||Ct.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=kpn(s,a,e.changes);return r=gu.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 s=Ct.chrome||Ct.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:f}=a,d,h,p,g;if(r&&r.range.fromBu){let b=Ek.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),w=Ek.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=b.breakAtStart,p=b.openStart,g=w.openEnd;let _=this.compositionView(r);w.breakAtStart?_.breakAfter=1:w.content.length&&_.merge(_.length,_.length,w.content[0],!1,w.openStart,0)&&(_.breakAfter=w.content[0].breakAfter,w.content.shift()),b.content.length&&_.merge(0,0,b.content[b.content.length-1],!0,0,b.openEnd)&&b.content.pop(),d=b.content.concat(_).concat(w.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:g}=Ek.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:v}=o.findPos(c,1),{i:y,off:x}=o.findPos(l,-1);L9e(this,y,x,m,v,d,h,p,g)}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(r7e)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Qf(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Ug(i,[n],n.length);let r=new no;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=Ir.get(o);a&&a!=s&&(a.dom=null),s.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&&B3(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(Ct.gecko&&a.empty&&!this.hasComposition&&Cpn(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Xs(f,0),s=!0}let u=this.view.observer.selectionRange;(s||!u.focusNode||(!Ok(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Ok(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{Ct.android&&Ct.chrome&&this.dom.contains(u.focusNode)&&Apn(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=cP(this.view.root);if(f)if(a.empty){if(Ct.gecko){let d=Epn(l.node,l.offset);if(d&&d!=3){let h=(d==1?R9e:D9e)(l.node,l.offset);h&&(l=new Xs(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.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 Xs(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Xs(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Ok(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=cP(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=no.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.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=Ir.get(n.childNodes[i]);o instanceof no&&(r=o.domAtPos(o.length))}return r?new Xs(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Ir.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;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(le||a.covers(1))&&(!r||a instanceof no&&!(r instanceof no&&n>=0)))r=a,i=c;else if(r&&c==e&&l==e&&a instanceof vg&&Math.abs(n)<2){if(a.deco.startSide<0)break;s&&(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 no))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof Qf))return null;let o=ms(i.text,r);if(o==r)return null;let s=Fb(i.dom,r,o).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==ai.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),s){let p=f.dom.lastChild,g=p?wC(p):[];if(g.length){let m=g[g.length-1],v=l?m.right-h.left:h.right-m.left;v>a&&(a=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"?ai.RTL:ai.LTR}measureTextSize(){for(let o of this.children)if(o instanceof no){let s=o.measureTextSize();if(s)return s}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=wC(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 I9e(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],s=o?o.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(It.replace({widget:new hK(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return It.set(e)}updateDeco(){let e=1,n=this.view.state.facet(uP).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(o7e).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(Gn.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=l7e(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;ipn(this.view.scrollDOM,s,n.head{re.from&&(n=!0)}),n}function Mpn(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return Ve.cursor(e);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=ms(i.text,o,!1):a=ms(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=ms(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;at?e.left-t:Math.max(0,t-e.right)}function Dpn(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function s7(t,e){return t.tope.top+1}function R1e(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function yK(t,e,n){let r,i,o,s,a=!1,l,c,u,f;for(let p=t.firstChild;p;p=p.nextSibling){let g=wC(p);for(let m=0;mx||s==x&&o>y){r=p,i=v,o=y,s=x;let b=x?n0?m0)}y==0?n>v.bottom&&(!u||u.bottomv.top)&&(c=p,f=v):u&&s7(u,v)?u=D1e(u,v.bottom):f&&s7(f,v)&&(f=R1e(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 I1e(r,d,n);if(a&&r.contentEditable!="false")return yK(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 I1e(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;an?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((Ct.chrome||Ct.gecko)&&Fb(t,a).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:t,offset:a+(h?1:0)};i=a+(h?1:0),o=f}}}return{node:t,offset:i>-1?i:s>0?t.nodeValue.length:0}}function u7e(t,e,n,r=-1){var i,o;let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:u,y:f}=e,d=f-a;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let b=t.viewState.heightOracle.textHeight/2,w=!1;l=t.elementAtHeight(d),l.type!=ka.Text;)for(;d=r>0?l.bottom+b:l.top-b,!(d>=0&&d<=c);){if(w)return n?null:0;w=!0,r=-r}f=a+d;let h=l.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:L1e(t,s,l,u,f);let p=t.dom.ownerDocument,g=t.root.elementFromPoint?t.root:p,m=g.elementFromPoint(u,f);m&&!t.contentDOM.contains(m)&&(m=null),m||(u=Math.max(s.left+1,Math.min(s.right-1,u)),m=g.elementFromPoint(u,f),m&&!t.contentDOM.contains(m)&&(m=null));let v,y=-1;if(m&&((i=t.docView.nearest(m))===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)||Ct.safari&&Ipn(v,y,u)||Ct.chrome&&Lpn(v,y,u))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let b=no.find(t.docView,h);if(!b)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=yK(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 a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);o+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+rK(s,o,t.state.tabSize)}function Ipn(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 Fb(t,r-1,r).getBoundingClientRect().left>n}function Lpn(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():Fb(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function xK(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==ka.Text))return r}return n}function $pn(t,e,n,r){let i=xK(t,e.head),o=!r||i.type!=ka.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==ai.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return Ve.cursor(l,n?-1:1)}return Ve.cursor(n?i.to:i.from,n?-1:1)}function $1e(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=wpn(i,o,s,a,n),u=q9e;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;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 a}else{if(!r)return c;l=r(u)}a=c}}function Fpn(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let s=r(o);return i==mi.Space&&(i=s),i==s}}function Npn(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return Ve.cursor(i,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),u=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let h=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),a=(o<0?h.top:h.bottom)+u}let f=l.left+s,d=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*o,g=u7e(t,{x:f,y:p},!1,o);if(pl.bottom||(o<0?gi)){let m=t.docView.coordsForChar(g),v=!m||p{if(e>o&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ve.cursor(r,ro)&&this.lineBreak(),i=s}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,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let n=Ir.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+(jpn(e,r.node,r.offset)?n:0))}}function jpn(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=o||s?[]:Vpn(e),l=new zpn(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Gpn(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!sK(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!sK(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((Ct.ios||Ct.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=i.from,c=null;(o===8||Ct.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))}:(Ct.mac||Ct.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=Ve.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:ar.of([" "])}):Ct.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` + `&&t.lineWrapping&&(r&&(r=Ve.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:ar.of([" "])}),n)return Yle(t,n,r,o);if(r&&!r.main.eq(i)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function Yle(t,e,n,r=-1){if(Ct.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Ct.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&&nS(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&nS(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&nS(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=Upn(t,e,n));return t.state.facet(Z9e).some(l=>l(t,e.from,e.to,o,a))||t.dispatch(a()),!0}function Upn(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 a=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=i.changes(e),l=n&&n.main.to<=a.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&&c7e(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:a,range:l||p.map(a)};let g=p.to-d,m=g-c.length;if(p.to-p.from!=h||t.state.sliceDoc(m,g)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let v=i.changes({from:m,to:g,insert:e.insert}),y=p.to-o.to;return{changes:v,range:l?Ve.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):p.map(v)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Wpn(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function Vpn(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 F1e(n,r)),(i!=n||o!=r)&&e.push(new F1e(i,o))),e}function Gpn(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?Ve.single(n+e,r+e):null}class Hpn{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,Ct.safari&&e.contentDOM.addEventListener("input",()=>null),Ct.gecko&&lgn(e.contentDOM.ownerDocument)}handleEvent(e){!egn(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=qpn(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}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&&h7e.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ct.android&&Ct.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Ct.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=d7e.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Xpn.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:Ct.safari&&!Ct.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 N1e(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){al(n.state,i)}}}function qpn(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 s=i.domEventHandlers[o];s&&n(o).handlers.push(N1e(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&n(o).observers.push(N1e(r.value,s))}}for(let r in Kf)n(r).handlers.push(Kf[r]);for(let r in Du)n(r).observers.push(Du[r]);return e}const d7e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Xpn="dthko",h7e=[16,17,18,20,91,92,224,225],kL=6;function AL(t){return Math.max(0,t)*.7+8}function Ypn(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Qpn{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=opn(e.contentDOM),this.atoms=e.state.facet(Xle).map(s=>s(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(In.allowMultipleSelections)&&Kpn(e,n),this.dragging=Jpn(e,n)&&m7e(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&&Ypn(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=l7e(this.view);e.clientX-l.left<=i+kL?n=-AL(i-e.clientX):e.clientX+l.right>=s-kL&&(n=AL(e.clientX-s)),e.clientY-l.top<=o+kL?r=-AL(o-e.clientY):e.clientY+l.bottom>=a-kL&&(r=AL(e.clientY-a)),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 Kpn(t,e){let n=t.state.facet(X9e);return n.length?n[0](e):Ct.mac?e.metaKey:e.ctrlKey}function Zpn(t,e){let n=t.state.facet(Y9e);return n.length?n[0](e):Ct.mac?!e.altKey:!e.ctrlKey}function Jpn(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=cP(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function egn(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=Ir.get(n))&&r.ignoreEvent(e))return!1;return!0}const Kf=Object.create(null),Du=Object.create(null),p7e=Ct.ie&&Ct.ie_version<15||Ct.ios&&Ct.webkit_version<604;function tgn(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(),g7e(t,n.value)},50)}function g7e(t,e){let{state:n}=t,r,i=1,o=n.toText(e),s=o.lines==n.selection.ranges.length;if(bK!=null&&n.selection.ranges.every(l=>l.empty)&&bK==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((s?o.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:Ve.cursor(c.from+f.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:Ve.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Du.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Kf.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Du.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Du.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Kf.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(Q9e))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=ign(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Qpn(t,e,n,r)),r&&t.observer.ignore(()=>{A9e(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 z1e(t,e,n,r){if(r==1)return Ve.cursor(e,n);if(r==2)return Mpn(t.state,e,n);{let i=no.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return ae>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function ngn(t,e,n,r){let i=no.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 s=i.coordsAt(o,-1);if(s&&j1e(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&j1e(n,r,a)?1:s&&s.bottom>=r?-1:1}function B1e(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:ngn(t,n,e.clientX,e.clientY)}}const rgn=Ct.ie&&Ct.ie_version<=11;let U1e=null,W1e=0,V1e=0;function m7e(t){if(!rgn)return t.detail;let e=U1e,n=V1e;return U1e=t,V1e=Date.now(),W1e=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(W1e+1)%3:1}function ign(t,e){let n=B1e(t,e),r=m7e(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=B1e(t,o),c,u=z1e(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let f=z1e(t,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=ogn(i,l.pos))?c:a?i.addRange(u):Ve.create([u])}}}function ogn(t,e){for(let n=0;n=e)return Ve.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}Kf.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,s=o+i.length;(o>=n.to||s<=n.from)&&(n=Ve.range(o,s))}}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};Kf.dragend=t=>(t.inputState.draggedContent=null,!1);function G1e(t,e,n,r){if(!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=r&&o&&Zpn(t,e)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Kf.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&&G1e(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return G1e(t,e,r,!0),!0}return!1};Kf.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=p7e?null:e.clipboardData;return n?(g7e(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(tgn(t),!1)};function sgn(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 agn(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 s=t.doc.lineAt(o);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let bK=null;Kf.copy=Kf.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=agn(t.state);if(!n&&!i)return!1;bK=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=p7e?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(sgn(t,n),!1)};const v7e=tp.define();function y7e(t,e){let n=[];for(let r of t.facet(J9e)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:v7e.of(!0)}):null}function x7e(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=y7e(t.state,e);n?t.dispatch(n):t.update([])}},10)}Du.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),x7e(t)};Du.blur=t=>{t.observer.clearSelectionRange(),x7e(t)};Du.compositionstart=Du.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Du.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,Ct.chrome&&Ct.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Du.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Kf.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"),s=e.getTargetRanges();if(o&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return Yle(t,{from:l,to:c,insert:t.state.toText(o)},null),!0}}let i;if(Ct.chrome&&Ct.android&&(i=d7e.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 s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Ct.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Ct.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Du.compositionend(t,e),20),!1};const H1e=new Set;function lgn(t){H1e.has(t)||(H1e.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const q1e=["pre-wrap","normal","pre-line","break-spaces"];let CC=!1;function X1e(){CC=!1}class cgn{constructor(e){this.lineWrapping=e,this.doc=ar.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 q1e.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!=a;if(this.lineWrapping=a,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)>W3&&(CC=!0),this.height=e)}replace(e,n,r){return Aa.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=o.lineAt(l,Kr.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Kr.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,lo*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i=o&&s(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 Yl extends b7e{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new Yd(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Yl||i instanceof ns&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof ns?i=new Yl(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Aa.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 ns extends Aa{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,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let o=r[r.length-1];o instanceof ns?r[r.length-1]=new ns(o.length+i):r.push(null,new ns(i-1))}if(e>0){let o=r[0];o instanceof ns?r[0]=new ns(e+o.length):r.unshift(new ns(e-1),null)}return Aa.of(r)}decomposeLeft(e,n){n.push(new ns(e-1),null)}decomposeRight(e,n){n.push(null,new ns(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 s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new ns(i.from-n-1).updateHeight(e,n));a<=o&&i.more;){let u=e.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=W3&&(l=-2);let d=new Yl(u,f);d.outdated=!1,s.push(d),a+=u+1}a<=o&&s.push(null,new ns(o-a).updateHeight(e,a));let c=Aa.of(s);return(l<0||Math.abs(c.height-this.height)>=W3||Math.abs(l-this.heightMetrics(e,n).perLine)>=W3)&&(CC=!0),oz(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 fgn extends Aa{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 ea))return c;let u=n==Kr.ByPosNoHeight?Kr.ByPosNoHeight:Kr.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(e,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,a,l,s);else{let c=this.lineAt(l,Kr.ByPos,r,i,o);e=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}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 s=o.length;for(let a of r)o.push(a);if(e>0&&Y1e(o,s-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?Aa.of(this.break?[e,null,n]:[e,n]):(this.left=oz(this.left,e),this.right=oz(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:s}=this,a=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<=a+s.length&&i.more?l=s=s.updateHeight(e,a,r,i):s.updateHeight(e,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Y1e(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof ns&&(r=t[e+1])instanceof ns&&t.splice(e-1,3,new ns(n.length+1+r.length))}const dgn=5;class Qle{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 Yl?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Yl(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=dgn)&&this.addLineDeco(i,o,s)}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 Yl(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new ns(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 Yl)return e;let n=new Yl(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 Yl)&&!this.isCovered?this.nodes.push(new Yl(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),s=Math.min(s,d.right),a=Math.max(a,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,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function mgn(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class l7{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 cgn(n),this.stateDeco=e.facet(uP).filter(r=>typeof r!="function"),this.heightMap=Aa.empty().applyChanges(this.stateDeco,ar.empty,this.heightOracle.setDoc(e.doc),[new gu(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=It.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:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new PL(o,s))}}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?K1e:new Kle(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(RT(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(uP).filter(u=>typeof u!="function");let i=e.changedRanges,o=gu.extendWithRanges(i,hgn(r,this.stateDeco,e?e.changes:mo.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);X1e(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||CC)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.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(t7e)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?ai.RTL:ai.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:b,scaleY:w}=k9e(n,a);(b>.005&&Math.abs(this.scaleX-b)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=b,this.scaleY=w,c|=8,s=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=M9e(e.scrollDOM);let p=(this.printing?mgn:ggn)(n,this.paddingTop),g=p.top-this.pixelViewport.top,m=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=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let b=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(b)&&(s=!0),s||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:w,charWidth:_,textHeight:S}=e.docView.measureTextSize();s=w>0&&i.refresh(o,w,_,S,y/_,b),s&&(e.docView.minWidth=0,c|=8)}g>0&&m>0?u=Math.max(g,m):g<0&&m<0&&(u=Math.min(g,m)),X1e();for(let w of this.viewports){let _=w.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(w);this.heightMap=(s?Aa.empty().applyChanges(this.stateDeco,ar.empty,this.heightOracle,[new gu(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new ugn(w.from,_))}CC&&(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(s?[]: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:s,visibleBottom:a}=this,l=new PL(i.lineAt(s-r*1e3,Kr.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,Kr.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,Kr.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=ai.LTR&&!r)return[];let a=[],l=(u,f,d,h)=>{if(f-uu&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)v.fromy));if(!m){if(fv.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(Ve.cursor(f),!1,!0).head;v>u&&(f=v)}m=new l7(u,f,this.gapSize(d,u,f,h))}a.push(m)},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=[];Gn.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)||RT(this.heightMap.lineAt(e,Kr.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)||RT(this.heightMap.lineAt(this.scaler.fromDOM(e),Kr.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 RT(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 PL{constructor(e,n){this.from=e,this.to=n}}function ygn(t,e,n){let r=[],i=t,o=0;return Gn.spans(n,t,e,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:s}=e[i],a=s-o;if(r<=a)return o+r;r-=a}}function RL(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 xgn(t,e){for(let n of t)if(e(n))return n}const K1e={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Kle{constructor(e,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,Kr.ByPos,e,0,0).top,u=n.lineAt(l,Kr.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.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 RT(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Yd(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>RT(i,e)):t._content)}const DL=St.define({combine:t=>t.join(" ")}),wK=St.define({combine:t=>t.indexOf(!0)>-1}),_K=_y.newName(),w7e=_y.newName(),_7e=_y.newName(),S7e={"&light":"."+w7e,"&dark":"."+_7e};function SK(t,e,n){return new _y(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 bgn=SK("."+_K,{"&":{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"}},S7e),wgn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},c7=Ct.ie&&Ct.ie_version<=11;class _gn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new spn,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);(Ct.ie&&Ct.ie_version<=11||Ct.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&&!(Ct.chrome&&Ct.chrome_version<126)&&(this.editContext=new Cgn(e),e.state.facet(iv)&&(e.contentDOM.editContext=this.editContext.editContext)),c7&&(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(iv)?r.root.activeElement!=this.dom:!B3(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Ct.ie&&Ct.ie_version<=11||Ct.android&&Ct.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Ok(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=cP(e.root);if(!n)return!1;let r=Ct.safari&&e.root.nodeType==11&&npn(this.dom.ownerDocument)==this.dom&&Sgn(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=B3(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&&nS(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 s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&B3(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 Bpn(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=f7e(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=Z1e(n,e.previousSibling||e.target.previousSibling,-1),i=Z1e(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(iv)!=e.state.facet(iv)&&(e.view.contentDOM.editContext=e.state.facet(iv)?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 Z1e(t,e,n){for(;e;){let r=Ir.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 J1e(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return Ok(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Sgn(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return J1e(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?J1e(t,n):null}class Cgn{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:ar.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||Yle(e,o,Ve.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 s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(s!="None"&&a!="None"){let l=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(It.mark({attributes:{style:l}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:r7e.of(It.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=cP(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,s,a,l,c)=>{if(r)return;let u=c.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(o+=n,s+=n,s<=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(s),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 mt{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||apn(e.parent)||document,this.viewState=new Q1e(e.state||In.create(e)),e.scrollTo&&e.scrollTo.is(TL)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(AT).map(i=>new o7(i));for(let i of this.plugins)i.update(this);this.observer=new _gn(this),this.inputState=new Hpn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new M1e(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 ao?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 s=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(v7e))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=y7e(o,s),l||(a=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(In.phrases)!=this.state.facet(In.phrases))return this.setState(o);i=iz.create(this,o,e),i.flags|=a;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 rS(h.empty?h:Ve.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(TL)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=sz.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(PT)!=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(DL)!=i.state.facet(DL)&&(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(vK))try{d(i)}catch(h){al(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!f7e(this,u)&&c.force&&nS(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 Q1e(e),this.plugins=e.facet(AT).map(r=>new o7(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new M1e(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(AT),r=e.state.facet(AT);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new o7(o));else{let a=this.plugins[s];a.mustUpdate=e,i.push(a)}}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:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(M9e(r))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>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 al(this.state,p),ewe}}),f=iz.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,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(vK))a(n)}get themeClasses(){return _K+" "+(this.state.facet(wK)?_7e:w7e)+" "+this.state.facet(DL)}updateAttrs(){let e=twe(this,i7e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(iv)?"true":"false",class:"cm-content",style:`${Ct.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),twe(this,qle,n);let r=this.observer.ignore(()=>{let i=fK(this.contentDOM,this.contentAttrs,n),o=fK(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(mt.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(PT);let e=this.state.facet(mt.cspNonce);_y.mount(this.root,this.styleModules.concat(bgn).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 a7(this,e,$1e(this,e,n,r))}moveByGroup(e,n){return a7(this,e,$1e(this,e,n,r=>Fpn(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 Ve.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return $pn(this,e,n,r)}moveVertically(e,n,r){return a7(this,e,Npn(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(),u7e(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),s=o[Sv.find(o,e-i.from,-1,n)];return oD(r,s.dir==ai.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(e7e)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Ogn)return H9e(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||G9e(o.isolates,r=P1e(this,e))))return o.order;r||(r=P1e(this,e));let i=bpn(e.text,n,r);return this.bidiCache.push(new sz(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ct.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{A9e(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 TL.of(new rS(typeof e=="number"?Ve.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 TL.of(new rS(Ve.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 Yi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yi.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=_y.newName(),i=[DL.of(r),PT.of(SK(`.${r}`,e))];return n&&n.dark&&i.push(wK.of(!0)),i}static baseTheme(e){return o0.lowest(PT.of(SK("."+_K,e,S7e)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Ir.get(r)||Ir.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}mt.styleModule=PT;mt.inputHandler=Z9e;mt.scrollHandler=n7e;mt.focusChangeEffect=J9e;mt.perLineTextDirection=e7e;mt.exceptionSink=K9e;mt.updateListener=vK;mt.editable=iv;mt.mouseSelectionStyle=Q9e;mt.dragMovesSelection=Y9e;mt.clickAddsSelectionRange=X9e;mt.decorations=uP;mt.outerDecorations=o7e;mt.atomicRanges=Xle;mt.bidiIsolatedRanges=s7e;mt.scrollMargins=a7e;mt.darkTheme=wK;mt.cspNonce=St.define({combine:t=>t.length?t[0]:""});mt.contentAttributes=qle;mt.editorAttributes=i7e;mt.lineWrapping=mt.contentAttributes.of({class:"cm-lineWrapping"});mt.announce=rn.define();const Ogn=4096,ewe={};class sz{constructor(e,n,r,i,o,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:ai.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(t):o;s&&uK(s,n)}return n}const Egn=Ct.mac?"mac":Ct.windows?"win":Ct.linux?"linux":"key";function Tgn(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;lr.concat(i),[]))),n}function Agn(t,e,n){return O7e(C7e(t.state),e,t,n)}let ov=null;const Pgn=4e3;function Mgn(t,e=Egn){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var f,d;let h=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(v=>Tgn(v,e));for(let v=1;v{let b=ov={view:x,prefix:y,scope:s};return setTimeout(()=>{ov==b&&(ov=null)},Pgn),!0}]})}let g=p.join(" ");i(g,!1);let m=h[g]||(h[g]={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&&m.run.push(l),c&&(m.preventDefault=!0),u&&(m.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=s;for(let d in u)u[d].run.push(h=>f(h,CK))}let l=s[e]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let CK=null;function O7e(t,e,n,r){CK=e;let i=tpn(e),o=as(i,0),s=Zc(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;ov&&ov.view==n&&ov.scope==r&&(a=ov.prefix+" ",h7e.indexOf(e.keyCode)<0&&(c=!0,ov=null));let f=new Set,d=m=>{if(m){for(let v of m.run)if(!f.has(v)&&(f.add(v),v(n)))return m.stopPropagation&&(u=!0),!0;m.preventDefault&&(m.stopPropagation&&(u=!0),c=!0)}return!1},h=t[r],p,g;return h&&(d(h[a+IL(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ct.windows&&e.ctrlKey&&e.altKey)&&(p=Sy[e.keyCode])&&p!=i?(d(h[a+IL(p,e,!0)])||e.shiftKey&&(g=lP[e.keyCode])!=i&&g!=p&&d(h[a+IL(g,e,!1)]))&&(l=!0):s&&e.shiftKey&&d(h[a+IL(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),CK=null,l}class cD{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=E7e(e);return[new cD(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return Rgn(e,n,r)}}function E7e(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==ai.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function rwe(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let o=t.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=t.posAtCoords({x:o.left+1,y:s}),l=t.posAtCoords({x:o.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function Rgn(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==ai.LTR,s=t.contentDOM,a=s.getBoundingClientRect(),l=E7e(t),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=xK(t,r),p=xK(t,i),g=h.type==ka.Text?h:null,m=p.type==ka.Text?p:null;if(g&&(t.lineWrapping||h.widgetLineBreaks)&&(g=rwe(t,r,1,g)),m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=rwe(t,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(x(n.from,n.to,g));{let w=g?x(n.from,null,g):b(h,!1),_=m?x(null,n.to,m):b(p,!0),S=[];return(g||h).to<(m||p).from-(g&&m?1:0)||h.widgetLineBreaks>1&&w.bottom+t.defaultLineHeight/2<_.top?S.push(v(f,w.bottom,d,_.top)):w.bottom<_.top&&t.elementAtHeight((w.bottom+_.top)/2).type==ka.Text&&(w.bottom=_.top=(w.bottom+_.top)/2),y(w).concat(S).concat(y(_))}function v(w,_,S,O){return new cD(e,w-l.left,_-l.top-.01,S-w,O-_+.01)}function y({top:w,bottom:_,horizontal:S}){let O=[];for(let k=0;kA&&T.from=I)break;L>M&&P(Math.max(N,M),w==null&&N<=A,Math.min(L,I),_==null&&L>=R,F.dir)}if(M=z.to+1,M>=I)break}return E.length==0&&P(A,w==null,R,_==null,t.textDirection),{top:O,bottom:k,horizontal:E}}function b(w,_){let S=a.top+(_?w.top:w.bottom);return{top:S,bottom:S,horizontal:[]}}}function Dgn(t,e){return t.constructor==e.constructor&&t.eq(e)}class Ign{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(V3)!=e.state.facet(V3)&&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(V3);for(;n!Dgn(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 V3=St.define();function T7e(t){return[Yi.define(e=>new Ign(e,t)),V3.of(t)]}const k7e=!Ct.ios,fP=St.define({combine(t){return np(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Lgn(t={}){return[fP.of(t),$gn,Fgn,Ngn,t7e.of(!0)]}function A7e(t){return t.startState.facet(fP)!=t.state.facet(fP)}const $gn=T7e({above:!0,markers(t){let{state:e}=t,n=e.facet(fP),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||k7e:n.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:Ve.cursor(i.head,i.head>i.anchor?-1:1);for(let l of cD.forRange(t,s,a))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=A7e(t);return n&&iwe(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){iwe(e.state,t)},class:"cm-cursorLayer"});function iwe(t,e){e.style.animationDuration=t.facet(fP).cursorBlinkRate+"ms"}const Fgn=T7e({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:cD.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||A7e(t)},class:"cm-selectionLayer"}),OK={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};k7e&&(OK[".cm-line"].caretColor=OK[".cm-content"].caretColor="transparent !important");const Ngn=o0.highest(mt.theme(OK)),P7e=rn.define({map(t,e){return t==null?null:e.mapPos(t)}}),DT=Ko.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(P7e)?r.value:n,t)}}),zgn=Yi.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(DT);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(DT)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(DT),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(DT)!=t&&this.view.dispatch({effects:P7e.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 jgn(){return[DT,zgn]}function owe(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)i(s+a.index,a)}function Bgn(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 Ugn{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=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=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let n=new wy,r=n.add.bind(n);for(let{from:i,to:o}of Bgn(e,this.maxLength))owe(e.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,a,l)=>{l>e.view.viewport.from&&a1e3?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 s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=e.state.doc.lineAt(s),c=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;ad.push(v.range(g,m));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(m,e,g,p));n=n.update({filterFrom:u,filterTo:f,filter:(g,m)=>gf,add:d})}}return n}}const EK=/x/.unicode!=null?"gu":"g",Wgn=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,EK),Vgn={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 u7=null;function Ggn(){var t;if(u7==null&&typeof document<"u"&&document.body){let e=document.body.style;u7=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return u7||!1}const G3=St.define({combine(t){let e=np(t,{render:null,specialChars:Wgn,addSpecialChars:null});return(e.replaceTabs=!Ggn())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,EK)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,EK)),e}});function Hgn(t={}){return[G3.of(t),qgn()]}let swe=null;function qgn(){return swe||(swe=Yi.fromClass(class{constructor(t){this.view=t,this.decorations=It.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(G3)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Ugn({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=as(e[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=KO(s.text,a,r-s.from);return It.replace({widget:new Kgn((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=It.replace({widget:new Qgn(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(G3);t.startState.facet(G3)!=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 Xgn="•";function Ygn(t){return t>=32?Xgn:t==10?"␤":String.fromCharCode(9216+t)}class Qgn extends rp{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Ygn(this.code),r=e.state.phrase("Control character")+" "+(Vgn[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 Kgn extends rp{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 Zgn(){return emn}const Jgn=It.line({class:"cm-activeLine"}),emn=Yi.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(Jgn.range(i.from)),e=i.from)}return It.set(n)}},{decorations:t=>t.decorations});class tmn extends rp{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?wC(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=oD(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 nmn(t){return Yi.fromClass(class{constructor(e){this.view=e,this.placeholder=t?It.set([It.widget({widget:new tmn(t),side:1}).range(0)]):It.none}get decorations(){return this.view.state.doc.length?It.none:this.placeholder}},{decorations:e=>e.decorations})}const TK=2e3;function rmn(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>TK||n.off>TK||e.col<0||n.col<0){let s=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=a&&o.push(Ve.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),u=rK(c.text,s,t.tabSize,!0);if(u<0)o.push(Ve.cursor(c.to));else{let f=rK(c.text,a,t.tabSize);o.push(Ve.range(c.from+u,c.from+f))}}}return o}function imn(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function awe(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>TK?-1:i==r.length?imn(t,e.clientX):KO(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function omn(t,e){let n=awe(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),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=awe(t,i);if(!a)return r;let l=rmn(t.state,n,a);return l.length?s?Ve.create(l.concat(r.ranges)):Ve.create(l):r}}:null}function smn(t){let e=n=>n.altKey&&n.button==0;return mt.mouseSelectionStyle.of((n,r)=>e(r)?omn(n,r):null)}const amn={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},lmn={style:"cursor: crosshair"};function cmn(t={}){let[e,n]=amn[t.key||"Alt"],r=Yi.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,mt.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?lmn:null})]}const O2="-10000px";class M7e{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(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,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 s=[],a=n?[]:null;for(let l=0;ln[c]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function umn(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const f7=St.define({combine:t=>{var e,n,r;return{position:Ct.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)||umn}}}),lwe=new WeakMap,Zle=Yi.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(f7);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 M7e(t,Jle,(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(f7);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=O2,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(Ct.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==O2&&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 s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(f7).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=t,s=[];for(let a=0;a=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1){u.style.top=O2;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,g=d.right-d.left,m=(e=lwe.get(c))!==null&&e!==void 0?e:d.bottom-d.top,v=c.offset||dmn,y=this.view.textDirection==ai.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-g)):Math.min(Math.max(r.left,f.left-g+(h?14:0)-v.x),r.right-g),b=this.above[a];!l.strictSide&&(b?f.top-(d.bottom-d.top)-v.yr.bottom)&&b==r.bottom-f.bottom>f.top-r.top&&(b=this.above[a]=!b);let w=(b?f.top-r.top:r.bottom-f.bottom)-p;if(wx&&O.top<_+m&&O.bottom>_&&(_=b?O.top-m-2-p:O.bottom+p+2);if(this.position=="absolute"?(u.style.top=(_-t.parent.top)/o+"px",u.style.left=(x-t.parent.left)/i+"px"):(u.style.top=_/o+"px",u.style.left=x/i+"px"),h){let O=f.left+(y?v.x:-v.x)-(x+14-7);h.style.left=O/i+"px"}c.overlap!==!0&&s.push({left:x,top:_,right:S,bottom:_+m}),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=O2}},{eventObservers:{scroll(){this.maybeMeasure()}}}),fmn=mt.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"}}}),dmn={x:0,y:0},Jle=St.define({enables:[Zle,fmn]}),az=St.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class MU{static create(e){return new MU(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new M7e(e,az,(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 hmn=Jle.compute([az],t=>{let e=t.facet(az);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:MU.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class pmn{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;ea.bottom||n.xa.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==ai.RTL?-1:1;o=n.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>al(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(Zle),n=e?e.manager.tooltips.findIndex(r=>r.create==MU.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&&!gmn(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!mmn(this.view,s,a,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 LL=4;function gmn(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-LL&&e.clientX<=n.right+LL&&e.clientY>=n.top-LL&&e.clientY<=n.bottom+LL}function mmn(t,e,n,r,i,o){let s=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,a)=e&&l<=n}function vmn(t,e={}){let n=rn.define(),r=Ko.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,fs.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(ymn)&&(i=[]);return i},provide:i=>az.from(i)});return{active:r,extension:[r,Yi.define(i=>new pmn(i,t,r,n,e.hoverTime||300)),hmn]}}function R7e(t,e){let n=t.plugin(Zle);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const ymn=rn.define(),cwe=St.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 dP(t,e){let n=t.plugin(D7e),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const D7e=Yi.fromClass(class{constructor(t){this.input=t.state.facet(hP),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(cwe);this.top=new $L(t,!0,e.topContainer),this.bottom=new $L(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(cwe);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new $L(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new $L(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(hP);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(t.view),a.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)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=>mt.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class $L{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=uwe(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=uwe(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 uwe(t){let e=t.nextSibling;return t.remove(),e}const hP=St.define({enables:D7e});class Wg extends Lb{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Wg.prototype.elementClass="";Wg.prototype.toDOM=void 0;Wg.prototype.mapMode=fs.TrackBefore;Wg.prototype.startSide=Wg.prototype.endSide=-1;Wg.prototype.point=!0;const H3=St.define(),xmn=St.define(),bmn={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Gn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Tk=St.define();function wmn(t){return[I7e(),Tk.of(Object.assign(Object.assign({},bmn),t))]}const fwe=St.define({combine:t=>t.some(e=>e)});function I7e(t){return[_mn]}const _mn=Yi.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(Tk).map(e=>new hwe(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(fwe),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(fwe)!=!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=Gn.iter(this.view.state.facet(H3),this.view.viewport.from),r=[],i=this.gutters.map(o=>new Smn(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==ka.Text&&s){kK(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==ka.Text){kK(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.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(Tk),n=t.state.facet(Tk),r=t.docChanged||t.heightChanged||t.viewportChanged||!Gn.eq(t.startState.facet(H3),t.state.facet(H3),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 s=e.indexOf(o);s<0?i.push(new hwe(this.view,o)):(this.gutters[s].update(t),i.push(this.gutters[s]))}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=>mt.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==ai.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function dwe(t){return Array.isArray(t)?t:[t]}function kK(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Smn{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Gn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let a=new L7e(e,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,s,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];kK(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 s=this.gutter;i.length==0&&!s.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(xmn)){let s=o(e,n.widget,n);s&&(i||(i=[])).push(s)}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 hwe{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,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=dwe(n.markers(e)),n.initialSpacer&&(this.spacer=new L7e(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=dwe(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!Gn.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 L7e{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":""),Cmn(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=oo(a,l,c)||s(a,l,c):s}return r}})}});class d7 extends Wg{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function h7(t,e){return t.state.facet(b_).formatNumber(e,t.state)}const Tmn=Tk.compute([b_],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Omn)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new d7(h7(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(Emn)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(b_)!=e.state.facet(b_),initialSpacer(e){return new d7(h7(e,pwe(e.state.doc.lines)))},updateSpacer(e,n){let r=h7(n.view,pwe(n.view.state.doc.lines));return r==e.number?e:new d7(r)},domEventHandlers:t.facet(b_).domEventHandlers}));function kmn(t={}){return[b_.of(t),I7e(),Tmn]}function pwe(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(Amn.range(i)))}return Gn.of(e)});function Mmn(){return Pmn}const $7e=1024;let Rmn=0;class p7{constructor(e,n){this.from=e,this.to=n}}class _n{constructor(e={}){this.id=Rmn++,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=Tl.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}_n.closedBy=new _n({deserialize:t=>t.split(" ")});_n.openedBy=new _n({deserialize:t=>t.split(" ")});_n.group=new _n({deserialize:t=>t.split(" ")});_n.isolate=new _n({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});_n.contextHash=new _n({perNode:!0});_n.lookAhead=new _n({perNode:!0});_n.mounted=new _n({perNode:!0});class lz{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[_n.mounted.id]}}const Dmn=Object.create(null);class Tl{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):Dmn,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Tl(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(_n.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(_n.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}Tl.none=new Tl("",Object.create(null),0,8);class ece{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(s|yo.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!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:rce(Tl.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new lo(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new lo(Tl.none,n,r,i)))}static build(e){return Fmn(e)}}lo.empty=new lo(Tl.none,[],[],0);class tce{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 tce(this.buffer,this.index)}}class Oy{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Tl.none}toString(){let e=[];for(let n=0;n0));l=s[l+3]);return a}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),s=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function pP(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?a.length:-1;e!=c;e+=n){let u=a[e],f=l[e]+s.from;if(F7e(i,r,f,f+u.length)){if(u instanceof Oy){if(o&yo.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new th(new Imn(s,u,e,f),null,d)}else if(o&yo.IncludeAnonymous||!u.type.isAnonymous||nce(u)){let d;if(!(o&yo.IgnoreMounts)&&(d=lz.get(u))&&!d.overlay)return new vl(d.tree,f,e,s);let h=new vl(u,f,e,s);return o&yo.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&yo.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))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&yo.IgnoreOverlays)&&(i=lz.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s=o:a>o))return new vl(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 mwe(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=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 AK(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 Imn{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class th extends N7e{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 th(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&yo.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 th(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 th(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 th(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 s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),n.push(0)}return new lo(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function z7e(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;on.from||s.to=e){let a=new vl(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(pP(a,e,n,!1))}}return i?z7e(i):r}class PK{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 vl)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 vl?(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&yo.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&yo.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&yo.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,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&yo.IncludeAnonymous||a instanceof Oy||!a.type.isAnonymous||nce(a))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 s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return AK(this.node,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function nce(t){return t.children.some(e=>e instanceof Oy||!e.type.isAnonymous||nce(e))}function Fmn(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=$7e,reused:o=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new tce(n,n.length):n,l=r.types,c=0,u=0;function f(w,_,S,O,k,E){let{id:P,start:A,end:R,size:T}=a,M=u;for(;T<0;)if(a.next(),T==-1){let L=o[P];S.push(L),O.push(A-w);return}else if(T==-3){c=P;return}else if(T==-4){u=P;return}else throw new RangeError(`Unrecognized record size: ${T}`);let I=l[P],z,F,N=A-w;if(R-A<=i&&(F=m(a.pos-_,k))){let L=new Uint16Array(F.size-F.skip),B=a.pos-F.size,$=L.length;for(;a.pos>B;)$=v(F.start,L,$);z=new Oy(L,R-F.start,r),N=F.start-w}else{let L=a.pos-T;a.next();let B=[],$=[],j=P>=s?P:-1,X=0,V=R;for(;a.pos>L;)j>=0&&a.id==j&&a.size>=0?(a.end<=V-i&&(p(B,$,A,X,a.end,V,j,M),X=B.length,V=a.end),a.next()):E>2500?d(A,L,B,$):f(A,L,B,$,j,E+1);if(j>=0&&X>0&&X-1&&X>0){let Y=h(I);z=rce(I,B,$,0,B.length,0,R-A,Y,Y)}else z=g(I,B,$,R-A,M-R)}S.push(z),O.push(N)}function d(w,_,S,O){let k=[],E=0,P=-1;for(;a.pos>_;){let{id:A,start:R,end:T,size:M}=a;if(M>4)a.next();else{if(P>-1&&R=0;T-=3)A[M++]=k[T],A[M++]=k[T+1]-R,A[M++]=k[T+2]-R,A[M++]=M;S.push(new Oy(A,k[2]-R,r)),O.push(R-w)}}function h(w){return(_,S,O)=>{let k=0,E=_.length-1,P,A;if(E>=0&&(P=_[E])instanceof lo){if(!E&&P.type==w&&P.length==O)return P;(A=P.prop(_n.lookAhead))&&(k=S[E]+P.length+A)}return g(w,_,S,O,k)}}function p(w,_,S,O,k,E,P,A){let R=[],T=[];for(;w.length>O;)R.push(w.pop()),T.push(_.pop()+S-k);w.push(g(r.types[P],R,T,E-k,A-E)),_.push(k-S)}function g(w,_,S,O,k=0,E){if(c){let P=[_n.contextHash,c];E=E?[P].concat(E):[P]}if(k>25){let P=[_n.lookAhead,k];E=E?[P].concat(E):[P]}return new lo(w,_,S,O,E)}function m(w,_){let S=a.fork(),O=0,k=0,E=0,P=S.end-i,A={size:0,start:0,skip:0};e:for(let R=S.pos-w;S.pos>R;){let T=S.size;if(S.id==_&&T>=0){A.size=O,A.start=k,A.skip=E,E+=4,O+=4,S.next();continue}let M=S.pos-T;if(T<0||M=s?4:0,z=S.start;for(S.next();S.pos>M;){if(S.size<0)if(S.size==-3)I+=4;else break e;else S.id>=s&&(I+=4);S.next()}k=z,O+=T,E+=I}return(_<0||O==w)&&(A.size=O,A.start=k,A.skip=E),A.size>4?A:void 0}function v(w,_,S){let{id:O,start:k,end:E,size:P}=a;if(a.next(),P>=0&&O4){let R=a.pos-(P-4);for(;a.pos>R;)S=v(w,_,S)}_[--S]=A,_[--S]=E-w,_[--S]=k-w,_[--S]=O}else P==-3?c=O:P==-4&&(u=O);return S}let y=[],x=[];for(;a.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 lo(l[t.topID],y.reverse(),x.reverse(),b)}const vwe=new WeakMap;function q3(t,e){if(!t.isAnonymous||e instanceof Oy||e.type!=t)return 1;let n=vwe.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof lo)){n=1;break}n+=q3(t,r)}vwe.set(e,n)}return n}function rce(t,e,n,r,i,o,s,a,l){let c=0;for(let p=r;p=u)break;_+=S}if(x==b+1){if(_>u){let S=p[b];h(S.children,S.positions,0,S.children.length,g[b]+y);continue}f.push(p[b])}else{let S=g[x-1]+p[x-1].length-w;f.push(rce(t,p,g,b,x,w,S,null,l))}d.push(w+y-o)}}return h(e,n,r,i,0),(a||l)(f,d,s)}class Nmn{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 th?this.setBuffer(e.context.buffer,e.index,n):e instanceof vl&&this.map.set(e.tree,n)}get(e){return e instanceof th?this.getBuffer(e.context.buffer,e.index):e instanceof vl?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 Yx{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?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 Yx(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,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;s&&s.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 Yx(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),s.to>f)break;s=onew p7(i.from,i.to)):[new p7(0,0)]:[new p7(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 zmn{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 _n({perNode:!0});let jmn=0;class Yc{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=jmn++}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 Yc&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new Yc(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 cz(e);return r=>r.modified.indexOf(n)>-1?r:cz.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Bmn=0;class cz{constructor(e){this.name=e,this.instances=[],this.id=Bmn++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&Umn(n,a.modified));if(r)return r;let i=[],o=new Yc(e.name,i,e,n);for(let a of n)a.instances.push(o);let s=Wmn(n);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(cz.get(a,l));return o}}function Umn(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Wmn(t){let e=[[]];for(let n=0;nr.length-n.length)}function ice(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=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);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=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new uz(r,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return B7e.add(e)}const B7e=new _n;class uz{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 s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function Vmn(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function Gmn(t,e,n,r=0,i=t.length){let o=new Hmn(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Hmn{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:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=qmn(e)||uz.empty,f=Vmn(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(_n.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(m=>!m.scope||m.scope(d.tree.type)),g=e.firstChild();for(let m=0,v=a;;m++){let y=m=x||!e.nextSibling())););if(!y||x>r)break;v=y.to+a,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),c))}g&&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 qmn(t){let e=t.type.prop(B7e);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const dt=Yc.define,NL=dt(),Zm=dt(),ywe=dt(Zm),xwe=dt(Zm),Jm=dt(),zL=dt(Jm),g7=dt(Jm),Sd=dt(),M0=dt(Sd),bd=dt(),wd=dt(),MK=dt(),E2=dt(MK),jL=dt(),Ee={comment:NL,lineComment:dt(NL),blockComment:dt(NL),docComment:dt(NL),name:Zm,variableName:dt(Zm),typeName:ywe,tagName:dt(ywe),propertyName:xwe,attributeName:dt(xwe),className:dt(Zm),labelName:dt(Zm),namespace:dt(Zm),macroName:dt(Zm),literal:Jm,string:zL,docString:dt(zL),character:dt(zL),attributeValue:dt(zL),number:g7,integer:dt(g7),float:dt(g7),bool:dt(Jm),regexp:dt(Jm),escape:dt(Jm),color:dt(Jm),url:dt(Jm),keyword:bd,self:dt(bd),null:dt(bd),atom:dt(bd),unit:dt(bd),modifier:dt(bd),operatorKeyword:dt(bd),controlKeyword:dt(bd),definitionKeyword:dt(bd),moduleKeyword:dt(bd),operator:wd,derefOperator:dt(wd),arithmeticOperator:dt(wd),logicOperator:dt(wd),bitwiseOperator:dt(wd),compareOperator:dt(wd),updateOperator:dt(wd),definitionOperator:dt(wd),typeOperator:dt(wd),controlOperator:dt(wd),punctuation:MK,separator:dt(MK),bracket:E2,angleBracket:dt(E2),squareBracket:dt(E2),paren:dt(E2),brace:dt(E2),content:Sd,heading:M0,heading1:dt(M0),heading2:dt(M0),heading3:dt(M0),heading4:dt(M0),heading5:dt(M0),heading6:dt(M0),contentSeparator:dt(Sd),list:dt(Sd),quote:dt(Sd),emphasis:dt(Sd),strong:dt(Sd),link:dt(Sd),monospace:dt(Sd),strikethrough:dt(Sd),inserted:dt(),deleted:dt(),changed:dt(),invalid:dt(),meta:jL,documentMeta:dt(jL),annotation:dt(jL),processingInstruction:dt(jL),definition:Yc.defineModifier("definition"),constant:Yc.defineModifier("constant"),function:Yc.defineModifier("function"),standard:Yc.defineModifier("standard"),local:Yc.defineModifier("local"),special:Yc.defineModifier("special")};for(let t in Ee){let e=Ee[t];e instanceof Yc&&(e.name=t)}U7e([{tag:Ee.link,class:"tok-link"},{tag:Ee.heading,class:"tok-heading"},{tag:Ee.emphasis,class:"tok-emphasis"},{tag:Ee.strong,class:"tok-strong"},{tag:Ee.keyword,class:"tok-keyword"},{tag:Ee.atom,class:"tok-atom"},{tag:Ee.bool,class:"tok-bool"},{tag:Ee.url,class:"tok-url"},{tag:Ee.labelName,class:"tok-labelName"},{tag:Ee.inserted,class:"tok-inserted"},{tag:Ee.deleted,class:"tok-deleted"},{tag:Ee.literal,class:"tok-literal"},{tag:Ee.string,class:"tok-string"},{tag:Ee.number,class:"tok-number"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],class:"tok-string2"},{tag:Ee.variableName,class:"tok-variableName"},{tag:Ee.local(Ee.variableName),class:"tok-variableName tok-local"},{tag:Ee.definition(Ee.variableName),class:"tok-variableName tok-definition"},{tag:Ee.special(Ee.variableName),class:"tok-variableName2"},{tag:Ee.definition(Ee.propertyName),class:"tok-propertyName tok-definition"},{tag:Ee.typeName,class:"tok-typeName"},{tag:Ee.namespace,class:"tok-namespace"},{tag:Ee.className,class:"tok-className"},{tag:Ee.macroName,class:"tok-macroName"},{tag:Ee.propertyName,class:"tok-propertyName"},{tag:Ee.operator,class:"tok-operator"},{tag:Ee.comment,class:"tok-comment"},{tag:Ee.meta,class:"tok-meta"},{tag:Ee.invalid,class:"tok-invalid"},{tag:Ee.punctuation,class:"tok-punctuation"}]);var m7;const w_=new _n;function Xmn(t){return St.define({combine:t?e=>e.concat(t):void 0})}const Ymn=new _n;class kf{constructor(e,n,r=[],i=""){this.data=e,this.name=i,In.prototype.hasOwnProperty("tree")||Object.defineProperty(In.prototype,"tree",{get(){return Ho(this)}}),this.parser=n,this.extension=[Ey.of(this),In.languageData.of((o,s,a)=>{let l=bwe(o,s,a),c=l.type.prop(w_);if(!c)return[];let u=o.facet(c),f=l.type.prop(Ymn);if(f){let d=l.resolve(s-l.from,a);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 bwe(e,n,r).type.prop(w_)==this.data}findRegions(e){let n=e.facet(Ey);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,s)=>{if(o.prop(w_)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(_n.mounted);if(a){if(a.tree.prop(w_)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new gP(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ho(t){let e=t.field(kf.state,!1);return e?e.tree:lo.empty}class Qmn{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 T2=null;class fz{constructor(e,n,r=[],i,o,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new fz(e,n,[],lo.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Qmn(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=lo.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(Yx.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=T2;T2=this;try{return e()}finally{T2=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=wwe(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=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=Yx.applyChanges(r,l),i=lo.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);ue.from&&(this.fragments=wwe(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 j7e{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=T2;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=s,new lo(Tl.none,[],[],s-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 T2}}function wwe(t,e,n){return Yx.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class OC{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 OC(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=fz.create(e.facet(Ey).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new OC(r)}}kf.state=Ko.define({create:OC.init,update(t,e){for(let n of e.effects)if(n.is(kf.setState))return n.value;return e.startState.facet(Ey)!=e.state.facet(Ey)?OC.init(e.state):t.apply(e)}});let W7e=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(W7e=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const v7=typeof navigator<"u"&&(!((m7=navigator.scheduling)===null||m7===void 0)&&m7.isInputPending)?()=>navigator.scheduling.isInputPending():null,Kmn=Yi.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(kf.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(kf.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=W7e(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>v7&&v7()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:kf.setState.of(new OC(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>al(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()}}}),Ey=St.define({combine(t){return t.length?t[0]:null},enables:t=>[kf.state,Kmn,mt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class V7e{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Zmn=St.define(),uD=St.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 dz(t){let e=t.facet(uD);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function mP(t,e){let n="",r=t.tabSize,i=t.facet(uD)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o=e?Jmn(t,n,e):null}class RU{constructor(e,n={}){this.state=e,this.options=n,this.unit=dz(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+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return KO(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 s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const sce=new _n;function Jmn(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return G7e(r,t,n)}function G7e(t,e,n){for(let r=t;r;r=r.next){let i=tvn(r.node);if(i)return i(ace.create(e,n,r))}return 0}function evn(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function tvn(t){let e=t.type.prop(sce);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(_n.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>H7e(s,!0,1,void 0,o&&!evn(s)?i.from:void 0)}return t.parent==null?nvn:null}function nvn(){return 0}class ace extends RU{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 ace(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(rvn(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return G7e(this.context.next,this.base,this.pos)}}function rvn(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function ivn(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),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.fromH7e(r,e,n,t)}function H7e(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==t.pos+s,l=e?ivn(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function _we({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const ovn=200;function svn(){return In.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+ovn)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=oce(s,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=mP(s,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 avn=St.define(),lce=new _n;function q7e(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(o&&a.from=e&&c.to>n&&(o=c)}}return o}function cvn(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function hz(t,e,n){for(let r of t.facet(avn)){let i=r(t,e,n);if(i)return i}return lvn(t,e,n)}function X7e(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 DU=rn.define({map:X7e}),fD=rn.define({map:X7e});function Y7e(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 zb=Ko.define({create(){return It.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(DU)&&!uvn(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Z7e),i=r?It.replace({widget:new vvn(r(e.state,n.value))}):Swe;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(fD)&&(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=>mt.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:s})}),i}function uvn(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function Q7e(t,e){return t.field(zb,!1)?e:e.concat(rn.appendConfig.of(J7e()))}const fvn=t=>{for(let e of Y7e(t)){let n=hz(t.state,e.from,e.to);if(n)return t.dispatch({effects:Q7e(t.state,[DU.of(n),K7e(t,n)])}),!0}return!1},dvn=t=>{if(!t.state.field(zb,!1))return!1;let e=[];for(let n of Y7e(t)){let r=pz(t.state,n.from,n.to);r&&e.push(fD.of(r),K7e(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function K7e(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return mt.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const hvn=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(zb,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(fD.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},gvn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:fvn},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:dvn},{key:"Ctrl-Alt-[",run:hvn},{key:"Ctrl-Alt-]",run:pvn}],mvn={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Z7e=St.define({combine(t){return np(t,mvn)}});function J7e(t){return[zb,bvn]}function eGe(t,e){let{state:n}=t,r=n.facet(Z7e),i=s=>{let a=t.lineBlockAt(t.posAtDOM(s.target)),l=pz(t.state,a.from,a.to);l&&t.dispatch({effects:fD.of(l)}),s.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 Swe=It.replace({widget:new class extends rp{toDOM(t){return eGe(t,null)}}});class vvn extends rp{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return eGe(e,this.value)}}const yvn={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class x7 extends Wg{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 xvn(t={}){let e=Object.assign(Object.assign({},yvn),t),n=new x7(e,!0),r=new x7(e,!1),i=Yi.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Ey)!=s.state.facet(Ey)||s.startState.field(zb,!1)!=s.state.field(zb,!1)||Ho(s.startState)!=Ho(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new wy;for(let l of s.viewportLineBlocks){let c=pz(s.state,l.from,l.to)?r:hz(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,wmn({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Gn.empty},initialSpacer(){return new x7(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=pz(s.state,a.from,a.to);if(c)return s.dispatch({effects:fD.of(c)}),!0;let u=hz(s.state,a.from,a.to);return u?(s.dispatch({effects:DU.of(u)}),!0):!1}})}),J7e()]}const bvn=mt.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 dD{constructor(e,n){this.specs=e;let r;function i(a){let l=_y.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof kf?a=>a.prop(w_)==s.data:s?a=>a==s:void 0,this.style=U7e(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new _y(r):null,this.themeType=n.themeType}static define(e,n){return new dD(e,n||{})}}const RK=St.define(),tGe=St.define({combine(t){return t.length?[t[0]]:null}});function b7(t){let e=t.facet(RK);return e.length?e:t.facet(tGe)}function nGe(t,e){let n=[_vn],r;return t instanceof dD&&(t.module&&n.push(mt.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(tGe.of(t)):r?n.push(RK.computeN([mt.darkTheme],i=>i.facet(mt.darkTheme)==(r=="dark")?[t]:[])):n.push(RK.of(t)),n}class wvn{constructor(e){this.markCache=Object.create(null),this.tree=Ho(e.state),this.decorations=this.buildDeco(e,b7(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Ho(e.state),r=b7(e.state),i=r!=b7(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(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 It.none;let r=new wy;for(let{from:i,to:o}of e.visibleRanges)Gmn(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=It.mark({class:l})))},i,o);return r.finish()}}const _vn=o0.high(Yi.fromClass(wvn,{decorations:t=>t.decorations})),Svn=dD.define([{tag:Ee.meta,color:"#404740"},{tag:Ee.link,textDecoration:"underline"},{tag:Ee.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.keyword,color:"#708"},{tag:[Ee.atom,Ee.bool,Ee.url,Ee.contentSeparator,Ee.labelName],color:"#219"},{tag:[Ee.literal,Ee.inserted],color:"#164"},{tag:[Ee.string,Ee.deleted],color:"#a11"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],color:"#e40"},{tag:Ee.definition(Ee.variableName),color:"#00f"},{tag:Ee.local(Ee.variableName),color:"#30a"},{tag:[Ee.typeName,Ee.namespace],color:"#085"},{tag:Ee.className,color:"#167"},{tag:[Ee.special(Ee.variableName),Ee.macroName],color:"#256"},{tag:Ee.definition(Ee.propertyName),color:"#00c"},{tag:Ee.comment,color:"#940"},{tag:Ee.invalid,color:"#f00"}]),Cvn=mt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),rGe=1e4,iGe="()[]{}",oGe=St.define({combine(t){return np(t,{afterCursor:!0,brackets:iGe,maxScanDistance:rGe,renderMatch:Tvn})}}),Ovn=It.mark({class:"cm-matchingBracket"}),Evn=It.mark({class:"cm-nonmatchingBracket"});function Tvn(t){let e=[],n=t.matched?Ovn:Evn;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 kvn=Ko.define({create(){return It.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(oGe);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=nh(e.state,i.head,-1,r)||i.head>0&&nh(e.state,i.head-1,1,r)||r.afterCursor&&(nh(e.state,i.head,1,r)||i.headmt.decorations.from(t)}),Avn=[kvn,Cvn];function Pvn(t={}){return[oGe.of(t),Avn]}const Mvn=new _n;function DK(t,e,n){let r=t.prop(e<0?_n.openedBy:_n.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 IK(t){let e=t.type.prop(Mvn);return e?e(t.node):t}function nh(t,e,n,r={}){let i=r.maxScanDistance||rGe,o=r.brackets||iGe,s=Ho(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=DK(l.type,n,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return Rvn(t,e,n,l,u,c,o)}}return Dvn(t,e,n,s,a.type,i,o)}function Rvn(t,e,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.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 g=n>0?0:h.length-1,m=n>0?h.length:-1;g!=m;g+=n){let v=s.indexOf(h[g]);if(!(v<0||r.resolveInner(p+g,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:v>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const Ivn=Object.create(null),Cwe=[Tl.none],Owe=[],Ewe=Object.create(null),Lvn=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"]])Lvn[t]=$vn(Ivn,e);function w7(t,e){Owe.indexOf(t)>-1||(Owe.push(t),console.warn(e))}function $vn(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||Ee[c];u?typeof u=="function"?l.length?l=l.map(u):w7(c,`Modifier ${c} used at start of tag`):l.length?w7(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:w7(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(a=>a.id),o=Ewe[i];if(o)return o.id;let s=Ewe[i]=Tl.define({id:Cwe.length,name:r,props:[ice({[r]:n})]});return Cwe.push(s),s.id}ai.RTL,ai.LTR;const Fvn=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=uce(t.state,n.from);return r.line?Nvn(t):r.block?jvn(t):!1};function cce(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 Nvn=cce(Wvn,0),zvn=cce(sGe,0),jvn=cce((t,e)=>sGe(t,e,Uvn(e)),0);function uce(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const k2=50;function Bvn(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-k2,r),s=t.sliceDoc(i,i+k2),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*k2?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+k2),f=t.sliceDoc(i-k2,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 Uvn(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 sGe(t,e,n=e.selection.ranges){let r=n.map(o=>uce(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>Bvn(e,r[s],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let s=0,a;si&&(o==s||s>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:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:a.from+c,insert:l+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const LK=tp.define(),Vvn=tp.define(),Gvn=St.define(),aGe=St.define({combine(t){return np(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)})}}),lGe=Ko.define({create(){return rh.empty},update(t,e){let n=e.state.facet(aGe),r=e.annotation(LK);if(r){let l=ll.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=gz(u,u.length,n.minDepth,l):u=fGe(u,e.startState.selection),new rh(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(Vvn);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(ao.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=ll.fromTransaction(e),s=e.annotation(ao.time),a=e.annotation(ao.userEvent);return o?t=t.addChanges(o,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,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 rh(t.done.map(ll.fromJSON),t.undone.map(ll.fromJSON))}});function Hvn(t={}){return[lGe,aGe.of(t),mt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?cGe:e.inputType=="historyRedo"?$K:null;return r?(e.preventDefault(),r(n)):!1}})]}function IU(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(lGe,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const cGe=IU(0,!1),$K=IU(1,!1),qvn=IU(0,!0),Xvn=IU(1,!0);class ll{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 ll(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 ll(e.changes&&mo.fromJSON(e.changes),[],e.mapped&&_h.fromJSON(e.mapped),e.startSelection&&Ve.fromJSON(e.startSelection),e.selectionsAfter.map(Ve.fromJSON))}static fromTransaction(e,n){let r=lu;for(let i of e.startState.facet(Gvn)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new ll(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,lu)}static selection(e){return new ll(void 0,lu,void 0,void 0,e)}}function gz(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 Yvn(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,s,a)=>{for(let l=0;l=c&&s<=u&&(r=!0)}}),r}function Qvn(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function uGe(t,e){return t.length?e.length?t.concat(e):t:e}const lu=[],Kvn=200;function fGe(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Kvn));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),gz(t,t.length-1,1e9,n.setSelAfter(r)))}else return[ll.selection([e])]}function Zvn(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 _7(t,e){if(!t.length)return t;let n=t.length,r=lu;for(;n;){let i=Jvn(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?[ll.selection(r)]:lu}function Jvn(t,e,n){let r=uGe(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):lu,n);if(!t.changes)return ll.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new ll(i,rn.mapEffects(t.effects,e),s,t.startSelection.map(o),r)}const eyn=/^(input\.type|delete)($|\.)/;class rh{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 rh(this.done,this.undone):this}addChanges(e,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||eyn.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):LU(n,e))}function sa(t){return t.textDirectionAt(t.state.selection.main.head)==ai.LTR}const hGe=t=>dGe(t,!sa(t)),pGe=t=>dGe(t,sa(t));function gGe(t,e){return fd(t,n=>n.empty?t.moveByGroup(n,e):LU(n,e))}const nyn=t=>gGe(t,!sa(t)),ryn=t=>gGe(t,sa(t));function iyn(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 $U(t,e,n){let r=Ho(t).resolveInner(e.head),i=n?_n.closedBy:_n.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;iyn(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?nh(t,r.from,1):nh(t,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,Ve.cursor(a,n?-1:1)}const oyn=t=>fd(t,e=>$U(t.state,e,!sa(t))),syn=t=>fd(t,e=>$U(t.state,e,sa(t)));function mGe(t,e){return fd(t,n=>{if(!n.empty)return LU(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const vGe=t=>mGe(t,!1),yGe=t=>mGe(t,!0);function xGe(t){let e=t.scrollDOM.clientHeights.empty?t.moveVertically(s,e,n.height):LU(s,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottombGe(t,!1),FK=t=>bGe(t,!0);function s0(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=Ve.cursor(r.from+o))}return i}const ayn=t=>fd(t,e=>s0(t,e,!0)),lyn=t=>fd(t,e=>s0(t,e,!1)),cyn=t=>fd(t,e=>s0(t,e,!sa(t))),uyn=t=>fd(t,e=>s0(t,e,sa(t))),fyn=t=>fd(t,e=>Ve.cursor(t.lineBlockAt(e.head).from,1)),dyn=t=>fd(t,e=>Ve.cursor(t.lineBlockAt(e.head).to,-1));function hyn(t,e,n){let r=!1,i=ZO(t.selection,o=>{let s=nh(t,o.head,-1)||nh(t,o.head,1)||o.head>0&&nh(t,o.head-1,1)||o.headhyn(t,e);function Vu(t,e){let n=ZO(t.state.selection,r=>{let i=e(r);return Ve.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(ip(t.state,n)),!0)}function wGe(t,e){return Vu(t,n=>t.moveByChar(n,e))}const _Ge=t=>wGe(t,!sa(t)),SGe=t=>wGe(t,sa(t));function CGe(t,e){return Vu(t,n=>t.moveByGroup(n,e))}const gyn=t=>CGe(t,!sa(t)),myn=t=>CGe(t,sa(t)),vyn=t=>Vu(t,e=>$U(t.state,e,!sa(t))),yyn=t=>Vu(t,e=>$U(t.state,e,sa(t)));function OGe(t,e){return Vu(t,n=>t.moveVertically(n,e))}const EGe=t=>OGe(t,!1),TGe=t=>OGe(t,!0);function kGe(t,e){return Vu(t,n=>t.moveVertically(n,e,xGe(t).height))}const kwe=t=>kGe(t,!1),Awe=t=>kGe(t,!0),xyn=t=>Vu(t,e=>s0(t,e,!0)),byn=t=>Vu(t,e=>s0(t,e,!1)),wyn=t=>Vu(t,e=>s0(t,e,!sa(t))),_yn=t=>Vu(t,e=>s0(t,e,sa(t))),Syn=t=>Vu(t,e=>Ve.cursor(t.lineBlockAt(e.head).from)),Cyn=t=>Vu(t,e=>Ve.cursor(t.lineBlockAt(e.head).to)),Pwe=({state:t,dispatch:e})=>(e(ip(t,{anchor:0})),!0),Mwe=({state:t,dispatch:e})=>(e(ip(t,{anchor:t.doc.length})),!0),Rwe=({state:t,dispatch:e})=>(e(ip(t,{anchor:t.selection.main.anchor,head:0})),!0),Dwe=({state:t,dispatch:e})=>(e(ip(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Oyn=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Eyn=({state:t,dispatch:e})=>{let n=FU(t).map(({from:r,to:i})=>Ve.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Ve.create(n),userEvent:"select"})),!0},Tyn=({state:t,dispatch:e})=>{let n=ZO(t.selection,r=>{var i;let o=Ho(t).resolveStack(r.from,1);for(let s=o;s;s=s.next){let{node:a}=s;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&(!((i=a.parent)===null||i===void 0)&&i.parent))return Ve.range(a.to,a.from)}return r});return e(ip(t,n)),!0},kyn=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ve.create([n.main]):n.main.empty||(r=Ve.create([Ve.cursor(n.main.head)])),r?(e(ip(t,r)),!0):!1};function hD(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=e(o);ls&&(n="delete.forward",l=BL(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=BL(t,s,!1),a=BL(t,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:Ve.cursor(s,si(t)))r.between(e,e,(i,o)=>{ie&&(e=n?o:i)});return e}const AGe=(t,e,n)=>hD(t,r=>{let i=r.from,{state:o}=t,s=o.doc.lineAt(i),a,l;if(n&&!e&&i>s.from&&iAGe(t,!1,!0),PGe=t=>AGe(t,!0,!1),MGe=(t,e)=>hD(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=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=ms(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=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),RGe=t=>MGe(t,!1),Ayn=t=>MGe(t,!0),Pyn=t=>hD(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headhD(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Ryn=t=>hD(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:ar.of(["",""])},range:Ve.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Iyn=({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),s=i==o.from?i-1:ms(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:ms(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(s,i))},range:Ve.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function FU(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 s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function DGe(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of FU(t)){if(n?o.to==t.doc.length:o.from==0)continue;let s=t.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+t.lineBreak});for(let l of o.ranges)i.push(Ve.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:t.lineBreak+s.text});for(let l of o.ranges)i.push(Ve.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ve.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Lyn=({state:t,dispatch:e})=>DGe(t,e,!1),$yn=({state:t,dispatch:e})=>DGe(t,e,!0);function IGe(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of FU(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 Fyn=({state:t,dispatch:e})=>IGe(t,e,!1),Nyn=({state:t,dispatch:e})=>IGe(t,e,!0),zyn=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(FU(e).map(({from:i,to:o})=>(i>0?i--:o{let o;if(t.lineWrapping){let s=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+t.documentTop-a.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 jyn(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Ho(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(_n.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 Byn=LGe(!1),Uyn=LGe(!0);function LGe(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,a=e.doc.lineAt(o),l=!t&&o==s&&jyn(e,o);t&&(o=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new RU(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=oce(c,o);for(u==null&&(u=KO(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));sa.from&&o{let i=[];for(let s=r.from;s<=r.to;){let a=t.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),s=a.to+1}let o=t.changes(i);return{changes:i,range:Ve.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const Wyn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new RU(t,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=fce(t,(o,s,a)=>{let l=oce(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=mP(t,l);(c!=u||a.fromt.readOnly?!1:(e(t.update(fce(t,(n,r)=>{r.push({from:n.from,insert:t.facet(uD)})}),{userEvent:"input.indent"})),!0),FGe=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(fce(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=KO(i,t.tabSize),s=0,a=mP(t,Math.max(0,o-dz(t)));for(;s(t.setTabFocusMode(),!0),Gyn=[{key:"Ctrl-b",run:hGe,shift:_Ge,preventDefault:!0},{key:"Ctrl-f",run:pGe,shift:SGe},{key:"Ctrl-p",run:vGe,shift:EGe},{key:"Ctrl-n",run:yGe,shift:TGe},{key:"Ctrl-a",run:fyn,shift:Syn},{key:"Ctrl-e",run:dyn,shift:Cyn},{key:"Ctrl-d",run:PGe},{key:"Ctrl-h",run:NK},{key:"Ctrl-k",run:Pyn},{key:"Ctrl-Alt-h",run:RGe},{key:"Ctrl-o",run:Dyn},{key:"Ctrl-t",run:Iyn},{key:"Ctrl-v",run:FK}],Hyn=[{key:"ArrowLeft",run:hGe,shift:_Ge,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:nyn,shift:gyn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:cyn,shift:wyn,preventDefault:!0},{key:"ArrowRight",run:pGe,shift:SGe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ryn,shift:myn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:uyn,shift:_yn,preventDefault:!0},{key:"ArrowUp",run:vGe,shift:EGe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Pwe,shift:Rwe},{mac:"Ctrl-ArrowUp",run:Twe,shift:kwe},{key:"ArrowDown",run:yGe,shift:TGe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Mwe,shift:Dwe},{mac:"Ctrl-ArrowDown",run:FK,shift:Awe},{key:"PageUp",run:Twe,shift:kwe},{key:"PageDown",run:FK,shift:Awe},{key:"Home",run:lyn,shift:byn,preventDefault:!0},{key:"Mod-Home",run:Pwe,shift:Rwe},{key:"End",run:ayn,shift:xyn,preventDefault:!0},{key:"Mod-End",run:Mwe,shift:Dwe},{key:"Enter",run:Byn},{key:"Mod-a",run:Oyn},{key:"Backspace",run:NK,shift:NK},{key:"Delete",run:PGe},{key:"Mod-Backspace",mac:"Alt-Backspace",run:RGe},{key:"Mod-Delete",mac:"Alt-Delete",run:Ayn},{mac:"Mod-Backspace",run:Myn},{mac:"Mod-Delete",run:Ryn}].concat(Gyn.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),qyn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:oyn,shift:vyn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:syn,shift:yyn},{key:"Alt-ArrowUp",run:Lyn},{key:"Shift-Alt-ArrowUp",run:Fyn},{key:"Alt-ArrowDown",run:$yn},{key:"Shift-Alt-ArrowDown",run:Nyn},{key:"Escape",run:kyn},{key:"Mod-Enter",run:Uyn},{key:"Alt-l",mac:"Ctrl-l",run:Eyn},{key:"Mod-i",run:Tyn,preventDefault:!0},{key:"Mod-[",run:FGe},{key:"Mod-]",run:$Ge},{key:"Mod-Alt-\\",run:Wyn},{key:"Shift-Mod-k",run:zyn},{key:"Shift-Mod-\\",run:pyn},{key:"Mod-/",run:Fvn},{key:"Alt-A",run:zvn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Vyn}].concat(Hyn),Xyn={key:"Tab",run:$Ge,shift:FGe};function zr(){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 EC{constructor(e,n,r=0,i=e.length,o,s){this.test=s,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?a=>o(Iwe(a)):Iwe,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 as(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=Ble(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Zc(e);let i=this.normalize(n);for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==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=mz(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 a=new iS(n,e.sliceString(n,r));return S7.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=e.sliceString(n,s)+o,s=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=mz(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=iS.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(jGe.prototype[Symbol.iterator]=BGe.prototype[Symbol.iterator]=function(){return this});function Yyn(t){try{return new RegExp(t,dce),!0}catch{return!1}}function mz(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function zK(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=zr("input",{class:"cm-textfield",name:"line",value:e}),r=zr("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:vz.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},zr("label",t.state.phrase("Go to line"),": ",n)," ",zr("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:s}=t,a=s.doc.lineAt(s.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let m=h/100;l&&(m=m*(l=="-"?-1:1)+a.number/s.doc.lines),h=Math.round(s.doc.lines*m)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),g=Ve.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[vz.of(!1),mt.scrollIntoView(g.from,{y:"center"})],selection:g}),t.focus()}return{dom:r}}const vz=rn.define(),Lwe=Ko.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(vz)&&(t=n.value);return t},provide:t=>hP.from(t,e=>e?zK:null)}),Qyn=t=>{let e=dP(t,zK);if(!e){let n=[vz.of(!0)];t.state.field(Lwe,!1)==null&&n.push(rn.appendConfig.of([Lwe,Kyn])),t.dispatch({effects:n}),e=dP(t,zK)}return e&&e.dom.querySelector("input").select(),!0},Kyn=mt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Zyn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Jyn=St.define({combine(t){return np(t,Zyn,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function e0n(t){return[o0n,i0n]}const t0n=It.mark({class:"cm-selectionMatch"}),n0n=It.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function $we(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=mi.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=mi.Word)}function r0n(t,e,n,r){return t(e.sliceDoc(n,n+1))==mi.Word&&t(e.sliceDoc(r-1,r))==mi.Word}const i0n=Yi.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(Jyn),{state:n}=t,r=n.selection;if(r.ranges.length>1)return It.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return It.none;let l=n.wordAt(i.head);if(!l)return It.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return It.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!($we(s,n,i.from,i.to)&&r0n(s,n,i.from,i.to)))return It.none}else if(o=n.sliceDoc(i.from,i.to),!o)return It.none}let a=[];for(let l of t.visibleRanges){let c=new EC(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||$we(s,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(n0n.range(u,f)):(u>=i.to||f<=i.from)&&a.push(t0n.range(u,f)),a.length>e.maxMatches))return It.none}}return It.set(a)}},{decorations:t=>t.decorations}),o0n=mt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),s0n=({state:t,dispatch:e})=>{let{selection:n}=t,r=Ve.create(n.ranges.map(i=>t.wordAt(i.head)||Ve.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function a0n(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 s=!1,a=new EC(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new EC(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const l0n=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return s0n({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=a0n(t,r);return i?(e(t.update({selection:t.selection.addRange(Ve.range(i.from,i.to),!1),effects:mt.scrollIntoView(i.to)})),!0):!1},JO=St.define({combine(t){return np(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new b0n(e),scrollToMatch:e=>mt.scrollIntoView(e)})}});class UGe{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||Yyn(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 d0n(this):new u0n(this)}getCursor(e,n=0,r){let i=e.doc?e:In.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Gw(this,i,n,r):Vw(this,i,n,r)}}class WGe{constructor(e){this.spec=e}}function Vw(t,e,n,r){return new EC(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?c0n(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function c0n(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=Vw(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 Gw(t,e,n,r){return new jGe(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?f0n(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function yz(t,e){return t.slice(ms(t,e,!1),e)}function xz(t,e){return t.slice(e,ms(t,e))}function f0n(t){return(e,n,r)=>!r[0].length||(t(yz(r.input,r.index))!=mi.Word||t(xz(r.input,r.index))!=mi.Word)&&(t(xz(r.input,r.index+r[0].length))!=mi.Word||t(yz(r.input,r.index+r[0].length))!=mi.Word)}class d0n extends WGe{nextMatch(e,n,r){let i=Gw(this.spec,e,r,e.doc.length).next();return i.done&&(i=Gw(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),s=Gw(this.spec,e,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;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=Gw(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 vP=rn.define(),hce=rn.define(),Gv=Ko.define({create(t){return new C7(jK(t).create(),null)},update(t,e){for(let n of e.effects)n.is(vP)?t=new C7(n.value.create(),t.panel):n.is(hce)&&(t=new C7(t.query,n.value?pce:null));return t},provide:t=>hP.from(t,e=>e.panel)});class C7{constructor(e,n){this.query=e,this.panel=n}}const h0n=It.mark({class:"cm-searchMatch"}),p0n=It.mark({class:"cm-searchMatch cm-searchMatch-selected"}),g0n=Yi.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Gv))}update(t){let e=t.state.field(Gv);(e!=t.startState.field(Gv)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return It.none;let{view:n}=this,r=new wy;for(let i=0,o=n.visibleRanges,s=o.length;io[i+1].from-2*250;)l=o[++i].to;t.highlight(n.state,a,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?p0n:h0n)})}return r.finish()}},{decorations:t=>t.decorations});function pD(t){return e=>{let n=e.state.field(Gv,!1);return n&&n.query.spec.valid?t(e,n):HGe(e)}}const bz=pD((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=Ve.single(r.from,r.to),o=t.state.facet(JO);return t.dispatch({selection:i,effects:[gce(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),GGe(t),!0}),wz=pD((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=Ve.single(i.from,i.to),s=t.state.facet(JO);return t.dispatch({selection:o,effects:[gce(t,i),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),GGe(t),!0}),m0n=pD((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Ve.create(n.map(r=>Ve.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),v0n=({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=[],s=0;for(let a=new EC(t.doc,t.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(Ve.range(a.value.from,a.value.to))}return e(t.update({selection:Ve.create(o,s),userEvent:"select.search.matches"})),!0},Fwe=pD((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 s=[],a,l,c=[];if(o.from==r&&o.to==i&&(l=n.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(n,o.from,o.to),c.push(mt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let u=s.length==0||s[0].from>=o.to?0:o.to-o.from-l.length;a=Ve.single(o.from-u,o.to-u),c.push(gce(t,o)),c.push(n.facet(JO).scrollToMatch(a.main,t))}return t.dispatch({changes:s,selection:a,effects:c,userEvent:"input.replace"}),!0}),y0n=pD((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:mt.announce.of(r),userEvent:"input.replace.all"}),!0});function pce(t){return t.state.facet(JO).createPanel(t)}function jK(t,e){var n,r,i,o,s;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(JO);return new UGe({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:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function VGe(t){let e=dP(t,pce);return e&&e.dom.querySelector("[main-field]")}function GGe(t){let e=VGe(t);e&&e==t.root.activeElement&&e.select()}const HGe=t=>{let e=t.state.field(Gv,!1);if(e&&e.panel){let n=VGe(t);if(n&&n!=t.root.activeElement){let r=jK(t.state,e.query.spec);r.valid&&t.dispatch({effects:vP.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[hce.of(!0),e?vP.of(jK(t.state,e.query.spec)):rn.appendConfig.of(_0n)]});return!0},qGe=t=>{let e=t.state.field(Gv,!1);if(!e||!e.panel)return!1;let n=dP(t,pce);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:hce.of(!1)}),!0},x0n=[{key:"Mod-f",run:HGe,scope:"editor search-panel"},{key:"F3",run:bz,shift:wz,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:bz,shift:wz,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:qGe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:v0n},{key:"Mod-Alt-g",run:Qyn},{key:"Mod-d",run:l0n,preventDefault:!0}];class b0n{constructor(e){this.view=e;let n=this.query=e.state.field(Gv).query.spec;this.commit=this.commit.bind(this),this.searchField=zr("input",{value:n.search,placeholder:Il(e,"Find"),"aria-label":Il(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=zr("input",{value:n.replace,placeholder:Il(e,"Replace"),"aria-label":Il(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=zr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=zr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=zr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return zr("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=zr("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>bz(e),[Il(e,"next")]),r("prev",()=>wz(e),[Il(e,"previous")]),r("select",()=>m0n(e),[Il(e,"all")]),zr("label",null,[this.caseField,Il(e,"match case")]),zr("label",null,[this.reField,Il(e,"regexp")]),zr("label",null,[this.wordField,Il(e,"by word")]),...e.state.readOnly?[]:[zr("br"),this.replaceField,r("replace",()=>Fwe(e),[Il(e,"replace")]),r("replaceAll",()=>y0n(e),[Il(e,"replace all")])],zr("button",{name:"close",onclick:()=>qGe(e),"aria-label":Il(e,"close"),type:"button"},["×"])])}commit(){let e=new UGe({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:vP.of(e)}))}keydown(e){Agn(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?wz:bz)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Fwe(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(vP)&&!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(JO).top}}function Il(t,e){return t.state.phrase(e)}const UL=30,WL=/[\s\.,:;?!]/;function gce(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-UL),s=Math.min(i,n+UL),a=t.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;la.length-UL;l--)if(!WL.test(a[l-1])&&WL.test(a[l])){a=a.slice(0,l);break}}return mt.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const w0n=mt.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"}}),_0n=[Gv,o0.low(g0n),w0n];class XGe{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=Ho(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(QGe(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 Nwe(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 S0n(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+$/]:S0n(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function C0n(t,e){return n=>{for(let r=Ho(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 zwe{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function Hv(t){return t.selection.main.from}function QGe(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 mce=tp.define();function O0n(t,e,n,r){let{main:i}=t.selection,o=n-i.from,s=r-i.from;return Object.assign(Object.assign({},t.changeByRange(a=>a!=i&&n!=r&&t.sliceDoc(a.from+o,a.from+s)!=t.sliceDoc(n,r)?{range:a}:{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:e},range:Ve.cursor(a.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const jwe=new WeakMap;function E0n(t){if(!Array.isArray(t))return t;let e=jwe.get(t);return e||jwe.set(t,e=YGe(t)),e}const _z=rn.define(),yP=rn.define();class T0n{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&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(_=Ble(w))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!y||S==1&&m||b==0&&S!=0)&&(n[f]==w||r[f]==w&&(d=!0)?s[f++]=y:s.length&&(v=!1)),b=S,y+=Zc(w)}return f==l&&s[0]==0&&v?this.result(-100+(d?-200:0),s,e):h==l&&p==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-900-e.length,[p,g]):f==l?this.result(-100+(d?-200:0)+-700+(v?0:-1100),s,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 s of n){let a=s+(this.astral?Zc(as(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(e-r.length,i)}}class k0n{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:A0n,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=>Bwe(e(r),n(r)),optionClass:(e,n)=>r=>Bwe(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function Bwe(t,e){return t?e?t+" "+e:t:e}function A0n(t,e,n,r,i,o){let s=t.textDirection==ai.RTL,a=s,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&d=g||y>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let m=(e.bottom-e.top)/o.offsetHeight,v=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/m}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function P0n(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 s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;cl&&s.appendChild(document.createTextNode(a.slice(l,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function O7(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 M0n{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:s}=i.open,a=e.state.facet(ds);this.optionContent=P0n(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=O7(o.length,s,a.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(ds).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:yP.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:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=O7(o.length,s,e.state.facet(ds).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}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=O7(n.options.length,n.selected,this.view.state.facet(ds).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(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>al(this.view.state,s,"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&&D0n(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 s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.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+"-"+s,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew M0n(n,t,e)}function D0n(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 Uwe(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function I0n(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(ds);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 zwe(f,c.source,u?u(f):[],1e9-n.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new k0n(f):new T0n(f);for(let p of c.result.options)if(d=h.match(p.label)){let g=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new zwe(p,c.source,g,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,g;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((g=h.rank)!==null&&g!==void 0?g:1e9)||(d.namef.score-u.score||l(u.completion,f.completion))){let u=c.completion;!a||a.label!=u.label||a.detail!=u.detail||a.type!=null&&u.type!=null&&a.type!=u.type||a.apply!=u.apply||a.boost!=u.boost?s.push(c):Uwe(c.completion)>Uwe(a)&&(s[s.length-1]=c),a=c.completion}return s}class __{constructor(e,n,r,i,o,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new __(this.options,Wwe(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let s=I0n(e,n);if(!s.length)return i&&e.some(l=>l.state==1)?new __(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let a=n.facet(ds).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(l,c.from):l,1e8),create:j0n,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new __(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Sz{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new Sz(N0n,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(ds),o=(r.override||n.languageDataAt("autocomplete",Hv(n)).map(E0n)).map(a=>(this.active.find(c=>c.source==a)||new nc(a,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((a,l)=>a==this.active[l])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!L0n(o,this.active)?s=__.build(o,n,this.id,s,r):s&&s.disabled&&!o.some(a=>a.state==1)&&(s=null),!s&&o.every(a=>a.state!=1)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new nc(a.source,0):a));for(let a of e.effects)a.is(JGe)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new Sz(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?$0n:F0n}}function L0n(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const N0n=[];function KGe(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(mce);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 nc{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=KGe(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new nc(i.source,0)),r&4&&i.state==0&&(i=new nc(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(_z))i=new nc(i.source,1,o.value?Hv(e.state):-1);else if(o.is(yP))i=new nc(i.source,0);else if(o.is(ZGe))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(e,n){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new nc(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(Hv(e.state))}}class oS extends nc{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),s=e.changes.mapPos(this.to,1),a=Hv(e.state);if((this.explicitPos<0?a<=o:as||!i||n&2&&Hv(e.startState)==this.from)return new nc(this.source,n&4?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return z0n(i.validFor,e.state,o,s)?new oS(this.source,l,i,o,s):i.update&&(i=i.update(i,o,s,new XGe(e.state,a,l>=0)))?new oS(this.source,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Hv(e.state)):new nc(this.source,1,l)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new oS(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new nc(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function z0n(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):QGe(t,!0).test(i)}const ZGe=rn.define({map(t,e){return t.map(n=>n.map(e))}}),JGe=rn.define(),Ja=Ko.define({create(){return Sz.start()},update(t,e){return t.update(e)},provide:t=>[Jle.from(t,e=>e.tooltip),mt.contentAttributes.from(t,e=>e.attrs)]});function vce(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(Ja).active.find(i=>i.source==e.source);return r instanceof oS?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},O0n(t.state,n,r.from,r.to)),{annotations:mce.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const j0n=R0n(Ja,vce);function VL(t,e="option"){return n=>{let r=n.state.field(Ja,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),n.dispatch({effects:JGe.of(a)}),!0}}const B0n=t=>{let e=t.state.field(Ja,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Ja,!1)?(t.dispatch({effects:_z.of(!0)}),!0):!1,W0n=t=>{let e=t.state.field(Ja,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:yP.of(null)}),!0)};class V0n{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const G0n=50,H0n=1e3,q0n=Yi.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(Ja).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(Ja),n=t.state.facet(ds);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Ja)==e)return;let r=t.transactions.some(o=>{let s=KGe(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;oG0n&&Date.now()-s.time>H0n){for(let a of s.context.abortListeners)try{a()}catch(l){al(this.view.state,l)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(o=>o.effects.some(s=>s.is(_z)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.state==1&&!this.running.some(s=>s.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(Ja);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=Hv(e),r=new XGe(e,n,t.explicitPos==n,this.view),i=new V0n(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:yP.of(null)}),al(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(ds).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(ds);for(let r=0;rs.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new nc(i.active.source,0);for(let a of i.updates)s=s.update(a,n);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:ZGe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Ja,!1);if(e&&e.tooltip&&this.view.state.facet(ds).closeOnBlur){let n=e.open&&R7e(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:yP.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:_z.of(!1)}),20),this.composing=0}}}),X0n=typeof navigator=="object"&&/Win/.test(navigator.platform),Y0n=o0.highest(mt.domEventHandlers({keydown(t,e){let n=e.state.field(Ja,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(X0n&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&vce(e,r),!1}})),eHe=mt.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 Q0n{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class yce{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,fs.TrackDel),r=e.mapPos(this.to,1,fs.TrackDel);return n==null||r==null?null:new yce(this.field,n,r)}}class xce{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=s,u=/^\t*/.exec(l)[0].length;for(let f=0;fnew yce(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],o;for(let s of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(s);){let a=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 Q0n(c,r.length,o.index,o.index+u.length)),s=s.slice(0,o.index)+l+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(s)}return new xce(r,i)}}let K0n=It.widget({widget:new class extends rp{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Z0n=It.mark({class:"cm-snippetField"});class eE{constructor(e,n){this.ranges=e,this.active=n,this.deco=It.set(e.map(r=>(r.from==r.to?K0n:Z0n).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 eE(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 gD=rn.define({map(t,e){return t&&t.map(e)}}),J0n=rn.define(),xP=Ko.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(gD))return n.value;if(n.is(J0n)&&t)return new eE(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=>mt.decorations.from(t,e=>e?e.deco:It.none)});function bce(t,e){return Ve.create(t.filter(n=>n.field==e).map(n=>Ve.range(n.from,n.to)))}function exn(t){let e=xce.parse(t);return(n,r,i,o)=>{let{text:s,ranges:a}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:ar.of(s)},scrollIntoView:!0,annotations:r?[mce.of(r),ao.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=bce(a,0)),a.some(c=>c.field>0)){let c=new eE(a,0),u=l.effects=[gD.of(c)];n.state.field(xP,!1)===void 0&&u.push(rn.appendConfig.of([xP,oxn,sxn,eHe]))}n.dispatch(n.state.update(l))}}function tHe(t){return({state:e,dispatch:n})=>{let r=e.field(xP,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(s=>s.field==i+t);return n(e.update({selection:bce(r.ranges,i),effects:gD.of(o?null:new eE(r.ranges,i)),scrollIntoView:!0})),!0}}const txn=({state:t,dispatch:e})=>t.field(xP,!1)?(e(t.update({effects:gD.of(null)})),!0):!1,nxn=tHe(1),rxn=tHe(-1),ixn=[{key:"Tab",run:nxn,shift:rxn},{key:"Escape",run:txn}],Vwe=St.define({combine(t){return t.length?t[0]:ixn}}),oxn=o0.highest(lD.compute([Vwe],t=>t.facet(Vwe)));function mp(t,e){return Object.assign(Object.assign({},e),{apply:exn(t)})}const sxn=mt.domEventHandlers({mousedown(t,e){let n=e.state.field(xP,!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:bce(n.ranges,i.field),effects:gD.of(n.ranges.some(o=>o.field>i.field)?new eE(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),bP={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},wx=rn.define({map(t,e){let n=e.mapPos(t,-1,fs.TrackAfter);return n??void 0}}),wce=new class extends Lb{};wce.startSide=1;wce.endSide=-1;const nHe=Ko.define({create(){return Gn.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(wx)&&(t=t.update({add:[wce.range(n.value,n.value+1)]}));return t}});function axn(){return[cxn,nHe]}const E7="()[]{}<>";function rHe(t){for(let e=0;e{if((lxn?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Zc(as(r,0))==1||e!=i.from||n!=i.to)return!1;let o=dxn(t.state,r);return o?(t.dispatch(o),!0):!1}),uxn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=iHe(t,t.selection.main.head).brackets||bP.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let a=hxn(t.doc,s.head);for(let l of r)if(l==a&&NU(t.doc,s.head)==rHe(as(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:Ve.cursor(s.head-l.length)}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},fxn=[{key:"Backspace",run:uxn}];function dxn(t,e){let n=iHe(t,t.selection.main.head),r=n.brackets||bP.brackets;for(let i of r){let o=rHe(as(i,0));if(e==i)return o==i?mxn(t,i,r.indexOf(i+i+i)>-1,n):pxn(t,i,o,n.before||bP.before);if(e==o&&oHe(t,t.selection.main.from))return gxn(t,i,o)}return null}function oHe(t,e){let n=!1;return t.field(nHe).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function NU(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Zc(as(n,0)))}function hxn(t,e){let n=t.sliceString(e-2,e);return Zc(as(n,0))==n.length?n:n.slice(1)}function pxn(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:wx.of(s.to+e.length),range:Ve.range(s.anchor+e.length,s.head+e.length)};let a=NU(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:wx.of(s.head+e.length),range:Ve.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function gxn(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&NU(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:Ve.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function mxn(t,e,n,r){let i=r.stringPrefixes||bP.stringPrefixes,o=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:wx.of(a.to+e.length),range:Ve.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=NU(t.doc,l),u;if(c==e){if(Gwe(t,l))return{changes:{insert:e+e,from:l},effects:wx.of(l+e.length),range:Ve.cursor(l+e.length)};if(oHe(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:Ve.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=Hwe(t,l-2*e.length,i))>-1&&Gwe(t,u))return{changes:{insert:e+e+e+e,from:l},effects:wx.of(l+e.length),range:Ve.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=mi.Word&&Hwe(t,l,i)>-1&&!vxn(t,l,e,i))return{changes:{insert:e+e,from:l},effects:wx.of(l+e.length),range:Ve.cursor(l+e.length)}}return{range:o=a}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Gwe(t,e){let n=Ho(t).resolveInner(e+1);return n.parent&&n.from==e}function vxn(t,e,n,r){let i=Ho(t).resolveInner(e,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.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 Hwe(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=mi.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))!=mi.Word)return o}return-1}function sHe(t={}){return[Y0n,Ja,ds.of(t),q0n,yxn,eHe]}const aHe=[{key:"Ctrl-Space",run:U0n},{key:"Escape",run:W0n},{key:"ArrowDown",run:VL(!0)},{key:"ArrowUp",run:VL(!1)},{key:"PageDown",run:VL(!0,"page")},{key:"PageUp",run:VL(!1,"page")},{key:"Enter",run:B0n}],yxn=o0.highest(lD.computeN([ds],t=>t.facet(ds).defaultKeymap?[aHe]:[]));class xxn{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class sx{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(wP).markerFilter;o&&(i=o(i,r));let s=It.set(i.map(a=>a.from==a.to||a.from==a.to-1&&r.doc.lineAt(a.from).to==a.from?It.widget({widget:new kxn(a),diagnostic:a}).range(a.from):It.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a}).range(a.from,a.to)),!0);return new sx(s,n,TC(s))}}function TC(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new xxn(i,o,s.diagnostic),!1}),r}function bxn(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(wP).hideOn(t,n,r);if(i!=null)return i;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(lHe))||t.changes.touchesRange(o.from,Math.max(o.to,r)))}function wxn(t,e){return t.field(cc,!1)?e:e.concat(rn.appendConfig.of(Mxn))}const lHe=rn.define(),_ce=rn.define(),cHe=rn.define(),cc=Ko.define({create(){return new sx(It.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=TC(n,t.selected.diagnostic,o)||TC(n,null,o)}!n.size&&i&&e.state.facet(wP).autoPanel&&(i=null),t=new sx(n,i,r)}for(let n of e.effects)if(n.is(lHe)){let r=e.state.facet(wP).autoPanel?n.value.length?_P.open:null:t.panel;t=sx.init(n.value,r,e.state)}else n.is(_ce)?t=new sx(t.diagnostics,n.value?_P.open:null,t.selected):n.is(cHe)&&(t=new sx(t.diagnostics,t.panel,n.value));return t},provide:t=>[hP.from(t,e=>e.panel),mt.decorations.from(t,e=>e.diagnostics)]}),_xn=It.mark({class:"cm-lintRange cm-lintRange-active"});function Sxn(t,e,n){let{diagnostics:r}=t.state.field(cc),i=[],o=2e8,s=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)&&(efHe(t,n,!1)))}const Oxn=t=>{let e=t.state.field(cc,!1);(!e||!e.panel)&&t.dispatch({effects:wxn(t.state,[_ce.of(!0)])});let n=dP(t,_P.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},qwe=t=>{let e=t.state.field(cc,!1);return!e||!e.panel?!1:(t.dispatch({effects:_ce.of(!1)}),!0)},Exn=t=>{let e=t.state.field(cc,!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)},Txn=[{key:"Mod-Shift-m",run:Oxn,preventDefault:!0},{key:"F8",run:Exn}],wP=St.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},np(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 uHe(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 fHe(t,e,n){var r;let i=n?uHe(e.actions):[];return zr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},zr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let h=TC(t.state.field(cc).diagnostics,e);h&&o.apply(t,h.from,h.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),zr("u",c.slice(u,u+1)),c.slice(u+1)];return zr("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),e.source&&zr("div",{class:"cm-diagnosticSource"},e.source))}class kxn extends rp{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return zr("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Xwe{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=fHe(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class _P{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)qwe(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],s=uHe(o.actions);for(let a=0;a{for(let o=0;oqwe(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(cc).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:s,panel:a})=>{let l=a.height/this.list.offsetHeight;s.topa.bottom&&(this.list.scrollTop+=(s.bottom-a.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(cc),r=TC(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:cHe.of(r)})}static open(e){return new _P(e)}}function Axn(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function GL(t){return Axn(``,'width="6" height="3"')}const Pxn=mt.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:GL("#d11")},".cm-lintRange-warning":{backgroundImage:GL("orange")},".cm-lintRange-info":{backgroundImage:GL("#999")},".cm-lintRange-hint":{backgroundImage:GL("#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}}}),Mxn=[cc,mt.decorations.compute([cc],t=>{let{selected:e,panel:n}=t.field(cc);return!e||!n||e.from==e.to?It.none:It.set([_xn.range(e.from,e.to)])}),vmn(Sxn,{hideOn:bxn}),Pxn];var Ywe=function(e){e===void 0&&(e={});var n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(fxn)),e.defaultKeymap!==!1&&(n=n.concat(qyn)),e.searchKeymap!==!1&&(n=n.concat(x0n)),e.historyKeymap!==!1&&(n=n.concat(tyn)),e.foldKeymap!==!1&&(n=n.concat(gvn)),e.completionKeymap!==!1&&(n=n.concat(aHe)),e.lintKeymap!==!1&&(n=n.concat(Txn));var r=[];return e.lineNumbers!==!1&&r.push(kmn()),e.highlightActiveLineGutter!==!1&&r.push(Mmn()),e.highlightSpecialChars!==!1&&r.push(Hgn()),e.history!==!1&&r.push(Hvn()),e.foldGutter!==!1&&r.push(xvn()),e.drawSelection!==!1&&r.push(Lgn()),e.dropCursor!==!1&&r.push(jgn()),e.allowMultipleSelections!==!1&&r.push(In.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(svn()),e.syntaxHighlighting!==!1&&r.push(nGe(Svn,{fallback:!0})),e.bracketMatching!==!1&&r.push(Pvn()),e.closeBrackets!==!1&&r.push(axn()),e.autocompletion!==!1&&r.push(sHe()),e.rectangularSelection!==!1&&r.push(smn()),e.crosshairCursor!==!1&&r.push(cmn()),e.highlightActiveLine!==!1&&r.push(Zgn()),e.highlightSelectionMatches!==!1&&r.push(e0n()),e.tabSize&&typeof e.tabSize=="number"&&r.push(uD.of(" ".repeat(e.tabSize))),r.concat([lD.of(n.flat())]).filter(Boolean)};const Rxn="#e5c07b",Qwe="#e06c75",Dxn="#56b6c2",Ixn="#ffffff",X3="#abb2bf",BK="#7d8799",Lxn="#61afef",$xn="#98c379",Kwe="#d19a66",Fxn="#c678dd",Nxn="#21252b",Zwe="#2c313a",Jwe="#282c34",T7="#353a42",zxn="#3E4451",e_e="#528bff",jxn=mt.theme({"&":{color:X3,backgroundColor:Jwe},".cm-content":{caretColor:e_e},".cm-cursor, .cm-dropCursor":{borderLeftColor:e_e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:zxn},".cm-panels":{backgroundColor:Nxn,color:X3},".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:Jwe,color:BK,border:"none"},".cm-activeLineGutter":{backgroundColor:Zwe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:T7},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:T7,borderBottomColor:T7},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Zwe,color:X3}}},{dark:!0}),Bxn=dD.define([{tag:Ee.keyword,color:Fxn},{tag:[Ee.name,Ee.deleted,Ee.character,Ee.propertyName,Ee.macroName],color:Qwe},{tag:[Ee.function(Ee.variableName),Ee.labelName],color:Lxn},{tag:[Ee.color,Ee.constant(Ee.name),Ee.standard(Ee.name)],color:Kwe},{tag:[Ee.definition(Ee.name),Ee.separator],color:X3},{tag:[Ee.typeName,Ee.className,Ee.number,Ee.changed,Ee.annotation,Ee.modifier,Ee.self,Ee.namespace],color:Rxn},{tag:[Ee.operator,Ee.operatorKeyword,Ee.url,Ee.escape,Ee.regexp,Ee.link,Ee.special(Ee.string)],color:Dxn},{tag:[Ee.meta,Ee.comment],color:BK},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.link,color:BK,textDecoration:"underline"},{tag:Ee.heading,fontWeight:"bold",color:Qwe},{tag:[Ee.atom,Ee.bool,Ee.special(Ee.variableName)],color:Kwe},{tag:[Ee.processingInstruction,Ee.string,Ee.inserted],color:$xn},{tag:Ee.invalid,color:Ixn}]),Uxn=[jxn,nGe(Bxn)];var Wxn=mt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Vxn=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(lD.of([Xyn])),a&&(typeof a=="boolean"?l.unshift(Ywe()):l.unshift(Ywe(a))),s&&l.unshift(nmn(s)),o){case"light":l.push(Wxn);break;case"dark":l.push(Uxn);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(mt.editable.of(!1)),i&&l.push(In.readOnly.of(!0)),[...l]},Gxn=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)}),t_e=tp.define(),Hxn=[];function qxn(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=Hxn,autoFocus:l,theme:c="light",height:u="",minHeight:f="",maxHeight:d="",placeholder:h="",width:p="",minWidth:g="",maxWidth:m="",editable:v=!0,readOnly:y=!1,indentWithTab:x=!0,basicSetup:b=!0,root:w,initialState:_}=t,[S,O]=D.useState(),[k,E]=D.useState(),[P,A]=D.useState(),R=mt.theme({"&":{height:u,minHeight:f,maxHeight:d,width:p,minWidth:g,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),T=mt.updateListener.of(z=>{if(z.docChanged&&typeof r=="function"&&!z.transactions.some(L=>L.annotation(t_e))){var F=z.state.doc,N=F.toString();r(N,z)}i&&i(Gxn(z))}),M=Vxn({theme:c,editable:v,readOnly:y,placeholder:h,indentWithTab:x,basicSetup:b}),I=[T,R,...M];return s&&typeof s=="function"&&I.push(mt.updateListener.of(s)),I=I.concat(a),D.useEffect(()=>{if(S&&!P){var z={doc:e,selection:n,extensions:I},F=_?In.fromJSON(_.json,z,_.fields):In.create(z);if(A(F),!k){var N=new mt({state:F,parent:S,root:w});E(N),o&&o(N,F)}}return()=>{k&&(A(void 0),E(void 0))}},[S,P]),D.useEffect(()=>O(t.container),[t.container]),D.useEffect(()=>()=>{k&&(k.destroy(),E(void 0))},[k]),D.useEffect(()=>{l&&k&&k.focus()},[l,k]),D.useEffect(()=>{k&&k.dispatch({effects:rn.reconfigure.of(I)})},[c,a,u,f,d,p,g,m,h,v,y,x,b,r,s]),D.useEffect(()=>{if(e!==void 0){var z=k?k.state.doc.toString():"";k&&e!==z&&k.dispatch({changes:{from:0,to:z.length,insert:e||""},annotations:[t_e.of(!0)]})}},[e,k]),{state:P,setState:A,view:k,setView:E,container:S,setContainer:O}}var Xxn=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],zU=D.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:w,readOnly:_,root:S,initialState:O}=t,k=Dt(t,Xxn),E=D.useRef(null),{state:P,view:A,container:R}=qxn({container:E.current,root:S,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:w,readOnly:_,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:O});if(D.useImperativeHandle(e,()=>({editor:E.current,state:P,view:A}),[E,R,P,A]),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 C.jsx("div",ve({ref:E,className:""+T+(n?" "+n:"")},k))});zU.displayName="CodeMirror";var n_e={};let Yxn=class UK{constructor(e,n,r,i,o,s,a,l,c,u=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,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 UK(e,[],n,r,r,0,[],0,i?new r_e(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,s=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&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+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:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.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 UK(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 Qxn(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,s;ol&1&&a==s)||i.push(n[o],s)}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 s=this.findForcedReduction();if(s==null)return!1;n=s}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,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};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 r_e{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Qxn{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 Cz{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 Cz(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 Cz(this.stack,this.pos,this.index)}}function HL(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class Y3{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const i_e=new Y3;class Kxn{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=i_e,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 s=this.ranges[++i];o+=s.from-r.to,r=s}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&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.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=i_e,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 sS{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Zxn(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}sS.prototype.contextual=sS.prototype.fallback=sS.prototype.extend=!1;sS.prototype.fallback=sS.prototype.extend=!1;class jU{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Zxn(t,e,n,r,i,o){let s=0,a=1<0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||Jxn(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,d=t[s+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){s=t[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),g=t[p],m=t[p+1]||65536;if(u=m)f=h+1;else{s=t[p+2],e.advance();continue e}}break}}function o_e(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function Jxn(t,e,n,r){let i=o_e(n,r,e);return i<0||o_e(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 ebn{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?s_e(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?s_e(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=s,null;if(o instanceof lo){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class tbn{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Y3)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=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 Y3,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 Y3,{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 s=0;s=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>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 ebn(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[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&obn(i);if(s)return Ll&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Ll&&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 s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return Ll&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s ":"";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(_n.contextHash)||0)==u))return e.useNode(f,d),Ll&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof lo)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof lo&&f.positions[0]==0)f=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ll&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&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 a_e(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let s=0;s ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),Ll&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&(Ll&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)Ll&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))Ll&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),Ll&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),a_e(a,r)):(!i||i.scoret;class ibn{constructor(e){this.start=e.start,this.shift=e.shift||A7,this.reduce=e.reduce||A7,this.reuse=e.reuse||A7,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class SP extends j7e{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 a=0;ae.topRules[a][1]),i=[];for(let a=0;a=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)o(a[c++],l,f);c++}}}this.nodeSet=new ece(n.map((a,l)=>Tl.define({name:l>=this.minRepeatTerm?void 0:a,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=$7e;let s=HL(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new sS(s,a):a),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 nbn(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 s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>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=jp(this.data,o+2);else break;i=n(jp(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=jp(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(SP.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(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=l_e(s),s})),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 s=n.indexOf(o);s>=0&&(r[s]=!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 sbn=ice({String:Ee.string,Number:Ee.number,"True False":Ee.bool,PropertyName:Ee.propertyName,Null:Ee.null,",":Ee.separator,"[ ]":Ee.squareBracket,"{ }":Ee.brace}),abn=SP.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:[sbn],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}),lbn=gP.define({name:"json",parser:abn.configure({props:[sce.add({Object:_we({except:/^\s*\}/}),Array:_we({except:/^\s*\]/})}),lce.add({"Object Array":q7e})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function dHe(){return new V7e(lbn)}const cbn=1,hHe=194,pHe=195,ubn=196,c_e=197,fbn=198,dbn=199,hbn=200,pbn=2,gHe=3,u_e=201,gbn=24,mbn=25,vbn=49,ybn=50,xbn=55,bbn=56,wbn=57,_bn=59,Sbn=60,Cbn=61,Obn=62,Ebn=63,Tbn=65,kbn=238,Abn=71,Pbn=241,Mbn=242,Rbn=243,Dbn=244,Ibn=245,Lbn=246,$bn=247,Fbn=248,mHe=72,Nbn=249,zbn=250,jbn=251,Bbn=252,Ubn=253,Wbn=254,Vbn=255,Gbn=256,Hbn=73,qbn=77,Xbn=263,Ybn=112,Qbn=130,Kbn=151,Zbn=152,Jbn=155,jb=10,CP=13,Sce=32,BU=9,Cce=35,e1n=40,t1n=46,WK=123,f_e=125,vHe=39,yHe=34,n1n=92,r1n=111,i1n=120,o1n=78,s1n=117,a1n=85,l1n=new Set([mbn,vbn,ybn,Xbn,Tbn,Qbn,bbn,wbn,kbn,Obn,Ebn,mHe,Hbn,qbn,Sbn,Cbn,Kbn,Zbn,Jbn,Ybn]);function P7(t){return t==jb||t==CP}function M7(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const c1n=new jU((t,e)=>{let n;if(t.next<0)t.acceptToken(dbn);else if(e.context.flags&Q3)P7(t.next)&&t.acceptToken(fbn,1);else if(((n=t.peek(-1))<0||P7(n))&&e.canShift(c_e)){let r=0;for(;t.next==Sce||t.next==BU;)t.advance(),r++;(t.next==jb||t.next==CP||t.next==Cce)&&t.acceptToken(c_e,-r)}else P7(t.next)&&t.acceptToken(ubn,1)},{contextual:!0}),u1n=new jU((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==jb||r==CP){let i=0,o=0;for(;;){if(t.next==Sce)i++;else if(t.next==BU)i+=8-i%8;else break;t.advance(),o++}i!=n.indent&&t.next!=jb&&t.next!=CP&&t.next!=Cce&&(i[t,e|xHe])),h1n=new ibn({start:f1n,reduce(t,e,n,r){return t.flags&Q3&&l1n.has(e)||(e==Abn||e==mHe)&&t.flags&xHe?t.parent:t},shift(t,e,n,r){return e==hHe?new K3(t,d1n(r.read(r.pos,n.pos)),0):e==pHe?t.parent:e==gbn||e==xbn||e==_bn||e==gHe?new K3(t,0,Q3):d_e.has(e)?new K3(t,0,d_e.get(e)|t.flags&Q3):t},hash(t){return t.hash}}),p1n=new jU(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==Sce||n==BU)){n!=e1n&&n!=t1n&&n!=jb&&n!=CP&&n!=Cce&&t.acceptToken(cbn);return}}}),g1n=new jU((t,e)=>{let{flags:n}=e.context,r=n&Op?yHe:vHe,i=(n&Ep)>0,o=!(n&Tp),s=(n&kp)>0,a=t.pos;for(;!(t.next<0);)if(s&&t.next==WK)if(t.peek(1)==WK)t.advance(2);else{if(t.pos==a){t.acceptToken(gHe,1);return}break}else if(o&&t.next==n1n){if(t.pos==a){t.advance();let l=t.next;l>=0&&(t.advance(),m1n(t,l)),t.acceptToken(pbn);return}break}else if(t.next==r&&(!i||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==a){t.acceptToken(u_e,i?3:1);return}break}else if(t.next==jb){if(i)t.advance();else if(t.pos==a){t.acceptToken(u_e);return}break}else t.advance();t.pos>a&&t.acceptToken(hbn)});function m1n(t,e){if(e==r1n)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==i1n)for(let n=0;n<2&&M7(t.next);n++)t.advance();else if(e==s1n)for(let n=0;n<4&&M7(t.next);n++)t.advance();else if(e==a1n)for(let n=0;n<8&&M7(t.next);n++)t.advance();else if(e==o1n&&t.next==WK){for(t.advance();t.next>=0&&t.next!=f_e&&t.next!=vHe&&t.next!=yHe&&t.next!=jb;)t.advance();t.next==f_e&&t.advance()}}const v1n=ice({'async "*" "**" FormatConversion FormatSpec':Ee.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Ee.controlKeyword,"in not and or is del":Ee.operatorKeyword,"from def class global nonlocal lambda":Ee.definitionKeyword,import:Ee.moduleKeyword,"with as print":Ee.keyword,Boolean:Ee.bool,None:Ee.null,VariableName:Ee.variableName,"CallExpression/VariableName":Ee.function(Ee.variableName),"FunctionDefinition/VariableName":Ee.function(Ee.definition(Ee.variableName)),"ClassDefinition/VariableName":Ee.definition(Ee.className),PropertyName:Ee.propertyName,"CallExpression/MemberExpression/PropertyName":Ee.function(Ee.propertyName),Comment:Ee.lineComment,Number:Ee.number,String:Ee.string,FormatString:Ee.special(Ee.string),Escape:Ee.escape,UpdateOp:Ee.updateOperator,"ArithOp!":Ee.arithmeticOperator,BitOp:Ee.bitwiseOperator,CompareOp:Ee.compareOperator,AssignOp:Ee.definitionOperator,Ellipsis:Ee.punctuation,At:Ee.meta,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace,".":Ee.derefOperator,", ;":Ee.separator}),y1n={__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},x1n=SP.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:[p1n,u1n,c1n,g1n,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>y1n[t]||-1}],tokenPrec:7652}),h_e=new Nmn,bHe=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function qL(t){return(e,n,r)=>{if(r)return!1;let i=e.node.getChild("VariableName");return i&&n(i,t),!0}}const b1n={FunctionDefinition:qL("function"),ClassDefinition:qL("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 s=i.getChild("import");s;s=s.nextSibling)s.name=="VariableName"&&((r=s.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(s,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:qL("variable"),AsPattern:qL("variable"),__proto__:null};function wHe(t,e){let n=h_e.get(e);if(n)return n;let r=[],i=!0;function o(s,a){let l=t.sliceString(s.from,s.to);r.push({label:l,type:a})}return e.cursor(yo.IncludeAnonymous).iterate(s=>{if(s.name){let a=b1n[s.name];if(a&&a(s,o,i)||!i&&bHe.has(s.name))return!1;i=!1}else if(s.to-s.from>8192){for(let a of wHe(t,s.node))r.push(a);return!1}}),h_e.set(e,r),r}const p_e=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,_He=["String","FormatString","Comment","PropertyName"];function w1n(t){let e=Ho(t.state).resolveInner(t.pos,-1);if(_He.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&p_e.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)bHe.has(i.name)&&(r=r.concat(wHe(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:p_e}}const _1n=["__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"}))),S1n=[mp("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),mp("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),mp("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),mp("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),mp(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),mp("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),mp("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),mp("import ${module}",{label:"import",detail:"statement",type:"keyword"}),mp("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],C1n=C0n(_He,YGe(_1n.concat(S1n)));function g_e(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 R7=mP.define({name:"python",parser:x1n.configure({props:[sce.add({Body:t=>{var e;return(e=g_e(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":y7({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":y7({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":y7({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=g_e(t,e);if(n!=null)return n}}return t.continue()}}),lce.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":q7e,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 O1n(){return new V7e(R7,[R7.data.of({autocomplete:w1n}),R7.data.of({autocomplete:C1n})])}const E1n=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,kC={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"}},T1n=({visibleInfoCardElements:t,setVisibleInfoCardElements:e,infoCardElementViewModes:n,updateInfoCardElementViewMode:r,selectedDataset:i,selectedVariable:o,selectedPlaceInfo:s,selectedTime:a,serverConfig:l,allowViewModePython:c})=>{const u=(p,g)=>{e(g)};let f,d,h;if(i){const p="dataset",g=n[p],m=y=>r(p,y),v=t.includes(p);f=C.jsx(k1n,{isIn:v,viewMode:g,setViewMode:m,dataset:i,serverConfig:l,hasPython:c})}if(i&&o){const p="variable",g=n[p],m=y=>r(p,y),v=t.includes(p);d=C.jsx(A1n,{isIn:v,viewMode:g,setViewMode:m,variable:o,time:a,serverConfig:l,hasPython:c})}if(s){const p="place",g=n[p],m=y=>r(p,y),v=t.includes(p);h=C.jsx(P1n,{isIn:v,viewMode:g,setViewMode:m,placeInfo:s})}return C.jsxs(vPe,{sx:kC.card,children:[C.jsx(yPe,{disableSpacing:!0,children:C.jsxs(tO,{size:"small",value:t,onChange:u,children:[C.jsx(xr,{value:"dataset",disabled:i===null,size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Dataset information"),children:C.jsx(Lhn,{})})},0),C.jsx(xr,{value:"variable",disabled:o===null,size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Variable information"),children:C.jsx(s9e,{})})},1),C.jsx(xr,{value:"place",disabled:s===null,size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Place information"),children:C.jsx(Dhn,{})})},2)]},0)}),f,d,h]})},k1n=({isIn:t,viewMode:e,setViewMode:n,dataset:r,serverConfig:i,hasPython:o})=>{let s;if(e==="code"){const a=r.dimensions.map(c=>VK(c,["name","size","dtype"])),l=VK(r,["id","title","bbox","attrs"]);l.dimensions=a,s=C.jsx(Ece,{code:JSON.stringify(l,null,2)})}else if(e==="list")s=C.jsx(yg,{children:C.jsx(EP,{data:Object.getOwnPropertyNames(r.attrs||{}).map(a=>[a,r.attrs[a]])})});else if(e==="text"){const a=[[pe.get("Dimension names"),r.dimensions.map(l=>l.name).join(", ")],[pe.get("Dimension data types"),r.dimensions.map(l=>l.dtype).join(", ")],[pe.get("Dimension lengths"),r.dimensions.map(l=>l.size).join(", ")],[pe.get("Geographical extent")+" (x1, y1, x2, y2)",r.bbox.map(l=>l+"").join(", ")],[pe.get("Spatial reference system"),r.spatialRef]];s=C.jsx(yg,{children:C.jsx(EP,{data:a})})}else e==="python"&&(s=C.jsx(CHe,{code:M1n(i,r)}));return C.jsx(Oce,{title:r.title||"?",subheader:r.title&&`ID: ${r.id}`,isIn:t,viewMode:e,setViewMode:n,hasPython:o,children:s})},A1n=({isIn:t,viewMode:e,setViewMode:n,variable:r,time:i,serverConfig:o,hasPython:s})=>{let a,l;if(e==="code"){const c=VK(r,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);a=C.jsx(Ece,{code:JSON.stringify(c,null,2)})}else if(e==="list"){if(a=C.jsx(yg,{children:C.jsx(EP,{data:Object.getOwnPropertyNames(r.attrs||{}).map(c=>[c,r.attrs[c]])})}),r.htmlRepr){const c=u=>{u&&r.htmlRepr&&(u.innerHTML=r.htmlRepr)};l=C.jsx(yg,{children:C.jsx(kl,{ref:c,sx:kC.variableHtmlReprContainer})})}}else if(e==="text"){let c=[[pe.get("Name"),r.name],[pe.get("Title"),r.title],[pe.get("Units"),r.units]];jM(r)?c.push([pe.get("Expression"),r.expression]):c=[...c,[pe.get("Data type"),r.dtype],[pe.get("Dimension names"),r.dims.join(", ")],[pe.get("Dimension lengths"),r.shape.map(u=>u+"").join(", ")],[pe.get("Time chunk size"),r.timeChunkSize]],a=C.jsx(yg,{children:C.jsx(EP,{data:c})})}else e==="python"&&(a=C.jsx(CHe,{code:R1n(o,r,i)}));return C.jsxs(Oce,{title:r.title||r.name,subheader:`${pe.get("Name")}: ${r.name}`,isIn:t,viewMode:e,setViewMode:n,hasPython:s,children:[l,a]})},P1n=({isIn:t,viewMode:e,setViewMode:n,placeInfo:r})=>{const i=r.place;let o,s,a;if(e==="code")o=C.jsx(Ece,{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=C.jsx(yg,{children:C.jsx(EP,{data:l})})}else o=C.jsx(yg,{children:C.jsx(Jt,{children:pe.get("There is no information available for this location.")})});else r.image&&r.image.startsWith("http")&&(s=C.jsx(Lst,{sx:kC.media,image:r.image,title:r.label})),r.description&&(a=C.jsx(yg,{children:C.jsx(Jt,{children:r.description})}));return C.jsxs(Oce,{title:r.label,subheader:`${pe.get("Geometry type")}: ${pe.get(i.geometry.type)}`,isIn:t,viewMode:e,setViewMode:n,children:[s,a,o]})},Oce=({isIn:t,title:e,subheader:n,viewMode:r,setViewMode:i,hasPython:o,children:s})=>{const a=(l,c)=>{i(c)};return C.jsxs(MF,{in:t,timeout:"auto",unmountOnExit:!0,children:[C.jsx(Ast,{title:e,subheader:n,titleTypographyProps:{fontSize:"1.1em"},action:C.jsxs(tO,{size:"small",value:r,exclusive:!0,onChange:a,children:[C.jsx(xr,{value:"text",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Textual format"),children:C.jsx(Ihn,{})})},0),C.jsx(xr,{value:"list",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Tabular format"),children:C.jsx(Rhn,{})})},1),C.jsx(xr,{value:"code",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("JSON format"),children:C.jsx(Mhn,{})})},2),o&&C.jsx(xr,{value:"python",size:"small",sx:{...il.toggleButton,width:"30px"},children:C.jsx("img",{src:E1n,width:16,alt:"python logo"})},3)]},0)}),s]})},EP=({data:t})=>C.jsx(NPe,{component:kl,sx:kC.keyValueTableContainer,children:C.jsx(Jee,{sx:kC.table,size:"small",children:C.jsx(ete,{children:t.map((e,n)=>{const[r,i]=e;let o=i;return typeof i=="string"&&(i.startsWith("http://")||i.startsWith("https://"))?o=C.jsx(lct,{href:i,target:"_blank",rel:"noreferrer",children:i}):Array.isArray(i)&&(o="["+i.map(s=>s+"").join(", ")+"]"),C.jsxs(Ad,{children:[C.jsx(ui,{children:r}),C.jsx(ui,{align:"right",children:o})]},n)})})})}),yg=({children:t})=>C.jsx(xPe,{sx:kC.cardContent,children:t}),SHe=({code:t,extension:e})=>{const n=To();return C.jsx(yg,{children:C.jsx(zU,{theme:n.palette.mode,height:"320px",extensions:[e],value:t,readOnly:!0})})},Ece=({code:t})=>C.jsx(SHe,{code:t,extension:dHe()}),CHe=({code:t})=>C.jsx(SHe,{code:t,extension:O1n()});function VK(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function M1n(t,e){const n=D1n(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 R1n(t,e,n){const r=e.name,i=e.colorBarMin,o=e.colorBarMax,s=e.colorBarName;let a="";n!==null&&(a=`sel(time="${aO(n)}", method="nearest")`);const l=[];if(jM(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`),a&&l.push(`${r} = ${r}.${a}`)}else a?l.push(`${r} = dataset.${r}.${a}`):l.push(`${r} = dataset.${r}`);return l.push(`${r}.plot.imshow(vmin=${i}, vmax=${o}, cmap="${s}")`),l.join(` -`)}function D1n(t){return I1n(t)[0]+".zarr"}function I1n(t){const e=t.lastIndexOf(".");return e>=0?[t.substring(0,e),t.substring(e)]:[t,""]}const L1n=t=>({locale:t.controlState.locale,visibleInfoCardElements:PSt(t),infoCardElementViewModes:MSt(t),selectedDataset:fo(t),selectedVariable:za(t),selectedPlaceInfo:ZM(t),selectedTime:YM(t),serverConfig:zi(t),allowViewModePython:!!Pn.instance.branding.allowViewModePython}),$1n={setVisibleInfoCardElements:gZt,updateInfoCardElementViewMode:mZt},F1n=Rn(L1n,$1n)(T1n),D7=5,N1n={container:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(D7),marginRight:t.spacing(D7),width:`calc(100% - ${t.spacing(3*(D7+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function z1n({dataTimeRange:t,selectedTimeRange:e,selectTimeRange:n}){const[r,i]=D.useState(e);D.useEffect(()=>{i(e)},[e]);const o=(u,f)=>{Array.isArray(f)&&i([f[0],f[1]])},s=(u,f)=>{n&&Array.isArray(f)&&n([f[0],f[1]])};function a(u){return aO(u)}const l=Array.isArray(t);l||(t=[Date.now()-2*ADe.years,Date.now()]);const c=[{value:t[0],label:dA(t[0])},{value:t[1],label:dA(t[1])}];return C.jsx(ot,{sx:N1n.container,children:C.jsx(t1,{disabled:!l,min:t[0],max:t[1],value:r,marks:c,onChange:o,onChangeCommitted:s,size:"small",valueLabelDisplay:"on",valueLabelFormat:a})})}var j1n=Array.isArray,Rl=j1n,B1n=typeof ri=="object"&&ri&&ri.Object===Object&&ri,OHe=B1n,U1n=OHe,W1n=typeof self=="object"&&self&&self.Object===Object&&self,V1n=U1n||W1n||Function("return this")(),op=V1n,G1n=op,H1n=G1n.Symbol,mD=H1n,m_e=mD,EHe=Object.prototype,q1n=EHe.hasOwnProperty,X1n=EHe.toString,P2=m_e?m_e.toStringTag:void 0;function Y1n(t){var e=q1n.call(t,P2),n=t[P2];try{t[P2]=void 0;var r=!0}catch{}var i=X1n.call(t);return r&&(e?t[P2]=n:delete t[P2]),i}var Q1n=Y1n,K1n=Object.prototype,Z1n=K1n.toString;function J1n(t){return Z1n.call(t)}var ewn=J1n,v_e=mD,twn=Q1n,nwn=ewn,rwn="[object Null]",iwn="[object Undefined]",y_e=v_e?v_e.toStringTag:void 0;function own(t){return t==null?t===void 0?iwn:rwn:y_e&&y_e in Object(t)?twn(t):nwn(t)}var im=own;function swn(t){return t!=null&&typeof t=="object"}var om=swn,awn=im,lwn=om,cwn="[object Symbol]";function uwn(t){return typeof t=="symbol"||lwn(t)&&awn(t)==cwn}var nE=uwn,fwn=Rl,dwn=nE,hwn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pwn=/^\w*$/;function gwn(t,e){if(fwn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||dwn(t)?!0:pwn.test(t)||!hwn.test(t)||e!=null&&t in Object(e)}var Tce=gwn;function mwn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var a0=mwn;const rE=sn(a0);var vwn=im,ywn=a0,xwn="[object AsyncFunction]",bwn="[object Function]",wwn="[object GeneratorFunction]",_wn="[object Proxy]";function Swn(t){if(!ywn(t))return!1;var e=vwn(t);return e==bwn||e==wwn||e==xwn||e==_wn}var kce=Swn;const mn=sn(kce);var Cwn=op,Own=Cwn["__core-js_shared__"],Ewn=Own,I7=Ewn,x_e=function(){var t=/[^.]+$/.exec(I7&&I7.keys&&I7.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Twn(t){return!!x_e&&x_e in t}var kwn=Twn,Awn=Function.prototype,Pwn=Awn.toString;function Mwn(t){if(t!=null){try{return Pwn.call(t)}catch{}try{return t+""}catch{}}return""}var THe=Mwn,Rwn=kce,Dwn=kwn,Iwn=a0,Lwn=THe,$wn=/[\\^$.*+?()[\]{}|]/g,Fwn=/^\[object .+?Constructor\]$/,Nwn=Function.prototype,zwn=Object.prototype,jwn=Nwn.toString,Bwn=zwn.hasOwnProperty,Uwn=RegExp("^"+jwn.call(Bwn).replace($wn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wwn(t){if(!Iwn(t)||Dwn(t))return!1;var e=Rwn(t)?Uwn:Fwn;return e.test(Lwn(t))}var Vwn=Wwn;function Gwn(t,e){return t==null?void 0:t[e]}var Hwn=Gwn,qwn=Vwn,Xwn=Hwn;function Ywn(t,e){var n=Xwn(t,e);return qwn(n)?n:void 0}var M1=Ywn,Qwn=M1,Kwn=Qwn(Object,"create"),UU=Kwn,b_e=UU;function Zwn(){this.__data__=b_e?b_e(null):{},this.size=0}var Jwn=Zwn;function e_n(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var t_n=e_n,n_n=UU,r_n="__lodash_hash_undefined__",i_n=Object.prototype,o_n=i_n.hasOwnProperty;function s_n(t){var e=this.__data__;if(n_n){var n=e[t];return n===r_n?void 0:n}return o_n.call(e,t)?e[t]:void 0}var a_n=s_n,l_n=UU,c_n=Object.prototype,u_n=c_n.hasOwnProperty;function f_n(t){var e=this.__data__;return l_n?e[t]!==void 0:u_n.call(e,t)}var d_n=f_n,h_n=UU,p_n="__lodash_hash_undefined__";function g_n(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=h_n&&e===void 0?p_n:e,this}var m_n=g_n,v_n=Jwn,y_n=t_n,x_n=a_n,b_n=d_n,w_n=m_n;function iE(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var N_n=F_n,z_n=WU;function j_n(t,e){var n=this.__data__,r=z_n(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var B_n=j_n,U_n=C_n,W_n=R_n,V_n=L_n,G_n=N_n,H_n=B_n;function oE(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},_x=function(e){return vD(e)&&e.indexOf("%")===e.length-1},at=function(e){return fCn(e)&&!aE(e)},So=function(e){return at(e)||vD(e)},gCn=0,lE=function(e){var n=++gCn;return"".concat(e||"").concat(n)},Bb=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(!at(e)&&!vD(e))return r;var o;if(_x(e)){var s=e.indexOf("%");o=n*parseFloat(e.slice(0,s))/100}else o=+e;return aE(o)&&(o=r),i&&o>n&&(o=n),o},sv=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},mCn=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 _Cn(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 HK(t){"@babel/helpers - typeof";return HK=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},HK(t)}var T_e={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},xg=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},k_e=null,$7=null,$ce=function t(e){if(e===k_e&&Array.isArray($7))return $7;var n=[];return D.Children.forEach(e,function(r){wn(r)||(OF.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),$7=n,k_e=e,n};function vu(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return xg(i)}):r=[xg(e)],$ce(t).forEach(function(i){var o=mu(i,"type.displayName")||mu(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function Ql(t,e){var n=vu(t,e);return n&&n[0]}var A_e=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!at(r)||r<=0||!at(i)||i<=0)},SCn=["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"],CCn=function(e){return e&&e.type&&vD(e.type)&&SCn.indexOf(e.type)>=0},LHe=function(e){return e&&HK(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},OCn=function(e,n,r,i){var o,s=(o=L7==null?void 0:L7[i])!==null&&o!==void 0?o:[];return!mn(e)&&(i&&s.includes(n)||yCn.includes(n))||r&&Lce.includes(n)},pn=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(D.isValidElement(e)&&(i=e.props),!rE(i))return null;var o={};return Object.keys(i).forEach(function(s){var a;OCn((a=i)===null||a===void 0?void 0:a[s],s,n,r)&&(o[s]=i[s])}),o},qK=function t(e,n){if(e===n)return!0;var r=D.Children.count(e);if(r!==D.Children.count(n))return!1;if(r===0)return!0;if(r===1)return P_e(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 PCn(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 YK(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,s=t.style,a=t.title,l=t.desc,c=ACn(t,kCn),u=i||{width:n,height:r,x:0,y:0},f=Oe("recharts-surface",o);return he.createElement("svg",XK({},pn(c,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),he.createElement("title",null,a),he.createElement("desc",null,l),e)}var MCn=["children","className"];function QK(){return QK=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 DCn(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 Vr=he.forwardRef(function(t,e){var n=t.children,r=t.className,i=RCn(t,MCn),o=Oe("recharts-layer",r);return he.createElement("g",QK({className:o},pn(i,!0),{ref:e}),n)}),bg=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:$Cn(t,e,n)}var NCn=FCn,zCn="\\ud800-\\udfff",jCn="\\u0300-\\u036f",BCn="\\ufe20-\\ufe2f",UCn="\\u20d0-\\u20ff",WCn=jCn+BCn+UCn,VCn="\\ufe0e\\ufe0f",GCn="\\u200d",HCn=RegExp("["+GCn+zCn+WCn+VCn+"]");function qCn(t){return HCn.test(t)}var $He=qCn;function XCn(t){return t.split("")}var YCn=XCn,FHe="\\ud800-\\udfff",QCn="\\u0300-\\u036f",KCn="\\ufe20-\\ufe2f",ZCn="\\u20d0-\\u20ff",JCn=QCn+KCn+ZCn,eOn="\\ufe0e\\ufe0f",tOn="["+FHe+"]",KK="["+JCn+"]",ZK="\\ud83c[\\udffb-\\udfff]",nOn="(?:"+KK+"|"+ZK+")",NHe="[^"+FHe+"]",zHe="(?:\\ud83c[\\udde6-\\uddff]){2}",jHe="[\\ud800-\\udbff][\\udc00-\\udfff]",rOn="\\u200d",BHe=nOn+"?",UHe="["+eOn+"]?",iOn="(?:"+rOn+"(?:"+[NHe,zHe,jHe].join("|")+")"+UHe+BHe+")*",oOn=UHe+BHe+iOn,sOn="(?:"+[NHe+KK+"?",KK,zHe,jHe,tOn].join("|")+")",aOn=RegExp(ZK+"(?="+ZK+")|"+sOn+oOn,"g");function lOn(t){return t.match(aOn)||[]}var cOn=lOn,uOn=YCn,fOn=$He,dOn=cOn;function hOn(t){return fOn(t)?dOn(t):uOn(t)}var pOn=hOn,gOn=NCn,mOn=$He,vOn=pOn,yOn=MHe;function xOn(t){return function(e){e=yOn(e);var n=mOn(e)?vOn(e):void 0,r=n?n[0]:e.charAt(0),i=n?gOn(n,1).join(""):e.slice(1);return r[t]()+i}}var bOn=xOn,wOn=bOn,_On=wOn("toUpperCase"),SOn=_On;const qU=sn(SOn);function TP(t){"@babel/helpers - typeof";return TP=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},TP(t)}var COn=["type","size","sizeType"];function JK(){return JK=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 AOn(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 WHe={symbolCircle:zre,symbolCross:$kt,symbolDiamond:Nkt,symbolSquare:zkt,symbolStar:Wkt,symbolTriangle:Vkt,symbolWye:Hkt},POn=Math.PI/180,MOn=function(e){var n="symbol".concat(qU(e));return WHe[n]||zre},ROn=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*POn;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}},DOn=function(e,n){WHe["symbol".concat(qU(e))]=n},Fce=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,s=e.sizeType,a=s===void 0?"area":s,l=kOn(e,COn),c=D_e(D_e({},l),{},{type:r,size:o,sizeType:a}),u=function(){var m=MOn(r),v=p3e().type(m).size(ROn(o,a,r));return v()},f=c.className,d=c.cx,h=c.cy,p=pn(c,!0);return d===+d&&h===+h&&o===+o?he.createElement("path",JK({},p,{className:Oe("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};Fce.registerSymbol=DOn;function AC(t){"@babel/helpers - typeof";return AC=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},AC(t)}function eZ(){return eZ=Object.assign?Object.assign.bind():function(t){for(var e=1;en?null:n+t.unit}const R7=gP.define({name:"python",parser:x1n.configure({props:[sce.add({Body:t=>{var e;return(e=g_e(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":y7({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":y7({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":y7({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=g_e(t,e);if(n!=null)return n}}return t.continue()}}),lce.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":q7e,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 O1n(){return new V7e(R7,[R7.data.of({autocomplete:w1n}),R7.data.of({autocomplete:C1n})])}const E1n=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,kC={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"}},T1n=({visibleInfoCardElements:t,setVisibleInfoCardElements:e,infoCardElementViewModes:n,updateInfoCardElementViewMode:r,selectedDataset:i,selectedVariable:o,selectedPlaceInfo:s,selectedTime:a,serverConfig:l,allowViewModePython:c})=>{const u=(p,g)=>{e(g)};let f,d,h;if(i){const p="dataset",g=n[p],m=y=>r(p,y),v=t.includes(p);f=C.jsx(k1n,{isIn:v,viewMode:g,setViewMode:m,dataset:i,serverConfig:l,hasPython:c})}if(i&&o){const p="variable",g=n[p],m=y=>r(p,y),v=t.includes(p);d=C.jsx(A1n,{isIn:v,viewMode:g,setViewMode:m,variable:o,time:a,serverConfig:l,hasPython:c})}if(s){const p="place",g=n[p],m=y=>r(p,y),v=t.includes(p);h=C.jsx(P1n,{isIn:v,viewMode:g,setViewMode:m,placeInfo:s})}return C.jsxs(vPe,{sx:kC.card,children:[C.jsx(yPe,{disableSpacing:!0,children:C.jsxs(tO,{size:"small",value:t,onChange:u,children:[C.jsx(xr,{value:"dataset",disabled:i===null,size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Dataset information"),children:C.jsx(Lhn,{})})},0),C.jsx(xr,{value:"variable",disabled:o===null,size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Variable information"),children:C.jsx(s9e,{})})},1),C.jsx(xr,{value:"place",disabled:s===null,size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Place information"),children:C.jsx(Dhn,{})})},2)]},0)}),f,d,h]})},k1n=({isIn:t,viewMode:e,setViewMode:n,dataset:r,serverConfig:i,hasPython:o})=>{let s;if(e==="code"){const a=r.dimensions.map(c=>VK(c,["name","size","dtype"])),l=VK(r,["id","title","bbox","attrs"]);l.dimensions=a,s=C.jsx(Ece,{code:JSON.stringify(l,null,2)})}else if(e==="list")s=C.jsx(yg,{children:C.jsx(OP,{data:Object.getOwnPropertyNames(r.attrs||{}).map(a=>[a,r.attrs[a]])})});else if(e==="text"){const a=[[pe.get("Dimension names"),r.dimensions.map(l=>l.name).join(", ")],[pe.get("Dimension data types"),r.dimensions.map(l=>l.dtype).join(", ")],[pe.get("Dimension lengths"),r.dimensions.map(l=>l.size).join(", ")],[pe.get("Geographical extent")+" (x1, y1, x2, y2)",r.bbox.map(l=>l+"").join(", ")],[pe.get("Spatial reference system"),r.spatialRef]];s=C.jsx(yg,{children:C.jsx(OP,{data:a})})}else e==="python"&&(s=C.jsx(CHe,{code:M1n(i,r)}));return C.jsx(Oce,{title:r.title||"?",subheader:r.title&&`ID: ${r.id}`,isIn:t,viewMode:e,setViewMode:n,hasPython:o,children:s})},A1n=({isIn:t,viewMode:e,setViewMode:n,variable:r,time:i,serverConfig:o,hasPython:s})=>{let a,l;if(e==="code"){const c=VK(r,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);a=C.jsx(Ece,{code:JSON.stringify(c,null,2)})}else if(e==="list"){if(a=C.jsx(yg,{children:C.jsx(OP,{data:Object.getOwnPropertyNames(r.attrs||{}).map(c=>[c,r.attrs[c]])})}),r.htmlRepr){const c=u=>{u&&r.htmlRepr&&(u.innerHTML=r.htmlRepr)};l=C.jsx(yg,{children:C.jsx(kl,{ref:c,sx:kC.variableHtmlReprContainer})})}}else if(e==="text"){let c=[[pe.get("Name"),r.name],[pe.get("Title"),r.title],[pe.get("Units"),r.units]];jM(r)?c.push([pe.get("Expression"),r.expression]):c=[...c,[pe.get("Data type"),r.dtype],[pe.get("Dimension names"),r.dims.join(", ")],[pe.get("Dimension lengths"),r.shape.map(u=>u+"").join(", ")],[pe.get("Time chunk size"),r.timeChunkSize]],a=C.jsx(yg,{children:C.jsx(OP,{data:c})})}else e==="python"&&(a=C.jsx(CHe,{code:R1n(o,r,i)}));return C.jsxs(Oce,{title:r.title||r.name,subheader:`${pe.get("Name")}: ${r.name}`,isIn:t,viewMode:e,setViewMode:n,hasPython:s,children:[l,a]})},P1n=({isIn:t,viewMode:e,setViewMode:n,placeInfo:r})=>{const i=r.place;let o,s,a;if(e==="code")o=C.jsx(Ece,{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=C.jsx(yg,{children:C.jsx(OP,{data:l})})}else o=C.jsx(yg,{children:C.jsx(Jt,{children:pe.get("There is no information available for this location.")})});else r.image&&r.image.startsWith("http")&&(s=C.jsx(Lst,{sx:kC.media,image:r.image,title:r.label})),r.description&&(a=C.jsx(yg,{children:C.jsx(Jt,{children:r.description})}));return C.jsxs(Oce,{title:r.label,subheader:`${pe.get("Geometry type")}: ${pe.get(i.geometry.type)}`,isIn:t,viewMode:e,setViewMode:n,children:[s,a,o]})},Oce=({isIn:t,title:e,subheader:n,viewMode:r,setViewMode:i,hasPython:o,children:s})=>{const a=(l,c)=>{i(c)};return C.jsxs(MF,{in:t,timeout:"auto",unmountOnExit:!0,children:[C.jsx(Ast,{title:e,subheader:n,titleTypographyProps:{fontSize:"1.1em"},action:C.jsxs(tO,{size:"small",value:r,exclusive:!0,onChange:a,children:[C.jsx(xr,{value:"text",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Textual format"),children:C.jsx(Ihn,{})})},0),C.jsx(xr,{value:"list",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("Tabular format"),children:C.jsx(Rhn,{})})},1),C.jsx(xr,{value:"code",size:"small",sx:il.toggleButton,children:C.jsx(Mt,{arrow:!0,title:pe.get("JSON format"),children:C.jsx(Mhn,{})})},2),o&&C.jsx(xr,{value:"python",size:"small",sx:{...il.toggleButton,width:"30px"},children:C.jsx("img",{src:E1n,width:16,alt:"python logo"})},3)]},0)}),s]})},OP=({data:t})=>C.jsx(NPe,{component:kl,sx:kC.keyValueTableContainer,children:C.jsx(Jee,{sx:kC.table,size:"small",children:C.jsx(ete,{children:t.map((e,n)=>{const[r,i]=e;let o=i;return typeof i=="string"&&(i.startsWith("http://")||i.startsWith("https://"))?o=C.jsx(lct,{href:i,target:"_blank",rel:"noreferrer",children:i}):Array.isArray(i)&&(o="["+i.map(s=>s+"").join(", ")+"]"),C.jsxs(Ad,{children:[C.jsx(ui,{children:r}),C.jsx(ui,{align:"right",children:o})]},n)})})})}),yg=({children:t})=>C.jsx(xPe,{sx:kC.cardContent,children:t}),SHe=({code:t,extension:e})=>{const n=To();return C.jsx(yg,{children:C.jsx(zU,{theme:n.palette.mode,height:"320px",extensions:[e],value:t,readOnly:!0})})},Ece=({code:t})=>C.jsx(SHe,{code:t,extension:dHe()}),CHe=({code:t})=>C.jsx(SHe,{code:t,extension:O1n()});function VK(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function M1n(t,e){const n=D1n(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 R1n(t,e,n){const r=e.name,i=e.colorBarMin,o=e.colorBarMax,s=e.colorBarName;let a="";n!==null&&(a=`sel(time="${sO(n)}", method="nearest")`);const l=[];if(jM(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`),a&&l.push(`${r} = ${r}.${a}`)}else a?l.push(`${r} = dataset.${r}.${a}`):l.push(`${r} = dataset.${r}`);return l.push(`${r}.plot.imshow(vmin=${i}, vmax=${o}, cmap="${s}")`),l.join(` +`)}function D1n(t){return I1n(t)[0]+".zarr"}function I1n(t){const e=t.lastIndexOf(".");return e>=0?[t.substring(0,e),t.substring(e)]:[t,""]}const L1n=t=>({locale:t.controlState.locale,visibleInfoCardElements:PSt(t),infoCardElementViewModes:MSt(t),selectedDataset:fo(t),selectedVariable:za(t),selectedPlaceInfo:ZM(t),selectedTime:YM(t),serverConfig:zi(t),allowViewModePython:!!Pn.instance.branding.allowViewModePython}),$1n={setVisibleInfoCardElements:gZt,updateInfoCardElementViewMode:mZt},F1n=Rn(L1n,$1n)(T1n),D7=5,N1n={container:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(D7),marginRight:t.spacing(D7),width:`calc(100% - ${t.spacing(3*(D7+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function z1n({dataTimeRange:t,selectedTimeRange:e,selectTimeRange:n}){const[r,i]=D.useState(e);D.useEffect(()=>{i(e)},[e]);const o=(u,f)=>{Array.isArray(f)&&i([f[0],f[1]])},s=(u,f)=>{n&&Array.isArray(f)&&n([f[0],f[1]])};function a(u){return sO(u)}const l=Array.isArray(t);l||(t=[Date.now()-2*ADe.years,Date.now()]);const c=[{value:t[0],label:fA(t[0])},{value:t[1],label:fA(t[1])}];return C.jsx(ot,{sx:N1n.container,children:C.jsx(t1,{disabled:!l,min:t[0],max:t[1],value:r,marks:c,onChange:o,onChangeCommitted:s,size:"small",valueLabelDisplay:"on",valueLabelFormat:a})})}var j1n=Array.isArray,Rl=j1n,B1n=typeof ri=="object"&&ri&&ri.Object===Object&&ri,OHe=B1n,U1n=OHe,W1n=typeof self=="object"&&self&&self.Object===Object&&self,V1n=U1n||W1n||Function("return this")(),op=V1n,G1n=op,H1n=G1n.Symbol,mD=H1n,m_e=mD,EHe=Object.prototype,q1n=EHe.hasOwnProperty,X1n=EHe.toString,A2=m_e?m_e.toStringTag:void 0;function Y1n(t){var e=q1n.call(t,A2),n=t[A2];try{t[A2]=void 0;var r=!0}catch{}var i=X1n.call(t);return r&&(e?t[A2]=n:delete t[A2]),i}var Q1n=Y1n,K1n=Object.prototype,Z1n=K1n.toString;function J1n(t){return Z1n.call(t)}var ewn=J1n,v_e=mD,twn=Q1n,nwn=ewn,rwn="[object Null]",iwn="[object Undefined]",y_e=v_e?v_e.toStringTag:void 0;function own(t){return t==null?t===void 0?iwn:rwn:y_e&&y_e in Object(t)?twn(t):nwn(t)}var im=own;function swn(t){return t!=null&&typeof t=="object"}var om=swn,awn=im,lwn=om,cwn="[object Symbol]";function uwn(t){return typeof t=="symbol"||lwn(t)&&awn(t)==cwn}var tE=uwn,fwn=Rl,dwn=tE,hwn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pwn=/^\w*$/;function gwn(t,e){if(fwn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||dwn(t)?!0:pwn.test(t)||!hwn.test(t)||e!=null&&t in Object(e)}var Tce=gwn;function mwn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var a0=mwn;const nE=sn(a0);var vwn=im,ywn=a0,xwn="[object AsyncFunction]",bwn="[object Function]",wwn="[object GeneratorFunction]",_wn="[object Proxy]";function Swn(t){if(!ywn(t))return!1;var e=vwn(t);return e==bwn||e==wwn||e==xwn||e==_wn}var kce=Swn;const mn=sn(kce);var Cwn=op,Own=Cwn["__core-js_shared__"],Ewn=Own,I7=Ewn,x_e=function(){var t=/[^.]+$/.exec(I7&&I7.keys&&I7.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Twn(t){return!!x_e&&x_e in t}var kwn=Twn,Awn=Function.prototype,Pwn=Awn.toString;function Mwn(t){if(t!=null){try{return Pwn.call(t)}catch{}try{return t+""}catch{}}return""}var THe=Mwn,Rwn=kce,Dwn=kwn,Iwn=a0,Lwn=THe,$wn=/[\\^$.*+?()[\]{}|]/g,Fwn=/^\[object .+?Constructor\]$/,Nwn=Function.prototype,zwn=Object.prototype,jwn=Nwn.toString,Bwn=zwn.hasOwnProperty,Uwn=RegExp("^"+jwn.call(Bwn).replace($wn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wwn(t){if(!Iwn(t)||Dwn(t))return!1;var e=Rwn(t)?Uwn:Fwn;return e.test(Lwn(t))}var Vwn=Wwn;function Gwn(t,e){return t==null?void 0:t[e]}var Hwn=Gwn,qwn=Vwn,Xwn=Hwn;function Ywn(t,e){var n=Xwn(t,e);return qwn(n)?n:void 0}var M1=Ywn,Qwn=M1,Kwn=Qwn(Object,"create"),UU=Kwn,b_e=UU;function Zwn(){this.__data__=b_e?b_e(null):{},this.size=0}var Jwn=Zwn;function e_n(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var t_n=e_n,n_n=UU,r_n="__lodash_hash_undefined__",i_n=Object.prototype,o_n=i_n.hasOwnProperty;function s_n(t){var e=this.__data__;if(n_n){var n=e[t];return n===r_n?void 0:n}return o_n.call(e,t)?e[t]:void 0}var a_n=s_n,l_n=UU,c_n=Object.prototype,u_n=c_n.hasOwnProperty;function f_n(t){var e=this.__data__;return l_n?e[t]!==void 0:u_n.call(e,t)}var d_n=f_n,h_n=UU,p_n="__lodash_hash_undefined__";function g_n(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=h_n&&e===void 0?p_n:e,this}var m_n=g_n,v_n=Jwn,y_n=t_n,x_n=a_n,b_n=d_n,w_n=m_n;function rE(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var N_n=F_n,z_n=WU;function j_n(t,e){var n=this.__data__,r=z_n(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var B_n=j_n,U_n=C_n,W_n=R_n,V_n=L_n,G_n=N_n,H_n=B_n;function iE(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},_x=function(e){return vD(e)&&e.indexOf("%")===e.length-1},at=function(e){return fCn(e)&&!sE(e)},So=function(e){return at(e)||vD(e)},gCn=0,aE=function(e){var n=++gCn;return"".concat(e||"").concat(n)},Bb=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(!at(e)&&!vD(e))return r;var o;if(_x(e)){var s=e.indexOf("%");o=n*parseFloat(e.slice(0,s))/100}else o=+e;return sE(o)&&(o=r),i&&o>n&&(o=n),o},sv=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},mCn=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 _Cn(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 HK(t){"@babel/helpers - typeof";return HK=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},HK(t)}var T_e={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},xg=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},k_e=null,$7=null,$ce=function t(e){if(e===k_e&&Array.isArray($7))return $7;var n=[];return D.Children.forEach(e,function(r){wn(r)||(OF.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),$7=n,k_e=e,n};function vu(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return xg(i)}):r=[xg(e)],$ce(t).forEach(function(i){var o=mu(i,"type.displayName")||mu(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function Ql(t,e){var n=vu(t,e);return n&&n[0]}var A_e=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!at(r)||r<=0||!at(i)||i<=0)},SCn=["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"],CCn=function(e){return e&&e.type&&vD(e.type)&&SCn.indexOf(e.type)>=0},LHe=function(e){return e&&HK(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},OCn=function(e,n,r,i){var o,s=(o=L7==null?void 0:L7[i])!==null&&o!==void 0?o:[];return!mn(e)&&(i&&s.includes(n)||yCn.includes(n))||r&&Lce.includes(n)},pn=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(D.isValidElement(e)&&(i=e.props),!nE(i))return null;var o={};return Object.keys(i).forEach(function(s){var a;OCn((a=i)===null||a===void 0?void 0:a[s],s,n,r)&&(o[s]=i[s])}),o},qK=function t(e,n){if(e===n)return!0;var r=D.Children.count(e);if(r!==D.Children.count(n))return!1;if(r===0)return!0;if(r===1)return P_e(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 PCn(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 YK(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,s=t.style,a=t.title,l=t.desc,c=ACn(t,kCn),u=i||{width:n,height:r,x:0,y:0},f=Oe("recharts-surface",o);return he.createElement("svg",XK({},pn(c,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),he.createElement("title",null,a),he.createElement("desc",null,l),e)}var MCn=["children","className"];function QK(){return QK=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 DCn(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 Vr=he.forwardRef(function(t,e){var n=t.children,r=t.className,i=RCn(t,MCn),o=Oe("recharts-layer",r);return he.createElement("g",QK({className:o},pn(i,!0),{ref:e}),n)}),bg=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:$Cn(t,e,n)}var NCn=FCn,zCn="\\ud800-\\udfff",jCn="\\u0300-\\u036f",BCn="\\ufe20-\\ufe2f",UCn="\\u20d0-\\u20ff",WCn=jCn+BCn+UCn,VCn="\\ufe0e\\ufe0f",GCn="\\u200d",HCn=RegExp("["+GCn+zCn+WCn+VCn+"]");function qCn(t){return HCn.test(t)}var $He=qCn;function XCn(t){return t.split("")}var YCn=XCn,FHe="\\ud800-\\udfff",QCn="\\u0300-\\u036f",KCn="\\ufe20-\\ufe2f",ZCn="\\u20d0-\\u20ff",JCn=QCn+KCn+ZCn,eOn="\\ufe0e\\ufe0f",tOn="["+FHe+"]",KK="["+JCn+"]",ZK="\\ud83c[\\udffb-\\udfff]",nOn="(?:"+KK+"|"+ZK+")",NHe="[^"+FHe+"]",zHe="(?:\\ud83c[\\udde6-\\uddff]){2}",jHe="[\\ud800-\\udbff][\\udc00-\\udfff]",rOn="\\u200d",BHe=nOn+"?",UHe="["+eOn+"]?",iOn="(?:"+rOn+"(?:"+[NHe,zHe,jHe].join("|")+")"+UHe+BHe+")*",oOn=UHe+BHe+iOn,sOn="(?:"+[NHe+KK+"?",KK,zHe,jHe,tOn].join("|")+")",aOn=RegExp(ZK+"(?="+ZK+")|"+sOn+oOn,"g");function lOn(t){return t.match(aOn)||[]}var cOn=lOn,uOn=YCn,fOn=$He,dOn=cOn;function hOn(t){return fOn(t)?dOn(t):uOn(t)}var pOn=hOn,gOn=NCn,mOn=$He,vOn=pOn,yOn=MHe;function xOn(t){return function(e){e=yOn(e);var n=mOn(e)?vOn(e):void 0,r=n?n[0]:e.charAt(0),i=n?gOn(n,1).join(""):e.slice(1);return r[t]()+i}}var bOn=xOn,wOn=bOn,_On=wOn("toUpperCase"),SOn=_On;const qU=sn(SOn);function EP(t){"@babel/helpers - typeof";return EP=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},EP(t)}var COn=["type","size","sizeType"];function JK(){return JK=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 AOn(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 WHe={symbolCircle:zre,symbolCross:$kt,symbolDiamond:Nkt,symbolSquare:zkt,symbolStar:Wkt,symbolTriangle:Vkt,symbolWye:Hkt},POn=Math.PI/180,MOn=function(e){var n="symbol".concat(qU(e));return WHe[n]||zre},ROn=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*POn;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}},DOn=function(e,n){WHe["symbol".concat(qU(e))]=n},Fce=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,s=e.sizeType,a=s===void 0?"area":s,l=kOn(e,COn),c=D_e(D_e({},l),{},{type:r,size:o,sizeType:a}),u=function(){var m=MOn(r),v=p3e().type(m).size(ROn(o,a,r));return v()},f=c.className,d=c.cx,h=c.cy,p=pn(c,!0);return d===+d&&h===+h&&o===+o?he.createElement("path",JK({},p,{className:Oe("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};Fce.registerSymbol=DOn;function AC(t){"@babel/helpers - typeof";return AC=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},AC(t)}function eZ(){return eZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var y=h.inactive?c:h.color;return he.createElement("li",eZ({className:m,style:f,key:"legend-item-".concat(p)},Tz(r.props,h,p)),he.createElement(YK,{width:s,height:s,viewBox:u,style:d},r.renderIcon(h)),he.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},g?g(v,h,p):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var a={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return he.createElement("ul",{className:"recharts-default-legend",style:a},this.renderItems())}}]),e}(D.PureComponent);kP(Nce,"displayName","Legend");kP(Nce,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var WOn=VU;function VOn(){this.__data__=new WOn,this.size=0}var GOn=VOn;function HOn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var qOn=HOn;function XOn(t){return this.__data__.get(t)}var YOn=XOn;function QOn(t){return this.__data__.has(t)}var KOn=QOn,ZOn=VU,JOn=Pce,eEn=Mce,tEn=200;function nEn(t,e){var n=this.__data__;if(n instanceof ZOn){var r=n.__data__;if(!JOn||r.lengtha))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&CEn?new bEn:void 0;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=k2n}var Uce=A2n,P2n=im,M2n=Uce,R2n=om,D2n="[object Arguments]",I2n="[object Array]",L2n="[object Boolean]",$2n="[object Date]",F2n="[object Error]",N2n="[object Function]",z2n="[object Map]",j2n="[object Number]",B2n="[object Object]",U2n="[object RegExp]",W2n="[object Set]",V2n="[object String]",G2n="[object WeakMap]",H2n="[object ArrayBuffer]",q2n="[object DataView]",X2n="[object Float32Array]",Y2n="[object Float64Array]",Q2n="[object Int8Array]",K2n="[object Int16Array]",Z2n="[object Int32Array]",J2n="[object Uint8Array]",eTn="[object Uint8ClampedArray]",tTn="[object Uint16Array]",nTn="[object Uint32Array]",Qr={};Qr[X2n]=Qr[Y2n]=Qr[Q2n]=Qr[K2n]=Qr[Z2n]=Qr[J2n]=Qr[eTn]=Qr[tTn]=Qr[nTn]=!0;Qr[D2n]=Qr[I2n]=Qr[H2n]=Qr[L2n]=Qr[q2n]=Qr[$2n]=Qr[F2n]=Qr[N2n]=Qr[z2n]=Qr[j2n]=Qr[B2n]=Qr[U2n]=Qr[W2n]=Qr[V2n]=Qr[G2n]=!1;function rTn(t){return R2n(t)&&M2n(t.length)&&!!Qr[P2n(t)]}var iTn=rTn;function oTn(t){return function(e){return t(e)}}var eqe=oTn,Mz={exports:{}};Mz.exports;(function(t,e){var n=OHe,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a})(Mz,Mz.exports);var sTn=Mz.exports,aTn=iTn,lTn=eqe,j_e=sTn,B_e=j_e&&j_e.isTypedArray,cTn=B_e?lTn(B_e):aTn,tqe=cTn,uTn=h2n,fTn=jce,dTn=Rl,hTn=JHe,pTn=Bce,gTn=tqe,mTn=Object.prototype,vTn=mTn.hasOwnProperty;function yTn(t,e){var n=dTn(t),r=!n&&fTn(t),i=!n&&!r&&hTn(t),o=!n&&!r&&!i&&gTn(t),s=n||r||i||o,a=s?uTn(t.length,String):[],l=a.length;for(var c in t)(e||vTn.call(t,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||pTn(c,l)))&&a.push(c);return a}var xTn=yTn,bTn=Object.prototype;function wTn(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||bTn;return t===n}var _Tn=wTn;function STn(t,e){return function(n){return t(e(n))}}var nqe=STn,CTn=nqe,OTn=CTn(Object.keys,Object),ETn=OTn,TTn=_Tn,kTn=ETn,ATn=Object.prototype,PTn=ATn.hasOwnProperty;function MTn(t){if(!TTn(t))return kTn(t);var e=[];for(var n in Object(t))PTn.call(t,n)&&n!="constructor"&&e.push(n);return e}var RTn=MTn,DTn=kce,ITn=Uce;function LTn(t){return t!=null&&ITn(t.length)&&!DTn(t)}var yD=LTn,$Tn=xTn,FTn=RTn,NTn=yD;function zTn(t){return NTn(t)?$Tn(t):FTn(t)}var XU=zTn,jTn=t2n,BTn=f2n,UTn=XU;function WTn(t){return jTn(t,UTn,BTn)}var VTn=WTn,U_e=VTn,GTn=1,HTn=Object.prototype,qTn=HTn.hasOwnProperty;function XTn(t,e,n,r,i,o){var s=n>n,a=U_e(t),l=a.length,c=U_e(e),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in e:qTn.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var g=!0;o.set(t,e),o.set(e,t);for(var m=s;++f-1}var HAn=GAn;function qAn(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=lPn){var c=e?null:sPn(t);if(c)return aPn(c);s=!1,i=oPn,l=new nPn}else l=e?[]:a;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function SPn(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 CPn(t){return t.value}function OPn(t,e){if(he.isValidElement(t))return he.cloneElement(t,e);if(typeof t=="function")return he.createElement(t,e);e.ref;var n=_Pn(e,gPn);return he.createElement(Nce,n)}var iSe=1,MC=function(t){bPn(e,t);function e(){var n;mPn(this,e);for(var r=arguments.length,i=new Array(r),o=0;oiSe||Math.abs(i.height-this.lastBoundingBox.height)>iSe)&&(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?R0({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,a=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(s==="center"&&o==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=s==="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(a==="middle"){var p=this.getBBoxSnapshot();d={top:((u||0)-p.height)/2}}else d=a==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return R0(R0({},f),d)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,a=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=R0(R0({position:"absolute",width:s||"auto",height:a||"auto"},this.getDefaultPosition(l)),l);return he.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},OPn(o,R0(R0({},this.props),{},{payload:cqe(u,c,CPn)})))}}],[{key:"getWithHeight",value:function(r,i){var o=r.props.layout;return o==="vertical"&&at(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}]),e}(D.PureComponent);YU(MC,"displayName","Legend");YU(MC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var oSe=mD,EPn=jce,TPn=Rl,sSe=oSe?oSe.isConcatSpreadable:void 0;function kPn(t){return TPn(t)||EPn(t)||!!(sSe&&t&&t[sSe])}var APn=kPn,PPn=KHe,MPn=APn;function hqe(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=MPn),i||(i=[]);++o0&&n(a)?e>1?hqe(a,e-1,n,r,i):PPn(i,a):r||(i[i.length]=a)}return i}var pqe=hqe;function RPn(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(n(o[l],l,o)===!1)break}return e}}var DPn=RPn,IPn=DPn,LPn=IPn(),$Pn=LPn,FPn=$Pn,NPn=XU;function zPn(t,e){return t&&FPn(t,e,NPn)}var gqe=zPn,jPn=yD;function BPn(t,e){return function(n,r){if(n==null)return n;if(!jPn(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++oe||o&&s&&l&&!a&&!c||r&&s&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=a)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var tMn=eMn,j7=Dce,nMn=Ice,rMn=l0,iMn=mqe,oMn=QPn,sMn=eqe,aMn=tMn,lMn=fE,cMn=Rl;function uMn(t,e,n){e.length?e=j7(e,function(o){return cMn(o)?function(s){return nMn(s,o.length===1?o[0]:o)}:o}):e=[lMn];var r=-1;e=j7(e,sMn(rMn));var i=iMn(t,function(o,s,a){var l=j7(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return oMn(i,function(o,s){return aMn(o,s,n)})}var fMn=uMn;function dMn(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 hMn=dMn,pMn=hMn,lSe=Math.max;function gMn(t,e,n){return e=lSe(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=lSe(r.length-e,0),s=Array(o);++i0){if(++e>=OMn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var AMn=kMn,PMn=CMn,MMn=AMn,RMn=MMn(PMn),DMn=RMn,IMn=fE,LMn=mMn,$Mn=DMn;function FMn(t,e){return $Mn(LMn(t,e,IMn),t+"")}var NMn=FMn,zMn=Ace,jMn=yD,BMn=Bce,UMn=a0;function WMn(t,e,n){if(!UMn(n))return!1;var r=typeof e;return(r=="number"?jMn(n)&&BMn(e,n.length):r=="string"&&e in n)?zMn(n[e],t):!1}var QU=WMn,VMn=pqe,GMn=fMn,HMn=NMn,uSe=QU,qMn=HMn(function(t,e){if(t==null)return[];var n=e.length;return n>1&&uSe(t,e[0],e[1])?e=[]:n>2&&uSe(e[0],e[1],e[2])&&(e=[e[0]]),GMn(t,VMn(e,1),[])}),XMn=qMn;const Gce=sn(XMn);function AP(t){"@babel/helpers - typeof";return AP=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},AP(t)}function lZ(){return lZ=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(M2,"-left"),at(n)&&e&&at(e.x)&&n=e.y),"".concat(M2,"-top"),at(r)&&e&&at(e.y)&&rg?Math.max(u,l[r]):Math.max(f,l[r])}function cRn(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 uRn(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,s=t.tooltipBox,a=t.useTranslate3d,l=t.viewBox,c,u,f;return s.height>0&&s.width>0&&n?(u=hSe({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=hSe({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),c=cRn({translateX:u,translateY:f,useTranslate3d:a})):c=aRn,{cssProperties:c,cssClasses:lRn({translateX:u,translateY:f,coordinate:n})}}function RC(t){"@babel/helpers - typeof";return RC=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},RC(t)}function pSe(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 gSe(t){for(var e=1;emSe||Math.abs(r.height-this.state.lastBoundingBox.height)>mSe)&&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,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,p=i.position,g=i.reverseDirection,m=i.useTranslate3d,v=i.viewBox,y=i.wrapperStyle,x=uRn({allowEscapeViewBox:s,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:v}),b=x.cssClasses,w=x.cssProperties,_=gSe(gSe({transition:d&&o?"transform ".concat(a,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return he.createElement("div",{tabIndex:-1,className:b,style:_,ref:function(O){r.wrapperNode=O}},c)}}]),e}(D.PureComponent),xRn=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Sh={isSsr:xRn(),get:function(e){return Sh[e]},set:function(e,n){if(typeof e=="string")Sh[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){Sh[i]=e[i]})}}};function DC(t){"@babel/helpers - typeof";return DC=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},DC(t)}function vSe(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 ySe(t){for(var e=1;e0;return he.createElement(yRn,{allowEscapeViewBox:s,animationDuration:a,animationEasing:l,isAnimationActive:d,active:o,coordinate:u,hasPayload:_,offset:h,position:m,reverseDirection:v,useTranslate3d:y,viewBox:x,wrapperStyle:b},ARn(c,ySe(ySe({},this.props),{},{payload:w})))}}]),e}(D.PureComponent);Hce(Rd,"displayName","Tooltip");Hce(Rd,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Sh.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 PRn=op,MRn=function(){return PRn.Date.now()},RRn=MRn,DRn=/\s/;function IRn(t){for(var e=t.length;e--&&DRn.test(t.charAt(e)););return e}var LRn=IRn,$Rn=LRn,FRn=/^\s+/;function NRn(t){return t&&t.slice(0,$Rn(t)+1).replace(FRn,"")}var zRn=NRn,jRn=zRn,xSe=a0,BRn=nE,bSe=NaN,URn=/^[-+]0x[0-9a-f]+$/i,WRn=/^0b[01]+$/i,VRn=/^0o[0-7]+$/i,GRn=parseInt;function HRn(t){if(typeof t=="number")return t;if(BRn(t))return bSe;if(xSe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=xSe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=jRn(t);var n=WRn.test(t);return n||VRn.test(t)?GRn(t.slice(2),n?2:8):URn.test(t)?bSe:+t}var _qe=HRn,qRn=a0,U7=RRn,wSe=_qe,XRn="Expected a function",YRn=Math.max,QRn=Math.min;function KRn(t,e,n){var r,i,o,s,a,l,c=0,u=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(XRn);e=wSe(e)||0,qRn(n)&&(u=!!n.leading,f="maxWait"in n,o=f?YRn(wSe(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d);function h(_){var S=r,O=i;return r=i=void 0,c=_,s=t.apply(O,S),s}function p(_){return c=_,a=setTimeout(v,e),u?h(_):s}function g(_){var S=_-l,O=_-c,k=e-S;return f?QRn(k,o-O):k}function m(_){var S=_-l,O=_-c;return l===void 0||S>=e||S<0||f&&O>=o}function v(){var _=U7();if(m(_))return y(_);a=setTimeout(v,g(_))}function y(_){return a=void 0,d&&r?h(_):(r=i=void 0,s)}function x(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function b(){return a===void 0?s:y(U7())}function w(){var _=U7(),S=m(_);if(r=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(v,e),h(l)}return a===void 0&&(a=setTimeout(v,e)),s}return w.cancel=x,w.flush=b,w}var ZRn=KRn,JRn=ZRn,eDn=a0,tDn="Expected a function";function nDn(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(tDn);return eDn(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),JRn(t,e,{leading:r,maxWait:e,trailing:i})}var rDn=nDn;const Sqe=sn(rDn);function MP(t){"@babel/helpers - typeof";return MP=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},MP(t)}function _Se(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 QL(t){for(var e=1;e`);var y=h.inactive?c:h.color;return he.createElement("li",eZ({className:m,style:f,key:"legend-item-".concat(p)},Tz(r.props,h,p)),he.createElement(YK,{width:s,height:s,viewBox:u,style:d},r.renderIcon(h)),he.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},g?g(v,h,p):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var a={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return he.createElement("ul",{className:"recharts-default-legend",style:a},this.renderItems())}}]),e}(D.PureComponent);TP(Nce,"displayName","Legend");TP(Nce,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var WOn=VU;function VOn(){this.__data__=new WOn,this.size=0}var GOn=VOn;function HOn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var qOn=HOn;function XOn(t){return this.__data__.get(t)}var YOn=XOn;function QOn(t){return this.__data__.has(t)}var KOn=QOn,ZOn=VU,JOn=Pce,eEn=Mce,tEn=200;function nEn(t,e){var n=this.__data__;if(n instanceof ZOn){var r=n.__data__;if(!JOn||r.lengtha))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&CEn?new bEn:void 0;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=k2n}var Uce=A2n,P2n=im,M2n=Uce,R2n=om,D2n="[object Arguments]",I2n="[object Array]",L2n="[object Boolean]",$2n="[object Date]",F2n="[object Error]",N2n="[object Function]",z2n="[object Map]",j2n="[object Number]",B2n="[object Object]",U2n="[object RegExp]",W2n="[object Set]",V2n="[object String]",G2n="[object WeakMap]",H2n="[object ArrayBuffer]",q2n="[object DataView]",X2n="[object Float32Array]",Y2n="[object Float64Array]",Q2n="[object Int8Array]",K2n="[object Int16Array]",Z2n="[object Int32Array]",J2n="[object Uint8Array]",eTn="[object Uint8ClampedArray]",tTn="[object Uint16Array]",nTn="[object Uint32Array]",Qr={};Qr[X2n]=Qr[Y2n]=Qr[Q2n]=Qr[K2n]=Qr[Z2n]=Qr[J2n]=Qr[eTn]=Qr[tTn]=Qr[nTn]=!0;Qr[D2n]=Qr[I2n]=Qr[H2n]=Qr[L2n]=Qr[q2n]=Qr[$2n]=Qr[F2n]=Qr[N2n]=Qr[z2n]=Qr[j2n]=Qr[B2n]=Qr[U2n]=Qr[W2n]=Qr[V2n]=Qr[G2n]=!1;function rTn(t){return R2n(t)&&M2n(t.length)&&!!Qr[P2n(t)]}var iTn=rTn;function oTn(t){return function(e){return t(e)}}var eqe=oTn,Mz={exports:{}};Mz.exports;(function(t,e){var n=OHe,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a})(Mz,Mz.exports);var sTn=Mz.exports,aTn=iTn,lTn=eqe,j_e=sTn,B_e=j_e&&j_e.isTypedArray,cTn=B_e?lTn(B_e):aTn,tqe=cTn,uTn=h2n,fTn=jce,dTn=Rl,hTn=JHe,pTn=Bce,gTn=tqe,mTn=Object.prototype,vTn=mTn.hasOwnProperty;function yTn(t,e){var n=dTn(t),r=!n&&fTn(t),i=!n&&!r&&hTn(t),o=!n&&!r&&!i&&gTn(t),s=n||r||i||o,a=s?uTn(t.length,String):[],l=a.length;for(var c in t)(e||vTn.call(t,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||pTn(c,l)))&&a.push(c);return a}var xTn=yTn,bTn=Object.prototype;function wTn(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||bTn;return t===n}var _Tn=wTn;function STn(t,e){return function(n){return t(e(n))}}var nqe=STn,CTn=nqe,OTn=CTn(Object.keys,Object),ETn=OTn,TTn=_Tn,kTn=ETn,ATn=Object.prototype,PTn=ATn.hasOwnProperty;function MTn(t){if(!TTn(t))return kTn(t);var e=[];for(var n in Object(t))PTn.call(t,n)&&n!="constructor"&&e.push(n);return e}var RTn=MTn,DTn=kce,ITn=Uce;function LTn(t){return t!=null&&ITn(t.length)&&!DTn(t)}var yD=LTn,$Tn=xTn,FTn=RTn,NTn=yD;function zTn(t){return NTn(t)?$Tn(t):FTn(t)}var XU=zTn,jTn=t2n,BTn=f2n,UTn=XU;function WTn(t){return jTn(t,UTn,BTn)}var VTn=WTn,U_e=VTn,GTn=1,HTn=Object.prototype,qTn=HTn.hasOwnProperty;function XTn(t,e,n,r,i,o){var s=n>n,a=U_e(t),l=a.length,c=U_e(e),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in e:qTn.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var g=!0;o.set(t,e),o.set(e,t);for(var m=s;++f-1}var HAn=GAn;function qAn(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=lPn){var c=e?null:sPn(t);if(c)return aPn(c);s=!1,i=oPn,l=new nPn}else l=e?[]:a;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function SPn(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 CPn(t){return t.value}function OPn(t,e){if(he.isValidElement(t))return he.cloneElement(t,e);if(typeof t=="function")return he.createElement(t,e);e.ref;var n=_Pn(e,gPn);return he.createElement(Nce,n)}var iSe=1,MC=function(t){bPn(e,t);function e(){var n;mPn(this,e);for(var r=arguments.length,i=new Array(r),o=0;oiSe||Math.abs(i.height-this.lastBoundingBox.height)>iSe)&&(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?R0({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,a=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(s==="center"&&o==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=s==="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(a==="middle"){var p=this.getBBoxSnapshot();d={top:((u||0)-p.height)/2}}else d=a==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return R0(R0({},f),d)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,a=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=R0(R0({position:"absolute",width:s||"auto",height:a||"auto"},this.getDefaultPosition(l)),l);return he.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},OPn(o,R0(R0({},this.props),{},{payload:cqe(u,c,CPn)})))}}],[{key:"getWithHeight",value:function(r,i){var o=r.props.layout;return o==="vertical"&&at(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}]),e}(D.PureComponent);YU(MC,"displayName","Legend");YU(MC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var oSe=mD,EPn=jce,TPn=Rl,sSe=oSe?oSe.isConcatSpreadable:void 0;function kPn(t){return TPn(t)||EPn(t)||!!(sSe&&t&&t[sSe])}var APn=kPn,PPn=KHe,MPn=APn;function hqe(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=MPn),i||(i=[]);++o0&&n(a)?e>1?hqe(a,e-1,n,r,i):PPn(i,a):r||(i[i.length]=a)}return i}var pqe=hqe;function RPn(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(n(o[l],l,o)===!1)break}return e}}var DPn=RPn,IPn=DPn,LPn=IPn(),$Pn=LPn,FPn=$Pn,NPn=XU;function zPn(t,e){return t&&FPn(t,e,NPn)}var gqe=zPn,jPn=yD;function BPn(t,e){return function(n,r){if(n==null)return n;if(!jPn(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++oe||o&&s&&l&&!a&&!c||r&&s&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=a)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var tMn=eMn,j7=Dce,nMn=Ice,rMn=l0,iMn=mqe,oMn=QPn,sMn=eqe,aMn=tMn,lMn=uE,cMn=Rl;function uMn(t,e,n){e.length?e=j7(e,function(o){return cMn(o)?function(s){return nMn(s,o.length===1?o[0]:o)}:o}):e=[lMn];var r=-1;e=j7(e,sMn(rMn));var i=iMn(t,function(o,s,a){var l=j7(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return oMn(i,function(o,s){return aMn(o,s,n)})}var fMn=uMn;function dMn(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 hMn=dMn,pMn=hMn,lSe=Math.max;function gMn(t,e,n){return e=lSe(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=lSe(r.length-e,0),s=Array(o);++i0){if(++e>=OMn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var AMn=kMn,PMn=CMn,MMn=AMn,RMn=MMn(PMn),DMn=RMn,IMn=uE,LMn=mMn,$Mn=DMn;function FMn(t,e){return $Mn(LMn(t,e,IMn),t+"")}var NMn=FMn,zMn=Ace,jMn=yD,BMn=Bce,UMn=a0;function WMn(t,e,n){if(!UMn(n))return!1;var r=typeof e;return(r=="number"?jMn(n)&&BMn(e,n.length):r=="string"&&e in n)?zMn(n[e],t):!1}var QU=WMn,VMn=pqe,GMn=fMn,HMn=NMn,uSe=QU,qMn=HMn(function(t,e){if(t==null)return[];var n=e.length;return n>1&&uSe(t,e[0],e[1])?e=[]:n>2&&uSe(e[0],e[1],e[2])&&(e=[e[0]]),GMn(t,VMn(e,1),[])}),XMn=qMn;const Gce=sn(XMn);function kP(t){"@babel/helpers - typeof";return kP=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},kP(t)}function lZ(){return lZ=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(P2,"-left"),at(n)&&e&&at(e.x)&&n=e.y),"".concat(P2,"-top"),at(r)&&e&&at(e.y)&&rg?Math.max(u,l[r]):Math.max(f,l[r])}function cRn(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 uRn(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,s=t.tooltipBox,a=t.useTranslate3d,l=t.viewBox,c,u,f;return s.height>0&&s.width>0&&n?(u=hSe({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=hSe({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),c=cRn({translateX:u,translateY:f,useTranslate3d:a})):c=aRn,{cssProperties:c,cssClasses:lRn({translateX:u,translateY:f,coordinate:n})}}function RC(t){"@babel/helpers - typeof";return RC=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},RC(t)}function pSe(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 gSe(t){for(var e=1;emSe||Math.abs(r.height-this.state.lastBoundingBox.height)>mSe)&&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,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,p=i.position,g=i.reverseDirection,m=i.useTranslate3d,v=i.viewBox,y=i.wrapperStyle,x=uRn({allowEscapeViewBox:s,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:v}),b=x.cssClasses,w=x.cssProperties,_=gSe(gSe({transition:d&&o?"transform ".concat(a,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return he.createElement("div",{tabIndex:-1,className:b,style:_,ref:function(O){r.wrapperNode=O}},c)}}]),e}(D.PureComponent),xRn=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Sh={isSsr:xRn(),get:function(e){return Sh[e]},set:function(e,n){if(typeof e=="string")Sh[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){Sh[i]=e[i]})}}};function DC(t){"@babel/helpers - typeof";return DC=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},DC(t)}function vSe(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 ySe(t){for(var e=1;e0;return he.createElement(yRn,{allowEscapeViewBox:s,animationDuration:a,animationEasing:l,isAnimationActive:d,active:o,coordinate:u,hasPayload:_,offset:h,position:m,reverseDirection:v,useTranslate3d:y,viewBox:x,wrapperStyle:b},ARn(c,ySe(ySe({},this.props),{},{payload:w})))}}]),e}(D.PureComponent);Hce(Rd,"displayName","Tooltip");Hce(Rd,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Sh.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 PRn=op,MRn=function(){return PRn.Date.now()},RRn=MRn,DRn=/\s/;function IRn(t){for(var e=t.length;e--&&DRn.test(t.charAt(e)););return e}var LRn=IRn,$Rn=LRn,FRn=/^\s+/;function NRn(t){return t&&t.slice(0,$Rn(t)+1).replace(FRn,"")}var zRn=NRn,jRn=zRn,xSe=a0,BRn=tE,bSe=NaN,URn=/^[-+]0x[0-9a-f]+$/i,WRn=/^0b[01]+$/i,VRn=/^0o[0-7]+$/i,GRn=parseInt;function HRn(t){if(typeof t=="number")return t;if(BRn(t))return bSe;if(xSe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=xSe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=jRn(t);var n=WRn.test(t);return n||VRn.test(t)?GRn(t.slice(2),n?2:8):URn.test(t)?bSe:+t}var _qe=HRn,qRn=a0,U7=RRn,wSe=_qe,XRn="Expected a function",YRn=Math.max,QRn=Math.min;function KRn(t,e,n){var r,i,o,s,a,l,c=0,u=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(XRn);e=wSe(e)||0,qRn(n)&&(u=!!n.leading,f="maxWait"in n,o=f?YRn(wSe(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d);function h(_){var S=r,O=i;return r=i=void 0,c=_,s=t.apply(O,S),s}function p(_){return c=_,a=setTimeout(v,e),u?h(_):s}function g(_){var S=_-l,O=_-c,k=e-S;return f?QRn(k,o-O):k}function m(_){var S=_-l,O=_-c;return l===void 0||S>=e||S<0||f&&O>=o}function v(){var _=U7();if(m(_))return y(_);a=setTimeout(v,g(_))}function y(_){return a=void 0,d&&r?h(_):(r=i=void 0,s)}function x(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function b(){return a===void 0?s:y(U7())}function w(){var _=U7(),S=m(_);if(r=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(v,e),h(l)}return a===void 0&&(a=setTimeout(v,e)),s}return w.cancel=x,w.flush=b,w}var ZRn=KRn,JRn=ZRn,eDn=a0,tDn="Expected a function";function nDn(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(tDn);return eDn(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),JRn(t,e,{leading:r,maxWait:e,trailing:i})}var rDn=nDn;const Sqe=sn(rDn);function PP(t){"@babel/helpers - typeof";return PP=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},PP(t)}function _Se(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 QL(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(R=Sqe(R,g,{trailing:!0,leading:!1}));var T=new ResizeObserver(R),M=w.current.getBoundingClientRect(),I=M.width,z=M.height;return P(I,z),T.observe(w.current),function(){T.disconnect()}},[P,g]);var A=D.useMemo(function(){var R=k.containerWidth,T=k.containerHeight;if(R<0||T<0)return null;bg(_x(s)||_x(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,s,l),bg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var M=_x(s)?R:s,I=_x(l)?T:l;n&&n>0&&(M?I=M/n:I&&(M=I*n),d&&I>d&&(I=d)),bg(M>0||I>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.`,M,I,s,l,u,f,n);var z=!Array.isArray(h)&&OF.isElement(h)&&xg(h.type).endsWith("Chart");return he.Children.map(h,function(F){return OF.isElement(F)?D.cloneElement(F,QL({width:M,height:I},z?{style:QL({height:"100%",width:"100%",maxHeight:I,maxWidth:M},F.props.style)}:{})):F})},[n,h,l,d,f,u,k,s]);return he.createElement("div",{id:m?"".concat(m):void 0,className:Oe("recharts-responsive-container",v),style:QL(QL({},b),{},{width:s,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:w},A)}),Oqe=function(e){return null};Oqe.displayName="Cell";function RP(t){"@babel/helpers - typeof";return RP=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},RP(t)}function CSe(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 hZ(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Sh.isSsr)return{width:0,height:0};var r=vDn(n),i=JSON.stringify({text:e,copyStyle:r});if(pw.widthCache[i])return pw.widthCache[i];try{var o=document.getElementById(OSe);o||(o=document.createElement("span"),o.setAttribute("id",OSe),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=hZ(hZ({},mDn),r);Object.assign(o.style,s),o.textContent="".concat(e);var a=o.getBoundingClientRect(),l={width:a.width,height:a.height};return pw.widthCache[i]=l,++pw.cacheCount>gDn&&(pw.cacheCount=0,pw.widthCache={}),l}catch{return{width:0,height:0}}},yDn=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function DP(t){"@babel/helpers - typeof";return DP=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},DP(t)}function Lz(t,e){return _Dn(t)||wDn(t,e)||bDn(t,e)||xDn()}function xDn(){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 bDn(t,e){if(t){if(typeof t=="string")return ESe(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 ESe(t,e)}}function ESe(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 $Dn(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 RSe(t,e){return jDn(t)||zDn(t,e)||NDn(t,e)||FDn()}function FDn(){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 NDn(t,e){if(t){if(typeof t=="string")return DSe(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 DSe(t,e)}}function DSe(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 M.reduce(function(I,z){var F=z.word,N=z.width,L=I[I.length-1];if(L&&(i==null||o||L.width+N+rz.width?I:z})};if(!u)return h;for(var g="…",m=function(M){var I=f.slice(0,M),z=Aqe({breakAll:c,style:l,children:I+g}).wordsWithComputedWidth,F=d(z),N=F.length>s||p(F).width>Number(i);return[N,F]},v=0,y=f.length-1,x=0,b;v<=y&&x<=f.length-1;){var w=Math.floor((v+y)/2),_=w-1,S=m(_),O=RSe(S,2),k=O[0],E=O[1],P=m(w),A=RSe(P,1),R=A[0];if(!k&&!R&&(v=w+1),k&&R&&(y=w-1),!k&&R){b=E;break}x++}return b||h},ISe=function(e){var n=wn(e)?[]:e.toString().split(kqe);return[{words:n}]},UDn=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,s=e.breakAll,a=e.maxLines;if((n||r)&&!Sh.isSsr){var l,c,u=Aqe({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return ISe(i);return BDn({breakAll:s,children:i,maxLines:a,style:o},l,c,n,r)}return ISe(i)},LSe="#808080",$z=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,s=e.lineHeight,a=s===void 0?"1em":s,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,g=p===void 0?"end":p,m=e.fill,v=m===void 0?LSe:m,y=MSe(e,IDn),x=D.useMemo(function(){return UDn({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,w=y.dy,_=y.angle,S=y.className,O=y.breakAll,k=MSe(y,LDn);if(!So(r)||!So(o))return null;var E=r+(at(b)?b:0),P=o+(at(w)?w:0),A;switch(g){case"start":A=W7("calc(".concat(c,")"));break;case"middle":A=W7("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(c," / 2))"));break;default:A=W7("calc(".concat(x.length-1," * -").concat(a,")"));break}var R=[];if(f){var T=x[0].width,M=y.width;R.push("scale(".concat((at(M)?M/T:1)/T,")"))}return _&&R.push("rotate(".concat(_,", ").concat(E,", ").concat(P,")")),R.length&&(k.transform=R.join(" ")),he.createElement("text",pZ({},pn(k,!0),{x:E,y:P,className:Oe("recharts-text",S),textAnchor:h,fill:v.includes("url")?LSe:v}),x.map(function(I,z){var F=I.words.join(O?"":" ");return he.createElement("tspan",{x:E,dy:z===0?A:a,key:F},F)}))};const $Se=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:EA,scaleDiverging:cie,scaleDivergingLog:uie,scaleDivergingPow:kB,scaleDivergingSqrt:gFe,scaleDivergingSymlog:fie,scaleIdentity:Kre,scaleImplicit:EN,scaleLinear:PA,scaleLog:Jre,scaleOrdinal:aR,scalePoint:ik,scalePow:SB,scaleQuantile:rie,scaleQuantize:iie,scaleRadial:uFe,scaleSequential:OB,scaleSequentialLog:aie,scaleSequentialPow:EB,scaleSequentialQuantile:pFe,scaleSequentialSqrt:hFe,scaleSequentialSymlog:lie,scaleSqrt:cFe,scaleSymlog:tie,scaleThreshold:oie,scaleTime:fFe,scaleUtc:dFe,tickFormat:Qre},Symbol.toStringTag,{value:"Module"}));var WDn=nE;function VDn(t,e,n){for(var r=-1,i=t.length;++re}var HDn=GDn,qDn=Pqe,XDn=HDn,YDn=fE;function QDn(t){return t&&t.length?qDn(t,YDn,XDn):void 0}var KDn=QDn;const Cv=sn(KDn);function ZDn(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};Tt.decimalPlaces=Tt.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Zr;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Tt.dividedBy=Tt.div=function(t){return wg(this,new this.constructor(t))};Tt.dividedToIntegerBy=Tt.idiv=function(t){var e=this,n=e.constructor;return $r(wg(e,new n(t),0,1),n.precision)};Tt.equals=Tt.eq=function(t){return!this.cmp(t)};Tt.exponent=function(){return co(this)};Tt.greaterThan=Tt.gt=function(t){return this.cmp(t)>0};Tt.greaterThanOrEqualTo=Tt.gte=function(t){return this.cmp(t)>=0};Tt.isInteger=Tt.isint=function(){return this.e>this.d.length-2};Tt.isNegative=Tt.isneg=function(){return this.s<0};Tt.isPositive=Tt.ispos=function(){return this.s>0};Tt.isZero=function(){return this.s===0};Tt.lessThan=Tt.lt=function(t){return this.cmp(t)<0};Tt.lessThanOrEqualTo=Tt.lte=function(t){return this.cmp(t)<1};Tt.logarithm=Tt.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(rc))throw Error(Iu+"NaN");if(n.s<1)throw Error(Iu+(n.s?"NaN":"-Infinity"));return n.eq(rc)?new r(0):(vi=!1,e=wg(IP(n,o),IP(t,o),o),vi=!0,$r(e,i))};Tt.minus=Tt.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Iqe(e,t):Rqe(e,(t.s=-t.s,t))};Tt.modulo=Tt.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Iu+"NaN");return n.s?(vi=!1,e=wg(n,t,0,1).times(t),vi=!0,n.minus(e)):$r(new r(n),i)};Tt.naturalExponential=Tt.exp=function(){return Dqe(this)};Tt.naturalLogarithm=Tt.ln=function(){return IP(this)};Tt.negated=Tt.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Tt.plus=Tt.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Rqe(e,t):Iqe(e,(t.s=-t.s,t))};Tt.precision=Tt.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Qx+t);if(e=co(i)+1,r=i.d.length-1,n=r*Zr+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};Tt.squareRoot=Tt.sqrt=function(){var t,e,n,r,i,o,s,a=this,l=a.constructor;if(a.s<1){if(!a.s)return new l(0);throw Error(Iu+"NaN")}for(t=co(a),vi=!1,i=Math.sqrt(+a),i==0||i==1/0?(e=ih(a.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=hE((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=s=n+3;;)if(o=r,r=o.plus(wg(a,o,s+2)).times(.5),ih(o.d).slice(0,s)===(e=ih(r.d)).slice(0,s)){if(e=e.slice(s-3,s+1),i==s&&e=="4999"){if($r(o,n+1,0),o.times(o).eq(a)){r=o;break}}else if(e!="9999")break;s+=4}return vi=!0,$r(r,n)};Tt.times=Tt.mul=function(t){var e,n,r,i,o,s,a,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;)a=o[i]+h[r]*d[i-r-1]+e,o[i--]=a%Do|0,e=a/Do|0;o[i]=(o[i]+e)%Do|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,vi?$r(t,f.precision):t};Tt.toDecimalPlaces=Tt.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(Nh(t,0,dE),e===void 0?e=r.rounding:Nh(e,0,8),$r(n,t+co(n)+1,e))};Tt.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=Ub(r,!0):(Nh(t,0,dE),e===void 0?e=i.rounding:Nh(e,0,8),r=$r(new i(r),t+1,e),n=Ub(r,!0,t+1)),n};Tt.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?Ub(i):(Nh(t,0,dE),e===void 0?e=o.rounding:Nh(e,0,8),r=$r(new o(i),t+co(i)+1,e),n=Ub(r.abs(),!1,t+co(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Tt.toInteger=Tt.toint=function(){var t=this,e=t.constructor;return $r(new e(t),co(t)+1,e.rounding)};Tt.toNumber=function(){return+this};Tt.toPower=Tt.pow=function(t){var e,n,r,i,o,s,a=this,l=a.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(rc);if(a=new l(a),!a.s){if(t.s<1)throw Error(Iu+"Infinity");return a}if(a.eq(rc))return a;if(r=l.precision,t.eq(rc))return $r(a,r);if(e=t.e,n=t.d.length-1,s=e>=n,o=a.s,s){if((n=u<0?-u:u)<=Mqe){for(i=new l(rc),e=Math.ceil(r/Zr+4),vi=!1;n%2&&(i=i.times(a),NSe(i.d,e)),n=hE(n/2),n!==0;)a=a.times(a),NSe(a.d,e);return vi=!0,t.s<0?new l(rc).div(i):$r(i,r)}}else if(o<0)throw Error(Iu+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,a.s=1,vi=!1,i=t.times(IP(a,r+c)),vi=!0,i=Dqe(i),i.s=o,i};Tt.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=co(i),r=Ub(i,n<=o.toExpNeg||n>=o.toExpPos)):(Nh(t,1,dE),e===void 0?e=o.rounding:Nh(e,0,8),i=$r(new o(i),t,e),n=co(i),r=Ub(i,t<=n||n<=o.toExpNeg,t)),r};Tt.toSignificantDigits=Tt.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(Nh(t,1,dE),e===void 0?e=r.rounding:Nh(e,0,8)),$r(new r(n),t,e)};Tt.toString=Tt.valueOf=Tt.val=Tt.toJSON=Tt[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=co(t),n=t.constructor;return Ub(t,e<=n.toExpNeg||e>=n.toExpPos)};function Rqe(t,e){var n,r,i,o,s,a,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),vi?$r(e,f):e;if(l=t.d,c=e.d,s=t.e,i=e.e,l=l.slice(),o=s-i,o){for(o<0?(r=l,o=-o,a=c.length):(r=c,i=s,a=l.length),s=Math.ceil(f/Zr),a=s>a?s+1:a+1,o>a&&(o=a,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(a=l.length,o=c.length,a-o<0&&(o=a,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/Do|0,l[o]%=Do;for(n&&(l.unshift(n),++i),a=l.length;l[--a]==0;)l.pop();return e.d=l,e.e=i,vi?$r(e,f):e}function Nh(t,e,n){if(t!==~~t||tn)throw Error(Qx+t)}function ih(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;es?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]1;)r.shift()}return function(r,i,o,s){var a,l,c,u,f,d,h,p,g,m,v,y,x,b,w,_,S,O,k=r.constructor,E=r.s==i.s?1:-1,P=r.d,A=i.d;if(!r.s)return new k(r);if(!i.s)throw Error(Iu+"Division by zero");for(l=r.e-i.e,S=A.length,w=P.length,h=new k(E),p=h.d=[],c=0;A[c]==(P[c]||0);)++c;if(A[c]>(P[c]||0)&&--l,o==null?y=o=k.precision:s?y=o+(co(r)-co(i))+1:y=o,y<0)return new k(0);if(y=y/Zr+2|0,c=0,S==1)for(u=0,A=A[0],y++;(c1&&(A=t(A,u),P=t(P,u),S=A.length,w=P.length),b=S,g=P.slice(0,S),m=g.length;m=Do/2&&++_;do u=0,a=e(A,g,S,m),a<0?(v=g[0],S!=m&&(v=v*Do+(g[1]||0)),u=v/_|0,u>1?(u>=Do&&(u=Do-1),f=t(A,u),d=f.length,m=g.length,a=e(f,g,d,m),a==1&&(u--,n(f,S16)throw Error(qce+co(t));if(!t.s)return new u(rc);for(e==null?(vi=!1,a=f):a=e,s=new u(.03125);t.abs().gte(.1);)t=t.times(s),c+=5;for(r=Math.log(q0(2,c))/Math.LN10*2+5|0,a+=r,n=i=o=new u(rc),u.precision=a;;){if(i=$r(i.times(t),a),n=n.times(++l),s=o.plus(wg(i,n,a)),ih(s.d).slice(0,a)===ih(o.d).slice(0,a)){for(;c--;)o=$r(o.times(o),a);return u.precision=f,e==null?(vi=!0,$r(o,f)):o}o=s}}function co(t){for(var e=t.e*Zr,n=t.d[0];n>=10;n/=10)e++;return e}function V7(t,e,n){if(e>t.LN10.sd())throw vi=!0,n&&(t.precision=n),Error(Iu+"LN10 precision limit exceeded");return $r(new t(t.LN10),e)}function ev(t){for(var e="";t--;)e+="0";return e}function IP(t,e){var n,r,i,o,s,a,l,c,u,f=1,d=10,h=t,p=h.d,g=h.constructor,m=g.precision;if(h.s<1)throw Error(Iu+(h.s?"NaN":"-Infinity"));if(h.eq(rc))return new g(0);if(e==null?(vi=!1,c=m):c=e,h.eq(10))return e==null&&(vi=!0),V7(g,c);if(c+=d,g.precision=c,n=ih(p),r=n.charAt(0),o=co(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(t),n=ih(h.d),r=n.charAt(0),f++;o=co(h),r>1?(h=new g("0."+n),o++):h=new g(r+"."+n.slice(1))}else return l=V7(g,c+2,m).times(o+""),h=IP(new g(r+"."+n.slice(1)),c-d).plus(l),g.precision=m,e==null?(vi=!0,$r(h,m)):h;for(a=s=h=wg(h.minus(rc),h.plus(rc),c),u=$r(h.times(h),c),i=3;;){if(s=$r(s.times(u),c),l=a.plus(wg(s,new g(i),c)),ih(l.d).slice(0,c)===ih(a.d).slice(0,c))return a=a.times(2),o!==0&&(a=a.plus(V7(g,c+2,m).times(o+""))),a=wg(a,new g(f),c),g.precision=m,e==null?(vi=!0,$r(a,m)):a;a=l,i+=2}}function FSe(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=hE(n/Zr),t.d=[],r=(n+1)%Zr,n<0&&(r+=Zr),rFz||t.e<-Fz))throw Error(qce+n)}else t.s=0,t.e=0,t.d=[0];return t}function $r(t,e,n){var r,i,o,s,a,l,c,u,f=t.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=e-s,r<0)r+=Zr,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/Zr),o=f.length,u>=o)return t;for(c=o=f[u],s=1;o>=10;o/=10)s++;r%=Zr,i=r-Zr+s}if(n!==void 0&&(o=q0(10,s-i-1),a=c/o%10|0,l=e<0||f[u+1]!==void 0||c%o,l=n<4?(a||l)&&(n==0||n==(t.s<0?3:2)):a>5||a==5&&(n==4||l||n==6&&(r>0?i>0?c/q0(10,s-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(o=co(t),f.length=1,e=e-o-1,f[0]=q0(10,(Zr-e%Zr)%Zr),t.e=hE(-e/Zr)||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=q0(10,Zr-r),f[u]=i>0?(c/q0(10,s-i)%q0(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==Do&&(f[0]=1,++t.e);break}else{if(f[u]+=o,f[u]!=Do)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(vi&&(t.e>Fz||t.e<-Fz))throw Error(qce+co(t));return t}function Iqe(t,e){var n,r,i,o,s,a,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),vi?$r(e,h):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),s=c-r,s){for(u=s<0,u?(n=l,s=-s,a=f.length):(n=f,r=c,a=l.length),i=Math.max(Math.ceil(h/Zr),a)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=l.length,a=f.length,u=i0;--i)l[a++]=0;for(i=f.length;i>s;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+ev(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ev(-i-1)+o,n&&(r=n-s)>0&&(o+=ev(r))):i>=s?(o+=ev(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+ev(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=ev(r))),t.s<0?"-"+o:o}function NSe(t,e){if(t.length>e)return t.length=e,!0}function Lqe(t){var e,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Qx+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return FSe(s,o.toString())}else if(typeof o!="string")throw Error(Qx+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,bIn.test(o))FSe(s,o);else throw Error(Qx+o)}if(i.prototype=Tt,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=Lqe,i.config=i.set=wIn,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(Qx+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Qx+n+": "+r);return this}var Xce=Lqe(xIn);rc=new Xce(1);const Or=Xce;function _In(t){return EIn(t)||OIn(t)||CIn(t)||SIn()}function SIn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. + height and width.`,M,I,s,l,u,f,n);var z=!Array.isArray(h)&&OF.isElement(h)&&xg(h.type).endsWith("Chart");return he.Children.map(h,function(F){return OF.isElement(F)?D.cloneElement(F,QL({width:M,height:I},z?{style:QL({height:"100%",width:"100%",maxHeight:I,maxWidth:M},F.props.style)}:{})):F})},[n,h,l,d,f,u,k,s]);return he.createElement("div",{id:m?"".concat(m):void 0,className:Oe("recharts-responsive-container",v),style:QL(QL({},b),{},{width:s,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:w},A)}),Oqe=function(e){return null};Oqe.displayName="Cell";function MP(t){"@babel/helpers - typeof";return MP=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},MP(t)}function CSe(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 hZ(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Sh.isSsr)return{width:0,height:0};var r=vDn(n),i=JSON.stringify({text:e,copyStyle:r});if(pw.widthCache[i])return pw.widthCache[i];try{var o=document.getElementById(OSe);o||(o=document.createElement("span"),o.setAttribute("id",OSe),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=hZ(hZ({},mDn),r);Object.assign(o.style,s),o.textContent="".concat(e);var a=o.getBoundingClientRect(),l={width:a.width,height:a.height};return pw.widthCache[i]=l,++pw.cacheCount>gDn&&(pw.cacheCount=0,pw.widthCache={}),l}catch{return{width:0,height:0}}},yDn=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function RP(t){"@babel/helpers - typeof";return RP=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},RP(t)}function Lz(t,e){return _Dn(t)||wDn(t,e)||bDn(t,e)||xDn()}function xDn(){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 bDn(t,e){if(t){if(typeof t=="string")return ESe(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 ESe(t,e)}}function ESe(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 $Dn(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 RSe(t,e){return jDn(t)||zDn(t,e)||NDn(t,e)||FDn()}function FDn(){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 NDn(t,e){if(t){if(typeof t=="string")return DSe(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 DSe(t,e)}}function DSe(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 M.reduce(function(I,z){var F=z.word,N=z.width,L=I[I.length-1];if(L&&(i==null||o||L.width+N+rz.width?I:z})};if(!u)return h;for(var g="…",m=function(M){var I=f.slice(0,M),z=Aqe({breakAll:c,style:l,children:I+g}).wordsWithComputedWidth,F=d(z),N=F.length>s||p(F).width>Number(i);return[N,F]},v=0,y=f.length-1,x=0,b;v<=y&&x<=f.length-1;){var w=Math.floor((v+y)/2),_=w-1,S=m(_),O=RSe(S,2),k=O[0],E=O[1],P=m(w),A=RSe(P,1),R=A[0];if(!k&&!R&&(v=w+1),k&&R&&(y=w-1),!k&&R){b=E;break}x++}return b||h},ISe=function(e){var n=wn(e)?[]:e.toString().split(kqe);return[{words:n}]},UDn=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,s=e.breakAll,a=e.maxLines;if((n||r)&&!Sh.isSsr){var l,c,u=Aqe({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return ISe(i);return BDn({breakAll:s,children:i,maxLines:a,style:o},l,c,n,r)}return ISe(i)},LSe="#808080",$z=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,s=e.lineHeight,a=s===void 0?"1em":s,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,g=p===void 0?"end":p,m=e.fill,v=m===void 0?LSe:m,y=MSe(e,IDn),x=D.useMemo(function(){return UDn({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,w=y.dy,_=y.angle,S=y.className,O=y.breakAll,k=MSe(y,LDn);if(!So(r)||!So(o))return null;var E=r+(at(b)?b:0),P=o+(at(w)?w:0),A;switch(g){case"start":A=W7("calc(".concat(c,")"));break;case"middle":A=W7("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(c," / 2))"));break;default:A=W7("calc(".concat(x.length-1," * -").concat(a,")"));break}var R=[];if(f){var T=x[0].width,M=y.width;R.push("scale(".concat((at(M)?M/T:1)/T,")"))}return _&&R.push("rotate(".concat(_,", ").concat(E,", ").concat(P,")")),R.length&&(k.transform=R.join(" ")),he.createElement("text",pZ({},pn(k,!0),{x:E,y:P,className:Oe("recharts-text",S),textAnchor:h,fill:v.includes("url")?LSe:v}),x.map(function(I,z){var F=I.words.join(O?"":" ");return he.createElement("tspan",{x:E,dy:z===0?A:a,key:F},F)}))};const $Se=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:OA,scaleDiverging:cie,scaleDivergingLog:uie,scaleDivergingPow:kB,scaleDivergingSqrt:gFe,scaleDivergingSymlog:fie,scaleIdentity:Kre,scaleImplicit:EN,scaleLinear:AA,scaleLog:Jre,scaleOrdinal:aR,scalePoint:rk,scalePow:SB,scaleQuantile:rie,scaleQuantize:iie,scaleRadial:uFe,scaleSequential:OB,scaleSequentialLog:aie,scaleSequentialPow:EB,scaleSequentialQuantile:pFe,scaleSequentialSqrt:hFe,scaleSequentialSymlog:lie,scaleSqrt:cFe,scaleSymlog:tie,scaleThreshold:oie,scaleTime:fFe,scaleUtc:dFe,tickFormat:Qre},Symbol.toStringTag,{value:"Module"}));var WDn=tE;function VDn(t,e,n){for(var r=-1,i=t.length;++re}var HDn=GDn,qDn=Pqe,XDn=HDn,YDn=uE;function QDn(t){return t&&t.length?qDn(t,YDn,XDn):void 0}var KDn=QDn;const Cv=sn(KDn);function ZDn(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};Tt.decimalPlaces=Tt.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Zr;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Tt.dividedBy=Tt.div=function(t){return wg(this,new this.constructor(t))};Tt.dividedToIntegerBy=Tt.idiv=function(t){var e=this,n=e.constructor;return $r(wg(e,new n(t),0,1),n.precision)};Tt.equals=Tt.eq=function(t){return!this.cmp(t)};Tt.exponent=function(){return co(this)};Tt.greaterThan=Tt.gt=function(t){return this.cmp(t)>0};Tt.greaterThanOrEqualTo=Tt.gte=function(t){return this.cmp(t)>=0};Tt.isInteger=Tt.isint=function(){return this.e>this.d.length-2};Tt.isNegative=Tt.isneg=function(){return this.s<0};Tt.isPositive=Tt.ispos=function(){return this.s>0};Tt.isZero=function(){return this.s===0};Tt.lessThan=Tt.lt=function(t){return this.cmp(t)<0};Tt.lessThanOrEqualTo=Tt.lte=function(t){return this.cmp(t)<1};Tt.logarithm=Tt.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(rc))throw Error(Iu+"NaN");if(n.s<1)throw Error(Iu+(n.s?"NaN":"-Infinity"));return n.eq(rc)?new r(0):(vi=!1,e=wg(DP(n,o),DP(t,o),o),vi=!0,$r(e,i))};Tt.minus=Tt.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Iqe(e,t):Rqe(e,(t.s=-t.s,t))};Tt.modulo=Tt.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Iu+"NaN");return n.s?(vi=!1,e=wg(n,t,0,1).times(t),vi=!0,n.minus(e)):$r(new r(n),i)};Tt.naturalExponential=Tt.exp=function(){return Dqe(this)};Tt.naturalLogarithm=Tt.ln=function(){return DP(this)};Tt.negated=Tt.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Tt.plus=Tt.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Rqe(e,t):Iqe(e,(t.s=-t.s,t))};Tt.precision=Tt.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Qx+t);if(e=co(i)+1,r=i.d.length-1,n=r*Zr+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};Tt.squareRoot=Tt.sqrt=function(){var t,e,n,r,i,o,s,a=this,l=a.constructor;if(a.s<1){if(!a.s)return new l(0);throw Error(Iu+"NaN")}for(t=co(a),vi=!1,i=Math.sqrt(+a),i==0||i==1/0?(e=ih(a.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=dE((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=s=n+3;;)if(o=r,r=o.plus(wg(a,o,s+2)).times(.5),ih(o.d).slice(0,s)===(e=ih(r.d)).slice(0,s)){if(e=e.slice(s-3,s+1),i==s&&e=="4999"){if($r(o,n+1,0),o.times(o).eq(a)){r=o;break}}else if(e!="9999")break;s+=4}return vi=!0,$r(r,n)};Tt.times=Tt.mul=function(t){var e,n,r,i,o,s,a,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;)a=o[i]+h[r]*d[i-r-1]+e,o[i--]=a%Do|0,e=a/Do|0;o[i]=(o[i]+e)%Do|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,vi?$r(t,f.precision):t};Tt.toDecimalPlaces=Tt.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(Nh(t,0,fE),e===void 0?e=r.rounding:Nh(e,0,8),$r(n,t+co(n)+1,e))};Tt.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=Ub(r,!0):(Nh(t,0,fE),e===void 0?e=i.rounding:Nh(e,0,8),r=$r(new i(r),t+1,e),n=Ub(r,!0,t+1)),n};Tt.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?Ub(i):(Nh(t,0,fE),e===void 0?e=o.rounding:Nh(e,0,8),r=$r(new o(i),t+co(i)+1,e),n=Ub(r.abs(),!1,t+co(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Tt.toInteger=Tt.toint=function(){var t=this,e=t.constructor;return $r(new e(t),co(t)+1,e.rounding)};Tt.toNumber=function(){return+this};Tt.toPower=Tt.pow=function(t){var e,n,r,i,o,s,a=this,l=a.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(rc);if(a=new l(a),!a.s){if(t.s<1)throw Error(Iu+"Infinity");return a}if(a.eq(rc))return a;if(r=l.precision,t.eq(rc))return $r(a,r);if(e=t.e,n=t.d.length-1,s=e>=n,o=a.s,s){if((n=u<0?-u:u)<=Mqe){for(i=new l(rc),e=Math.ceil(r/Zr+4),vi=!1;n%2&&(i=i.times(a),NSe(i.d,e)),n=dE(n/2),n!==0;)a=a.times(a),NSe(a.d,e);return vi=!0,t.s<0?new l(rc).div(i):$r(i,r)}}else if(o<0)throw Error(Iu+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,a.s=1,vi=!1,i=t.times(DP(a,r+c)),vi=!0,i=Dqe(i),i.s=o,i};Tt.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=co(i),r=Ub(i,n<=o.toExpNeg||n>=o.toExpPos)):(Nh(t,1,fE),e===void 0?e=o.rounding:Nh(e,0,8),i=$r(new o(i),t,e),n=co(i),r=Ub(i,t<=n||n<=o.toExpNeg,t)),r};Tt.toSignificantDigits=Tt.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(Nh(t,1,fE),e===void 0?e=r.rounding:Nh(e,0,8)),$r(new r(n),t,e)};Tt.toString=Tt.valueOf=Tt.val=Tt.toJSON=Tt[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=co(t),n=t.constructor;return Ub(t,e<=n.toExpNeg||e>=n.toExpPos)};function Rqe(t,e){var n,r,i,o,s,a,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),vi?$r(e,f):e;if(l=t.d,c=e.d,s=t.e,i=e.e,l=l.slice(),o=s-i,o){for(o<0?(r=l,o=-o,a=c.length):(r=c,i=s,a=l.length),s=Math.ceil(f/Zr),a=s>a?s+1:a+1,o>a&&(o=a,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(a=l.length,o=c.length,a-o<0&&(o=a,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/Do|0,l[o]%=Do;for(n&&(l.unshift(n),++i),a=l.length;l[--a]==0;)l.pop();return e.d=l,e.e=i,vi?$r(e,f):e}function Nh(t,e,n){if(t!==~~t||tn)throw Error(Qx+t)}function ih(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;es?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]1;)r.shift()}return function(r,i,o,s){var a,l,c,u,f,d,h,p,g,m,v,y,x,b,w,_,S,O,k=r.constructor,E=r.s==i.s?1:-1,P=r.d,A=i.d;if(!r.s)return new k(r);if(!i.s)throw Error(Iu+"Division by zero");for(l=r.e-i.e,S=A.length,w=P.length,h=new k(E),p=h.d=[],c=0;A[c]==(P[c]||0);)++c;if(A[c]>(P[c]||0)&&--l,o==null?y=o=k.precision:s?y=o+(co(r)-co(i))+1:y=o,y<0)return new k(0);if(y=y/Zr+2|0,c=0,S==1)for(u=0,A=A[0],y++;(c1&&(A=t(A,u),P=t(P,u),S=A.length,w=P.length),b=S,g=P.slice(0,S),m=g.length;m=Do/2&&++_;do u=0,a=e(A,g,S,m),a<0?(v=g[0],S!=m&&(v=v*Do+(g[1]||0)),u=v/_|0,u>1?(u>=Do&&(u=Do-1),f=t(A,u),d=f.length,m=g.length,a=e(f,g,d,m),a==1&&(u--,n(f,S16)throw Error(qce+co(t));if(!t.s)return new u(rc);for(e==null?(vi=!1,a=f):a=e,s=new u(.03125);t.abs().gte(.1);)t=t.times(s),c+=5;for(r=Math.log(q0(2,c))/Math.LN10*2+5|0,a+=r,n=i=o=new u(rc),u.precision=a;;){if(i=$r(i.times(t),a),n=n.times(++l),s=o.plus(wg(i,n,a)),ih(s.d).slice(0,a)===ih(o.d).slice(0,a)){for(;c--;)o=$r(o.times(o),a);return u.precision=f,e==null?(vi=!0,$r(o,f)):o}o=s}}function co(t){for(var e=t.e*Zr,n=t.d[0];n>=10;n/=10)e++;return e}function V7(t,e,n){if(e>t.LN10.sd())throw vi=!0,n&&(t.precision=n),Error(Iu+"LN10 precision limit exceeded");return $r(new t(t.LN10),e)}function ev(t){for(var e="";t--;)e+="0";return e}function DP(t,e){var n,r,i,o,s,a,l,c,u,f=1,d=10,h=t,p=h.d,g=h.constructor,m=g.precision;if(h.s<1)throw Error(Iu+(h.s?"NaN":"-Infinity"));if(h.eq(rc))return new g(0);if(e==null?(vi=!1,c=m):c=e,h.eq(10))return e==null&&(vi=!0),V7(g,c);if(c+=d,g.precision=c,n=ih(p),r=n.charAt(0),o=co(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(t),n=ih(h.d),r=n.charAt(0),f++;o=co(h),r>1?(h=new g("0."+n),o++):h=new g(r+"."+n.slice(1))}else return l=V7(g,c+2,m).times(o+""),h=DP(new g(r+"."+n.slice(1)),c-d).plus(l),g.precision=m,e==null?(vi=!0,$r(h,m)):h;for(a=s=h=wg(h.minus(rc),h.plus(rc),c),u=$r(h.times(h),c),i=3;;){if(s=$r(s.times(u),c),l=a.plus(wg(s,new g(i),c)),ih(l.d).slice(0,c)===ih(a.d).slice(0,c))return a=a.times(2),o!==0&&(a=a.plus(V7(g,c+2,m).times(o+""))),a=wg(a,new g(f),c),g.precision=m,e==null?(vi=!0,$r(a,m)):a;a=l,i+=2}}function FSe(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=dE(n/Zr),t.d=[],r=(n+1)%Zr,n<0&&(r+=Zr),rFz||t.e<-Fz))throw Error(qce+n)}else t.s=0,t.e=0,t.d=[0];return t}function $r(t,e,n){var r,i,o,s,a,l,c,u,f=t.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=e-s,r<0)r+=Zr,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/Zr),o=f.length,u>=o)return t;for(c=o=f[u],s=1;o>=10;o/=10)s++;r%=Zr,i=r-Zr+s}if(n!==void 0&&(o=q0(10,s-i-1),a=c/o%10|0,l=e<0||f[u+1]!==void 0||c%o,l=n<4?(a||l)&&(n==0||n==(t.s<0?3:2)):a>5||a==5&&(n==4||l||n==6&&(r>0?i>0?c/q0(10,s-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(o=co(t),f.length=1,e=e-o-1,f[0]=q0(10,(Zr-e%Zr)%Zr),t.e=dE(-e/Zr)||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=q0(10,Zr-r),f[u]=i>0?(c/q0(10,s-i)%q0(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==Do&&(f[0]=1,++t.e);break}else{if(f[u]+=o,f[u]!=Do)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(vi&&(t.e>Fz||t.e<-Fz))throw Error(qce+co(t));return t}function Iqe(t,e){var n,r,i,o,s,a,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),vi?$r(e,h):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),s=c-r,s){for(u=s<0,u?(n=l,s=-s,a=f.length):(n=f,r=c,a=l.length),i=Math.max(Math.ceil(h/Zr),a)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=l.length,a=f.length,u=i0;--i)l[a++]=0;for(i=f.length;i>s;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+ev(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ev(-i-1)+o,n&&(r=n-s)>0&&(o+=ev(r))):i>=s?(o+=ev(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+ev(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=ev(r))),t.s<0?"-"+o:o}function NSe(t,e){if(t.length>e)return t.length=e,!0}function Lqe(t){var e,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Qx+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return FSe(s,o.toString())}else if(typeof o!="string")throw Error(Qx+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,bIn.test(o))FSe(s,o);else throw Error(Qx+o)}if(i.prototype=Tt,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=Lqe,i.config=i.set=wIn,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(Qx+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Qx+n+": "+r);return this}var Xce=Lqe(xIn);rc=new Xce(1);const Or=Xce;function _In(t){return EIn(t)||OIn(t)||CIn(t)||SIn()}function SIn(){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 CIn(t,e){if(t){if(typeof t=="string")return gZ(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 gZ(t,e)}}function OIn(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function EIn(t){if(Array.isArray(t))return gZ(t)}function gZ(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-s,zSe(function(){for(var a=arguments.length,l=new Array(a),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 s=t[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function BIn(t){if(Array.isArray(t))return t}function jqe(t){var e=LP(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function Bqe(t,e,n){if(t.lte(0))return new Or(0);var r=JU.getDigitCount(t.toNumber()),i=new Or(10).pow(r),o=t.div(i),s=r!==1?.05:.1,a=new Or(Math.ceil(o.div(s).toNumber())).add(n).mul(s),l=a.mul(i);return e?l:new Or(Math.ceil(l))}function UIn(t,e,n){var r=1,i=new Or(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new Or(10).pow(JU.getDigitCount(t)-1),i=new Or(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Or(Math.floor(t)))}else t===0?i=new Or(Math.floor((e-1)/2)):n||(i=new Or(Math.floor(t)));var s=Math.floor((e-1)/2),a=PIn(AIn(function(l){return i.add(new Or(l-s).mul(r)).toNumber()}),mZ);return a(0,e)}function Uqe(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 Or(0),tickMin:new Or(0),tickMax:new Or(0)};var o=Bqe(new Or(e).sub(t).div(n-1),r,i),s;t<=0&&e>=0?s=new Or(0):(s=new Or(t).add(e).div(2),s=s.sub(new Or(s).mod(o)));var a=Math.ceil(s.sub(t).div(o).toNumber()),l=Math.ceil(new Or(e).sub(s).div(o).toNumber()),c=a+l+1;return c>n?Uqe(t,e,n,r,i+1):(c0?l+(n-c):l,a=e>0?a:a+(n-c)),{step:o,tickMin:s.sub(new Or(a).mul(o)),tickMax:s.add(new Or(l).mul(o))})}function WIn(t){var e=LP(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,s=Math.max(i,2),a=jqe([n,r]),l=LP(a,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(yZ(mZ(0,i-1).map(function(){return 1/0}))):[].concat(yZ(mZ(0,i-1).map(function(){return-1/0})),[u]);return n>r?vZ(f):f}if(c===u)return UIn(c,i,o);var d=Uqe(c,u,s,o),h=d.step,p=d.tickMin,g=d.tickMax,m=JU.rangeStep(p,g.add(new Or(.1).mul(h)),h);return n>r?vZ(m):m}function VIn(t,e){var n=LP(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=jqe([r,i]),a=LP(s,2),l=a[0],c=a[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=Bqe(new Or(c).sub(l).div(u-1),o,0),d=[].concat(yZ(JU.rangeStep(new Or(l),new Or(c).sub(new Or(.99).mul(f)),f)),[c]);return r>i?vZ(d):d}var GIn=Nqe(WIn),HIn=Nqe(VIn),qIn="Invariant failed";function Wb(t,e){throw new Error(qIn)}var XIn=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Nz(){return Nz=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 tLn(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 pE(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,o=t.data,s=t.dataPointFormatter,a=t.xAxis,l=t.yAxis,c=eLn(t,XIn),u=pn(c,!1);t.direction==="x"&&a.type!=="number"&&Wb();var f=o.map(function(d){var h=s(d,i),p=h.x,g=h.y,m=h.value,v=h.errorVal;if(!v)return null;var y=[],x,b;if(Array.isArray(v)){var w=YIn(v,2);x=w[0],b=w[1]}else x=b=v;if(n==="vertical"){var _=a.scale,S=g+e,O=S+r,k=S-r,E=_(m-x),P=_(m+b);y.push({x1:P,y1:O,x2:P,y2:k}),y.push({x1:E,y1:S,x2:P,y2:S}),y.push({x1:E,y1:O,x2:E,y2:k})}else if(n==="horizontal"){var A=l.scale,R=p+e,T=R-r,M=R+r,I=A(m-x),z=A(m+b);y.push({x1:T,y1:z,x2:M,y2:z}),y.push({x1:R,y1:I,x2:R,y2:z}),y.push({x1:T,y1:I,x2:M,y2:I})}return he.createElement(Vr,Nz({className:"recharts-errorBar",key:"bar-".concat(y.map(function(F){return"".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))},u),y.map(function(F){return he.createElement("line",Nz({},F,{key:"line-".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))}))});return he.createElement(Vr,{className:"recharts-errorBars"},f)}pE.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};pE.displayName="ErrorBar";function $P(t){"@babel/helpers - typeof";return $P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$P(t)}function BSe(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 G7(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,s=-1,a=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(a<=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[a-1].coordinate,f=i[c].coordinate,d=c>=a-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(Af(f-u)!==Af(d-f)){var p=[];if(Af(d-f)===Af(l[1]-l[0])){h=d;var g=f+l[1]-l[0];p[0]=Math.min(g,(g+u)/2),p[1]=Math.max(g,(g+u)/2)}else{h=u;var m=d+l[1]-l[0];p[0]=Math.min(f,(m+f)/2),p[1]=Math.max(f,(m+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]){s=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){s=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===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){s=r[b].index;break}return s},Yce=function(e){var n=e,r=n.type.displayName,i=e.props,o=i.stroke,s=i.fill,a;switch(r){case"Line":a=o;break;case"Area":case"Radar":a=o&&o!=="none"?o:s;break;default:a=s;break}return a},dLn=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},a=Object.keys(o),l=0,c=a.length;l=0});if(v&&v.length){var y=v[0].props.barSize,x=v[0].props[m];s[x]||(s[x]=[]);var b=wn(y)?n:y;s[x].push({item:v[0],stackList:v.slice(1),barSize:wn(b)?void 0:Bb(b,r,0)})}}return s},hLn=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,s=o===void 0?[]:o,a=e.maxBarSize,l=s.length;if(l<1)return null;var c=Bb(n,i,0,!0),u,f=[];if(s[0].barSize===+s[0].barSize){var d=!1,h=i/l,p=s.reduce(function(b,w){return b+w.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 g=(i-p)/2>>0,m={offset:g-c,size:0};u=s.reduce(function(b,w){var _={item:w.item,position:{offset:m.offset+m.size+c,size:d?h:w.barSize}},S=[].concat(WSe(b),[_]);return m=S[S.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(O){S.push({item:O,position:m})}),S},f)}else{var v=Bb(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=a===+a?Math.min(y,a):y;u=s.reduce(function(b,w,_){var S=[].concat(WSe(b),[{item:w.item,position:{offset:v+(y+c)*_+(y-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(O){S.push({item:O,position:S[S.length-1].position})}),S},f)}return u},pLn=function(e,n,r,i){var o=r.children,s=r.width,a=r.margin,l=s-(a.left||0)-(a.right||0),c=Wqe({children:o,legendWidth:l});if(c){var u=i||{},f=u.width,d=u.height,h=c.align,p=c.verticalAlign,g=c.layout;if((g==="vertical"||g==="horizontal"&&p==="middle")&&h!=="center"&&at(e[h]))return Qc(Qc({},e),{},lS({},h,e[h]+(f||0)));if((g==="horizontal"||g==="vertical"&&h==="center")&&p!=="middle"&&at(e[p]))return Qc(Qc({},e),{},lS({},p,e[p]+(d||0)))}return e},gLn=function(e,n,r){return wn(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Vqe=function(e,n,r,i,o){var s=n.props.children,a=vu(s,pE).filter(function(c){return gLn(i,o,c.props.direction)});if(a&&a.length){var l=a.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=Da(u,r);if(wn(f))return c;var d=Array.isArray(f)?[KU(f),Cv(f)]:[f,f],h=l.reduce(function(p,g){var m=Da(u,g,0),v=d[0]-Math.abs(Array.isArray(m)?m[0]:m),y=d[1]+Math.abs(Array.isArray(m)?m[1]:m);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},mLn=function(e,n,r,i,o){var s=n.map(function(a){return Vqe(e,a,r,o,i)}).filter(function(a){return!wn(a)});return s&&s.length?s.reduce(function(a,l){return[Math.min(a[0],l[0]),Math.max(a[1],l[1])]},[1/0,-1/0]):null},Gqe=function(e,n,r,i,o){var s=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Vqe(e,l,c,i)||Pk(e,c,r,o)});if(r==="number")return s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var a={};return s.reduce(function(l,c){for(var u=0,f=c.length;u=2?Af(a[0]-a[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!aE(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}})},H7=new WeakMap,ZL=function(e,n){if(typeof n!="function")return e;H7.has(e)||H7.set(e,new WeakMap);var r=H7.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},vLn=function(e,n,r){var i=e.scale,o=e.type,s=e.layout,a=e.axisType;if(i==="auto")return s==="radial"&&a==="radiusAxis"?{scale:EA(),realScaleType:"band"}:s==="radial"&&a==="angleAxis"?{scale:PA(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ik(),realScaleType:"point"}:o==="category"?{scale:EA(),realScaleType:"band"}:{scale:PA(),realScaleType:"linear"};if(vD(i)){var l="scale".concat(qU(i));return{scale:($Se[l]||ik)(),realScaleType:$Se[l]?l:"point"}}return mn(i)?{scale:i}:{scale:ik(),realScaleType:"point"}},VSe=1e-4,yLn=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])-VSe,s=Math.max(i[0],i[1])+VSe,a=e(n[0]),l=e(n[r-1]);(as||ls)&&e.domain([n[0],n[r-1]])}},xLn=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[a][r][0]=o,e[a][r][1]=o+l,o=e[a][r][1]):(e[a][r][0]=s,e[a][r][1]=s+l,s=e[a][r][1])}},_Ln=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[s][r][0]=o,e[s][r][1]=o+a,o=e[s][r][1]):(e[s][r][0]=0,e[s][r][1]=0)}},SLn={sign:wLn,expand:rAt,none:BS,silhouette:iAt,wiggle:oAt,positive:_Ln},CLn=function(e,n,r){var i=n.map(function(a){return a.props.dataKey}),o=SLn[r],s=nAt().keys(i).value(function(a,l){return+Da(a,l,0)}).order(bX).offset(o);return s(e)},OLn=function(e,n,r,i,o,s){if(!e)return null;var a=s?n.reverse():n,l={},c=a.reduce(function(f,d){var h=d.props,p=h.stackId,g=h.hide;if(g)return f;var m=d.props[r],v=f[m]||{hasStack:!1,stackGroups:{}};if(So(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[lE("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return Qc(Qc({},f),{},lS({},m,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(g,m){var v=h.stackGroups[m];return Qc(Qc({},g),{},lS({},m,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:CLn(e,v.items,o)}))},p)}return Qc(Qc({},f),{},lS({},d,h))},u)},ELn=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,s=n.originalDomain,a=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=GIn(c,o,a);return e.domain([KU(u),Cv(u)]),{niceTicks:u}}if(o&&i==="number"){var f=e.domain(),d=HIn(f,o,a);return{niceTicks:d}}return null};function zz(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,s=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!wn(i[e.dataKey])){var a=Oz(n,"value",i[e.dataKey]);if(a)return a.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Da(i,wn(s)?e.dataKey:s);return wn(l)?null:e.scale(l)}var GSe=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,s=e.entry,a=e.index;if(n.type==="category")return r[a]?r[a].coordinate+i:null;var l=Da(s,n.dataKey,n.domain[a]);return wn(l)?null:n.scale(l)-o/2+i},TLn=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]},kLn=function(e,n){var r=e.props.stackId;if(So(r)){var i=n[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},ALn=function(e){return e.reduce(function(n,r){return[KU(r.concat([n[0]]).filter(at)),Cv(r.concat([n[1]]).filter(at))]},[1/0,-1/0])},Xqe=function(e,n,r){return Object.keys(e).reduce(function(i,o){var s=e[o],a=s.stackedData,l=a.reduce(function(c,u){var f=ALn(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})},HSe=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qSe=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,wZ=function(e,n,r){if(mn(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(at(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(HSe.test(e[0])){var o=+HSe.exec(e[0])[1];i[0]=n[0]-o}else mn(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(at(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(qSe.test(e[1])){var s=+qSe.exec(e[1])[1];i[1]=n[1]+s}else mn(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},jz=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=Gce(n,function(f){return f.coordinate}),s=1/0,a=1,l=o.length;as&&(c=2*Math.PI-c),{radius:a,angle:DLn(c),angleInRadian:c}},$Ln=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),s=Math.min(i,o);return{startAngle:n-s*360,endAngle:r-s*360}},FLn=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),s=Math.floor(i/360),a=Math.min(o,s);return e+a*360},KSe=function(e,n){var r=e.x,i=e.y,o=LLn({x:r,y:i},n),s=o.radius,a=o.angle,l=n.innerRadius,c=n.outerRadius;if(sc)return!1;if(s===0)return!0;var u=$Ln(n),f=u.startAngle,d=u.endAngle,h=a,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?QSe(QSe({},n),{},{radius:s,angle:FLn(h,n)}):null};function zP(t){"@babel/helpers - typeof";return zP=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},zP(t)}var NLn=["offset"];function zLn(t){return WLn(t)||ULn(t)||BLn(t)||jLn()}function jLn(){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 BLn(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 ULn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function WLn(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=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function GLn(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 ZSe(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 po(t){for(var e=1;e=0?1:-1,x,b;i==="insideStart"?(x=h+y*s,b=g):i==="insideEnd"?(x=p-y*s,b=!g):i==="end"&&(x=p+y*s,b=g),b=v<=0?b:!b;var w=vs(c,u,m,x),_=vs(c,u,m,x+(b?1:-1)*359),S="M".concat(w.x,",").concat(w.y,` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FIn(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function NIn(t){if(Array.isArray(t))return xZ(t)}function IP(t,e){return BIn(t)||jIn(t,e)||zqe(t,e)||zIn()}function zIn(){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 zqe(t,e){if(t){if(typeof t=="string")return xZ(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 xZ(t,e)}}function xZ(t,e){(e==null||e>t.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 s=t[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function BIn(t){if(Array.isArray(t))return t}function jqe(t){var e=IP(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function Bqe(t,e,n){if(t.lte(0))return new Or(0);var r=JU.getDigitCount(t.toNumber()),i=new Or(10).pow(r),o=t.div(i),s=r!==1?.05:.1,a=new Or(Math.ceil(o.div(s).toNumber())).add(n).mul(s),l=a.mul(i);return e?l:new Or(Math.ceil(l))}function UIn(t,e,n){var r=1,i=new Or(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new Or(10).pow(JU.getDigitCount(t)-1),i=new Or(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Or(Math.floor(t)))}else t===0?i=new Or(Math.floor((e-1)/2)):n||(i=new Or(Math.floor(t)));var s=Math.floor((e-1)/2),a=PIn(AIn(function(l){return i.add(new Or(l-s).mul(r)).toNumber()}),mZ);return a(0,e)}function Uqe(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 Or(0),tickMin:new Or(0),tickMax:new Or(0)};var o=Bqe(new Or(e).sub(t).div(n-1),r,i),s;t<=0&&e>=0?s=new Or(0):(s=new Or(t).add(e).div(2),s=s.sub(new Or(s).mod(o)));var a=Math.ceil(s.sub(t).div(o).toNumber()),l=Math.ceil(new Or(e).sub(s).div(o).toNumber()),c=a+l+1;return c>n?Uqe(t,e,n,r,i+1):(c0?l+(n-c):l,a=e>0?a:a+(n-c)),{step:o,tickMin:s.sub(new Or(a).mul(o)),tickMax:s.add(new Or(l).mul(o))})}function WIn(t){var e=IP(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,s=Math.max(i,2),a=jqe([n,r]),l=IP(a,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(yZ(mZ(0,i-1).map(function(){return 1/0}))):[].concat(yZ(mZ(0,i-1).map(function(){return-1/0})),[u]);return n>r?vZ(f):f}if(c===u)return UIn(c,i,o);var d=Uqe(c,u,s,o),h=d.step,p=d.tickMin,g=d.tickMax,m=JU.rangeStep(p,g.add(new Or(.1).mul(h)),h);return n>r?vZ(m):m}function VIn(t,e){var n=IP(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=jqe([r,i]),a=IP(s,2),l=a[0],c=a[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=Bqe(new Or(c).sub(l).div(u-1),o,0),d=[].concat(yZ(JU.rangeStep(new Or(l),new Or(c).sub(new Or(.99).mul(f)),f)),[c]);return r>i?vZ(d):d}var GIn=Nqe(WIn),HIn=Nqe(VIn),qIn="Invariant failed";function Wb(t,e){throw new Error(qIn)}var XIn=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Nz(){return Nz=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 tLn(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 hE(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,o=t.data,s=t.dataPointFormatter,a=t.xAxis,l=t.yAxis,c=eLn(t,XIn),u=pn(c,!1);t.direction==="x"&&a.type!=="number"&&Wb();var f=o.map(function(d){var h=s(d,i),p=h.x,g=h.y,m=h.value,v=h.errorVal;if(!v)return null;var y=[],x,b;if(Array.isArray(v)){var w=YIn(v,2);x=w[0],b=w[1]}else x=b=v;if(n==="vertical"){var _=a.scale,S=g+e,O=S+r,k=S-r,E=_(m-x),P=_(m+b);y.push({x1:P,y1:O,x2:P,y2:k}),y.push({x1:E,y1:S,x2:P,y2:S}),y.push({x1:E,y1:O,x2:E,y2:k})}else if(n==="horizontal"){var A=l.scale,R=p+e,T=R-r,M=R+r,I=A(m-x),z=A(m+b);y.push({x1:T,y1:z,x2:M,y2:z}),y.push({x1:R,y1:I,x2:R,y2:z}),y.push({x1:T,y1:I,x2:M,y2:I})}return he.createElement(Vr,Nz({className:"recharts-errorBar",key:"bar-".concat(y.map(function(F){return"".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))},u),y.map(function(F){return he.createElement("line",Nz({},F,{key:"line-".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))}))});return he.createElement(Vr,{className:"recharts-errorBars"},f)}hE.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};hE.displayName="ErrorBar";function LP(t){"@babel/helpers - typeof";return LP=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},LP(t)}function BSe(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 G7(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,s=-1,a=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(a<=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[a-1].coordinate,f=i[c].coordinate,d=c>=a-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(Af(f-u)!==Af(d-f)){var p=[];if(Af(d-f)===Af(l[1]-l[0])){h=d;var g=f+l[1]-l[0];p[0]=Math.min(g,(g+u)/2),p[1]=Math.max(g,(g+u)/2)}else{h=u;var m=d+l[1]-l[0];p[0]=Math.min(f,(m+f)/2),p[1]=Math.max(f,(m+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]){s=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){s=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===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){s=r[b].index;break}return s},Yce=function(e){var n=e,r=n.type.displayName,i=e.props,o=i.stroke,s=i.fill,a;switch(r){case"Line":a=o;break;case"Area":case"Radar":a=o&&o!=="none"?o:s;break;default:a=s;break}return a},dLn=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},a=Object.keys(o),l=0,c=a.length;l=0});if(v&&v.length){var y=v[0].props.barSize,x=v[0].props[m];s[x]||(s[x]=[]);var b=wn(y)?n:y;s[x].push({item:v[0],stackList:v.slice(1),barSize:wn(b)?void 0:Bb(b,r,0)})}}return s},hLn=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,s=o===void 0?[]:o,a=e.maxBarSize,l=s.length;if(l<1)return null;var c=Bb(n,i,0,!0),u,f=[];if(s[0].barSize===+s[0].barSize){var d=!1,h=i/l,p=s.reduce(function(b,w){return b+w.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 g=(i-p)/2>>0,m={offset:g-c,size:0};u=s.reduce(function(b,w){var _={item:w.item,position:{offset:m.offset+m.size+c,size:d?h:w.barSize}},S=[].concat(WSe(b),[_]);return m=S[S.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(O){S.push({item:O,position:m})}),S},f)}else{var v=Bb(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=a===+a?Math.min(y,a):y;u=s.reduce(function(b,w,_){var S=[].concat(WSe(b),[{item:w.item,position:{offset:v+(y+c)*_+(y-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(O){S.push({item:O,position:S[S.length-1].position})}),S},f)}return u},pLn=function(e,n,r,i){var o=r.children,s=r.width,a=r.margin,l=s-(a.left||0)-(a.right||0),c=Wqe({children:o,legendWidth:l});if(c){var u=i||{},f=u.width,d=u.height,h=c.align,p=c.verticalAlign,g=c.layout;if((g==="vertical"||g==="horizontal"&&p==="middle")&&h!=="center"&&at(e[h]))return Qc(Qc({},e),{},lS({},h,e[h]+(f||0)));if((g==="horizontal"||g==="vertical"&&h==="center")&&p!=="middle"&&at(e[p]))return Qc(Qc({},e),{},lS({},p,e[p]+(d||0)))}return e},gLn=function(e,n,r){return wn(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Vqe=function(e,n,r,i,o){var s=n.props.children,a=vu(s,hE).filter(function(c){return gLn(i,o,c.props.direction)});if(a&&a.length){var l=a.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=Da(u,r);if(wn(f))return c;var d=Array.isArray(f)?[KU(f),Cv(f)]:[f,f],h=l.reduce(function(p,g){var m=Da(u,g,0),v=d[0]-Math.abs(Array.isArray(m)?m[0]:m),y=d[1]+Math.abs(Array.isArray(m)?m[1]:m);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},mLn=function(e,n,r,i,o){var s=n.map(function(a){return Vqe(e,a,r,o,i)}).filter(function(a){return!wn(a)});return s&&s.length?s.reduce(function(a,l){return[Math.min(a[0],l[0]),Math.max(a[1],l[1])]},[1/0,-1/0]):null},Gqe=function(e,n,r,i,o){var s=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Vqe(e,l,c,i)||Ak(e,c,r,o)});if(r==="number")return s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var a={};return s.reduce(function(l,c){for(var u=0,f=c.length;u=2?Af(a[0]-a[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!sE(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}})},H7=new WeakMap,ZL=function(e,n){if(typeof n!="function")return e;H7.has(e)||H7.set(e,new WeakMap);var r=H7.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},vLn=function(e,n,r){var i=e.scale,o=e.type,s=e.layout,a=e.axisType;if(i==="auto")return s==="radial"&&a==="radiusAxis"?{scale:OA(),realScaleType:"band"}:s==="radial"&&a==="angleAxis"?{scale:AA(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:rk(),realScaleType:"point"}:o==="category"?{scale:OA(),realScaleType:"band"}:{scale:AA(),realScaleType:"linear"};if(vD(i)){var l="scale".concat(qU(i));return{scale:($Se[l]||rk)(),realScaleType:$Se[l]?l:"point"}}return mn(i)?{scale:i}:{scale:rk(),realScaleType:"point"}},VSe=1e-4,yLn=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])-VSe,s=Math.max(i[0],i[1])+VSe,a=e(n[0]),l=e(n[r-1]);(as||ls)&&e.domain([n[0],n[r-1]])}},xLn=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[a][r][0]=o,e[a][r][1]=o+l,o=e[a][r][1]):(e[a][r][0]=s,e[a][r][1]=s+l,s=e[a][r][1])}},_Ln=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[s][r][0]=o,e[s][r][1]=o+a,o=e[s][r][1]):(e[s][r][0]=0,e[s][r][1]=0)}},SLn={sign:wLn,expand:rAt,none:BS,silhouette:iAt,wiggle:oAt,positive:_Ln},CLn=function(e,n,r){var i=n.map(function(a){return a.props.dataKey}),o=SLn[r],s=nAt().keys(i).value(function(a,l){return+Da(a,l,0)}).order(bX).offset(o);return s(e)},OLn=function(e,n,r,i,o,s){if(!e)return null;var a=s?n.reverse():n,l={},c=a.reduce(function(f,d){var h=d.props,p=h.stackId,g=h.hide;if(g)return f;var m=d.props[r],v=f[m]||{hasStack:!1,stackGroups:{}};if(So(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[aE("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return Qc(Qc({},f),{},lS({},m,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(g,m){var v=h.stackGroups[m];return Qc(Qc({},g),{},lS({},m,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:CLn(e,v.items,o)}))},p)}return Qc(Qc({},f),{},lS({},d,h))},u)},ELn=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,s=n.originalDomain,a=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=GIn(c,o,a);return e.domain([KU(u),Cv(u)]),{niceTicks:u}}if(o&&i==="number"){var f=e.domain(),d=HIn(f,o,a);return{niceTicks:d}}return null};function zz(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,s=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!wn(i[e.dataKey])){var a=Oz(n,"value",i[e.dataKey]);if(a)return a.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Da(i,wn(s)?e.dataKey:s);return wn(l)?null:e.scale(l)}var GSe=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,s=e.entry,a=e.index;if(n.type==="category")return r[a]?r[a].coordinate+i:null;var l=Da(s,n.dataKey,n.domain[a]);return wn(l)?null:n.scale(l)-o/2+i},TLn=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]},kLn=function(e,n){var r=e.props.stackId;if(So(r)){var i=n[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},ALn=function(e){return e.reduce(function(n,r){return[KU(r.concat([n[0]]).filter(at)),Cv(r.concat([n[1]]).filter(at))]},[1/0,-1/0])},Xqe=function(e,n,r){return Object.keys(e).reduce(function(i,o){var s=e[o],a=s.stackedData,l=a.reduce(function(c,u){var f=ALn(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})},HSe=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qSe=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,wZ=function(e,n,r){if(mn(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(at(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(HSe.test(e[0])){var o=+HSe.exec(e[0])[1];i[0]=n[0]-o}else mn(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(at(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(qSe.test(e[1])){var s=+qSe.exec(e[1])[1];i[1]=n[1]+s}else mn(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},jz=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=Gce(n,function(f){return f.coordinate}),s=1/0,a=1,l=o.length;as&&(c=2*Math.PI-c),{radius:a,angle:DLn(c),angleInRadian:c}},$Ln=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),s=Math.min(i,o);return{startAngle:n-s*360,endAngle:r-s*360}},FLn=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),s=Math.floor(i/360),a=Math.min(o,s);return e+a*360},KSe=function(e,n){var r=e.x,i=e.y,o=LLn({x:r,y:i},n),s=o.radius,a=o.angle,l=n.innerRadius,c=n.outerRadius;if(sc)return!1;if(s===0)return!0;var u=$Ln(n),f=u.startAngle,d=u.endAngle,h=a,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?QSe(QSe({},n),{},{radius:s,angle:FLn(h,n)}):null};function NP(t){"@babel/helpers - typeof";return NP=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},NP(t)}var NLn=["offset"];function zLn(t){return WLn(t)||ULn(t)||BLn(t)||jLn()}function jLn(){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 BLn(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 ULn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function WLn(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=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function GLn(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 ZSe(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 po(t){for(var e=1;e=0?1:-1,x,b;i==="insideStart"?(x=h+y*s,b=g):i==="insideEnd"?(x=p-y*s,b=!g):i==="end"&&(x=p+y*s,b=g),b=v<=0?b:!b;var w=vs(c,u,m,x),_=vs(c,u,m,x+(b?1:-1)*359),S="M".concat(w.x,",").concat(w.y,` A`).concat(m,",").concat(m,",0,1,").concat(b?0:1,`, - `).concat(_.x,",").concat(_.y),O=wn(e.id)?lE("recharts-radial-line-"):e.id;return he.createElement("text",jP({},r,{dominantBaseline:"central",className:Oe("recharts-radial-bar-label",a)}),he.createElement("defs",null,he.createElement("path",{id:O,d:S})),he.createElement("textPath",{xlinkHref:"#".concat(O)},n))},ZLn=function(e){var n=e.viewBox,r=e.offset,i=e.position,o=n,s=o.cx,a=o.cy,l=o.innerRadius,c=o.outerRadius,u=o.startAngle,f=o.endAngle,d=(u+f)/2;if(i==="outside"){var h=vs(s,a,c+r,d),p=h.x,g=h.y;return{x:p,y:g,textAnchor:p>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"end"};var m=(l+c)/2,v=vs(s,a,m,d),y=v.x,x=v.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},JLn=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,s=n,a=s.x,l=s.y,c=s.width,u=s.height,f=u>=0?1:-1,d=f*i,h=f>0?"end":"start",p=f>0?"start":"end",g=c>=0?1:-1,m=g*i,v=g>0?"end":"start",y=g>0?"start":"end";if(o==="top"){var x={x:a+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return po(po({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var b={x:a+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:p};return po(po({},b),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var w={x:a-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return po(po({},w),r?{width:Math.max(w.x-r.x,0),height:u}:{})}if(o==="right"){var _={x:a+c+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return po(po({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:u}:{})}var S=r?{width:c,height:u}:{};return o==="insideLeft"?po({x:a+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},S):o==="insideRight"?po({x:a+c-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},S):o==="insideTop"?po({x:a+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},S):o==="insideBottom"?po({x:a+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},S):o==="insideTopLeft"?po({x:a+m,y:l+d,textAnchor:y,verticalAnchor:p},S):o==="insideTopRight"?po({x:a+c-m,y:l+d,textAnchor:v,verticalAnchor:p},S):o==="insideBottomLeft"?po({x:a+m,y:l+u-d,textAnchor:y,verticalAnchor:h},S):o==="insideBottomRight"?po({x:a+c-m,y:l+u-d,textAnchor:v,verticalAnchor:h},S):rE(o)&&(at(o.x)||_x(o.x))&&(at(o.y)||_x(o.y))?po({x:a+Bb(o.x,c),y:l+Bb(o.y,u),textAnchor:"end",verticalAnchor:"end"},S):po({x:a+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},S)},e$n=function(e){return"cx"in e&&at(e.cx)};function Vs(t){var e=t.offset,n=e===void 0?5:e,r=VLn(t,NLn),i=po({offset:n},r),o=i.viewBox,s=i.position,a=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,d=i.textBreakAll;if(!o||wn(a)&&wn(l)&&!D.isValidElement(c)&&!mn(c))return null;if(D.isValidElement(c))return D.cloneElement(c,i);var h;if(mn(c)){if(h=D.createElement(c,i),D.isValidElement(h))return h}else h=YLn(i);var p=e$n(o),g=pn(i,!0);if(p&&(s==="insideStart"||s==="insideEnd"||s==="end"))return KLn(i,h,g);var m=p?ZLn(i):JLn(i);return he.createElement($z,jP({className:Oe("recharts-label",f)},g,m,{breakAll:d}),h)}Vs.displayName="Label";var Qqe=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,s=e.endAngle,a=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,d=e.y,h=e.top,p=e.left,g=e.width,m=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if(at(g)&&at(m)){if(at(f)&&at(d))return{x:f,y:d,width:g,height:m};if(at(h)&&at(p))return{x:h,y:p,width:g,height:m}}return at(f)&&at(d)?{x:f,y:d,width:0,height:0}:at(n)&&at(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:s||i||0,innerRadius:c||0,outerRadius:u||l||a||0,clockWise:v}:e.viewBox?e.viewBox:{}},t$n=function(e,n){return e?e===!0?he.createElement(Vs,{key:"label-implicit",viewBox:n}):So(e)?he.createElement(Vs,{key:"label-implicit",viewBox:n,value:e}):D.isValidElement(e)?e.type===Vs?D.cloneElement(e,{key:"label-implicit",viewBox:n}):he.createElement(Vs,{key:"label-implicit",content:e,viewBox:n}):mn(e)?he.createElement(Vs,{key:"label-implicit",content:e,viewBox:n}):rE(e)?he.createElement(Vs,jP({viewBox:n},e,{key:"label-implicit"})):null:null},n$n=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=Qqe(e),s=vu(i,Vs).map(function(l,c){return D.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return s;var a=t$n(e.label,n||o);return[a].concat(zLn(s))};Vs.parseViewBox=Qqe;Vs.renderCallByParent=n$n;function r$n(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var i$n=r$n;const o$n=sn(i$n);function BP(t){"@babel/helpers - typeof";return BP=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},BP(t)}var s$n=["valueAccessor"],a$n=["data","dataKey","clockWise","id","textBreakAll"];function l$n(t){return d$n(t)||f$n(t)||u$n(t)||c$n()}function c$n(){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 u$n(t,e){if(t){if(typeof t=="string")return SZ(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 SZ(t,e)}}function f$n(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function d$n(t){if(Array.isArray(t))return SZ(t)}function SZ(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 m$n(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 v$n=function(e){return Array.isArray(e.value)?o$n(e.value):e.value};function _g(t){var e=t.valueAccessor,n=e===void 0?v$n:e,r=tCe(t,s$n),i=r.data,o=r.dataKey,s=r.clockWise,a=r.id,l=r.textBreakAll,c=tCe(r,a$n);return!i||!i.length?null:he.createElement(Vr,{className:"recharts-label-list"},i.map(function(u,f){var d=wn(o)?n(u,f):Da(u&&u.payload,o),h=wn(a)?{}:{id:"".concat(a,"-").concat(f)};return he.createElement(Vs,Uz({},pn(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Vs.parseViewBox(wn(s)?u:eCe(eCe({},u),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}_g.displayName="LabelList";function y$n(t,e){return t?t===!0?he.createElement(_g,{key:"labelList-implicit",data:e}):he.isValidElement(t)||mn(t)?he.createElement(_g,{key:"labelList-implicit",data:e,content:t}):rE(t)?he.createElement(_g,Uz({data:e},t,{key:"labelList-implicit"})):null:null}function x$n(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=vu(r,_g).map(function(s,a){return D.cloneElement(s,{data:e,key:"labelList-".concat(a)})});if(!n)return i;var o=y$n(t.label,e);return[o].concat(l$n(i))}_g.renderCallByParent=x$n;function UP(t){"@babel/helpers - typeof";return UP=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},UP(t)}function CZ(){return CZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"end"};var m=(l+c)/2,v=vs(s,a,m,d),y=v.x,x=v.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},JLn=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,s=n,a=s.x,l=s.y,c=s.width,u=s.height,f=u>=0?1:-1,d=f*i,h=f>0?"end":"start",p=f>0?"start":"end",g=c>=0?1:-1,m=g*i,v=g>0?"end":"start",y=g>0?"start":"end";if(o==="top"){var x={x:a+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return po(po({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var b={x:a+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:p};return po(po({},b),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var w={x:a-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return po(po({},w),r?{width:Math.max(w.x-r.x,0),height:u}:{})}if(o==="right"){var _={x:a+c+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return po(po({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:u}:{})}var S=r?{width:c,height:u}:{};return o==="insideLeft"?po({x:a+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},S):o==="insideRight"?po({x:a+c-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},S):o==="insideTop"?po({x:a+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},S):o==="insideBottom"?po({x:a+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},S):o==="insideTopLeft"?po({x:a+m,y:l+d,textAnchor:y,verticalAnchor:p},S):o==="insideTopRight"?po({x:a+c-m,y:l+d,textAnchor:v,verticalAnchor:p},S):o==="insideBottomLeft"?po({x:a+m,y:l+u-d,textAnchor:y,verticalAnchor:h},S):o==="insideBottomRight"?po({x:a+c-m,y:l+u-d,textAnchor:v,verticalAnchor:h},S):nE(o)&&(at(o.x)||_x(o.x))&&(at(o.y)||_x(o.y))?po({x:a+Bb(o.x,c),y:l+Bb(o.y,u),textAnchor:"end",verticalAnchor:"end"},S):po({x:a+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},S)},e$n=function(e){return"cx"in e&&at(e.cx)};function Vs(t){var e=t.offset,n=e===void 0?5:e,r=VLn(t,NLn),i=po({offset:n},r),o=i.viewBox,s=i.position,a=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,d=i.textBreakAll;if(!o||wn(a)&&wn(l)&&!D.isValidElement(c)&&!mn(c))return null;if(D.isValidElement(c))return D.cloneElement(c,i);var h;if(mn(c)){if(h=D.createElement(c,i),D.isValidElement(h))return h}else h=YLn(i);var p=e$n(o),g=pn(i,!0);if(p&&(s==="insideStart"||s==="insideEnd"||s==="end"))return KLn(i,h,g);var m=p?ZLn(i):JLn(i);return he.createElement($z,zP({className:Oe("recharts-label",f)},g,m,{breakAll:d}),h)}Vs.displayName="Label";var Qqe=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,s=e.endAngle,a=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,d=e.y,h=e.top,p=e.left,g=e.width,m=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if(at(g)&&at(m)){if(at(f)&&at(d))return{x:f,y:d,width:g,height:m};if(at(h)&&at(p))return{x:h,y:p,width:g,height:m}}return at(f)&&at(d)?{x:f,y:d,width:0,height:0}:at(n)&&at(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:s||i||0,innerRadius:c||0,outerRadius:u||l||a||0,clockWise:v}:e.viewBox?e.viewBox:{}},t$n=function(e,n){return e?e===!0?he.createElement(Vs,{key:"label-implicit",viewBox:n}):So(e)?he.createElement(Vs,{key:"label-implicit",viewBox:n,value:e}):D.isValidElement(e)?e.type===Vs?D.cloneElement(e,{key:"label-implicit",viewBox:n}):he.createElement(Vs,{key:"label-implicit",content:e,viewBox:n}):mn(e)?he.createElement(Vs,{key:"label-implicit",content:e,viewBox:n}):nE(e)?he.createElement(Vs,zP({viewBox:n},e,{key:"label-implicit"})):null:null},n$n=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=Qqe(e),s=vu(i,Vs).map(function(l,c){return D.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return s;var a=t$n(e.label,n||o);return[a].concat(zLn(s))};Vs.parseViewBox=Qqe;Vs.renderCallByParent=n$n;function r$n(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var i$n=r$n;const o$n=sn(i$n);function jP(t){"@babel/helpers - typeof";return jP=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},jP(t)}var s$n=["valueAccessor"],a$n=["data","dataKey","clockWise","id","textBreakAll"];function l$n(t){return d$n(t)||f$n(t)||u$n(t)||c$n()}function c$n(){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 u$n(t,e){if(t){if(typeof t=="string")return SZ(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 SZ(t,e)}}function f$n(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function d$n(t){if(Array.isArray(t))return SZ(t)}function SZ(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 m$n(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 v$n=function(e){return Array.isArray(e.value)?o$n(e.value):e.value};function _g(t){var e=t.valueAccessor,n=e===void 0?v$n:e,r=tCe(t,s$n),i=r.data,o=r.dataKey,s=r.clockWise,a=r.id,l=r.textBreakAll,c=tCe(r,a$n);return!i||!i.length?null:he.createElement(Vr,{className:"recharts-label-list"},i.map(function(u,f){var d=wn(o)?n(u,f):Da(u&&u.payload,o),h=wn(a)?{}:{id:"".concat(a,"-").concat(f)};return he.createElement(Vs,Uz({},pn(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Vs.parseViewBox(wn(s)?u:eCe(eCe({},u),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}_g.displayName="LabelList";function y$n(t,e){return t?t===!0?he.createElement(_g,{key:"labelList-implicit",data:e}):he.isValidElement(t)||mn(t)?he.createElement(_g,{key:"labelList-implicit",data:e,content:t}):nE(t)?he.createElement(_g,Uz({data:e},t,{key:"labelList-implicit"})):null:null}function x$n(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=vu(r,_g).map(function(s,a){return D.cloneElement(s,{data:e,key:"labelList-".concat(a)})});if(!n)return i;var o=y$n(t.label,e);return[o].concat(l$n(i))}_g.renderCallByParent=x$n;function BP(t){"@babel/helpers - typeof";return BP=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},BP(t)}function CZ(){return CZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(s>c),`, `).concat(f.x,",").concat(f.y,` @@ -604,14 +604,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `);if(i>0){var _=JL({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),S=_.circleTangency,O=_.lineTangency,k=_.theta,E=JL({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),P=E.circleTangency,A=E.lineTangency,R=E.theta,T=l?Math.abs(c-u):Math.abs(c-u)-k-R;if(T<0&&s===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(A.x,",").concat(A.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,` A`).concat(i,",").concat(i,",0,").concat(+(T>180),",").concat(+(f>0),",").concat(S.x,",").concat(S.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(O.x,",").concat(O.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},O$n={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Zqe=function(e){var n=rCe(rCe({},O$n),e),r=n.cx,i=n.cy,o=n.innerRadius,s=n.outerRadius,a=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(s0&&Math.abs(u-f)<360?m=C$n({cx:r,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(g,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=Kqe({cx:r,cy:i,innerRadius:o,outerRadius:s,startAngle:u,endAngle:f}),he.createElement("path",CZ({},pn(n,!0),{className:h,d:m,role:"img"}))};function WP(t){"@babel/helpers - typeof";return WP=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},WP(t)}function OZ(){return OZ=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 L$n(t,e){return gE(t.getTime(),e.getTime())}function fCe(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),o=0,s,a;(s=i.next())&&!s.done;){for(var l=e.entries(),c=!1,u=0;(a=l.next())&&!a.done;){var f=s.value,d=f[0],h=f[1],p=a.value,g=p[0],m=p[1];!c&&!r[u]&&(c=n.equals(d,g,o,u,t,e,n)&&n.equals(h,m,d,g,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;o++}return!0}function $$n(t,e,n){var r=uCe(t),i=r.length;if(uCe(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===eXe&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Jqe(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function I2(t,e,n){var r=lCe(t),i=r.length;if(lCe(e).length!==i)return!1;for(var o,s,a;i-- >0;)if(o=r[i],o===eXe&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Jqe(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(s=cCe(t,o),a=cCe(e,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function F$n(t,e){return gE(t.valueOf(),e.valueOf())}function N$n(t,e){return t.source===e.source&&t.flags===e.flags}function dCe(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),o,s;(o=i.next())&&!o.done;){for(var a=e.values(),l=!1,c=0;(s=a.next())&&!s.done;)!l&&!r[c]&&(l=n.equals(o.value,s.value,o.value,s.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function z$n(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 j$n="[object Arguments]",B$n="[object Boolean]",U$n="[object Date]",W$n="[object Map]",V$n="[object Number]",G$n="[object Object]",H$n="[object RegExp]",q$n="[object Set]",X$n="[object String]",Y$n=Array.isArray,hCe=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,pCe=Object.assign,Q$n=Object.prototype.toString.call.bind(Object.prototype.toString);function K$n(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,s=t.areRegExpsEqual,a=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(Y$n(u))return e(u,f,d);if(hCe!=null&&hCe(u))return l(u,f,d);if(h===Date)return n(u,f,d);if(h===RegExp)return s(u,f,d);if(h===Map)return r(u,f,d);if(h===Set)return a(u,f,d);var p=Q$n(u);return p===U$n?n(u,f,d):p===H$n?s(u,f,d):p===W$n?r(u,f,d):p===q$n?a(u,f,d):p===G$n?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,d):p===j$n?i(u,f,d):p===B$n||p===V$n||p===X$n?o(u,f,d):!1}}function Z$n(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?I2:I$n,areDatesEqual:L$n,areMapsEqual:r?aCe(fCe,I2):fCe,areObjectsEqual:r?I2:$$n,arePrimitiveWrappersEqual:F$n,areRegExpsEqual:N$n,areSetsEqual:r?aCe(dCe,I2):dCe,areTypedArraysEqual:r?I2:z$n};if(n&&(i=pCe({},i,n(i))),e){var o=t$(i.areArraysEqual),s=t$(i.areMapsEqual),a=t$(i.areObjectsEqual),l=t$(i.areSetsEqual);i=pCe({},i,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:l})}return i}function J$n(t){return function(e,n,r,i,o,s,a){return t(e,n,a)}}function e3n(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 s={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,s)}}var t3n=c0();c0({strict:!0});c0({circular:!0});c0({circular:!0,strict:!0});c0({createInternalComparator:function(){return gE}});c0({strict:!0,createInternalComparator:function(){return gE}});c0({circular:!0,createInternalComparator:function(){return gE}});c0({circular:!0,createInternalComparator:function(){return gE},strict:!0});function c0(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,s=o===void 0?!1:o,a=Z$n(t),l=K$n(a),c=r?r(l):J$n(l);return e3n({circular:n,comparator:l,createState:i,equals:c,strict:s})}function n3n(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function gCe(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):n3n(i)};requestAnimationFrame(r)}function EZ(t){"@babel/helpers - typeof";return EZ=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},EZ(t)}function r3n(t){return a3n(t)||s3n(t)||o3n(t)||i3n()}function i3n(){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 o3n(t,e){if(t){if(typeof t=="string")return mCe(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 mCe(t,e)}}function mCe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&Math.abs(u-f)<360?m=C$n({cx:r,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(g,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=Kqe({cx:r,cy:i,innerRadius:o,outerRadius:s,startAngle:u,endAngle:f}),he.createElement("path",CZ({},pn(n,!0),{className:h,d:m,role:"img"}))};function UP(t){"@babel/helpers - typeof";return UP=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},UP(t)}function OZ(){return OZ=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 L$n(t,e){return pE(t.getTime(),e.getTime())}function fCe(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),o=0,s,a;(s=i.next())&&!s.done;){for(var l=e.entries(),c=!1,u=0;(a=l.next())&&!a.done;){var f=s.value,d=f[0],h=f[1],p=a.value,g=p[0],m=p[1];!c&&!r[u]&&(c=n.equals(d,g,o,u,t,e,n)&&n.equals(h,m,d,g,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;o++}return!0}function $$n(t,e,n){var r=uCe(t),i=r.length;if(uCe(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===eXe&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Jqe(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function D2(t,e,n){var r=lCe(t),i=r.length;if(lCe(e).length!==i)return!1;for(var o,s,a;i-- >0;)if(o=r[i],o===eXe&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Jqe(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(s=cCe(t,o),a=cCe(e,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function F$n(t,e){return pE(t.valueOf(),e.valueOf())}function N$n(t,e){return t.source===e.source&&t.flags===e.flags}function dCe(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),o,s;(o=i.next())&&!o.done;){for(var a=e.values(),l=!1,c=0;(s=a.next())&&!s.done;)!l&&!r[c]&&(l=n.equals(o.value,s.value,o.value,s.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function z$n(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 j$n="[object Arguments]",B$n="[object Boolean]",U$n="[object Date]",W$n="[object Map]",V$n="[object Number]",G$n="[object Object]",H$n="[object RegExp]",q$n="[object Set]",X$n="[object String]",Y$n=Array.isArray,hCe=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,pCe=Object.assign,Q$n=Object.prototype.toString.call.bind(Object.prototype.toString);function K$n(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,s=t.areRegExpsEqual,a=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(Y$n(u))return e(u,f,d);if(hCe!=null&&hCe(u))return l(u,f,d);if(h===Date)return n(u,f,d);if(h===RegExp)return s(u,f,d);if(h===Map)return r(u,f,d);if(h===Set)return a(u,f,d);var p=Q$n(u);return p===U$n?n(u,f,d):p===H$n?s(u,f,d):p===W$n?r(u,f,d):p===q$n?a(u,f,d):p===G$n?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,d):p===j$n?i(u,f,d):p===B$n||p===V$n||p===X$n?o(u,f,d):!1}}function Z$n(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?D2:I$n,areDatesEqual:L$n,areMapsEqual:r?aCe(fCe,D2):fCe,areObjectsEqual:r?D2:$$n,arePrimitiveWrappersEqual:F$n,areRegExpsEqual:N$n,areSetsEqual:r?aCe(dCe,D2):dCe,areTypedArraysEqual:r?D2:z$n};if(n&&(i=pCe({},i,n(i))),e){var o=t$(i.areArraysEqual),s=t$(i.areMapsEqual),a=t$(i.areObjectsEqual),l=t$(i.areSetsEqual);i=pCe({},i,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:l})}return i}function J$n(t){return function(e,n,r,i,o,s,a){return t(e,n,a)}}function e3n(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 s={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,s)}}var t3n=c0();c0({strict:!0});c0({circular:!0});c0({circular:!0,strict:!0});c0({createInternalComparator:function(){return pE}});c0({strict:!0,createInternalComparator:function(){return pE}});c0({circular:!0,createInternalComparator:function(){return pE}});c0({circular:!0,createInternalComparator:function(){return pE},strict:!0});function c0(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,s=o===void 0?!1:o,a=Z$n(t),l=K$n(a),c=r?r(l):J$n(l);return e3n({circular:n,comparator:l,createState:i,equals:c,strict:s})}function n3n(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function gCe(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):n3n(i)};requestAnimationFrame(r)}function EZ(t){"@babel/helpers - typeof";return EZ=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},EZ(t)}function r3n(t){return a3n(t)||s3n(t)||o3n(t)||i3n()}function i3n(){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 o3n(t,e){if(t){if(typeof t=="string")return mCe(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 mCe(t,e)}}function mCe(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},g=function(v){for(var y=v>1?1:v,x=y,b=0;b<8;++b){var w=f(x)-y,_=h(x);if(Math.abs(w-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,s=e.dt,a=s===void 0?17:s,l=function(u,f,d){var h=-(u-f)*r,p=d*o,g=d+(h-p)*a/1e3,m=d*a/1e3+u;return Math.abs(m-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 N3n(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 q7(t){return U3n(t)||B3n(t)||j3n(t)||z3n()}function z3n(){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 j3n(t,e){if(t){if(typeof t=="string")return MZ(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 MZ(t,e)}}function B3n(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function U3n(t){if(Array.isArray(t))return MZ(t)}function MZ(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 Gz(t){return Gz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gz(t)}var zh=function(t){q3n(n,t);var e=X3n(n);function n(r,i){var o;W3n(this,n),o=e.call(this,r,i);var s=o.props,a=s.isActive,l=s.attributeName,c=s.from,u=s.to,f=s.steps,d=s.children,h=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(IZ(o)),o.changeStyle=o.changeStyle.bind(IZ(o)),!a||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),DZ(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},DZ(o);o.state={style:l?LT({},l,c):c}}else o.state={style:{}};return o}return G3n(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,a=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,f=o.from,d=this.state.style;if(a){if(!s){var h={style:l?LT({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(t3n(i.to,u)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=p||c?f:i.to;if(this.state&&d){var m={style:l?LT({},l,g):g};(l&&d[l]!==g||!l&&d!==g)&&this.setState(m)}this.runAnimation(Qu(Qu({},this.props),{},{from:g,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,s=i.from,a=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=L3n(s,a,C3n(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,s=i.steps,a=i.begin,l=i.onAnimationStart,c=s[0],u=c.style,f=c.duration,d=f===void 0?0:f,h=function(g,m,v){if(v===0)return g;var y=m.duration,x=m.easing,b=x===void 0?"ease":x,w=m.style,_=m.properties,S=m.onAnimationEnd,O=v>0?s[v-1]:m,k=_||Object.keys(w);if(typeof b=="function"||b==="spring")return[].concat(q7(g),[o.runJSAnimation.bind(o,{from:O.style,to:w,duration:y,easing:b}),y]);var E=xCe(k,y,b),P=Qu(Qu(Qu({},O.style),w),{},{transition:E});return[].concat(q7(g),[P,y,S]).filter(d3n)};return this.manager.start([l].concat(q7(s.reduce(h,[u,Math.max(d,a)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=l3n());var o=i.begin,s=i.duration,a=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 g=a?LT({},a,l):l,m=xCe(Object.keys(g),s,c);p.start([u,o,Qu(Qu({},g),{},{transition:m}),s,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var a=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=F3n(i,$3n),c=D.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!a||c===0||s<=0)return o;var f=function(h){var p=h.props,g=p.style,m=g===void 0?{}:g,v=p.className,y=D.cloneElement(h,Qu(Qu({},l),{},{style:Qu(Qu({},m),u),className:v}));return y};return c===1?f(D.Children.only(o)):he.createElement("div",null,D.Children.map(o,function(d){return f(d)}))}}]),n}(D.PureComponent);zh.displayName="Animate";zh.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};zh.propTypes={from:ge.oneOfType([ge.object,ge.string]),to:ge.oneOfType([ge.object,ge.string]),attributeName:ge.string,duration:ge.number,begin:ge.number,easing:ge.oneOfType([ge.string,ge.func]),steps:ge.arrayOf(ge.shape({duration:ge.number.isRequired,style:ge.object.isRequired,easing:ge.oneOfType([ge.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ge.func]),properties:ge.arrayOf("string"),onAnimationEnd:ge.func})),children:ge.oneOfType([ge.node,ge.func]),isActive:ge.bool,canBegin:ge.bool,onAnimationEnd:ge.func,shouldReAnimate:ge.bool,onAnimationStart:ge.func,onAnimationReStart:ge.func};ge.object,ge.object,ge.object,ge.element;ge.object,ge.object,ge.object,ge.oneOfType([ge.array,ge.element]),ge.any;function HP(t){"@babel/helpers - typeof";return HP=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},HP(t)}function Hz(){return Hz=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(s>0&&o instanceof Array){for(var f=[0,0,0,0],d=0,h=4;ds?s:o[d];u="M".concat(e,",").concat(n+a*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,`, +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nXe(t,e){if(t){if(typeof t=="string")return TZ(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 TZ(t,e)}}function b3n(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function w3n(t){if(Array.isArray(t))return TZ(t)}function TZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:v<0?0:v},g=function(v){for(var y=v>1?1:v,x=y,b=0;b<8;++b){var w=f(x)-y,_=h(x);if(Math.abs(w-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,s=e.dt,a=s===void 0?17:s,l=function(u,f,d){var h=-(u-f)*r,p=d*o,g=d+(h-p)*a/1e3,m=d*a/1e3+u;return Math.abs(m-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 N3n(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 q7(t){return U3n(t)||B3n(t)||j3n(t)||z3n()}function z3n(){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 j3n(t,e){if(t){if(typeof t=="string")return MZ(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 MZ(t,e)}}function B3n(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function U3n(t){if(Array.isArray(t))return MZ(t)}function MZ(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 Gz(t){return Gz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gz(t)}var zh=function(t){q3n(n,t);var e=X3n(n);function n(r,i){var o;W3n(this,n),o=e.call(this,r,i);var s=o.props,a=s.isActive,l=s.attributeName,c=s.from,u=s.to,f=s.steps,d=s.children,h=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(IZ(o)),o.changeStyle=o.changeStyle.bind(IZ(o)),!a||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),DZ(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},DZ(o);o.state={style:l?IT({},l,c):c}}else o.state={style:{}};return o}return G3n(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,a=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,f=o.from,d=this.state.style;if(a){if(!s){var h={style:l?IT({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(t3n(i.to,u)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=p||c?f:i.to;if(this.state&&d){var m={style:l?IT({},l,g):g};(l&&d[l]!==g||!l&&d!==g)&&this.setState(m)}this.runAnimation(Qu(Qu({},this.props),{},{from:g,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,s=i.from,a=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=L3n(s,a,C3n(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,s=i.steps,a=i.begin,l=i.onAnimationStart,c=s[0],u=c.style,f=c.duration,d=f===void 0?0:f,h=function(g,m,v){if(v===0)return g;var y=m.duration,x=m.easing,b=x===void 0?"ease":x,w=m.style,_=m.properties,S=m.onAnimationEnd,O=v>0?s[v-1]:m,k=_||Object.keys(w);if(typeof b=="function"||b==="spring")return[].concat(q7(g),[o.runJSAnimation.bind(o,{from:O.style,to:w,duration:y,easing:b}),y]);var E=xCe(k,y,b),P=Qu(Qu(Qu({},O.style),w),{},{transition:E});return[].concat(q7(g),[P,y,S]).filter(d3n)};return this.manager.start([l].concat(q7(s.reduce(h,[u,Math.max(d,a)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=l3n());var o=i.begin,s=i.duration,a=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 g=a?IT({},a,l):l,m=xCe(Object.keys(g),s,c);p.start([u,o,Qu(Qu({},g),{},{transition:m}),s,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var a=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=F3n(i,$3n),c=D.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!a||c===0||s<=0)return o;var f=function(h){var p=h.props,g=p.style,m=g===void 0?{}:g,v=p.className,y=D.cloneElement(h,Qu(Qu({},l),{},{style:Qu(Qu({},m),u),className:v}));return y};return c===1?f(D.Children.only(o)):he.createElement("div",null,D.Children.map(o,function(d){return f(d)}))}}]),n}(D.PureComponent);zh.displayName="Animate";zh.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};zh.propTypes={from:ge.oneOfType([ge.object,ge.string]),to:ge.oneOfType([ge.object,ge.string]),attributeName:ge.string,duration:ge.number,begin:ge.number,easing:ge.oneOfType([ge.string,ge.func]),steps:ge.arrayOf(ge.shape({duration:ge.number.isRequired,style:ge.object.isRequired,easing:ge.oneOfType([ge.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ge.func]),properties:ge.arrayOf("string"),onAnimationEnd:ge.func})),children:ge.oneOfType([ge.node,ge.func]),isActive:ge.bool,canBegin:ge.bool,onAnimationEnd:ge.func,shouldReAnimate:ge.bool,onAnimationStart:ge.func,onAnimationReStart:ge.func};ge.object,ge.object,ge.object,ge.element;ge.object,ge.object,ge.object,ge.oneOfType([ge.array,ge.element]),ge.any;function GP(t){"@babel/helpers - typeof";return GP=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},GP(t)}function Hz(){return Hz=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(s>0&&o instanceof Array){for(var f=[0,0,0,0],d=0,h=4;ds?s:o[d];u="M".concat(e,",").concat(n+a*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+a*f[1])),u+="L ".concat(e+r,",").concat(n+i-a*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-a*f[3])),u+="Z"}else if(s>0&&o===+o&&o>0){var p=Math.min(s,o);u="M ".concat(e,",").concat(n+a*p,` @@ -621,18 +621,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(e+r,",").concat(n+i-a*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-a*p," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},iFn=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,s=n.y,a=n.width,l=n.height;if(Math.abs(a)>0&&Math.abs(l)>0){var c=Math.min(o,o+a),u=Math.max(o,o+a),f=Math.min(s,s+l),d=Math.max(s,s+l);return r>=c&&r<=u&&i>=f&&i<=d}return!1},oFn={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Qce=function(e){var n=TCe(TCe({},oFn),e),r=D.useRef(),i=D.useState(-1),o=Q3n(i,2),s=o[0],a=o[1];D.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&a(b)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,h=n.className,p=n.animationEasing,g=n.animationDuration,m=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=Oe("recharts-rectangle",h);return y?he.createElement(zh,{canBegin:s>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:g,animationEasing:p,isActive:y},function(b){var w=b.width,_=b.height,S=b.x,O=b.y;return he.createElement(zh,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,isActive:v,easing:p},he.createElement("path",Hz({},pn(n,!0),{className:x,d:kCe(S,O,w,_,d),ref:r})))}):he.createElement("path",Hz({},pn(n,!0),{className:x,d:kCe(l,c,u,f,d)}))};function LZ(){return LZ=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 dFn(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 hFn=function(e,n,r,i,o,s){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},pFn=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,s=e.top,a=s===void 0?0:s,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,g=fFn(e,sFn),m=aFn({x:r,y:o,top:a,left:c,width:f,height:h},g);return!at(r)||!at(o)||!at(f)||!at(h)||!at(a)||!at(c)?null:he.createElement("path",$Z({},pn(m,!0),{className:Oe("recharts-cross",p),d:hFn(r,o,f,h,a,c)}))},gFn=nqe,mFn=gFn(Object.getPrototypeOf,Object),vFn=mFn,yFn=im,xFn=vFn,bFn=om,wFn="[object Object]",_Fn=Function.prototype,SFn=Object.prototype,aXe=_Fn.toString,CFn=SFn.hasOwnProperty,OFn=aXe.call(Object);function EFn(t){if(!bFn(t)||yFn(t)!=wFn)return!1;var e=xFn(t);if(e===null)return!0;var n=CFn.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&aXe.call(n)==OFn}var TFn=EFn;const kFn=sn(TFn);var AFn=im,PFn=om,MFn="[object Boolean]";function RFn(t){return t===!0||t===!1||PFn(t)&&AFn(t)==MFn}var DFn=RFn;const IFn=sn(DFn);function XP(t){"@babel/helpers - typeof";return XP=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},XP(t)}function qz(){return qz=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:g,animationEasing:p,isActive:v},function(x){var b=x.upperWidth,w=x.lowerWidth,_=x.height,S=x.x,O=x.y;return he.createElement(zh,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,easing:p},he.createElement("path",qz({},pn(n,!0),{className:y,d:DCe(S,O,b,w,_),ref:r})))}):he.createElement("g",null,he.createElement("path",qz({},pn(n,!0),{className:y,d:DCe(l,c,u,f,d)})))},GFn=["option","shapeType","propTransformer","activeClassName","isActive"];function YP(t){"@babel/helpers - typeof";return YP=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},YP(t)}function HFn(t,e){if(t==null)return{};var n=qFn(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 qFn(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 ICe(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 Xz(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),Gl(Cd(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,a=i.startIndex;s==null||s({endIndex:o,startIndex:a})}),r.detachDragEndListener()}),Gl(Cd(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Gl(Cd(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Gl(Cd(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Gl(Cd(r),"handleSlideDragStart",function(i){var o=BCe(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(Cd(r),"startX"),endX:r.handleTravellerDragStart.bind(Cd(r),"endX")},r.state={},r}return TNn(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,s=this.state.scaleValues,a=this.props,l=a.gap,c=a.data,u=c.length-1,f=Math.min(i,o),d=Math.max(i,o),h=e.getIndexInRange(s,f),p=e.getIndexInRange(s,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,s=i.tickFormatter,a=i.dataKey,l=Da(o[r],a,r);return mn(s)?s(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,s=i.startX,a=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,p=l.onChange,g=r.pageX-o;g>0?g=Math.min(g,c+u-f-a,c+u-f-s):g<0&&(g=Math.max(g,c-s,c-a));var m=this.getIndex({startX:s+g,endX:a+g});(m.startIndex!==d||m.endIndex!==h)&&p&&p(m),this.setState({startX:s+g,endX:a+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=BCe(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,s=i.movingTravellerId,a=i.endX,l=i.startX,c=this.state[s],u=this.props,f=u.x,d=u.width,h=u.travellerWidth,p=u.onChange,g=u.gap,m=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[s]=c+y;var x=this.getIndex(v),b=x.startIndex,w=x.endIndex,_=function(){var O=m.length-1;return s==="startX"&&(a>l?b%g===0:w%g===0)||al?w%g===0:b%g===0)||a>l&&w===O};this.setState(Gl(Gl({},s,c+y),"brushMoveStartX",r.pageX),function(){p&&_()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,a=s.scaleValues,l=s.startX,c=s.endX,u=this.state[i],f=a.indexOf(u);if(f!==-1){var d=f+r;if(!(d===-1||d>=a.length)){var h=a[d];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(Gl({},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,s=r.width,a=r.height,l=r.fill,c=r.stroke;return he.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:s,height:a})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.data,c=r.children,u=r.padding,f=D.Children.only(c);return f?he.cloneElement(f,{x:i,y:o,width:s,height:a,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,a=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,p=l.data,g=l.startIndex,m=l.endIndex,v=Math.max(r,this.props.x),y=Y7(Y7({},pn(this.props,!1)),{},{x:v,y:c,width:u,height:f}),x=h||"Min value: ".concat((o=p[g])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=p[m])===null||s===void 0?void 0:s.name);return he.createElement(Vr,{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(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),a.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(d,y))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,a=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return he.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:s,width:f,height:a})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,a=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 he.createElement(Vr,{className:"recharts-brush-texts"},he.createElement($z,Qz({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:s+a/2},p),this.getTextOfTick(i)),he.createElement($z,Qz({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:s+a/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,a=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,d=this.state,h=d.startX,p=d.endX,g=d.isTextActive,m=d.isSlideMoving,v=d.isTravellerMoving,y=d.isTravellerFocused;if(!i||!i.length||!at(a)||!at(l)||!at(c)||!at(u)||c<=0||u<=0)return null;var x=Oe("recharts-brush",o),b=he.Children.count(s)===1,w=ONn("userSelect","none");return he.createElement(Vr,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(g||m||v||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,a=r.height,l=r.stroke,c=Math.floor(o+a/2)-1;return he.createElement(he.Fragment,null,he.createElement("rect",{x:i,y:o,width:s,height:a,fill:l,stroke:"none"}),he.createElement("line",{x1:i+1,y1:c,x2:i+s-1,y2:c,fill:"none",stroke:"#fff"}),he.createElement("line",{x1:i+1,y1:c+2,x2:i+s-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return he.isValidElement(r)?o=he.cloneElement(r,i):mn(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,a=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return Y7({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s},o&&o.length?RNn({data:o,width:s,x:a,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||a!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([a,a+s-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s,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,s=0,a=o-1;a-s>1;){var l=Math.floor((s+a)/2);r[l]>i?a=l:s=l}return i>=r[a]?a:s}}]),e}(D.PureComponent);Gl(Vb,"displayName","Brush");Gl(Vb,"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 DNn=Vce;function INn(t,e){var n;return DNn(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var LNn=INn,$Nn=XHe,FNn=l0,NNn=LNn,zNn=Rl,jNn=QU;function BNn(t,e,n){var r=zNn(t)?$Nn:NNn;return n&&jNn(t,e,n)&&(e=void 0),r(t,FNn(e))}var UNn=BNn;const WNn=sn(UNn);var Ch=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},UCe=vqe;function VNn(t,e,n){e=="__proto__"&&UCe?UCe(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var GNn=VNn,HNn=GNn,qNn=gqe,XNn=l0;function YNn(t,e){var n={};return e=XNn(e),qNn(t,function(r,i,o){HNn(n,i,e(r,i,o))}),n}var QNn=YNn;const KNn=sn(QNn);function ZNn(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 g5n(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 m5n(t,e){var n=t.x,r=t.y,i=p5n(t,u5n),o="".concat(n),s=parseInt(o,10),a="".concat(r),l=parseInt(a,10),c="".concat(e.height||i.height),u=parseInt(c,10),f="".concat(e.width||i.width),d=parseInt(f,10);return L2(L2(L2(L2(L2({},e),i),s?{x:s}:{}),l?{y:l}:{}),{},{height:u,width:d,name:e.name,radius:e.radius})}function VCe(t){return he.createElement(eNn,NZ({shapeType:"rectangle",propTransformer:m5n,activeClassName:"recharts-active-bar"},t))}var v5n=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||Wb(),n)}},y5n=["value","background"],hXe;function FC(t){"@babel/helpers - typeof";return FC=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},FC(t)}function x5n(t,e){if(t==null)return{};var n=b5n(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 b5n(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 Zz(){return Zz=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(T)0&&Math.abs(R)0&&(R=Math.min((X||0)-(T[V-1]||0),R))}),Number.isFinite(R)){var M=R/A,I=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(S=M*I/2),g.padding==="no-gap"){var z=Bb(e.barCategoryGap,M*I),F=M*I/2;S=F-z-(F-z)/I*z}}}i==="xAxis"?O=[r.left+(x.left||0)+(S||0),r.left+r.width-(x.right||0)-(S||0)]:i==="yAxis"?O=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(S||0),r.top+r.height-(x.bottom||0)-(S||0)]:O=g.range,w&&(O=[O[1],O[0]]);var N=vLn(g,o,d),L=N.scale,B=N.realScaleType;L.domain(v).range(O),yLn(L);var $=ELn(L,pf(pf({},g),{},{realScaleType:B}));i==="xAxis"?(P=m==="top"&&!b||m==="bottom"&&b,k=r.left,E=f[_]-P*g.height):i==="yAxis"&&(P=m==="left"&&!b||m==="right"&&b,k=f[_]-P*g.width,E=r.top);var j=pf(pf(pf({},g),$),{},{realScaleType:B,x:k,y:E,scale:L,width:i==="xAxis"?r.width:g.width,height:i==="yAxis"?r.height:g.height});return j.bandSize=jz(j,$),!g.hide&&i==="xAxis"?f[_]+=(P?-1:1)*j.height:g.hide||(f[_]+=(P?-1:1)*j.width),pf(pf({},h),{},r8({},p,j))},{})},vXe=function(e,n){var r=e.x,i=e.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},P5n=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return vXe({x:n,y:r},{x:i,y:o})},yXe=function(){function t(e){T5n(this,t),this.scale=e}return k5n(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 s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(n)+a}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}();r8(yXe,"EPS",1e-4);var Zce=function(e){var n=Object.keys(e).reduce(function(r,i){return pf(pf({},r),{},r8({},i,yXe.create(e[i])))},{});return pf(pf({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,a=o.position;return KNn(i,function(l,c){return n[c].apply(l,{bandAware:s,position:a})})},isInRange:function(i){return dXe(i,function(o,s){return n[s].isInRange(o)})}})};function M5n(t){return(t%180+180)%180}var R5n=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=M5n(i),s=o*Math.PI/180,a=Math.atan(r/n),l=s>a&&s-1?i[o?e[s]:s]:void 0}}var F5n=$5n,N5n=lXe;function z5n(t){var e=N5n(t),n=e%1;return e===e?n?e-n:e:0}var j5n=z5n,B5n=lqe,U5n=l0,W5n=j5n,V5n=Math.max;function G5n(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:W5n(n);return i<0&&(i=V5n(r+i,0)),B5n(t,U5n(e),i)}var H5n=G5n,q5n=F5n,X5n=H5n,Y5n=q5n(X5n),Q5n=Y5n;const K5n=sn(Q5n);var Z5n=_Sn(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("")}),Jce=D.createContext(void 0),eue=D.createContext(void 0),xXe=D.createContext(void 0),bXe=D.createContext({}),wXe=D.createContext(void 0),_Xe=D.createContext(0),SXe=D.createContext(0),YCe=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=e.clipPathId,a=e.children,l=e.width,c=e.height,u=Z5n(o);return he.createElement(Jce.Provider,{value:r},he.createElement(eue.Provider,{value:i},he.createElement(bXe.Provider,{value:o},he.createElement(xXe.Provider,{value:u},he.createElement(wXe.Provider,{value:s},he.createElement(_Xe.Provider,{value:c},he.createElement(SXe.Provider,{value:l},a)))))))},J5n=function(){return D.useContext(wXe)},CXe=function(e){var n=D.useContext(Jce);n==null&&Wb();var r=n[e];return r==null&&Wb(),r},ezn=function(){var e=D.useContext(Jce);return sv(e)},tzn=function(){var e=D.useContext(eue),n=K5n(e,function(r){return dXe(r.domain,Number.isFinite)});return n||sv(e)},OXe=function(e){var n=D.useContext(eue);n==null&&Wb();var r=n[e];return r==null&&Wb(),r},nzn=function(){var e=D.useContext(xXe);return e},rzn=function(){return D.useContext(bXe)},tue=function(){return D.useContext(SXe)},nue=function(){return D.useContext(_Xe)};function eM(t){"@babel/helpers - typeof";return eM=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},eM(t)}function QCe(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 KCe(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 Czn(t,e){return EXe(t,e+1)}function Ozn(t,e,n,r,i){for(var o=(r||[]).slice(),s=e.start,a=e.end,l=0,c=1,u=s,f=function(){var p=r==null?void 0:r[l];if(p===void 0)return{v:EXe(r,c)};var g=l,m,v=function(){return m===void 0&&(m=n(p,g)),m},y=p.coordinate,x=l===0||ej(t,y,v,u,a);x||(l=0,u=s,c+=1),x&&(u=y+t*(v()/2+i),l+=c)},d;c<=o.length;)if(d=f(),d)return d.v;return[]}function rM(t){"@babel/helpers - typeof";return rM=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},rM(t)}function rOe(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 zs(t){for(var e=1;e0?h.coordinate-m*t:h.coordinate})}else o[d]=h=zs(zs({},h),{},{tickCoord:h.coordinate});var v=ej(t,h.tickCoord,g,a,l);v&&(l=h.tickCoord-t*(g()/2+i),o[d]=zs(zs({},h),{},{isShow:!0}))},u=s-1;u>=0;u--)c(u);return o}function Pzn(t,e,n,r,i,o){var s=(r||[]).slice(),a=s.length,l=e.start,c=e.end;if(o){var u=r[a-1],f=n(u,a-1),d=t*(u.coordinate+t*f/2-c);s[a-1]=u=zs(zs({},u),{},{tickCoord:d>0?u.coordinate-d*t:u.coordinate});var h=ej(t,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-t*(f/2+i),s[a-1]=zs(zs({},u),{},{isShow:!0}))}for(var p=o?a-1:a,g=function(y){var x=s[y],b,w=function(){return b===void 0&&(b=n(x,y)),b};if(y===0){var _=t*(x.coordinate-t*w()/2-l);s[y]=x=zs(zs({},x),{},{tickCoord:_<0?x.coordinate-_*t:x.coordinate})}else s[y]=x=zs(zs({},x),{},{tickCoord:x.coordinate});var S=ej(t,x.tickCoord,w,l,c);S&&(l=x.tickCoord+t*(w()/2+i),s[y]=zs(zs({},x),{},{isShow:!0}))},m=0;m=2?Af(i[1].coordinate-i[0].coordinate):1,v=Szn(o,m,h);return l==="equidistantPreserveStart"?Ozn(m,v,g,i,s):(l==="preserveStart"||l==="preserveStartEnd"?d=Pzn(m,v,g,i,s,l==="preserveStartEnd"):d=Azn(m,v,g,i,s),d.filter(function(y){return y.isShow}))}var Mzn=["viewBox"],Rzn=["viewBox"],Dzn=["ticks"];function NC(t){"@babel/helpers - typeof";return NC=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},NC(t)}function C_(){return C_=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 Izn(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 Lzn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oOe(t,e){for(var n=0;n0?l(this.props):l(h)),s<=0||a<=0||!p||!p.length?null:he.createElement(Vr,{className:Oe("recharts-cartesian-axis",c),ref:function(m){r.layerReference=m}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Vs.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s;return he.isValidElement(r)?s=he.cloneElement(r,i):mn(r)?s=r(i):s=he.createElement($z,C_({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}]),e}(D.Component);iue(mE,"displayName","CartesianAxis");iue(mE,"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 Uzn=["x1","y1","x2","y2","key"],Wzn=["offset"];function Gb(t){"@babel/helpers - typeof";return Gb=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},Gb(t)}function sOe(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 Gs(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function qzn(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 Xzn=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,o=e.y,s=e.width,a=e.height;return he.createElement("rect",{x:i,y:o,width:s,height:a,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function AXe(t,e){var n;if(he.isValidElement(t))n=he.cloneElement(t,e);else if(mn(t))n=t(e);else{var r=e.x1,i=e.y1,o=e.x2,s=e.y2,a=e.key,l=aOe(e,Uzn),c=pn(l,!1);c.offset;var u=aOe(c,Wzn);n=he.createElement("line",Sx({},u,{x1:r,y1:i,x2:o,y2:s,fill:"none",key:a}))}return n}function Yzn(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 s=o.map(function(a,l){var c=Gs(Gs({},t),{},{x1:e,y1:a,x2:e+n,y2:a,key:"line-".concat(l),index:l});return AXe(i,c)});return he.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Qzn(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 s=o.map(function(a,l){var c=Gs(Gs({},t),{},{x1:a,y1:e,x2:a,y2:e+n,key:"line-".concat(l),index:l});return AXe(i,c)});return he.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function Kzn(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,o=t.width,s=t.height,a=t.horizontalPoints,l=t.horizontal,c=l===void 0?!0:l;if(!c||!e||!e.length)return null;var u=a.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],g=p?i+s-d:u[h+1]-d;if(g<=0)return null;var m=h%e.length;return he.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:g,width:o,stroke:"none",fill:e[m],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return he.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Zzn(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,o=t.x,s=t.y,a=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],g=p?o+a-d:u[h+1]-d;if(g<=0)return null;var m=h%r.length;return he.createElement("rect",{key:"react-".concat(h),x:d,y:s,width:g,height:l,stroke:"none",fill:r[m],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return he.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Jzn=function(e,n){var r=e.xAxis,i=e.width,o=e.height,s=e.offset;return qqe(rue(Gs(Gs(Gs({},mE.defaultProps),r),{},{ticks:ng(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,n)},ejn=function(e,n){var r=e.yAxis,i=e.width,o=e.height,s=e.offset;return qqe(rue(Gs(Gs(Gs({},mE.defaultProps),r),{},{ticks:ng(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,n)},gw={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function oue(t){var e,n,r,i,o,s,a=tue(),l=nue(),c=rzn(),u=Gs(Gs({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:gw.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:gw.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:gw.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:gw.horizontalFill,vertical:(o=t.vertical)!==null&&o!==void 0?o:gw.vertical,verticalFill:(s=t.verticalFill)!==null&&s!==void 0?s:gw.verticalFill,x:at(t.x)?t.x:c.left,y:at(t.y)?t.y:c.top,width:at(t.width)?t.width:c.width,height:at(t.height)?t.height:c.height}),f=u.x,d=u.y,h=u.width,p=u.height,g=u.syncWithTicks,m=u.horizontalValues,v=u.verticalValues,y=ezn(),x=tzn();if(!at(h)||h<=0||!at(p)||p<=0||!at(f)||f!==+f||!at(d)||d!==+d)return null;var b=u.verticalCoordinatesGenerator||Jzn,w=u.horizontalCoordinatesGenerator||ejn,_=u.horizontalPoints,S=u.verticalPoints;if((!_||!_.length)&&mn(w)){var O=m&&m.length,k=w({yAxis:x?Gs(Gs({},x),{},{ticks:O?m:x.ticks}):void 0,width:a,height:l,offset:c},O?!0:g);bg(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Gb(k),"]")),Array.isArray(k)&&(_=k)}if((!S||!S.length)&&mn(b)){var E=v&&v.length,P=b({xAxis:y?Gs(Gs({},y),{},{ticks:E?v:y.ticks}):void 0,width:a,height:l,offset:c},E?!0:g);bg(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Gb(P),"]")),Array.isArray(P)&&(S=P)}return he.createElement("g",{className:"recharts-cartesian-grid"},he.createElement(Xzn,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),he.createElement(Yzn,Sx({},u,{offset:c,horizontalPoints:_,xAxis:y,yAxis:x})),he.createElement(Qzn,Sx({},u,{offset:c,verticalPoints:S,xAxis:y,yAxis:x})),he.createElement(Kzn,Sx({},u,{horizontalPoints:_})),he.createElement(Zzn,Sx({},u,{verticalPoints:S})))}oue.displayName="CartesianGrid";var tjn=["type","layout","connectNulls","ref"];function zC(t){"@babel/helpers - typeof";return zC=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},zC(t)}function njn(t,e){if(t==null)return{};var n=rjn(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 rjn(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 Rk(){return Rk=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(mw(l.slice(0,p)),[f-g]);break}var m=h.length%2===0?[0,d]:[d];return[].concat(mw(e.repeat(l,u)),mw(h),m).map(function(v){return"".concat(v,"px")}).join(", ")}),gf($m(n),"id",lE("recharts-line-")),gf($m(n),"pathRef",function(s){n.mainCurve=s}),gf($m(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),gf($m(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return cjn(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,s=o.points,a=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=vu(u,pE);if(!f)return null;var d=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Da(g.payload,m)}},h={clipPath:r?"url(#clipPath-".concat(i,")"):null};return he.createElement(Vr,h,f.map(function(p){return he.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:s,xAxis:a,yAxis:l,layout:c,dataPointFormatter:d})}))}},{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,l=a.dot,c=a.points,u=a.dataKey,f=pn(this.props,!1),d=pn(l,!0),h=c.map(function(g,m){var v=Ul(Ul(Ul({key:"dot-".concat(m),r:3},f),d),{},{value:g.value,dataKey:u,cx:g.x,cy:g.y,index:m,payload:g.payload});return e.renderDotItem(l,v)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return he.createElement(Vr,Rk({className:"recharts-line-dots",key:"dots"},p),h)}},{key:"renderCurveStatically",value:function(r,i,o,s){var a=this.props,l=a.type,c=a.layout,u=a.connectNulls;a.ref;var f=njn(a,tjn),d=Ul(Ul(Ul({},pn(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},s),{},{type:l,layout:c,connectNulls:u});return he.createElement(cS,Rk({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,s=this.props,a=s.points,l=s.strokeDasharray,c=s.isAnimationActive,u=s.animationBegin,f=s.animationDuration,d=s.animationEasing,h=s.animationId,p=s.animateNewValues,g=s.width,m=s.height,v=this.state,y=v.prevPoints,x=v.totalLength;return he.createElement(zh,{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 w=b.t;if(y){var _=y.length/a.length,S=a.map(function(A,R){var T=Math.floor(R*_);if(y[T]){var M=y[T],I=cs(M.x,A.x),z=cs(M.y,A.y);return Ul(Ul({},A),{},{x:I(w),y:z(w)})}if(p){var F=cs(g*2,A.x),N=cs(m/2,A.y);return Ul(Ul({},A),{},{x:F(w),y:N(w)})}return Ul(Ul({},A),{},{x:A.x,y:A.y})});return o.renderCurveStatically(S,r,i)}var O=cs(0,x),k=O(w),E;if(l){var P="".concat(l).split(/[,\s]+/gim).map(function(A){return parseFloat(A)});E=o.getStrokeDasharray(k,x,P)}else E=o.generateSimpleStrokeDasharray(x,k);return o.renderCurveStatically(a,r,i,{strokeDasharray:E})})}},{key:"renderCurve",value:function(r,i){var o=this.props,s=o.points,a=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return a&&s&&s.length&&(!c&&u>0||!IC(c,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.xAxis,u=i.yAxis,f=i.top,d=i.left,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,x=Oe("recharts-line",l),b=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,_=b||w,S=wn(m)?this.id:m,O=(r=pn(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=O.r,E=k===void 0?3:k,P=O.strokeWidth,A=P===void 0?2:P,R=LHe(s)?s:{},T=R.clipDot,M=T===void 0?!0:T,I=E*2+A;return he.createElement(Vr,{className:x},b||w?he.createElement("defs",null,he.createElement("clipPath",{id:"clipPath-".concat(S)},he.createElement("rect",{x:b?d:d-h/2,y:w?f:f-p/2,width:b?h:h*2,height:w?p:p*2})),!M&&he.createElement("clipPath",{id:"clipPath-dots-".concat(S)},he.createElement("rect",{x:d-I/2,y:f-I/2,width:h+I,height:p+I}))):null,!y&&this.renderCurve(_,S),this.renderErrorBar(_,S),(y||s)&&this.renderDots(_,M,S),(!g||v)&&_g.renderCallByParent(this.props,a))}}],[{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(mw(r),[0]):r,s=[],a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mjn(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 Cx(){return Cx=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!IC(u,s)||!IC(f,a))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,d=i.yAxis,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,x=Oe("recharts-area",l),b=f&&f.allowDataOverflow,w=d&&d.allowDataOverflow,_=b||w,S=wn(m)?this.id:m,O=(r=pn(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=O.r,E=k===void 0?3:k,P=O.strokeWidth,A=P===void 0?2:P,R=LHe(s)?s:{},T=R.clipDot,M=T===void 0?!0:T,I=E*2+A;return he.createElement(Vr,{className:x},b||w?he.createElement("defs",null,he.createElement("clipPath",{id:"clipPath-".concat(S)},he.createElement("rect",{x:b?u:u-h/2,y:w?c:c-p/2,width:b?h:h*2,height:w?p:p*2})),!M&&he.createElement("clipPath",{id:"clipPath-dots-".concat(S)},he.createElement("rect",{x:u-I/2,y:c-I/2,width:h+I,height:p+I}))):null,y?null:this.renderArea(_,S),(s||y)&&this.renderDots(_,M,S),(!g||v)&&_g.renderCallByParent(this.props,a))}}],[{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}(D.PureComponent);RXe=u0;oh(u0,"displayName","Area");oh(u0,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Sh.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});oh(u0,"getBaseValue",function(t,e,n,r){var i=t.layout,o=t.baseValue,s=e.props.baseValue,a=s??o;if(at(a)&&typeof a=="number")return a;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 a==="dataMin"?f:a==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]});oh(u0,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,o=t.xAxisTicks,s=t.yAxisTicks,a=t.bandSize,l=t.dataKey,c=t.stackedData,u=t.dataStartIndex,f=t.displayedData,d=t.offset,h=e.layout,p=c&&c.length,g=RXe.getBaseValue(e,n,r,i),m=h==="horizontal",v=!1,y=f.map(function(b,w){var _;p?_=c[u+w]:(_=Da(b,l),Array.isArray(_)?v=!0:_=[g,_]);var S=_[1]==null||p&&Da(b,l)==null;return m?{x:zz({axis:r,ticks:o,bandSize:a,entry:b,index:w}),y:S?null:i.scale(_[1]),value:_,payload:b}:{x:S?null:r.scale(_[1]),y:zz({axis:i,ticks:s,bandSize:a,entry:b,index:w}),value:_,payload:b}}),x;return p||v?x=y.map(function(b){var w=Array.isArray(b.value)?b.value[0]:null;return m?{x:b.x,y:w!=null&&b.y!=null?i.scale(w):null}:{x:w!=null?r.scale(w):null,y:b.y}}):x=m?i.scale(g):r.scale(g),Fm({points:y,baseLine:x,layout:h,isRange:v},d)});oh(u0,"renderDotItem",function(t,e){var n;if(he.isValidElement(t))n=he.cloneElement(t,e);else if(mn(t))n=t(e);else{var r=Oe("recharts-area-dot",typeof t!="boolean"?t.className:"");n=he.createElement(e8,Cx({},e,{className:r}))}return n});function qZ(){return qZ=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&&Math.abs(l)>0){var c=Math.min(o,o+a),u=Math.max(o,o+a),f=Math.min(s,s+l),d=Math.max(s,s+l);return r>=c&&r<=u&&i>=f&&i<=d}return!1},oFn={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Qce=function(e){var n=TCe(TCe({},oFn),e),r=D.useRef(),i=D.useState(-1),o=Q3n(i,2),s=o[0],a=o[1];D.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&a(b)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,h=n.className,p=n.animationEasing,g=n.animationDuration,m=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=Oe("recharts-rectangle",h);return y?he.createElement(zh,{canBegin:s>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:g,animationEasing:p,isActive:y},function(b){var w=b.width,_=b.height,S=b.x,O=b.y;return he.createElement(zh,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,isActive:v,easing:p},he.createElement("path",Hz({},pn(n,!0),{className:x,d:kCe(S,O,w,_,d),ref:r})))}):he.createElement("path",Hz({},pn(n,!0),{className:x,d:kCe(l,c,u,f,d)}))};function LZ(){return LZ=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 dFn(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 hFn=function(e,n,r,i,o,s){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},pFn=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,s=e.top,a=s===void 0?0:s,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,g=fFn(e,sFn),m=aFn({x:r,y:o,top:a,left:c,width:f,height:h},g);return!at(r)||!at(o)||!at(f)||!at(h)||!at(a)||!at(c)?null:he.createElement("path",$Z({},pn(m,!0),{className:Oe("recharts-cross",p),d:hFn(r,o,f,h,a,c)}))},gFn=nqe,mFn=gFn(Object.getPrototypeOf,Object),vFn=mFn,yFn=im,xFn=vFn,bFn=om,wFn="[object Object]",_Fn=Function.prototype,SFn=Object.prototype,aXe=_Fn.toString,CFn=SFn.hasOwnProperty,OFn=aXe.call(Object);function EFn(t){if(!bFn(t)||yFn(t)!=wFn)return!1;var e=xFn(t);if(e===null)return!0;var n=CFn.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&aXe.call(n)==OFn}var TFn=EFn;const kFn=sn(TFn);var AFn=im,PFn=om,MFn="[object Boolean]";function RFn(t){return t===!0||t===!1||PFn(t)&&AFn(t)==MFn}var DFn=RFn;const IFn=sn(DFn);function qP(t){"@babel/helpers - typeof";return qP=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},qP(t)}function qz(){return qz=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:g,animationEasing:p,isActive:v},function(x){var b=x.upperWidth,w=x.lowerWidth,_=x.height,S=x.x,O=x.y;return he.createElement(zh,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,easing:p},he.createElement("path",qz({},pn(n,!0),{className:y,d:DCe(S,O,b,w,_),ref:r})))}):he.createElement("g",null,he.createElement("path",qz({},pn(n,!0),{className:y,d:DCe(l,c,u,f,d)})))},GFn=["option","shapeType","propTransformer","activeClassName","isActive"];function XP(t){"@babel/helpers - typeof";return XP=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},XP(t)}function HFn(t,e){if(t==null)return{};var n=qFn(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 qFn(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 ICe(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 Xz(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),Gl(Cd(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,a=i.startIndex;s==null||s({endIndex:o,startIndex:a})}),r.detachDragEndListener()}),Gl(Cd(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Gl(Cd(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Gl(Cd(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Gl(Cd(r),"handleSlideDragStart",function(i){var o=BCe(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(Cd(r),"startX"),endX:r.handleTravellerDragStart.bind(Cd(r),"endX")},r.state={},r}return TNn(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,s=this.state.scaleValues,a=this.props,l=a.gap,c=a.data,u=c.length-1,f=Math.min(i,o),d=Math.max(i,o),h=e.getIndexInRange(s,f),p=e.getIndexInRange(s,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,s=i.tickFormatter,a=i.dataKey,l=Da(o[r],a,r);return mn(s)?s(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,s=i.startX,a=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,p=l.onChange,g=r.pageX-o;g>0?g=Math.min(g,c+u-f-a,c+u-f-s):g<0&&(g=Math.max(g,c-s,c-a));var m=this.getIndex({startX:s+g,endX:a+g});(m.startIndex!==d||m.endIndex!==h)&&p&&p(m),this.setState({startX:s+g,endX:a+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=BCe(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,s=i.movingTravellerId,a=i.endX,l=i.startX,c=this.state[s],u=this.props,f=u.x,d=u.width,h=u.travellerWidth,p=u.onChange,g=u.gap,m=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[s]=c+y;var x=this.getIndex(v),b=x.startIndex,w=x.endIndex,_=function(){var O=m.length-1;return s==="startX"&&(a>l?b%g===0:w%g===0)||al?w%g===0:b%g===0)||a>l&&w===O};this.setState(Gl(Gl({},s,c+y),"brushMoveStartX",r.pageX),function(){p&&_()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,a=s.scaleValues,l=s.startX,c=s.endX,u=this.state[i],f=a.indexOf(u);if(f!==-1){var d=f+r;if(!(d===-1||d>=a.length)){var h=a[d];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(Gl({},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,s=r.width,a=r.height,l=r.fill,c=r.stroke;return he.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:s,height:a})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.data,c=r.children,u=r.padding,f=D.Children.only(c);return f?he.cloneElement(f,{x:i,y:o,width:s,height:a,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,a=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,p=l.data,g=l.startIndex,m=l.endIndex,v=Math.max(r,this.props.x),y=Y7(Y7({},pn(this.props,!1)),{},{x:v,y:c,width:u,height:f}),x=h||"Min value: ".concat((o=p[g])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=p[m])===null||s===void 0?void 0:s.name);return he.createElement(Vr,{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(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),a.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(d,y))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,a=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return he.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:s,width:f,height:a})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,a=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 he.createElement(Vr,{className:"recharts-brush-texts"},he.createElement($z,Qz({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:s+a/2},p),this.getTextOfTick(i)),he.createElement($z,Qz({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:s+a/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,a=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,d=this.state,h=d.startX,p=d.endX,g=d.isTextActive,m=d.isSlideMoving,v=d.isTravellerMoving,y=d.isTravellerFocused;if(!i||!i.length||!at(a)||!at(l)||!at(c)||!at(u)||c<=0||u<=0)return null;var x=Oe("recharts-brush",o),b=he.Children.count(s)===1,w=ONn("userSelect","none");return he.createElement(Vr,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(g||m||v||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,a=r.height,l=r.stroke,c=Math.floor(o+a/2)-1;return he.createElement(he.Fragment,null,he.createElement("rect",{x:i,y:o,width:s,height:a,fill:l,stroke:"none"}),he.createElement("line",{x1:i+1,y1:c,x2:i+s-1,y2:c,fill:"none",stroke:"#fff"}),he.createElement("line",{x1:i+1,y1:c+2,x2:i+s-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return he.isValidElement(r)?o=he.cloneElement(r,i):mn(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,a=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return Y7({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s},o&&o.length?RNn({data:o,width:s,x:a,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||a!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([a,a+s-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s,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,s=0,a=o-1;a-s>1;){var l=Math.floor((s+a)/2);r[l]>i?a=l:s=l}return i>=r[a]?a:s}}]),e}(D.PureComponent);Gl(Vb,"displayName","Brush");Gl(Vb,"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 DNn=Vce;function INn(t,e){var n;return DNn(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var LNn=INn,$Nn=XHe,FNn=l0,NNn=LNn,zNn=Rl,jNn=QU;function BNn(t,e,n){var r=zNn(t)?$Nn:NNn;return n&&jNn(t,e,n)&&(e=void 0),r(t,FNn(e))}var UNn=BNn;const WNn=sn(UNn);var Ch=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},UCe=vqe;function VNn(t,e,n){e=="__proto__"&&UCe?UCe(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var GNn=VNn,HNn=GNn,qNn=gqe,XNn=l0;function YNn(t,e){var n={};return e=XNn(e),qNn(t,function(r,i,o){HNn(n,i,e(r,i,o))}),n}var QNn=YNn;const KNn=sn(QNn);function ZNn(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 g5n(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 m5n(t,e){var n=t.x,r=t.y,i=p5n(t,u5n),o="".concat(n),s=parseInt(o,10),a="".concat(r),l=parseInt(a,10),c="".concat(e.height||i.height),u=parseInt(c,10),f="".concat(e.width||i.width),d=parseInt(f,10);return I2(I2(I2(I2(I2({},e),i),s?{x:s}:{}),l?{y:l}:{}),{},{height:u,width:d,name:e.name,radius:e.radius})}function VCe(t){return he.createElement(eNn,NZ({shapeType:"rectangle",propTransformer:m5n,activeClassName:"recharts-active-bar"},t))}var v5n=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||Wb(),n)}},y5n=["value","background"],hXe;function FC(t){"@babel/helpers - typeof";return FC=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},FC(t)}function x5n(t,e){if(t==null)return{};var n=b5n(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 b5n(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 Zz(){return Zz=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(T)0&&Math.abs(R)0&&(R=Math.min((X||0)-(T[V-1]||0),R))}),Number.isFinite(R)){var M=R/A,I=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(S=M*I/2),g.padding==="no-gap"){var z=Bb(e.barCategoryGap,M*I),F=M*I/2;S=F-z-(F-z)/I*z}}}i==="xAxis"?O=[r.left+(x.left||0)+(S||0),r.left+r.width-(x.right||0)-(S||0)]:i==="yAxis"?O=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(S||0),r.top+r.height-(x.bottom||0)-(S||0)]:O=g.range,w&&(O=[O[1],O[0]]);var N=vLn(g,o,d),L=N.scale,B=N.realScaleType;L.domain(v).range(O),yLn(L);var $=ELn(L,pf(pf({},g),{},{realScaleType:B}));i==="xAxis"?(P=m==="top"&&!b||m==="bottom"&&b,k=r.left,E=f[_]-P*g.height):i==="yAxis"&&(P=m==="left"&&!b||m==="right"&&b,k=f[_]-P*g.width,E=r.top);var j=pf(pf(pf({},g),$),{},{realScaleType:B,x:k,y:E,scale:L,width:i==="xAxis"?r.width:g.width,height:i==="yAxis"?r.height:g.height});return j.bandSize=jz(j,$),!g.hide&&i==="xAxis"?f[_]+=(P?-1:1)*j.height:g.hide||(f[_]+=(P?-1:1)*j.width),pf(pf({},h),{},r8({},p,j))},{})},vXe=function(e,n){var r=e.x,i=e.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},P5n=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return vXe({x:n,y:r},{x:i,y:o})},yXe=function(){function t(e){T5n(this,t),this.scale=e}return k5n(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 s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(n)+a}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}();r8(yXe,"EPS",1e-4);var Zce=function(e){var n=Object.keys(e).reduce(function(r,i){return pf(pf({},r),{},r8({},i,yXe.create(e[i])))},{});return pf(pf({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,a=o.position;return KNn(i,function(l,c){return n[c].apply(l,{bandAware:s,position:a})})},isInRange:function(i){return dXe(i,function(o,s){return n[s].isInRange(o)})}})};function M5n(t){return(t%180+180)%180}var R5n=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=M5n(i),s=o*Math.PI/180,a=Math.atan(r/n),l=s>a&&s-1?i[o?e[s]:s]:void 0}}var F5n=$5n,N5n=lXe;function z5n(t){var e=N5n(t),n=e%1;return e===e?n?e-n:e:0}var j5n=z5n,B5n=lqe,U5n=l0,W5n=j5n,V5n=Math.max;function G5n(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:W5n(n);return i<0&&(i=V5n(r+i,0)),B5n(t,U5n(e),i)}var H5n=G5n,q5n=F5n,X5n=H5n,Y5n=q5n(X5n),Q5n=Y5n;const K5n=sn(Q5n);var Z5n=_Sn(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("")}),Jce=D.createContext(void 0),eue=D.createContext(void 0),xXe=D.createContext(void 0),bXe=D.createContext({}),wXe=D.createContext(void 0),_Xe=D.createContext(0),SXe=D.createContext(0),YCe=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=e.clipPathId,a=e.children,l=e.width,c=e.height,u=Z5n(o);return he.createElement(Jce.Provider,{value:r},he.createElement(eue.Provider,{value:i},he.createElement(bXe.Provider,{value:o},he.createElement(xXe.Provider,{value:u},he.createElement(wXe.Provider,{value:s},he.createElement(_Xe.Provider,{value:c},he.createElement(SXe.Provider,{value:l},a)))))))},J5n=function(){return D.useContext(wXe)},CXe=function(e){var n=D.useContext(Jce);n==null&&Wb();var r=n[e];return r==null&&Wb(),r},ezn=function(){var e=D.useContext(Jce);return sv(e)},tzn=function(){var e=D.useContext(eue),n=K5n(e,function(r){return dXe(r.domain,Number.isFinite)});return n||sv(e)},OXe=function(e){var n=D.useContext(eue);n==null&&Wb();var r=n[e];return r==null&&Wb(),r},nzn=function(){var e=D.useContext(xXe);return e},rzn=function(){return D.useContext(bXe)},tue=function(){return D.useContext(SXe)},nue=function(){return D.useContext(_Xe)};function JP(t){"@babel/helpers - typeof";return JP=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},JP(t)}function QCe(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 KCe(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 Czn(t,e){return EXe(t,e+1)}function Ozn(t,e,n,r,i){for(var o=(r||[]).slice(),s=e.start,a=e.end,l=0,c=1,u=s,f=function(){var p=r==null?void 0:r[l];if(p===void 0)return{v:EXe(r,c)};var g=l,m,v=function(){return m===void 0&&(m=n(p,g)),m},y=p.coordinate,x=l===0||ej(t,y,v,u,a);x||(l=0,u=s,c+=1),x&&(u=y+t*(v()/2+i),l+=c)},d;c<=o.length;)if(d=f(),d)return d.v;return[]}function nM(t){"@babel/helpers - typeof";return nM=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},nM(t)}function rOe(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 zs(t){for(var e=1;e0?h.coordinate-m*t:h.coordinate})}else o[d]=h=zs(zs({},h),{},{tickCoord:h.coordinate});var v=ej(t,h.tickCoord,g,a,l);v&&(l=h.tickCoord-t*(g()/2+i),o[d]=zs(zs({},h),{},{isShow:!0}))},u=s-1;u>=0;u--)c(u);return o}function Pzn(t,e,n,r,i,o){var s=(r||[]).slice(),a=s.length,l=e.start,c=e.end;if(o){var u=r[a-1],f=n(u,a-1),d=t*(u.coordinate+t*f/2-c);s[a-1]=u=zs(zs({},u),{},{tickCoord:d>0?u.coordinate-d*t:u.coordinate});var h=ej(t,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-t*(f/2+i),s[a-1]=zs(zs({},u),{},{isShow:!0}))}for(var p=o?a-1:a,g=function(y){var x=s[y],b,w=function(){return b===void 0&&(b=n(x,y)),b};if(y===0){var _=t*(x.coordinate-t*w()/2-l);s[y]=x=zs(zs({},x),{},{tickCoord:_<0?x.coordinate-_*t:x.coordinate})}else s[y]=x=zs(zs({},x),{},{tickCoord:x.coordinate});var S=ej(t,x.tickCoord,w,l,c);S&&(l=x.tickCoord+t*(w()/2+i),s[y]=zs(zs({},x),{},{isShow:!0}))},m=0;m=2?Af(i[1].coordinate-i[0].coordinate):1,v=Szn(o,m,h);return l==="equidistantPreserveStart"?Ozn(m,v,g,i,s):(l==="preserveStart"||l==="preserveStartEnd"?d=Pzn(m,v,g,i,s,l==="preserveStartEnd"):d=Azn(m,v,g,i,s),d.filter(function(y){return y.isShow}))}var Mzn=["viewBox"],Rzn=["viewBox"],Dzn=["ticks"];function NC(t){"@babel/helpers - typeof";return NC=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},NC(t)}function C_(){return C_=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 Izn(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 Lzn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oOe(t,e){for(var n=0;n0?l(this.props):l(h)),s<=0||a<=0||!p||!p.length?null:he.createElement(Vr,{className:Oe("recharts-cartesian-axis",c),ref:function(m){r.layerReference=m}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Vs.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s;return he.isValidElement(r)?s=he.cloneElement(r,i):mn(r)?s=r(i):s=he.createElement($z,C_({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}]),e}(D.Component);iue(gE,"displayName","CartesianAxis");iue(gE,"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 Uzn=["x1","y1","x2","y2","key"],Wzn=["offset"];function Gb(t){"@babel/helpers - typeof";return Gb=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},Gb(t)}function sOe(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 Gs(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function qzn(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 Xzn=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,o=e.y,s=e.width,a=e.height;return he.createElement("rect",{x:i,y:o,width:s,height:a,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function AXe(t,e){var n;if(he.isValidElement(t))n=he.cloneElement(t,e);else if(mn(t))n=t(e);else{var r=e.x1,i=e.y1,o=e.x2,s=e.y2,a=e.key,l=aOe(e,Uzn),c=pn(l,!1);c.offset;var u=aOe(c,Wzn);n=he.createElement("line",Sx({},u,{x1:r,y1:i,x2:o,y2:s,fill:"none",key:a}))}return n}function Yzn(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 s=o.map(function(a,l){var c=Gs(Gs({},t),{},{x1:e,y1:a,x2:e+n,y2:a,key:"line-".concat(l),index:l});return AXe(i,c)});return he.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Qzn(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 s=o.map(function(a,l){var c=Gs(Gs({},t),{},{x1:a,y1:e,x2:a,y2:e+n,key:"line-".concat(l),index:l});return AXe(i,c)});return he.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function Kzn(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,o=t.width,s=t.height,a=t.horizontalPoints,l=t.horizontal,c=l===void 0?!0:l;if(!c||!e||!e.length)return null;var u=a.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],g=p?i+s-d:u[h+1]-d;if(g<=0)return null;var m=h%e.length;return he.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:g,width:o,stroke:"none",fill:e[m],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return he.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Zzn(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,o=t.x,s=t.y,a=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],g=p?o+a-d:u[h+1]-d;if(g<=0)return null;var m=h%r.length;return he.createElement("rect",{key:"react-".concat(h),x:d,y:s,width:g,height:l,stroke:"none",fill:r[m],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return he.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Jzn=function(e,n){var r=e.xAxis,i=e.width,o=e.height,s=e.offset;return qqe(rue(Gs(Gs(Gs({},gE.defaultProps),r),{},{ticks:ng(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,n)},ejn=function(e,n){var r=e.yAxis,i=e.width,o=e.height,s=e.offset;return qqe(rue(Gs(Gs(Gs({},gE.defaultProps),r),{},{ticks:ng(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,n)},gw={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function oue(t){var e,n,r,i,o,s,a=tue(),l=nue(),c=rzn(),u=Gs(Gs({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:gw.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:gw.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:gw.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:gw.horizontalFill,vertical:(o=t.vertical)!==null&&o!==void 0?o:gw.vertical,verticalFill:(s=t.verticalFill)!==null&&s!==void 0?s:gw.verticalFill,x:at(t.x)?t.x:c.left,y:at(t.y)?t.y:c.top,width:at(t.width)?t.width:c.width,height:at(t.height)?t.height:c.height}),f=u.x,d=u.y,h=u.width,p=u.height,g=u.syncWithTicks,m=u.horizontalValues,v=u.verticalValues,y=ezn(),x=tzn();if(!at(h)||h<=0||!at(p)||p<=0||!at(f)||f!==+f||!at(d)||d!==+d)return null;var b=u.verticalCoordinatesGenerator||Jzn,w=u.horizontalCoordinatesGenerator||ejn,_=u.horizontalPoints,S=u.verticalPoints;if((!_||!_.length)&&mn(w)){var O=m&&m.length,k=w({yAxis:x?Gs(Gs({},x),{},{ticks:O?m:x.ticks}):void 0,width:a,height:l,offset:c},O?!0:g);bg(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Gb(k),"]")),Array.isArray(k)&&(_=k)}if((!S||!S.length)&&mn(b)){var E=v&&v.length,P=b({xAxis:y?Gs(Gs({},y),{},{ticks:E?v:y.ticks}):void 0,width:a,height:l,offset:c},E?!0:g);bg(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Gb(P),"]")),Array.isArray(P)&&(S=P)}return he.createElement("g",{className:"recharts-cartesian-grid"},he.createElement(Xzn,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),he.createElement(Yzn,Sx({},u,{offset:c,horizontalPoints:_,xAxis:y,yAxis:x})),he.createElement(Qzn,Sx({},u,{offset:c,verticalPoints:S,xAxis:y,yAxis:x})),he.createElement(Kzn,Sx({},u,{horizontalPoints:_})),he.createElement(Zzn,Sx({},u,{verticalPoints:S})))}oue.displayName="CartesianGrid";var tjn=["type","layout","connectNulls","ref"];function zC(t){"@babel/helpers - typeof";return zC=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},zC(t)}function njn(t,e){if(t==null)return{};var n=rjn(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 rjn(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 Mk(){return Mk=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(mw(l.slice(0,p)),[f-g]);break}var m=h.length%2===0?[0,d]:[d];return[].concat(mw(e.repeat(l,u)),mw(h),m).map(function(v){return"".concat(v,"px")}).join(", ")}),gf($m(n),"id",aE("recharts-line-")),gf($m(n),"pathRef",function(s){n.mainCurve=s}),gf($m(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),gf($m(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return cjn(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,s=o.points,a=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=vu(u,hE);if(!f)return null;var d=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Da(g.payload,m)}},h={clipPath:r?"url(#clipPath-".concat(i,")"):null};return he.createElement(Vr,h,f.map(function(p){return he.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:s,xAxis:a,yAxis:l,layout:c,dataPointFormatter:d})}))}},{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,l=a.dot,c=a.points,u=a.dataKey,f=pn(this.props,!1),d=pn(l,!0),h=c.map(function(g,m){var v=Ul(Ul(Ul({key:"dot-".concat(m),r:3},f),d),{},{value:g.value,dataKey:u,cx:g.x,cy:g.y,index:m,payload:g.payload});return e.renderDotItem(l,v)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return he.createElement(Vr,Mk({className:"recharts-line-dots",key:"dots"},p),h)}},{key:"renderCurveStatically",value:function(r,i,o,s){var a=this.props,l=a.type,c=a.layout,u=a.connectNulls;a.ref;var f=njn(a,tjn),d=Ul(Ul(Ul({},pn(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},s),{},{type:l,layout:c,connectNulls:u});return he.createElement(cS,Mk({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,s=this.props,a=s.points,l=s.strokeDasharray,c=s.isAnimationActive,u=s.animationBegin,f=s.animationDuration,d=s.animationEasing,h=s.animationId,p=s.animateNewValues,g=s.width,m=s.height,v=this.state,y=v.prevPoints,x=v.totalLength;return he.createElement(zh,{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 w=b.t;if(y){var _=y.length/a.length,S=a.map(function(A,R){var T=Math.floor(R*_);if(y[T]){var M=y[T],I=cs(M.x,A.x),z=cs(M.y,A.y);return Ul(Ul({},A),{},{x:I(w),y:z(w)})}if(p){var F=cs(g*2,A.x),N=cs(m/2,A.y);return Ul(Ul({},A),{},{x:F(w),y:N(w)})}return Ul(Ul({},A),{},{x:A.x,y:A.y})});return o.renderCurveStatically(S,r,i)}var O=cs(0,x),k=O(w),E;if(l){var P="".concat(l).split(/[,\s]+/gim).map(function(A){return parseFloat(A)});E=o.getStrokeDasharray(k,x,P)}else E=o.generateSimpleStrokeDasharray(x,k);return o.renderCurveStatically(a,r,i,{strokeDasharray:E})})}},{key:"renderCurve",value:function(r,i){var o=this.props,s=o.points,a=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return a&&s&&s.length&&(!c&&u>0||!IC(c,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.xAxis,u=i.yAxis,f=i.top,d=i.left,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,x=Oe("recharts-line",l),b=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,_=b||w,S=wn(m)?this.id:m,O=(r=pn(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=O.r,E=k===void 0?3:k,P=O.strokeWidth,A=P===void 0?2:P,R=LHe(s)?s:{},T=R.clipDot,M=T===void 0?!0:T,I=E*2+A;return he.createElement(Vr,{className:x},b||w?he.createElement("defs",null,he.createElement("clipPath",{id:"clipPath-".concat(S)},he.createElement("rect",{x:b?d:d-h/2,y:w?f:f-p/2,width:b?h:h*2,height:w?p:p*2})),!M&&he.createElement("clipPath",{id:"clipPath-dots-".concat(S)},he.createElement("rect",{x:d-I/2,y:f-I/2,width:h+I,height:p+I}))):null,!y&&this.renderCurve(_,S),this.renderErrorBar(_,S),(y||s)&&this.renderDots(_,M,S),(!g||v)&&_g.renderCallByParent(this.props,a))}}],[{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(mw(r),[0]):r,s=[],a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mjn(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 Cx(){return Cx=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!IC(u,s)||!IC(f,a))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,d=i.yAxis,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,x=Oe("recharts-area",l),b=f&&f.allowDataOverflow,w=d&&d.allowDataOverflow,_=b||w,S=wn(m)?this.id:m,O=(r=pn(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=O.r,E=k===void 0?3:k,P=O.strokeWidth,A=P===void 0?2:P,R=LHe(s)?s:{},T=R.clipDot,M=T===void 0?!0:T,I=E*2+A;return he.createElement(Vr,{className:x},b||w?he.createElement("defs",null,he.createElement("clipPath",{id:"clipPath-".concat(S)},he.createElement("rect",{x:b?u:u-h/2,y:w?c:c-p/2,width:b?h:h*2,height:w?p:p*2})),!M&&he.createElement("clipPath",{id:"clipPath-dots-".concat(S)},he.createElement("rect",{x:u-I/2,y:c-I/2,width:h+I,height:p+I}))):null,y?null:this.renderArea(_,S),(s||y)&&this.renderDots(_,M,S),(!g||v)&&_g.renderCallByParent(this.props,a))}}],[{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}(D.PureComponent);RXe=u0;oh(u0,"displayName","Area");oh(u0,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Sh.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});oh(u0,"getBaseValue",function(t,e,n,r){var i=t.layout,o=t.baseValue,s=e.props.baseValue,a=s??o;if(at(a)&&typeof a=="number")return a;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 a==="dataMin"?f:a==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]});oh(u0,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,o=t.xAxisTicks,s=t.yAxisTicks,a=t.bandSize,l=t.dataKey,c=t.stackedData,u=t.dataStartIndex,f=t.displayedData,d=t.offset,h=e.layout,p=c&&c.length,g=RXe.getBaseValue(e,n,r,i),m=h==="horizontal",v=!1,y=f.map(function(b,w){var _;p?_=c[u+w]:(_=Da(b,l),Array.isArray(_)?v=!0:_=[g,_]);var S=_[1]==null||p&&Da(b,l)==null;return m?{x:zz({axis:r,ticks:o,bandSize:a,entry:b,index:w}),y:S?null:i.scale(_[1]),value:_,payload:b}:{x:S?null:r.scale(_[1]),y:zz({axis:i,ticks:s,bandSize:a,entry:b,index:w}),value:_,payload:b}}),x;return p||v?x=y.map(function(b){var w=Array.isArray(b.value)?b.value[0]:null;return m?{x:b.x,y:w!=null&&b.y!=null?i.scale(w):null}:{x:w!=null?r.scale(w):null,y:b.y}}):x=m?i.scale(g):r.scale(g),Fm({points:y,baseLine:x,layout:h,isRange:v},d)});oh(u0,"renderDotItem",function(t,e){var n;if(he.isValidElement(t))n=he.cloneElement(t,e);else if(mn(t))n=t(e);else{var r=Oe("recharts-area-dot",typeof t!="boolean"?t.className:"");n=he.createElement(e8,Cx({},e,{className:r}))}return n});function qZ(){return qZ=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 Hjn(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 qjn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xjn(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?s:e&&e.length&&at(i)&&at(o)?e.slice(i,o+1):[]};function UXe(t){return t==="number"?[0,"auto"]:void 0}var JZ=function(e,n,r,i){var o=e.graphicalItems,s=e.tooltipAxis,a=i8(n,e);return r<0||!o||!o.length||r>=a.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(s.dataKey&&!s.allowDuplicatedCategory){var h=f===void 0?a:f;d=Oz(h,s.dataKey,i)}else d=f&&f[r]||a[r];return d?[].concat(UC(l),[Yqe(c,d)]):l},[])},vOe=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},s=o4n(o,r),a=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=fLn(s,a,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=JZ(e,n,u,f),h=s4n(r,a,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},a4n=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=e.stackOffset,h=Hqe(u,o);return r.reduce(function(p,g){var m,v=g.props,y=v.type,x=v.dataKey,b=v.allowDataOverflow,w=v.allowDuplicatedCategory,_=v.scale,S=v.ticks,O=v.includeHidden,k=g.props[s];if(p[k])return p;var E=i8(e.data,{graphicalItems:i.filter(function($){return $.props[s]===k}),dataStartIndex:l,dataEndIndex:c}),P=E.length,A,R,T;Ijn(g.props.domain,b,y)&&(A=wZ(g.props.domain,null,b),h&&(y==="number"||_!=="auto")&&(T=Pk(E,x,"category")));var M=UXe(y);if(!A||A.length===0){var I,z=(I=g.props.domain)!==null&&I!==void 0?I:M;if(x){if(A=Pk(E,x,y),y==="category"&&h){var F=mCn(A);w&&F?(R=A,A=Yz(0,P)):w||(A=XSe(z,A,g).reduce(function($,j){return $.indexOf(j)>=0?$:[].concat(UC($),[j])},[]))}else if(y==="category")w?A=A.filter(function($){return $!==""&&!wn($)}):A=XSe(z,A,g).reduce(function($,j){return $.indexOf(j)>=0||j===""||wn(j)?$:[].concat(UC($),[j])},[]);else if(y==="number"){var N=mLn(E,i.filter(function($){return $.props[s]===k&&(O||!$.props.hide)}),x,o,u);N&&(A=N)}h&&(y==="number"||_!=="auto")&&(T=Pk(E,x,"category"))}else h?A=Yz(0,P):a&&a[k]&&a[k].hasStack&&y==="number"?A=d==="expand"?[0,1]:Xqe(a[k].stackGroups,l,c):A=Gqe(E,i.filter(function($){return $.props[s]===k&&(O||!$.props.hide)}),y,u,!0);if(y==="number")A=QZ(f,A,k,o,S),z&&(A=wZ(z,A,b));else if(y==="category"&&z){var L=z,B=A.every(function($){return L.indexOf($)>=0});B&&(A=L)}}return Ge(Ge({},p),{},Yt({},k,Ge(Ge({},g.props),{},{axisType:o,domain:A,categoricalDomain:T,duplicateDomain:R,originalDomain:(m=g.props.domain)!==null&&m!==void 0?m:M,isCategorical:h,layout:u})))},{})},l4n=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=i8(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=Hqe(u,o),g=-1;return r.reduce(function(m,v){var y=v.props[s],x=UXe("number");if(!m[y]){g++;var b;return p?b=Yz(0,h):a&&a[y]&&a[y].hasStack?(b=Xqe(a[y].stackGroups,l,c),b=QZ(f,b,y,o)):(b=wZ(x,Gqe(d,r.filter(function(w){return w.props[s]===y&&!w.props.hide}),"number",u),i.defaultProps.allowDataOverflow),b=QZ(f,b,y,o)),Ge(Ge({},m),{},Yt({},y,Ge(Ge({axisType:o},i.defaultProps),{},{hide:!0,orientation:mu(r4n,"".concat(o,".").concat(g%2),null),domain:b,originalDomain:x,isCategorical:p,layout:u})))}return m},{})},c4n=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),d=vu(u,o),h={};return d&&d.length?h=a4n(e,{axes:d,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c}):s&&s.length&&(h=l4n(e,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c})),h},u4n=function(e){var n=sv(e),r=ng(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Gce(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:jz(n,r)}},yOe=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ql(n,Vb),o=0,s=0;return e.data&&e.data.length!==0&&(s=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},f4n=function(e){return!e||!e.length?!1:e.some(function(n){var r=xg(n&&n.type);return r&&r.indexOf("Bar")>=0})},xOe=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"}},d4n=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,s=o===void 0?{}:o,a=e.yAxisMap,l=a===void 0?{}:a,c=r.width,u=r.height,f=r.children,d=r.margin||{},h=Ql(f,Vb),p=Ql(f,MC),g=Object.keys(l).reduce(function(w,_){var S=l[_],O=S.orientation;return!S.mirror&&!S.hide?Ge(Ge({},w),{},Yt({},O,w[O]+S.width)):w},{left:d.left||0,right:d.right||0}),m=Object.keys(s).reduce(function(w,_){var S=s[_],O=S.orientation;return!S.mirror&&!S.hide?Ge(Ge({},w),{},Yt({},O,mu(w,"".concat(O))+S.height)):w},{top:d.top||0,bottom:d.bottom||0}),v=Ge(Ge({},m),g),y=v.bottom;h&&(v.bottom+=h.props.height||Vb.defaultProps.height),p&&n&&(v=pLn(v,i,r,n));var x=c-v.left-v.right,b=u-v.top-v.bottom;return Ge(Ge({brushBottom:y},v),{},{width:Math.max(x,0),height:Math.max(b,0)})},h4n=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},sue=function(e){var n,r=e.chartName,i=e.GraphicalChild,o=e.defaultTooltipEventType,s=o===void 0?"axis":o,a=e.validateTooltipEventTypes,l=a===void 0?["axis"]:a,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,d=e.defaultProps,h=function(m,v){var y=v.graphicalItems,x=v.stackGroups,b=v.offset,w=v.updateId,_=v.dataStartIndex,S=v.dataEndIndex,O=m.barSize,k=m.layout,E=m.barGap,P=m.barCategoryGap,A=m.maxBarSize,R=xOe(k),T=R.numericAxisName,M=R.cateAxisName,I=f4n(y),z=[];return y.forEach(function(F,N){var L=i8(m.data,{graphicalItems:[F],dataStartIndex:_,dataEndIndex:S}),B=F.props,$=B.dataKey,j=B.maxBarSize,X=F.props["".concat(T,"Id")],V=F.props["".concat(M,"Id")],Y={},le=c.reduce(function(de,xe){var H=v["".concat(xe.axisType,"Map")],W=F.props["".concat(xe.axisType,"Id")];H&&H[W]||xe.axisType==="zAxis"||Wb();var J=H[W];return Ge(Ge({},de),{},Yt(Yt({},xe.axisType,J),"".concat(xe.axisType,"Ticks"),ng(J)))},Y),K=le[M],ee=le["".concat(M,"Ticks")],re=x&&x[X]&&x[X].hasStack&&kLn(F,x[X].stackGroups),me=xg(F.type).indexOf("Bar")>=0,te=jz(K,ee),ae=[],U=I&&dLn({barSize:O,stackGroups:x,totalSize:h4n(le,M)});if(me){var oe,ne,G=wn(j)?A:j,q=(oe=(ne=jz(K,ee,!0))!==null&&ne!==void 0?ne:G)!==null&&oe!==void 0?oe:0;ae=hLn({barGap:E,barCategoryGap:P,bandSize:q!==te?q:te,sizeList:U[V],maxBarSize:G}),q!==te&&(ae=ae.map(function(de){return Ge(Ge({},de),{},{position:Ge(Ge({},de.position),{},{offset:de.position.offset-q/2})})}))}var Z=F&&F.type&&F.type.getComposedData;Z&&z.push({props:Ge(Ge({},Z(Ge(Ge({},le),{},{displayedData:L,props:m,dataKey:$,item:F,bandSize:te,barPosition:ae,offset:b,stackedData:re,layout:k,dataStartIndex:_,dataEndIndex:S}))),{},Yt(Yt(Yt({key:F.key||"item-".concat(N)},T,le[T]),M,le[M]),"animationId",w)),childIndex:TCn(F,m.children),item:F})}),z},p=function(m,v){var y=m.props,x=m.dataStartIndex,b=m.dataEndIndex,w=m.updateId;if(!A_e({props:y}))return null;var _=y.children,S=y.layout,O=y.stackOffset,k=y.data,E=y.reverseStackOrder,P=xOe(S),A=P.numericAxisName,R=P.cateAxisName,T=vu(_,i),M=OLn(k,T,"".concat(A,"Id"),"".concat(R,"Id"),O,E),I=c.reduce(function(B,$){var j="".concat($.axisType,"Map");return Ge(Ge({},B),{},Yt({},j,c4n(y,Ge(Ge({},$),{},{graphicalItems:T,stackGroups:$.axisType===A&&M,dataStartIndex:x,dataEndIndex:b}))))},{}),z=d4n(Ge(Ge({},I),{},{props:y,graphicalItems:T}),v==null?void 0:v.legendBBox);Object.keys(I).forEach(function(B){I[B]=f(y,I[B],z,B.replace("Map",""),r)});var F=I["".concat(R,"Map")],N=u4n(F),L=h(y,Ge(Ge({},I),{},{dataStartIndex:x,dataEndIndex:b,updateId:w,graphicalItems:T,stackGroups:M,offset:z}));return Ge(Ge({formattedGraphicalItems:L,graphicalItems:T,offset:z,stackGroups:M},N),I)};return n=function(g){Zjn(m,g);function m(v){var y,x,b;return qjn(this,m),b=Qjn(this,m,[v]),Yt(Wn(b),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Yt(Wn(b),"accessibilityManager",new Djn),Yt(Wn(b),"handleLegendBBoxUpdate",function(w){if(w){var _=b.state,S=_.dataStartIndex,O=_.dataEndIndex,k=_.updateId;b.setState(Ge({legendBBox:w},p({props:b.props,dataStartIndex:S,dataEndIndex:O,updateId:k},Ge(Ge({},b.state),{},{legendBBox:w}))))}}),Yt(Wn(b),"handleReceiveSyncEvent",function(w,_,S){if(b.props.syncId===w){if(S===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(_)}}),Yt(Wn(b),"handleBrushChange",function(w){var _=w.startIndex,S=w.endIndex;if(_!==b.state.dataStartIndex||S!==b.state.dataEndIndex){var O=b.state.updateId;b.setState(function(){return Ge({dataStartIndex:_,dataEndIndex:S},p({props:b.props,dataStartIndex:_,dataEndIndex:S,updateId:O},b.state))}),b.triggerSyncEvent({dataStartIndex:_,dataEndIndex:S})}}),Yt(Wn(b),"handleMouseEnter",function(w){var _=b.getMouseInfo(w);if(_){var S=Ge(Ge({},_),{},{isTooltipActive:!0});b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseEnter;mn(O)&&O(S,w)}}),Yt(Wn(b),"triggeredAfterMouseMove",function(w){var _=b.getMouseInfo(w),S=_?Ge(Ge({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseMove;mn(O)&&O(S,w)}),Yt(Wn(b),"handleItemMouseEnter",function(w){b.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Yt(Wn(b),"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Yt(Wn(b),"handleMouseMove",function(w){w.persist(),b.throttleTriggeredAfterMouseMove(w)}),Yt(Wn(b),"handleMouseLeave",function(w){b.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};b.setState(_),b.triggerSyncEvent(_);var S=b.props.onMouseLeave;mn(S)&&S(_,w)}),Yt(Wn(b),"handleOuterEvent",function(w){var _=ECn(w),S=mu(b.props,"".concat(_));if(_&&mn(S)){var O,k;/.*touch.*/i.test(_)?k=b.getMouseInfo(w.changedTouches[0]):k=b.getMouseInfo(w),S((O=k)!==null&&O!==void 0?O:{},w)}}),Yt(Wn(b),"handleClick",function(w){var _=b.getMouseInfo(w);if(_){var S=Ge(Ge({},_),{},{isTooltipActive:!0});b.setState(S),b.triggerSyncEvent(S);var O=b.props.onClick;mn(O)&&O(S,w)}}),Yt(Wn(b),"handleMouseDown",function(w){var _=b.props.onMouseDown;if(mn(_)){var S=b.getMouseInfo(w);_(S,w)}}),Yt(Wn(b),"handleMouseUp",function(w){var _=b.props.onMouseUp;if(mn(_)){var S=b.getMouseInfo(w);_(S,w)}}),Yt(Wn(b),"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Yt(Wn(b),"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseDown(w.changedTouches[0])}),Yt(Wn(b),"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseUp(w.changedTouches[0])}),Yt(Wn(b),"triggerSyncEvent",function(w){b.props.syncId!==void 0&&K7.emit(Z7,b.props.syncId,w,b.eventEmitterSymbol)}),Yt(Wn(b),"applySyncEvent",function(w){var _=b.props,S=_.layout,O=_.syncMethod,k=b.state.updateId,E=w.dataStartIndex,P=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)b.setState(Ge({dataStartIndex:E,dataEndIndex:P},p({props:b.props,dataStartIndex:E,dataEndIndex:P,updateId:k},b.state)));else if(w.activeTooltipIndex!==void 0){var A=w.chartX,R=w.chartY,T=w.activeTooltipIndex,M=b.state,I=M.offset,z=M.tooltipTicks;if(!I)return;if(typeof O=="function")T=O(z,w);else if(O==="value"){T=-1;for(var F=0;F=0){var re,me;if(A.dataKey&&!A.allowDuplicatedCategory){var te=typeof A.dataKey=="function"?ee:"payload.".concat(A.dataKey.toString());re=Oz(F,te,T),me=N&&L&&Oz(L,te,T)}else re=F==null?void 0:F[R],me=N&&L&&L[R];if(V||X){var ae=w.props.activeIndex!==void 0?w.props.activeIndex:R;return[D.cloneElement(w,Ge(Ge(Ge({},O.props),le),{},{activeIndex:ae})),null,null]}if(!wn(re))return[K].concat(UC(b.renderActivePoints({item:O,activePoint:re,basePoint:me,childIndex:R,isRange:N})))}else{var U,oe=(U=b.getItemByXY(b.state.activeCoordinate))!==null&&U!==void 0?U:{graphicalItem:K},ne=oe.graphicalItem,G=ne.item,q=G===void 0?w:G,Z=ne.childIndex,de=Ge(Ge(Ge({},O.props),le),{},{activeIndex:Z});return[D.cloneElement(q,de),null,null]}return N?[K,null,null]:[K,null]}),Yt(Wn(b),"renderCustomized",function(w,_,S){return D.cloneElement(w,Ge(Ge({key:"recharts-customized-".concat(S)},b.props),b.state))}),Yt(Wn(b),"renderMap",{CartesianGrid:{handler:r$,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:r$},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:r$},YAxis:{handler:r$},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:lE("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=Sqe(b.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),b.state={},b}return Yjn(m,[{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,w=y.height,_=y.layout,S=Ql(x,Rd);if(S){var O=S.props.defaultIndex;if(!(typeof O!="number"||O<0||O>this.state.tooltipTicks.length)){var k=this.state.tooltipTicks[O]&&this.state.tooltipTicks[O].value,E=JZ(this.state,b,O,k),P=this.state.tooltipTicks[O].coordinate,A=(this.state.offset.top+w)/2,R=_==="horizontal",T=R?{x:P,y:A}:{y:P,x:A},M=this.state.formattedGraphicalItems.find(function(z){var F=z.item;return F.type.name==="Scatter"});M&&(T=Ge(Ge({},T),M.props.points[O].tooltipPosition),E=M.props.points[O].tooltipPayload);var I={activeTooltipIndex:O,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:T};this.setState(I),this.renderCursor(S),this.accessibilityManager.setIndex(O)}}}},{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,w;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(y){qK([Ql(y.children,Rd)],[Ql(this.props.children,Rd)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=Ql(this.props.children,Rd);if(y&&typeof y.props.shared=="boolean"){var x=y.props.shared?"axis":"item";return l.indexOf(x)>=0?x:s}return s}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var x=this.container,b=x.getBoundingClientRect(),w=yDn(b),_={chartX:Math.round(y.pageX-w.left),chartY:Math.round(y.pageY-w.top)},S=b.width/x.offsetWidth||1,O=this.inRange(_.chartX,_.chartY,S);if(!O)return null;var k=this.state,E=k.xAxisMap,P=k.yAxisMap,A=this.getTooltipEventType();if(A!=="axis"&&E&&P){var R=sv(E).scale,T=sv(P).scale,M=R&&R.invert?R.invert(_.chartX):null,I=T&&T.invert?T.invert(_.chartY):null;return Ge(Ge({},_),{},{xValue:M,yValue:I})}var z=vOe(this.state,this.props.data,this.props.layout,O);return z?Ge(Ge({},_),z):null}},{key:"inRange",value:function(y,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=y/b,S=x/b;if(w==="horizontal"||w==="vertical"){var O=this.state.offset,k=_>=O.left&&_<=O.left+O.width&&S>=O.top&&S<=O.top+O.height;return k?{x:_,y:S}:null}var E=this.state,P=E.angleAxisMap,A=E.radiusAxisMap;if(P&&A){var R=sv(P);return KSe({x:_,y:S},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,x=this.getTooltipEventType(),b=Ql(y,Rd),w={};b&&x==="axis"&&(b.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var _=Ez(this.props,this.handleOuterEvent);return Ge(Ge({},_),w)}},{key:"addListener",value:function(){K7.on(Z7,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){K7.removeListener(Z7,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,x,b){for(var w=this.state.formattedGraphicalItems,_=0,S=w.length;_!yr(t)||!Number.isFinite(t)?"":dA(t),y4n=t=>t.toPrecision(3),eG={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function x4n({payload:t,removeTimeSeries:e}){return!t||t.length===0?null:C.jsx(ot,{sx:eG.legendContainer,children:t.map((n,r)=>C.jsxs(ot,{sx:{...eG.legendItem,color:n.color},children:[C.jsx("span",{children:n.value}),e&&C.jsx(ot,{component:"span",sx:eG.legendCloseIcon,onMouseUp:()=>e(r),children:C.jsx(xU,{fontSize:"small"})})]},n.value))})}const tG={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)})},b4n="#00000000",w4n="#FAFFDD";function _4n({active:t,label:e,payload:n}){if(!t||!yr(e)||!n||n.length===0)return null;const r=n.map((i,o)=>{const{name:s,value:a,unit:l,dataKey:c}=i;let u=i.color;if(!yr(a))return null;const f=s||"?",d=a.toFixed(3);u===b4n&&(u=w4n);let p=f.indexOf(":")!==-1?"":` (${c})`;return typeof l=="string"&&(p!==""?p=`${l} ${p}`:p=l),C.jsxs("div",{children:[C.jsxs("span",{children:[f,": "]}),C.jsx(ot,{component:"span",sx:tG.toolTipValue,style:{color:u},children:d}),C.jsxs("span",{children:[" ",p]})]},o)});return r?C.jsxs(ot,{sx:tG.toolTipContainer,children:[C.jsx(ot,{component:"span",sx:tG.toolTipLabel,children:`${aO(e)} UTC`}),r]}):null}function bOe({cx:t,cy:e,radius:n,stroke:r,fill:i,strokeWidth:o,symbol:s}){const l=n+.5*o,c=2*l,u=Math.floor(100*o/c+.5)+"%";let f;if(s==="diamond"){const g=1024*(n/c);f=C.jsx("polygon",{points:`${512-g},512 512,${512-g} ${512+g},512 512,${512+g}`,strokeWidth:u,stroke:r,fill:i})}else{const d=Math.floor(100*n/c+.5)+"%";f=C.jsx("circle",{cx:"50%",cy:"50%",r:d,strokeWidth:u,stroke:r,fill:i})}return yr(t)&&yr(e)?C.jsx("svg",{x:t-l,y:e-l,width:c,height:c,viewBox:"0 0 1024 1024",children:f}):null}function S4n({timeSeriesGroup:t,timeSeriesIndex:e,selectTimeSeries:n,places:r,selectPlace:i,placeInfos:o,placeGroupTimeSeries:s,paletteMode:a,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;s.forEach(b=>{if(x===null&&b.placeGroup.id===f.datasetId){const w=b.placeGroup.features;w.length>0&&w[0].properties&&(x=w[0].properties.color||null)}}),p=x||"red"}else if(o){const x=o[f.placeId];if(x){const{place:b,label:w,color:_}=x;if(b.geometry.type==="Point"){const S=b.geometry.coordinates[0],O=b.geometry.coordinates[1];h+=` (${w}: ${O.toFixed(5)},${S.toFixed(5)})`}else h+=` (${w})`;p=_}}const g=UPe(p,a);let m,v;u.source.placeId===null?(m=0,v={radius:5,strokeWidth:1.5,symbol:"diamond"}):(m=l==="point"?0:u.dataProgress,v={radius:3,strokeWidth:2,symbol:"circle"});const y=c&&f.valueDataKey&&f.errorDataKey&&C.jsx(pE,{dataKey:`ev${e}`,width:4,strokeWidth:1,stroke:g,strokeOpacity:.5});return l==="bar"?C.jsx(R1,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,fill:g,fillOpacity:m,isAnimationActive:!1,onClick:d,children:y},e):C.jsx(wD,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,dot:C.jsx(bOe,{...v,stroke:g,fill:"white"}),activeDot:C.jsx(bOe,{...v,stroke:"white",fill:g}),stroke:g,strokeOpacity:m,isAnimationActive:!1,onClick:d,children:y},e)}const C4n=lt(C.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"),O4n=lt(C.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart"),E4n=lt(C.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"),T4n=lt(C.jsx("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand"),k4n=lt(C.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"),WXe=lt(C.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"),A4n=lt([C.jsx("circle",{cx:"7",cy:"14",r:"3"},"0"),C.jsx("circle",{cx:"11",cy:"6",r:"3"},"1"),C.jsx("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot"),P4n=lt(C.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"),M4n=lt([C.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),C.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 R4n(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 D4n=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function Sg(t){const e=[];for(let n=0,r=t.length;n$l||t.height>$l)&&(t.width>$l&&t.height>$l?t.width>t.height?(t.height*=$l/t.width,t.width=$l):(t.width*=$l/t.height,t.height=$l):t.width>$l?(t.height*=$l/t.width,t.width=$l):(t.width*=$l/t.height,t.height=$l))}function sj(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 N4n(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function z4n(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),N4n(i)}const yl=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||yl(n,e)};function j4n(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function B4n(t){return Sg(t).map(e=>{const n=t.getPropertyValue(e),r=t.getPropertyPriority(e);return`${e}: ${n}${r?" !important":""};`}).join(" ")}function U4n(t,e,n){const r=`.${t}:${e}`,i=n.cssText?j4n(n):B4n(n);return document.createTextNode(`${r}{${i}}`)}function wOe(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=D4n();try{e.className=`${e.className} ${o}`}catch{return}const s=document.createElement("style");s.appendChild(U4n(o,n,r)),e.appendChild(s)}function W4n(t,e){wOe(t,e,":before"),wOe(t,e,":after")}const _Oe="application/font-woff",SOe="image/jpeg",V4n={woff:_Oe,woff2:_Oe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:SOe,jpeg:SOe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function G4n(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function aue(t){const e=G4n(t).toLowerCase();return V4n[e]||""}function H4n(t){return t.split(/,/)[1]}function eJ(t){return t.search(/^(data:)/)!==-1}function q4n(t,e){return`data:${e};base64,${t}`}async function GXe(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,s)=>{const a=new FileReader;a.onerror=s,a.onloadend=()=>{try{o(n({res:r,result:a.result}))}catch(l){s(l)}},a.readAsDataURL(i)})}const nG={};function X4n(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 lue(t,e,n){const r=X4n(t,e,n.includeQueryParams);if(nG[r]!=null)return nG[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await GXe(t,n.fetchRequestInit,({res:s,result:a})=>(e||(e=s.headers.get("Content-Type")||""),H4n(a)));i=q4n(o,e)}catch(o){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;o&&(s=typeof o=="string"?o:o.message),s&&console.warn(s)}return nG[r]=i,i}async function Y4n(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):sj(e)}async function Q4n(t,e){if(t.currentSrc){const o=document.createElement("canvas"),s=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,s==null||s.drawImage(t,0,0,o.width,o.height);const a=o.toDataURL();return sj(a)}const n=t.poster,r=aue(n),i=await lue(n,r,e);return sj(i)}async function K4n(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await o8(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function Z4n(t,e){return yl(t,HTMLCanvasElement)?Y4n(t):yl(t,HTMLVideoElement)?Q4n(t,e):yl(t,HTMLIFrameElement)?K4n(t):t.cloneNode(!1)}const J4n=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function eBn(t,e,n){var r,i;let o=[];return J4n(t)&&t.assignedNodes?o=Sg(t.assignedNodes()):yl(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=Sg(t.contentDocument.body.childNodes):o=Sg(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||yl(t,HTMLVideoElement)||await o.reduce((s,a)=>s.then(()=>o8(a,n)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function tBn(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Sg(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`),yl(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 nBn(t,e){yl(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),yl(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function rBn(t,e){if(yl(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(i=>t.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function iBn(t,e){return yl(e,Element)&&(tBn(t,e),W4n(t,e),nBn(t,e),rBn(t,e)),e}async function oBn(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let o=0;oZ4n(r,e)).then(r=>eBn(t,r,e)).then(r=>iBn(t,r)).then(r=>oBn(r,e))}const HXe=/url\((['"]?)([^'"]+?)\1\)/g,sBn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,aBn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lBn(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function cBn(t){const e=[];return t.replace(HXe,(n,r,i)=>(e.push(i),n)),e.filter(n=>!eJ(n))}async function uBn(t,e,n,r,i){try{const o=n?R4n(e,n):e,s=aue(e);let a;return i||(a=await lue(o,s,r)),t.replace(lBn(e),`$1${a}$3`)}catch{}return t}function fBn(t,{preferredFontFormat:e}){return e?t.replace(aBn,n=>{for(;;){const[r,,i]=sBn.exec(n)||[];if(!i)return"";if(i===e)return`src: ${r};`}}):t}function qXe(t){return t.search(HXe)!==-1}async function XXe(t,e,n){if(!qXe(t))return t;const r=fBn(t,n);return cBn(r).reduce((o,s)=>o.then(a=>uBn(a,s,e,n)),Promise.resolve(r))}async function i$(t,e,n){var r;const i=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(i){const o=await XXe(i,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function dBn(t,e){await i$("background",t,e)||await i$("background-image",t,e),await i$("mask",t,e)||await i$("mask-image",t,e)}async function hBn(t,e){const n=yl(t,HTMLImageElement);if(!(n&&!eJ(t.src))&&!(yl(t,SVGImageElement)&&!eJ(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await lue(r,aue(r),e);await new Promise((o,s)=>{t.onload=o,t.onerror=s;const a=t;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),n?(t.srcset="",t.src=i):t.href.baseVal=i})}async function pBn(t,e){const r=Sg(t.childNodes).map(i=>YXe(i,e));await Promise.all(r).then(()=>t)}async function YXe(t,e){yl(t,Element)&&(await dBn(t,e),await hBn(t,e),await pBn(t,e))}function gBn(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 COe={};async function OOe(t){let e=COe[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},COe[t]=e,e}async function EOe(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,t.url).href),GXe(a,e.fetchRequestInit,({result:l})=>(n=n.replace(s,`url(${l})`),[s,l]))});return Promise.all(o).then(()=>n)}function TOe(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,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(s,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=a.exec(r),l===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;e.push(l[0])}return e}async function mBn(t,e){const n=[],r=[];return t.forEach(i=>{if("cssRules"in i)try{Sg(i.cssRules||[]).forEach((o,s)=>{if(o.type===CSSRule.IMPORT_RULE){let a=s+1;const l=o.href,c=OOe(l).then(u=>EOe(u,e)).then(u=>TOe(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?a+=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 s=t.find(a=>a.href==null)||document.styleSheets[0];i.href!=null&&r.push(OOe(i.href).then(a=>EOe(a,e)).then(a=>TOe(a).forEach(l=>{s.insertRule(l,i.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(t.forEach(i=>{if("cssRules"in i)try{Sg(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function vBn(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>qXe(e.style.getPropertyValue("src")))}async function yBn(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Sg(t.ownerDocument.styleSheets),r=await mBn(n,e);return vBn(r)}async function xBn(t,e){const n=await yBn(t,e);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return XXe(i.cssText,o,e)}))).join(` -`)}async function bBn(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await xBn(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 wBn(t,e={}){const{width:n,height:r}=VXe(t,e),i=await o8(t,e,!0);return await bBn(i,e),await YXe(i,e),gBn(i,e),await z4n(i,n,r)}async function QXe(t,e={}){const{width:n,height:r}=VXe(t,e),i=await wBn(t,e),o=await sj(i),s=document.createElement("canvas"),a=s.getContext("2d"),l=e.pixelRatio||$4n(),c=e.canvasWidth||n,u=e.canvasHeight||r;return s.width=c*l,s.height=u*l,e.skipAutoScale||F4n(s),s.style.width=`${c}`,s.style.height=`${u}`,e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}async function _Bn(t,e={}){return(await QXe(t,e)).toDataURL()}async function SBn(t,e={}){return(await QXe(t,e)).toDataURL("image/jpeg",e.quality||1)}const kOe={png:_Bn,jpeg:SBn};function CBn(t,e){OBn(t,e).then(()=>{e!=null&&e.handleSuccess&&e.handleSuccess()}).catch(n=>{if(e!=null&&e.handleError)e.handleError(n);else throw n})}async function OBn(t,e={}){const n=t,r=e.format||"png";if(!(r in kOe))throw new Error(`Image format '${r}' is unknown or not supported.`);const i=await kOe[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}),s=await(await fetch(i)).blob();await navigator.clipboard.write([new ClipboardItem({"image/png":s})])}function KXe({elementRef:t,postMessage:e}){const n=()=>{e("success",pe.get("Snapshot copied to clipboard"))},r=o=>{const s="Error copying snapshot to clipboard";console.error(s+":",o),e("error",pe.get(s))},i=()=>{t.current?CBn(t.current,{format:"png",width:2e3,handleSuccess:n,handleError:r}):r(new Error("missing element reference"))};return C.jsx(au,{tooltipText:pe.get("Copy snapshot of chart to clipboard"),onClick:i,icon:C.jsx(M4n,{fontSize:"inherit"})})}function EBn({sx:t,timeSeriesGroupId:e,placeGroupTimeSeries:n,addPlaceGroupTimeSeries:r}){const[i,o]=he.useState(null),s=f=>{o(f.currentTarget)},a=()=>{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(C.jsx(Br,{onClick:()=>l(f.timeSeries[d]),children:h},h))})});const u=!!i;return C.jsxs(C.Fragment,{children:[C.jsx(Gt,{size:"small",sx:t,"aria-label":"Add","aria-controls":u?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:s,disabled:c.length===0,children:C.jsx(Mt,{arrow:!0,title:pe.get("Add time-series from places"),children:C.jsx(kU,{fontSize:"inherit"})})}),C.jsx(Ny,{id:"basic-menu",anchorEl:i,open:u,onClose:a,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const o$={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 TBn({anchorEl:t,valueRange:e,setValueRange:n}){const[r,i]=D.useState(e?[e[0]+"",e[1]+""]:["0","1"]);if(!t)return null;const o=[Number.parseFloat(r[0]),Number.parseFloat(r[1])],s=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 C.jsx(e1,{anchorEl:t,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:C.jsxs(ot,{sx:o$.container,children:[C.jsxs(ot,{component:"form",sx:o$.minMaxBox,children:[C.jsx(Jr,{sx:o$.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!s,onChange:f=>a(f)}),C.jsx(Jr,{sx:o$.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!s,onChange:f=>l(f)})]}),C.jsx(iD,{onDone:c,doneDisabled:!s,onCancel:u,size:"medium"})]})})}const s$="stddev",D0={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 kBn({timeSeriesGroup:t,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n,removeTimeSeriesGroup:r,resetZoom:i,loading:o,zoomed:s,zoomMode:a,setZoomMode:l,showTooltips:c,setShowTooltips:u,chartType:f,setChartType:d,stdevBarsDisabled:h,stdevBars:p,setStdevBars:g,valueRange:m,setValueRange:v,chartElement:y,postMessage:x}){const b=D.useRef(null),[w,_]=D.useState(!1),S=()=>{_(!w)},O=E=>{_(!1),E&&v(E)},k=(E,P)=>{const A=new Set(P),R=A.has(s$);A.delete(s$),A.delete(f),P=Array.from(A),d(P.length===1?P[0]:f),g(R)};return C.jsx(ot,{sx:D0.headerContainer,children:C.jsxs(ot,{sx:D0.actionsContainer,children:[s&&C.jsx(Mt,{arrow:!0,title:pe.get("Zoom to full range"),children:C.jsx(Gt,{sx:D0.actionButton,onClick:i,size:"small",children:C.jsx(k4n,{fontSize:"inherit"})},"zoomOutButton")}),C.jsx(Mt,{arrow:!0,title:pe.get("Toggle zoom mode (or press CTRL key)"),children:C.jsx(xr,{value:"zoomMode",selected:a,onClick:()=>l(!a),size:"small",children:C.jsx(C4n,{fontSize:"inherit"})})}),C.jsx(TBn,{anchorEl:w?b.current:null,valueRange:m,setValueRange:O}),C.jsx(Mt,{arrow:!0,title:pe.get("Enter fixed y-range"),children:C.jsx(xr,{ref:b,value:"valueRange",selected:w,onClick:S,size:"small",children:C.jsx(T4n,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Toggle showing info popup on hover"),children:C.jsx(xr,{value:"showTooltips",selected:c,onClick:()=>u(!c),size:"small",children:C.jsx(E4n,{fontSize:"inherit"})})}),C.jsxs(tO,{value:p?[f,s$]:[f],onChange:k,size:"small",sx:D0.chartTypes,children:[C.jsx(Mt,{arrow:!0,title:pe.get("Show points"),children:C.jsx(xr,{value:"point",size:"small",children:C.jsx(A4n,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Show lines"),children:C.jsx(xr,{value:"line",size:"small",children:C.jsx(P4n,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Show bars"),children:C.jsx(xr,{value:"bar",size:"small",children:C.jsx(O4n,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Show standard deviation (if any)"),children:C.jsx(xr,{value:s$,size:"small",disabled:h,children:C.jsx(WXe,{fontSize:"inherit"})})})]}),C.jsx(KXe,{elementRef:y,postMessage:x}),C.jsx(EBn,{sx:D0.actionButton,timeSeriesGroupId:t.id,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n}),o?C.jsx(Ly,{size:24,sx:D0.actionButton,color:"secondary"}):C.jsx(Gt,{sx:D0.actionButton,"aria-label":"Close",onClick:()=>r(t.id),size:"small",children:C.jsx(GO,{fontSize:"inherit"})})]})})}const ABn=oa("div")(({theme:t})=>({userSelect:"none",marginTop:t.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),PBn={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function MBn({timeSeriesGroup:t,selectTimeSeries:e,selectedTime:n,selectTime:r,selectedTimeRange:i,selectTimeRange:o,places:s,selectPlace:a,placeInfos:l,dataTimeRange:c,chartTypeDefault:u,includeStdev:f,removeTimeSeries:d,removeTimeSeriesGroup:h,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,postMessage:m}){const v=Zb(),[y,x]=D.useState(!1),[b,w]=D.useState(!0),[_,S]=D.useState(u),[O,k]=D.useState(f),[E,P]=D.useState({}),A=D.useRef(),R=D.useRef(),T=D.useRef(),M=D.useRef(null),I=D.useRef(null),z=D.useMemo(()=>{const W=new Map;t.timeSeriesArray.forEach((se,ye)=>{const ie=`v${ye}`,fe=`ev${ye}`,Q=se.source.valueDataKey,_e=se.source.errorDataKey;se.data.forEach(we=>{const Ie=W.get(we.time);let Pe;Ie===void 0?(Pe={time:we.time},W.set(we.time,Pe)):Pe=Ie;const Re=we[Q];if(yr(Re)&&isFinite(Re)&&(Pe[ie]=Re),_e){const Te=we[_e];yr(Te)&&isFinite(Te)&&(Pe[fe]=Te)}})});const J=Array.from(W.values());return J.sort((se,ye)=>se.time-ye.time),J},[t]),F=D.useMemo(()=>t.timeSeriesArray.map(W=>W.dataProgress?W.dataProgress:0),[t]),N=F.reduce((W,J)=>W+J,0)/F.length,L=N>0&&N<1,B=!!i&&!o_t(i,c||null);t.timeSeriesArray.forEach(W=>{W.source.valueDataKey});const $=t.variableUnits||pe.get("unknown units"),j=`${pe.get("Quantity")} (${$})`,X=v.palette.primary.light,V=v.palette.primary.main,Y=v.palette.text.primary,le=()=>{yr(E.x1)&&P({})},K=W=>{if(!W)return;const{chartX:J,chartY:se}=W;if(!yr(J)||!yr(se))return;const ye=Z(J,se);if(ye){const[ie,fe]=ye;P({x1:ie,y1:fe})}},ee=(W,J)=>{const{x1:se,y1:ye}=E;if(!yr(se)||!yr(ye)||!W)return;const{chartX:ie,chartY:fe}=W;if(!yr(ie)||!yr(fe))return;const Q=Z(ie,fe);if(Q){const[_e,we]=Q;J.ctrlKey||y?_e!==se&&we!==ye&&P({x1:se,y1:ye,x2:_e,y2:we}):_e!==se&&P({x1:se,y1:ye,x2:_e})}},re=W=>{const[J,se]=AOe(E);le(),J&&J[0]{le()},te=()=>{le()},ae=W=>{d(t.id,W)},U=()=>{le(),o(c||null,t.id,null)},oe=W=>{W&&o(i,t.id,W)},ne=(W,J)=>{if(T.current=[W,J],M.current){const se=M.current.getElementsByClassName("recharts-legend-wrapper");se.length!==0&&(I.current=se.item(0))}},G=([W,J])=>{const se=(J-W)*.1;return i?A.current=i:A.current=[W-se,J+se],A.current},q=([W,J])=>{const se=(J-W)*.1;if(t.variableRange)R.current=t.variableRange;else{const ye=W-se;R.current=[ye<0&&W-1e-6>0?0:ye,J+se]}return R.current},Z=(W,J)=>{const se=I.current;if(!T.current||!A.current||!R.current||!se)return;const[ye,ie]=A.current,[fe,Q]=R.current,[_e,we]=T.current,Ie=se.clientHeight,Pe=65,Re=5,Te=5,Le=38,ue=_e-Pe-Te,$e=we-Re-Le-Ie,Se=(W-Pe)/ue,Ye=(J-Re)/$e;return[ye+Se*(ie-ye),Q-Ye*(Q-fe)]},[de,xe]=AOe(E),H=_==="bar"?g4n:p4n;return C.jsxs(ABn,{children:[C.jsx(kBn,{timeSeriesGroup:t,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,removeTimeSeriesGroup:h,resetZoom:U,loading:L,zoomed:B,zoomMode:y,setZoomMode:x,showTooltips:b,setShowTooltips:w,chartType:_,setChartType:S,stdevBarsDisabled:!f,stdevBars:O,setStdevBars:k,valueRange:R.current,setValueRange:oe,chartElement:M,postMessage:m}),C.jsx(Cqe,{width:"98%",onResize:ne,ref:M,children:C.jsxs(H,{onMouseDown:K,onMouseMove:ee,onMouseUp:re,onMouseEnter:me,onMouseLeave:te,syncId:"anyId",style:{color:Y,fontSize:"0.8em"},data:z,barGap:1,barSize:30,maxBarSize:30,children:[C.jsx(I1,{dataKey:"time",type:"number",tickCount:6,domain:G,tickFormatter:v4n,stroke:Y,allowDataOverflow:!0}),C.jsx(L1,{type:"number",tickCount:5,domain:q,tickFormatter:y4n,stroke:Y,allowDataOverflow:!0,label:{...PBn,value:j}}),C.jsx(oue,{strokeDasharray:"3 3"}),b&&!yr(E.x1)&&C.jsx(Rd,{content:C.jsx(_4n,{})}),C.jsx(MC,{content:C.jsx(x4n,{removeTimeSeries:ae})}),t.timeSeriesArray.map((W,J)=>S4n({timeSeriesGroup:t,timeSeriesIndex:J,selectTimeSeries:e,places:s,selectPlace:a,placeGroupTimeSeries:p,placeInfos:l,chartType:_,stdevBars:O,paletteMode:v.palette.mode})),de&&C.jsx(D1,{x1:de[0],y1:xe?xe[0]:void 0,x2:de[1],y2:xe?xe[1]:void 0,strokeOpacity:.3,fill:X,fillOpacity:.3}),n!==null&&C.jsx(xD,{isFront:!0,x:n,stroke:V,strokeWidth:3,strokeOpacity:.5})]})})]})}function AOe(t){const{x1:e,x2:n,y1:r,y2:i}=t;let o,s;return yr(e)&&yr(n)&&(o=eC.jsx(MBn,{timeSeriesGroup:l,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,...a},l.id))]})}const $Bn=t=>({locale:t.controlState.locale,timeSeriesGroups:t.dataState.timeSeriesGroups,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,dataTimeRange:eSt(t),chartTypeDefault:t.controlState.timeSeriesChartTypeDefault,includeStdev:t.controlState.timeSeriesIncludeStdev,placeInfos:aSt(t),places:KM(t),placeGroupTimeSeries:d_t(t),canAddTimeSeries:nIe(t)}),FBn={selectTime:sU,selectTimeRange:S8e,removeTimeSeries:IKt,removeTimeSeriesGroup:LKt,selectPlace:oU,addPlaceGroupTimeSeries:DKt,addTimeSeries:iU,postMessage:_s},NBn=Rn($Bn,FBn)(LBn),zBn=lt(C.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 jBn(t){return t.count===0}function BBn(t){return t.count===1}function UBn(t){return t.count>1}function WBn({statisticsRecord:t}){const e=t.statistics;return C.jsx(Jee,{size:"small",children:C.jsx(ete,{children:jBn(e)?C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Value")}),C.jsx(ui,{align:"right",children:"NaN"})]}):BBn(e)?C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Value")}),C.jsx(ui,{align:"right",children:$2(e.mean)})]}):C.jsxs(C.Fragment,{children:[C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Count")}),C.jsx(ui,{align:"right",children:e.count})]}),C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Minimum")}),C.jsx(ui,{align:"right",children:$2(e.minimum)})]}),C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Maximum")}),C.jsx(ui,{align:"right",children:$2(e.maximum)})]}),C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Mean")}),C.jsx(ui,{align:"right",children:$2(e.mean)})]}),C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Deviation")}),C.jsx(ui,{align:"right",children:$2(e.deviation)})]})]})})})}function $2(t){return by(t,3)}function VBn({statisticsRecord:t,showBrush:e,showDetails:n}){const r=To(),i=t.statistics,o=D.useMemo(()=>{if(!i.histogram)return null;const{values:y,edges:x}=i.histogram;return y.map((b,w)=>({x:.5*(x[w]+x[w+1]),y:b,i:w}))},[i]),[s,a]=D.useState([0,o?o.length-1:-1]);if(D.useEffect(()=>{o&&a([0,o.length-1])},[o]),o===null)return null;const{placeInfo:l}=t.source,[c,u]=s,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),g=r.palette.text.primary,m=r.palette.text.primary,v=({startIndex:y,endIndex:x})=>{yr(y)&&yr(x)&&a([y,x])};return C.jsx(Cqe,{width:"100%",height:"100%",children:C.jsxs(m4n,{data:o,margin:{top:0,right:e?30:5,bottom:1,left:2},style:{color:m,fontSize:"0.8em"},children:[C.jsx(oue,{strokeDasharray:"3 3"}),C.jsx(I1,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>by(y,2)}),C.jsx(L1,{}),C.jsx(u0,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&C.jsx(xD,{x:i.mean,isFront:!0,stroke:g,strokeWidth:2,strokeOpacity:.5}),n&&C.jsx(D1,{x1:h,x2:p,isFront:!1,stroke:g,strokeWidth:1,strokeOpacity:.3,fill:g,fillOpacity:.05}),e&&C.jsx(Vb,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>by(o[y].x,1),onChange:v})]})})}const a$={container:{padding:1,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function l$({phrase:t}){return C.jsx("span",{style:{color:"red"},children:`<${pe.get(t)}?>`})}function ZXe({dataset:t,variable:e,time:n,placeInfo:r,actions:i,body:o,containerRef:s}){const a=t?t.title:C.jsx(l$,{phrase:"Dataset"}),l=e?e.name:C.jsx(l$,{phrase:"Variable"}),c=t==null?void 0:t.dimensions.some(d=>d.name=="time"),u=n?NMe(n):c?C.jsx(l$,{phrase:"Time"}):null,f=r?r.label:C.jsx(l$,{phrase:"Place"});return C.jsxs(ot,{sx:a$.container,ref:s,children:[C.jsxs(ot,{sx:a$.header,children:[C.jsxs(Jt,{fontSize:"small",children:[a," / ",l,u&&`, ${u}`,", ",f]}),C.jsx(ot,{sx:a$.actions,children:i})]}),o&&C.jsx(ot,{sx:a$.body,children:o})]})}const POe={table:{flexGrow:0},chart:{flexGrow:1}};function GBn({locale:t,statisticsRecord:e,rowIndex:n,removeStatistics:r,postMessage:i}){const o=D.useRef(null),[s,a]=D.useState(!1),[l,c]=D.useState(!1),{dataset:u,variable:f,time:d,placeInfo:h}=e.source,p=UBn(e.statistics),g=()=>{c(!l)},m=()=>{a(!s)},v=()=>{r(n)};return C.jsx(ZXe,{dataset:u,variable:f,time:d,placeInfo:h,containerRef:o,actions:C.jsxs(C.Fragment,{children:[p&&C.jsxs(tO,{size:"small",children:[C.jsx(Mt,{arrow:!0,title:pe.get("Toggle adjustable x-range"),children:C.jsx(xr,{selected:s,onClick:m,value:"brush",size:"small",children:C.jsx(zBn,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Show standard deviation (if any)"),children:C.jsx(xr,{selected:l,onClick:g,value:"details",size:"small",children:C.jsx(WXe,{fontSize:"inherit"})})})]}),p&&C.jsx(KXe,{elementRef:o,postMessage:i}),C.jsx(Gt,{size:"small",onClick:v,children:C.jsx(GO,{fontSize:"inherit"})})]}),body:C.jsxs(C.Fragment,{children:[C.jsx(ot,{sx:POe.table,children:C.jsx(WBn,{locale:t,statisticsRecord:e})}),C.jsx(ot,{sx:POe.chart,children:C.jsx(VBn,{showBrush:s,showDetails:l,statisticsRecord:e})})]})})}const HBn={progress:{color:"primary"}};function qBn({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:s}){return C.jsx(ZXe,{dataset:t,variable:e,time:n,placeInfo:r,actions:s?C.jsx(Ly,{size:20,sx:HBn.progress}):C.jsx(Gt,{size:"small",disabled:!i,onClick:o,color:"primary",children:C.jsx(kU,{fontSize:"inherit"})})})}const XBn={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function YBn({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,statisticsLoading:i,statisticsRecords:o,canAddStatistics:s,addStatistics:a,removeStatistics:l,postMessage:c}){return C.jsxs(ot,{sx:XBn.container,children:[C.jsx(qBn,{selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:s,addStatistics:a,statisticsLoading:i}),o.map((u,f)=>C.jsx(GBn,{statisticsRecord:u,rowIndex:f,removeStatistics:l,postMessage:c},f))]})}const QBn=t=>({selectedDataset:fo(t),selectedVariable:za(t),selectedTime:c1(t),selectedPlaceInfo:ZM(t),statisticsLoading:u_t(t),statisticsRecords:lSt(t),canAddStatistics:rIe(t)}),KBn={addStatistics:XUe,removeStatistics:MKt,postMessage:_s},ZBn=Rn(QBn,KBn)(YBn);/** +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zXe(t,e){if(t){if(typeof t=="string")return ZZ(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 ZZ(t,e)}}function e4n(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function t4n(t){if(Array.isArray(t))return ZZ(t)}function ZZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?s:e&&e.length&&at(i)&&at(o)?e.slice(i,o+1):[]};function UXe(t){return t==="number"?[0,"auto"]:void 0}var JZ=function(e,n,r,i){var o=e.graphicalItems,s=e.tooltipAxis,a=i8(n,e);return r<0||!o||!o.length||r>=a.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(s.dataKey&&!s.allowDuplicatedCategory){var h=f===void 0?a:f;d=Oz(h,s.dataKey,i)}else d=f&&f[r]||a[r];return d?[].concat(UC(l),[Yqe(c,d)]):l},[])},vOe=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},s=o4n(o,r),a=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=fLn(s,a,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=JZ(e,n,u,f),h=s4n(r,a,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},a4n=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=e.stackOffset,h=Hqe(u,o);return r.reduce(function(p,g){var m,v=g.props,y=v.type,x=v.dataKey,b=v.allowDataOverflow,w=v.allowDuplicatedCategory,_=v.scale,S=v.ticks,O=v.includeHidden,k=g.props[s];if(p[k])return p;var E=i8(e.data,{graphicalItems:i.filter(function($){return $.props[s]===k}),dataStartIndex:l,dataEndIndex:c}),P=E.length,A,R,T;Ijn(g.props.domain,b,y)&&(A=wZ(g.props.domain,null,b),h&&(y==="number"||_!=="auto")&&(T=Ak(E,x,"category")));var M=UXe(y);if(!A||A.length===0){var I,z=(I=g.props.domain)!==null&&I!==void 0?I:M;if(x){if(A=Ak(E,x,y),y==="category"&&h){var F=mCn(A);w&&F?(R=A,A=Yz(0,P)):w||(A=XSe(z,A,g).reduce(function($,j){return $.indexOf(j)>=0?$:[].concat(UC($),[j])},[]))}else if(y==="category")w?A=A.filter(function($){return $!==""&&!wn($)}):A=XSe(z,A,g).reduce(function($,j){return $.indexOf(j)>=0||j===""||wn(j)?$:[].concat(UC($),[j])},[]);else if(y==="number"){var N=mLn(E,i.filter(function($){return $.props[s]===k&&(O||!$.props.hide)}),x,o,u);N&&(A=N)}h&&(y==="number"||_!=="auto")&&(T=Ak(E,x,"category"))}else h?A=Yz(0,P):a&&a[k]&&a[k].hasStack&&y==="number"?A=d==="expand"?[0,1]:Xqe(a[k].stackGroups,l,c):A=Gqe(E,i.filter(function($){return $.props[s]===k&&(O||!$.props.hide)}),y,u,!0);if(y==="number")A=QZ(f,A,k,o,S),z&&(A=wZ(z,A,b));else if(y==="category"&&z){var L=z,B=A.every(function($){return L.indexOf($)>=0});B&&(A=L)}}return Ge(Ge({},p),{},Yt({},k,Ge(Ge({},g.props),{},{axisType:o,domain:A,categoricalDomain:T,duplicateDomain:R,originalDomain:(m=g.props.domain)!==null&&m!==void 0?m:M,isCategorical:h,layout:u})))},{})},l4n=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=i8(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=Hqe(u,o),g=-1;return r.reduce(function(m,v){var y=v.props[s],x=UXe("number");if(!m[y]){g++;var b;return p?b=Yz(0,h):a&&a[y]&&a[y].hasStack?(b=Xqe(a[y].stackGroups,l,c),b=QZ(f,b,y,o)):(b=wZ(x,Gqe(d,r.filter(function(w){return w.props[s]===y&&!w.props.hide}),"number",u),i.defaultProps.allowDataOverflow),b=QZ(f,b,y,o)),Ge(Ge({},m),{},Yt({},y,Ge(Ge({axisType:o},i.defaultProps),{},{hide:!0,orientation:mu(r4n,"".concat(o,".").concat(g%2),null),domain:b,originalDomain:x,isCategorical:p,layout:u})))}return m},{})},c4n=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),d=vu(u,o),h={};return d&&d.length?h=a4n(e,{axes:d,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c}):s&&s.length&&(h=l4n(e,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c})),h},u4n=function(e){var n=sv(e),r=ng(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Gce(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:jz(n,r)}},yOe=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ql(n,Vb),o=0,s=0;return e.data&&e.data.length!==0&&(s=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},f4n=function(e){return!e||!e.length?!1:e.some(function(n){var r=xg(n&&n.type);return r&&r.indexOf("Bar")>=0})},xOe=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"}},d4n=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,s=o===void 0?{}:o,a=e.yAxisMap,l=a===void 0?{}:a,c=r.width,u=r.height,f=r.children,d=r.margin||{},h=Ql(f,Vb),p=Ql(f,MC),g=Object.keys(l).reduce(function(w,_){var S=l[_],O=S.orientation;return!S.mirror&&!S.hide?Ge(Ge({},w),{},Yt({},O,w[O]+S.width)):w},{left:d.left||0,right:d.right||0}),m=Object.keys(s).reduce(function(w,_){var S=s[_],O=S.orientation;return!S.mirror&&!S.hide?Ge(Ge({},w),{},Yt({},O,mu(w,"".concat(O))+S.height)):w},{top:d.top||0,bottom:d.bottom||0}),v=Ge(Ge({},m),g),y=v.bottom;h&&(v.bottom+=h.props.height||Vb.defaultProps.height),p&&n&&(v=pLn(v,i,r,n));var x=c-v.left-v.right,b=u-v.top-v.bottom;return Ge(Ge({brushBottom:y},v),{},{width:Math.max(x,0),height:Math.max(b,0)})},h4n=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},sue=function(e){var n,r=e.chartName,i=e.GraphicalChild,o=e.defaultTooltipEventType,s=o===void 0?"axis":o,a=e.validateTooltipEventTypes,l=a===void 0?["axis"]:a,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,d=e.defaultProps,h=function(m,v){var y=v.graphicalItems,x=v.stackGroups,b=v.offset,w=v.updateId,_=v.dataStartIndex,S=v.dataEndIndex,O=m.barSize,k=m.layout,E=m.barGap,P=m.barCategoryGap,A=m.maxBarSize,R=xOe(k),T=R.numericAxisName,M=R.cateAxisName,I=f4n(y),z=[];return y.forEach(function(F,N){var L=i8(m.data,{graphicalItems:[F],dataStartIndex:_,dataEndIndex:S}),B=F.props,$=B.dataKey,j=B.maxBarSize,X=F.props["".concat(T,"Id")],V=F.props["".concat(M,"Id")],Y={},le=c.reduce(function(de,xe){var H=v["".concat(xe.axisType,"Map")],W=F.props["".concat(xe.axisType,"Id")];H&&H[W]||xe.axisType==="zAxis"||Wb();var J=H[W];return Ge(Ge({},de),{},Yt(Yt({},xe.axisType,J),"".concat(xe.axisType,"Ticks"),ng(J)))},Y),K=le[M],ee=le["".concat(M,"Ticks")],re=x&&x[X]&&x[X].hasStack&&kLn(F,x[X].stackGroups),me=xg(F.type).indexOf("Bar")>=0,te=jz(K,ee),ae=[],U=I&&dLn({barSize:O,stackGroups:x,totalSize:h4n(le,M)});if(me){var oe,ne,G=wn(j)?A:j,q=(oe=(ne=jz(K,ee,!0))!==null&&ne!==void 0?ne:G)!==null&&oe!==void 0?oe:0;ae=hLn({barGap:E,barCategoryGap:P,bandSize:q!==te?q:te,sizeList:U[V],maxBarSize:G}),q!==te&&(ae=ae.map(function(de){return Ge(Ge({},de),{},{position:Ge(Ge({},de.position),{},{offset:de.position.offset-q/2})})}))}var Z=F&&F.type&&F.type.getComposedData;Z&&z.push({props:Ge(Ge({},Z(Ge(Ge({},le),{},{displayedData:L,props:m,dataKey:$,item:F,bandSize:te,barPosition:ae,offset:b,stackedData:re,layout:k,dataStartIndex:_,dataEndIndex:S}))),{},Yt(Yt(Yt({key:F.key||"item-".concat(N)},T,le[T]),M,le[M]),"animationId",w)),childIndex:TCn(F,m.children),item:F})}),z},p=function(m,v){var y=m.props,x=m.dataStartIndex,b=m.dataEndIndex,w=m.updateId;if(!A_e({props:y}))return null;var _=y.children,S=y.layout,O=y.stackOffset,k=y.data,E=y.reverseStackOrder,P=xOe(S),A=P.numericAxisName,R=P.cateAxisName,T=vu(_,i),M=OLn(k,T,"".concat(A,"Id"),"".concat(R,"Id"),O,E),I=c.reduce(function(B,$){var j="".concat($.axisType,"Map");return Ge(Ge({},B),{},Yt({},j,c4n(y,Ge(Ge({},$),{},{graphicalItems:T,stackGroups:$.axisType===A&&M,dataStartIndex:x,dataEndIndex:b}))))},{}),z=d4n(Ge(Ge({},I),{},{props:y,graphicalItems:T}),v==null?void 0:v.legendBBox);Object.keys(I).forEach(function(B){I[B]=f(y,I[B],z,B.replace("Map",""),r)});var F=I["".concat(R,"Map")],N=u4n(F),L=h(y,Ge(Ge({},I),{},{dataStartIndex:x,dataEndIndex:b,updateId:w,graphicalItems:T,stackGroups:M,offset:z}));return Ge(Ge({formattedGraphicalItems:L,graphicalItems:T,offset:z,stackGroups:M},N),I)};return n=function(g){Zjn(m,g);function m(v){var y,x,b;return qjn(this,m),b=Qjn(this,m,[v]),Yt(Wn(b),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Yt(Wn(b),"accessibilityManager",new Djn),Yt(Wn(b),"handleLegendBBoxUpdate",function(w){if(w){var _=b.state,S=_.dataStartIndex,O=_.dataEndIndex,k=_.updateId;b.setState(Ge({legendBBox:w},p({props:b.props,dataStartIndex:S,dataEndIndex:O,updateId:k},Ge(Ge({},b.state),{},{legendBBox:w}))))}}),Yt(Wn(b),"handleReceiveSyncEvent",function(w,_,S){if(b.props.syncId===w){if(S===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(_)}}),Yt(Wn(b),"handleBrushChange",function(w){var _=w.startIndex,S=w.endIndex;if(_!==b.state.dataStartIndex||S!==b.state.dataEndIndex){var O=b.state.updateId;b.setState(function(){return Ge({dataStartIndex:_,dataEndIndex:S},p({props:b.props,dataStartIndex:_,dataEndIndex:S,updateId:O},b.state))}),b.triggerSyncEvent({dataStartIndex:_,dataEndIndex:S})}}),Yt(Wn(b),"handleMouseEnter",function(w){var _=b.getMouseInfo(w);if(_){var S=Ge(Ge({},_),{},{isTooltipActive:!0});b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseEnter;mn(O)&&O(S,w)}}),Yt(Wn(b),"triggeredAfterMouseMove",function(w){var _=b.getMouseInfo(w),S=_?Ge(Ge({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseMove;mn(O)&&O(S,w)}),Yt(Wn(b),"handleItemMouseEnter",function(w){b.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Yt(Wn(b),"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Yt(Wn(b),"handleMouseMove",function(w){w.persist(),b.throttleTriggeredAfterMouseMove(w)}),Yt(Wn(b),"handleMouseLeave",function(w){b.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};b.setState(_),b.triggerSyncEvent(_);var S=b.props.onMouseLeave;mn(S)&&S(_,w)}),Yt(Wn(b),"handleOuterEvent",function(w){var _=ECn(w),S=mu(b.props,"".concat(_));if(_&&mn(S)){var O,k;/.*touch.*/i.test(_)?k=b.getMouseInfo(w.changedTouches[0]):k=b.getMouseInfo(w),S((O=k)!==null&&O!==void 0?O:{},w)}}),Yt(Wn(b),"handleClick",function(w){var _=b.getMouseInfo(w);if(_){var S=Ge(Ge({},_),{},{isTooltipActive:!0});b.setState(S),b.triggerSyncEvent(S);var O=b.props.onClick;mn(O)&&O(S,w)}}),Yt(Wn(b),"handleMouseDown",function(w){var _=b.props.onMouseDown;if(mn(_)){var S=b.getMouseInfo(w);_(S,w)}}),Yt(Wn(b),"handleMouseUp",function(w){var _=b.props.onMouseUp;if(mn(_)){var S=b.getMouseInfo(w);_(S,w)}}),Yt(Wn(b),"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Yt(Wn(b),"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseDown(w.changedTouches[0])}),Yt(Wn(b),"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseUp(w.changedTouches[0])}),Yt(Wn(b),"triggerSyncEvent",function(w){b.props.syncId!==void 0&&K7.emit(Z7,b.props.syncId,w,b.eventEmitterSymbol)}),Yt(Wn(b),"applySyncEvent",function(w){var _=b.props,S=_.layout,O=_.syncMethod,k=b.state.updateId,E=w.dataStartIndex,P=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)b.setState(Ge({dataStartIndex:E,dataEndIndex:P},p({props:b.props,dataStartIndex:E,dataEndIndex:P,updateId:k},b.state)));else if(w.activeTooltipIndex!==void 0){var A=w.chartX,R=w.chartY,T=w.activeTooltipIndex,M=b.state,I=M.offset,z=M.tooltipTicks;if(!I)return;if(typeof O=="function")T=O(z,w);else if(O==="value"){T=-1;for(var F=0;F=0){var re,me;if(A.dataKey&&!A.allowDuplicatedCategory){var te=typeof A.dataKey=="function"?ee:"payload.".concat(A.dataKey.toString());re=Oz(F,te,T),me=N&&L&&Oz(L,te,T)}else re=F==null?void 0:F[R],me=N&&L&&L[R];if(V||X){var ae=w.props.activeIndex!==void 0?w.props.activeIndex:R;return[D.cloneElement(w,Ge(Ge(Ge({},O.props),le),{},{activeIndex:ae})),null,null]}if(!wn(re))return[K].concat(UC(b.renderActivePoints({item:O,activePoint:re,basePoint:me,childIndex:R,isRange:N})))}else{var U,oe=(U=b.getItemByXY(b.state.activeCoordinate))!==null&&U!==void 0?U:{graphicalItem:K},ne=oe.graphicalItem,G=ne.item,q=G===void 0?w:G,Z=ne.childIndex,de=Ge(Ge(Ge({},O.props),le),{},{activeIndex:Z});return[D.cloneElement(q,de),null,null]}return N?[K,null,null]:[K,null]}),Yt(Wn(b),"renderCustomized",function(w,_,S){return D.cloneElement(w,Ge(Ge({key:"recharts-customized-".concat(S)},b.props),b.state))}),Yt(Wn(b),"renderMap",{CartesianGrid:{handler:r$,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:r$},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:r$},YAxis:{handler:r$},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:aE("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=Sqe(b.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),b.state={},b}return Yjn(m,[{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,w=y.height,_=y.layout,S=Ql(x,Rd);if(S){var O=S.props.defaultIndex;if(!(typeof O!="number"||O<0||O>this.state.tooltipTicks.length)){var k=this.state.tooltipTicks[O]&&this.state.tooltipTicks[O].value,E=JZ(this.state,b,O,k),P=this.state.tooltipTicks[O].coordinate,A=(this.state.offset.top+w)/2,R=_==="horizontal",T=R?{x:P,y:A}:{y:P,x:A},M=this.state.formattedGraphicalItems.find(function(z){var F=z.item;return F.type.name==="Scatter"});M&&(T=Ge(Ge({},T),M.props.points[O].tooltipPosition),E=M.props.points[O].tooltipPayload);var I={activeTooltipIndex:O,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:T};this.setState(I),this.renderCursor(S),this.accessibilityManager.setIndex(O)}}}},{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,w;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(y){qK([Ql(y.children,Rd)],[Ql(this.props.children,Rd)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=Ql(this.props.children,Rd);if(y&&typeof y.props.shared=="boolean"){var x=y.props.shared?"axis":"item";return l.indexOf(x)>=0?x:s}return s}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var x=this.container,b=x.getBoundingClientRect(),w=yDn(b),_={chartX:Math.round(y.pageX-w.left),chartY:Math.round(y.pageY-w.top)},S=b.width/x.offsetWidth||1,O=this.inRange(_.chartX,_.chartY,S);if(!O)return null;var k=this.state,E=k.xAxisMap,P=k.yAxisMap,A=this.getTooltipEventType();if(A!=="axis"&&E&&P){var R=sv(E).scale,T=sv(P).scale,M=R&&R.invert?R.invert(_.chartX):null,I=T&&T.invert?T.invert(_.chartY):null;return Ge(Ge({},_),{},{xValue:M,yValue:I})}var z=vOe(this.state,this.props.data,this.props.layout,O);return z?Ge(Ge({},_),z):null}},{key:"inRange",value:function(y,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=y/b,S=x/b;if(w==="horizontal"||w==="vertical"){var O=this.state.offset,k=_>=O.left&&_<=O.left+O.width&&S>=O.top&&S<=O.top+O.height;return k?{x:_,y:S}:null}var E=this.state,P=E.angleAxisMap,A=E.radiusAxisMap;if(P&&A){var R=sv(P);return KSe({x:_,y:S},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,x=this.getTooltipEventType(),b=Ql(y,Rd),w={};b&&x==="axis"&&(b.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var _=Ez(this.props,this.handleOuterEvent);return Ge(Ge({},_),w)}},{key:"addListener",value:function(){K7.on(Z7,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){K7.removeListener(Z7,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,x,b){for(var w=this.state.formattedGraphicalItems,_=0,S=w.length;_!yr(t)||!Number.isFinite(t)?"":fA(t),y4n=t=>t.toPrecision(3),eG={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function x4n({payload:t,removeTimeSeries:e}){return!t||t.length===0?null:C.jsx(ot,{sx:eG.legendContainer,children:t.map((n,r)=>C.jsxs(ot,{sx:{...eG.legendItem,color:n.color},children:[C.jsx("span",{children:n.value}),e&&C.jsx(ot,{component:"span",sx:eG.legendCloseIcon,onMouseUp:()=>e(r),children:C.jsx(xU,{fontSize:"small"})})]},n.value))})}const tG={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)})},b4n="#00000000",w4n="#FAFFDD";function _4n({active:t,label:e,payload:n}){if(!t||!yr(e)||!n||n.length===0)return null;const r=n.map((i,o)=>{const{name:s,value:a,unit:l,dataKey:c}=i;let u=i.color;if(!yr(a))return null;const f=s||"?",d=a.toFixed(3);u===b4n&&(u=w4n);let p=f.indexOf(":")!==-1?"":` (${c})`;return typeof l=="string"&&(p!==""?p=`${l} ${p}`:p=l),C.jsxs("div",{children:[C.jsxs("span",{children:[f,": "]}),C.jsx(ot,{component:"span",sx:tG.toolTipValue,style:{color:u},children:d}),C.jsxs("span",{children:[" ",p]})]},o)});return r?C.jsxs(ot,{sx:tG.toolTipContainer,children:[C.jsx(ot,{component:"span",sx:tG.toolTipLabel,children:`${sO(e)} UTC`}),r]}):null}function bOe({cx:t,cy:e,radius:n,stroke:r,fill:i,strokeWidth:o,symbol:s}){const l=n+.5*o,c=2*l,u=Math.floor(100*o/c+.5)+"%";let f;if(s==="diamond"){const g=1024*(n/c);f=C.jsx("polygon",{points:`${512-g},512 512,${512-g} ${512+g},512 512,${512+g}`,strokeWidth:u,stroke:r,fill:i})}else{const d=Math.floor(100*n/c+.5)+"%";f=C.jsx("circle",{cx:"50%",cy:"50%",r:d,strokeWidth:u,stroke:r,fill:i})}return yr(t)&&yr(e)?C.jsx("svg",{x:t-l,y:e-l,width:c,height:c,viewBox:"0 0 1024 1024",children:f}):null}function S4n({timeSeriesGroup:t,timeSeriesIndex:e,selectTimeSeries:n,places:r,selectPlace:i,placeInfos:o,placeGroupTimeSeries:s,paletteMode:a,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;s.forEach(b=>{if(x===null&&b.placeGroup.id===f.datasetId){const w=b.placeGroup.features;w.length>0&&w[0].properties&&(x=w[0].properties.color||null)}}),p=x||"red"}else if(o){const x=o[f.placeId];if(x){const{place:b,label:w,color:_}=x;if(b.geometry.type==="Point"){const S=b.geometry.coordinates[0],O=b.geometry.coordinates[1];h+=` (${w}: ${O.toFixed(5)},${S.toFixed(5)})`}else h+=` (${w})`;p=_}}const g=UPe(p,a);let m,v;u.source.placeId===null?(m=0,v={radius:5,strokeWidth:1.5,symbol:"diamond"}):(m=l==="point"?0:u.dataProgress,v={radius:3,strokeWidth:2,symbol:"circle"});const y=c&&f.valueDataKey&&f.errorDataKey&&C.jsx(hE,{dataKey:`ev${e}`,width:4,strokeWidth:1,stroke:g,strokeOpacity:.5});return l==="bar"?C.jsx(R1,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,fill:g,fillOpacity:m,isAnimationActive:!1,onClick:d,children:y},e):C.jsx(wD,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,dot:C.jsx(bOe,{...v,stroke:g,fill:"white"}),activeDot:C.jsx(bOe,{...v,stroke:"white",fill:g}),stroke:g,strokeOpacity:m,isAnimationActive:!1,onClick:d,children:y},e)}const C4n=lt(C.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"),O4n=lt(C.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart"),E4n=lt(C.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"),T4n=lt(C.jsx("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand"),k4n=lt(C.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"),WXe=lt(C.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"),A4n=lt([C.jsx("circle",{cx:"7",cy:"14",r:"3"},"0"),C.jsx("circle",{cx:"11",cy:"6",r:"3"},"1"),C.jsx("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot"),P4n=lt(C.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"),M4n=lt([C.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),C.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 R4n(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 D4n=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function Sg(t){const e=[];for(let n=0,r=t.length;n$l||t.height>$l)&&(t.width>$l&&t.height>$l?t.width>t.height?(t.height*=$l/t.width,t.width=$l):(t.width*=$l/t.height,t.height=$l):t.width>$l?(t.height*=$l/t.width,t.width=$l):(t.width*=$l/t.height,t.height=$l))}function sj(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 N4n(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function z4n(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),N4n(i)}const yl=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||yl(n,e)};function j4n(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function B4n(t){return Sg(t).map(e=>{const n=t.getPropertyValue(e),r=t.getPropertyPriority(e);return`${e}: ${n}${r?" !important":""};`}).join(" ")}function U4n(t,e,n){const r=`.${t}:${e}`,i=n.cssText?j4n(n):B4n(n);return document.createTextNode(`${r}{${i}}`)}function wOe(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=D4n();try{e.className=`${e.className} ${o}`}catch{return}const s=document.createElement("style");s.appendChild(U4n(o,n,r)),e.appendChild(s)}function W4n(t,e){wOe(t,e,":before"),wOe(t,e,":after")}const _Oe="application/font-woff",SOe="image/jpeg",V4n={woff:_Oe,woff2:_Oe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:SOe,jpeg:SOe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function G4n(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function aue(t){const e=G4n(t).toLowerCase();return V4n[e]||""}function H4n(t){return t.split(/,/)[1]}function eJ(t){return t.search(/^(data:)/)!==-1}function q4n(t,e){return`data:${e};base64,${t}`}async function GXe(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,s)=>{const a=new FileReader;a.onerror=s,a.onloadend=()=>{try{o(n({res:r,result:a.result}))}catch(l){s(l)}},a.readAsDataURL(i)})}const nG={};function X4n(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 lue(t,e,n){const r=X4n(t,e,n.includeQueryParams);if(nG[r]!=null)return nG[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await GXe(t,n.fetchRequestInit,({res:s,result:a})=>(e||(e=s.headers.get("Content-Type")||""),H4n(a)));i=q4n(o,e)}catch(o){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;o&&(s=typeof o=="string"?o:o.message),s&&console.warn(s)}return nG[r]=i,i}async function Y4n(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):sj(e)}async function Q4n(t,e){if(t.currentSrc){const o=document.createElement("canvas"),s=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,s==null||s.drawImage(t,0,0,o.width,o.height);const a=o.toDataURL();return sj(a)}const n=t.poster,r=aue(n),i=await lue(n,r,e);return sj(i)}async function K4n(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await o8(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function Z4n(t,e){return yl(t,HTMLCanvasElement)?Y4n(t):yl(t,HTMLVideoElement)?Q4n(t,e):yl(t,HTMLIFrameElement)?K4n(t):t.cloneNode(!1)}const J4n=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function eBn(t,e,n){var r,i;let o=[];return J4n(t)&&t.assignedNodes?o=Sg(t.assignedNodes()):yl(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=Sg(t.contentDocument.body.childNodes):o=Sg(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||yl(t,HTMLVideoElement)||await o.reduce((s,a)=>s.then(()=>o8(a,n)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function tBn(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Sg(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`),yl(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 nBn(t,e){yl(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),yl(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function rBn(t,e){if(yl(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(i=>t.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function iBn(t,e){return yl(e,Element)&&(tBn(t,e),W4n(t,e),nBn(t,e),rBn(t,e)),e}async function oBn(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let o=0;oZ4n(r,e)).then(r=>eBn(t,r,e)).then(r=>iBn(t,r)).then(r=>oBn(r,e))}const HXe=/url\((['"]?)([^'"]+?)\1\)/g,sBn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,aBn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lBn(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function cBn(t){const e=[];return t.replace(HXe,(n,r,i)=>(e.push(i),n)),e.filter(n=>!eJ(n))}async function uBn(t,e,n,r,i){try{const o=n?R4n(e,n):e,s=aue(e);let a;return i||(a=await lue(o,s,r)),t.replace(lBn(e),`$1${a}$3`)}catch{}return t}function fBn(t,{preferredFontFormat:e}){return e?t.replace(aBn,n=>{for(;;){const[r,,i]=sBn.exec(n)||[];if(!i)return"";if(i===e)return`src: ${r};`}}):t}function qXe(t){return t.search(HXe)!==-1}async function XXe(t,e,n){if(!qXe(t))return t;const r=fBn(t,n);return cBn(r).reduce((o,s)=>o.then(a=>uBn(a,s,e,n)),Promise.resolve(r))}async function i$(t,e,n){var r;const i=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(i){const o=await XXe(i,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function dBn(t,e){await i$("background",t,e)||await i$("background-image",t,e),await i$("mask",t,e)||await i$("mask-image",t,e)}async function hBn(t,e){const n=yl(t,HTMLImageElement);if(!(n&&!eJ(t.src))&&!(yl(t,SVGImageElement)&&!eJ(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await lue(r,aue(r),e);await new Promise((o,s)=>{t.onload=o,t.onerror=s;const a=t;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),n?(t.srcset="",t.src=i):t.href.baseVal=i})}async function pBn(t,e){const r=Sg(t.childNodes).map(i=>YXe(i,e));await Promise.all(r).then(()=>t)}async function YXe(t,e){yl(t,Element)&&(await dBn(t,e),await hBn(t,e),await pBn(t,e))}function gBn(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 COe={};async function OOe(t){let e=COe[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},COe[t]=e,e}async function EOe(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,t.url).href),GXe(a,e.fetchRequestInit,({result:l})=>(n=n.replace(s,`url(${l})`),[s,l]))});return Promise.all(o).then(()=>n)}function TOe(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,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(s,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=a.exec(r),l===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;e.push(l[0])}return e}async function mBn(t,e){const n=[],r=[];return t.forEach(i=>{if("cssRules"in i)try{Sg(i.cssRules||[]).forEach((o,s)=>{if(o.type===CSSRule.IMPORT_RULE){let a=s+1;const l=o.href,c=OOe(l).then(u=>EOe(u,e)).then(u=>TOe(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?a+=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 s=t.find(a=>a.href==null)||document.styleSheets[0];i.href!=null&&r.push(OOe(i.href).then(a=>EOe(a,e)).then(a=>TOe(a).forEach(l=>{s.insertRule(l,i.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(t.forEach(i=>{if("cssRules"in i)try{Sg(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function vBn(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>qXe(e.style.getPropertyValue("src")))}async function yBn(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Sg(t.ownerDocument.styleSheets),r=await mBn(n,e);return vBn(r)}async function xBn(t,e){const n=await yBn(t,e);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return XXe(i.cssText,o,e)}))).join(` +`)}async function bBn(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await xBn(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 wBn(t,e={}){const{width:n,height:r}=VXe(t,e),i=await o8(t,e,!0);return await bBn(i,e),await YXe(i,e),gBn(i,e),await z4n(i,n,r)}async function QXe(t,e={}){const{width:n,height:r}=VXe(t,e),i=await wBn(t,e),o=await sj(i),s=document.createElement("canvas"),a=s.getContext("2d"),l=e.pixelRatio||$4n(),c=e.canvasWidth||n,u=e.canvasHeight||r;return s.width=c*l,s.height=u*l,e.skipAutoScale||F4n(s),s.style.width=`${c}`,s.style.height=`${u}`,e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}async function _Bn(t,e={}){return(await QXe(t,e)).toDataURL()}async function SBn(t,e={}){return(await QXe(t,e)).toDataURL("image/jpeg",e.quality||1)}const kOe={png:_Bn,jpeg:SBn};function CBn(t,e){OBn(t,e).then(()=>{e!=null&&e.handleSuccess&&e.handleSuccess()}).catch(n=>{if(e!=null&&e.handleError)e.handleError(n);else throw n})}async function OBn(t,e={}){const n=t,r=e.format||"png";if(!(r in kOe))throw new Error(`Image format '${r}' is unknown or not supported.`);const i=await kOe[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}),s=await(await fetch(i)).blob();await navigator.clipboard.write([new ClipboardItem({"image/png":s})])}function KXe({elementRef:t,postMessage:e}){const n=()=>{e("success",pe.get("Snapshot copied to clipboard"))},r=o=>{const s="Error copying snapshot to clipboard";console.error(s+":",o),e("error",pe.get(s))},i=()=>{t.current?CBn(t.current,{format:"png",width:2e3,handleSuccess:n,handleError:r}):r(new Error("missing element reference"))};return C.jsx(au,{tooltipText:pe.get("Copy snapshot of chart to clipboard"),onClick:i,icon:C.jsx(M4n,{fontSize:"inherit"})})}function EBn({sx:t,timeSeriesGroupId:e,placeGroupTimeSeries:n,addPlaceGroupTimeSeries:r}){const[i,o]=he.useState(null),s=f=>{o(f.currentTarget)},a=()=>{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(C.jsx(Br,{onClick:()=>l(f.timeSeries[d]),children:h},h))})});const u=!!i;return C.jsxs(C.Fragment,{children:[C.jsx(Gt,{size:"small",sx:t,"aria-label":"Add","aria-controls":u?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:s,disabled:c.length===0,children:C.jsx(Mt,{arrow:!0,title:pe.get("Add time-series from places"),children:C.jsx(kU,{fontSize:"inherit"})})}),C.jsx(Ny,{id:"basic-menu",anchorEl:i,open:u,onClose:a,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const o$={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 TBn({anchorEl:t,valueRange:e,setValueRange:n}){const[r,i]=D.useState(e?[e[0]+"",e[1]+""]:["0","1"]);if(!t)return null;const o=[Number.parseFloat(r[0]),Number.parseFloat(r[1])],s=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 C.jsx(e1,{anchorEl:t,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:C.jsxs(ot,{sx:o$.container,children:[C.jsxs(ot,{component:"form",sx:o$.minMaxBox,children:[C.jsx(Jr,{sx:o$.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!s,onChange:f=>a(f)}),C.jsx(Jr,{sx:o$.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!s,onChange:f=>l(f)})]}),C.jsx(iD,{onDone:c,doneDisabled:!s,onCancel:u,size:"medium"})]})})}const s$="stddev",D0={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 kBn({timeSeriesGroup:t,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n,removeTimeSeriesGroup:r,resetZoom:i,loading:o,zoomed:s,zoomMode:a,setZoomMode:l,showTooltips:c,setShowTooltips:u,chartType:f,setChartType:d,stdevBarsDisabled:h,stdevBars:p,setStdevBars:g,valueRange:m,setValueRange:v,chartElement:y,postMessage:x}){const b=D.useRef(null),[w,_]=D.useState(!1),S=()=>{_(!w)},O=E=>{_(!1),E&&v(E)},k=(E,P)=>{const A=new Set(P),R=A.has(s$);A.delete(s$),A.delete(f),P=Array.from(A),d(P.length===1?P[0]:f),g(R)};return C.jsx(ot,{sx:D0.headerContainer,children:C.jsxs(ot,{sx:D0.actionsContainer,children:[s&&C.jsx(Mt,{arrow:!0,title:pe.get("Zoom to full range"),children:C.jsx(Gt,{sx:D0.actionButton,onClick:i,size:"small",children:C.jsx(k4n,{fontSize:"inherit"})},"zoomOutButton")}),C.jsx(Mt,{arrow:!0,title:pe.get("Toggle zoom mode (or press CTRL key)"),children:C.jsx(xr,{value:"zoomMode",selected:a,onClick:()=>l(!a),size:"small",children:C.jsx(C4n,{fontSize:"inherit"})})}),C.jsx(TBn,{anchorEl:w?b.current:null,valueRange:m,setValueRange:O}),C.jsx(Mt,{arrow:!0,title:pe.get("Enter fixed y-range"),children:C.jsx(xr,{ref:b,value:"valueRange",selected:w,onClick:S,size:"small",children:C.jsx(T4n,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Toggle showing info popup on hover"),children:C.jsx(xr,{value:"showTooltips",selected:c,onClick:()=>u(!c),size:"small",children:C.jsx(E4n,{fontSize:"inherit"})})}),C.jsxs(tO,{value:p?[f,s$]:[f],onChange:k,size:"small",sx:D0.chartTypes,children:[C.jsx(Mt,{arrow:!0,title:pe.get("Show points"),children:C.jsx(xr,{value:"point",size:"small",children:C.jsx(A4n,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Show lines"),children:C.jsx(xr,{value:"line",size:"small",children:C.jsx(P4n,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Show bars"),children:C.jsx(xr,{value:"bar",size:"small",children:C.jsx(O4n,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Show standard deviation (if any)"),children:C.jsx(xr,{value:s$,size:"small",disabled:h,children:C.jsx(WXe,{fontSize:"inherit"})})})]}),C.jsx(KXe,{elementRef:y,postMessage:x}),C.jsx(EBn,{sx:D0.actionButton,timeSeriesGroupId:t.id,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n}),o?C.jsx(Ly,{size:24,sx:D0.actionButton,color:"secondary"}):C.jsx(Gt,{sx:D0.actionButton,"aria-label":"Close",onClick:()=>r(t.id),size:"small",children:C.jsx(VO,{fontSize:"inherit"})})]})})}const ABn=oa("div")(({theme:t})=>({userSelect:"none",marginTop:t.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),PBn={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function MBn({timeSeriesGroup:t,selectTimeSeries:e,selectedTime:n,selectTime:r,selectedTimeRange:i,selectTimeRange:o,places:s,selectPlace:a,placeInfos:l,dataTimeRange:c,chartTypeDefault:u,includeStdev:f,removeTimeSeries:d,removeTimeSeriesGroup:h,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,postMessage:m}){const v=Zb(),[y,x]=D.useState(!1),[b,w]=D.useState(!0),[_,S]=D.useState(u),[O,k]=D.useState(f),[E,P]=D.useState({}),A=D.useRef(),R=D.useRef(),T=D.useRef(),M=D.useRef(null),I=D.useRef(null),z=D.useMemo(()=>{const W=new Map;t.timeSeriesArray.forEach((se,ye)=>{const ie=`v${ye}`,fe=`ev${ye}`,Q=se.source.valueDataKey,_e=se.source.errorDataKey;se.data.forEach(we=>{const Ie=W.get(we.time);let Pe;Ie===void 0?(Pe={time:we.time},W.set(we.time,Pe)):Pe=Ie;const Re=we[Q];if(yr(Re)&&isFinite(Re)&&(Pe[ie]=Re),_e){const Te=we[_e];yr(Te)&&isFinite(Te)&&(Pe[fe]=Te)}})});const J=Array.from(W.values());return J.sort((se,ye)=>se.time-ye.time),J},[t]),F=D.useMemo(()=>t.timeSeriesArray.map(W=>W.dataProgress?W.dataProgress:0),[t]),N=F.reduce((W,J)=>W+J,0)/F.length,L=N>0&&N<1,B=!!i&&!o_t(i,c||null);t.timeSeriesArray.forEach(W=>{W.source.valueDataKey});const $=t.variableUnits||pe.get("unknown units"),j=`${pe.get("Quantity")} (${$})`,X=v.palette.primary.light,V=v.palette.primary.main,Y=v.palette.text.primary,le=()=>{yr(E.x1)&&P({})},K=W=>{if(!W)return;const{chartX:J,chartY:se}=W;if(!yr(J)||!yr(se))return;const ye=Z(J,se);if(ye){const[ie,fe]=ye;P({x1:ie,y1:fe})}},ee=(W,J)=>{const{x1:se,y1:ye}=E;if(!yr(se)||!yr(ye)||!W)return;const{chartX:ie,chartY:fe}=W;if(!yr(ie)||!yr(fe))return;const Q=Z(ie,fe);if(Q){const[_e,we]=Q;J.ctrlKey||y?_e!==se&&we!==ye&&P({x1:se,y1:ye,x2:_e,y2:we}):_e!==se&&P({x1:se,y1:ye,x2:_e})}},re=W=>{const[J,se]=AOe(E);le(),J&&J[0]{le()},te=()=>{le()},ae=W=>{d(t.id,W)},U=()=>{le(),o(c||null,t.id,null)},oe=W=>{W&&o(i,t.id,W)},ne=(W,J)=>{if(T.current=[W,J],M.current){const se=M.current.getElementsByClassName("recharts-legend-wrapper");se.length!==0&&(I.current=se.item(0))}},G=([W,J])=>{const se=(J-W)*.1;return i?A.current=i:A.current=[W-se,J+se],A.current},q=([W,J])=>{const se=(J-W)*.1;if(t.variableRange)R.current=t.variableRange;else{const ye=W-se;R.current=[ye<0&&W-1e-6>0?0:ye,J+se]}return R.current},Z=(W,J)=>{const se=I.current;if(!T.current||!A.current||!R.current||!se)return;const[ye,ie]=A.current,[fe,Q]=R.current,[_e,we]=T.current,Ie=se.clientHeight,Pe=65,Re=5,Te=5,Le=38,ue=_e-Pe-Te,$e=we-Re-Le-Ie,Se=(W-Pe)/ue,Ye=(J-Re)/$e;return[ye+Se*(ie-ye),Q-Ye*(Q-fe)]},[de,xe]=AOe(E),H=_==="bar"?g4n:p4n;return C.jsxs(ABn,{children:[C.jsx(kBn,{timeSeriesGroup:t,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,removeTimeSeriesGroup:h,resetZoom:U,loading:L,zoomed:B,zoomMode:y,setZoomMode:x,showTooltips:b,setShowTooltips:w,chartType:_,setChartType:S,stdevBarsDisabled:!f,stdevBars:O,setStdevBars:k,valueRange:R.current,setValueRange:oe,chartElement:M,postMessage:m}),C.jsx(Cqe,{width:"98%",onResize:ne,ref:M,children:C.jsxs(H,{onMouseDown:K,onMouseMove:ee,onMouseUp:re,onMouseEnter:me,onMouseLeave:te,syncId:"anyId",style:{color:Y,fontSize:"0.8em"},data:z,barGap:1,barSize:30,maxBarSize:30,children:[C.jsx(I1,{dataKey:"time",type:"number",tickCount:6,domain:G,tickFormatter:v4n,stroke:Y,allowDataOverflow:!0}),C.jsx(L1,{type:"number",tickCount:5,domain:q,tickFormatter:y4n,stroke:Y,allowDataOverflow:!0,label:{...PBn,value:j}}),C.jsx(oue,{strokeDasharray:"3 3"}),b&&!yr(E.x1)&&C.jsx(Rd,{content:C.jsx(_4n,{})}),C.jsx(MC,{content:C.jsx(x4n,{removeTimeSeries:ae})}),t.timeSeriesArray.map((W,J)=>S4n({timeSeriesGroup:t,timeSeriesIndex:J,selectTimeSeries:e,places:s,selectPlace:a,placeGroupTimeSeries:p,placeInfos:l,chartType:_,stdevBars:O,paletteMode:v.palette.mode})),de&&C.jsx(D1,{x1:de[0],y1:xe?xe[0]:void 0,x2:de[1],y2:xe?xe[1]:void 0,strokeOpacity:.3,fill:X,fillOpacity:.3}),n!==null&&C.jsx(xD,{isFront:!0,x:n,stroke:V,strokeWidth:3,strokeOpacity:.5})]})})]})}function AOe(t){const{x1:e,x2:n,y1:r,y2:i}=t;let o,s;return yr(e)&&yr(n)&&(o=eC.jsx(MBn,{timeSeriesGroup:l,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,...a},l.id))]})}const $Bn=t=>({locale:t.controlState.locale,timeSeriesGroups:t.dataState.timeSeriesGroups,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,dataTimeRange:eSt(t),chartTypeDefault:t.controlState.timeSeriesChartTypeDefault,includeStdev:t.controlState.timeSeriesIncludeStdev,placeInfos:aSt(t),places:KM(t),placeGroupTimeSeries:d_t(t),canAddTimeSeries:nIe(t)}),FBn={selectTime:sU,selectTimeRange:S8e,removeTimeSeries:IKt,removeTimeSeriesGroup:LKt,selectPlace:oU,addPlaceGroupTimeSeries:DKt,addTimeSeries:iU,postMessage:_s},NBn=Rn($Bn,FBn)(LBn),zBn=lt(C.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 jBn(t){return t.count===0}function BBn(t){return t.count===1}function UBn(t){return t.count>1}function WBn({statisticsRecord:t}){const e=t.statistics;return C.jsx(Jee,{size:"small",children:C.jsx(ete,{children:jBn(e)?C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Value")}),C.jsx(ui,{align:"right",children:"NaN"})]}):BBn(e)?C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Value")}),C.jsx(ui,{align:"right",children:L2(e.mean)})]}):C.jsxs(C.Fragment,{children:[C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Count")}),C.jsx(ui,{align:"right",children:e.count})]}),C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Minimum")}),C.jsx(ui,{align:"right",children:L2(e.minimum)})]}),C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Maximum")}),C.jsx(ui,{align:"right",children:L2(e.maximum)})]}),C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Mean")}),C.jsx(ui,{align:"right",children:L2(e.mean)})]}),C.jsxs(Ad,{children:[C.jsx(ui,{children:pe.get("Deviation")}),C.jsx(ui,{align:"right",children:L2(e.deviation)})]})]})})})}function L2(t){return by(t,3)}function VBn({statisticsRecord:t,showBrush:e,showDetails:n}){const r=To(),i=t.statistics,o=D.useMemo(()=>{if(!i.histogram)return null;const{values:y,edges:x}=i.histogram;return y.map((b,w)=>({x:.5*(x[w]+x[w+1]),y:b,i:w}))},[i]),[s,a]=D.useState([0,o?o.length-1:-1]);if(D.useEffect(()=>{o&&a([0,o.length-1])},[o]),o===null)return null;const{placeInfo:l}=t.source,[c,u]=s,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),g=r.palette.text.primary,m=r.palette.text.primary,v=({startIndex:y,endIndex:x})=>{yr(y)&&yr(x)&&a([y,x])};return C.jsx(Cqe,{width:"100%",height:"100%",children:C.jsxs(m4n,{data:o,margin:{top:0,right:e?30:5,bottom:1,left:2},style:{color:m,fontSize:"0.8em"},children:[C.jsx(oue,{strokeDasharray:"3 3"}),C.jsx(I1,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>by(y,2)}),C.jsx(L1,{}),C.jsx(u0,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&C.jsx(xD,{x:i.mean,isFront:!0,stroke:g,strokeWidth:2,strokeOpacity:.5}),n&&C.jsx(D1,{x1:h,x2:p,isFront:!1,stroke:g,strokeWidth:1,strokeOpacity:.3,fill:g,fillOpacity:.05}),e&&C.jsx(Vb,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>by(o[y].x,1),onChange:v})]})})}const a$={container:{padding:1,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function l$({phrase:t}){return C.jsx("span",{style:{color:"red"},children:`<${pe.get(t)}?>`})}function ZXe({dataset:t,variable:e,time:n,placeInfo:r,actions:i,body:o,containerRef:s}){const a=t?t.title:C.jsx(l$,{phrase:"Dataset"}),l=e?e.name:C.jsx(l$,{phrase:"Variable"}),c=t==null?void 0:t.dimensions.some(d=>d.name=="time"),u=n?NMe(n):c?C.jsx(l$,{phrase:"Time"}):null,f=r?r.label:C.jsx(l$,{phrase:"Place"});return C.jsxs(ot,{sx:a$.container,ref:s,children:[C.jsxs(ot,{sx:a$.header,children:[C.jsxs(Jt,{fontSize:"small",children:[a," / ",l,u&&`, ${u}`,", ",f]}),C.jsx(ot,{sx:a$.actions,children:i})]}),o&&C.jsx(ot,{sx:a$.body,children:o})]})}const POe={table:{flexGrow:0},chart:{flexGrow:1}};function GBn({locale:t,statisticsRecord:e,rowIndex:n,removeStatistics:r,postMessage:i}){const o=D.useRef(null),[s,a]=D.useState(!1),[l,c]=D.useState(!1),{dataset:u,variable:f,time:d,placeInfo:h}=e.source,p=UBn(e.statistics),g=()=>{c(!l)},m=()=>{a(!s)},v=()=>{r(n)};return C.jsx(ZXe,{dataset:u,variable:f,time:d,placeInfo:h,containerRef:o,actions:C.jsxs(C.Fragment,{children:[p&&C.jsxs(tO,{size:"small",children:[C.jsx(Mt,{arrow:!0,title:pe.get("Toggle adjustable x-range"),children:C.jsx(xr,{selected:s,onClick:m,value:"brush",size:"small",children:C.jsx(zBn,{fontSize:"inherit"})})}),C.jsx(Mt,{arrow:!0,title:pe.get("Show standard deviation (if any)"),children:C.jsx(xr,{selected:l,onClick:g,value:"details",size:"small",children:C.jsx(WXe,{fontSize:"inherit"})})})]}),p&&C.jsx(KXe,{elementRef:o,postMessage:i}),C.jsx(Gt,{size:"small",onClick:v,children:C.jsx(VO,{fontSize:"inherit"})})]}),body:C.jsxs(C.Fragment,{children:[C.jsx(ot,{sx:POe.table,children:C.jsx(WBn,{locale:t,statisticsRecord:e})}),C.jsx(ot,{sx:POe.chart,children:C.jsx(VBn,{showBrush:s,showDetails:l,statisticsRecord:e})})]})})}const HBn={progress:{color:"primary"}};function qBn({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:s}){return C.jsx(ZXe,{dataset:t,variable:e,time:n,placeInfo:r,actions:s?C.jsx(Ly,{size:20,sx:HBn.progress}):C.jsx(Gt,{size:"small",disabled:!i,onClick:o,color:"primary",children:C.jsx(kU,{fontSize:"inherit"})})})}const XBn={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function YBn({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,statisticsLoading:i,statisticsRecords:o,canAddStatistics:s,addStatistics:a,removeStatistics:l,postMessage:c}){return C.jsxs(ot,{sx:XBn.container,children:[C.jsx(qBn,{selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:s,addStatistics:a,statisticsLoading:i}),o.map((u,f)=>C.jsx(GBn,{statisticsRecord:u,rowIndex:f,removeStatistics:l,postMessage:c},f))]})}const QBn=t=>({selectedDataset:fo(t),selectedVariable:za(t),selectedTime:c1(t),selectedPlaceInfo:ZM(t),statisticsLoading:u_t(t),statisticsRecords:lSt(t),canAddStatistics:rIe(t)}),KBn={addStatistics:XUe,removeStatistics:MKt,postMessage:_s},ZBn=Rn(QBn,KBn)(YBn);/** * @license * Copyright 2010-2022 Three.js Authors * SPDX-License-Identifier: MIT - */const cue="144",vw={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},yw={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},JBn=0,MOe=1,e6n=2,JXe=1,t6n=2,NT=3,WC=0,mc=1,rg=2,qv=0,uS=1,ROe=2,DOe=3,IOe=4,n6n=5,Hw=100,r6n=101,i6n=102,LOe=103,$Oe=104,o6n=200,s6n=201,a6n=202,l6n=203,eYe=204,tYe=205,c6n=206,u6n=207,f6n=208,d6n=209,h6n=210,p6n=0,g6n=1,m6n=2,tJ=3,v6n=4,y6n=5,x6n=6,b6n=7,nYe=0,w6n=1,_6n=2,Cg=0,S6n=1,C6n=2,O6n=3,E6n=4,T6n=5,rYe=300,VC=301,GC=302,nJ=303,rJ=304,s8=306,iJ=1e3,Jc=1001,oJ=1002,el=1003,FOe=1004,NOe=1005,tl=1006,k6n=1007,a8=1008,Hb=1009,A6n=1010,P6n=1011,iYe=1012,M6n=1013,Ox=1014,Ev=1015,sM=1016,R6n=1017,D6n=1018,fS=1020,I6n=1021,L6n=1022,sh=1023,$6n=1024,F6n=1025,Kx=1026,HC=1027,oYe=1028,N6n=1029,z6n=1030,j6n=1031,B6n=1033,rG=33776,iG=33777,oG=33778,sG=33779,zOe=35840,jOe=35841,BOe=35842,UOe=35843,U6n=36196,WOe=37492,VOe=37496,GOe=37808,HOe=37809,qOe=37810,XOe=37811,YOe=37812,QOe=37813,KOe=37814,ZOe=37815,JOe=37816,eEe=37817,tEe=37818,nEe=37819,rEe=37820,iEe=37821,oEe=36492,qb=3e3,Pi=3001,W6n=3200,V6n=3201,G6n=0,H6n=1,Dp="srgb",Ex="srgb-linear",aG=7680,q6n=519,sEe=35044,aEe="300 es",sJ=1035;class $1{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,s=i.length;o>8&255]+Rs[t>>16&255]+Rs[t>>24&255]+"-"+Rs[e&255]+Rs[e>>8&255]+"-"+Rs[e>>16&15|64]+Rs[e>>24&255]+"-"+Rs[n&63|128]+Rs[n>>8&255]+"-"+Rs[n>>16&255]+Rs[n>>24&255]+Rs[r&255]+Rs[r>>8&255]+Rs[r>>16&255]+Rs[r>>24&255]).toLowerCase()}function nl(t,e,n){return Math.max(e,Math.min(n,t))}function X6n(t,e){return(t%e+e)%e}function cG(t,e,n){return(1-n)*t+n*e}function cEe(t){return(t&t-1)===0&&t!==0}function aJ(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function c$(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 Fl(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 On{constructor(e=0,n=0){On.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,s=this.y-e.y;return this.x=o*r-s*i+e.x,this.y=o*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class uc{constructor(){uc.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,n,r,i,o,s,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=s,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,s=r[0],a=r[3],l=r[6],c=r[1],u=r[4],f=r[7],d=r[2],h=r[5],p=r[8],g=i[0],m=i[3],v=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return o[0]=s*g+a*y+l*w,o[3]=s*m+a*x+l*_,o[6]=s*v+a*b+l*S,o[1]=c*g+u*y+f*w,o[4]=c*m+u*x+f*_,o[7]=c*v+u*b+f*S,o[2]=d*g+h*y+p*w,o[5]=d*m+h*x+p*_,o[8]=d*v+h*b+p*S,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],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*s*u-n*a*c-r*o*u+r*a*l+i*o*c-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*s-a*c,d=a*l-u*o,h=c*o-s*l,p=n*f+r*d+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return e[0]=f*g,e[1]=(i*c-u*r)*g,e[2]=(a*r-i*s)*g,e[3]=d*g,e[4]=(u*n-i*l)*g,e[5]=(i*o-a*n)*g,e[6]=h*g,e[7]=(r*l-c*n)*g,e[8]=(s*n-r*o)*g,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,s,a){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*s+c*a)+s+e,-i*c,i*l,-i*(-c*s+l*a)+a+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],s=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=n*o+r*l,i[3]=n*s+r*c,i[6]=n*a+r*u,i[1]=-r*o+n*l,i[4]=-r*s+n*c,i[7]=-r*a+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 sYe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function aM(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Zx(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Z3(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const uG={[Dp]:{[Ex]:Zx},[Ex]:{[Dp]:Z3}},Ku={legacyMode:!0,get workingColorSpace(){return Ex},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(uG[e]&&uG[e][n]!==void 0){const r=uG[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)}},aYe={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},ho={r:0,g:0,b:0},Zu={h:0,s:0,l:0},u$={h:0,s:0,l:0};function fG(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 f$(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class hi{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=Dp){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ku.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Ex){return this.r=e,this.g=n,this.b=r,Ku.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Ex){if(e=X6n(e,1),n=nl(n,0,1),r=nl(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=fG(s,o,e+1/3),this.g=fG(s,o,e),this.b=fG(s,o,e-1/3)}return Ku.toWorkingColorSpace(this,i),this}setStyle(e,n=Dp){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 s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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,Ku.toWorkingColorSpace(this,n),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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,Ku.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(a)){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],s=o.length;if(s===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,Ku.toWorkingColorSpace(this,n),this;if(s===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,Ku.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e,n=Dp){const r=aYe[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=Zx(e.r),this.g=Zx(e.g),this.b=Zx(e.b),this}copyLinearToSRGB(e){return this.r=Z3(e.r),this.g=Z3(e.g),this.b=Z3(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Dp){return Ku.fromWorkingColorSpace(f$(this,ho),e),nl(ho.r*255,0,255)<<16^nl(ho.g*255,0,255)<<8^nl(ho.b*255,0,255)<<0}getHexString(e=Dp){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Ex){Ku.fromWorkingColorSpace(f$(this,ho),n);const r=ho.r,i=ho.g,o=ho.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,c;const u=(a+s)/2;if(a===s)l=0,c=0;else{const f=s-a;switch(c=u<=.5?f/(s+a):f/(2-s-a),s){case r:l=(i-o)/f+(i"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{xw===void 0&&(xw=aM("canvas")),xw.width=e.width,xw.height=e.height;const r=xw.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=xw}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=aM("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 s=0;s1)switch(this.wrapS){case iJ:e.x=e.x-Math.floor(e.x);break;case Jc:e.x=e.x<0?0:1;break;case oJ: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 iJ:e.y=e.y-Math.floor(e.y);break;case Jc:e.y=e.y<0?0:1;break;case oJ: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)}}kc.DEFAULT_IMAGE=null;kc.DEFAULT_MAPPING=rYe;class ys{constructor(e=0,n=0,r=0,i=1){ys.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,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[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],g=l[2],m=l[6],v=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-g)<.01&&Math.abs(p-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+g)<.1&&Math.abs(p+m)<.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,w=(v+1)/2,_=(u+d)/4,S=(f+g)/4,O=(p+m)/4;return x>b&&x>w?x<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(x),i=_/r,o=S/r):b>w?b<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(b),r=_/i,o=O/i):w<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(w),r=S/o,i=O/o),this.set(r,i,o,n),this}let y=Math.sqrt((m-p)*(m-p)+(f-g)*(f-g)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(m-p)/y,this.y=(f-g)/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 Xb extends $1{constructor(e,n,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new ys(0,0,e,n),this.scissorTest=!1,this.viewport=new ys(0,0,e,n);const i={width:e,height:n,depth:1};this.texture=new kc(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:tl,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 cYe(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 uYe extends kc{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=el,this.minFilter=el,this.wrapR=Jc,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class fYe extends kc{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=el,this.minFilter=el,this.wrapR=Jc,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yb{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,s,a){let l=r[i+0],c=r[i+1],u=r[i+2],f=r[i+3];const d=o[s+0],h=o[s+1],p=o[s+2],g=o[s+3];if(a===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f;return}if(a===1){e[n+0]=d,e[n+1]=h,e[n+2]=p,e[n+3]=g;return}if(f!==g||l!==d||c!==h||u!==p){let m=1-a;const v=l*d+c*h+u*p+f*g,y=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){const w=Math.sqrt(x),_=Math.atan2(w,v*y);m=Math.sin(m*_)/w,a=Math.sin(a*_)/w}const b=a*y;if(l=l*m+d*b,c=c*m+h*b,u=u*m+p*b,f=f*m+g*b,m===1-a){const w=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=w,c*=w,u*=w,f*=w}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[s],d=o[s+1],h=o[s+2],p=o[s+3];return e[n]=a*p+u*f+l*h-c*d,e[n+1]=l*p+u*d+c*f-a*h,e[n+2]=c*p+u*h+a*d-l*f,e[n+3]=u*p-a*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,s=e._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),f=a(o/2),d=l(r/2),h=l(i/2),p=l(o/2);switch(s){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: "+s)}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],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],f=n[10],d=r+a+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=(s-i)*h}else if(r>a&&r>f){const h=2*Math.sqrt(1+r-a-f);this._w=(u-l)/h,this._x=.25*h,this._y=(i+s)/h,this._z=(o+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-r-f);this._w=(o-c)/h,this._x=(i+s)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-r-a);this._w=(s-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(nl(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,s=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-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,s=this._w;let a=s*e._w+r*e._x+i*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-n;return this._w=h*s+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,a),f=Math.sin((1-n)*u)/c,d=Math.sin(n*u)/c;return this._w=s*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 Ce{constructor(e=0,n=0,r=0){Ce.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(uEe.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(uEe.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,s=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])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,c=l*n+s*i-a*r,u=l*r+a*n-o*i,f=l*i+o*r-s*n,d=-o*n-s*r-a*i;return this.x=c*l+d*-o+u*-a-f*-s,this.y=u*l+d*-s+f*-o-c*-a,this.z=f*l+d*-a+c*-s-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,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,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 hG.copy(this).projectOnVector(e),this.sub(hG)}reflect(e){return this.sub(hG.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(nl(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 hG=new Ce,uEe=new Yb;class vE{constructor(e=new Ce(1/0,1/0,1/0),n=new Ce(-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,s=-1/0,a=-1/0;for(let l=0,c=e.length;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromBufferAttribute(e){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=e.count;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),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,I0),I0.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(F2),d$.subVectors(this.max,F2),bw.subVectors(e.a,F2),ww.subVectors(e.b,F2),_w.subVectors(e.c,F2),wm.subVectors(ww,bw),_m.subVectors(_w,ww),L0.subVectors(bw,_w);let n=[0,-wm.z,wm.y,0,-_m.z,_m.y,0,-L0.z,L0.y,wm.z,0,-wm.x,_m.z,0,-_m.x,L0.z,0,-L0.x,-wm.y,wm.x,0,-_m.y,_m.x,0,-L0.y,L0.x,0];return!gG(n,bw,ww,_w,d$)||(n=[1,0,0,0,1,0,0,0,1],!gG(n,bw,ww,_w,d$))?!1:(h$.crossVectors(wm,_m),n=[h$.x,h$.y,h$.z],gG(n,bw,ww,_w,d$))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return I0.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(I0).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:(vp[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),vp[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),vp[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),vp[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),vp[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),vp[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),vp[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),vp[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(vp),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 vp=[new Ce,new Ce,new Ce,new Ce,new Ce,new Ce,new Ce,new Ce],I0=new Ce,pG=new vE,bw=new Ce,ww=new Ce,_w=new Ce,wm=new Ce,_m=new Ce,L0=new Ce,F2=new Ce,d$=new Ce,h$=new Ce,$0=new Ce;function gG(t,e,n,r,i){for(let o=0,s=t.length-3;o<=s;o+=3){$0.fromArray(t,o);const a=i.x*Math.abs($0.x)+i.y*Math.abs($0.y)+i.z*Math.abs($0.z),l=e.dot($0),c=n.dot($0),u=r.dot($0);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const Q6n=new vE,fEe=new Ce,p$=new Ce,mG=new Ce;class l8{constructor(e=new Ce,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):Q6n.setFromPoints(e).getCenter(r);let i=0;for(let o=0,s=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){mG.subVectors(e,this.center);const n=mG.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(mG.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?p$.set(0,0,1).multiplyScalar(e.radius):p$.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(fEe.copy(e.center).add(p$)),this.expandByPoint(fEe.copy(e.center).sub(p$)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const yp=new Ce,vG=new Ce,g$=new Ce,Sm=new Ce,yG=new Ce,m$=new Ce,xG=new Ce;class dYe{constructor(e=new Ce,n=new Ce(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,yp)),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=yp.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(yp.copy(this.direction).multiplyScalar(n).add(this.origin),yp.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){vG.copy(e).add(n).multiplyScalar(.5),g$.copy(n).sub(e).normalize(),Sm.copy(this.origin).sub(vG);const o=e.distanceTo(n)*.5,s=-this.direction.dot(g$),a=Sm.dot(this.direction),l=-Sm.dot(g$),c=Sm.lengthSq(),u=Math.abs(1-s*s);let f,d,h,p;if(u>0)if(f=s*l-a,d=s*a-l,p=o*u,f>=0)if(d>=-p)if(d<=p){const g=1/u;f*=g,d*=g,h=f*(f+s*d+2*a)+d*(s*f+d+2*l)+c}else d=o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d=-o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-s*o+a)),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,-(s*o+a)),d=f>0?o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c);else d=s>0?-o:o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(g$).multiplyScalar(d).add(vG),h}intersectSphere(e,n){yp.subVectors(e.center,this.origin);const r=yp.dot(this.direction),i=yp.dot(yp)-r*r,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return a<0&&l<0?null:a<0?this.at(l,n):this.at(a,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,s,a,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,s=(e.max.y-d.y)*u):(o=(e.max.y-d.y)*u,s=(e.min.y-d.y)*u),r>s||o>i||((o>r||r!==r)&&(r=o),(s=0?(a=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(a=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,yp)!==null}intersectTriangle(e,n,r,i,o){yG.subVectors(n,e),m$.subVectors(r,e),xG.crossVectors(yG,m$);let s=this.direction.dot(xG),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;Sm.subVectors(this.origin,e);const l=a*this.direction.dot(m$.crossVectors(Sm,m$));if(l<0)return null;const c=a*this.direction.dot(yG.cross(Sm));if(c<0||l+c>s)return null;const u=-a*Sm.dot(xG);return u<0?null:this.at(u/s,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 Gr{constructor(){Gr.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,s,a,l,c,u,f,d,h,p,g,m){const v=this.elements;return v[0]=e,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=s,v[9]=a,v[13]=l,v[2]=c,v[6]=u,v[10]=f,v[14]=d,v[3]=h,v[7]=p,v[11]=g,v[15]=m,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 Gr().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/Sw.setFromMatrixColumn(e,0).length(),o=1/Sw.setFromMatrixColumn(e,1).length(),s=1/Sw.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]*s,n[9]=r[9]*s,n[10]=r[10]*s,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,s=Math.cos(r),a=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=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=h+p*c,n[5]=d-g*c,n[9]=-a*l,n[2]=g-d*c,n[6]=p+h*c,n[10]=s*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d+g*a,n[4]=p*a-h,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-a,n[2]=h*a-p,n[6]=g+d*a,n[10]=s*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d-g*a,n[4]=-s*f,n[8]=p+h*a,n[1]=h+p*a,n[5]=s*u,n[9]=g-d*a,n[2]=-s*c,n[6]=a,n[10]=s*l}else if(e.order==="ZYX"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=p*c-h,n[8]=d*c+g,n[1]=l*f,n[5]=g*c+d,n[9]=h*c-p,n[2]=-c,n[6]=a*l,n[10]=s*l}else if(e.order==="YZX"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=g-d*f,n[8]=p*f+h,n[1]=f,n[5]=s*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*f+p,n[10]=d-g*f}else if(e.order==="XZY"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=d*f+g,n[5]=s*u,n[9]=h*f-p,n[2]=p*f-h,n[6]=a*u,n[10]=g*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(K6n,e,Z6n)}lookAt(e,n,r){const i=this.elements;return Nl.subVectors(e,n),Nl.lengthSq()===0&&(Nl.z=1),Nl.normalize(),Cm.crossVectors(r,Nl),Cm.lengthSq()===0&&(Math.abs(r.z)===1?Nl.x+=1e-4:Nl.z+=1e-4,Nl.normalize(),Cm.crossVectors(r,Nl)),Cm.normalize(),v$.crossVectors(Nl,Cm),i[0]=Cm.x,i[4]=v$.x,i[8]=Nl.x,i[1]=Cm.y,i[5]=v$.y,i[9]=Nl.y,i[2]=Cm.z,i[6]=v$.z,i[10]=Nl.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,s=r[0],a=r[4],l=r[8],c=r[12],u=r[1],f=r[5],d=r[9],h=r[13],p=r[2],g=r[6],m=r[10],v=r[14],y=r[3],x=r[7],b=r[11],w=r[15],_=i[0],S=i[4],O=i[8],k=i[12],E=i[1],P=i[5],A=i[9],R=i[13],T=i[2],M=i[6],I=i[10],z=i[14],F=i[3],N=i[7],L=i[11],B=i[15];return o[0]=s*_+a*E+l*T+c*F,o[4]=s*S+a*P+l*M+c*N,o[8]=s*O+a*A+l*I+c*L,o[12]=s*k+a*R+l*z+c*B,o[1]=u*_+f*E+d*T+h*F,o[5]=u*S+f*P+d*M+h*N,o[9]=u*O+f*A+d*I+h*L,o[13]=u*k+f*R+d*z+h*B,o[2]=p*_+g*E+m*T+v*F,o[6]=p*S+g*P+m*M+v*N,o[10]=p*O+g*A+m*I+v*L,o[14]=p*k+g*R+m*z+v*B,o[3]=y*_+x*E+b*T+w*F,o[7]=y*S+x*P+b*M+w*N,o[11]=y*O+x*A+b*I+w*L,o[15]=y*k+x*R+b*z+w*B,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],g=e[7],m=e[11],v=e[15];return p*(+o*l*f-i*c*f-o*a*d+r*c*d+i*a*h-r*l*h)+g*(+n*l*h-n*c*d+o*s*d-i*s*h+i*c*u-o*l*u)+m*(+n*c*f-n*a*h-o*s*f+r*s*h+o*a*u-r*c*u)+v*(-i*a*u-n*l*f+n*a*d+i*s*f-r*s*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],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=f*m*c-g*d*c+g*l*h-a*m*h-f*l*v+a*d*v,x=p*d*c-u*m*c-p*l*h+s*m*h+u*l*v-s*d*v,b=u*g*c-p*f*c+p*a*h-s*g*h-u*a*v+s*f*v,w=p*f*l-u*g*l-p*a*d+s*g*d+u*a*m-s*f*m,_=n*y+r*x+i*b+o*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/_;return e[0]=y*S,e[1]=(g*d*o-f*m*o-g*i*h+r*m*h+f*i*v-r*d*v)*S,e[2]=(a*m*o-g*l*o+g*i*c-r*m*c-a*i*v+r*l*v)*S,e[3]=(f*l*o-a*d*o-f*i*c+r*d*c+a*i*h-r*l*h)*S,e[4]=x*S,e[5]=(u*m*o-p*d*o+p*i*h-n*m*h-u*i*v+n*d*v)*S,e[6]=(p*l*o-s*m*o-p*i*c+n*m*c+s*i*v-n*l*v)*S,e[7]=(s*d*o-u*l*o+u*i*c-n*d*c-s*i*h+n*l*h)*S,e[8]=b*S,e[9]=(p*f*o-u*g*o-p*r*h+n*g*h+u*r*v-n*f*v)*S,e[10]=(s*g*o-p*a*o+p*r*c-n*g*c-s*r*v+n*a*v)*S,e[11]=(u*a*o-s*f*o-u*r*c+n*f*c+s*r*h-n*a*h)*S,e[12]=w*S,e[13]=(u*g*i-p*f*i+p*r*d-n*g*d-u*r*m+n*f*m)*S,e[14]=(p*a*i-s*g*i-p*r*l+n*g*l+s*r*m-n*a*m)*S,e[15]=(s*f*i-u*a*i+u*r*l-n*f*l-s*r*d+n*a*d)*S,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,s=e.x,a=e.y,l=e.z,c=o*s,u=o*a;return this.set(c*s+r,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+r,u*l-i*s,0,c*l-i*a,u*l+i*s,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,s){return this.set(1,r,o,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,c=o+o,u=s+s,f=a+a,d=o*c,h=o*u,p=o*f,g=s*u,m=s*f,v=a*f,y=l*c,x=l*u,b=l*f,w=r.x,_=r.y,S=r.z;return i[0]=(1-(g+v))*w,i[1]=(h+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(h-b)*_,i[5]=(1-(d+v))*_,i[6]=(m+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(m-y)*S,i[10]=(1-(d+g))*S,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=Sw.set(i[0],i[1],i[2]).length();const s=Sw.set(i[4],i[5],i[6]).length(),a=Sw.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],Ju.copy(this);const c=1/o,u=1/s,f=1/a;return Ju.elements[0]*=c,Ju.elements[1]*=c,Ju.elements[2]*=c,Ju.elements[4]*=u,Ju.elements[5]*=u,Ju.elements[6]*=u,Ju.elements[8]*=f,Ju.elements[9]*=f,Ju.elements[10]*=f,n.setFromRotationMatrix(Ju),r.x=o,r.y=s,r.z=a,this}makePerspective(e,n,r,i,o,s){const a=this.elements,l=2*o/(n-e),c=2*o/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d=-(s+o)/(s-o),h=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=f,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,n,r,i,o,s){const a=this.elements,l=1/(n-e),c=1/(r-i),u=1/(s-o),f=(n+e)*l,d=(r+i)*c,h=(s+o)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-f,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[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 Sw=new Ce,Ju=new Gr,K6n=new Ce(0,0,0),Z6n=new Ce(1,1,1),Cm=new Ce,v$=new Ce,Nl=new Ce,dEe=new Gr,hEe=new Yb;class SD{constructor(e=0,n=0,r=0,i=SD.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],s=i[4],a=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(nl(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-nl(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(nl(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-nl(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(-s,c));break;case"YZX":this._z=Math.asin(nl(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(a,h));break;case"XZY":this._z=Math.asin(-nl(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,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 dEe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(dEe,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return hEe.setFromEuler(this),this.setFromQuaternion(hEe,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")}}SD.DefaultOrder="XYZ";SD.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class hYe{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 a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),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 s(a){const l=[];for(const c in a){const u=a[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){ef.subVectors(i,n),bp.subVectors(r,n),bG.subVectors(e,n);const s=ef.dot(ef),a=ef.dot(bp),l=ef.dot(bG),c=bp.dot(bp),u=bp.dot(bG),f=s*c-a*a;if(f===0)return o.set(-2,-1,-1);const d=1/f,h=(c*l-a*u)*d,p=(s*u-a*l)*d;return o.set(1-h-p,p,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,wp),wp.x>=0&&wp.y>=0&&wp.x+wp.y<=1}static getUV(e,n,r,i,o,s,a,l){return this.getBarycoord(e,n,r,i,wp),l.set(0,0),l.addScaledVector(o,wp.x),l.addScaledVector(s,wp.y),l.addScaledVector(a,wp.z),l}static isFrontFacing(e,n,r,i){return ef.subVectors(r,n),bp.subVectors(e,n),ef.cross(bp).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 ef.subVectors(this.c,this.b),bp.subVectors(this.a,this.b),ef.cross(bp).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Hp.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Hp.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Hp.getUV(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Hp.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Hp.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 s,a;Ow.subVectors(i,r),Ew.subVectors(o,r),wG.subVectors(e,r);const l=Ow.dot(wG),c=Ew.dot(wG);if(l<=0&&c<=0)return n.copy(r);_G.subVectors(e,i);const u=Ow.dot(_G),f=Ew.dot(_G);if(u>=0&&f<=u)return n.copy(i);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(r).addScaledVector(Ow,s);SG.subVectors(e,o);const h=Ow.dot(SG),p=Ew.dot(SG);if(p>=0&&h<=p)return n.copy(o);const g=h*c-l*p;if(g<=0&&c>=0&&p<=0)return a=c/(c-p),n.copy(r).addScaledVector(Ew,a);const m=u*p-h*f;if(m<=0&&f-u>=0&&h-p>=0)return xEe.subVectors(o,i),a=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(xEe,a);const v=1/(m+g+d);return s=g*v,a=d*v,n.copy(r).addScaledVector(Ow,s).addScaledVector(Ew,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let rUn=0;class CD extends $1{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rUn++}),this.uuid=_D(),this.name="",this.type="Material",this.blending=uS,this.side=WC,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=eYe,this.blendDst=tYe,this.blendEquation=Hw,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=tJ,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=q6n,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=aG,this.stencilZFail=aG,this.stencilZPass=aG,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!==uS&&(r.blending=this.blending),this.side!==WC&&(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 s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(e.textures),s=i(e.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}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 uue extends CD{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new hi(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=nYe,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 eo=new Ce,x$=new On;class yu{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=sEe,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 s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.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,s=i.length;on.far?null:{distance:c,point:E$.clone(),object:t}}function T$(t,e,n,r,i,o,s,a,l,c,u,f){Om.fromBufferAttribute(i,c),Em.fromBufferAttribute(i,u),Tm.fromBufferAttribute(i,f);const d=t.morphTargetInfluences;if(o&&d){b$.set(0,0,0),w$.set(0,0,0),_$.set(0,0,0);for(let p=0,g=o.length;p0?1:-1,u.push(N.x,N.y,N.z),f.push($/S),f.push(1-L/O),z+=1}}for(let L=0;L>8&255]+Rs[t>>16&255]+Rs[t>>24&255]+"-"+Rs[e&255]+Rs[e>>8&255]+"-"+Rs[e>>16&15|64]+Rs[e>>24&255]+"-"+Rs[n&63|128]+Rs[n>>8&255]+"-"+Rs[n>>16&255]+Rs[n>>24&255]+Rs[r&255]+Rs[r>>8&255]+Rs[r>>16&255]+Rs[r>>24&255]).toLowerCase()}function nl(t,e,n){return Math.max(e,Math.min(n,t))}function X6n(t,e){return(t%e+e)%e}function cG(t,e,n){return(1-n)*t+n*e}function cEe(t){return(t&t-1)===0&&t!==0}function aJ(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function c$(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 Fl(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 On{constructor(e=0,n=0){On.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,s=this.y-e.y;return this.x=o*r-s*i+e.x,this.y=o*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class uc{constructor(){uc.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,n,r,i,o,s,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=s,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,s=r[0],a=r[3],l=r[6],c=r[1],u=r[4],f=r[7],d=r[2],h=r[5],p=r[8],g=i[0],m=i[3],v=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return o[0]=s*g+a*y+l*w,o[3]=s*m+a*x+l*_,o[6]=s*v+a*b+l*S,o[1]=c*g+u*y+f*w,o[4]=c*m+u*x+f*_,o[7]=c*v+u*b+f*S,o[2]=d*g+h*y+p*w,o[5]=d*m+h*x+p*_,o[8]=d*v+h*b+p*S,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],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*s*u-n*a*c-r*o*u+r*a*l+i*o*c-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*s-a*c,d=a*l-u*o,h=c*o-s*l,p=n*f+r*d+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return e[0]=f*g,e[1]=(i*c-u*r)*g,e[2]=(a*r-i*s)*g,e[3]=d*g,e[4]=(u*n-i*l)*g,e[5]=(i*o-a*n)*g,e[6]=h*g,e[7]=(r*l-c*n)*g,e[8]=(s*n-r*o)*g,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,s,a){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*s+c*a)+s+e,-i*c,i*l,-i*(-c*s+l*a)+a+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],s=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=n*o+r*l,i[3]=n*s+r*c,i[6]=n*a+r*u,i[1]=-r*o+n*l,i[4]=-r*s+n*c,i[7]=-r*a+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 sYe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function sM(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Zx(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Z3(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const uG={[Dp]:{[Ex]:Zx},[Ex]:{[Dp]:Z3}},Ku={legacyMode:!0,get workingColorSpace(){return Ex},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(uG[e]&&uG[e][n]!==void 0){const r=uG[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)}},aYe={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},ho={r:0,g:0,b:0},Zu={h:0,s:0,l:0},u$={h:0,s:0,l:0};function fG(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 f$(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class hi{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=Dp){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ku.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Ex){return this.r=e,this.g=n,this.b=r,Ku.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Ex){if(e=X6n(e,1),n=nl(n,0,1),r=nl(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=fG(s,o,e+1/3),this.g=fG(s,o,e),this.b=fG(s,o,e-1/3)}return Ku.toWorkingColorSpace(this,i),this}setStyle(e,n=Dp){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 s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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,Ku.toWorkingColorSpace(this,n),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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,Ku.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(a)){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],s=o.length;if(s===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,Ku.toWorkingColorSpace(this,n),this;if(s===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,Ku.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e,n=Dp){const r=aYe[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=Zx(e.r),this.g=Zx(e.g),this.b=Zx(e.b),this}copyLinearToSRGB(e){return this.r=Z3(e.r),this.g=Z3(e.g),this.b=Z3(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Dp){return Ku.fromWorkingColorSpace(f$(this,ho),e),nl(ho.r*255,0,255)<<16^nl(ho.g*255,0,255)<<8^nl(ho.b*255,0,255)<<0}getHexString(e=Dp){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Ex){Ku.fromWorkingColorSpace(f$(this,ho),n);const r=ho.r,i=ho.g,o=ho.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,c;const u=(a+s)/2;if(a===s)l=0,c=0;else{const f=s-a;switch(c=u<=.5?f/(s+a):f/(2-s-a),s){case r:l=(i-o)/f+(i"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{xw===void 0&&(xw=sM("canvas")),xw.width=e.width,xw.height=e.height;const r=xw.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=xw}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=sM("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 s=0;s1)switch(this.wrapS){case iJ:e.x=e.x-Math.floor(e.x);break;case Jc:e.x=e.x<0?0:1;break;case oJ: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 iJ:e.y=e.y-Math.floor(e.y);break;case Jc:e.y=e.y<0?0:1;break;case oJ: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)}}kc.DEFAULT_IMAGE=null;kc.DEFAULT_MAPPING=rYe;class ys{constructor(e=0,n=0,r=0,i=1){ys.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,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[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],g=l[2],m=l[6],v=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-g)<.01&&Math.abs(p-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+g)<.1&&Math.abs(p+m)<.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,w=(v+1)/2,_=(u+d)/4,S=(f+g)/4,O=(p+m)/4;return x>b&&x>w?x<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(x),i=_/r,o=S/r):b>w?b<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(b),r=_/i,o=O/i):w<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(w),r=S/o,i=O/o),this.set(r,i,o,n),this}let y=Math.sqrt((m-p)*(m-p)+(f-g)*(f-g)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(m-p)/y,this.y=(f-g)/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 Xb extends $1{constructor(e,n,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new ys(0,0,e,n),this.scissorTest=!1,this.viewport=new ys(0,0,e,n);const i={width:e,height:n,depth:1};this.texture=new kc(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:tl,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 cYe(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 uYe extends kc{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=el,this.minFilter=el,this.wrapR=Jc,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class fYe extends kc{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=el,this.minFilter=el,this.wrapR=Jc,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yb{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,s,a){let l=r[i+0],c=r[i+1],u=r[i+2],f=r[i+3];const d=o[s+0],h=o[s+1],p=o[s+2],g=o[s+3];if(a===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f;return}if(a===1){e[n+0]=d,e[n+1]=h,e[n+2]=p,e[n+3]=g;return}if(f!==g||l!==d||c!==h||u!==p){let m=1-a;const v=l*d+c*h+u*p+f*g,y=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){const w=Math.sqrt(x),_=Math.atan2(w,v*y);m=Math.sin(m*_)/w,a=Math.sin(a*_)/w}const b=a*y;if(l=l*m+d*b,c=c*m+h*b,u=u*m+p*b,f=f*m+g*b,m===1-a){const w=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=w,c*=w,u*=w,f*=w}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[s],d=o[s+1],h=o[s+2],p=o[s+3];return e[n]=a*p+u*f+l*h-c*d,e[n+1]=l*p+u*d+c*f-a*h,e[n+2]=c*p+u*h+a*d-l*f,e[n+3]=u*p-a*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,s=e._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),f=a(o/2),d=l(r/2),h=l(i/2),p=l(o/2);switch(s){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: "+s)}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],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],f=n[10],d=r+a+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=(s-i)*h}else if(r>a&&r>f){const h=2*Math.sqrt(1+r-a-f);this._w=(u-l)/h,this._x=.25*h,this._y=(i+s)/h,this._z=(o+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-r-f);this._w=(o-c)/h,this._x=(i+s)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-r-a);this._w=(s-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(nl(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,s=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-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,s=this._w;let a=s*e._w+r*e._x+i*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-n;return this._w=h*s+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,a),f=Math.sin((1-n)*u)/c,d=Math.sin(n*u)/c;return this._w=s*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 Ce{constructor(e=0,n=0,r=0){Ce.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(uEe.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(uEe.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,s=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])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,c=l*n+s*i-a*r,u=l*r+a*n-o*i,f=l*i+o*r-s*n,d=-o*n-s*r-a*i;return this.x=c*l+d*-o+u*-a-f*-s,this.y=u*l+d*-s+f*-o-c*-a,this.z=f*l+d*-a+c*-s-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,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,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 hG.copy(this).projectOnVector(e),this.sub(hG)}reflect(e){return this.sub(hG.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(nl(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 hG=new Ce,uEe=new Yb;class mE{constructor(e=new Ce(1/0,1/0,1/0),n=new Ce(-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,s=-1/0,a=-1/0;for(let l=0,c=e.length;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromBufferAttribute(e){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=e.count;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),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,I0),I0.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($2),d$.subVectors(this.max,$2),bw.subVectors(e.a,$2),ww.subVectors(e.b,$2),_w.subVectors(e.c,$2),wm.subVectors(ww,bw),_m.subVectors(_w,ww),L0.subVectors(bw,_w);let n=[0,-wm.z,wm.y,0,-_m.z,_m.y,0,-L0.z,L0.y,wm.z,0,-wm.x,_m.z,0,-_m.x,L0.z,0,-L0.x,-wm.y,wm.x,0,-_m.y,_m.x,0,-L0.y,L0.x,0];return!gG(n,bw,ww,_w,d$)||(n=[1,0,0,0,1,0,0,0,1],!gG(n,bw,ww,_w,d$))?!1:(h$.crossVectors(wm,_m),n=[h$.x,h$.y,h$.z],gG(n,bw,ww,_w,d$))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return I0.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(I0).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:(vp[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),vp[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),vp[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),vp[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),vp[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),vp[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),vp[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),vp[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(vp),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 vp=[new Ce,new Ce,new Ce,new Ce,new Ce,new Ce,new Ce,new Ce],I0=new Ce,pG=new mE,bw=new Ce,ww=new Ce,_w=new Ce,wm=new Ce,_m=new Ce,L0=new Ce,$2=new Ce,d$=new Ce,h$=new Ce,$0=new Ce;function gG(t,e,n,r,i){for(let o=0,s=t.length-3;o<=s;o+=3){$0.fromArray(t,o);const a=i.x*Math.abs($0.x)+i.y*Math.abs($0.y)+i.z*Math.abs($0.z),l=e.dot($0),c=n.dot($0),u=r.dot($0);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const Q6n=new mE,fEe=new Ce,p$=new Ce,mG=new Ce;class l8{constructor(e=new Ce,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):Q6n.setFromPoints(e).getCenter(r);let i=0;for(let o=0,s=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){mG.subVectors(e,this.center);const n=mG.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(mG.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?p$.set(0,0,1).multiplyScalar(e.radius):p$.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(fEe.copy(e.center).add(p$)),this.expandByPoint(fEe.copy(e.center).sub(p$)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const yp=new Ce,vG=new Ce,g$=new Ce,Sm=new Ce,yG=new Ce,m$=new Ce,xG=new Ce;class dYe{constructor(e=new Ce,n=new Ce(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,yp)),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=yp.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(yp.copy(this.direction).multiplyScalar(n).add(this.origin),yp.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){vG.copy(e).add(n).multiplyScalar(.5),g$.copy(n).sub(e).normalize(),Sm.copy(this.origin).sub(vG);const o=e.distanceTo(n)*.5,s=-this.direction.dot(g$),a=Sm.dot(this.direction),l=-Sm.dot(g$),c=Sm.lengthSq(),u=Math.abs(1-s*s);let f,d,h,p;if(u>0)if(f=s*l-a,d=s*a-l,p=o*u,f>=0)if(d>=-p)if(d<=p){const g=1/u;f*=g,d*=g,h=f*(f+s*d+2*a)+d*(s*f+d+2*l)+c}else d=o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d=-o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-s*o+a)),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,-(s*o+a)),d=f>0?o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c);else d=s>0?-o:o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(g$).multiplyScalar(d).add(vG),h}intersectSphere(e,n){yp.subVectors(e.center,this.origin);const r=yp.dot(this.direction),i=yp.dot(yp)-r*r,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return a<0&&l<0?null:a<0?this.at(l,n):this.at(a,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,s,a,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,s=(e.max.y-d.y)*u):(o=(e.max.y-d.y)*u,s=(e.min.y-d.y)*u),r>s||o>i||((o>r||r!==r)&&(r=o),(s=0?(a=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(a=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,yp)!==null}intersectTriangle(e,n,r,i,o){yG.subVectors(n,e),m$.subVectors(r,e),xG.crossVectors(yG,m$);let s=this.direction.dot(xG),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;Sm.subVectors(this.origin,e);const l=a*this.direction.dot(m$.crossVectors(Sm,m$));if(l<0)return null;const c=a*this.direction.dot(yG.cross(Sm));if(c<0||l+c>s)return null;const u=-a*Sm.dot(xG);return u<0?null:this.at(u/s,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 Gr{constructor(){Gr.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,s,a,l,c,u,f,d,h,p,g,m){const v=this.elements;return v[0]=e,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=s,v[9]=a,v[13]=l,v[2]=c,v[6]=u,v[10]=f,v[14]=d,v[3]=h,v[7]=p,v[11]=g,v[15]=m,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 Gr().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/Sw.setFromMatrixColumn(e,0).length(),o=1/Sw.setFromMatrixColumn(e,1).length(),s=1/Sw.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]*s,n[9]=r[9]*s,n[10]=r[10]*s,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,s=Math.cos(r),a=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=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=h+p*c,n[5]=d-g*c,n[9]=-a*l,n[2]=g-d*c,n[6]=p+h*c,n[10]=s*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d+g*a,n[4]=p*a-h,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-a,n[2]=h*a-p,n[6]=g+d*a,n[10]=s*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d-g*a,n[4]=-s*f,n[8]=p+h*a,n[1]=h+p*a,n[5]=s*u,n[9]=g-d*a,n[2]=-s*c,n[6]=a,n[10]=s*l}else if(e.order==="ZYX"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=p*c-h,n[8]=d*c+g,n[1]=l*f,n[5]=g*c+d,n[9]=h*c-p,n[2]=-c,n[6]=a*l,n[10]=s*l}else if(e.order==="YZX"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=g-d*f,n[8]=p*f+h,n[1]=f,n[5]=s*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*f+p,n[10]=d-g*f}else if(e.order==="XZY"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=d*f+g,n[5]=s*u,n[9]=h*f-p,n[2]=p*f-h,n[6]=a*u,n[10]=g*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(K6n,e,Z6n)}lookAt(e,n,r){const i=this.elements;return Nl.subVectors(e,n),Nl.lengthSq()===0&&(Nl.z=1),Nl.normalize(),Cm.crossVectors(r,Nl),Cm.lengthSq()===0&&(Math.abs(r.z)===1?Nl.x+=1e-4:Nl.z+=1e-4,Nl.normalize(),Cm.crossVectors(r,Nl)),Cm.normalize(),v$.crossVectors(Nl,Cm),i[0]=Cm.x,i[4]=v$.x,i[8]=Nl.x,i[1]=Cm.y,i[5]=v$.y,i[9]=Nl.y,i[2]=Cm.z,i[6]=v$.z,i[10]=Nl.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,s=r[0],a=r[4],l=r[8],c=r[12],u=r[1],f=r[5],d=r[9],h=r[13],p=r[2],g=r[6],m=r[10],v=r[14],y=r[3],x=r[7],b=r[11],w=r[15],_=i[0],S=i[4],O=i[8],k=i[12],E=i[1],P=i[5],A=i[9],R=i[13],T=i[2],M=i[6],I=i[10],z=i[14],F=i[3],N=i[7],L=i[11],B=i[15];return o[0]=s*_+a*E+l*T+c*F,o[4]=s*S+a*P+l*M+c*N,o[8]=s*O+a*A+l*I+c*L,o[12]=s*k+a*R+l*z+c*B,o[1]=u*_+f*E+d*T+h*F,o[5]=u*S+f*P+d*M+h*N,o[9]=u*O+f*A+d*I+h*L,o[13]=u*k+f*R+d*z+h*B,o[2]=p*_+g*E+m*T+v*F,o[6]=p*S+g*P+m*M+v*N,o[10]=p*O+g*A+m*I+v*L,o[14]=p*k+g*R+m*z+v*B,o[3]=y*_+x*E+b*T+w*F,o[7]=y*S+x*P+b*M+w*N,o[11]=y*O+x*A+b*I+w*L,o[15]=y*k+x*R+b*z+w*B,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],g=e[7],m=e[11],v=e[15];return p*(+o*l*f-i*c*f-o*a*d+r*c*d+i*a*h-r*l*h)+g*(+n*l*h-n*c*d+o*s*d-i*s*h+i*c*u-o*l*u)+m*(+n*c*f-n*a*h-o*s*f+r*s*h+o*a*u-r*c*u)+v*(-i*a*u-n*l*f+n*a*d+i*s*f-r*s*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],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=f*m*c-g*d*c+g*l*h-a*m*h-f*l*v+a*d*v,x=p*d*c-u*m*c-p*l*h+s*m*h+u*l*v-s*d*v,b=u*g*c-p*f*c+p*a*h-s*g*h-u*a*v+s*f*v,w=p*f*l-u*g*l-p*a*d+s*g*d+u*a*m-s*f*m,_=n*y+r*x+i*b+o*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/_;return e[0]=y*S,e[1]=(g*d*o-f*m*o-g*i*h+r*m*h+f*i*v-r*d*v)*S,e[2]=(a*m*o-g*l*o+g*i*c-r*m*c-a*i*v+r*l*v)*S,e[3]=(f*l*o-a*d*o-f*i*c+r*d*c+a*i*h-r*l*h)*S,e[4]=x*S,e[5]=(u*m*o-p*d*o+p*i*h-n*m*h-u*i*v+n*d*v)*S,e[6]=(p*l*o-s*m*o-p*i*c+n*m*c+s*i*v-n*l*v)*S,e[7]=(s*d*o-u*l*o+u*i*c-n*d*c-s*i*h+n*l*h)*S,e[8]=b*S,e[9]=(p*f*o-u*g*o-p*r*h+n*g*h+u*r*v-n*f*v)*S,e[10]=(s*g*o-p*a*o+p*r*c-n*g*c-s*r*v+n*a*v)*S,e[11]=(u*a*o-s*f*o-u*r*c+n*f*c+s*r*h-n*a*h)*S,e[12]=w*S,e[13]=(u*g*i-p*f*i+p*r*d-n*g*d-u*r*m+n*f*m)*S,e[14]=(p*a*i-s*g*i-p*r*l+n*g*l+s*r*m-n*a*m)*S,e[15]=(s*f*i-u*a*i+u*r*l-n*f*l-s*r*d+n*a*d)*S,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,s=e.x,a=e.y,l=e.z,c=o*s,u=o*a;return this.set(c*s+r,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+r,u*l-i*s,0,c*l-i*a,u*l+i*s,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,s){return this.set(1,r,o,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,c=o+o,u=s+s,f=a+a,d=o*c,h=o*u,p=o*f,g=s*u,m=s*f,v=a*f,y=l*c,x=l*u,b=l*f,w=r.x,_=r.y,S=r.z;return i[0]=(1-(g+v))*w,i[1]=(h+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(h-b)*_,i[5]=(1-(d+v))*_,i[6]=(m+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(m-y)*S,i[10]=(1-(d+g))*S,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=Sw.set(i[0],i[1],i[2]).length();const s=Sw.set(i[4],i[5],i[6]).length(),a=Sw.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],Ju.copy(this);const c=1/o,u=1/s,f=1/a;return Ju.elements[0]*=c,Ju.elements[1]*=c,Ju.elements[2]*=c,Ju.elements[4]*=u,Ju.elements[5]*=u,Ju.elements[6]*=u,Ju.elements[8]*=f,Ju.elements[9]*=f,Ju.elements[10]*=f,n.setFromRotationMatrix(Ju),r.x=o,r.y=s,r.z=a,this}makePerspective(e,n,r,i,o,s){const a=this.elements,l=2*o/(n-e),c=2*o/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d=-(s+o)/(s-o),h=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=f,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,n,r,i,o,s){const a=this.elements,l=1/(n-e),c=1/(r-i),u=1/(s-o),f=(n+e)*l,d=(r+i)*c,h=(s+o)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-f,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[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 Sw=new Ce,Ju=new Gr,K6n=new Ce(0,0,0),Z6n=new Ce(1,1,1),Cm=new Ce,v$=new Ce,Nl=new Ce,dEe=new Gr,hEe=new Yb;class SD{constructor(e=0,n=0,r=0,i=SD.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],s=i[4],a=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(nl(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-nl(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(nl(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-nl(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(-s,c));break;case"YZX":this._z=Math.asin(nl(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(a,h));break;case"XZY":this._z=Math.asin(-nl(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,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 dEe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(dEe,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return hEe.setFromEuler(this),this.setFromQuaternion(hEe,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")}}SD.DefaultOrder="XYZ";SD.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class hYe{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 a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),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 s(a){const l=[];for(const c in a){const u=a[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){ef.subVectors(i,n),bp.subVectors(r,n),bG.subVectors(e,n);const s=ef.dot(ef),a=ef.dot(bp),l=ef.dot(bG),c=bp.dot(bp),u=bp.dot(bG),f=s*c-a*a;if(f===0)return o.set(-2,-1,-1);const d=1/f,h=(c*l-a*u)*d,p=(s*u-a*l)*d;return o.set(1-h-p,p,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,wp),wp.x>=0&&wp.y>=0&&wp.x+wp.y<=1}static getUV(e,n,r,i,o,s,a,l){return this.getBarycoord(e,n,r,i,wp),l.set(0,0),l.addScaledVector(o,wp.x),l.addScaledVector(s,wp.y),l.addScaledVector(a,wp.z),l}static isFrontFacing(e,n,r,i){return ef.subVectors(r,n),bp.subVectors(e,n),ef.cross(bp).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 ef.subVectors(this.c,this.b),bp.subVectors(this.a,this.b),ef.cross(bp).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Hp.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Hp.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Hp.getUV(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Hp.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Hp.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 s,a;Ow.subVectors(i,r),Ew.subVectors(o,r),wG.subVectors(e,r);const l=Ow.dot(wG),c=Ew.dot(wG);if(l<=0&&c<=0)return n.copy(r);_G.subVectors(e,i);const u=Ow.dot(_G),f=Ew.dot(_G);if(u>=0&&f<=u)return n.copy(i);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(r).addScaledVector(Ow,s);SG.subVectors(e,o);const h=Ow.dot(SG),p=Ew.dot(SG);if(p>=0&&h<=p)return n.copy(o);const g=h*c-l*p;if(g<=0&&c>=0&&p<=0)return a=c/(c-p),n.copy(r).addScaledVector(Ew,a);const m=u*p-h*f;if(m<=0&&f-u>=0&&h-p>=0)return xEe.subVectors(o,i),a=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(xEe,a);const v=1/(m+g+d);return s=g*v,a=d*v,n.copy(r).addScaledVector(Ow,s).addScaledVector(Ew,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let rUn=0;class CD extends $1{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rUn++}),this.uuid=_D(),this.name="",this.type="Material",this.blending=uS,this.side=WC,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=eYe,this.blendDst=tYe,this.blendEquation=Hw,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=tJ,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=q6n,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=aG,this.stencilZFail=aG,this.stencilZPass=aG,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!==uS&&(r.blending=this.blending),this.side!==WC&&(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 s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(e.textures),s=i(e.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}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 uue extends CD{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new hi(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=nYe,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 eo=new Ce,x$=new On;class yu{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=sEe,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 s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.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,s=i.length;on.far?null:{distance:c,point:E$.clone(),object:t}}function T$(t,e,n,r,i,o,s,a,l,c,u,f){Om.fromBufferAttribute(i,c),Em.fromBufferAttribute(i,u),Tm.fromBufferAttribute(i,f);const d=t.morphTargetInfluences;if(o&&d){b$.set(0,0,0),w$.set(0,0,0),_$.set(0,0,0);for(let p=0,g=o.length;p0?1:-1,u.push(N.x,N.y,N.z),f.push($/S),f.push(1-L/O),z+=1}}for(let L=0;L1?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||dUn.getNormalMatrix(e),i=this.coplanarPoint(PG).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 Mw=new l8,k$=new Ce;class xYe{constructor(e=new X0,n=new X0,r=new X0,i=new X0,o=new X0,s=new X0){this.planes=[e,n,r,i,o,s]}set(e,n,r,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),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],s=r[2],a=r[3],l=r[4],c=r[5],u=r[6],f=r[7],d=r[8],h=r[9],p=r[10],g=r[11],m=r[12],v=r[13],y=r[14],x=r[15];return n[0].setComponents(a-i,f-l,g-d,x-m).normalize(),n[1].setComponents(a+i,f+l,g+d,x+m).normalize(),n[2].setComponents(a+o,f+c,g+h,x+v).normalize(),n[3].setComponents(a-o,f-c,g-h,x-v).normalize(),n[4].setComponents(a-s,f-u,g-p,x-y).normalize(),n[5].setComponents(a+s,f+u,g+p,x+y).normalize(),this}intersectsObject(e){const n=e.geometry;return n.boundingSphere===null&&n.computeBoundingSphere(),Mw.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Mw)}intersectsSprite(e){return Mw.center.set(0,0,0),Mw.radius=.7071067811865476,Mw.applyMatrix4(e.matrixWorld),this.intersectsSphere(Mw)}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,k$.y=i.normal.y>0?e.max.y:e.min.y,k$.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(k$)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function bYe(){let t=null,e=!1,n=null,r=null;function i(o,s){n(o,s),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 hUn(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 s(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function a(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||dUn.getNormalMatrix(e),i=this.coplanarPoint(PG).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 Mw=new l8,k$=new Ce;class xYe{constructor(e=new X0,n=new X0,r=new X0,i=new X0,o=new X0,s=new X0){this.planes=[e,n,r,i,o,s]}set(e,n,r,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),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],s=r[2],a=r[3],l=r[4],c=r[5],u=r[6],f=r[7],d=r[8],h=r[9],p=r[10],g=r[11],m=r[12],v=r[13],y=r[14],x=r[15];return n[0].setComponents(a-i,f-l,g-d,x-m).normalize(),n[1].setComponents(a+i,f+l,g+d,x+m).normalize(),n[2].setComponents(a+o,f+c,g+h,x+v).normalize(),n[3].setComponents(a-o,f-c,g-h,x-v).normalize(),n[4].setComponents(a-s,f-u,g-p,x-y).normalize(),n[5].setComponents(a+s,f+u,g+p,x+y).normalize(),this}intersectsObject(e){const n=e.geometry;return n.boundingSphere===null&&n.computeBoundingSphere(),Mw.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Mw)}intersectsSprite(e){return Mw.center.set(0,0,0),Mw.radius=.7071067811865476,Mw.applyMatrix4(e.matrixWorld),this.intersectsSphere(Mw)}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,k$.y=i.normal.y>0?e.max.y:e.min.y,k$.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(k$)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function bYe(){let t=null,e=!1,n=null,r=null;function i(o,s){n(o,s),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 hUn(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 s(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function a(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 #include #include -}`,Cn={alphamap_fragment:pUn,alphamap_pars_fragment:gUn,alphatest_fragment:mUn,alphatest_pars_fragment:vUn,aomap_fragment:yUn,aomap_pars_fragment:xUn,begin_vertex:bUn,beginnormal_vertex:wUn,bsdfs:_Un,iridescence_fragment:SUn,bumpmap_pars_fragment:CUn,clipping_planes_fragment:OUn,clipping_planes_pars_fragment:EUn,clipping_planes_pars_vertex:TUn,clipping_planes_vertex:kUn,color_fragment:AUn,color_pars_fragment:PUn,color_pars_vertex:MUn,color_vertex:RUn,common:DUn,cube_uv_reflection_fragment:IUn,defaultnormal_vertex:LUn,displacementmap_pars_vertex:$Un,displacementmap_vertex:FUn,emissivemap_fragment:NUn,emissivemap_pars_fragment:zUn,encodings_fragment:jUn,encodings_pars_fragment:BUn,envmap_fragment:UUn,envmap_common_pars_fragment:WUn,envmap_pars_fragment:VUn,envmap_pars_vertex:GUn,envmap_physical_pars_fragment:r8n,envmap_vertex:HUn,fog_vertex:qUn,fog_pars_vertex:XUn,fog_fragment:YUn,fog_pars_fragment:QUn,gradientmap_pars_fragment:KUn,lightmap_fragment:ZUn,lightmap_pars_fragment:JUn,lights_lambert_fragment:e8n,lights_lambert_pars_fragment:t8n,lights_pars_begin:n8n,lights_toon_fragment:i8n,lights_toon_pars_fragment:o8n,lights_phong_fragment:s8n,lights_phong_pars_fragment:a8n,lights_physical_fragment:l8n,lights_physical_pars_fragment:c8n,lights_fragment_begin:u8n,lights_fragment_maps:f8n,lights_fragment_end:d8n,logdepthbuf_fragment:h8n,logdepthbuf_pars_fragment:p8n,logdepthbuf_pars_vertex:g8n,logdepthbuf_vertex:m8n,map_fragment:v8n,map_pars_fragment:y8n,map_particle_fragment:x8n,map_particle_pars_fragment:b8n,metalnessmap_fragment:w8n,metalnessmap_pars_fragment:_8n,morphcolor_vertex:S8n,morphnormal_vertex:C8n,morphtarget_pars_vertex:O8n,morphtarget_vertex:E8n,normal_fragment_begin:T8n,normal_fragment_maps:k8n,normal_pars_fragment:A8n,normal_pars_vertex:P8n,normal_vertex:M8n,normalmap_pars_fragment:R8n,clearcoat_normal_fragment_begin:D8n,clearcoat_normal_fragment_maps:I8n,clearcoat_pars_fragment:L8n,iridescence_pars_fragment:$8n,output_fragment:F8n,packing:N8n,premultiplied_alpha_fragment:z8n,project_vertex:j8n,dithering_fragment:B8n,dithering_pars_fragment:U8n,roughnessmap_fragment:W8n,roughnessmap_pars_fragment:V8n,shadowmap_pars_fragment:G8n,shadowmap_pars_vertex:H8n,shadowmap_vertex:q8n,shadowmask_pars_fragment:X8n,skinbase_vertex:Y8n,skinning_pars_vertex:Q8n,skinning_vertex:K8n,skinnormal_vertex:Z8n,specularmap_fragment:J8n,specularmap_pars_fragment:eWn,tonemapping_fragment:tWn,tonemapping_pars_fragment:nWn,transmission_fragment:rWn,transmission_pars_fragment:iWn,uv_pars_fragment:oWn,uv_pars_vertex:sWn,uv_vertex:aWn,uv2_pars_fragment:lWn,uv2_pars_vertex:cWn,uv2_vertex:uWn,worldpos_vertex:fWn,background_vert:dWn,background_frag:hWn,cube_vert:pWn,cube_frag:gWn,depth_vert:mWn,depth_frag:vWn,distanceRGBA_vert:yWn,distanceRGBA_frag:xWn,equirect_vert:bWn,equirect_frag:wWn,linedashed_vert:_Wn,linedashed_frag:SWn,meshbasic_vert:CWn,meshbasic_frag:OWn,meshlambert_vert:EWn,meshlambert_frag:TWn,meshmatcap_vert:kWn,meshmatcap_frag:AWn,meshnormal_vert:PWn,meshnormal_frag:MWn,meshphong_vert:RWn,meshphong_frag:DWn,meshphysical_vert:IWn,meshphysical_frag:LWn,meshtoon_vert:$Wn,meshtoon_frag:FWn,points_vert:NWn,points_frag:zWn,shadow_vert:jWn,shadow_frag:BWn,sprite_vert:UWn,sprite_frag:WWn},ft={common:{diffuse:{value:new hi(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new uc},uv2Transform:{value:new uc},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 On(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 hi(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 hi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new uc}},sprite:{diffuse:{value:new hi(16777215)},opacity:{value:1},center:{value:new On(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new uc}}},$d={basic:{uniforms:Ls([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.fog]),vertexShader:Cn.meshbasic_vert,fragmentShader:Cn.meshbasic_frag},lambert:{uniforms:Ls([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new hi(0)}}]),vertexShader:Cn.meshlambert_vert,fragmentShader:Cn.meshlambert_frag},phong:{uniforms:Ls([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new hi(0)},specular:{value:new hi(1118481)},shininess:{value:30}}]),vertexShader:Cn.meshphong_vert,fragmentShader:Cn.meshphong_frag},standard:{uniforms:Ls([ft.common,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.roughnessmap,ft.metalnessmap,ft.fog,ft.lights,{emissive:{value:new hi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Cn.meshphysical_vert,fragmentShader:Cn.meshphysical_frag},toon:{uniforms:Ls([ft.common,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.gradientmap,ft.fog,ft.lights,{emissive:{value:new hi(0)}}]),vertexShader:Cn.meshtoon_vert,fragmentShader:Cn.meshtoon_frag},matcap:{uniforms:Ls([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,{matcap:{value:null}}]),vertexShader:Cn.meshmatcap_vert,fragmentShader:Cn.meshmatcap_frag},points:{uniforms:Ls([ft.points,ft.fog]),vertexShader:Cn.points_vert,fragmentShader:Cn.points_frag},dashed:{uniforms:Ls([ft.common,ft.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Cn.linedashed_vert,fragmentShader:Cn.linedashed_frag},depth:{uniforms:Ls([ft.common,ft.displacementmap]),vertexShader:Cn.depth_vert,fragmentShader:Cn.depth_frag},normal:{uniforms:Ls([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,{opacity:{value:1}}]),vertexShader:Cn.meshnormal_vert,fragmentShader:Cn.meshnormal_frag},sprite:{uniforms:Ls([ft.sprite,ft.fog]),vertexShader:Cn.sprite_vert,fragmentShader:Cn.sprite_frag},background:{uniforms:{uvTransform:{value:new uc},t2D:{value:null}},vertexShader:Cn.background_vert,fragmentShader:Cn.background_frag},cube:{uniforms:Ls([ft.envmap,{opacity:{value:1}}]),vertexShader:Cn.cube_vert,fragmentShader:Cn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Cn.equirect_vert,fragmentShader:Cn.equirect_frag},distanceRGBA:{uniforms:Ls([ft.common,ft.displacementmap,{referencePosition:{value:new Ce},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Cn.distanceRGBA_vert,fragmentShader:Cn.distanceRGBA_frag},shadow:{uniforms:Ls([ft.lights,ft.fog,{color:{value:new hi(0)},opacity:{value:1}}]),vertexShader:Cn.shadow_vert,fragmentShader:Cn.shadow_frag}};$d.physical={uniforms:Ls([$d.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new On(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 hi(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new On},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new hi(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new hi(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Cn.meshphysical_vert,fragmentShader:Cn.meshphysical_frag};function VWn(t,e,n,r,i,o){const s=new hi(0);let a=i===!0?0:1,l,c,u=null,f=0,d=null;function h(g,m){let v=!1,y=m.isScene===!0?m.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(s,a):y&&y.isColor&&(p(y,1),v=!0),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===s8)?(c===void 0&&(c=new ah(new yE(1,1,1),new Ty({name:"BackgroundCubeMaterial",uniforms:qC($d.cube.uniforms),vertexShader:$d.cube.vertexShader,fragmentShader:$d.cube.fragmentShader,side:mc,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(w,_,S){this.matrixWorld.copyPosition(S.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(),g.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new ah(new c8(2,2),new Ty({name:"BackgroundMaterial",uniforms:qC($d.background.uniforms),vertexShader:$d.background.vertexShader,fragmentShader:$d.background.fragmentShader,side:WC,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(),g.unshift(l,l.geometry,l.material,0,0,null))}function p(g,m){n.buffers.color.setClear(g.r,g.g,g.b,m,o)}return{getClearColor:function(){return s},setClearColor:function(g,m=1){s.set(g),a=m,p(s,a)},getClearAlpha:function(){return a},setClearAlpha:function(g){a=g,p(s,a)},render:h}}function GWn(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||o!==null,a={},l=m(null);let c=l,u=!1;function f(T,M,I,z,F){let N=!1;if(s){const L=g(z,I,M);c!==L&&(c=L,h(c.object)),N=v(T,z,I,F),N&&y(T,z,I,F)}else{const L=M.wireframe===!0;(c.geometry!==z.id||c.program!==I.id||c.wireframe!==L)&&(c.geometry=z.id,c.program=I.id,c.wireframe=L,N=!0)}F!==null&&n.update(F,34963),(N||u)&&(u=!1,O(T,M,I,z),F!==null&&t.bindBuffer(34963,n.get(F).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 g(T,M,I){const z=I.wireframe===!0;let F=a[T.id];F===void 0&&(F={},a[T.id]=F);let N=F[M.id];N===void 0&&(N={},F[M.id]=N);let L=N[z];return L===void 0&&(L=m(d()),N[z]=L),L}function m(T){const M=[],I=[],z=[];for(let F=0;F=0){const X=F[$];let V=N[$];if(V===void 0&&($==="instanceMatrix"&&T.instanceMatrix&&(V=T.instanceMatrix),$==="instanceColor"&&T.instanceColor&&(V=T.instanceColor)),X===void 0||X.attribute!==V||V&&X.data!==V.data)return!0;L++}return c.attributesNum!==L||c.index!==z}function y(T,M,I,z){const F={},N=M.attributes;let L=0;const B=I.getAttributes();for(const $ in B)if(B[$].location>=0){let X=N[$];X===void 0&&($==="instanceMatrix"&&T.instanceMatrix&&(X=T.instanceMatrix),$==="instanceColor"&&T.instanceColor&&(X=T.instanceColor));const V={};V.attribute=X,X&&X.data&&(V.data=X.data),F[$]=V,L++}c.attributes=F,c.attributesNum=L,c.index=z}function x(){const T=c.newAttributes;for(let M=0,I=T.length;M=0){let j=F[B];if(j===void 0&&(B==="instanceMatrix"&&T.instanceMatrix&&(j=T.instanceMatrix),B==="instanceColor"&&T.instanceColor&&(j=T.instanceColor)),j!==void 0){const X=j.normalized,V=j.itemSize,Y=n.get(j);if(Y===void 0)continue;const le=Y.buffer,K=Y.type,ee=Y.bytesPerElement;if(j.isInterleavedBufferAttribute){const re=j.data,me=re.stride,te=j.offset;if(re.isInstancedInterleavedBuffer){for(let ae=0;ae<$.locationSize;ae++)w($.location+ae,re.meshPerAttribute);T.isInstancedMesh!==!0&&z._maxInstanceCount===void 0&&(z._maxInstanceCount=re.meshPerAttribute*re.count)}else for(let ae=0;ae<$.locationSize;ae++)b($.location+ae);t.bindBuffer(34962,le);for(let ae=0;ae<$.locationSize;ae++)S($.location+ae,V/$.locationSize,K,X,me*ee,(te+V/$.locationSize*ae)*ee)}else{if(j.isInstancedBufferAttribute){for(let re=0;re<$.locationSize;re++)w($.location+re,j.meshPerAttribute);T.isInstancedMesh!==!0&&z._maxInstanceCount===void 0&&(z._maxInstanceCount=j.meshPerAttribute*j.count)}else for(let re=0;re<$.locationSize;re++)b($.location+re);t.bindBuffer(34962,le);for(let re=0;re<$.locationSize;re++)S($.location+re,V/$.locationSize,K,X,V*ee,V/$.locationSize*re*ee)}}else if(L!==void 0){const X=L[B];if(X!==void 0)switch(X.length){case 2:t.vertexAttrib2fv($.location,X);break;case 3:t.vertexAttrib3fv($.location,X);break;case 4:t.vertexAttrib4fv($.location,X);break;default:t.vertexAttrib1fv($.location,X)}}}}_()}function k(){A();for(const T in a){const M=a[T];for(const I in M){const z=M[I];for(const F in z)p(z[F].object),delete z[F];delete M[I]}delete a[T]}}function E(T){if(a[T.id]===void 0)return;const M=a[T.id];for(const I in M){const z=M[I];for(const F in z)p(z[F].object),delete z[F];delete M[I]}delete a[T.id]}function P(T){for(const M in a){const I=a[M];if(I[T.id]===void 0)continue;const z=I[T.id];for(const F in z)p(z[F].object),delete z[F];delete I[T.id]}}function A(){R(),u=!0,c!==l&&(c=l,h(c.object))}function R(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:f,reset:A,resetDefaultState:R,dispose:k,releaseStatesOfGeometry:E,releaseStatesOfProgram:P,initAttributes:x,enableAttribute:b,disableUnusedAttributes:_}}function HWn(t,e,n,r){const i=r.isWebGL2;let o;function s(c){o=c}function a(c,u){t.drawArrays(o,c,u),n.update(u,o,1)}function l(c,u,f){if(f===0)return;let d,h;if(i)d=t,h="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[h](o,c,u,f),n.update(u,o,f)}this.setMode=s,this.render=a,this.renderInstances=l}function qWn(t,e,n){let r;function i(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const S=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(S){if(S==="highp"){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&t instanceof WebGL2ComputeRenderingContext;let a=n.precision!==void 0?n.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=s||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),g=t.getParameter(34921),m=t.getParameter(36347),v=t.getParameter(36348),y=t.getParameter(36349),x=d>0,b=s||e.has("OES_texture_float"),w=x&&b,_=s?t.getParameter(36183):0;return{isWebGL2:s,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function XWn(t){const e=this;let n=null,r=0,i=!1,o=!1;const s=new X0,a=new uc,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,g=f.clipIntersection,m=f.clipShadows,v=t.get(f);if(!i||p===null||p.length===0||o&&!m)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 w=0;w!==x;++w)b[w]=n[w];v.clippingState=b,this.numIntersection=g?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 g=f!==null?f.length:0;let m=null;if(g!==0){if(m=l.value,p!==!0||m===null){const v=h+g*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length0){const c=new uUn(l.height/2);return c.fromEquirectangularTexture(t,s),e.set(s,c),s.addEventListener("dispose",i),n(c.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class wYe extends vYe{constructor(e=-1,n=1,r=1,i=-1,o=.1,s=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=s,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,s){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=s,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,s=r+e,a=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,s=o+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,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 O_=4,wEe=[.125,.215,.35,.446,.526,.582],ax=20,MG=new wYe,_Ee=new hi;let RG=null;const Y0=(1+Math.sqrt(5))/2,Rw=1/Y0,SEe=[new Ce(1,1,1),new Ce(-1,1,1),new Ce(1,1,-1),new Ce(-1,1,-1),new Ce(0,Y0,Rw),new Ce(0,Y0,-Rw),new Ce(Rw,0,Y0),new Ce(-Rw,0,Y0),new Ce(Y0,Rw,0),new Ce(-Y0,Rw,0)];class CEe{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){RG=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=TEe(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=EEe(),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),g&&u.render(p,a),u.render(e,a)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=d,u.autoClear=f,e.background=m}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===VC||e.mapping===GC;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=TEe()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=EEe());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new ah(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=e;const l=this._cubeSize;A$(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,MG)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iax&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ax}`);const v=[];let y=0;for(let S=0;Sx-O_?i-x+O_:0),_=4*(this._cubeSize-b);A$(n,w,_,3*b,2*b),l.setRenderTarget(n),l.render(f,MG)}}function QWn(t){const e=[],n=[],r=[];let i=t;const o=t-O_+1+wEe.length;for(let s=0;st-O_?l=wEe[s-t+O_-1]:s===0&&(l=0),r.push(l);const c=1/(a-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,g=3,m=2,v=1,y=new Float32Array(g*p*h),x=new Float32Array(m*p*h),b=new Float32Array(v*p*h);for(let _=0;_2?0:-1,k=[S,O,0,S+2/3,O,0,S+2/3,O+1,0,S,O,0,S+2/3,O+1,0,S,O+1,0];y.set(k,g*p*_),x.set(d,m*p*_);const E=[_,_,_,_,_,_];b.set(E,v*p*_)}const w=new sm;w.setAttribute("position",new yu(y,g)),w.setAttribute("uv",new yu(x,m)),w.setAttribute("faceIndex",new yu(b,v)),e.push(w),i>O_&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function OEe(t,e,n){const r=new Xb(t,e,n);return r.texture.mapping=s8,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function A$(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function KWn(t,e,n){const r=new Float32Array(ax),i=new Ce(0,1,0);return new Ty({name:"SphericalGaussianBlur",defines:{n:ax,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:fue(),fragmentShader:` +}`,Cn={alphamap_fragment:pUn,alphamap_pars_fragment:gUn,alphatest_fragment:mUn,alphatest_pars_fragment:vUn,aomap_fragment:yUn,aomap_pars_fragment:xUn,begin_vertex:bUn,beginnormal_vertex:wUn,bsdfs:_Un,iridescence_fragment:SUn,bumpmap_pars_fragment:CUn,clipping_planes_fragment:OUn,clipping_planes_pars_fragment:EUn,clipping_planes_pars_vertex:TUn,clipping_planes_vertex:kUn,color_fragment:AUn,color_pars_fragment:PUn,color_pars_vertex:MUn,color_vertex:RUn,common:DUn,cube_uv_reflection_fragment:IUn,defaultnormal_vertex:LUn,displacementmap_pars_vertex:$Un,displacementmap_vertex:FUn,emissivemap_fragment:NUn,emissivemap_pars_fragment:zUn,encodings_fragment:jUn,encodings_pars_fragment:BUn,envmap_fragment:UUn,envmap_common_pars_fragment:WUn,envmap_pars_fragment:VUn,envmap_pars_vertex:GUn,envmap_physical_pars_fragment:r8n,envmap_vertex:HUn,fog_vertex:qUn,fog_pars_vertex:XUn,fog_fragment:YUn,fog_pars_fragment:QUn,gradientmap_pars_fragment:KUn,lightmap_fragment:ZUn,lightmap_pars_fragment:JUn,lights_lambert_fragment:e8n,lights_lambert_pars_fragment:t8n,lights_pars_begin:n8n,lights_toon_fragment:i8n,lights_toon_pars_fragment:o8n,lights_phong_fragment:s8n,lights_phong_pars_fragment:a8n,lights_physical_fragment:l8n,lights_physical_pars_fragment:c8n,lights_fragment_begin:u8n,lights_fragment_maps:f8n,lights_fragment_end:d8n,logdepthbuf_fragment:h8n,logdepthbuf_pars_fragment:p8n,logdepthbuf_pars_vertex:g8n,logdepthbuf_vertex:m8n,map_fragment:v8n,map_pars_fragment:y8n,map_particle_fragment:x8n,map_particle_pars_fragment:b8n,metalnessmap_fragment:w8n,metalnessmap_pars_fragment:_8n,morphcolor_vertex:S8n,morphnormal_vertex:C8n,morphtarget_pars_vertex:O8n,morphtarget_vertex:E8n,normal_fragment_begin:T8n,normal_fragment_maps:k8n,normal_pars_fragment:A8n,normal_pars_vertex:P8n,normal_vertex:M8n,normalmap_pars_fragment:R8n,clearcoat_normal_fragment_begin:D8n,clearcoat_normal_fragment_maps:I8n,clearcoat_pars_fragment:L8n,iridescence_pars_fragment:$8n,output_fragment:F8n,packing:N8n,premultiplied_alpha_fragment:z8n,project_vertex:j8n,dithering_fragment:B8n,dithering_pars_fragment:U8n,roughnessmap_fragment:W8n,roughnessmap_pars_fragment:V8n,shadowmap_pars_fragment:G8n,shadowmap_pars_vertex:H8n,shadowmap_vertex:q8n,shadowmask_pars_fragment:X8n,skinbase_vertex:Y8n,skinning_pars_vertex:Q8n,skinning_vertex:K8n,skinnormal_vertex:Z8n,specularmap_fragment:J8n,specularmap_pars_fragment:eWn,tonemapping_fragment:tWn,tonemapping_pars_fragment:nWn,transmission_fragment:rWn,transmission_pars_fragment:iWn,uv_pars_fragment:oWn,uv_pars_vertex:sWn,uv_vertex:aWn,uv2_pars_fragment:lWn,uv2_pars_vertex:cWn,uv2_vertex:uWn,worldpos_vertex:fWn,background_vert:dWn,background_frag:hWn,cube_vert:pWn,cube_frag:gWn,depth_vert:mWn,depth_frag:vWn,distanceRGBA_vert:yWn,distanceRGBA_frag:xWn,equirect_vert:bWn,equirect_frag:wWn,linedashed_vert:_Wn,linedashed_frag:SWn,meshbasic_vert:CWn,meshbasic_frag:OWn,meshlambert_vert:EWn,meshlambert_frag:TWn,meshmatcap_vert:kWn,meshmatcap_frag:AWn,meshnormal_vert:PWn,meshnormal_frag:MWn,meshphong_vert:RWn,meshphong_frag:DWn,meshphysical_vert:IWn,meshphysical_frag:LWn,meshtoon_vert:$Wn,meshtoon_frag:FWn,points_vert:NWn,points_frag:zWn,shadow_vert:jWn,shadow_frag:BWn,sprite_vert:UWn,sprite_frag:WWn},ft={common:{diffuse:{value:new hi(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new uc},uv2Transform:{value:new uc},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 On(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 hi(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 hi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new uc}},sprite:{diffuse:{value:new hi(16777215)},opacity:{value:1},center:{value:new On(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new uc}}},$d={basic:{uniforms:Ls([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.fog]),vertexShader:Cn.meshbasic_vert,fragmentShader:Cn.meshbasic_frag},lambert:{uniforms:Ls([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new hi(0)}}]),vertexShader:Cn.meshlambert_vert,fragmentShader:Cn.meshlambert_frag},phong:{uniforms:Ls([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new hi(0)},specular:{value:new hi(1118481)},shininess:{value:30}}]),vertexShader:Cn.meshphong_vert,fragmentShader:Cn.meshphong_frag},standard:{uniforms:Ls([ft.common,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.roughnessmap,ft.metalnessmap,ft.fog,ft.lights,{emissive:{value:new hi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Cn.meshphysical_vert,fragmentShader:Cn.meshphysical_frag},toon:{uniforms:Ls([ft.common,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.gradientmap,ft.fog,ft.lights,{emissive:{value:new hi(0)}}]),vertexShader:Cn.meshtoon_vert,fragmentShader:Cn.meshtoon_frag},matcap:{uniforms:Ls([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,{matcap:{value:null}}]),vertexShader:Cn.meshmatcap_vert,fragmentShader:Cn.meshmatcap_frag},points:{uniforms:Ls([ft.points,ft.fog]),vertexShader:Cn.points_vert,fragmentShader:Cn.points_frag},dashed:{uniforms:Ls([ft.common,ft.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Cn.linedashed_vert,fragmentShader:Cn.linedashed_frag},depth:{uniforms:Ls([ft.common,ft.displacementmap]),vertexShader:Cn.depth_vert,fragmentShader:Cn.depth_frag},normal:{uniforms:Ls([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,{opacity:{value:1}}]),vertexShader:Cn.meshnormal_vert,fragmentShader:Cn.meshnormal_frag},sprite:{uniforms:Ls([ft.sprite,ft.fog]),vertexShader:Cn.sprite_vert,fragmentShader:Cn.sprite_frag},background:{uniforms:{uvTransform:{value:new uc},t2D:{value:null}},vertexShader:Cn.background_vert,fragmentShader:Cn.background_frag},cube:{uniforms:Ls([ft.envmap,{opacity:{value:1}}]),vertexShader:Cn.cube_vert,fragmentShader:Cn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Cn.equirect_vert,fragmentShader:Cn.equirect_frag},distanceRGBA:{uniforms:Ls([ft.common,ft.displacementmap,{referencePosition:{value:new Ce},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Cn.distanceRGBA_vert,fragmentShader:Cn.distanceRGBA_frag},shadow:{uniforms:Ls([ft.lights,ft.fog,{color:{value:new hi(0)},opacity:{value:1}}]),vertexShader:Cn.shadow_vert,fragmentShader:Cn.shadow_frag}};$d.physical={uniforms:Ls([$d.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new On(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 hi(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new On},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new hi(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new hi(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Cn.meshphysical_vert,fragmentShader:Cn.meshphysical_frag};function VWn(t,e,n,r,i,o){const s=new hi(0);let a=i===!0?0:1,l,c,u=null,f=0,d=null;function h(g,m){let v=!1,y=m.isScene===!0?m.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(s,a):y&&y.isColor&&(p(y,1),v=!0),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===s8)?(c===void 0&&(c=new ah(new vE(1,1,1),new Ty({name:"BackgroundCubeMaterial",uniforms:qC($d.cube.uniforms),vertexShader:$d.cube.vertexShader,fragmentShader:$d.cube.fragmentShader,side:mc,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(w,_,S){this.matrixWorld.copyPosition(S.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(),g.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new ah(new c8(2,2),new Ty({name:"BackgroundMaterial",uniforms:qC($d.background.uniforms),vertexShader:$d.background.vertexShader,fragmentShader:$d.background.fragmentShader,side:WC,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(),g.unshift(l,l.geometry,l.material,0,0,null))}function p(g,m){n.buffers.color.setClear(g.r,g.g,g.b,m,o)}return{getClearColor:function(){return s},setClearColor:function(g,m=1){s.set(g),a=m,p(s,a)},getClearAlpha:function(){return a},setClearAlpha:function(g){a=g,p(s,a)},render:h}}function GWn(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||o!==null,a={},l=m(null);let c=l,u=!1;function f(T,M,I,z,F){let N=!1;if(s){const L=g(z,I,M);c!==L&&(c=L,h(c.object)),N=v(T,z,I,F),N&&y(T,z,I,F)}else{const L=M.wireframe===!0;(c.geometry!==z.id||c.program!==I.id||c.wireframe!==L)&&(c.geometry=z.id,c.program=I.id,c.wireframe=L,N=!0)}F!==null&&n.update(F,34963),(N||u)&&(u=!1,O(T,M,I,z),F!==null&&t.bindBuffer(34963,n.get(F).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 g(T,M,I){const z=I.wireframe===!0;let F=a[T.id];F===void 0&&(F={},a[T.id]=F);let N=F[M.id];N===void 0&&(N={},F[M.id]=N);let L=N[z];return L===void 0&&(L=m(d()),N[z]=L),L}function m(T){const M=[],I=[],z=[];for(let F=0;F=0){const X=F[$];let V=N[$];if(V===void 0&&($==="instanceMatrix"&&T.instanceMatrix&&(V=T.instanceMatrix),$==="instanceColor"&&T.instanceColor&&(V=T.instanceColor)),X===void 0||X.attribute!==V||V&&X.data!==V.data)return!0;L++}return c.attributesNum!==L||c.index!==z}function y(T,M,I,z){const F={},N=M.attributes;let L=0;const B=I.getAttributes();for(const $ in B)if(B[$].location>=0){let X=N[$];X===void 0&&($==="instanceMatrix"&&T.instanceMatrix&&(X=T.instanceMatrix),$==="instanceColor"&&T.instanceColor&&(X=T.instanceColor));const V={};V.attribute=X,X&&X.data&&(V.data=X.data),F[$]=V,L++}c.attributes=F,c.attributesNum=L,c.index=z}function x(){const T=c.newAttributes;for(let M=0,I=T.length;M=0){let j=F[B];if(j===void 0&&(B==="instanceMatrix"&&T.instanceMatrix&&(j=T.instanceMatrix),B==="instanceColor"&&T.instanceColor&&(j=T.instanceColor)),j!==void 0){const X=j.normalized,V=j.itemSize,Y=n.get(j);if(Y===void 0)continue;const le=Y.buffer,K=Y.type,ee=Y.bytesPerElement;if(j.isInterleavedBufferAttribute){const re=j.data,me=re.stride,te=j.offset;if(re.isInstancedInterleavedBuffer){for(let ae=0;ae<$.locationSize;ae++)w($.location+ae,re.meshPerAttribute);T.isInstancedMesh!==!0&&z._maxInstanceCount===void 0&&(z._maxInstanceCount=re.meshPerAttribute*re.count)}else for(let ae=0;ae<$.locationSize;ae++)b($.location+ae);t.bindBuffer(34962,le);for(let ae=0;ae<$.locationSize;ae++)S($.location+ae,V/$.locationSize,K,X,me*ee,(te+V/$.locationSize*ae)*ee)}else{if(j.isInstancedBufferAttribute){for(let re=0;re<$.locationSize;re++)w($.location+re,j.meshPerAttribute);T.isInstancedMesh!==!0&&z._maxInstanceCount===void 0&&(z._maxInstanceCount=j.meshPerAttribute*j.count)}else for(let re=0;re<$.locationSize;re++)b($.location+re);t.bindBuffer(34962,le);for(let re=0;re<$.locationSize;re++)S($.location+re,V/$.locationSize,K,X,V*ee,V/$.locationSize*re*ee)}}else if(L!==void 0){const X=L[B];if(X!==void 0)switch(X.length){case 2:t.vertexAttrib2fv($.location,X);break;case 3:t.vertexAttrib3fv($.location,X);break;case 4:t.vertexAttrib4fv($.location,X);break;default:t.vertexAttrib1fv($.location,X)}}}}_()}function k(){A();for(const T in a){const M=a[T];for(const I in M){const z=M[I];for(const F in z)p(z[F].object),delete z[F];delete M[I]}delete a[T]}}function E(T){if(a[T.id]===void 0)return;const M=a[T.id];for(const I in M){const z=M[I];for(const F in z)p(z[F].object),delete z[F];delete M[I]}delete a[T.id]}function P(T){for(const M in a){const I=a[M];if(I[T.id]===void 0)continue;const z=I[T.id];for(const F in z)p(z[F].object),delete z[F];delete I[T.id]}}function A(){R(),u=!0,c!==l&&(c=l,h(c.object))}function R(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:f,reset:A,resetDefaultState:R,dispose:k,releaseStatesOfGeometry:E,releaseStatesOfProgram:P,initAttributes:x,enableAttribute:b,disableUnusedAttributes:_}}function HWn(t,e,n,r){const i=r.isWebGL2;let o;function s(c){o=c}function a(c,u){t.drawArrays(o,c,u),n.update(u,o,1)}function l(c,u,f){if(f===0)return;let d,h;if(i)d=t,h="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[h](o,c,u,f),n.update(u,o,f)}this.setMode=s,this.render=a,this.renderInstances=l}function qWn(t,e,n){let r;function i(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const S=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(S){if(S==="highp"){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&t instanceof WebGL2ComputeRenderingContext;let a=n.precision!==void 0?n.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=s||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),g=t.getParameter(34921),m=t.getParameter(36347),v=t.getParameter(36348),y=t.getParameter(36349),x=d>0,b=s||e.has("OES_texture_float"),w=x&&b,_=s?t.getParameter(36183):0;return{isWebGL2:s,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function XWn(t){const e=this;let n=null,r=0,i=!1,o=!1;const s=new X0,a=new uc,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,g=f.clipIntersection,m=f.clipShadows,v=t.get(f);if(!i||p===null||p.length===0||o&&!m)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 w=0;w!==x;++w)b[w]=n[w];v.clippingState=b,this.numIntersection=g?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 g=f!==null?f.length:0;let m=null;if(g!==0){if(m=l.value,p!==!0||m===null){const v=h+g*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length0){const c=new uUn(l.height/2);return c.fromEquirectangularTexture(t,s),e.set(s,c),s.addEventListener("dispose",i),n(c.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class wYe extends vYe{constructor(e=-1,n=1,r=1,i=-1,o=.1,s=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=s,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,s){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=s,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,s=r+e,a=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,s=o+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,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 O_=4,wEe=[.125,.215,.35,.446,.526,.582],ax=20,MG=new wYe,_Ee=new hi;let RG=null;const Y0=(1+Math.sqrt(5))/2,Rw=1/Y0,SEe=[new Ce(1,1,1),new Ce(-1,1,1),new Ce(1,1,-1),new Ce(-1,1,-1),new Ce(0,Y0,Rw),new Ce(0,Y0,-Rw),new Ce(Rw,0,Y0),new Ce(-Rw,0,Y0),new Ce(Y0,Rw,0),new Ce(-Y0,Rw,0)];class CEe{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){RG=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=TEe(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=EEe(),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),g&&u.render(p,a),u.render(e,a)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=d,u.autoClear=f,e.background=m}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===VC||e.mapping===GC;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=TEe()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=EEe());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new ah(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=e;const l=this._cubeSize;A$(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,MG)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iax&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ax}`);const v=[];let y=0;for(let S=0;Sx-O_?i-x+O_:0),_=4*(this._cubeSize-b);A$(n,w,_,3*b,2*b),l.setRenderTarget(n),l.render(f,MG)}}function QWn(t){const e=[],n=[],r=[];let i=t;const o=t-O_+1+wEe.length;for(let s=0;st-O_?l=wEe[s-t+O_-1]:s===0&&(l=0),r.push(l);const c=1/(a-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,g=3,m=2,v=1,y=new Float32Array(g*p*h),x=new Float32Array(m*p*h),b=new Float32Array(v*p*h);for(let _=0;_2?0:-1,k=[S,O,0,S+2/3,O,0,S+2/3,O+1,0,S,O,0,S+2/3,O+1,0,S,O+1,0];y.set(k,g*p*_),x.set(d,m*p*_);const E=[_,_,_,_,_,_];b.set(E,v*p*_)}const w=new sm;w.setAttribute("position",new yu(y,g)),w.setAttribute("uv",new yu(x,m)),w.setAttribute("faceIndex",new yu(b,v)),e.push(w),i>O_&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function OEe(t,e,n){const r=new Xb(t,e,n);return r.texture.mapping=s8,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function A$(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function KWn(t,e,n){const r=new Float32Array(ax),i=new Ce(0,1,0);return new Ty({name:"SphericalGaussianBlur",defines:{n:ax,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:fue(),fragmentShader:` precision mediump float; precision mediump int; @@ -3681,27 +3681,27 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function ZWn(t){let e=new WeakMap,n=null;function r(a){if(a&&a.isTexture){const l=a.mapping,c=l===nJ||l===rJ,u=l===VC||l===GC;if(c||u)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let f=e.get(a);return n===null&&(n=new CEe(t)),f=c?n.fromEquirectangular(a,f):n.fromCubemap(a,f),e.set(a,f),f.texture}else{if(e.has(a))return e.get(a).texture;{const f=a.image;if(c&&f&&f.height>0||u&&f&&i(f)){n===null&&(n=new CEe(t));const d=c?n.fromEquirectangular(a):n.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",o),d.texture}else return null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(P=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const A=new Float32Array(E*P*4*g),R=new uYe(A,E,P,g);R.type=Ev,R.needsUpdate=!0;const T=k*4;for(let I=0;I0)return t;const i=e*n;let o=kEe[i];if(o===void 0&&(o=new Float32Array(i),kEe[i]=o),e!==0){r.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=n,t[s].toArray(o,a)}return o}function Ia(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 CEe(t));const d=c?n.fromEquirectangular(a):n.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",o),d.texture}else return null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(P=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const A=new Float32Array(E*P*4*g),R=new uYe(A,E,P,g);R.type=Ev,R.needsUpdate=!0;const T=k*4;for(let I=0;I0)return t;const i=e*n;let o=kEe[i];if(o===void 0&&(o=new Float32Array(i),kEe[i]=o),e!==0){r.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=n,t[s].toArray(o,a)}return o}function Ia(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${a}: ${n[s]}`)}return r.join(` `)}function JVn(t){switch(t){case qb:return["Linear","( value )"];case Pi:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function LEe(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 s=parseInt(o[1]);return n.toUpperCase()+` `+i+` -`+ZVn(t.getShaderSource(e),s)}else return i}function e9n(t,e){const n=JVn(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function t9n(t,e){let n;switch(e){case S6n:n="Linear";break;case C6n:n="Reinhard";break;case O6n:n="OptimizedCineon";break;case E6n:n="ACESFilmic";break;case T6n:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function n9n(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(zT).join(` +`+ZVn(t.getShaderSource(e),s)}else return i}function e9n(t,e){const n=JVn(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function t9n(t,e){let n;switch(e){case S6n:n="Linear";break;case C6n:n="Reinhard";break;case O6n:n="OptimizedCineon";break;case E6n:n="ACESFilmic";break;case T6n:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function n9n(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(NT).join(` `)}function r9n(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` -`)}function i9n(t,e){const n={},r=t.getProgramParameter(e,35721);for(let i=0;i/gm;function lJ(t){return t.replace(o9n,s9n)}function s9n(t,e){const n=Cn[e];if(n===void 0)throw new Error("Can not resolve #include <"+e+">");return lJ(n)}const a9n=/#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 NEe(t){return t.replace(a9n,l9n)}function l9n(t,e,n,r){let i="";for(let o=parseInt(e);o/gm;function lJ(t){return t.replace(o9n,s9n)}function s9n(t,e){const n=Cn[e];if(n===void 0)throw new Error("Can not resolve #include <"+e+">");return lJ(n)}const a9n=/#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 NEe(t){return t.replace(a9n,l9n)}function l9n(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(m+=` -`),v=[h,p].filter(zT).join(` +`),v=[h,p].filter(NT).join(` `),v.length>0&&(v+=` `)):(m=[zEe(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(zT).join(` +`].filter(NT).join(` `),v=[h,zEe(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!==Cg?"#define TONE_MAPPING":"",n.toneMapping!==Cg?Cn.tonemapping_pars_fragment:"",n.toneMapping!==Cg?t9n("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Cn.encodings_pars_fragment,e9n("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` -`].filter(zT).join(` +`].filter(NT).join(` `)),s=lJ(s),s=$Ee(s,n),s=FEe(s,n),a=lJ(a),a=$Ee(a,n),a=FEe(a,n),s=NEe(s),a=NEe(a),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es `,m=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` @@ -3739,7 +3739,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function R9n(t,e,n){let r=new xYe;const i=new On,o=new On,s=new ys,a=new k9n({depthPacking:V6n}),l=new A9n,c={},u=n.maxTextureSize,f={0:mc,1:WC,2:rg},d=new Ty({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new On},radius:{value:4}},vertexShader:P9n,fragmentShader:M9n}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new sm;p.setAttribute("position",new yu(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new ah(p,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=JXe,this.render=function(b,w,_){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||b.length===0)return;const S=t.getRenderTarget(),O=t.getActiveCubeFace(),k=t.getActiveMipmapLevel(),E=t.state;E.setBlending(qv),E.buffers.color.setClear(1,1,1,1),E.buffers.depth.setTest(!0),E.setScissorTest(!1);for(let P=0,A=b.length;Pu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/M.x),i.x=o.x*M.x,T.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/M.y),i.y=o.y*M.y,T.mapSize.y=o.y)),T.map===null){const z=this.type!==NT?{minFilter:el,magFilter:el}:{};T.map=new Xb(i.x,i.y,z),T.map.texture.name=R.name+".shadowMap",T.camera.updateProjectionMatrix()}t.setRenderTarget(T.map),t.clear();const I=T.getViewportCount();for(let z=0;z0){const A=E.uuid,R=w.uuid;let T=c[A];T===void 0&&(T={},c[A]=T);let M=T[R];M===void 0&&(M=E.clone(),T[R]=M),E=M}return E.visible=w.visible,E.wireframe=w.wireframe,k===NT?E.side=w.shadowSide!==null?w.shadowSide:w.side:E.side=w.shadowSide!==null?w.shadowSide:f[w.side],E.alphaMap=w.alphaMap,E.alphaTest=w.alphaTest,E.clipShadows=w.clipShadows,E.clippingPlanes=w.clippingPlanes,E.clipIntersection=w.clipIntersection,E.displacementMap=w.displacementMap,E.displacementScale=w.displacementScale,E.displacementBias=w.displacementBias,E.wireframeLinewidth=w.wireframeLinewidth,E.linewidth=w.linewidth,_.isPointLight===!0&&E.isMeshDistanceMaterial===!0&&(E.referencePosition.setFromMatrixPosition(_.matrixWorld),E.nearDistance=S,E.farDistance=O),E}function x(b,w,_,S,O){if(b.visible===!1)return;if(b.layers.test(w.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&O===NT)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,b.matrixWorld);const P=e.update(b),A=b.material;if(Array.isArray(A)){const R=P.groups;for(let T=0,M=R.length;T=1):F.indexOf("OpenGL ES")!==-1&&(z=parseFloat(/^OpenGL ES (\d)/.exec(F)[1]),I=z>=2);let N=null,L={};const B=t.getParameter(3088),$=t.getParameter(2978),j=new ys().fromArray(B),X=new ys().fromArray($);function V(ue,$e,Se){const Ye=new Uint8Array(4),tt=t.createTexture();t.bindTexture(ue,tt),t.texParameteri(ue,10241,9728),t.texParameteri(ue,10240,9728);for(let ut=0;utse||H.height>se)&&(ye=se/Math.max(H.width,H.height)),ye<1||W===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const ie=W?aJ:Math.floor,fe=ie(ye*H.width),Q=ie(ye*H.height);g===void 0&&(g=y(fe,Q));const _e=J?y(fe,Q):g;return _e.width=fe,_e.height=Q,_e.getContext("2d").drawImage(H,0,0,fe,Q),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+fe+"x"+Q+")."),_e}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 cEe(H.width)&&cEe(H.height)}function w(H){return a?!1:H.wrapS!==Jc||H.wrapT!==Jc||H.minFilter!==el&&H.minFilter!==tl}function _(H,W){return H.generateMipmaps&&W&&H.minFilter!==el&&H.minFilter!==tl}function S(H){t.generateMipmap(H)}function O(H,W,J,se,ye=!1){if(a===!1)return W;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 ie=W;return W===6403&&(J===5126&&(ie=33326),J===5131&&(ie=33325),J===5121&&(ie=33321)),W===33319&&(J===5126&&(ie=33328),J===5131&&(ie=33327),J===5121&&(ie=33323)),W===6408&&(J===5126&&(ie=34836),J===5131&&(ie=34842),J===5121&&(ie=se===Pi&&ye===!1?35907:32856),J===32819&&(ie=32854),J===32820&&(ie=32855)),(ie===33325||ie===33326||ie===33327||ie===33328||ie===34842||ie===34836)&&e.get("EXT_color_buffer_float"),ie}function k(H,W,J){return _(H,J)===!0||H.isFramebufferTexture&&H.minFilter!==el&&H.minFilter!==tl?Math.log2(Math.max(W.width,W.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?W.mipmaps.length:1}function E(H){return H===el||H===FOe||H===NOe?9728:9729}function P(H){const W=H.target;W.removeEventListener("dispose",P),R(W),W.isVideoTexture&&p.delete(W)}function A(H){const W=H.target;W.removeEventListener("dispose",A),M(W)}function R(H){const W=r.get(H);if(W.__webglInit===void 0)return;const J=H.source,se=m.get(J);if(se){const ye=se[W.__cacheKey];ye.usedTimes--,ye.usedTimes===0&&T(H),Object.keys(se).length===0&&m.delete(J)}r.remove(H)}function T(H){const W=r.get(H);t.deleteTexture(W.__webglTexture);const J=H.source,se=m.get(J);delete se[W.__cacheKey],s.memory.textures--}function M(H){const W=H.texture,J=r.get(H),se=r.get(W);if(se.__webglTexture!==void 0&&(t.deleteTexture(se.__webglTexture),s.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)t.deleteFramebuffer(J.__webglFramebuffer[ye]),J.__webglDepthbuffer&&t.deleteRenderbuffer(J.__webglDepthbuffer[ye]);else{if(t.deleteFramebuffer(J.__webglFramebuffer),J.__webglDepthbuffer&&t.deleteRenderbuffer(J.__webglDepthbuffer),J.__webglMultisampledFramebuffer&&t.deleteFramebuffer(J.__webglMultisampledFramebuffer),J.__webglColorRenderbuffer)for(let ye=0;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+l),I+=1,H}function N(H){const W=[];return W.push(H.wrapS),W.push(H.wrapT),W.push(H.magFilter),W.push(H.minFilter),W.push(H.anisotropy),W.push(H.internalFormat),W.push(H.format),W.push(H.type),W.push(H.generateMipmaps),W.push(H.premultiplyAlpha),W.push(H.flipY),W.push(H.unpackAlignment),W.push(H.encoding),W.join()}function L(H,W){const J=r.get(H);if(H.isVideoTexture&&de(H),H.isRenderTargetTexture===!1&&H.version>0&&J.__version!==H.version){const se=H.image;if(se===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{K(J,H,W);return}}n.activeTexture(33984+W),n.bindTexture(3553,J.__webglTexture)}function B(H,W){const J=r.get(H);if(H.version>0&&J.__version!==H.version){K(J,H,W);return}n.activeTexture(33984+W),n.bindTexture(35866,J.__webglTexture)}function $(H,W){const J=r.get(H);if(H.version>0&&J.__version!==H.version){K(J,H,W);return}n.activeTexture(33984+W),n.bindTexture(32879,J.__webglTexture)}function j(H,W){const J=r.get(H);if(H.version>0&&J.__version!==H.version){ee(J,H,W);return}n.activeTexture(33984+W),n.bindTexture(34067,J.__webglTexture)}const X={[iJ]:10497,[Jc]:33071,[oJ]:33648},V={[el]:9728,[FOe]:9984,[NOe]:9986,[tl]:9729,[k6n]:9985,[a8]:9987};function Y(H,W,J){if(J?(t.texParameteri(H,10242,X[W.wrapS]),t.texParameteri(H,10243,X[W.wrapT]),(H===32879||H===35866)&&t.texParameteri(H,32882,X[W.wrapR]),t.texParameteri(H,10240,V[W.magFilter]),t.texParameteri(H,10241,V[W.minFilter])):(t.texParameteri(H,10242,33071),t.texParameteri(H,10243,33071),(H===32879||H===35866)&&t.texParameteri(H,32882,33071),(W.wrapS!==Jc||W.wrapT!==Jc)&&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,E(W.magFilter)),t.texParameteri(H,10241,E(W.minFilter)),W.minFilter!==el&&W.minFilter!==tl&&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 se=e.get("EXT_texture_filter_anisotropic");if(W.type===Ev&&e.has("OES_texture_float_linear")===!1||a===!1&&W.type===sM&&e.has("OES_texture_half_float_linear")===!1)return;(W.anisotropy>1||r.get(W).__currentAnisotropy)&&(t.texParameterf(H,se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(W.anisotropy,i.getMaxAnisotropy())),r.get(W).__currentAnisotropy=W.anisotropy)}}function le(H,W){let J=!1;H.__webglInit===void 0&&(H.__webglInit=!0,W.addEventListener("dispose",P));const se=W.source;let ye=m.get(se);ye===void 0&&(ye={},m.set(se,ye));const ie=N(W);if(ie!==H.__cacheKey){ye[ie]===void 0&&(ye[ie]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,J=!0),ye[ie].usedTimes++;const fe=ye[H.__cacheKey];fe!==void 0&&(ye[H.__cacheKey].usedTimes--,fe.usedTimes===0&&T(W)),H.__cacheKey=ie,H.__webglTexture=ye[ie].texture}return J}function K(H,W,J){let se=3553;W.isDataArrayTexture&&(se=35866),W.isData3DTexture&&(se=32879);const ye=le(H,W),ie=W.source;if(n.activeTexture(33984+J),n.bindTexture(se,H.__webglTexture),ie.version!==ie.__currentVersion||ye===!0){t.pixelStorei(37440,W.flipY),t.pixelStorei(37441,W.premultiplyAlpha),t.pixelStorei(3317,W.unpackAlignment),t.pixelStorei(37443,0);const fe=w(W)&&b(W.image)===!1;let Q=x(W.image,fe,!1,u);Q=xe(W,Q);const _e=b(Q)||a,we=o.convert(W.format,W.encoding);let Ie=o.convert(W.type),Pe=O(W.internalFormat,we,Ie,W.encoding,W.isVideoTexture);Y(se,W,_e);let Re;const Te=W.mipmaps,Le=a&&W.isVideoTexture!==!0,ue=ie.__currentVersion===void 0||ye===!0,$e=k(W,Q,_e);if(W.isDepthTexture)Pe=6402,a?W.type===Ev?Pe=36012:W.type===Ox?Pe=33190:W.type===fS?Pe=35056:Pe=33189:W.type===Ev&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),W.format===Kx&&Pe===6402&&W.type!==iYe&&W.type!==Ox&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),W.type=Ox,Ie=o.convert(W.type)),W.format===HC&&Pe===6402&&(Pe=34041,W.type!==fS&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),W.type=fS,Ie=o.convert(W.type))),ue&&(Le?n.texStorage2D(3553,1,Pe,Q.width,Q.height):n.texImage2D(3553,0,Pe,Q.width,Q.height,0,we,Ie,null));else if(W.isDataTexture)if(Te.length>0&&_e){Le&&ue&&n.texStorage2D(3553,$e,Pe,Te[0].width,Te[0].height);for(let Se=0,Ye=Te.length;Se>=1,Ye>>=1}}else if(Te.length>0&&_e){Le&&ue&&n.texStorage2D(3553,$e,Pe,Te[0].width,Te[0].height);for(let Se=0,Ye=Te.length;Se0&&ue++,n.texStorage2D(34067,ue,Re,Q[0].width,Q[0].height));for(let Se=0;Se<6;Se++)if(fe){Te?n.texSubImage2D(34069+Se,0,0,0,Q[Se].width,Q[Se].height,Ie,Pe,Q[Se].data):n.texImage2D(34069+Se,0,Re,Q[Se].width,Q[Se].height,0,Ie,Pe,Q[Se].data);for(let Ye=0;Ye<$e.length;Ye++){const ut=$e[Ye].image[Se].image;Te?n.texSubImage2D(34069+Se,Ye+1,0,0,ut.width,ut.height,Ie,Pe,ut.data):n.texImage2D(34069+Se,Ye+1,Re,ut.width,ut.height,0,Ie,Pe,ut.data)}}else{Te?n.texSubImage2D(34069+Se,0,0,0,Ie,Pe,Q[Se]):n.texImage2D(34069+Se,0,Re,Ie,Pe,Q[Se]);for(let Ye=0;Ye<$e.length;Ye++){const tt=$e[Ye];Te?n.texSubImage2D(34069+Se,Ye+1,0,0,Ie,Pe,tt.image[Se]):n.texImage2D(34069+Se,Ye+1,Re,Ie,Pe,tt.image[Se])}}}_(W,we)&&S(34067),ye.__currentVersion=ye.version,W.onUpdate&&W.onUpdate(W)}H.__version=W.version}function re(H,W,J,se,ye){const ie=o.convert(J.format,J.encoding),fe=o.convert(J.type),Q=O(J.internalFormat,ie,fe,J.encoding);r.get(W).__hasExternalTextures||(ye===32879||ye===35866?n.texImage3D(ye,0,Q,W.width,W.height,W.depth,0,ie,fe,null):n.texImage2D(ye,0,Q,W.width,W.height,0,ie,fe,null)),n.bindFramebuffer(36160,H),Z(W)?d.framebufferTexture2DMultisampleEXT(36160,se,ye,r.get(J).__webglTexture,0,q(W)):t.framebufferTexture2D(36160,se,ye,r.get(J).__webglTexture,0),n.bindFramebuffer(36160,null)}function me(H,W,J){if(t.bindRenderbuffer(36161,H),W.depthBuffer&&!W.stencilBuffer){let se=33189;if(J||Z(W)){const ye=W.depthTexture;ye&&ye.isDepthTexture&&(ye.type===Ev?se=36012:ye.type===Ox&&(se=33190));const ie=q(W);Z(W)?d.renderbufferStorageMultisampleEXT(36161,ie,se,W.width,W.height):t.renderbufferStorageMultisample(36161,ie,se,W.width,W.height)}else t.renderbufferStorage(36161,se,W.width,W.height);t.framebufferRenderbuffer(36160,36096,36161,H)}else if(W.depthBuffer&&W.stencilBuffer){const se=q(W);J&&Z(W)===!1?t.renderbufferStorageMultisample(36161,se,35056,W.width,W.height):Z(W)?d.renderbufferStorageMultisampleEXT(36161,se,35056,W.width,W.height):t.renderbufferStorage(36161,34041,W.width,W.height),t.framebufferRenderbuffer(36160,33306,36161,H)}else{const se=W.isWebGLMultipleRenderTargets===!0?W.texture:[W.texture];for(let ye=0;ye0&&Z(H)===!1){const Q=ie?W:[W];J.__webglMultisampledFramebuffer=t.createFramebuffer(),J.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,J.__webglMultisampledFramebuffer);for(let _e=0;_e0&&Z(H)===!1){const W=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],J=H.width,se=H.height;let ye=16384;const ie=[],fe=H.stencilBuffer?33306:36096,Q=r.get(H),_e=H.isWebGLMultipleRenderTargets===!0;if(_e)for(let we=0;we0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&W.__useRenderToTexture!==!1}function de(H){const W=s.render.frame;p.get(H)!==W&&(p.set(H,W),H.update())}function xe(H,W){const J=H.encoding,se=H.format,ye=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===sJ||J!==qb&&(J===Pi?a===!1?e.has("EXT_sRGB")===!0&&se===sh?(H.format=sJ,H.minFilter=tl,H.generateMipmaps=!1):W=lYe.sRGBToLinear(W):(se!==sh||ye!==Hb)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",J)),W}this.allocateTextureUnit=F,this.resetTextureUnits=z,this.setTexture2D=L,this.setTexture2DArray=B,this.setTexture3D=$,this.setTextureCube=j,this.rebindTextures=U,this.setupRenderTarget=oe,this.updateRenderTargetMipmap=ne,this.updateMultisampleRenderTarget=G,this.setupDepthRenderbuffer=ae,this.setupFrameBufferTexture=re,this.useMultisampledRTT=Z}function L9n(t,e,n){const r=n.isWebGL2;function i(o,s=null){let a;if(o===Hb)return 5121;if(o===R6n)return 32819;if(o===D6n)return 32820;if(o===A6n)return 5120;if(o===P6n)return 5122;if(o===iYe)return 5123;if(o===M6n)return 5124;if(o===Ox)return 5125;if(o===Ev)return 5126;if(o===sM)return r?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(o===I6n)return 6406;if(o===sh)return 6408;if(o===$6n)return 6409;if(o===F6n)return 6410;if(o===Kx)return 6402;if(o===HC)return 34041;if(o===oYe)return 6403;if(o===L6n)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===sJ)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(o===N6n)return 36244;if(o===z6n)return 33319;if(o===j6n)return 33320;if(o===B6n)return 36249;if(o===rG||o===iG||o===oG||o===sG)if(s===Pi)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(o===rG)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===iG)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===oG)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===sG)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(o===rG)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===iG)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===oG)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===sG)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===zOe||o===jOe||o===BOe||o===UOe)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(o===zOe)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===jOe)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===BOe)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===UOe)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===U6n)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===WOe||o===VOe)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(o===WOe)return s===Pi?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(o===VOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===GOe||o===HOe||o===qOe||o===XOe||o===YOe||o===QOe||o===KOe||o===ZOe||o===JOe||o===eEe||o===tEe||o===nEe||o===rEe||o===iEe)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(o===GOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===HOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===qOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===XOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===YOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===QOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===KOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===ZOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===JOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===eEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===tEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===nEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===rEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===iEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===oEe)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(o===oEe)return s===Pi?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===fS?r?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class $9n extends bf{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class P$ extends xl{constructor(){super(),this.isGroup=!0,this.type="Group"}}const F9n={type:"move"};class IG{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new P$,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 P$,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ce,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ce),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new P$,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ce,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ce),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,s=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){s=!0;for(const g of e.hand.values()){const m=n.getJointPose(g,r);if(c.joints[g.jointName]===void 0){const y=new P$;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[g.jointName]=y,c.add(y)}const v=c.joints[g.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==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));a!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(F9n)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),this}}class N9n extends kc{constructor(e,n,r,i,o,s,a,l,c,u){if(u=u!==void 0?u:Kx,u!==Kx&&u!==HC)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===Kx&&(r=Ox),r===void 0&&u===HC&&(r=fS),super(null,i,o,s,a,l,u,r,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=a!==void 0?a:el,this.minFilter=l!==void 0?l:el,this.flipY=!1,this.generateMipmaps=!1}}class z9n extends $1{constructor(e,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=null,c=null,u=null,f=null,d=null,h=null;const p=n.getContextAttributes();let g=null,m=null;const v=[],y=[],x=new bf;x.layers.enable(1),x.viewport=new ys;const b=new bf;b.layers.enable(2),b.viewport=new ys;const w=[x,b],_=new $9n;_.layers.enable(1),_.layers.enable(2);let S=null,O=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(N){let L=v[N];return L===void 0&&(L=new IG,v[N]=L),L.getTargetRaySpace()},this.getControllerGrip=function(N){let L=v[N];return L===void 0&&(L=new IG,v[N]=L),L.getGripSpace()},this.getHand=function(N){let L=v[N];return L===void 0&&(L=new IG,v[N]=L),L.getHandSpace()};function k(N){const L=y.indexOf(N.inputSource);if(L===-1)return;const B=v[L];B!==void 0&&B.dispatchEvent({type:N.type,data:N.inputSource})}function E(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",E),i.removeEventListener("inputsourceschange",P);for(let N=0;N=0&&(y[$]=null,v[$].dispatchEvent({type:"disconnected",data:B}))}for(let L=0;L=y.length){y.push(B),$=X;break}else if(y[X]===null){y[X]=B,$=X;break}if($===-1)break}const j=v[$];j&&j.dispatchEvent({type:"connected",data:B})}}const A=new Ce,R=new Ce;function T(N,L,B){A.setFromMatrixPosition(L.matrixWorld),R.setFromMatrixPosition(B.matrixWorld);const $=A.distanceTo(R),j=L.projectionMatrix.elements,X=B.projectionMatrix.elements,V=j[14]/(j[10]-1),Y=j[14]/(j[10]+1),le=(j[9]+1)/j[5],K=(j[9]-1)/j[5],ee=(j[8]-1)/j[0],re=(X[8]+1)/X[0],me=V*ee,te=V*re,ae=$/(-ee+re),U=ae*-ee;L.matrixWorld.decompose(N.position,N.quaternion,N.scale),N.translateX(U),N.translateZ(ae),N.matrixWorld.compose(N.position,N.quaternion,N.scale),N.matrixWorldInverse.copy(N.matrixWorld).invert();const oe=V+ae,ne=Y+ae,G=me-U,q=te+($-U),Z=le*Y/ne*oe,de=K*Y/ne*oe;N.projectionMatrix.makePerspective(G,q,Z,de,oe,ne)}function M(N,L){L===null?N.matrixWorld.copy(N.matrix):N.matrixWorld.multiplyMatrices(L.matrixWorld,N.matrix),N.matrixWorldInverse.copy(N.matrixWorld).invert()}this.updateCamera=function(N){if(i===null)return;_.near=b.near=x.near=N.near,_.far=b.far=x.far=N.far,(S!==_.near||O!==_.far)&&(i.updateRenderState({depthNear:_.near,depthFar:_.far}),S=_.near,O=_.far);const L=N.parent,B=_.cameras;M(_,L);for(let j=0;j0&&(g.alphaTest.value=m.alphaTest);const v=e.get(m).envMap;if(v&&(g.envMap.value=v,g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap){g.lightMap.value=m.lightMap;const b=t.physicallyCorrectLights!==!0?Math.PI:1;g.lightMapIntensity.value=m.lightMapIntensity*b}m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity);let y;m.map?y=m.map:m.specularMap?y=m.specularMap:m.displacementMap?y=m.displacementMap:m.normalMap?y=m.normalMap:m.bumpMap?y=m.bumpMap:m.roughnessMap?y=m.roughnessMap:m.metalnessMap?y=m.metalnessMap:m.alphaMap?y=m.alphaMap:m.emissiveMap?y=m.emissiveMap:m.clearcoatMap?y=m.clearcoatMap:m.clearcoatNormalMap?y=m.clearcoatNormalMap:m.clearcoatRoughnessMap?y=m.clearcoatRoughnessMap:m.iridescenceMap?y=m.iridescenceMap:m.iridescenceThicknessMap?y=m.iridescenceThicknessMap:m.specularIntensityMap?y=m.specularIntensityMap:m.specularColorMap?y=m.specularColorMap:m.transmissionMap?y=m.transmissionMap:m.thicknessMap?y=m.thicknessMap:m.sheenColorMap?y=m.sheenColorMap:m.sheenRoughnessMap&&(y=m.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),g.uvTransform.value.copy(y.matrix));let x;m.aoMap?x=m.aoMap:m.lightMap&&(x=m.lightMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),g.uv2Transform.value.copy(x.matrix))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function a(g,m,v,y){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*v,g.scale.value=y*.5,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let x;m.map?x=m.map:m.alphaMap&&(x=m.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),g.uvTransform.value.copy(x.matrix))}function l(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let v;m.map?v=m.map:m.alphaMap&&(v=m.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),g.uvTransform.value.copy(v.matrix))}function c(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function u(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.roughness.value=m.roughness,g.metalness.value=m.metalness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap),e.get(m).envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,v){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),g.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===mc&&g.clearcoatNormalScale.value.negate())),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap)),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap)}function h(g,m){m.matcap&&(g.matcap.value=m.matcap)}function p(g,m){g.referencePosition.value.copy(m.referencePosition),g.nearDistance.value=m.nearDistance,g.farDistance.value=m.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function B9n(t,e,n,r){let i={},o={},s=[];const a=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",m));const w=x.program;r.updateUBOMapping(y,w);const _=e.render.frame;o[y.id]!==_&&(d(y),o[y.id]=_)}function u(y){const x=f();y.__bindingPointIndex=x;const b=t.createBuffer(),w=y.__size,_=y.usage;return t.bindBuffer(35345,b),t.bufferData(35345,w,_),t.bindBuffer(35345,null),t.bindBufferBase(35345,x,b),b}function f(){for(let y=0;y0){_=b%w;const P=w-_;_!==0&&P-E.boundary<0&&(b+=w-_,k.__offset=b)}b+=E.storage}return _=b%w,_>0&&(b+=w-_),y.__size=b,y.__cache={},this}function g(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 m(y){const x=y.target;x.removeEventListener("dispose",m);const b=s.indexOf(x.__bindingPointIndex);s.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]);s=[],i={},o={}}return{bind:l,update:c,dispose:v}}function U9n(){const t=aM("canvas");return t.style.display="block",t}function EYe(t={}){this.isWebGLRenderer=!0;const e=t.canvas!==void 0?t.canvas:U9n(),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,s=t.premultipliedAlpha!==void 0?t.premultipliedAlpha:!0,a=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=qb,this.physicallyCorrectLights=!1,this.toneMapping=Cg,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 g=this;let m=!1,v=0,y=0,x=null,b=-1,w=null;const _=new ys,S=new ys;let O=null,k=e.width,E=e.height,P=1,A=null,R=null;const T=new ys(0,0,k,E),M=new ys(0,0,k,E);let I=!1;const z=new xYe;let F=!1,N=!1,L=null;const B=new Gr,$=new On,j=new Ce,X={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function V(){return x===null?P:1}let Y=n;function le(ce,Ae){for(let Fe=0;Fe0?d=p[p.length-1]:d=null,h.pop(),h.length>0?f=h[h.length-1]:f=null};function Zi(ce,Ae,Fe,ke){if(ce.visible===!1)return;if(ce.layers.test(Ae.layers)){if(ce.isGroup)Fe=ce.renderOrder;else if(ce.isLOD)ce.autoUpdate===!0&&ce.update(Ae);else if(ce.isLight)d.pushLight(ce),ce.castShadow&&d.pushShadow(ce);else if(ce.isSprite){if(!ce.frustumCulled||z.intersectsSprite(ce)){ke&&j.setFromMatrixPosition(ce.matrixWorld).applyMatrix4(B);const Nt=q.update(ce),an=ce.material;an.visible&&f.push(ce,Nt,an,Fe,j.z,null)}}else if((ce.isMesh||ce.isLine||ce.isPoints)&&(ce.isSkinnedMesh&&ce.skeleton.frame!==me.render.frame&&(ce.skeleton.update(),ce.skeleton.frame=me.render.frame),!ce.frustumCulled||z.intersectsObject(ce))){ke&&j.setFromMatrixPosition(ce.matrixWorld).applyMatrix4(B);const Nt=q.update(ce),an=ce.material;if(Array.isArray(an)){const tn=Nt.groups;for(let Qn=0,Bn=tn.length;Qn0&&Ht(Be,Ae,Fe),ke&&re.viewport(_.copy(ke)),Be.length>0&&fr(Be,Ae,Fe),Ot.length>0&&fr(Ot,Ae,Fe),Nt.length>0&&fr(Nt,Ae,Fe),re.buffers.depth.setTest(!0),re.buffers.depth.setMask(!0),re.buffers.color.setMask(!0),re.setPolygonOffset(!1)}function Ht(ce,Ae,Fe){const ke=ee.isWebGL2;L===null&&(L=new Xb(1,1,{generateMipmaps:!0,type:K.has("EXT_color_buffer_half_float")?sM:Hb,minFilter:a8,samples:ke&&o===!0?4:0})),g.getDrawingBufferSize($),ke?L.setSize($.x,$.y):L.setSize(aJ($.x),aJ($.y));const Be=g.getRenderTarget();g.setRenderTarget(L),g.clear();const Ot=g.toneMapping;g.toneMapping=Cg,fr(ce,Ae,Fe),g.toneMapping=Ot,ae.updateMultisampleRenderTarget(L),ae.updateRenderTargetMipmap(L),g.setRenderTarget(Be)}function fr(ce,Ae,Fe){const ke=Ae.isScene===!0?Ae.overrideMaterial:null;for(let Be=0,Ot=ce.length;Be0&&ae.useMultisampledRTT(ce)===!1?Be=te.get(ce).__webglMultisampledFramebuffer:Be=Qn,_.copy(ce.viewport),S.copy(ce.scissor),O=ce.scissorTest}else _.copy(T).multiplyScalar(P).floor(),S.copy(M).multiplyScalar(P).floor(),O=I;if(re.bindFramebuffer(36160,Be)&&ee.drawBuffers&&ke&&re.drawBuffers(ce,Be),re.viewport(_),re.scissor(S),re.setScissorTest(O),Ot){const tn=te.get(ce.texture);Y.framebufferTexture2D(36160,36064,34069+Ae,tn.__webglTexture,Fe)}else if(Nt){const tn=te.get(ce.texture),Qn=Ae||0;Y.framebufferTextureLayer(36160,36064,tn.__webglTexture,Fe||0,Qn)}b=-1},this.readRenderTargetPixels=function(ce,Ae,Fe,ke,Be,Ot,Nt){if(!(ce&&ce.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let an=te.get(ce).__webglFramebuffer;if(ce.isWebGLCubeRenderTarget&&Nt!==void 0&&(an=an[Nt]),an){re.bindFramebuffer(36160,an);try{const tn=ce.texture,Qn=tn.format,Bn=tn.type;if(Qn!==sh&&Q.convert(Qn)!==Y.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Un=Bn===sM&&(K.has("EXT_color_buffer_half_float")||ee.isWebGL2&&K.has("EXT_color_buffer_float"));if(Bn!==Hb&&Q.convert(Bn)!==Y.getParameter(35738)&&!(Bn===Ev&&(ee.isWebGL2||K.has("OES_texture_float")||K.has("WEBGL_color_buffer_float")))&&!Un){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Ae>=0&&Ae<=ce.width-ke&&Fe>=0&&Fe<=ce.height-Be&&Y.readPixels(Ae,Fe,ke,Be,Q.convert(Qn),Q.convert(Bn),Ot)}finally{const tn=x!==null?te.get(x).__webglFramebuffer:null;re.bindFramebuffer(36160,tn)}}},this.copyFramebufferToTexture=function(ce,Ae,Fe=0){const ke=Math.pow(2,-Fe),Be=Math.floor(Ae.image.width*ke),Ot=Math.floor(Ae.image.height*ke);ae.setTexture2D(Ae,0),Y.copyTexSubImage2D(3553,Fe,0,0,ce.x,ce.y,Be,Ot),re.unbindTexture()},this.copyTextureToTexture=function(ce,Ae,Fe,ke=0){const Be=Ae.image.width,Ot=Ae.image.height,Nt=Q.convert(Fe.format),an=Q.convert(Fe.type);ae.setTexture2D(Fe,0),Y.pixelStorei(37440,Fe.flipY),Y.pixelStorei(37441,Fe.premultiplyAlpha),Y.pixelStorei(3317,Fe.unpackAlignment),Ae.isDataTexture?Y.texSubImage2D(3553,ke,ce.x,ce.y,Be,Ot,Nt,an,Ae.image.data):Ae.isCompressedTexture?Y.compressedTexSubImage2D(3553,ke,ce.x,ce.y,Ae.mipmaps[0].width,Ae.mipmaps[0].height,Nt,Ae.mipmaps[0].data):Y.texSubImage2D(3553,ke,ce.x,ce.y,Nt,an,Ae.image),ke===0&&Fe.generateMipmaps&&Y.generateMipmap(3553),re.unbindTexture()},this.copyTextureToTexture3D=function(ce,Ae,Fe,ke,Be=0){if(g.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ot=ce.max.x-ce.min.x+1,Nt=ce.max.y-ce.min.y+1,an=ce.max.z-ce.min.z+1,tn=Q.convert(ke.format),Qn=Q.convert(ke.type);let Bn;if(ke.isData3DTexture)ae.setTexture3D(ke,0),Bn=32879;else if(ke.isDataArrayTexture)ae.setTexture2DArray(ke,0),Bn=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Y.pixelStorei(37440,ke.flipY),Y.pixelStorei(37441,ke.premultiplyAlpha),Y.pixelStorei(3317,ke.unpackAlignment);const Un=Y.getParameter(3314),Ti=Y.getParameter(32878),d0=Y.getParameter(3316),N1=Y.getParameter(3315),z1=Y.getParameter(32877),hd=Fe.isCompressedTexture?Fe.mipmaps[0]:Fe.image;Y.pixelStorei(3314,hd.width),Y.pixelStorei(32878,hd.height),Y.pixelStorei(3316,ce.min.x),Y.pixelStorei(3315,ce.min.y),Y.pixelStorei(32877,ce.min.z),Fe.isDataTexture||Fe.isData3DTexture?Y.texSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ot,Nt,an,tn,Qn,hd.data):Fe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Y.compressedTexSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ot,Nt,an,tn,hd.data)):Y.texSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ot,Nt,an,tn,Qn,hd),Y.pixelStorei(3314,Un),Y.pixelStorei(32878,Ti),Y.pixelStorei(3316,d0),Y.pixelStorei(3315,N1),Y.pixelStorei(32877,z1),Be===0&&ke.generateMipmaps&&Y.generateMipmap(Bn),re.unbindTexture()},this.initTexture=function(ce){ce.isCubeTexture?ae.setTextureCube(ce,0):ce.isData3DTexture?ae.setTexture3D(ce,0):ce.isDataArrayTexture?ae.setTexture2DArray(ce,0):ae.setTexture2D(ce,0),re.unbindTexture()},this.resetState=function(){v=0,y=0,x=null,re.reset(),_e.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class W9n extends EYe{}W9n.prototype.isWebGL1Renderer=!0;class V9n extends xl{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 TYe extends CD{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new hi(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 WEe=new Ce,VEe=new Ce,GEe=new Gr,LG=new dYe,M$=new l8;class G9n extends xl{constructor(e=new sm,n=new TYe){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 O=e.ray.origin.distanceTo(d);Oe.far||n.push({distance:O,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,s.start),y=Math.min(m.count,s.start+s.count);for(let x=v,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);const _=e.ray.origin.distanceTo(d);_e.far||n.push({distance:_,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,s=i.length;o{n&&n(o),this.manager.itemEnd(e)},0),o;if(_p[e]!==void 0){_p[e].push({onLoad:n,onProgress:r,onError:i});return}_p[e]=[],_p[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).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=_p[e],f=c.body.getReader(),d=c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let g=0;const m=new ReadableStream({start(v){y();function y(){f.read().then(({done:x,value:b})=>{if(x)v.close();else{g+=b.byteLength;const w=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:h});for(let _=0,S=u.length;_{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{aj.add(e,c);const u=_p[e];delete _p[e];for(let f=0,d=u.length;f{const u=_p[e];if(u===void 0)throw this.manager.itemError(e),c;delete _p[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 K9n extends f8{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,s=aj.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(s),o.manager.itemEnd(e)},0),s;const a=aM("img");function l(){u(),aj.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(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(e),a.src=e,a}}class Z9n extends f8{constructor(e){super(e)}load(e,n,r,i){const o=new kc,s=new K9n(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(a){o.image=a,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class XEe{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(nl(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const R$=new vE;class J9n extends H9n{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 sm;o.setIndex(new yu(r,1)),o.setAttribute("position",new yu(i,3)),super(o,new TYe({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&&R$.setFromObject(this.object),R$.isEmpty())return;const n=R$.min,r=R$.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:cue}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=cue);const YEe={type:"change"},$G={type:"start"},QEe={type:"end"};class e7n extends $1{constructor(e,n){super(),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Ce,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:vw.ROTATE,MIDDLE:vw.DOLLY,RIGHT:vw.PAN},this.touches={ONE:yw.ROTATE,TWO:yw.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 a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(Q){Q.addEventListener("keydown",xe),this._domElementKeyEvents=Q},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(YEe),r.update(),o=i.NONE},this.update=function(){const Q=new Ce,_e=new Yb().setFromUnitVectors(e.up,new Ce(0,1,0)),we=_e.clone().invert(),Ie=new Ce,Pe=new Yb,Re=2*Math.PI;return function(){const Le=r.object.position;Q.copy(Le).sub(r.target),Q.applyQuaternion(_e),a.setFromVector3(Q),r.autoRotate&&o===i.NONE&&k(S()),r.enableDamping?(a.theta+=l.theta*r.dampingFactor,a.phi+=l.phi*r.dampingFactor):(a.theta+=l.theta,a.phi+=l.phi);let ue=r.minAzimuthAngle,$e=r.maxAzimuthAngle;return isFinite(ue)&&isFinite($e)&&(ue<-Math.PI?ue+=Re:ue>Math.PI&&(ue-=Re),$e<-Math.PI?$e+=Re:$e>Math.PI&&($e-=Re),ue<=$e?a.theta=Math.max(ue,Math.min($e,a.theta)):a.theta=a.theta>(ue+$e)/2?Math.max(ue,a.theta):Math.min($e,a.theta)),a.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=c,a.radius=Math.max(r.minDistance,Math.min(r.maxDistance,a.radius)),r.enableDamping===!0?r.target.addScaledVector(u,r.dampingFactor):r.target.add(u),Q.setFromSpherical(a),Q.applyQuaternion(we),Le.copy(r.target).add(Q),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||Ie.distanceToSquared(r.object.position)>s||8*(1-Pe.dot(r.object.quaternion))>s?(r.dispatchEvent(YEe),Ie.copy(r.object.position),Pe.copy(r.object.quaternion),f=!1,!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",J),r.domElement.removeEventListener("pointerdown",U),r.domElement.removeEventListener("pointercancel",G),r.domElement.removeEventListener("wheel",de),r.domElement.removeEventListener("pointermove",oe),r.domElement.removeEventListener("pointerup",ne),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",xe)};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 s=1e-6,a=new XEe,l=new XEe;let c=1;const u=new Ce;let f=!1;const d=new On,h=new On,p=new On,g=new On,m=new On,v=new On,y=new On,x=new On,b=new On,w=[],_={};function S(){return 2*Math.PI/60/60*r.autoRotateSpeed}function O(){return Math.pow(.95,r.zoomSpeed)}function k(Q){l.theta-=Q}function E(Q){l.phi-=Q}const P=function(){const Q=new Ce;return function(we,Ie){Q.setFromMatrixColumn(Ie,0),Q.multiplyScalar(-we),u.add(Q)}}(),A=function(){const Q=new Ce;return function(we,Ie){r.screenSpacePanning===!0?Q.setFromMatrixColumn(Ie,1):(Q.setFromMatrixColumn(Ie,0),Q.crossVectors(r.object.up,Q)),Q.multiplyScalar(we),u.add(Q)}}(),R=function(){const Q=new Ce;return function(we,Ie){const Pe=r.domElement;if(r.object.isPerspectiveCamera){const Re=r.object.position;Q.copy(Re).sub(r.target);let Te=Q.length();Te*=Math.tan(r.object.fov/2*Math.PI/180),P(2*we*Te/Pe.clientHeight,r.object.matrix),A(2*Ie*Te/Pe.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(P(we*(r.object.right-r.object.left)/r.object.zoom/Pe.clientWidth,r.object.matrix),A(Ie*(r.object.top-r.object.bottom)/r.object.zoom/Pe.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function T(Q){r.object.isPerspectiveCamera?c/=Q:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*Q)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function M(Q){r.object.isPerspectiveCamera?c*=Q:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/Q)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function I(Q){d.set(Q.clientX,Q.clientY)}function z(Q){y.set(Q.clientX,Q.clientY)}function F(Q){g.set(Q.clientX,Q.clientY)}function N(Q){h.set(Q.clientX,Q.clientY),p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const _e=r.domElement;k(2*Math.PI*p.x/_e.clientHeight),E(2*Math.PI*p.y/_e.clientHeight),d.copy(h),r.update()}function L(Q){x.set(Q.clientX,Q.clientY),b.subVectors(x,y),b.y>0?T(O()):b.y<0&&M(O()),y.copy(x),r.update()}function B(Q){m.set(Q.clientX,Q.clientY),v.subVectors(m,g).multiplyScalar(r.panSpeed),R(v.x,v.y),g.copy(m),r.update()}function $(Q){Q.deltaY<0?M(O()):Q.deltaY>0&&T(O()),r.update()}function j(Q){let _e=!1;switch(Q.code){case r.keys.UP:R(0,r.keyPanSpeed),_e=!0;break;case r.keys.BOTTOM:R(0,-r.keyPanSpeed),_e=!0;break;case r.keys.LEFT:R(r.keyPanSpeed,0),_e=!0;break;case r.keys.RIGHT:R(-r.keyPanSpeed,0),_e=!0;break}_e&&(Q.preventDefault(),r.update())}function X(){if(w.length===1)d.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),_e=.5*(w[0].pageY+w[1].pageY);d.set(Q,_e)}}function V(){if(w.length===1)g.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),_e=.5*(w[0].pageY+w[1].pageY);g.set(Q,_e)}}function Y(){const Q=w[0].pageX-w[1].pageX,_e=w[0].pageY-w[1].pageY,we=Math.sqrt(Q*Q+_e*_e);y.set(0,we)}function le(){r.enableZoom&&Y(),r.enablePan&&V()}function K(){r.enableZoom&&Y(),r.enableRotate&&X()}function ee(Q){if(w.length===1)h.set(Q.pageX,Q.pageY);else{const we=fe(Q),Ie=.5*(Q.pageX+we.x),Pe=.5*(Q.pageY+we.y);h.set(Ie,Pe)}p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const _e=r.domElement;k(2*Math.PI*p.x/_e.clientHeight),E(2*Math.PI*p.y/_e.clientHeight),d.copy(h)}function re(Q){if(w.length===1)m.set(Q.pageX,Q.pageY);else{const _e=fe(Q),we=.5*(Q.pageX+_e.x),Ie=.5*(Q.pageY+_e.y);m.set(we,Ie)}v.subVectors(m,g).multiplyScalar(r.panSpeed),R(v.x,v.y),g.copy(m)}function me(Q){const _e=fe(Q),we=Q.pageX-_e.x,Ie=Q.pageY-_e.y,Pe=Math.sqrt(we*we+Ie*Ie);x.set(0,Pe),b.set(0,Math.pow(x.y/y.y,r.zoomSpeed)),T(b.y),y.copy(x)}function te(Q){r.enableZoom&&me(Q),r.enablePan&&re(Q)}function ae(Q){r.enableZoom&&me(Q),r.enableRotate&&ee(Q)}function U(Q){r.enabled!==!1&&(w.length===0&&(r.domElement.setPointerCapture(Q.pointerId),r.domElement.addEventListener("pointermove",oe),r.domElement.addEventListener("pointerup",ne)),se(Q),Q.pointerType==="touch"?H(Q):q(Q))}function oe(Q){r.enabled!==!1&&(Q.pointerType==="touch"?W(Q):Z(Q))}function ne(Q){ye(Q),w.length===0&&(r.domElement.releasePointerCapture(Q.pointerId),r.domElement.removeEventListener("pointermove",oe),r.domElement.removeEventListener("pointerup",ne)),r.dispatchEvent(QEe),o=i.NONE}function G(Q){ye(Q)}function q(Q){let _e;switch(Q.button){case 0:_e=r.mouseButtons.LEFT;break;case 1:_e=r.mouseButtons.MIDDLE;break;case 2:_e=r.mouseButtons.RIGHT;break;default:_e=-1}switch(_e){case vw.DOLLY:if(r.enableZoom===!1)return;z(Q),o=i.DOLLY;break;case vw.ROTATE:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(r.enablePan===!1)return;F(Q),o=i.PAN}else{if(r.enableRotate===!1)return;I(Q),o=i.ROTATE}break;case vw.PAN:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(r.enableRotate===!1)return;I(Q),o=i.ROTATE}else{if(r.enablePan===!1)return;F(Q),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent($G)}function Z(Q){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;N(Q);break;case i.DOLLY:if(r.enableZoom===!1)return;L(Q);break;case i.PAN:if(r.enablePan===!1)return;B(Q);break}}function de(Q){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(Q.preventDefault(),r.dispatchEvent($G),$(Q),r.dispatchEvent(QEe))}function xe(Q){r.enabled===!1||r.enablePan===!1||j(Q)}function H(Q){switch(ie(Q),w.length){case 1:switch(r.touches.ONE){case yw.ROTATE:if(r.enableRotate===!1)return;X(),o=i.TOUCH_ROTATE;break;case yw.PAN:if(r.enablePan===!1)return;V(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case yw.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;le(),o=i.TOUCH_DOLLY_PAN;break;case yw.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;K(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent($G)}function W(Q){switch(ie(Q),o){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;ee(Q),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;re(Q),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;te(Q),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ae(Q),r.update();break;default:o=i.NONE}}function J(Q){r.enabled!==!1&&Q.preventDefault()}function se(Q){w.push(Q)}function ye(Q){delete _[Q.pointerId];for(let _e=0;_eu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/M.x),i.x=o.x*M.x,T.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/M.y),i.y=o.y*M.y,T.mapSize.y=o.y)),T.map===null){const z=this.type!==FT?{minFilter:el,magFilter:el}:{};T.map=new Xb(i.x,i.y,z),T.map.texture.name=R.name+".shadowMap",T.camera.updateProjectionMatrix()}t.setRenderTarget(T.map),t.clear();const I=T.getViewportCount();for(let z=0;z0){const A=E.uuid,R=w.uuid;let T=c[A];T===void 0&&(T={},c[A]=T);let M=T[R];M===void 0&&(M=E.clone(),T[R]=M),E=M}return E.visible=w.visible,E.wireframe=w.wireframe,k===FT?E.side=w.shadowSide!==null?w.shadowSide:w.side:E.side=w.shadowSide!==null?w.shadowSide:f[w.side],E.alphaMap=w.alphaMap,E.alphaTest=w.alphaTest,E.clipShadows=w.clipShadows,E.clippingPlanes=w.clippingPlanes,E.clipIntersection=w.clipIntersection,E.displacementMap=w.displacementMap,E.displacementScale=w.displacementScale,E.displacementBias=w.displacementBias,E.wireframeLinewidth=w.wireframeLinewidth,E.linewidth=w.linewidth,_.isPointLight===!0&&E.isMeshDistanceMaterial===!0&&(E.referencePosition.setFromMatrixPosition(_.matrixWorld),E.nearDistance=S,E.farDistance=O),E}function x(b,w,_,S,O){if(b.visible===!1)return;if(b.layers.test(w.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&O===FT)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,b.matrixWorld);const P=e.update(b),A=b.material;if(Array.isArray(A)){const R=P.groups;for(let T=0,M=R.length;T=1):F.indexOf("OpenGL ES")!==-1&&(z=parseFloat(/^OpenGL ES (\d)/.exec(F)[1]),I=z>=2);let N=null,L={};const B=t.getParameter(3088),$=t.getParameter(2978),j=new ys().fromArray(B),X=new ys().fromArray($);function V(ue,$e,Se){const Ye=new Uint8Array(4),tt=t.createTexture();t.bindTexture(ue,tt),t.texParameteri(ue,10241,9728),t.texParameteri(ue,10240,9728);for(let ut=0;utse||H.height>se)&&(ye=se/Math.max(H.width,H.height)),ye<1||W===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const ie=W?aJ:Math.floor,fe=ie(ye*H.width),Q=ie(ye*H.height);g===void 0&&(g=y(fe,Q));const _e=J?y(fe,Q):g;return _e.width=fe,_e.height=Q,_e.getContext("2d").drawImage(H,0,0,fe,Q),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+fe+"x"+Q+")."),_e}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 cEe(H.width)&&cEe(H.height)}function w(H){return a?!1:H.wrapS!==Jc||H.wrapT!==Jc||H.minFilter!==el&&H.minFilter!==tl}function _(H,W){return H.generateMipmaps&&W&&H.minFilter!==el&&H.minFilter!==tl}function S(H){t.generateMipmap(H)}function O(H,W,J,se,ye=!1){if(a===!1)return W;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 ie=W;return W===6403&&(J===5126&&(ie=33326),J===5131&&(ie=33325),J===5121&&(ie=33321)),W===33319&&(J===5126&&(ie=33328),J===5131&&(ie=33327),J===5121&&(ie=33323)),W===6408&&(J===5126&&(ie=34836),J===5131&&(ie=34842),J===5121&&(ie=se===Pi&&ye===!1?35907:32856),J===32819&&(ie=32854),J===32820&&(ie=32855)),(ie===33325||ie===33326||ie===33327||ie===33328||ie===34842||ie===34836)&&e.get("EXT_color_buffer_float"),ie}function k(H,W,J){return _(H,J)===!0||H.isFramebufferTexture&&H.minFilter!==el&&H.minFilter!==tl?Math.log2(Math.max(W.width,W.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?W.mipmaps.length:1}function E(H){return H===el||H===FOe||H===NOe?9728:9729}function P(H){const W=H.target;W.removeEventListener("dispose",P),R(W),W.isVideoTexture&&p.delete(W)}function A(H){const W=H.target;W.removeEventListener("dispose",A),M(W)}function R(H){const W=r.get(H);if(W.__webglInit===void 0)return;const J=H.source,se=m.get(J);if(se){const ye=se[W.__cacheKey];ye.usedTimes--,ye.usedTimes===0&&T(H),Object.keys(se).length===0&&m.delete(J)}r.remove(H)}function T(H){const W=r.get(H);t.deleteTexture(W.__webglTexture);const J=H.source,se=m.get(J);delete se[W.__cacheKey],s.memory.textures--}function M(H){const W=H.texture,J=r.get(H),se=r.get(W);if(se.__webglTexture!==void 0&&(t.deleteTexture(se.__webglTexture),s.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)t.deleteFramebuffer(J.__webglFramebuffer[ye]),J.__webglDepthbuffer&&t.deleteRenderbuffer(J.__webglDepthbuffer[ye]);else{if(t.deleteFramebuffer(J.__webglFramebuffer),J.__webglDepthbuffer&&t.deleteRenderbuffer(J.__webglDepthbuffer),J.__webglMultisampledFramebuffer&&t.deleteFramebuffer(J.__webglMultisampledFramebuffer),J.__webglColorRenderbuffer)for(let ye=0;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+l),I+=1,H}function N(H){const W=[];return W.push(H.wrapS),W.push(H.wrapT),W.push(H.magFilter),W.push(H.minFilter),W.push(H.anisotropy),W.push(H.internalFormat),W.push(H.format),W.push(H.type),W.push(H.generateMipmaps),W.push(H.premultiplyAlpha),W.push(H.flipY),W.push(H.unpackAlignment),W.push(H.encoding),W.join()}function L(H,W){const J=r.get(H);if(H.isVideoTexture&&de(H),H.isRenderTargetTexture===!1&&H.version>0&&J.__version!==H.version){const se=H.image;if(se===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{K(J,H,W);return}}n.activeTexture(33984+W),n.bindTexture(3553,J.__webglTexture)}function B(H,W){const J=r.get(H);if(H.version>0&&J.__version!==H.version){K(J,H,W);return}n.activeTexture(33984+W),n.bindTexture(35866,J.__webglTexture)}function $(H,W){const J=r.get(H);if(H.version>0&&J.__version!==H.version){K(J,H,W);return}n.activeTexture(33984+W),n.bindTexture(32879,J.__webglTexture)}function j(H,W){const J=r.get(H);if(H.version>0&&J.__version!==H.version){ee(J,H,W);return}n.activeTexture(33984+W),n.bindTexture(34067,J.__webglTexture)}const X={[iJ]:10497,[Jc]:33071,[oJ]:33648},V={[el]:9728,[FOe]:9984,[NOe]:9986,[tl]:9729,[k6n]:9985,[a8]:9987};function Y(H,W,J){if(J?(t.texParameteri(H,10242,X[W.wrapS]),t.texParameteri(H,10243,X[W.wrapT]),(H===32879||H===35866)&&t.texParameteri(H,32882,X[W.wrapR]),t.texParameteri(H,10240,V[W.magFilter]),t.texParameteri(H,10241,V[W.minFilter])):(t.texParameteri(H,10242,33071),t.texParameteri(H,10243,33071),(H===32879||H===35866)&&t.texParameteri(H,32882,33071),(W.wrapS!==Jc||W.wrapT!==Jc)&&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,E(W.magFilter)),t.texParameteri(H,10241,E(W.minFilter)),W.minFilter!==el&&W.minFilter!==tl&&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 se=e.get("EXT_texture_filter_anisotropic");if(W.type===Ev&&e.has("OES_texture_float_linear")===!1||a===!1&&W.type===oM&&e.has("OES_texture_half_float_linear")===!1)return;(W.anisotropy>1||r.get(W).__currentAnisotropy)&&(t.texParameterf(H,se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(W.anisotropy,i.getMaxAnisotropy())),r.get(W).__currentAnisotropy=W.anisotropy)}}function le(H,W){let J=!1;H.__webglInit===void 0&&(H.__webglInit=!0,W.addEventListener("dispose",P));const se=W.source;let ye=m.get(se);ye===void 0&&(ye={},m.set(se,ye));const ie=N(W);if(ie!==H.__cacheKey){ye[ie]===void 0&&(ye[ie]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,J=!0),ye[ie].usedTimes++;const fe=ye[H.__cacheKey];fe!==void 0&&(ye[H.__cacheKey].usedTimes--,fe.usedTimes===0&&T(W)),H.__cacheKey=ie,H.__webglTexture=ye[ie].texture}return J}function K(H,W,J){let se=3553;W.isDataArrayTexture&&(se=35866),W.isData3DTexture&&(se=32879);const ye=le(H,W),ie=W.source;if(n.activeTexture(33984+J),n.bindTexture(se,H.__webglTexture),ie.version!==ie.__currentVersion||ye===!0){t.pixelStorei(37440,W.flipY),t.pixelStorei(37441,W.premultiplyAlpha),t.pixelStorei(3317,W.unpackAlignment),t.pixelStorei(37443,0);const fe=w(W)&&b(W.image)===!1;let Q=x(W.image,fe,!1,u);Q=xe(W,Q);const _e=b(Q)||a,we=o.convert(W.format,W.encoding);let Ie=o.convert(W.type),Pe=O(W.internalFormat,we,Ie,W.encoding,W.isVideoTexture);Y(se,W,_e);let Re;const Te=W.mipmaps,Le=a&&W.isVideoTexture!==!0,ue=ie.__currentVersion===void 0||ye===!0,$e=k(W,Q,_e);if(W.isDepthTexture)Pe=6402,a?W.type===Ev?Pe=36012:W.type===Ox?Pe=33190:W.type===fS?Pe=35056:Pe=33189:W.type===Ev&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),W.format===Kx&&Pe===6402&&W.type!==iYe&&W.type!==Ox&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),W.type=Ox,Ie=o.convert(W.type)),W.format===HC&&Pe===6402&&(Pe=34041,W.type!==fS&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),W.type=fS,Ie=o.convert(W.type))),ue&&(Le?n.texStorage2D(3553,1,Pe,Q.width,Q.height):n.texImage2D(3553,0,Pe,Q.width,Q.height,0,we,Ie,null));else if(W.isDataTexture)if(Te.length>0&&_e){Le&&ue&&n.texStorage2D(3553,$e,Pe,Te[0].width,Te[0].height);for(let Se=0,Ye=Te.length;Se>=1,Ye>>=1}}else if(Te.length>0&&_e){Le&&ue&&n.texStorage2D(3553,$e,Pe,Te[0].width,Te[0].height);for(let Se=0,Ye=Te.length;Se0&&ue++,n.texStorage2D(34067,ue,Re,Q[0].width,Q[0].height));for(let Se=0;Se<6;Se++)if(fe){Te?n.texSubImage2D(34069+Se,0,0,0,Q[Se].width,Q[Se].height,Ie,Pe,Q[Se].data):n.texImage2D(34069+Se,0,Re,Q[Se].width,Q[Se].height,0,Ie,Pe,Q[Se].data);for(let Ye=0;Ye<$e.length;Ye++){const ut=$e[Ye].image[Se].image;Te?n.texSubImage2D(34069+Se,Ye+1,0,0,ut.width,ut.height,Ie,Pe,ut.data):n.texImage2D(34069+Se,Ye+1,Re,ut.width,ut.height,0,Ie,Pe,ut.data)}}else{Te?n.texSubImage2D(34069+Se,0,0,0,Ie,Pe,Q[Se]):n.texImage2D(34069+Se,0,Re,Ie,Pe,Q[Se]);for(let Ye=0;Ye<$e.length;Ye++){const tt=$e[Ye];Te?n.texSubImage2D(34069+Se,Ye+1,0,0,Ie,Pe,tt.image[Se]):n.texImage2D(34069+Se,Ye+1,Re,Ie,Pe,tt.image[Se])}}}_(W,we)&&S(34067),ye.__currentVersion=ye.version,W.onUpdate&&W.onUpdate(W)}H.__version=W.version}function re(H,W,J,se,ye){const ie=o.convert(J.format,J.encoding),fe=o.convert(J.type),Q=O(J.internalFormat,ie,fe,J.encoding);r.get(W).__hasExternalTextures||(ye===32879||ye===35866?n.texImage3D(ye,0,Q,W.width,W.height,W.depth,0,ie,fe,null):n.texImage2D(ye,0,Q,W.width,W.height,0,ie,fe,null)),n.bindFramebuffer(36160,H),Z(W)?d.framebufferTexture2DMultisampleEXT(36160,se,ye,r.get(J).__webglTexture,0,q(W)):t.framebufferTexture2D(36160,se,ye,r.get(J).__webglTexture,0),n.bindFramebuffer(36160,null)}function me(H,W,J){if(t.bindRenderbuffer(36161,H),W.depthBuffer&&!W.stencilBuffer){let se=33189;if(J||Z(W)){const ye=W.depthTexture;ye&&ye.isDepthTexture&&(ye.type===Ev?se=36012:ye.type===Ox&&(se=33190));const ie=q(W);Z(W)?d.renderbufferStorageMultisampleEXT(36161,ie,se,W.width,W.height):t.renderbufferStorageMultisample(36161,ie,se,W.width,W.height)}else t.renderbufferStorage(36161,se,W.width,W.height);t.framebufferRenderbuffer(36160,36096,36161,H)}else if(W.depthBuffer&&W.stencilBuffer){const se=q(W);J&&Z(W)===!1?t.renderbufferStorageMultisample(36161,se,35056,W.width,W.height):Z(W)?d.renderbufferStorageMultisampleEXT(36161,se,35056,W.width,W.height):t.renderbufferStorage(36161,34041,W.width,W.height),t.framebufferRenderbuffer(36160,33306,36161,H)}else{const se=W.isWebGLMultipleRenderTargets===!0?W.texture:[W.texture];for(let ye=0;ye0&&Z(H)===!1){const Q=ie?W:[W];J.__webglMultisampledFramebuffer=t.createFramebuffer(),J.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,J.__webglMultisampledFramebuffer);for(let _e=0;_e0&&Z(H)===!1){const W=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],J=H.width,se=H.height;let ye=16384;const ie=[],fe=H.stencilBuffer?33306:36096,Q=r.get(H),_e=H.isWebGLMultipleRenderTargets===!0;if(_e)for(let we=0;we0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&W.__useRenderToTexture!==!1}function de(H){const W=s.render.frame;p.get(H)!==W&&(p.set(H,W),H.update())}function xe(H,W){const J=H.encoding,se=H.format,ye=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===sJ||J!==qb&&(J===Pi?a===!1?e.has("EXT_sRGB")===!0&&se===sh?(H.format=sJ,H.minFilter=tl,H.generateMipmaps=!1):W=lYe.sRGBToLinear(W):(se!==sh||ye!==Hb)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",J)),W}this.allocateTextureUnit=F,this.resetTextureUnits=z,this.setTexture2D=L,this.setTexture2DArray=B,this.setTexture3D=$,this.setTextureCube=j,this.rebindTextures=U,this.setupRenderTarget=oe,this.updateRenderTargetMipmap=ne,this.updateMultisampleRenderTarget=G,this.setupDepthRenderbuffer=ae,this.setupFrameBufferTexture=re,this.useMultisampledRTT=Z}function L9n(t,e,n){const r=n.isWebGL2;function i(o,s=null){let a;if(o===Hb)return 5121;if(o===R6n)return 32819;if(o===D6n)return 32820;if(o===A6n)return 5120;if(o===P6n)return 5122;if(o===iYe)return 5123;if(o===M6n)return 5124;if(o===Ox)return 5125;if(o===Ev)return 5126;if(o===oM)return r?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(o===I6n)return 6406;if(o===sh)return 6408;if(o===$6n)return 6409;if(o===F6n)return 6410;if(o===Kx)return 6402;if(o===HC)return 34041;if(o===oYe)return 6403;if(o===L6n)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===sJ)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(o===N6n)return 36244;if(o===z6n)return 33319;if(o===j6n)return 33320;if(o===B6n)return 36249;if(o===rG||o===iG||o===oG||o===sG)if(s===Pi)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(o===rG)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===iG)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===oG)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===sG)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(o===rG)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===iG)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===oG)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===sG)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===zOe||o===jOe||o===BOe||o===UOe)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(o===zOe)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===jOe)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===BOe)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===UOe)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===U6n)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===WOe||o===VOe)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(o===WOe)return s===Pi?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(o===VOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===GOe||o===HOe||o===qOe||o===XOe||o===YOe||o===QOe||o===KOe||o===ZOe||o===JOe||o===eEe||o===tEe||o===nEe||o===rEe||o===iEe)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(o===GOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===HOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===qOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===XOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===YOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===QOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===KOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===ZOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===JOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===eEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===tEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===nEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===rEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===iEe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===oEe)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(o===oEe)return s===Pi?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===fS?r?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class $9n extends bf{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class P$ extends xl{constructor(){super(),this.isGroup=!0,this.type="Group"}}const F9n={type:"move"};class IG{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new P$,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 P$,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ce,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ce),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new P$,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ce,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ce),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,s=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){s=!0;for(const g of e.hand.values()){const m=n.getJointPose(g,r);if(c.joints[g.jointName]===void 0){const y=new P$;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[g.jointName]=y,c.add(y)}const v=c.joints[g.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==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));a!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(F9n)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),this}}class N9n extends kc{constructor(e,n,r,i,o,s,a,l,c,u){if(u=u!==void 0?u:Kx,u!==Kx&&u!==HC)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===Kx&&(r=Ox),r===void 0&&u===HC&&(r=fS),super(null,i,o,s,a,l,u,r,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=a!==void 0?a:el,this.minFilter=l!==void 0?l:el,this.flipY=!1,this.generateMipmaps=!1}}class z9n extends $1{constructor(e,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=null,c=null,u=null,f=null,d=null,h=null;const p=n.getContextAttributes();let g=null,m=null;const v=[],y=[],x=new bf;x.layers.enable(1),x.viewport=new ys;const b=new bf;b.layers.enable(2),b.viewport=new ys;const w=[x,b],_=new $9n;_.layers.enable(1),_.layers.enable(2);let S=null,O=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(N){let L=v[N];return L===void 0&&(L=new IG,v[N]=L),L.getTargetRaySpace()},this.getControllerGrip=function(N){let L=v[N];return L===void 0&&(L=new IG,v[N]=L),L.getGripSpace()},this.getHand=function(N){let L=v[N];return L===void 0&&(L=new IG,v[N]=L),L.getHandSpace()};function k(N){const L=y.indexOf(N.inputSource);if(L===-1)return;const B=v[L];B!==void 0&&B.dispatchEvent({type:N.type,data:N.inputSource})}function E(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",E),i.removeEventListener("inputsourceschange",P);for(let N=0;N=0&&(y[$]=null,v[$].dispatchEvent({type:"disconnected",data:B}))}for(let L=0;L=y.length){y.push(B),$=X;break}else if(y[X]===null){y[X]=B,$=X;break}if($===-1)break}const j=v[$];j&&j.dispatchEvent({type:"connected",data:B})}}const A=new Ce,R=new Ce;function T(N,L,B){A.setFromMatrixPosition(L.matrixWorld),R.setFromMatrixPosition(B.matrixWorld);const $=A.distanceTo(R),j=L.projectionMatrix.elements,X=B.projectionMatrix.elements,V=j[14]/(j[10]-1),Y=j[14]/(j[10]+1),le=(j[9]+1)/j[5],K=(j[9]-1)/j[5],ee=(j[8]-1)/j[0],re=(X[8]+1)/X[0],me=V*ee,te=V*re,ae=$/(-ee+re),U=ae*-ee;L.matrixWorld.decompose(N.position,N.quaternion,N.scale),N.translateX(U),N.translateZ(ae),N.matrixWorld.compose(N.position,N.quaternion,N.scale),N.matrixWorldInverse.copy(N.matrixWorld).invert();const oe=V+ae,ne=Y+ae,G=me-U,q=te+($-U),Z=le*Y/ne*oe,de=K*Y/ne*oe;N.projectionMatrix.makePerspective(G,q,Z,de,oe,ne)}function M(N,L){L===null?N.matrixWorld.copy(N.matrix):N.matrixWorld.multiplyMatrices(L.matrixWorld,N.matrix),N.matrixWorldInverse.copy(N.matrixWorld).invert()}this.updateCamera=function(N){if(i===null)return;_.near=b.near=x.near=N.near,_.far=b.far=x.far=N.far,(S!==_.near||O!==_.far)&&(i.updateRenderState({depthNear:_.near,depthFar:_.far}),S=_.near,O=_.far);const L=N.parent,B=_.cameras;M(_,L);for(let j=0;j0&&(g.alphaTest.value=m.alphaTest);const v=e.get(m).envMap;if(v&&(g.envMap.value=v,g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap){g.lightMap.value=m.lightMap;const b=t.physicallyCorrectLights!==!0?Math.PI:1;g.lightMapIntensity.value=m.lightMapIntensity*b}m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity);let y;m.map?y=m.map:m.specularMap?y=m.specularMap:m.displacementMap?y=m.displacementMap:m.normalMap?y=m.normalMap:m.bumpMap?y=m.bumpMap:m.roughnessMap?y=m.roughnessMap:m.metalnessMap?y=m.metalnessMap:m.alphaMap?y=m.alphaMap:m.emissiveMap?y=m.emissiveMap:m.clearcoatMap?y=m.clearcoatMap:m.clearcoatNormalMap?y=m.clearcoatNormalMap:m.clearcoatRoughnessMap?y=m.clearcoatRoughnessMap:m.iridescenceMap?y=m.iridescenceMap:m.iridescenceThicknessMap?y=m.iridescenceThicknessMap:m.specularIntensityMap?y=m.specularIntensityMap:m.specularColorMap?y=m.specularColorMap:m.transmissionMap?y=m.transmissionMap:m.thicknessMap?y=m.thicknessMap:m.sheenColorMap?y=m.sheenColorMap:m.sheenRoughnessMap&&(y=m.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),g.uvTransform.value.copy(y.matrix));let x;m.aoMap?x=m.aoMap:m.lightMap&&(x=m.lightMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),g.uv2Transform.value.copy(x.matrix))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function a(g,m,v,y){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*v,g.scale.value=y*.5,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let x;m.map?x=m.map:m.alphaMap&&(x=m.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),g.uvTransform.value.copy(x.matrix))}function l(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let v;m.map?v=m.map:m.alphaMap&&(v=m.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),g.uvTransform.value.copy(v.matrix))}function c(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function u(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.roughness.value=m.roughness,g.metalness.value=m.metalness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap),e.get(m).envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,v){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),g.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===mc&&g.clearcoatNormalScale.value.negate())),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap)),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap)}function h(g,m){m.matcap&&(g.matcap.value=m.matcap)}function p(g,m){g.referencePosition.value.copy(m.referencePosition),g.nearDistance.value=m.nearDistance,g.farDistance.value=m.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function B9n(t,e,n,r){let i={},o={},s=[];const a=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",m));const w=x.program;r.updateUBOMapping(y,w);const _=e.render.frame;o[y.id]!==_&&(d(y),o[y.id]=_)}function u(y){const x=f();y.__bindingPointIndex=x;const b=t.createBuffer(),w=y.__size,_=y.usage;return t.bindBuffer(35345,b),t.bufferData(35345,w,_),t.bindBuffer(35345,null),t.bindBufferBase(35345,x,b),b}function f(){for(let y=0;y0){_=b%w;const P=w-_;_!==0&&P-E.boundary<0&&(b+=w-_,k.__offset=b)}b+=E.storage}return _=b%w,_>0&&(b+=w-_),y.__size=b,y.__cache={},this}function g(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 m(y){const x=y.target;x.removeEventListener("dispose",m);const b=s.indexOf(x.__bindingPointIndex);s.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]);s=[],i={},o={}}return{bind:l,update:c,dispose:v}}function U9n(){const t=sM("canvas");return t.style.display="block",t}function EYe(t={}){this.isWebGLRenderer=!0;const e=t.canvas!==void 0?t.canvas:U9n(),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,s=t.premultipliedAlpha!==void 0?t.premultipliedAlpha:!0,a=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=qb,this.physicallyCorrectLights=!1,this.toneMapping=Cg,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 g=this;let m=!1,v=0,y=0,x=null,b=-1,w=null;const _=new ys,S=new ys;let O=null,k=e.width,E=e.height,P=1,A=null,R=null;const T=new ys(0,0,k,E),M=new ys(0,0,k,E);let I=!1;const z=new xYe;let F=!1,N=!1,L=null;const B=new Gr,$=new On,j=new Ce,X={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function V(){return x===null?P:1}let Y=n;function le(ce,Ae){for(let Fe=0;Fe0?d=p[p.length-1]:d=null,h.pop(),h.length>0?f=h[h.length-1]:f=null};function Zi(ce,Ae,Fe,ke){if(ce.visible===!1)return;if(ce.layers.test(Ae.layers)){if(ce.isGroup)Fe=ce.renderOrder;else if(ce.isLOD)ce.autoUpdate===!0&&ce.update(Ae);else if(ce.isLight)d.pushLight(ce),ce.castShadow&&d.pushShadow(ce);else if(ce.isSprite){if(!ce.frustumCulled||z.intersectsSprite(ce)){ke&&j.setFromMatrixPosition(ce.matrixWorld).applyMatrix4(B);const Nt=q.update(ce),an=ce.material;an.visible&&f.push(ce,Nt,an,Fe,j.z,null)}}else if((ce.isMesh||ce.isLine||ce.isPoints)&&(ce.isSkinnedMesh&&ce.skeleton.frame!==me.render.frame&&(ce.skeleton.update(),ce.skeleton.frame=me.render.frame),!ce.frustumCulled||z.intersectsObject(ce))){ke&&j.setFromMatrixPosition(ce.matrixWorld).applyMatrix4(B);const Nt=q.update(ce),an=ce.material;if(Array.isArray(an)){const tn=Nt.groups;for(let Qn=0,Bn=tn.length;Qn0&&Ht(Be,Ae,Fe),ke&&re.viewport(_.copy(ke)),Be.length>0&&fr(Be,Ae,Fe),Ot.length>0&&fr(Ot,Ae,Fe),Nt.length>0&&fr(Nt,Ae,Fe),re.buffers.depth.setTest(!0),re.buffers.depth.setMask(!0),re.buffers.color.setMask(!0),re.setPolygonOffset(!1)}function Ht(ce,Ae,Fe){const ke=ee.isWebGL2;L===null&&(L=new Xb(1,1,{generateMipmaps:!0,type:K.has("EXT_color_buffer_half_float")?oM:Hb,minFilter:a8,samples:ke&&o===!0?4:0})),g.getDrawingBufferSize($),ke?L.setSize($.x,$.y):L.setSize(aJ($.x),aJ($.y));const Be=g.getRenderTarget();g.setRenderTarget(L),g.clear();const Ot=g.toneMapping;g.toneMapping=Cg,fr(ce,Ae,Fe),g.toneMapping=Ot,ae.updateMultisampleRenderTarget(L),ae.updateRenderTargetMipmap(L),g.setRenderTarget(Be)}function fr(ce,Ae,Fe){const ke=Ae.isScene===!0?Ae.overrideMaterial:null;for(let Be=0,Ot=ce.length;Be0&&ae.useMultisampledRTT(ce)===!1?Be=te.get(ce).__webglMultisampledFramebuffer:Be=Qn,_.copy(ce.viewport),S.copy(ce.scissor),O=ce.scissorTest}else _.copy(T).multiplyScalar(P).floor(),S.copy(M).multiplyScalar(P).floor(),O=I;if(re.bindFramebuffer(36160,Be)&&ee.drawBuffers&&ke&&re.drawBuffers(ce,Be),re.viewport(_),re.scissor(S),re.setScissorTest(O),Ot){const tn=te.get(ce.texture);Y.framebufferTexture2D(36160,36064,34069+Ae,tn.__webglTexture,Fe)}else if(Nt){const tn=te.get(ce.texture),Qn=Ae||0;Y.framebufferTextureLayer(36160,36064,tn.__webglTexture,Fe||0,Qn)}b=-1},this.readRenderTargetPixels=function(ce,Ae,Fe,ke,Be,Ot,Nt){if(!(ce&&ce.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let an=te.get(ce).__webglFramebuffer;if(ce.isWebGLCubeRenderTarget&&Nt!==void 0&&(an=an[Nt]),an){re.bindFramebuffer(36160,an);try{const tn=ce.texture,Qn=tn.format,Bn=tn.type;if(Qn!==sh&&Q.convert(Qn)!==Y.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Un=Bn===oM&&(K.has("EXT_color_buffer_half_float")||ee.isWebGL2&&K.has("EXT_color_buffer_float"));if(Bn!==Hb&&Q.convert(Bn)!==Y.getParameter(35738)&&!(Bn===Ev&&(ee.isWebGL2||K.has("OES_texture_float")||K.has("WEBGL_color_buffer_float")))&&!Un){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Ae>=0&&Ae<=ce.width-ke&&Fe>=0&&Fe<=ce.height-Be&&Y.readPixels(Ae,Fe,ke,Be,Q.convert(Qn),Q.convert(Bn),Ot)}finally{const tn=x!==null?te.get(x).__webglFramebuffer:null;re.bindFramebuffer(36160,tn)}}},this.copyFramebufferToTexture=function(ce,Ae,Fe=0){const ke=Math.pow(2,-Fe),Be=Math.floor(Ae.image.width*ke),Ot=Math.floor(Ae.image.height*ke);ae.setTexture2D(Ae,0),Y.copyTexSubImage2D(3553,Fe,0,0,ce.x,ce.y,Be,Ot),re.unbindTexture()},this.copyTextureToTexture=function(ce,Ae,Fe,ke=0){const Be=Ae.image.width,Ot=Ae.image.height,Nt=Q.convert(Fe.format),an=Q.convert(Fe.type);ae.setTexture2D(Fe,0),Y.pixelStorei(37440,Fe.flipY),Y.pixelStorei(37441,Fe.premultiplyAlpha),Y.pixelStorei(3317,Fe.unpackAlignment),Ae.isDataTexture?Y.texSubImage2D(3553,ke,ce.x,ce.y,Be,Ot,Nt,an,Ae.image.data):Ae.isCompressedTexture?Y.compressedTexSubImage2D(3553,ke,ce.x,ce.y,Ae.mipmaps[0].width,Ae.mipmaps[0].height,Nt,Ae.mipmaps[0].data):Y.texSubImage2D(3553,ke,ce.x,ce.y,Nt,an,Ae.image),ke===0&&Fe.generateMipmaps&&Y.generateMipmap(3553),re.unbindTexture()},this.copyTextureToTexture3D=function(ce,Ae,Fe,ke,Be=0){if(g.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ot=ce.max.x-ce.min.x+1,Nt=ce.max.y-ce.min.y+1,an=ce.max.z-ce.min.z+1,tn=Q.convert(ke.format),Qn=Q.convert(ke.type);let Bn;if(ke.isData3DTexture)ae.setTexture3D(ke,0),Bn=32879;else if(ke.isDataArrayTexture)ae.setTexture2DArray(ke,0),Bn=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Y.pixelStorei(37440,ke.flipY),Y.pixelStorei(37441,ke.premultiplyAlpha),Y.pixelStorei(3317,ke.unpackAlignment);const Un=Y.getParameter(3314),Ti=Y.getParameter(32878),d0=Y.getParameter(3316),N1=Y.getParameter(3315),z1=Y.getParameter(32877),hd=Fe.isCompressedTexture?Fe.mipmaps[0]:Fe.image;Y.pixelStorei(3314,hd.width),Y.pixelStorei(32878,hd.height),Y.pixelStorei(3316,ce.min.x),Y.pixelStorei(3315,ce.min.y),Y.pixelStorei(32877,ce.min.z),Fe.isDataTexture||Fe.isData3DTexture?Y.texSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ot,Nt,an,tn,Qn,hd.data):Fe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Y.compressedTexSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ot,Nt,an,tn,hd.data)):Y.texSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ot,Nt,an,tn,Qn,hd),Y.pixelStorei(3314,Un),Y.pixelStorei(32878,Ti),Y.pixelStorei(3316,d0),Y.pixelStorei(3315,N1),Y.pixelStorei(32877,z1),Be===0&&ke.generateMipmaps&&Y.generateMipmap(Bn),re.unbindTexture()},this.initTexture=function(ce){ce.isCubeTexture?ae.setTextureCube(ce,0):ce.isData3DTexture?ae.setTexture3D(ce,0):ce.isDataArrayTexture?ae.setTexture2DArray(ce,0):ae.setTexture2D(ce,0),re.unbindTexture()},this.resetState=function(){v=0,y=0,x=null,re.reset(),_e.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class W9n extends EYe{}W9n.prototype.isWebGL1Renderer=!0;class V9n extends xl{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 TYe extends CD{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new hi(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 WEe=new Ce,VEe=new Ce,GEe=new Gr,LG=new dYe,M$=new l8;class G9n extends xl{constructor(e=new sm,n=new TYe){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 O=e.ray.origin.distanceTo(d);Oe.far||n.push({distance:O,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,s.start),y=Math.min(m.count,s.start+s.count);for(let x=v,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);const _=e.ray.origin.distanceTo(d);_e.far||n.push({distance:_,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,s=i.length;o{n&&n(o),this.manager.itemEnd(e)},0),o;if(_p[e]!==void 0){_p[e].push({onLoad:n,onProgress:r,onError:i});return}_p[e]=[],_p[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).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=_p[e],f=c.body.getReader(),d=c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let g=0;const m=new ReadableStream({start(v){y();function y(){f.read().then(({done:x,value:b})=>{if(x)v.close();else{g+=b.byteLength;const w=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:h});for(let _=0,S=u.length;_{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{aj.add(e,c);const u=_p[e];delete _p[e];for(let f=0,d=u.length;f{const u=_p[e];if(u===void 0)throw this.manager.itemError(e),c;delete _p[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 K9n extends f8{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,s=aj.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(s),o.manager.itemEnd(e)},0),s;const a=sM("img");function l(){u(),aj.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(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(e),a.src=e,a}}class Z9n extends f8{constructor(e){super(e)}load(e,n,r,i){const o=new kc,s=new K9n(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(a){o.image=a,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class XEe{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(nl(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const R$=new mE;class J9n extends H9n{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 sm;o.setIndex(new yu(r,1)),o.setAttribute("position",new yu(i,3)),super(o,new TYe({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&&R$.setFromObject(this.object),R$.isEmpty())return;const n=R$.min,r=R$.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:cue}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=cue);const YEe={type:"change"},$G={type:"start"},QEe={type:"end"};class e7n extends $1{constructor(e,n){super(),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Ce,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:vw.ROTATE,MIDDLE:vw.DOLLY,RIGHT:vw.PAN},this.touches={ONE:yw.ROTATE,TWO:yw.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 a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(Q){Q.addEventListener("keydown",xe),this._domElementKeyEvents=Q},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(YEe),r.update(),o=i.NONE},this.update=function(){const Q=new Ce,_e=new Yb().setFromUnitVectors(e.up,new Ce(0,1,0)),we=_e.clone().invert(),Ie=new Ce,Pe=new Yb,Re=2*Math.PI;return function(){const Le=r.object.position;Q.copy(Le).sub(r.target),Q.applyQuaternion(_e),a.setFromVector3(Q),r.autoRotate&&o===i.NONE&&k(S()),r.enableDamping?(a.theta+=l.theta*r.dampingFactor,a.phi+=l.phi*r.dampingFactor):(a.theta+=l.theta,a.phi+=l.phi);let ue=r.minAzimuthAngle,$e=r.maxAzimuthAngle;return isFinite(ue)&&isFinite($e)&&(ue<-Math.PI?ue+=Re:ue>Math.PI&&(ue-=Re),$e<-Math.PI?$e+=Re:$e>Math.PI&&($e-=Re),ue<=$e?a.theta=Math.max(ue,Math.min($e,a.theta)):a.theta=a.theta>(ue+$e)/2?Math.max(ue,a.theta):Math.min($e,a.theta)),a.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=c,a.radius=Math.max(r.minDistance,Math.min(r.maxDistance,a.radius)),r.enableDamping===!0?r.target.addScaledVector(u,r.dampingFactor):r.target.add(u),Q.setFromSpherical(a),Q.applyQuaternion(we),Le.copy(r.target).add(Q),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||Ie.distanceToSquared(r.object.position)>s||8*(1-Pe.dot(r.object.quaternion))>s?(r.dispatchEvent(YEe),Ie.copy(r.object.position),Pe.copy(r.object.quaternion),f=!1,!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",J),r.domElement.removeEventListener("pointerdown",U),r.domElement.removeEventListener("pointercancel",G),r.domElement.removeEventListener("wheel",de),r.domElement.removeEventListener("pointermove",oe),r.domElement.removeEventListener("pointerup",ne),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",xe)};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 s=1e-6,a=new XEe,l=new XEe;let c=1;const u=new Ce;let f=!1;const d=new On,h=new On,p=new On,g=new On,m=new On,v=new On,y=new On,x=new On,b=new On,w=[],_={};function S(){return 2*Math.PI/60/60*r.autoRotateSpeed}function O(){return Math.pow(.95,r.zoomSpeed)}function k(Q){l.theta-=Q}function E(Q){l.phi-=Q}const P=function(){const Q=new Ce;return function(we,Ie){Q.setFromMatrixColumn(Ie,0),Q.multiplyScalar(-we),u.add(Q)}}(),A=function(){const Q=new Ce;return function(we,Ie){r.screenSpacePanning===!0?Q.setFromMatrixColumn(Ie,1):(Q.setFromMatrixColumn(Ie,0),Q.crossVectors(r.object.up,Q)),Q.multiplyScalar(we),u.add(Q)}}(),R=function(){const Q=new Ce;return function(we,Ie){const Pe=r.domElement;if(r.object.isPerspectiveCamera){const Re=r.object.position;Q.copy(Re).sub(r.target);let Te=Q.length();Te*=Math.tan(r.object.fov/2*Math.PI/180),P(2*we*Te/Pe.clientHeight,r.object.matrix),A(2*Ie*Te/Pe.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(P(we*(r.object.right-r.object.left)/r.object.zoom/Pe.clientWidth,r.object.matrix),A(Ie*(r.object.top-r.object.bottom)/r.object.zoom/Pe.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function T(Q){r.object.isPerspectiveCamera?c/=Q:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*Q)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function M(Q){r.object.isPerspectiveCamera?c*=Q:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/Q)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function I(Q){d.set(Q.clientX,Q.clientY)}function z(Q){y.set(Q.clientX,Q.clientY)}function F(Q){g.set(Q.clientX,Q.clientY)}function N(Q){h.set(Q.clientX,Q.clientY),p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const _e=r.domElement;k(2*Math.PI*p.x/_e.clientHeight),E(2*Math.PI*p.y/_e.clientHeight),d.copy(h),r.update()}function L(Q){x.set(Q.clientX,Q.clientY),b.subVectors(x,y),b.y>0?T(O()):b.y<0&&M(O()),y.copy(x),r.update()}function B(Q){m.set(Q.clientX,Q.clientY),v.subVectors(m,g).multiplyScalar(r.panSpeed),R(v.x,v.y),g.copy(m),r.update()}function $(Q){Q.deltaY<0?M(O()):Q.deltaY>0&&T(O()),r.update()}function j(Q){let _e=!1;switch(Q.code){case r.keys.UP:R(0,r.keyPanSpeed),_e=!0;break;case r.keys.BOTTOM:R(0,-r.keyPanSpeed),_e=!0;break;case r.keys.LEFT:R(r.keyPanSpeed,0),_e=!0;break;case r.keys.RIGHT:R(-r.keyPanSpeed,0),_e=!0;break}_e&&(Q.preventDefault(),r.update())}function X(){if(w.length===1)d.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),_e=.5*(w[0].pageY+w[1].pageY);d.set(Q,_e)}}function V(){if(w.length===1)g.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),_e=.5*(w[0].pageY+w[1].pageY);g.set(Q,_e)}}function Y(){const Q=w[0].pageX-w[1].pageX,_e=w[0].pageY-w[1].pageY,we=Math.sqrt(Q*Q+_e*_e);y.set(0,we)}function le(){r.enableZoom&&Y(),r.enablePan&&V()}function K(){r.enableZoom&&Y(),r.enableRotate&&X()}function ee(Q){if(w.length===1)h.set(Q.pageX,Q.pageY);else{const we=fe(Q),Ie=.5*(Q.pageX+we.x),Pe=.5*(Q.pageY+we.y);h.set(Ie,Pe)}p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const _e=r.domElement;k(2*Math.PI*p.x/_e.clientHeight),E(2*Math.PI*p.y/_e.clientHeight),d.copy(h)}function re(Q){if(w.length===1)m.set(Q.pageX,Q.pageY);else{const _e=fe(Q),we=.5*(Q.pageX+_e.x),Ie=.5*(Q.pageY+_e.y);m.set(we,Ie)}v.subVectors(m,g).multiplyScalar(r.panSpeed),R(v.x,v.y),g.copy(m)}function me(Q){const _e=fe(Q),we=Q.pageX-_e.x,Ie=Q.pageY-_e.y,Pe=Math.sqrt(we*we+Ie*Ie);x.set(0,Pe),b.set(0,Math.pow(x.y/y.y,r.zoomSpeed)),T(b.y),y.copy(x)}function te(Q){r.enableZoom&&me(Q),r.enablePan&&re(Q)}function ae(Q){r.enableZoom&&me(Q),r.enableRotate&&ee(Q)}function U(Q){r.enabled!==!1&&(w.length===0&&(r.domElement.setPointerCapture(Q.pointerId),r.domElement.addEventListener("pointermove",oe),r.domElement.addEventListener("pointerup",ne)),se(Q),Q.pointerType==="touch"?H(Q):q(Q))}function oe(Q){r.enabled!==!1&&(Q.pointerType==="touch"?W(Q):Z(Q))}function ne(Q){ye(Q),w.length===0&&(r.domElement.releasePointerCapture(Q.pointerId),r.domElement.removeEventListener("pointermove",oe),r.domElement.removeEventListener("pointerup",ne)),r.dispatchEvent(QEe),o=i.NONE}function G(Q){ye(Q)}function q(Q){let _e;switch(Q.button){case 0:_e=r.mouseButtons.LEFT;break;case 1:_e=r.mouseButtons.MIDDLE;break;case 2:_e=r.mouseButtons.RIGHT;break;default:_e=-1}switch(_e){case vw.DOLLY:if(r.enableZoom===!1)return;z(Q),o=i.DOLLY;break;case vw.ROTATE:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(r.enablePan===!1)return;F(Q),o=i.PAN}else{if(r.enableRotate===!1)return;I(Q),o=i.ROTATE}break;case vw.PAN:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(r.enableRotate===!1)return;I(Q),o=i.ROTATE}else{if(r.enablePan===!1)return;F(Q),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent($G)}function Z(Q){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;N(Q);break;case i.DOLLY:if(r.enableZoom===!1)return;L(Q);break;case i.PAN:if(r.enablePan===!1)return;B(Q);break}}function de(Q){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(Q.preventDefault(),r.dispatchEvent($G),$(Q),r.dispatchEvent(QEe))}function xe(Q){r.enabled===!1||r.enablePan===!1||j(Q)}function H(Q){switch(ie(Q),w.length){case 1:switch(r.touches.ONE){case yw.ROTATE:if(r.enableRotate===!1)return;X(),o=i.TOUCH_ROTATE;break;case yw.PAN:if(r.enablePan===!1)return;V(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case yw.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;le(),o=i.TOUCH_DOLLY_PAN;break;case yw.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;K(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent($G)}function W(Q){switch(ie(Q),o){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;ee(Q),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;re(Q),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;te(Q),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ae(Q),r.update();break;default:o=i.NONE}}function J(Q){r.enabled!==!1&&Q.preventDefault()}function se(Q){w.push(Q)}function ye(Q){delete _[Q.pointerId];for(let _e=0;_e>>1|(ii&21845)<<1;km=(km&52428)>>>2|(km&13107)<<2,km=(km&61680)>>>4|(km&3855)<<4,cJ[ii]=((km&65280)>>>8|(km&255)<<8)>>>1}var Ik=function(t,e,n){for(var r=t.length,i=0,o=new Tx(e);i>>l]=c}else for(a=new Tx(r),i=0;i>>15-t[i]);return a},OD=new ic(288);for(var ii=0;ii<144;++ii)OD[ii]=8;for(var ii=144;ii<256;++ii)OD[ii]=9;for(var ii=256;ii<280;++ii)OD[ii]=7;for(var ii=280;ii<288;++ii)OD[ii]=8;var IYe=new ic(32);for(var ii=0;ii<32;++ii)IYe[ii]=5;var u7n=Ik(OD,9,1),f7n=Ik(IYe,5,1),FG=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},tf=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},NG=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},d7n=function(t){return(t+7)/8|0},h7n=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t.BYTES_PER_ELEMENT==2?Tx:t.BYTES_PER_ELEMENT==4?kYe:ic)(n-e);return r.set(t.subarray(e,n)),r},p7n=["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"],Ip=function(t,e,n){var r=new Error(e||p7n[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Ip),!n)throw r;return r},g7n=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new ic(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new ic(r*3));var s=function(Y){var le=e.length;if(Y>le){var K=new ic(Math.max(le*2,Y));K.set(e),e=K}},a=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){a=tf(t,l,1);var g=tf(t,l+1,3);if(l+=3,g)if(g==1)u=u7n,f=f7n,d=9,h=5;else if(g==2){var x=tf(t,l,31)+257,b=tf(t,l+10,15)+4,w=x+tf(t,l+5,31)+1;l+=14;for(var _=new ic(w),S=new ic(19),O=0;O>>4;if(m<16)_[O++]=m;else{var R=0,T=0;for(m==16?(T=3+tf(t,l,3),l+=2,R=_[O-1]):m==17?(T=3+tf(t,l,7),l+=3):m==18&&(T=11+tf(t,l,127),l+=7);T--;)_[O++]=R}}var M=_.subarray(0,x),I=_.subarray(x);d=FG(M),h=FG(I),u=Ik(M,d,1),f=Ik(I,h,1)}else Ip(1);else{var m=d7n(l)+4,v=t[m-4]|t[m-3]<<8,y=m+v;if(y>r){o&&Ip(0);break}i&&s(c+v),e.set(t.subarray(m,y),c),n.b=c+=v,n.p=l=y*8,n.f=a;continue}if(l>p){o&&Ip(0);break}}i&&s(c+131072);for(var z=(1<>>4;if(l+=R&15,l>p){o&&Ip(0);break}if(R||Ip(2),L<256)e[c++]=L;else if(L==256){N=l,u=null;break}else{var B=L-254;if(L>264){var O=L-257,$=AYe[O];B=tf(t,l,(1<<$)-1)+DYe[O],l+=$}var j=f[NG(t,l)&F],X=j>>>4;j||Ip(3),l+=j&15;var I=c7n[X];if(X>3){var $=PYe[X];I+=NG(t,l)&(1<<$)-1,l+=$}if(l>p){o&&Ip(0);break}i&&s(c+131072);for(var V=c+B;c>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},y7n=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function x7n(t,e){return g7n(t.subarray(v7n(t),-8),new ic(y7n(t)))}var b7n=typeof TextDecoder<"u"&&new TextDecoder,w7n=0;try{b7n.decode(m7n,{stream:!0}),w7n=1}catch{}class _7n{constructor(e,n,r){const i=this;this.volume=e,n=n||0,Object.defineProperty(this,"index",{get:function(){return n},set:function(a){return n=a,i.geometryNeedsUpdate=!0,n}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const o=new kc(this.canvas);o.minFilter=tl,o.wrapS=o.wrapT=Jc;const s=new uue({map:o,side:rg,transparent:!0});this.mesh=new ah(this.geometry,s),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,s=this.ctxBuffer,a=s.getImageData(0,0,e,n),l=a.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 g=0;g=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 g=0;g=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++}s.putImageData(a,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 c8(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class S7n{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 uc,this.matrix.identity();let s=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return s},set:function(l){s=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}});let a=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return a},set:function(l){a=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,a].find(function(_){return Math.abs(_.dot(v[1]))>.9}),b=[l,c,a].find(function(_){return Math.abs(_.dot(v[2]))>.9});function w(_,S){const O=y===a?s:y.arglet==="i"?_:S,k=x===a?s:x.arglet==="i"?_:S,E=b===a?s:b.arglet==="i"?_:S,P=y.dot(v[0])>0?O:f.xLength-1-O,A=x.dot(v[1])>0?k:f.yLength-1-k,R=b.dot(v[2])>0?E:f.zLength-1-E;return f.access(P,A,R)}return{iLength:h,jLength:p,sliceAccess:w,matrix:u,planeWidth:g,planeHeight:m}}extractSlice(e,n){const r=new _7n(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,s={};function a(O,k){k==null&&(k=1);let E=1,P=Uint8Array;switch(O){case"uchar":break;case"schar":P=Int8Array;break;case"ushort":P=Uint16Array,E=2;break;case"sshort":P=Int16Array,E=2;break;case"uint":P=Uint32Array,E=4;break;case"sint":P=Int32Array,E=4;break;case"float":P=Float32Array,E=4;break;case"complex":P=Float64Array,E=8;break;case"double":P=Float64Array,E=8;break}let A=new P(n.slice(r,r+=k*E));return i!==o&&(A=l(A,E)),k===1?A[0]:A}function l(O,k){const E=new Uint8Array(O.buffer,O.byteOffset,O.byteLength);for(let P=0;PR;A--,R++){const T=E[R];E[R]=E[A],E[A]=T}return O}function c(O){let k,E,P,A,R,T,M,I;const z=O.split(/\r?\n/);for(M=0,I=z.length;M13)&&A!==32?P+=String.fromCharCode(A):(P!==""&&(M[I]=z(P,T),I++),P="");return P!==""&&(M[I]=z(P,T),I++),M}const f=a("uchar",e.byteLength),d=f.length;let h=null,p=0,g;for(g=1;gA[0]!==0),k=s.vectors.findIndex(A=>A[1]!==0),E=s.vectors.findIndex(A=>A[2]!==0),P=[];P[O]="x",P[k]="y",P[E]="z",m.axisOrder=P}else m.axisOrder=["x","y","z"];const b=new Ce().fromArray(s.vectors[0]).length(),w=new Ce().fromArray(s.vectors[1]).length(),_=new Ce().fromArray(s.vectors[2]).length();m.spacing=[b,w,_],m.matrix=new Gr;const S=new Gr;if(s.space==="left-posterior-superior"?S.set(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1):s.space==="left-anterior-superior"&&S.set(1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1),!s.vectors)m.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);else{const O=s.vectors,k=new Gr().set(O[0][0],O[1][0],O[2][0],0,O[0][1],O[1][1],O[2][1],0,O[0][2],O[1][2],O[2][2],0,0,0,0,1);m.matrix=new Gr().multiplyMatrices(k,S)}return m.inverseMatrix=new Gr,m.inverseMatrix.copy(m.matrix).invert(),m.RASDimensions=new Ce(m.xLength,m.yLength,m.zLength).applyMatrix4(m.matrix).round().toArray().map(Math.abs),m.lowerThreshold===-1/0&&(m.lowerThreshold=y),m.upperThreshold===1/0&&(m.upperThreshold=x),m}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,Lk.getVolumeOptions(this.props)),zG[s]=f,a(s,{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),a(s,{status:"error",message:p||`${f}`})}):a(s,{status:"error",message:`${f}`})})}}}render(){const{volumeId:n}=this.props;let r,i;if(!n)r=[C.jsx(Jt,{variant:"subtitle2",children:"Cannot display 3D volume"},"subtitle2"),C.jsx(Jt,{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"||!zG[n])&&(i=[C.jsx(Hr,{onClick:this.handleLoadVolume,disabled:!!o&&o.status==="loading",children:pe.get("Load Volume Data")},"load"),C.jsx(Jt,{variant:"body2",children:pe.get("Please note that the 3D volume rendering is still an experimental feature.")},"note")]),o&&(o.status==="loading"?r=C.jsx(Ly,{style:{margin:10}}):o.status==="error"&&(r=C.jsx(Jt,{variant:"body2",color:"red",children:`Failed loading volume: ${o.message}`})))}return r&&(r=C.jsx("div",{style:KEe,children:r})),i&&(i=C.jsx("div",{style:KEe,children:i})),C.jsxs("div",{style:A7n,children:[i,r,C.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:E7n}),!r&&!i&&k7n]})}updateVolumeScene(){const n=this.canvasRef.current;if(n===null){this.volumeScene=null;return}let r;this.props.volumeId&&(r=zG[this.props.volumeId]);let i=!1;(this.volumeScene===null||this.volumeScene.canvas!==n)&&(this.volumeScene=new o7n(n),i=!0),i&&r?this.volumeScene.setVolume(r,Lk.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(Lk.getVolumeOptions(this.props))}}function ZEe(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const o of t){const s=o[0],a=o[1];e=Math.min(e,s),n=Math.min(n,a),r=Math.max(r,s),i=Math.max(i,a)}return[e,n,r,i]}function P7n(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 lj={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}},M7n=({selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeId:i,volumeRenderMode:o,setVolumeRenderMode:s,volumeStates:a,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,g)=>{g!==null&&(s(g),e&&c(t.id,e.name,r,g,f))};return C.jsxs(vPe,{sx:lj.card,children:[C.jsx(yPe,{disableSpacing:!0,children:e&&C.jsxs(C.Fragment,{children:[C.jsxs(tO,{size:"small",exclusive:!0,value:o,onChange:h,children:[C.jsx(xr,{value:"mip",size:"small",children:C.jsx(Mt,{arrow:!0,title:"Maximum intensity projection",children:C.jsx("span",{children:"MIP"})})},"mip"),C.jsx(xr,{value:"aip",size:"small",children:C.jsx(Mt,{arrow:!0,title:"Average intensity projection",children:C.jsx("span",{children:"AIP"})})},"aip"),C.jsx(xr,{value:"iso",size:"small",children:C.jsx(Mt,{arrow:!0,title:"Iso-surface extraction",children:C.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&C.jsx(R7n,{minValue:e.colorBarMin,maxValue:e.colorBarMax,value:f,setValue:d})]})}),C.jsx(xPe,{sx:lj.cardContent,children:C.jsx(Lk,{selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:a,updateVolumeState:l,serverUrl:u})})]})},R7n=({value:t,minValue:e,maxValue:n,setValue:r,disabled:i})=>{const[o,s]=he.useState(t),[a,l]=he.useState(""+t),[c,u]=he.useState(null);function f(g){const m=g.target.value||"";l(m);const v=parseFloat(m);Number.isNaN(v)?u("Not a number"):vn?u("Out of range"):u(null)}function d(g){if(g.key==="Enter"&&!c){const m=parseFloat(a);s(m),r(m)}}function h(g,m){s(m),l(m.toFixed(2))}function p(g,m){r(m)}return C.jsx(Jr,{sx:lj.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:a,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:C.jsx(t1,{size:"small",sx:lj.isoSlider,min:e,max:n,value:o,step:(n-e)/20,onChange:h,onChangeCommitted:p})}})},D7n=t=>({locale:t.controlState.locale,selectedDataset:fo(t),selectedVariable:za(t),selectedPlaceInfo:ZM(t),variableColorBar:une(t),volumeRenderMode:t.controlState.volumeRenderMode,volumeId:sSt(t),volumeStates:t.controlState.volumeStates,serverUrl:zi(t).url}),I7n={setVolumeRenderMode:hZt,updateVolumeState:pZt,updateVariableVolume:GKt},L7n=Rn(D7n,I7n)(M7n),$7n={info:C.jsx(l9e,{fontSize:"inherit"}),timeSeries:C.jsx(khn,{fontSize:"inherit"}),stats:C.jsx(zWe,{fontSize:"inherit"}),volume:C.jsx(Ahn,{fontSize:"inherit"})},F7n={info:"Info",timeSeries:"Time-Series",stats:"Statistics",volume:"Volume"},D$={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"}},N7n=t=>({sidebarPanelId:t.controlState.sidebarPanelId}),z7n={setSidebarPanelId:ule};function j7n({sidebarPanelId:t,setSidebarPanelId:e}){const n=RIe(),r=D.useMemo(()=>n.panels||[],[n]),i=D.useMemo(()=>r.reduce((s,a,l)=>(s.set(a.name,l),s),new Map),[r]),o=D.useCallback((s,a)=>{e(a);const l=i.get(a);typeof l=="number"&&zCt("panels",l,{visible:!0})},[i,e]);return C.jsxs(ot,{sx:{width:"100%"},children:[C.jsx(ot,{sx:D$.tabBoxHeader,children:C.jsxs(O4,{value:t,onChange:o,variant:"scrollable",sx:D$.tabs,children:[zgt.map(s=>C.jsx(sb,{icon:$7n[s],iconPosition:"start",sx:D$.tab,disableRipple:!0,value:s,label:pe.get(F7n[s])},s)),r.map(s=>C.jsx(sb,{sx:D$.tab,disableRipple:!0,value:s.name,label:s.container.title},s.name))]})}),t==="info"&&C.jsx(F1n,{}),t==="stats"&&C.jsx(ZBn,{}),t==="timeSeries"&&C.jsx(NBn,{}),t==="volume"&&C.jsx(L7n,{}),r.map((s,a)=>t===s.name&&C.jsx(Phn,{contribution:s,panelIndex:a},s.name))]})}const B7n=Rn(N7n,z7n)(j7n),I$={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%"}},U7n=t=>({sidebarOpen:t.controlState.sidebarOpen,sidebarPosition:t.controlState.sidebarPosition}),W7n={setSidebarPosition:dZt},JEe=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function V7n({sidebarOpen:t,sidebarPosition:e,setSidebarPosition:n}){const[r,i]=D.useState(null),[o,s]=D.useState(JEe()),a=D.useRef(null),l=To();D.useEffect(()=>(c(),a.current=new ResizeObserver(c),a.current.observe(document.documentElement),()=>{a.current&&a.current.disconnect()}),[]),D.useEffect(()=>{r&&r.updateSize()},[r,e]);const c=()=>{s(JEe())},u=o==="hor"?"Hor":"Ver";return t?C.jsxs(cdn,{dir:o,splitPosition:e,setSplitPosition:n,style:I$["container"+u],child1Style:I$["viewer"+u],child2Style:I$["sidebar"+u],children:[C.jsx(f1e,{onMapRef:i,theme:l}),C.jsx(B7n,{})]}):C.jsx("div",{style:I$.viewer,children:C.jsx(f1e,{onMapRef:i,theme:l})})}const G7n=Rn(U7n,W7n)(V7n);var d8={exports:{}},LYe={};function $Ye(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,vc.findInArray)(t.changedTouches,n=>e===n.identifier)}function hGn(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function pGn(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 n7n(){try{const t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}}class r7n{constructor(){gn(this,"textures");this.textures={}}get(e,n){const r=uN(e);let i=this.textures[r];return i||(i=new Z9n().load(`data:image/png;base64,${e.imageData}`,n),this.textures[r]=i),i}}const i7n=new r7n;class o7n{constructor(e){gn(this,"canvas");gn(this,"camera");gn(this,"renderer");gn(this,"scene");gn(this,"material");if(!n7n())throw new Error("Missing WebGL2");this.render=this.render.bind(this);const n=new EYe({canvas:e});n.setPixelRatio(window.devicePixelRatio),n.setSize(e.clientWidth,e.clientHeight);const r=100,i=e.clientWidth/e.clientHeight,o=new wYe(-r*i,r*i,r,-r,-1e3,1e3);o.position.set(0,0,100),o.up.set(0,1,0);const s=new e7n(o,n.domElement);s.target.set(100,50,0),s.minZoom=.1,s.maxZoom=500,s.enablePan=!0,s.update(),this.canvas=e,this.renderer=n,this.camera=o,this.scene=null,this.material=null,s.addEventListener("change",this.render),e.addEventListener("resize",this.onCanvasResize)}setVolume(e,n){const r=new fYe(e.data,e.xLength,e.yLength,e.zLength);r.format=oYe,r.type=Ev,r.minFilter=r.magFilter=tl,r.unpackAlignment=1,r.needsUpdate=!0;const i=t7n,o=mYe.clone(i.uniforms),[s,a,l]=e.spacing,c=Math.floor(s*e.xLength),u=Math.floor(a*e.yLength),f=Math.floor(l*e.zLength);o.u_data.value=r,o.u_size.value.set(c,u,f);const d=new Ty({uniforms:o,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:mc}),h=new vE(c,u,f);h.translate(c/2,u/2,f/2);const p=new ah(h,d),g=new V9n;g.add(p),g.add(new J9n(p)),this.scene=g,this.material=d,this.setVolumeOptions(n)}setVolumeOptions(e){const n=this.material;if(n!==null){const{value1:r,value2:i,isoThreshold:o,renderMode:s,colorBar:a}=e,l=n.uniforms;l.u_clim.value.set(r,i),l.u_renderthreshold.value=o,l.u_renderstyle.value=s==="mip"?0:s==="aip"?1:2,l.u_cmdata.value=i7n.get(a,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 ic=Uint8Array,Tx=Uint16Array,kYe=Uint32Array,AYe=new ic([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]),PYe=new ic([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]),s7n=new ic([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),MYe=function(t,e){for(var n=new Tx(31),r=0;r<31;++r)n[r]=e+=1<>>1|(ii&21845)<<1;km=(km&52428)>>>2|(km&13107)<<2,km=(km&61680)>>>4|(km&3855)<<4,cJ[ii]=((km&65280)>>>8|(km&255)<<8)>>>1}var Dk=function(t,e,n){for(var r=t.length,i=0,o=new Tx(e);i>>l]=c}else for(a=new Tx(r),i=0;i>>15-t[i]);return a},OD=new ic(288);for(var ii=0;ii<144;++ii)OD[ii]=8;for(var ii=144;ii<256;++ii)OD[ii]=9;for(var ii=256;ii<280;++ii)OD[ii]=7;for(var ii=280;ii<288;++ii)OD[ii]=8;var IYe=new ic(32);for(var ii=0;ii<32;++ii)IYe[ii]=5;var u7n=Dk(OD,9,1),f7n=Dk(IYe,5,1),FG=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},tf=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},NG=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},d7n=function(t){return(t+7)/8|0},h7n=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t.BYTES_PER_ELEMENT==2?Tx:t.BYTES_PER_ELEMENT==4?kYe:ic)(n-e);return r.set(t.subarray(e,n)),r},p7n=["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"],Ip=function(t,e,n){var r=new Error(e||p7n[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Ip),!n)throw r;return r},g7n=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new ic(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new ic(r*3));var s=function(Y){var le=e.length;if(Y>le){var K=new ic(Math.max(le*2,Y));K.set(e),e=K}},a=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){a=tf(t,l,1);var g=tf(t,l+1,3);if(l+=3,g)if(g==1)u=u7n,f=f7n,d=9,h=5;else if(g==2){var x=tf(t,l,31)+257,b=tf(t,l+10,15)+4,w=x+tf(t,l+5,31)+1;l+=14;for(var _=new ic(w),S=new ic(19),O=0;O>>4;if(m<16)_[O++]=m;else{var R=0,T=0;for(m==16?(T=3+tf(t,l,3),l+=2,R=_[O-1]):m==17?(T=3+tf(t,l,7),l+=3):m==18&&(T=11+tf(t,l,127),l+=7);T--;)_[O++]=R}}var M=_.subarray(0,x),I=_.subarray(x);d=FG(M),h=FG(I),u=Dk(M,d,1),f=Dk(I,h,1)}else Ip(1);else{var m=d7n(l)+4,v=t[m-4]|t[m-3]<<8,y=m+v;if(y>r){o&&Ip(0);break}i&&s(c+v),e.set(t.subarray(m,y),c),n.b=c+=v,n.p=l=y*8,n.f=a;continue}if(l>p){o&&Ip(0);break}}i&&s(c+131072);for(var z=(1<>>4;if(l+=R&15,l>p){o&&Ip(0);break}if(R||Ip(2),L<256)e[c++]=L;else if(L==256){N=l,u=null;break}else{var B=L-254;if(L>264){var O=L-257,$=AYe[O];B=tf(t,l,(1<<$)-1)+DYe[O],l+=$}var j=f[NG(t,l)&F],X=j>>>4;j||Ip(3),l+=j&15;var I=c7n[X];if(X>3){var $=PYe[X];I+=NG(t,l)&(1<<$)-1,l+=$}if(l>p){o&&Ip(0);break}i&&s(c+131072);for(var V=c+B;c>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},y7n=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function x7n(t,e){return g7n(t.subarray(v7n(t),-8),new ic(y7n(t)))}var b7n=typeof TextDecoder<"u"&&new TextDecoder,w7n=0;try{b7n.decode(m7n,{stream:!0}),w7n=1}catch{}class _7n{constructor(e,n,r){const i=this;this.volume=e,n=n||0,Object.defineProperty(this,"index",{get:function(){return n},set:function(a){return n=a,i.geometryNeedsUpdate=!0,n}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const o=new kc(this.canvas);o.minFilter=tl,o.wrapS=o.wrapT=Jc;const s=new uue({map:o,side:rg,transparent:!0});this.mesh=new ah(this.geometry,s),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,s=this.ctxBuffer,a=s.getImageData(0,0,e,n),l=a.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 g=0;g=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 g=0;g=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++}s.putImageData(a,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 c8(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class S7n{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 uc,this.matrix.identity();let s=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return s},set:function(l){s=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}});let a=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return a},set:function(l){a=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,a].find(function(_){return Math.abs(_.dot(v[1]))>.9}),b=[l,c,a].find(function(_){return Math.abs(_.dot(v[2]))>.9});function w(_,S){const O=y===a?s:y.arglet==="i"?_:S,k=x===a?s:x.arglet==="i"?_:S,E=b===a?s:b.arglet==="i"?_:S,P=y.dot(v[0])>0?O:f.xLength-1-O,A=x.dot(v[1])>0?k:f.yLength-1-k,R=b.dot(v[2])>0?E:f.zLength-1-E;return f.access(P,A,R)}return{iLength:h,jLength:p,sliceAccess:w,matrix:u,planeWidth:g,planeHeight:m}}extractSlice(e,n){const r=new _7n(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,s={};function a(O,k){k==null&&(k=1);let E=1,P=Uint8Array;switch(O){case"uchar":break;case"schar":P=Int8Array;break;case"ushort":P=Uint16Array,E=2;break;case"sshort":P=Int16Array,E=2;break;case"uint":P=Uint32Array,E=4;break;case"sint":P=Int32Array,E=4;break;case"float":P=Float32Array,E=4;break;case"complex":P=Float64Array,E=8;break;case"double":P=Float64Array,E=8;break}let A=new P(n.slice(r,r+=k*E));return i!==o&&(A=l(A,E)),k===1?A[0]:A}function l(O,k){const E=new Uint8Array(O.buffer,O.byteOffset,O.byteLength);for(let P=0;PR;A--,R++){const T=E[R];E[R]=E[A],E[A]=T}return O}function c(O){let k,E,P,A,R,T,M,I;const z=O.split(/\r?\n/);for(M=0,I=z.length;M13)&&A!==32?P+=String.fromCharCode(A):(P!==""&&(M[I]=z(P,T),I++),P="");return P!==""&&(M[I]=z(P,T),I++),M}const f=a("uchar",e.byteLength),d=f.length;let h=null,p=0,g;for(g=1;gA[0]!==0),k=s.vectors.findIndex(A=>A[1]!==0),E=s.vectors.findIndex(A=>A[2]!==0),P=[];P[O]="x",P[k]="y",P[E]="z",m.axisOrder=P}else m.axisOrder=["x","y","z"];const b=new Ce().fromArray(s.vectors[0]).length(),w=new Ce().fromArray(s.vectors[1]).length(),_=new Ce().fromArray(s.vectors[2]).length();m.spacing=[b,w,_],m.matrix=new Gr;const S=new Gr;if(s.space==="left-posterior-superior"?S.set(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1):s.space==="left-anterior-superior"&&S.set(1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1),!s.vectors)m.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);else{const O=s.vectors,k=new Gr().set(O[0][0],O[1][0],O[2][0],0,O[0][1],O[1][1],O[2][1],0,O[0][2],O[1][2],O[2][2],0,0,0,0,1);m.matrix=new Gr().multiplyMatrices(k,S)}return m.inverseMatrix=new Gr,m.inverseMatrix.copy(m.matrix).invert(),m.RASDimensions=new Ce(m.xLength,m.yLength,m.zLength).applyMatrix4(m.matrix).round().toArray().map(Math.abs),m.lowerThreshold===-1/0&&(m.lowerThreshold=y),m.upperThreshold===1/0&&(m.upperThreshold=x),m}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,Ik.getVolumeOptions(this.props)),zG[s]=f,a(s,{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),a(s,{status:"error",message:p||`${f}`})}):a(s,{status:"error",message:`${f}`})})}}}render(){const{volumeId:n}=this.props;let r,i;if(!n)r=[C.jsx(Jt,{variant:"subtitle2",children:"Cannot display 3D volume"},"subtitle2"),C.jsx(Jt,{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"||!zG[n])&&(i=[C.jsx(Hr,{onClick:this.handleLoadVolume,disabled:!!o&&o.status==="loading",children:pe.get("Load Volume Data")},"load"),C.jsx(Jt,{variant:"body2",children:pe.get("Please note that the 3D volume rendering is still an experimental feature.")},"note")]),o&&(o.status==="loading"?r=C.jsx(Ly,{style:{margin:10}}):o.status==="error"&&(r=C.jsx(Jt,{variant:"body2",color:"red",children:`Failed loading volume: ${o.message}`})))}return r&&(r=C.jsx("div",{style:KEe,children:r})),i&&(i=C.jsx("div",{style:KEe,children:i})),C.jsxs("div",{style:A7n,children:[i,r,C.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:E7n}),!r&&!i&&k7n]})}updateVolumeScene(){const n=this.canvasRef.current;if(n===null){this.volumeScene=null;return}let r;this.props.volumeId&&(r=zG[this.props.volumeId]);let i=!1;(this.volumeScene===null||this.volumeScene.canvas!==n)&&(this.volumeScene=new o7n(n),i=!0),i&&r?this.volumeScene.setVolume(r,Ik.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(Ik.getVolumeOptions(this.props))}}function ZEe(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const o of t){const s=o[0],a=o[1];e=Math.min(e,s),n=Math.min(n,a),r=Math.max(r,s),i=Math.max(i,a)}return[e,n,r,i]}function P7n(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 lj={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}},M7n=({selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeId:i,volumeRenderMode:o,setVolumeRenderMode:s,volumeStates:a,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,g)=>{g!==null&&(s(g),e&&c(t.id,e.name,r,g,f))};return C.jsxs(vPe,{sx:lj.card,children:[C.jsx(yPe,{disableSpacing:!0,children:e&&C.jsxs(C.Fragment,{children:[C.jsxs(tO,{size:"small",exclusive:!0,value:o,onChange:h,children:[C.jsx(xr,{value:"mip",size:"small",children:C.jsx(Mt,{arrow:!0,title:"Maximum intensity projection",children:C.jsx("span",{children:"MIP"})})},"mip"),C.jsx(xr,{value:"aip",size:"small",children:C.jsx(Mt,{arrow:!0,title:"Average intensity projection",children:C.jsx("span",{children:"AIP"})})},"aip"),C.jsx(xr,{value:"iso",size:"small",children:C.jsx(Mt,{arrow:!0,title:"Iso-surface extraction",children:C.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&C.jsx(R7n,{minValue:e.colorBarMin,maxValue:e.colorBarMax,value:f,setValue:d})]})}),C.jsx(xPe,{sx:lj.cardContent,children:C.jsx(Ik,{selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:a,updateVolumeState:l,serverUrl:u})})]})},R7n=({value:t,minValue:e,maxValue:n,setValue:r,disabled:i})=>{const[o,s]=he.useState(t),[a,l]=he.useState(""+t),[c,u]=he.useState(null);function f(g){const m=g.target.value||"";l(m);const v=parseFloat(m);Number.isNaN(v)?u("Not a number"):vn?u("Out of range"):u(null)}function d(g){if(g.key==="Enter"&&!c){const m=parseFloat(a);s(m),r(m)}}function h(g,m){s(m),l(m.toFixed(2))}function p(g,m){r(m)}return C.jsx(Jr,{sx:lj.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:a,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:C.jsx(t1,{size:"small",sx:lj.isoSlider,min:e,max:n,value:o,step:(n-e)/20,onChange:h,onChangeCommitted:p})}})},D7n=t=>({locale:t.controlState.locale,selectedDataset:fo(t),selectedVariable:za(t),selectedPlaceInfo:ZM(t),variableColorBar:une(t),volumeRenderMode:t.controlState.volumeRenderMode,volumeId:sSt(t),volumeStates:t.controlState.volumeStates,serverUrl:zi(t).url}),I7n={setVolumeRenderMode:hZt,updateVolumeState:pZt,updateVariableVolume:GKt},L7n=Rn(D7n,I7n)(M7n),$7n={info:C.jsx(l9e,{fontSize:"inherit"}),timeSeries:C.jsx(khn,{fontSize:"inherit"}),stats:C.jsx(zWe,{fontSize:"inherit"}),volume:C.jsx(Ahn,{fontSize:"inherit"})},F7n={info:"Info",timeSeries:"Time-Series",stats:"Statistics",volume:"Volume"},D$={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"}},N7n=t=>({sidebarPanelId:t.controlState.sidebarPanelId}),z7n={setSidebarPanelId:ule};function j7n({sidebarPanelId:t,setSidebarPanelId:e}){const n=RIe(),r=D.useMemo(()=>n.panels||[],[n]),i=D.useMemo(()=>r.reduce((s,a,l)=>(s.set(a.name,l),s),new Map),[r]),o=D.useCallback((s,a)=>{e(a);const l=i.get(a);typeof l=="number"&&zCt("panels",l,{visible:!0})},[i,e]);return C.jsxs(ot,{sx:{width:"100%"},children:[C.jsx(ot,{sx:D$.tabBoxHeader,children:C.jsxs(O4,{value:t,onChange:o,variant:"scrollable",sx:D$.tabs,children:[zgt.map(s=>C.jsx(sb,{icon:$7n[s],iconPosition:"start",sx:D$.tab,disableRipple:!0,value:s,label:pe.get(F7n[s])},s)),r.map(s=>C.jsx(sb,{sx:D$.tab,disableRipple:!0,value:s.name,label:s.container.title},s.name))]})}),t==="info"&&C.jsx(F1n,{}),t==="stats"&&C.jsx(ZBn,{}),t==="timeSeries"&&C.jsx(NBn,{}),t==="volume"&&C.jsx(L7n,{}),r.map((s,a)=>t===s.name&&C.jsx(Phn,{contribution:s,panelIndex:a},s.name))]})}const B7n=Rn(N7n,z7n)(j7n),I$={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%"}},U7n=t=>({sidebarOpen:t.controlState.sidebarOpen,sidebarPosition:t.controlState.sidebarPosition}),W7n={setSidebarPosition:dZt},JEe=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function V7n({sidebarOpen:t,sidebarPosition:e,setSidebarPosition:n}){const[r,i]=D.useState(null),[o,s]=D.useState(JEe()),a=D.useRef(null),l=To();D.useEffect(()=>(c(),a.current=new ResizeObserver(c),a.current.observe(document.documentElement),()=>{a.current&&a.current.disconnect()}),[]),D.useEffect(()=>{r&&r.updateSize()},[r,e]);const c=()=>{s(JEe())},u=o==="hor"?"Hor":"Ver";return t?C.jsxs(cdn,{dir:o,splitPosition:e,setSplitPosition:n,style:I$["container"+u],child1Style:I$["viewer"+u],child2Style:I$["sidebar"+u],children:[C.jsx(f1e,{onMapRef:i,theme:l}),C.jsx(B7n,{})]}):C.jsx("div",{style:I$.viewer,children:C.jsx(f1e,{onMapRef:i,theme:l})})}const G7n=Rn(U7n,W7n)(V7n);var d8={exports:{}},LYe={};function $Ye(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,vc.findInArray)(t.changedTouches,n=>e===n.identifier)}function hGn(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function pGn(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&&BYe(t.body,"react-draggable-transparent-selection")}function gGn(t){if(t)try{if(t.body&&UYe(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 BYe(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function UYe(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.canDragX=yGn;ap.canDragY=xGn;ap.createCoreData=wGn;ap.createDraggableData=_Gn;ap.getBoundPosition=mGn;ap.getControlPosition=bGn;ap.snapToGrid=vGn;var Wl=sp,E_=ji;function mGn(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:SGn(r);const i=hue(t);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),u=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Wl.int)(u.paddingLeft)+(0,Wl.int)(c.marginLeft),top:-i.offsetTop+(0,Wl.int)(u.paddingTop)+(0,Wl.int)(c.marginTop),right:(0,E_.innerWidth)(l)-(0,E_.outerWidth)(i)-i.offsetLeft+(0,Wl.int)(u.paddingRight)-(0,Wl.int)(c.marginRight),bottom:(0,E_.innerHeight)(l)-(0,E_.outerHeight)(i)-i.offsetTop+(0,Wl.int)(u.paddingBottom)-(0,Wl.int)(c.marginBottom)}}return(0,Wl.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,Wl.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Wl.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,Wl.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function vGn(t,e,n){const r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]}function yGn(t){return t.props.axis==="both"||t.props.axis==="x"}function xGn(t){return t.props.axis==="both"||t.props.axis==="y"}function bGn(t,e,n){const r=typeof e=="number"?(0,E_.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const i=hue(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,E_.offsetXYFromParent)(r||t,o,n.props.scale)}function wGn(t,e,n){const r=!(0,Wl.isNum)(t.lastX),i=hue(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 _Gn(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 SGn(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function hue(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var h8={},p8={};Object.defineProperty(p8,"__esModule",{value:!0});p8.default=CGn;function CGn(){}Object.defineProperty(h8,"__esModule",{value:!0});h8.default=void 0;var BG=EGn(D),Ua=pue(hM),OGn=pue(KC),Ds=ji,Am=ap,UG=sp,j2=pue(p8);function pue(t){return t&&t.__esModule?t:{default:t}}function WYe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(WYe=function(r){return r?n:e})(t)}function EGn(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=WYe(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 s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function ha(t,e,n){return e=TGn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TGn(t){var e=kGn(t,"string");return typeof e=="symbol"?e:String(e)}function kGn(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 of={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Pm=of.mouse,g8=class extends BG.Component{constructor(){super(...arguments),ha(this,"dragging",!1),ha(this,"lastX",NaN),ha(this,"lastY",NaN),ha(this,"touchIdentifier",null),ha(this,"mounted",!1),ha(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,Ds.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,Ds.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const i=(0,Ds.getTouchIdentifier)(e);this.touchIdentifier=i;const o=(0,Am.getControlPosition)(e,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,Am.createCoreData)(this,s,a);(0,j2.default)("DraggableCore: handleDragStart: %j",l),(0,j2.default)("calling",this.props.onStart),!(this.props.onStart(e,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Ds.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Ds.addEvent)(r,Pm.move,this.handleDrag),(0,Ds.addEvent)(r,Pm.stop,this.handleDragStop))}),ha(this,"handleDrag",e=>{const n=(0,Am.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,Am.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,Am.createCoreData)(this,r,i);if((0,j2.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}),ha(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Am.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,Am.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Am.createCoreData)(this,r,i);if(this.props.onStop(e,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Ds.removeUserSelectStyles)(a.ownerDocument),(0,j2.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,j2.default)("DraggableCore: Removing handlers"),(0,Ds.removeEvent)(a.ownerDocument,Pm.move,this.handleDrag),(0,Ds.removeEvent)(a.ownerDocument,Pm.stop,this.handleDragStop))}),ha(this,"onMouseDown",e=>(Pm=of.mouse,this.handleDragStart(e))),ha(this,"onMouseUp",e=>(Pm=of.mouse,this.handleDragStop(e))),ha(this,"onTouchStart",e=>(Pm=of.touch,this.handleDragStart(e))),ha(this,"onTouchEnd",e=>(Pm=of.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,Ds.addEvent)(e,of.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,Ds.removeEvent)(n,of.mouse.move,this.handleDrag),(0,Ds.removeEvent)(n,of.touch.move,this.handleDrag),(0,Ds.removeEvent)(n,of.mouse.stop,this.handleDragStop),(0,Ds.removeEvent)(n,of.touch.stop,this.handleDragStop),(0,Ds.removeEvent)(e,of.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Ds.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:OGn.default.findDOMNode(this)}render(){return BG.cloneElement(BG.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};h8.default=g8;ha(g8,"displayName","DraggableCore");ha(g8,"propTypes",{allowAnyClick:Ua.default.bool,children:Ua.default.node.isRequired,disabled:Ua.default.bool,enableUserSelectHack:Ua.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:Ua.default.arrayOf(Ua.default.number),handle:Ua.default.string,cancel:Ua.default.string,nodeRef:Ua.default.object,onStart:Ua.default.func,onDrag:Ua.default.func,onStop:Ua.default.func,onMouseDown:Ua.default.func,scale:Ua.default.number,className:UG.dontSetMe,style:UG.dontSetMe,transform:UG.dontSetMe});ha(g8,"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(D),n=u(hM),r=u(KC),i=u(q7n),o=ji,s=ap,a=sp,l=u(h8),c=u(p8);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(w){return w?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 w={},_=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in y)if(S!=="default"&&Object.prototype.hasOwnProperty.call(y,S)){var O=_?Object.getOwnPropertyDescriptor(y,S):null;O&&(O.get||O.set)?Object.defineProperty(w,S,O):w[S]=y[S]}return w.default=y,b&&b.set(y,w),w}function h(){return h=Object.assign?Object.assign.bind():function(y){for(var x=1;x{if((0,c.default)("Draggable: onDragStart: %j",w),this.props.onStart(b,(0,s.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(b,w)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",w);const _=(0,s.createDraggableData)(this,w),S={x:_.x,y:_.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=S;S.x+=this.state.slackX,S.y+=this.state.slackY;const[P,A]=(0,s.getBoundPosition)(this,S.x,S.y);S.x=P,S.y=A,S.slackX=this.state.slackX+(k-S.x),S.slackY=this.state.slackY+(E-S.y),_.x=S.x,_.y=S.y,_.deltaX=S.x-this.state.x,_.deltaY=S.y-this.state.y}if(this.props.onDrag(b,_)===!1)return!1;this.setState(S)}),p(this,"onDragStop",(b,w)=>{if(!this.state.dragging||this.props.onStop(b,(0,s.createDraggableData)(this,w))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",w);const S={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:k,y:E}=this.props.position;S.x=k,S.y=E}this.setState(S)}),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:w,defaultPosition:_,defaultClassName:S,defaultClassNameDragging:O,defaultClassNameDragged:k,position:E,positionOffset:P,scale:A,...R}=this.props;let T={},M=null;const z=!!!E||this.state.dragging,F=E||_,N={x:(0,s.canDragX)(this)&&z?this.state.x:F.x,y:(0,s.canDragY)(this)&&z?this.state.y:F.y};this.state.isElementSVG?M=(0,o.createSVGTransform)(N,P):T=(0,o.createCSSTransform)(N,P);const L=(0,i.default)(w.props.className||"",S,{[O]:this.state.dragging,[k]:this.state.dragged});return e.createElement(l.default,h({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(w),{className:L,style:{...w.props.style,...T},transform:M}))}}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:a.dontSetMe,style:a.dontSetMe,transform:a.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})})(LYe);const{default:VYe,DraggableCore:AGn}=LYe;d8.exports=VYe;d8.exports.default=VYe;d8.exports.DraggableCore=AGn;var GYe=d8.exports;const PGn=sn(GYe);var gue={exports:{}},ED={},mue={};mue.__esModule=!0;mue.cloneElement=$Gn;var MGn=RGn(D);function RGn(t){return t&&t.__esModule?t:{default:t}}function n2e(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 r2e(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function i2e(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 WG(t){for(var e=1;eMath.abs(d*u)?o=i/u:i=o*u}var h=i,p=o,g=this.slack||[0,0],m=g[0],v=g[1];return i+=m,o+=v,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[m+(h-i),v+(p-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var d=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!d&&!h)){var p=o[0],g=o[o.length-1],m=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var v=m.left-s.lastHandleRect.left;u+=v}if(p==="n"){var y=m.top-s.lastHandleRect.top;f+=y}}s.lastHandleRect=m,g==="w"&&(u=-u),p==="n"&&(f=-f);var x=s.props.width+(d?u/s.props.transformScale:0),b=s.props.height+(h?f/s.props.transformScale:0),w=s.runConstraints(x,b);x=w[0],b=w[1];var _=x!==s.props.width||b!==s.props.height,S=typeof s.props[i]=="function"?s.props[i]:null,O=i==="onResize"&&!_;S&&!O&&(a.persist==null||a.persist(),S(a,{node:c,size:{width:x,height:b},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return B2.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=WG({ref:o},a?{}:{handleAxis:i});return B2.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=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=VGn(o,UGn);return(0,jGn.cloneElement)(s,WG(WG({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var d,h=(d=i.handleRefs[f])!=null?d:i.handleRefs[f]=B2.createRef();return B2.createElement(zGn.DraggableCore,uJ({},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}(B2.Component);ED.default=vue;vue.propTypes=BGn.resizableProps;vue.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var m8={};m8.__esModule=!0;m8.default=void 0;var VG=JGn(D),YGn=qYe(hM),QGn=qYe(ED),KGn=TD,ZGn=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function qYe(t){return t&&t.__esModule?t:{default:t}}function XYe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(XYe=function(i){return i?n:e})(t)}function JGn(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=XYe(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 s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function dJ(){return dJ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function iHn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,hJ(t,e)}function hJ(t,e){return hJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},hJ(t,e)}var YYe=function(t){iHn(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),s=0;sn(t,!i.visible)}),r?C.jsx(zf,{}):C.jsx(zf,{variant:"inset",component:"li",style:{margin:"0 0 0 52px"}})]})}const sHn={x:48,y:128},aHn={width:320,height:520},$$={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 lHn(t){const[e,n]=D.useState(sHn),[r,i]=D.useState(aHn),{layerMenuOpen:o,setLayerMenuOpen:s,openDialog:a,...l}=t;if(!o)return null;console.log("layerProps",l);const c=()=>{a("userOverlays")},u=()=>{a("userBaseMaps")},f=()=>{s(!1)},d=(p,g)=>{n({...g})},h=(p,g)=>{i({...g.size})};return C.jsx(PGn,{handle:"#layer-select-header",position:e,onStop:d,children:C.jsx(oHn,{width:r.width,height:r.height,style:$$.resizeBox,onResize:h,children:C.jsxs(kl,{elevation:10,sx:$$.windowPaper,component:"div",children:[C.jsxs(ot,{id:"layer-select-header",sx:$$.windowHeader,children:[C.jsx(ot,{component:"span",sx:$$.windowTitle,children:pe.get("Layers")}),C.jsx(Gt,{size:"small",onClick:f,children:C.jsx(GO,{fontSize:"inherit"})})]}),C.jsx(ot,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:C.jsxs(w4,{dense:!0,children:[C.jsx(Sp,{layerId:"overlay",...l}),C.jsx(Sp,{layerId:"userPlaces",...l}),C.jsx(Sp,{layerId:"datasetPlaces",...l}),C.jsx(Sp,{layerId:"datasetBoundary",...l}),C.jsx(Sp,{layerId:"datasetVariable",...l}),C.jsx(Sp,{layerId:"datasetVariable2",...l}),C.jsx(Sp,{layerId:"datasetRgb",...l}),C.jsx(Sp,{layerId:"datasetRgb2",...l}),C.jsx(Sp,{layerId:"baseMap",...l,last:!0}),C.jsx(Br,{onClick:u,children:pe.get("User Base Maps")+"..."}),C.jsx(Br,{onClick:c,children:pe.get("User Overlays")+"..."})]})})]})})})}const cHn=t=>({locale:t.controlState.locale,layerMenuOpen:t.controlState.layerMenuOpen,layerStates:FSt(t)}),uHn={openDialog:T1,setLayerMenuOpen:k8e,setLayerVisibility:iZt},fHn=Rn(cHn,uHn)(lHn),dHn=t=>({locale:t.controlState.locale,hasConsent:t.controlState.privacyNoticeAccepted,compact:Pn.instance.branding.compact}),hHn={},pHn=be("main")(({theme:t})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[t.breakpoints.up("md")]:{overflow:"hidden"}})),gHn=({hasConsent:t,compact:e})=>C.jsxs(pHn,{children:[!e&&C.jsx(C4,{variant:"dense"}),t&&C.jsxs(C.Fragment,{children:[C.jsx(adn,{}),C.jsx(G7n,{}),C.jsx(fHn,{})]})]}),mHn=Rn(dHn,hHn)(gHn),vHn={icon:t=>({marginRight:t.spacing(2)})};function yHn({open:t,settings:e,updateSettings:n,syncWithServer:r}){const[i,o]=D.useState(null),{store:s}=D.useContext(kj);if(D.useEffect(()=>{const c=pe.get("docs/privacy-note.en.md");fetch(c).then(u=>u.text()).then(u=>o(u))}),!t)return null;function a(){n({...e,privacyNoticeAccepted:!0}),r(s)}function l(){try{window.history.length>0?window.history.back():typeof window.home=="function"?window.home():window.location.href="about:home"}catch(c){console.error(c)}}return C.jsxs(ed,{open:t,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[C.jsx($y,{children:pe.get("Privacy Notice")}),C.jsx(Nf,{children:C.jsx(Vat,{children:i===null?C.jsx(Ly,{}):C.jsx(Cle,{text:i})})}),C.jsxs(Jb,{children:[C.jsxs(Hr,{onClick:a,children:[C.jsx(QYe,{sx:vHn.icon}),pe.get("Accept and continue")]}),C.jsx(Hr,{onClick:l,children:pe.get("Leave")})]})]})}const xHn=t=>({open:!t.controlState.privacyNoticeAccepted,settings:t.controlState}),bHn={updateSettings:KR,syncWithServer:sle},wHn=Rn(xHn,bHn)(yHn),_Hn=oa(Ly)(({theme:t})=>({margin:t.spacing(2)})),SHn=oa(Jt)(({theme:t})=>({margin:t.spacing(1)})),CHn=oa("div")(({theme:t})=>({margin:t.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function OHn({messages:t}){return t.length===0?null:C.jsxs(ed,{open:!0,"aria-labelledby":"loading",children:[C.jsx($y,{id:"loading",children:pe.get("Please wait...")}),C.jsxs(CHn,{children:[C.jsx(_Hn,{}),t.map((e,n)=>C.jsx(SHn,{children:e},n))]})]})}const EHn=t=>({locale:t.controlState.locale,messages:RSt(t)}),THn={},kHn=Rn(EHn,THn)(OHn),AHn=lt(C.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"),PHn=lt(C.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),MHn=lt(C.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"),RHn={success:MHn,warning:PHn,error:AHn,info:l9e},DHn=oa("span")(()=>({display:"flex",alignItems:"center"})),F$={close:{p:.5},success:t=>({color:t.palette.error.contrastText,backgroundColor:$p[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:iAe[700]}),icon:{fontSize:20},iconVariant:t=>({opacity:.9,marginRight:t.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},IHn={vertical:"bottom",horizontal:"center"};function LHn({className:t,message:e,hideMessage:n}){const r=()=>{n(e.id)};if(!e)return null;const i=RHn[e.type];return C.jsx(eft,{open:!0,anchorOrigin:IHn,autoHideDuration:5e3,onClose:r,children:C.jsx($Pe,{sx:F$[e.type],className:t,"aria-describedby":"client-snackbar",message:C.jsxs(DHn,{id:"client-snackbar",children:[C.jsx(i,{sx:F$.iconVariant}),e.text]}),action:[C.jsx(Gt,{"aria-label":"Close",color:"inherit",sx:F$.close,onClick:r,size:"large",children:C.jsx(GO,{sx:F$.icon})},"close")]})},e.type+":"+e.text)}const $Hn=t=>{const e=t.messageLogState.newEntries;return{locale:t.controlState.locale,message:e.length>0?e[0]:null}},FHn={hideMessage:JQt},NHn=Rn($Hn,FHn)(LHn),pJ=lt(C.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),ZYe=lt(C.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"),Dw={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 zHn({open:t,servers:e,selectedServer:n,closeDialog:r,configureServers:i}){const o=D.useRef(!1),[s,a]=D.useState(e),[l,c]=D.useState(n),[u,f]=D.useState("select");D.useEffect(()=>{o.current&&(a(e),c(n)),o.current=!0},[e,n]);const{store:d}=D.useContext(kj),h=()=>{u==="select"?(r("server"),i(s,l.id,d)):u==="add"?E():u==="edit"&&P()},p=()=>{u==="select"?_():A()},g=()=>{_()},m=F=>{const N=F.target.value,L=s.find(B=>B.id===N);c(L)},v=F=>{const N=F.target.value,L={...l,name:N};c(L)},y=F=>{const N=F.target.value,L={...l,url:N};c(L)},x=()=>{f("add")},b=()=>{f("edit")},w=()=>{R()},_=()=>{r("server")},S=()=>{const F=l.id;return s.findIndex(N=>N.id===F)},O=(F,N)=>{const L=[...s];L[F]=N,a(L),c(N),f("select")},k=(F,N)=>{a(F),c(N),f("select")},E=()=>{const F={...l,id:Uf("server-")},N=[...s,F];k(N,F)},P=()=>{O(S(),{...l})},A=()=>{const F=S();O(S(),s[F])},R=()=>{const F=[...s];if(F.length<2)throw new Error("internal error: server list cannot be emptied");const N=S(),L=F[N+(N>0?-1:1)];F.splice(N,1),k(F,L)},T=s.map((F,N)=>C.jsx(Br,{value:F.id,children:F.name},N));let M;u==="add"?M=pe.get("Add"):u==="edit"?M=pe.get("Save"):M=pe.get("OK");let I;u==="add"?I=pe.get("Add Server"):u==="edit"?I=pe.get("Edit Server"):I=pe.get("Select Server");let z;return u==="add"||u==="edit"?z=C.jsxs(Nf,{dividers:!0,children:[C.jsx(Jr,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:Dw.textField,margin:"normal",value:l.name,onChange:v}),C.jsx("br",{}),C.jsx(Jr,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:Dw.textField2,margin:"normal",value:l.url,onChange:y})]}):z=C.jsx(Nf,{dividers:!0,children:C.jsxs("div",{children:[C.jsxs(td,{variant:"standard",sx:Dw.formControl,children:[C.jsx(Fy,{htmlFor:"server-name",children:"Name"}),C.jsx(Hg,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:T}),C.jsx(Xee,{children:l.url})]}),C.jsx(Gt,{sx:Dw.button,"aria-label":"Add",color:"primary",onClick:x,size:"large",children:C.jsx(pJ,{fontSize:"small"})}),C.jsx(Gt,{sx:Dw.button,"aria-label":"Edit",onClick:b,size:"large",children:C.jsx(XO,{fontSize:"small"})}),C.jsx(Gt,{sx:Dw.button,"aria-label":"Delete",disabled:s.length<2,onClick:w,size:"large",children:C.jsx(ZYe,{fontSize:"small"})})]})}),C.jsxs(ed,{open:t,onClose:g,"aria-labelledby":"server-dialog-title",children:[C.jsx($y,{id:"server-dialog-title",children:I}),z,C.jsxs(Jb,{children:[C.jsx(Hr,{onClick:p,children:pe.get("Cancel")}),C.jsx(Hr,{onClick:h,autoFocus:!0,children:M})]})]})}const jHn=t=>({open:!!t.controlState.dialogOpen.server,servers:MDe(t),selectedServer:zi(t)}),BHn={closeDialog:VO,configureServers:FKt},UHn=Rn(jHn,BHn)(zHn),s2e=({anchorElement:t,layers:e,selectedLayerId:n,setSelectedLayerId:r,onClose:i})=>C.jsx(Ny,{anchorEl:t,keepMounted:!0,open:!!t,onClose:i,children:t&&e.map(o=>C.jsx(Br,{selected:o.id===n,onClick:()=>r(o.id===n?null:o.id),dense:!0,children:C.jsx(fu,{primary:BF(o)})},o.id))}),GG={settingsPanelTitle:t=>({marginBottom:t.spacing(1)}),settingsPanelPaper:t=>({backgroundColor:(t.palette.mode==="dark"?Eh:Oh)(t.palette.background.paper,.1),marginBottom:t.spacing(2)}),settingsPanelList:{margin:0}},qw=({title:t,children:e})=>{const n=he.Children.count(e),r=[];return he.Children.forEach(e,(i,o)=>{r.push(i),o{let i;e||(i={marginBottom:10});const o=C.jsx(fu,{primary:t,secondary:e});let s;return r&&(s=C.jsx(aA,{children:r})),n?C.jsxs(TPe,{style:i,onClick:n,children:[o,s]}):C.jsxs($_,{style:i,children:[o,s]})},Tv=({propertyName:t,settings:e,updateSettings:n,disabled:r})=>C.jsx(Zee,{checked:!!e[t],onChange:()=>n({...e,[t]:!e[t]}),disabled:r}),WHn=({propertyName:t,settings:e,updateSettings:n,options:r,disabled:i})=>{const o=(s,a)=>{n({...e,[t]:a})};return C.jsx(_4,{row:!0,value:e[t],onChange:o,children:r.map(([s,a])=>C.jsx(sg,{control:C.jsx(F_,{}),value:a,label:s,disabled:i},s))})},Iw={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}},a2e=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],VHn=[["point","Points"],["line","Lines"],["bar","Bars"]],GHn=({open:t,closeDialog:e,settings:n,selectedServer:r,baseMapLayers:i,overlayLayers:o,updateSettings:s,changeLocale:a,openDialog:l,viewerVersion:c,serverInfo:u})=>{const[f,d]=he.useState(null),[h,p]=he.useState(null),[g,m]=he.useState(null),[v,y]=he.useState(n.timeChunkSize+""),x=To();if(he.useEffect(()=>{const V=parseInt(v);!Number.isNaN(V)&&V!==n.timeChunkSize&&s({timeChunkSize:V})},[v,n,s]),!t)return null;function b(){e("settings")}function w(){l("server")}function _(V){s({timeAnimationInterval:parseInt(V.target.value)})}function S(V){s({timeSeriesChartTypeDefault:V.target.value})}function O(V){s({datasetLocateMode:V.target.value})}function k(V){s({placeLocateMode:V.target.value})}function E(V){y(V.target.value)}let P=null;f&&(P=Object.getOwnPropertyNames(pe.languages).map(V=>{const Y=pe.languages[V];return C.jsx(Br,{selected:V===n.locale,onClick:()=>a(V),children:C.jsx(fu,{primary:Y})},V)}));function A(V){d(V.currentTarget)}function R(){d(null)}function T(V){p(V.currentTarget)}function M(){p(null)}const I=V=>{V.stopPropagation(),l("userBaseMaps")},z=UF(i,n.selectedBaseMapId),F=BF(z);function N(V){m(V.currentTarget)}function L(){m(null)}const B=V=>{V.stopPropagation(),l("userOverlays")};function $(V){s({themeMode:V.target.value})}const j=UF(o,n.selectedOverlayId),X=BF(j);return C.jsxs("div",{children:[C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"sm",onClose:b,scroll:"body",children:[C.jsx($y,{children:pe.get("Settings")}),C.jsxs(Nf,{children:[C.jsxs(qw,{title:pe.get("General"),children:[C.jsx(ci,{label:pe.get("Server"),value:r.name,onClick:w}),C.jsx(ci,{label:pe.get("Language"),value:pe.languages[n.locale],onClick:A}),C.jsx(ci,{label:pe.get("Time interval of the player"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.timeAnimationInterval,onChange:_,margin:"normal",children:Ngt.map((V,Y)=>C.jsx(Br,{value:V,children:V+" ms"},Y))})}),C.jsx(ci,{label:pe.get("Appearance mode"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.themeMode||x.palette.mode,onChange:$,margin:"normal",children:jgt.map(([V,Y])=>C.jsx(Br,{value:V,children:pe.get(Y)},V))})})]}),C.jsxs(qw,{title:pe.get("Time-Series"),children:[C.jsx(ci,{label:pe.get("Show chart after adding a place"),value:N$(n.autoShowTimeSeries),children:C.jsx(Tv,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:s})}),C.jsx(ci,{label:pe.get("Default chart type"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.timeSeriesChartTypeDefault,onChange:S,margin:"normal",children:VHn.map(([V,Y])=>C.jsx(Br,{value:V,children:pe.get(Y)},V))})}),C.jsx(ci,{label:pe.get("Calculate standard deviation"),value:N$(n.timeSeriesIncludeStdev),children:C.jsx(Tv,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:s})}),C.jsx(ci,{label:pe.get("Calculate median instead of mean (disables standard deviation)"),value:N$(n.timeSeriesUseMedian),children:C.jsx(Tv,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:s})}),C.jsx(ci,{label:pe.get("Minimal number of data points in a time series update"),children:C.jsx(Jr,{variant:"standard",sx:Iw.intTextField,value:v,onChange:E,margin:"normal",size:"small"})})]}),C.jsxs(qw,{title:pe.get("Map"),children:[C.jsx(ci,{label:pe.get("Base map"),value:F,onClick:T,children:C.jsx(Hr,{onClick:I,children:pe.get("User Base Maps")+"..."})}),C.jsx(ci,{label:pe.get("Overlay"),value:X,onClick:N,children:C.jsx(Hr,{onClick:B,children:pe.get("User Overlays")+"..."})}),C.jsx(ci,{label:pe.get("Projection"),children:C.jsx(WHn,{propertyName:"mapProjection",settings:n,updateSettings:s,options:[[pe.get("Geographic"),rO],[pe.get("Mercator"),ite]]})}),C.jsx(ci,{label:pe.get("Image smoothing"),value:N$(n.imageSmoothingEnabled),children:C.jsx(Tv,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:s})}),C.jsx(ci,{label:pe.get("On dataset selection"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.datasetLocateMode,onChange:O,margin:"normal",children:a2e.map(([V,Y])=>C.jsx(Br,{value:V,children:pe.get(Y)},V))})}),C.jsx(ci,{label:pe.get("On place selection"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.placeLocateMode,onChange:k,margin:"normal",children:a2e.map(([V,Y])=>C.jsx(Br,{value:V,children:pe.get(Y)},V))})})]}),C.jsx(qw,{title:pe.get("Legal Agreement"),children:C.jsx(ci,{label:pe.get("Privacy notice"),value:n.privacyNoticeAccepted?pe.get("Accepted"):"",children:C.jsx(Hr,{disabled:!n.privacyNoticeAccepted,onClick:()=>{s({privacyNoticeAccepted:!1}),window.location.reload()},children:pe.get("Revoke consent")})})}),C.jsxs(qw,{title:pe.get("System Information"),children:[C.jsx(ci,{label:`xcube Viewer ${pe.get("version")}`,value:c}),C.jsx(ci,{label:`xcube Server ${pe.get("version")}`,value:u?u.version:pe.get("Cannot reach server")})]})]})]}),C.jsx(Ny,{anchorEl:f,keepMounted:!0,open:!!f,onClose:R,children:P}),C.jsx(s2e,{anchorElement:h,layers:i,selectedLayerId:n.selectedBaseMapId,setSelectedLayerId:V=>s({selectedBaseMapId:V}),onClose:M}),C.jsx(s2e,{anchorElement:g,layers:o,selectedLayerId:n.selectedOverlayId,setSelectedLayerId:V=>s({selectedOverlayId:V}),onClose:L})]})},N$=t=>t?pe.get("On"):pe.get("Off"),HHn=t=>({locale:t.controlState.locale,open:t.controlState.dialogOpen.settings,settings:t.controlState,baseMapLayers:hne(t),overlayLayers:pne(t),selectedServer:zi(t),viewerVersion:zUe,serverInfo:t.dataState.serverInfo}),qHn={closeDialog:VO,updateSettings:KR,changeLocale:z8e,openDialog:T1},XHn=Rn(HHn,qHn)(GHn),l2e={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})},YHn=({open:t,closeDialog:e,settings:n,updateSettings:r,downloadTimeSeries:i})=>{const o=()=>{e("export")};function s(c){r({exportFileName:c.target.value})}function a(c){r({exportTimeSeriesSeparator:c.target.value})}const l=()=>{o(),i()};return C.jsx("div",{children:C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[C.jsx(Nf,{children:C.jsxs(qw,{title:pe.get("Export Settings"),children:[C.jsx(ci,{label:pe.get("Include time-series data")+" (*.txt)",value:z$(n.exportTimeSeries),children:C.jsx(Tv,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),C.jsx(ci,{label:pe.get("Separator for time-series data"),children:C.jsx(Jr,{variant:"standard",sx:l2e.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:a,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),C.jsx(ci,{label:pe.get("Include places data")+" (*.geojson)",value:z$(n.exportPlaces),children:C.jsx(Tv,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),C.jsx(ci,{label:pe.get("Combine place data in one file"),value:z$(n.exportPlacesAsCollection),children:C.jsx(Tv,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),C.jsx(ci,{label:pe.get("As ZIP archive"),value:z$(n.exportZipArchive),children:C.jsx(Tv,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),C.jsx(ci,{label:pe.get("File name"),children:C.jsx(Jr,{variant:"standard",sx:l2e.fileNameTextField,value:n.exportFileName,onChange:s,margin:"normal",size:"small"})})]})}),C.jsx(Jb,{children:C.jsx(Hr,{onClick:l,disabled:!ZHn(n),children:pe.get("Download")})})]})})},z$=t=>t?pe.get("On"):pe.get("Off"),QHn=t=>/^[0-9a-zA-Z_-]+$/.test(t),KHn=t=>t.toUpperCase()==="TAB"||t.length===1,ZHn=t=>(t.exportTimeSeries||t.exportPlaces)&&QHn(t.exportFileName)&&(!t.exportTimeSeries||KHn(t.exportTimeSeriesSeparator)),JHn=t=>({locale:t.controlState.locale,open:!!t.controlState.dialogOpen.export,settings:t.controlState}),eqn={closeDialog:VO,updateSettings:KR,downloadTimeSeries:HKt},tqn=Rn(JHn,eqn)(YHn),nqn=lt(C.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),rqn=lt(C.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),iqn=({title:t,accept:e,multiple:n,disabled:r,onSelect:i,className:o})=>{const s=D.useRef(null),a=c=>{if(c.target.files!==null&&c.target.files.length){const u=[];for(let f=0;f{s.current!==null&&s.current.click()};return C.jsxs(C.Fragment,{children:[C.jsx("input",{type:"file",accept:e,multiple:n,ref:s,hidden:!0,onChange:a,disabled:r}),C.jsx(Hr,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:t})]})},HG={parse:t=>t,format:t=>typeof t=="string"?t:`${t}`,validate:t=>!0};function yue(){return t=>{const{options:e,updateOptions:n,optionKey:r,label:i,style:o,className:s,disabled:a,parse:l,format:c,validate:u}=t,f=e[r],d=h=>{const p=h.target.value,g=(l||HG.parse)(p);n({[r]:g})};return C.jsx(Jr,{label:pe.get(i),value:(c||HG.format)(f),error:!(u||HG.validate)(f),onChange:d,style:o,className:s,disabled:a,size:"small",variant:"standard"})}}const U2=yue(),oqn=oa("div")(({theme:t})=>({paddingTop:t.spacing(2)})),sqn=({options:t,updateOptions:e})=>C.jsx(oqn,{children:C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(U2,{optionKey:"timeNames",label:"Time property names",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(U2,{label:"Group property names",optionKey:"groupNames",options:t,updateOptions:e}),C.jsx(U2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e}),C.jsx(U2,{label:"Label property names",optionKey:"labelNames",options:t,updateOptions:e}),C.jsx(U2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e})]})}),fa=yue(),aqn=oa("div")(({theme:t})=>({paddingTop:t.spacing(2)})),lqn=({options:t,updateOptions:e})=>{const n=t.forceGeometry;return C.jsxs(aqn,{children:[C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(fa,{optionKey:"xNames",label:"X/longitude column names",options:t,updateOptions:e,disabled:n}),C.jsx(fa,{optionKey:"yNames",label:"Y/latitude column names",options:t,updateOptions:e,disabled:n}),C.jsxs("span",{children:[C.jsx(FF,{checked:t.forceGeometry,onChange:r=>e({forceGeometry:r.target.checked}),size:"small"}),C.jsx("span",{children:"Use geometry column"})]}),C.jsx(fa,{optionKey:"geometryNames",label:"Geometry column names",options:t,updateOptions:e,disabled:!n}),C.jsx(fa,{optionKey:"timeNames",label:"Time column names",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(fa,{optionKey:"groupNames",label:"Group column names",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"groupPrefix",label:"Group prefix (used as fallback)",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"labelNames",label:"Label column names",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"labelPrefix",label:"Label prefix (used as fallback)",options:t,updateOptions:e})]}),C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto auto"},children:[C.jsx(fa,{optionKey:"separator",label:"Separator character",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"comment",label:"Comment character",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"quote",label:"Quote character",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"escape",label:"Escape character",options:t,updateOptions:e}),C.jsx("div",{}),C.jsxs("span",{children:[C.jsx(FF,{checked:t.trim,onChange:r=>e({trim:r.target.checked}),size:"small"}),C.jsx("span",{children:"Remove whitespaces"})]}),C.jsx(fa,{optionKey:"nanToken",label:"Not-a-number token",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"trueToken",label:"True token",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"falseToken",label:"False token",options:t,updateOptions:e})]})]})},W2=yue(),cqn=oa("div")(({theme:t})=>({paddingTop:t.spacing(2)})),uqn=({options:t,updateOptions:e})=>C.jsx(cqn,{children:C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(W2,{optionKey:"time",label:"Time (UTC, ISO-format)",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(W2,{label:"Group",options:t,optionKey:"group",updateOptions:e}),C.jsx(W2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e,disabled:t.group.trim()!==""}),C.jsx(W2,{label:"Label",optionKey:"label",options:t,updateOptions:e}),C.jsx(W2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e,disabled:t.label.trim()!==""})]})}),qG={csv:{...LMe,codeExt:[]},geojson:{...$Me,codeExt:[dHe()]},wkt:{...zMe,codeExt:[]}},XG={spacer:{flexGrow:1},actionButton:t=>({marginRight:t.spacing(1)}),error:{fontSize:"small"}},fqn=oa("div")(({theme:t})=>({paddingTop:t.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),dqn=oa(iqn)(({theme:t})=>({marginRight:t.spacing(1)})),hqn=({open:t,closeDialog:e,userPlacesFormatName:n,userPlacesFormatOptions:r,updateSettings:i,addUserPlacesFromText:o,nextMapInteraction:s,setMapInteraction:a})=>{const[l,c]=D.useState(""),[u,f]=D.useState(null),[d,h]=D.useState(!1),[p,g]=D.useState(!1),[m,v]=D.useState(n),[y,x]=D.useState(r),b=To();if(D.useEffect(()=>{v(n)},[n]),D.useEffect(()=>{x(r)},[r]),!t)return null;const w=()=>{a("Select"),e("addUserPlacesFromText"),i({userPlacesFormatName:m,userPlacesFormatOptions:y}),o(l)},_=()=>{a(s),e("addUserPlacesFromText")},S=()=>{c("")},O=z=>{const F=z[0];h(!0);const N=new FileReader;N.onloadend=()=>{const L=N.result;v($he(L)),c(L),h(!1)},N.onabort=N.onerror=()=>{h(!1)},N.readAsText(F,"UTF-8")},k=()=>{c("")},E=()=>{console.info("PASTE!",l)},P=z=>{let F=m;l===""&&z.length>10&&(F=$he(z),v(F)),c(z),f(qG[F].checkError(z))};function A(z){v(z.target.value)}function R(z){x({...y,csv:{...y.csv,...z}})}function T(z){x({...y,geojson:{...y.geojson,...z}})}function M(z){x({...y,wkt:{...y.wkt,...z}})}let I;return m==="csv"?I=C.jsx(lqn,{options:y.csv,updateOptions:R}):m==="geojson"?I=C.jsx(sqn,{options:y.geojson,updateOptions:T}):I=C.jsx(uqn,{options:y.wkt,updateOptions:M}),C.jsxs(ed,{fullWidth:!0,open:t,onClose:_,"aria-labelledby":"server-dialog-title",children:[C.jsx($y,{id:"server-dialog-title",children:pe.get("Import places")}),C.jsxs(Nf,{dividers:!0,children:[C.jsxs(_4,{row:!0,value:m,onChange:z=>A(z),children:[C.jsx(sg,{value:"csv",label:pe.get(LMe.name),control:C.jsx(F_,{})},"csv"),C.jsx(sg,{value:"geojson",label:pe.get($Me.name),control:C.jsx(F_,{})},"geojson"),C.jsx(sg,{value:"wkt",label:pe.get(zMe.name),control:C.jsx(F_,{})},"wkt")]}),C.jsx(zU,{theme:b.palette.mode,placeholder:pe.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:qG[m].codeExt,value:l,onChange:P,onDrop:k,onPaste:E,onPasteCapture:E}),u&&C.jsx(Jt,{color:"error",sx:XG.error,children:u}),C.jsxs(fqn,{children:[C.jsx(dqn,{title:pe.get("From File")+"...",accept:qG[m].fileExt,multiple:!1,onSelect:O,disabled:d}),C.jsx(Hr,{onClick:S,disabled:l.trim()===""||d,sx:XG.actionButton,variant:"outlined",size:"small",children:pe.get("Clear")}),C.jsx(ot,{sx:XG.spacer}),C.jsx(Hr,{onClick:()=>g(!p),endIcon:p?C.jsx(rqn,{}):C.jsx(nqn,{}),variant:"outlined",size:"small",children:pe.get("Options")})]}),C.jsx(MF,{in:p,timeout:"auto",unmountOnExit:!0,children:I})]}),C.jsxs(Jb,{children:[C.jsx(Hr,{onClick:_,variant:"text",children:pe.get("Cancel")}),C.jsx(Hr,{onClick:w,disabled:l.trim()===""||u!==null||d,variant:"text",children:pe.get("OK")})]})]})},pqn=t=>({open:t.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:t.controlState.userPlacesFormatName,userPlacesFormatOptions:t.controlState.userPlacesFormatOptions,nextMapInteraction:t.controlState.lastMapInteraction}),gqn={closeDialog:VO,updateSettings:KR,setMapInteraction:E8e,addUserPlacesFromText:VUe},mqn=Rn(pqn,gqn)(hqn),JYe=lt(C.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 xue(t,e){return eQe(t,e,[]).join("")}function eQe(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)eQe(r,e,n)}return n}function vqn(t){return"documentElement"in t}function yqn(t){return new DOMParser().parseFromString(t,"application/xml")}function tQe(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 Hl(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName,l=void 0;a in s?l=s[a]:(l=[],s[a]=l),l.push(o)}}}function Lt(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName;s[a]=o}}}function Es(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(fj(o)){const s=o.Title,a=o.OnlineResource;s&&a?i=`© ${s}`:a?i=`${a}`:s&&(i=`${s}`)}return{name:n,title:r,attribution:i}})}function aXn(t){const e=rXn.read(t);if(fj(e)){const n=e.Capability;if(fj(n))return gJ(n,!0)}throw new Error("invalid WMSCapabilities object")}function gJ(t,e){let n,r;if(e)n=t.Layer;else{const{Layer:o,...s}=t;n=o,r=s}let i;return Array.isArray(n)?i=n.flatMap(o=>gJ(o)):fj(n)?i=gJ(n):i=[{}],i.map(o=>lXn(r,o))}function lXn(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 fj(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const cXn=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=D.useState(t.url),[o,s]=D.useState(null),[a,l]=D.useState(-1);D.useEffect(()=>{iXn(r).then(f=>{s(f)})},[r]),D.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&&a!=-1,u=()=>{o&&a!==-1&&e({...t,group:rte,title:o[a].title,url:r.trim(),attribution:o[a].attribution,wms:{layerName:o[a].name}})};return C.jsxs(ot,{sx:{display:"flex",gap:2,flexDirection:"column",padding:"5px 15px"},children:[C.jsx(Jr,{required:!0,label:pe.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),C.jsx(Hg,{disabled:!o||!o.length,variant:"standard",onChange:f=>l(f.target.value),value:a,size:"small",renderValue:()=>o&&o.length&&a>=0?o[a].title:pe.get("WMS Layer"),children:(o||[]).map((f,d)=>C.jsx(Br,{value:d,selected:a===d,children:C.jsx(fu,{primary:f.title})},f.name))}),C.jsx(iD,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:pe.get("docs/add-layer-wms.en.md")})]})},uXn=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=he.useState(t.title),[o,s]=he.useState(t.url),[a,l]=he.useState(t.attribution||""),c=(d,h)=>{const p=d!=="",g=h!==""&&(h.startsWith("http://")||h.trim().startsWith("https://"));return p&&g},u=()=>c(r.trim(),o.trim()),f=()=>e({...t,group:rte,title:r.trim(),url:o.trim(),attribution:a.trim()});return C.jsxs(ot,{sx:{display:"flex",gap:1,flexDirection:"column",padding:"5px 15px"},children:[C.jsx(Jr,{required:!0,label:pe.get("XYZ Layer URL"),variant:"standard",size:"small",value:o,fullWidth:!0,onChange:d=>s(d.currentTarget.value)}),C.jsxs(ot,{sx:{display:"flex",gap:1},children:[C.jsx(Jr,{required:!0,label:pe.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),C.jsx(Jr,{label:pe.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:a,onChange:d=>l(d.currentTarget.value)})]}),C.jsx(iD,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:pe.get("docs/add-layer-xyz.en.md")})]})},fXn={paper:t=>({backgroundColor:(t.palette.mode==="dark"?Eh:Oh)(t.palette.background.paper,.1),marginBottom:t.spacing(2)})},c2e=({userLayers:t,setUserLayers:e,selectedId:n,setSelectedId:r})=>{const[i,o]=he.useState(n),[s,a]=he.useState(null),[l,c]=r9e();if(!open)return null;const u=x=>{c(()=>e(t)),a({editId:x.id,editMode:"edit"})},f=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);e([...t.slice(0,b+1),{...x,id:Uf("user-layer"),title:x.title+" Copy"},...t.slice(b+1)])},d=x=>{c(void 0);const b=t.findIndex(w=>w.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=Uf("user-layer-");e([...t,{id:b,group:rte,title:"",url:"",attribution:"",wms:x==="wms"?{layerName:""}:void 0}]),a({editId:b,editMode:"add"})},p=()=>{h("wms")},g=()=>{h("xyz")},m=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);n===x.id&&r(i),e([...t.slice(0,b),x,...t.slice(b+1)]),a(null)},v=()=>{if(l(),s&&s.editMode==="add"){const x=t.findIndex(b=>b.id===s.editId);e([...t.slice(0,x),...t.slice(x+1)])}a(null)},y=s!==null;return C.jsx(kl,{sx:fXn.paper,children:C.jsxs(RM,{component:"nav",dense:!0,children:[t.map(x=>{const b=n===x.id;return s&&s.editId===x.id?x.wms?C.jsx(cXn,{userLayer:x,onChange:m,onCancel:v},x.id):C.jsx(uXn,{userLayer:x,onChange:m,onCancel:v},x.id):C.jsxs(TPe,{selected:b,onClick:()=>r(b?null:x.id),children:[C.jsx(fu,{primary:x.title,secondary:x.url}),C.jsxs(aA,{children:[C.jsx(Gt,{onClick:()=>u(x),size:"small",disabled:y,children:C.jsx(XO,{})}),C.jsx(Gt,{onClick:()=>f(x),size:"small",disabled:y,children:C.jsx(JYe,{})}),C.jsx(Gt,{onClick:()=>d(x),size:"small",disabled:y,children:C.jsx(GO,{})})]})]},x.id)}),!y&&C.jsx($_,{sx:{minHeight:"3em"},children:C.jsx(aA,{children:C.jsxs(ot,{sx:{display:"flex",gap:2,paddingTop:2},children:[C.jsx(Mt,{title:pe.get("Add layer from a Web Map Service"),children:C.jsx(Hr,{onClick:p,startIcon:C.jsx(pJ,{}),children:"WMS"})}),C.jsx(Mt,{title:pe.get("Add layer from a Tiled Web Map"),children:C.jsx(Hr,{onClick:g,startIcon:C.jsx(pJ,{}),children:"XYZ"})})]})})})]})})},dXn=({dialogId:t,open:e,closeDialog:n,settings:r,updateSettings:i})=>{const[o,s]=he.useState(t==="userBaseMaps"?0:1);if(!e)return null;const a=r.userBaseMaps,l=m=>{i({userBaseMaps:m})},c=r.userOverlays,u=m=>{i({userOverlays:m})},f=r.selectedBaseMapId,d=m=>{i({selectedBaseMapId:m})},h=r.selectedOverlayId,p=m=>{i({selectedOverlayId:m})};function g(){n(t)}return C.jsxs(ed,{open:e,fullWidth:!0,maxWidth:"sm",onClose:g,scroll:"body",children:[C.jsx($y,{children:pe.get("User Layers")}),C.jsxs(Nf,{children:[C.jsx(ot,{sx:{borderBottom:1,borderColor:"divider"},children:C.jsxs(O4,{value:o,onChange:(m,v)=>s(v),children:[C.jsx(sb,{label:"Base Maps"}),C.jsx(sb,{label:"Overlays"})]})}),o===0&&C.jsx(c2e,{userLayers:a,setUserLayers:l,selectedId:f,setSelectedId:d},"baseMaps"),o===1&&C.jsx(c2e,{userLayers:c,setUserLayers:u,selectedId:h,setSelectedId:p},"overlays")]})]})},hXn=(t,e)=>({open:t.controlState.dialogOpen[e.dialogId],settings:t.controlState,dialogId:e.dialogId}),pXn={closeDialog:VO,updateSettings:KR},u2e=Rn(hXn,pXn)(dXn);function sQe({selected:t,title:e,actions:n}){return C.jsxs(C4,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t&&{background:r=>kt(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[C.jsx(PQ,{}),C.jsx(Jt,{sx:{flex:"1 1 100%",paddingLeft:1},children:e}),n]})}const gXn={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function mXn({userVariables:t,setUserVariables:e,selectedIndex:n,setSelectedIndex:r,setEditedVariable:i}){const o=n>=0?t[n]:null,s=n>=0,a=d=>{r(n!==d?d:-1)},l=()=>{i({editMode:"add",variable:nrn()})},c=()=>{const d=t[n];e([...t.slice(0,n+1),rrn(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 C.jsxs(C.Fragment,{children:[C.jsx(sQe,{selected:n!==null,title:pe.get("Manage user variables"),actions:C.jsxs(C.Fragment,{children:[C.jsx(Mt,{title:pe.get("Add user variable"),children:C.jsx(Gt,{color:"primary",onClick:l,children:C.jsx(kU,{})})}),s&&C.jsx(Mt,{title:pe.get("Duplicate user variable"),children:C.jsx(Gt,{onClick:c,children:C.jsx(JYe,{})})}),s&&C.jsx(Mt,{title:pe.get("Edit user variable"),children:C.jsx(Gt,{onClick:u,children:C.jsx(XO,{})})}),s&&C.jsx(Mt,{title:pe.get("Remove user variable"),children:C.jsx(Gt,{onClick:f,children:C.jsx(ZYe,{})})})]})}),C.jsx(NPe,{sx:gXn.tableContainer,children:C.jsxs(Jee,{size:"small",children:[C.jsx(Ift,{children:C.jsxs(Ad,{children:[C.jsx(ui,{sx:{width:"15%"},children:pe.get("Name")}),C.jsx(ui,{sx:{width:"15%"},children:pe.get("Title")}),C.jsx(ui,{sx:{width:"10%"},children:pe.get("Units")}),C.jsx(ui,{children:pe.get("Expression")})]})}),C.jsx(ete,{children:t.map((d,h)=>C.jsxs(Ad,{hover:!0,selected:h===n,onClick:()=>a(h),children:[C.jsx(ui,{component:"th",scope:"row",children:d.name}),C.jsx(ui,{children:d.title}),C.jsx(ui,{children:d.units}),C.jsx(ui,{children:d.expression||""})]},d.id))})]})})]})}const vXn=lt(C.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),yXn=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function xXn(t){return yXn.test(t)}const f2e={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function d2e({part:t,partType:e,onPartClicked:n}){return C.jsx(ot,{component:"span",sx:f2e.expressionPart,children:C.jsx(pPe,{label:t,sx:f2e.expressionPartChip,size:"small",variant:"outlined",color:e==="variables"||e==="constants"?"default":e.includes("Functions")?"primary":"secondary",onClick:()=>n(t)})})}function bXn({anchorEl:t,exprPartTypes:e,setExprPartTypes:n,onClose:r}){const i=o=>{n({...e,[o]:!e[o]})};return C.jsx(Ny,{open:!!t,anchorEl:t,onClose:r,children:jWe.map(o=>C.jsx(KYe,{selected:e[o],title:pe.get(orn[o]),onClick:()=>i(o),dense:!0},o))})}function wXn({expression:t,onExpressionChange:e,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=Zb(),s=D.useRef(null),a=D.useCallback(c=>{var f;const u=(f=s.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)}},[]);D.useEffect(()=>{i.current=a},[i,a]);const l=D.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 C.jsx(zU,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:pe.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[sHe({override:[l]})],value:t,onChange:e,ref:s})}async function _Xn(t,e,n){if(n.trim()==="")return pe.get("Must not be empty");const r=`${t}/expressions/validate/${cO(e)}/${encodeURIComponent(n)}`;try{return await aRe(r),null}catch(i){const o=i.message;if(o){const s=o.indexOf("("),a=o.lastIndexOf(")");return o.slice(s>=0?s+1:0,a>=0?a:o.length)}return pe.get("Invalid expression")}}const j$={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 SXn({userVariables:t,setUserVariables:e,editedVariable:n,setEditedVariable:r,contextDataset:i,expressionCapabilities:o,serverUrl:s}){const[a,l]=D.useState(irn),[c,u]=D.useState(null),f=[...t,...i.variables],d=i.variables.filter($=>!jM($)).map($=>$.name),{id:h,name:p,title:g,units:m,expression:v}=n.variable,y=f.findIndex($=>$.id!==h&&$.name===p)>=0,x=!xXn(p),b=y?pe.get("Already in use"):x?pe.get("Not a valid identifier"):null,w=!b,[_,S]=D.useState(null),k=w&&!_,E=D.useRef(null);D.useEffect(()=>{const $=setTimeout(()=>{_Xn(s,i.id,n.variable.expression).then(S)},500);return()=>{clearTimeout($)}},[s,i.id,n.variable.expression]);const P=($,j)=>{r({...n,variable:{...n.variable,[$]:j}})},A=()=>{if(n.editMode==="add")e([n.variable,...t]);else{const $=t.findIndex(j=>j.id===n.variable.id);if($>=0){const j=[...t];j[$]=n.variable,e(j)}}r(null)},R=()=>{r(null)},T=$=>{P("name",$.target.value)},M=$=>{P("title",$.target.value)},I=$=>{P("units",$.target.value)},z=$=>{P("expression",$)},F=$=>{E.current($)},N=$=>{u($.currentTarget)},L=()=>{u(null)},B=[C.jsx(Gt,{size:"small",onClick:N,children:C.jsx(Mt,{arrow:!0,title:pe.get("Display further elements to be used in expressions"),children:C.jsx(vXn,{})})},"filter")];return jWe.forEach($=>{a[$]&&($==="variables"?d.forEach(j=>{B.push(C.jsx(d2e,{part:j,partType:$,onPartClicked:F},`${$}-${j}`))}):o.namespace[$].forEach(j=>{B.push(C.jsx(d2e,{part:j,partType:$,onPartClicked:F},`${$}-${j}`))}))}),C.jsxs(C.Fragment,{children:[C.jsx(bXn,{anchorEl:c,exprPartTypes:a,setExprPartTypes:l,onClose:L}),C.jsx(sQe,{selected:!0,title:n.editMode==="add"?pe.get("Add user variable"):pe.get("Edit user variable"),actions:C.jsx(iD,{size:"medium",onDone:A,doneDisabled:!k,onCancel:R})}),C.jsxs(ot,{sx:j$.content,children:[C.jsxs(ot,{sx:j$.propertiesRow,children:[C.jsx(Jr,{sx:{flexGrow:.3},error:!w,helperText:b,size:"small",variant:"standard",label:pe.get("Name"),value:p,onChange:T}),C.jsx(Jr,{sx:{flexGrow:.6},size:"small",variant:"standard",label:pe.get("Title"),value:g,onChange:M}),C.jsx(Jr,{sx:{flexGrow:.1},size:"small",variant:"standard",label:pe.get("Units"),value:m,onChange:I})]}),C.jsxs(ot,{sx:j$.expressionRow,children:[C.jsx(Jt,{sx:$=>({paddingBottom:1,color:$.palette.text.secondary}),children:pe.get("Expression")}),C.jsx(wXn,{expression:v,onExpressionChange:z,variableNames:d,expressionCapabilities:o,handleInsertPartRef:E}),_&&C.jsx(Jt,{sx:{paddingBottom:1},color:"error",fontSize:"small",children:_}),C.jsx(ot,{sx:j$.expressionParts,children:B})]})]})]})}const h2e={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function CXn({open:t,closeDialog:e,selectedDataset:n,selectedVariableName:r,selectVariable:i,userVariables:o,updateDatasetUserVariables:s,expressionCapabilities:a,serverUrl:l}){const[c,u]=D.useState(o),[f,d]=D.useState(c.findIndex(v=>v.name===r)),[h,p]=D.useState(null);if(D.useEffect(()=>{u(o)},[o]),!t||!n||!a)return null;function g(){s(n.id,c),e(Q5),f>=0&&i(c[f].name)}function m(){u(o),e(Q5)}return C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"md",onClose:m,scroll:"body",children:[C.jsx($y,{children:pe.get("User Variables")}),C.jsx(Nf,{dividers:!0,sx:h2e.dialogContent,children:h===null?C.jsx(mXn,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):C.jsx(SXn,{userVariables:c,setUserVariables:u,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:a,serverUrl:l})}),C.jsxs(Jb,{sx:h2e.dialogActions,children:[C.jsx(ot,{children:C.jsx(i9e,{size:"medium",helpUrl:pe.get("docs/user-variables.en.md")})}),C.jsxs(ot,{children:[C.jsx(Hr,{onClick:m,children:pe.get("Cancel")}),C.jsx(Hr,{onClick:g,disabled:h!==null||!OXn(c),children:pe.get("OK")})]})]})]})}function OXn(t){const e=new Set;return t.forEach(n=>e.add(n.name)),e.size===t.length}const EXn=t=>({open:t.controlState.dialogOpen[Q5],selectedDataset:fo(t),selectedVariableName:a1(t),userVariables:q_t(t),expressionCapabilities:c_t(t),serverUrl:zi(t).url,themeMode:t.controlState.themeMode}),TXn={closeDialog:VO,selectVariable:x8e,updateDatasetUserVariables:yKt},kXn=Rn(EXn,TXn)(CXn),AXn=t=>({compact:Pn.instance.branding.compact,themeMode:t.controlState.themeMode}),PXn={},MXn=({compact:t,themeMode:e})=>{const n=Tee("(prefers-color-scheme: dark)")?"dark":"light",r=D.useMemo(()=>{const i=BMe(e,n);return n4({typography:{fontSize:12,htmlFontSize:14},palette:{mode:i,primary:Pn.instance.branding.primaryColor,secondary:Pn.instance.branding.secondaryColor}})},[e,n]);return C.jsx(Wmt,{children:C.jsx(Qet,{injectFirst:!0,children:C.jsxs(yrt,{theme:r,children:[C.jsx(lat,{}),!t&&C.jsx(qnn,{}),C.jsx(mHn,{}),C.jsx(kHn,{}),C.jsx(UHn,{}),C.jsx(XHn,{}),C.jsx(u2e,{dialogId:"userOverlays"},"userOverlays"),C.jsx(u2e,{dialogId:"userBaseMaps"},"userBaseMaps"),C.jsx(kXn,{}),C.jsx(mqn,{}),C.jsx(tqn,{}),C.jsx(wHn,{}),C.jsx(NHn,{})]})})})},RXn=Rn(AXn,PXn)(MXn);function DXn(t,e,n){switch(t===void 0&&(t=Bgt()),e.type){case Jae:{const{controlState:r}=e.persistedState.state;return{...t,...r}}case fle:{const r={...t,...e.settings};return vd(r),r}case U8e:return vd(t),t;case eP:{let r=t.selectedDatasetId||Up.get("dataset"),i=t.selectedVariableName||Up.get("variable"),o=t.mapInteraction,s=hA(e.datasets,r);const a=s&&Lq(s,i)||null;return s?a||(i=s.variables.length?s.variables[0].name:null):(r=null,i=null,s=e.datasets.length?e.datasets[0]:null,s&&(r=s.id,s.variables.length>0&&(i=s.variables[0].name))),r||(o="Select"),{...t,selectedDatasetId:r,selectedVariableName:i,mapInteraction:o}}case l8e:{let r=t.selectedVariableName;const i=hA(e.datasets,e.selectedDatasetId);!Lq(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const s=e.selectedDatasetId,a=fRe(i),l=a?a[1]:null;return{...t,selectedDatasetId:s,selectedVariableName:r,selectedTimeRange:a,selectedTime:l}}case d8e:{const{location:r}=e;return t.flyTo!==r?{...t,flyTo:r}:t}case h8e:{const r=e.selectedPlaceGroupIds;return{...t,selectedPlaceGroupIds:r,selectedPlaceId:null}}case p8e:{const{placeId:r}=e;return{...t,selectedPlaceId:r}}case y8e:return{...t,selectedVariableName:e.selectedVariableName};case g8e:return{...t,layerVisibilities:{...t.layerVisibilities,[e.layerId]:e.visible}};case m8e:{const{mapPointInfoBoxEnabled:r}=e;return{...t,mapPointInfoBoxEnabled:r}}case v8e:{const{variableCompareMode:r}=e;return{...t,variableCompareMode:r,variableSplitPos:void 0}}case ale:{const{variableSplitPos:r}=e;return{...t,variableSplitPos:r}}case w8e:{let{selectedTime:r}=e;if(r!==null&&n){const i=Zq(n),o=i?cDe(i,r):-1;o>=0&&(r=i[o])}return t.selectedTime!==r?{...t,selectedTime:r}:t}case _8e:{if(n){let r=lIe(n);if(r>=0){const i=Zq(n);r+=e.increment,r<0&&(r=i.length-1),r>i.length-1&&(r=0);let o=i[r];const s=t.selectedTimeRange;if(s!==null&&(os[1]&&(o=s[1])),t.selectedTime!==o)return{...t,selectedTime:o}}}return t}case lle:return{...t,selectedTimeRange:e.selectedTimeRange};case uZt:return{...t,timeSeriesUpdateMode:e.timeSeriesUpdateMode};case C8e:return{...t,timeAnimationActive:e.timeAnimationActive,timeAnimationInterval:e.timeAnimationInterval};case tle:{const{id:r,selected:i}=e;return i?IXn(t,wf,r):t}case nle:{const{placeGroups:r}=e;return r.length>0?{...t,selectedPlaceGroupIds:[...t.selectedPlaceGroupIds||[],r[0].id]}:t}case rle:{const{placeGroupId:r,newName:i}=e;return r===wf?{...t,userDrawnPlaceGroupName:i}:t}case ile:{const{placeId:r,places:i}=e;if(r===t.selectedPlaceId){let o=null;const s=i.findIndex(a=>a.id===r);return s>=0&&(s0&&(o=i[s-1].id)),{...t,selectedPlaceId:o}}return t}case G8e:{const r=e.colorBarId;return{...t,userColorBars:[{id:r,type:"continuous",code:hRe},...t.userColorBars]}}case H8e:{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 vd(o),o}return t}case Y8e:{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 O8e:{let r={...t,mapInteraction:e.mapInteraction,lastMapInteraction:t.mapInteraction};return e.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...t.dialogOpen,addUserPlacesFromText:!0}}),r}case T8e:{const{layerMenuOpen:r}=e;return t={...t,layerMenuOpen:r},vd(t),t}case A8e:{const{sidebarPosition:r}=e;return t={...t,sidebarPosition:r},t}case P8e:{const{sidebarOpen:r}=e;return t={...t,sidebarOpen:r},vd(t),t}case M8e:{const{sidebarPanelId:r}=e;return t={...t,sidebarPanelId:r},vd(t),t}case R8e:return t={...t,volumeRenderMode:e.volumeRenderMode},vd(t),t;case D8e:{const{volumeId:r,volumeState:i}=e;return t={...t,volumeStates:{...t.volumeStates,[r]:i}},t}case I8e:{const r={...t.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:e.visibleElements.includes(i)}}),t={...t,infoCardElementStates:r},vd(t),t}case L8e:{const{elementType:r,viewMode:i}=e,o={...t,infoCardElementStates:{...t.infoCardElementStates,[r]:{...t.infoCardElementStates[r],viewMode:i}}};return vd(o),o}case $8e:return{...t,activities:{...t.activities,[e.id]:e.message}};case F8e:{const r={...t.activities};return delete r[e.id],{...t,activities:r}}case N8e:{const r=e.locale;return pe.locale=r,r!==t.locale&&(t={...t,locale:r},vd(t)),t}case j8e:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!0}}}case B8e:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!1}}}case b8e:{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 ole:if(t.selectedServerId!==e.selectedServerId)return{...t,selectedServerId:e.selectedServerId}}return t}function IXn(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 LXn(){const t=Rgt(),e=[{...Pn.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 $Xn(t,e){switch(t===void 0&&(t=LXn()),e.type){case Jae:{const{dataState:n}=e.persistedState.state;return{...t,...n}}case X5:return{...t,serverInfo:e.serverInfo};case n8e:return{...t,expressionCapabilities:e.expressionCapabilities};case eP:return{...t,datasets:e.datasets};case WUe:{const{datasetId:n,userVariables:r}=e,i=t.datasets.findIndex(l=>l.id===n),o=t.datasets[i],[s,a]=Fte(o);return{...t,datasets:[...t.datasets.slice(0,i),{...o,variables:[...s,...r]},...t.datasets.slice(i+1)]}}case i8e:{const{datasetId:n,variableName:r,colorBarName:i,colorBarMinMax:o,colorBarNorm:s,opacity:a}=e,l={colorBarName:i,colorBarMin:o[0],colorBarMax:o[1],colorBarNorm:s,opacity:a};return p2e(t,n,r,l)}case s8e:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=e;return p2e(t,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case ele:{const n=e.placeGroup,r=t.datasets.map(i=>{if(i.placeGroups){const o=i.placeGroups.findIndex(s=>s.id===n.id);if(o>=0){const s=[...i.placeGroups];return s[o]=n,{...i,placeGroups:s}}}return i});return{...t,datasets:r}}case tle:{const{placeGroupTitle:n,id:r,properties:i,geometry:o}=e,s={type:"Feature",id:r,properties:i,geometry:o},a=t.userPlaceGroups,l=a.findIndex(c=>c.id===wf);if(l>=0){const c=a[l];return{...t,userPlaceGroups:[...a.slice(0,l),{...c,features:[...c.features,s]},...a.slice(l+1)]}}else{const c=n&&n!==""?n:pe.get("My places");return{...t,userPlaceGroups:[{type:"FeatureCollection",id:wf,title:c,features:[s]},...a]}}}case nle:{const{placeGroups:n}=e;return{...t,userPlaceGroups:[...t.userPlaceGroups,...n]}}case rle:{const{placeGroupId:n,newName:r}=e,i=t.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o];return{...t,userPlaceGroups:[...i.slice(0,o),{...s,title:r},...i.slice(o+1)]}}return t}case GUe:{const{placeGroupId:n,placeId:r,newName:i}=e,o=t.userPlaceGroups,s=m2e(o,n,r,{label:i});return s?{...t,userPlaceGroups:s}:t}case HUe:{const{placeGroupId:n,placeId:r,placeStyle:i}=e,o=t.userPlaceGroups,s=m2e(o,n,r,i);return s?{...t,userPlaceGroups:s}:t}case ile:{const{placeGroupId:n,placeId:r}=e,i=t.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o],a=s.features.findIndex(l=>l.id===r);if(a>=0){const l=g2e(t.timeSeriesGroups,[r]);let c=t.timeSeriesGroups;return l.forEach(u=>{c=KG(c,u,"remove","append")}),{...t,userPlaceGroups:[...i.slice(0,o),{...s,features:[...s.features.slice(0,a),...s.features.slice(a+1)]},...i.slice(o+1)],timeSeriesGroups:c}}}return t}case qUe:{const{placeGroupId:n}=e,r=t.userPlaceGroups,i=r.findIndex(o=>o.id===n);if(i>=0){const s=r[i].features.map(c=>c.id),a=g2e(t.timeSeriesGroups,s);let l=t.timeSeriesGroups;return a.forEach(c=>{l=KG(l,c,"remove","append")}),{...t,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return t}case r8e:return{...t,colorBars:e.colorBars};case ZUe:{const{timeSeriesGroupId:n,timeSeries:r}=e,i=t.timeSeriesGroups,o=i.findIndex(l=>l.id===n),s=i[o],a=[...i];return a[o]={...s,timeSeriesArray:[...s.timeSeriesArray,r]},{...t,timeSeriesGroups:a}}case YUe:{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 QUe:{const{index:n}=e,r=t.statistics,i=r.records;return{...t,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case KUe:{const{timeSeries:n,updateMode:r,dataMode:i}=e,o=KG(t.timeSeriesGroups,n,r,i);return o!==t.timeSeriesGroups?{...t,timeSeriesGroups:o}:t}case JUe:{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 e8e:{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 t8e:return{...t,timeSeriesGroups:[]};case lle:{const{selectedGroupId:n,selectedValueRange:r}=e;if(!n)return t;const i=t.timeSeriesGroups.findIndex(s=>s.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 ole:return t.userServers!==e.servers?(Mgt(e.servers),{...t,userServers:e.servers}):t;default:return t}}function p2e(t,e,n,r){const i=t.datasets.findIndex(o=>o.id===e);if(i>=0){const o=t.datasets[i],s=o.variables.findIndex(a=>a.name===n);if(s>=0){const a=o.variables[s],l=t.datasets.slice(),c=o.variables.slice();return c[s]={...a,...r},l[i]={...o,variables:c},{...t,datasets:l}}}return t}function KG(t,e,n,r){let i=e,o;const s=t.findIndex(a=>a.variableUnits===i.source.variableUnits);if(s>=0){const a=t[s],l=a.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=[{...a,timeSeriesArray:u}]:n==="add"?(o=t.slice(),o[s]={...a,timeSeriesArray:u}):u.length>=0?(o=t.slice(),o[s]={...a,timeSeriesArray:u}):(o=t.slice(),o.splice(s,1))}else n==="replace"?o=[{id:Uf("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:Uf("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...t]:o=t;return o}function g2e(t,e){const n=[];return t.forEach(r=>{r.timeSeriesArray.forEach(i=>{e.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function m2e(t,e,n,r){const i=t.findIndex(o=>o.id===e);if(i>=0){const o=t[i],s=o.features,a=s.findIndex(l=>l.id===n);if(a>=0){const l=s[a];return[...t.slice(0,i),{...o,features:[...s.slice(0,a),{...l,properties:{...l.properties,...r}},...s.slice(a+1)]},...t.slice(i+1)]}}}function FXn(){return{newEntries:[],oldEntries:[]}}let NXn=0;function zXn(t,e){t===void 0&&(t=FXn());const n=t.newEntries;switch(e.type){case FUe:{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:++NXn,type:r,text:i},{...t,newEntries:[o,...n]})}case NUe:{const r=n.findIndex(i=>i.id===e.messageId);if(r>=0){const i=n[r],o=[...n];o.splice(r,1);const s=[i,...t.oldEntries];return{...t,newEntries:o,oldEntries:s}}}}return t}function jXn(){return{accessToken:null}}function BXn(t,e){switch(t===void 0&&(t=jXn()),e.type){case FWe:return{...t,accessToken:e.accessToken}}return t}function UXn(t,e){return{dataState:$Xn(t&&t.dataState,e),controlState:DXn(t&&t.controlState,e,t),messageLogState:zXn(t&&t.messageLogState,e),userAuthState:BXn(t&&t.userAuthState,e)}}console.debug("baseUrl:",nO);Pn.load().then(()=>{const t=(o,s)=>s.type!==ale,e=XJe.createLogger({collapsed:!0,diff:!1,predicate:t}),n=qJe(Kke,e),r=Yke(UXn,n),i=r.dispatch;i(z8e(r.getState().controlState.locale)),i(xZt()),r.getState().controlState.privacyNoticeAccepted&&i(sle(r,!0)),ZG.createRoot(document.getElementById("root")).render(C.jsx(VZe,{store:r,children:C.jsx(RXn,{})}))}); +`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&BYe(t.body,"react-draggable-transparent-selection")}function gGn(t){if(t)try{if(t.body&&UYe(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 BYe(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function UYe(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.canDragX=yGn;ap.canDragY=xGn;ap.createCoreData=wGn;ap.createDraggableData=_Gn;ap.getBoundPosition=mGn;ap.getControlPosition=bGn;ap.snapToGrid=vGn;var Wl=sp,E_=ji;function mGn(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:SGn(r);const i=hue(t);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),u=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Wl.int)(u.paddingLeft)+(0,Wl.int)(c.marginLeft),top:-i.offsetTop+(0,Wl.int)(u.paddingTop)+(0,Wl.int)(c.marginTop),right:(0,E_.innerWidth)(l)-(0,E_.outerWidth)(i)-i.offsetLeft+(0,Wl.int)(u.paddingRight)-(0,Wl.int)(c.marginRight),bottom:(0,E_.innerHeight)(l)-(0,E_.outerHeight)(i)-i.offsetTop+(0,Wl.int)(u.paddingBottom)-(0,Wl.int)(c.marginBottom)}}return(0,Wl.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,Wl.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Wl.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,Wl.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function vGn(t,e,n){const r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]}function yGn(t){return t.props.axis==="both"||t.props.axis==="x"}function xGn(t){return t.props.axis==="both"||t.props.axis==="y"}function bGn(t,e,n){const r=typeof e=="number"?(0,E_.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const i=hue(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,E_.offsetXYFromParent)(r||t,o,n.props.scale)}function wGn(t,e,n){const r=!(0,Wl.isNum)(t.lastX),i=hue(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 _Gn(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 SGn(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function hue(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var h8={},p8={};Object.defineProperty(p8,"__esModule",{value:!0});p8.default=CGn;function CGn(){}Object.defineProperty(h8,"__esModule",{value:!0});h8.default=void 0;var BG=EGn(D),Ua=pue(dM),OGn=pue(KC),Ds=ji,Am=ap,UG=sp,z2=pue(p8);function pue(t){return t&&t.__esModule?t:{default:t}}function WYe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(WYe=function(r){return r?n:e})(t)}function EGn(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=WYe(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 s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function ha(t,e,n){return e=TGn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TGn(t){var e=kGn(t,"string");return typeof e=="symbol"?e:String(e)}function kGn(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 of={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Pm=of.mouse,g8=class extends BG.Component{constructor(){super(...arguments),ha(this,"dragging",!1),ha(this,"lastX",NaN),ha(this,"lastY",NaN),ha(this,"touchIdentifier",null),ha(this,"mounted",!1),ha(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,Ds.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,Ds.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const i=(0,Ds.getTouchIdentifier)(e);this.touchIdentifier=i;const o=(0,Am.getControlPosition)(e,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,Am.createCoreData)(this,s,a);(0,z2.default)("DraggableCore: handleDragStart: %j",l),(0,z2.default)("calling",this.props.onStart),!(this.props.onStart(e,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Ds.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Ds.addEvent)(r,Pm.move,this.handleDrag),(0,Ds.addEvent)(r,Pm.stop,this.handleDragStop))}),ha(this,"handleDrag",e=>{const n=(0,Am.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,Am.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,Am.createCoreData)(this,r,i);if((0,z2.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}),ha(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Am.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,Am.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Am.createCoreData)(this,r,i);if(this.props.onStop(e,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Ds.removeUserSelectStyles)(a.ownerDocument),(0,z2.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,z2.default)("DraggableCore: Removing handlers"),(0,Ds.removeEvent)(a.ownerDocument,Pm.move,this.handleDrag),(0,Ds.removeEvent)(a.ownerDocument,Pm.stop,this.handleDragStop))}),ha(this,"onMouseDown",e=>(Pm=of.mouse,this.handleDragStart(e))),ha(this,"onMouseUp",e=>(Pm=of.mouse,this.handleDragStop(e))),ha(this,"onTouchStart",e=>(Pm=of.touch,this.handleDragStart(e))),ha(this,"onTouchEnd",e=>(Pm=of.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,Ds.addEvent)(e,of.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,Ds.removeEvent)(n,of.mouse.move,this.handleDrag),(0,Ds.removeEvent)(n,of.touch.move,this.handleDrag),(0,Ds.removeEvent)(n,of.mouse.stop,this.handleDragStop),(0,Ds.removeEvent)(n,of.touch.stop,this.handleDragStop),(0,Ds.removeEvent)(e,of.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Ds.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:OGn.default.findDOMNode(this)}render(){return BG.cloneElement(BG.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};h8.default=g8;ha(g8,"displayName","DraggableCore");ha(g8,"propTypes",{allowAnyClick:Ua.default.bool,children:Ua.default.node.isRequired,disabled:Ua.default.bool,enableUserSelectHack:Ua.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:Ua.default.arrayOf(Ua.default.number),handle:Ua.default.string,cancel:Ua.default.string,nodeRef:Ua.default.object,onStart:Ua.default.func,onDrag:Ua.default.func,onStop:Ua.default.func,onMouseDown:Ua.default.func,scale:Ua.default.number,className:UG.dontSetMe,style:UG.dontSetMe,transform:UG.dontSetMe});ha(g8,"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(D),n=u(dM),r=u(KC),i=u(q7n),o=ji,s=ap,a=sp,l=u(h8),c=u(p8);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(w){return w?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 w={},_=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in y)if(S!=="default"&&Object.prototype.hasOwnProperty.call(y,S)){var O=_?Object.getOwnPropertyDescriptor(y,S):null;O&&(O.get||O.set)?Object.defineProperty(w,S,O):w[S]=y[S]}return w.default=y,b&&b.set(y,w),w}function h(){return h=Object.assign?Object.assign.bind():function(y){for(var x=1;x{if((0,c.default)("Draggable: onDragStart: %j",w),this.props.onStart(b,(0,s.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(b,w)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",w);const _=(0,s.createDraggableData)(this,w),S={x:_.x,y:_.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=S;S.x+=this.state.slackX,S.y+=this.state.slackY;const[P,A]=(0,s.getBoundPosition)(this,S.x,S.y);S.x=P,S.y=A,S.slackX=this.state.slackX+(k-S.x),S.slackY=this.state.slackY+(E-S.y),_.x=S.x,_.y=S.y,_.deltaX=S.x-this.state.x,_.deltaY=S.y-this.state.y}if(this.props.onDrag(b,_)===!1)return!1;this.setState(S)}),p(this,"onDragStop",(b,w)=>{if(!this.state.dragging||this.props.onStop(b,(0,s.createDraggableData)(this,w))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",w);const S={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:k,y:E}=this.props.position;S.x=k,S.y=E}this.setState(S)}),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:w,defaultPosition:_,defaultClassName:S,defaultClassNameDragging:O,defaultClassNameDragged:k,position:E,positionOffset:P,scale:A,...R}=this.props;let T={},M=null;const z=!!!E||this.state.dragging,F=E||_,N={x:(0,s.canDragX)(this)&&z?this.state.x:F.x,y:(0,s.canDragY)(this)&&z?this.state.y:F.y};this.state.isElementSVG?M=(0,o.createSVGTransform)(N,P):T=(0,o.createCSSTransform)(N,P);const L=(0,i.default)(w.props.className||"",S,{[O]:this.state.dragging,[k]:this.state.dragged});return e.createElement(l.default,h({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(w),{className:L,style:{...w.props.style,...T},transform:M}))}}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:a.dontSetMe,style:a.dontSetMe,transform:a.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})})(LYe);const{default:VYe,DraggableCore:AGn}=LYe;d8.exports=VYe;d8.exports.default=VYe;d8.exports.DraggableCore=AGn;var GYe=d8.exports;const PGn=sn(GYe);var gue={exports:{}},ED={},mue={};mue.__esModule=!0;mue.cloneElement=$Gn;var MGn=RGn(D);function RGn(t){return t&&t.__esModule?t:{default:t}}function n2e(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 r2e(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function i2e(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 WG(t){for(var e=1;eMath.abs(d*u)?o=i/u:i=o*u}var h=i,p=o,g=this.slack||[0,0],m=g[0],v=g[1];return i+=m,o+=v,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[m+(h-i),v+(p-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var d=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!d&&!h)){var p=o[0],g=o[o.length-1],m=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var v=m.left-s.lastHandleRect.left;u+=v}if(p==="n"){var y=m.top-s.lastHandleRect.top;f+=y}}s.lastHandleRect=m,g==="w"&&(u=-u),p==="n"&&(f=-f);var x=s.props.width+(d?u/s.props.transformScale:0),b=s.props.height+(h?f/s.props.transformScale:0),w=s.runConstraints(x,b);x=w[0],b=w[1];var _=x!==s.props.width||b!==s.props.height,S=typeof s.props[i]=="function"?s.props[i]:null,O=i==="onResize"&&!_;S&&!O&&(a.persist==null||a.persist(),S(a,{node:c,size:{width:x,height:b},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return j2.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=WG({ref:o},a?{}:{handleAxis:i});return j2.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=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=VGn(o,UGn);return(0,jGn.cloneElement)(s,WG(WG({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var d,h=(d=i.handleRefs[f])!=null?d:i.handleRefs[f]=j2.createRef();return j2.createElement(zGn.DraggableCore,uJ({},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}(j2.Component);ED.default=vue;vue.propTypes=BGn.resizableProps;vue.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var m8={};m8.__esModule=!0;m8.default=void 0;var VG=JGn(D),YGn=qYe(dM),QGn=qYe(ED),KGn=TD,ZGn=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function qYe(t){return t&&t.__esModule?t:{default:t}}function XYe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(XYe=function(i){return i?n:e})(t)}function JGn(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=XYe(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 s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function dJ(){return dJ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function iHn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,hJ(t,e)}function hJ(t,e){return hJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},hJ(t,e)}var YYe=function(t){iHn(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),s=0;sn(t,!i.visible)}),r?C.jsx(zf,{}):C.jsx(zf,{variant:"inset",component:"li",style:{margin:"0 0 0 52px"}})]})}const sHn={x:48,y:128},aHn={width:320,height:520},$$={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 lHn(t){const[e,n]=D.useState(sHn),[r,i]=D.useState(aHn),{layerMenuOpen:o,setLayerMenuOpen:s,openDialog:a,...l}=t;if(!o)return null;console.log("layerProps",l);const c=()=>{a("userOverlays")},u=()=>{a("userBaseMaps")},f=()=>{s(!1)},d=(p,g)=>{n({...g})},h=(p,g)=>{i({...g.size})};return C.jsx(PGn,{handle:"#layer-select-header",position:e,onStop:d,children:C.jsx(oHn,{width:r.width,height:r.height,style:$$.resizeBox,onResize:h,children:C.jsxs(kl,{elevation:10,sx:$$.windowPaper,component:"div",children:[C.jsxs(ot,{id:"layer-select-header",sx:$$.windowHeader,children:[C.jsx(ot,{component:"span",sx:$$.windowTitle,children:pe.get("Layers")}),C.jsx(Gt,{size:"small",onClick:f,children:C.jsx(VO,{fontSize:"inherit"})})]}),C.jsx(ot,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:C.jsxs(w4,{dense:!0,children:[C.jsx(Sp,{layerId:"overlay",...l}),C.jsx(Sp,{layerId:"userPlaces",...l}),C.jsx(Sp,{layerId:"datasetPlaces",...l}),C.jsx(Sp,{layerId:"datasetBoundary",...l}),C.jsx(Sp,{layerId:"datasetVariable",...l}),C.jsx(Sp,{layerId:"datasetVariable2",...l}),C.jsx(Sp,{layerId:"datasetRgb",...l}),C.jsx(Sp,{layerId:"datasetRgb2",...l}),C.jsx(Sp,{layerId:"baseMap",...l,last:!0}),C.jsx(Br,{onClick:u,children:pe.get("User Base Maps")+"..."}),C.jsx(Br,{onClick:c,children:pe.get("User Overlays")+"..."})]})})]})})})}const cHn=t=>({locale:t.controlState.locale,layerMenuOpen:t.controlState.layerMenuOpen,layerStates:FSt(t)}),uHn={openDialog:T1,setLayerMenuOpen:k8e,setLayerVisibility:iZt},fHn=Rn(cHn,uHn)(lHn),dHn=t=>({locale:t.controlState.locale,hasConsent:t.controlState.privacyNoticeAccepted,compact:Pn.instance.branding.compact}),hHn={},pHn=be("main")(({theme:t})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[t.breakpoints.up("md")]:{overflow:"hidden"}})),gHn=({hasConsent:t,compact:e})=>C.jsxs(pHn,{children:[!e&&C.jsx(C4,{variant:"dense"}),t&&C.jsxs(C.Fragment,{children:[C.jsx(adn,{}),C.jsx(G7n,{}),C.jsx(fHn,{})]})]}),mHn=Rn(dHn,hHn)(gHn),vHn={icon:t=>({marginRight:t.spacing(2)})};function yHn({open:t,settings:e,updateSettings:n,syncWithServer:r}){const[i,o]=D.useState(null),{store:s}=D.useContext(kj);if(D.useEffect(()=>{const c=pe.get("docs/privacy-note.en.md");fetch(c).then(u=>u.text()).then(u=>o(u))}),!t)return null;function a(){n({...e,privacyNoticeAccepted:!0}),r(s)}function l(){try{window.history.length>0?window.history.back():typeof window.home=="function"?window.home():window.location.href="about:home"}catch(c){console.error(c)}}return C.jsxs(ed,{open:t,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[C.jsx($y,{children:pe.get("Privacy Notice")}),C.jsx(Nf,{children:C.jsx(Vat,{children:i===null?C.jsx(Ly,{}):C.jsx(Cle,{text:i})})}),C.jsxs(Jb,{children:[C.jsxs(Hr,{onClick:a,children:[C.jsx(QYe,{sx:vHn.icon}),pe.get("Accept and continue")]}),C.jsx(Hr,{onClick:l,children:pe.get("Leave")})]})]})}const xHn=t=>({open:!t.controlState.privacyNoticeAccepted,settings:t.controlState}),bHn={updateSettings:KR,syncWithServer:sle},wHn=Rn(xHn,bHn)(yHn),_Hn=oa(Ly)(({theme:t})=>({margin:t.spacing(2)})),SHn=oa(Jt)(({theme:t})=>({margin:t.spacing(1)})),CHn=oa("div")(({theme:t})=>({margin:t.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function OHn({messages:t}){return t.length===0?null:C.jsxs(ed,{open:!0,"aria-labelledby":"loading",children:[C.jsx($y,{id:"loading",children:pe.get("Please wait...")}),C.jsxs(CHn,{children:[C.jsx(_Hn,{}),t.map((e,n)=>C.jsx(SHn,{children:e},n))]})]})}const EHn=t=>({locale:t.controlState.locale,messages:RSt(t)}),THn={},kHn=Rn(EHn,THn)(OHn),AHn=lt(C.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"),PHn=lt(C.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),MHn=lt(C.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"),RHn={success:MHn,warning:PHn,error:AHn,info:l9e},DHn=oa("span")(()=>({display:"flex",alignItems:"center"})),F$={close:{p:.5},success:t=>({color:t.palette.error.contrastText,backgroundColor:$p[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:iAe[700]}),icon:{fontSize:20},iconVariant:t=>({opacity:.9,marginRight:t.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},IHn={vertical:"bottom",horizontal:"center"};function LHn({className:t,message:e,hideMessage:n}){const r=()=>{n(e.id)};if(!e)return null;const i=RHn[e.type];return C.jsx(eft,{open:!0,anchorOrigin:IHn,autoHideDuration:5e3,onClose:r,children:C.jsx($Pe,{sx:F$[e.type],className:t,"aria-describedby":"client-snackbar",message:C.jsxs(DHn,{id:"client-snackbar",children:[C.jsx(i,{sx:F$.iconVariant}),e.text]}),action:[C.jsx(Gt,{"aria-label":"Close",color:"inherit",sx:F$.close,onClick:r,size:"large",children:C.jsx(VO,{sx:F$.icon})},"close")]})},e.type+":"+e.text)}const $Hn=t=>{const e=t.messageLogState.newEntries;return{locale:t.controlState.locale,message:e.length>0?e[0]:null}},FHn={hideMessage:JQt},NHn=Rn($Hn,FHn)(LHn),pJ=lt(C.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),ZYe=lt(C.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"),Dw={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 zHn({open:t,servers:e,selectedServer:n,closeDialog:r,configureServers:i}){const o=D.useRef(!1),[s,a]=D.useState(e),[l,c]=D.useState(n),[u,f]=D.useState("select");D.useEffect(()=>{o.current&&(a(e),c(n)),o.current=!0},[e,n]);const{store:d}=D.useContext(kj),h=()=>{u==="select"?(r("server"),i(s,l.id,d)):u==="add"?E():u==="edit"&&P()},p=()=>{u==="select"?_():A()},g=()=>{_()},m=F=>{const N=F.target.value,L=s.find(B=>B.id===N);c(L)},v=F=>{const N=F.target.value,L={...l,name:N};c(L)},y=F=>{const N=F.target.value,L={...l,url:N};c(L)},x=()=>{f("add")},b=()=>{f("edit")},w=()=>{R()},_=()=>{r("server")},S=()=>{const F=l.id;return s.findIndex(N=>N.id===F)},O=(F,N)=>{const L=[...s];L[F]=N,a(L),c(N),f("select")},k=(F,N)=>{a(F),c(N),f("select")},E=()=>{const F={...l,id:Uf("server-")},N=[...s,F];k(N,F)},P=()=>{O(S(),{...l})},A=()=>{const F=S();O(S(),s[F])},R=()=>{const F=[...s];if(F.length<2)throw new Error("internal error: server list cannot be emptied");const N=S(),L=F[N+(N>0?-1:1)];F.splice(N,1),k(F,L)},T=s.map((F,N)=>C.jsx(Br,{value:F.id,children:F.name},N));let M;u==="add"?M=pe.get("Add"):u==="edit"?M=pe.get("Save"):M=pe.get("OK");let I;u==="add"?I=pe.get("Add Server"):u==="edit"?I=pe.get("Edit Server"):I=pe.get("Select Server");let z;return u==="add"||u==="edit"?z=C.jsxs(Nf,{dividers:!0,children:[C.jsx(Jr,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:Dw.textField,margin:"normal",value:l.name,onChange:v}),C.jsx("br",{}),C.jsx(Jr,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:Dw.textField2,margin:"normal",value:l.url,onChange:y})]}):z=C.jsx(Nf,{dividers:!0,children:C.jsxs("div",{children:[C.jsxs(td,{variant:"standard",sx:Dw.formControl,children:[C.jsx(Fy,{htmlFor:"server-name",children:"Name"}),C.jsx(Hg,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:T}),C.jsx(Xee,{children:l.url})]}),C.jsx(Gt,{sx:Dw.button,"aria-label":"Add",color:"primary",onClick:x,size:"large",children:C.jsx(pJ,{fontSize:"small"})}),C.jsx(Gt,{sx:Dw.button,"aria-label":"Edit",onClick:b,size:"large",children:C.jsx(qO,{fontSize:"small"})}),C.jsx(Gt,{sx:Dw.button,"aria-label":"Delete",disabled:s.length<2,onClick:w,size:"large",children:C.jsx(ZYe,{fontSize:"small"})})]})}),C.jsxs(ed,{open:t,onClose:g,"aria-labelledby":"server-dialog-title",children:[C.jsx($y,{id:"server-dialog-title",children:I}),z,C.jsxs(Jb,{children:[C.jsx(Hr,{onClick:p,children:pe.get("Cancel")}),C.jsx(Hr,{onClick:h,autoFocus:!0,children:M})]})]})}const jHn=t=>({open:!!t.controlState.dialogOpen.server,servers:MDe(t),selectedServer:zi(t)}),BHn={closeDialog:WO,configureServers:FKt},UHn=Rn(jHn,BHn)(zHn),s2e=({anchorElement:t,layers:e,selectedLayerId:n,setSelectedLayerId:r,onClose:i})=>C.jsx(Ny,{anchorEl:t,keepMounted:!0,open:!!t,onClose:i,children:t&&e.map(o=>C.jsx(Br,{selected:o.id===n,onClick:()=>r(o.id===n?null:o.id),dense:!0,children:C.jsx(fu,{primary:BF(o)})},o.id))}),GG={settingsPanelTitle:t=>({marginBottom:t.spacing(1)}),settingsPanelPaper:t=>({backgroundColor:(t.palette.mode==="dark"?Eh:Oh)(t.palette.background.paper,.1),marginBottom:t.spacing(2)}),settingsPanelList:{margin:0}},qw=({title:t,children:e})=>{const n=he.Children.count(e),r=[];return he.Children.forEach(e,(i,o)=>{r.push(i),o{let i;e||(i={marginBottom:10});const o=C.jsx(fu,{primary:t,secondary:e});let s;return r&&(s=C.jsx(sA,{children:r})),n?C.jsxs(TPe,{style:i,onClick:n,children:[o,s]}):C.jsxs($_,{style:i,children:[o,s]})},Tv=({propertyName:t,settings:e,updateSettings:n,disabled:r})=>C.jsx(Zee,{checked:!!e[t],onChange:()=>n({...e,[t]:!e[t]}),disabled:r}),WHn=({propertyName:t,settings:e,updateSettings:n,options:r,disabled:i})=>{const o=(s,a)=>{n({...e,[t]:a})};return C.jsx(_4,{row:!0,value:e[t],onChange:o,children:r.map(([s,a])=>C.jsx(sg,{control:C.jsx(F_,{}),value:a,label:s,disabled:i},s))})},Iw={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}},a2e=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],VHn=[["point","Points"],["line","Lines"],["bar","Bars"]],GHn=({open:t,closeDialog:e,settings:n,selectedServer:r,baseMapLayers:i,overlayLayers:o,updateSettings:s,changeLocale:a,openDialog:l,viewerVersion:c,serverInfo:u})=>{const[f,d]=he.useState(null),[h,p]=he.useState(null),[g,m]=he.useState(null),[v,y]=he.useState(n.timeChunkSize+""),x=To();if(he.useEffect(()=>{const V=parseInt(v);!Number.isNaN(V)&&V!==n.timeChunkSize&&s({timeChunkSize:V})},[v,n,s]),!t)return null;function b(){e("settings")}function w(){l("server")}function _(V){s({timeAnimationInterval:parseInt(V.target.value)})}function S(V){s({timeSeriesChartTypeDefault:V.target.value})}function O(V){s({datasetLocateMode:V.target.value})}function k(V){s({placeLocateMode:V.target.value})}function E(V){y(V.target.value)}let P=null;f&&(P=Object.getOwnPropertyNames(pe.languages).map(V=>{const Y=pe.languages[V];return C.jsx(Br,{selected:V===n.locale,onClick:()=>a(V),children:C.jsx(fu,{primary:Y})},V)}));function A(V){d(V.currentTarget)}function R(){d(null)}function T(V){p(V.currentTarget)}function M(){p(null)}const I=V=>{V.stopPropagation(),l("userBaseMaps")},z=UF(i,n.selectedBaseMapId),F=BF(z);function N(V){m(V.currentTarget)}function L(){m(null)}const B=V=>{V.stopPropagation(),l("userOverlays")};function $(V){s({themeMode:V.target.value})}const j=UF(o,n.selectedOverlayId),X=BF(j);return C.jsxs("div",{children:[C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"sm",onClose:b,scroll:"body",children:[C.jsx($y,{children:pe.get("Settings")}),C.jsxs(Nf,{children:[C.jsxs(qw,{title:pe.get("General"),children:[C.jsx(ci,{label:pe.get("Server"),value:r.name,onClick:w}),C.jsx(ci,{label:pe.get("Language"),value:pe.languages[n.locale],onClick:A}),C.jsx(ci,{label:pe.get("Time interval of the player"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.timeAnimationInterval,onChange:_,margin:"normal",children:Ngt.map((V,Y)=>C.jsx(Br,{value:V,children:V+" ms"},Y))})}),C.jsx(ci,{label:pe.get("Appearance mode"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.themeMode||x.palette.mode,onChange:$,margin:"normal",children:jgt.map(([V,Y])=>C.jsx(Br,{value:V,children:pe.get(Y)},V))})})]}),C.jsxs(qw,{title:pe.get("Time-Series"),children:[C.jsx(ci,{label:pe.get("Show chart after adding a place"),value:N$(n.autoShowTimeSeries),children:C.jsx(Tv,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:s})}),C.jsx(ci,{label:pe.get("Default chart type"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.timeSeriesChartTypeDefault,onChange:S,margin:"normal",children:VHn.map(([V,Y])=>C.jsx(Br,{value:V,children:pe.get(Y)},V))})}),C.jsx(ci,{label:pe.get("Calculate standard deviation"),value:N$(n.timeSeriesIncludeStdev),children:C.jsx(Tv,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:s})}),C.jsx(ci,{label:pe.get("Calculate median instead of mean (disables standard deviation)"),value:N$(n.timeSeriesUseMedian),children:C.jsx(Tv,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:s})}),C.jsx(ci,{label:pe.get("Minimal number of data points in a time series update"),children:C.jsx(Jr,{variant:"standard",sx:Iw.intTextField,value:v,onChange:E,margin:"normal",size:"small"})})]}),C.jsxs(qw,{title:pe.get("Map"),children:[C.jsx(ci,{label:pe.get("Base map"),value:F,onClick:T,children:C.jsx(Hr,{onClick:I,children:pe.get("User Base Maps")+"..."})}),C.jsx(ci,{label:pe.get("Overlay"),value:X,onClick:N,children:C.jsx(Hr,{onClick:B,children:pe.get("User Overlays")+"..."})}),C.jsx(ci,{label:pe.get("Projection"),children:C.jsx(WHn,{propertyName:"mapProjection",settings:n,updateSettings:s,options:[[pe.get("Geographic"),nO],[pe.get("Mercator"),ite]]})}),C.jsx(ci,{label:pe.get("Image smoothing"),value:N$(n.imageSmoothingEnabled),children:C.jsx(Tv,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:s})}),C.jsx(ci,{label:pe.get("On dataset selection"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.datasetLocateMode,onChange:O,margin:"normal",children:a2e.map(([V,Y])=>C.jsx(Br,{value:V,children:pe.get(Y)},V))})}),C.jsx(ci,{label:pe.get("On place selection"),children:C.jsx(Jr,{variant:"standard",select:!0,sx:Iw.textField,value:n.placeLocateMode,onChange:k,margin:"normal",children:a2e.map(([V,Y])=>C.jsx(Br,{value:V,children:pe.get(Y)},V))})})]}),C.jsx(qw,{title:pe.get("Legal Agreement"),children:C.jsx(ci,{label:pe.get("Privacy notice"),value:n.privacyNoticeAccepted?pe.get("Accepted"):"",children:C.jsx(Hr,{disabled:!n.privacyNoticeAccepted,onClick:()=>{s({privacyNoticeAccepted:!1}),window.location.reload()},children:pe.get("Revoke consent")})})}),C.jsxs(qw,{title:pe.get("System Information"),children:[C.jsx(ci,{label:`xcube Viewer ${pe.get("version")}`,value:c}),C.jsx(ci,{label:`xcube Server ${pe.get("version")}`,value:u?u.version:pe.get("Cannot reach server")})]})]})]}),C.jsx(Ny,{anchorEl:f,keepMounted:!0,open:!!f,onClose:R,children:P}),C.jsx(s2e,{anchorElement:h,layers:i,selectedLayerId:n.selectedBaseMapId,setSelectedLayerId:V=>s({selectedBaseMapId:V}),onClose:M}),C.jsx(s2e,{anchorElement:g,layers:o,selectedLayerId:n.selectedOverlayId,setSelectedLayerId:V=>s({selectedOverlayId:V}),onClose:L})]})},N$=t=>t?pe.get("On"):pe.get("Off"),HHn=t=>({locale:t.controlState.locale,open:t.controlState.dialogOpen.settings,settings:t.controlState,baseMapLayers:hne(t),overlayLayers:pne(t),selectedServer:zi(t),viewerVersion:zUe,serverInfo:t.dataState.serverInfo}),qHn={closeDialog:WO,updateSettings:KR,changeLocale:z8e,openDialog:T1},XHn=Rn(HHn,qHn)(GHn),l2e={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})},YHn=({open:t,closeDialog:e,settings:n,updateSettings:r,downloadTimeSeries:i})=>{const o=()=>{e("export")};function s(c){r({exportFileName:c.target.value})}function a(c){r({exportTimeSeriesSeparator:c.target.value})}const l=()=>{o(),i()};return C.jsx("div",{children:C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[C.jsx(Nf,{children:C.jsxs(qw,{title:pe.get("Export Settings"),children:[C.jsx(ci,{label:pe.get("Include time-series data")+" (*.txt)",value:z$(n.exportTimeSeries),children:C.jsx(Tv,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),C.jsx(ci,{label:pe.get("Separator for time-series data"),children:C.jsx(Jr,{variant:"standard",sx:l2e.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:a,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),C.jsx(ci,{label:pe.get("Include places data")+" (*.geojson)",value:z$(n.exportPlaces),children:C.jsx(Tv,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),C.jsx(ci,{label:pe.get("Combine place data in one file"),value:z$(n.exportPlacesAsCollection),children:C.jsx(Tv,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),C.jsx(ci,{label:pe.get("As ZIP archive"),value:z$(n.exportZipArchive),children:C.jsx(Tv,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),C.jsx(ci,{label:pe.get("File name"),children:C.jsx(Jr,{variant:"standard",sx:l2e.fileNameTextField,value:n.exportFileName,onChange:s,margin:"normal",size:"small"})})]})}),C.jsx(Jb,{children:C.jsx(Hr,{onClick:l,disabled:!ZHn(n),children:pe.get("Download")})})]})})},z$=t=>t?pe.get("On"):pe.get("Off"),QHn=t=>/^[0-9a-zA-Z_-]+$/.test(t),KHn=t=>t.toUpperCase()==="TAB"||t.length===1,ZHn=t=>(t.exportTimeSeries||t.exportPlaces)&&QHn(t.exportFileName)&&(!t.exportTimeSeries||KHn(t.exportTimeSeriesSeparator)),JHn=t=>({locale:t.controlState.locale,open:!!t.controlState.dialogOpen.export,settings:t.controlState}),eqn={closeDialog:WO,updateSettings:KR,downloadTimeSeries:HKt},tqn=Rn(JHn,eqn)(YHn),nqn=lt(C.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),rqn=lt(C.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),iqn=({title:t,accept:e,multiple:n,disabled:r,onSelect:i,className:o})=>{const s=D.useRef(null),a=c=>{if(c.target.files!==null&&c.target.files.length){const u=[];for(let f=0;f{s.current!==null&&s.current.click()};return C.jsxs(C.Fragment,{children:[C.jsx("input",{type:"file",accept:e,multiple:n,ref:s,hidden:!0,onChange:a,disabled:r}),C.jsx(Hr,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:t})]})},HG={parse:t=>t,format:t=>typeof t=="string"?t:`${t}`,validate:t=>!0};function yue(){return t=>{const{options:e,updateOptions:n,optionKey:r,label:i,style:o,className:s,disabled:a,parse:l,format:c,validate:u}=t,f=e[r],d=h=>{const p=h.target.value,g=(l||HG.parse)(p);n({[r]:g})};return C.jsx(Jr,{label:pe.get(i),value:(c||HG.format)(f),error:!(u||HG.validate)(f),onChange:d,style:o,className:s,disabled:a,size:"small",variant:"standard"})}}const B2=yue(),oqn=oa("div")(({theme:t})=>({paddingTop:t.spacing(2)})),sqn=({options:t,updateOptions:e})=>C.jsx(oqn,{children:C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(B2,{optionKey:"timeNames",label:"Time property names",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(B2,{label:"Group property names",optionKey:"groupNames",options:t,updateOptions:e}),C.jsx(B2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e}),C.jsx(B2,{label:"Label property names",optionKey:"labelNames",options:t,updateOptions:e}),C.jsx(B2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e})]})}),fa=yue(),aqn=oa("div")(({theme:t})=>({paddingTop:t.spacing(2)})),lqn=({options:t,updateOptions:e})=>{const n=t.forceGeometry;return C.jsxs(aqn,{children:[C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(fa,{optionKey:"xNames",label:"X/longitude column names",options:t,updateOptions:e,disabled:n}),C.jsx(fa,{optionKey:"yNames",label:"Y/latitude column names",options:t,updateOptions:e,disabled:n}),C.jsxs("span",{children:[C.jsx(FF,{checked:t.forceGeometry,onChange:r=>e({forceGeometry:r.target.checked}),size:"small"}),C.jsx("span",{children:"Use geometry column"})]}),C.jsx(fa,{optionKey:"geometryNames",label:"Geometry column names",options:t,updateOptions:e,disabled:!n}),C.jsx(fa,{optionKey:"timeNames",label:"Time column names",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(fa,{optionKey:"groupNames",label:"Group column names",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"groupPrefix",label:"Group prefix (used as fallback)",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"labelNames",label:"Label column names",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"labelPrefix",label:"Label prefix (used as fallback)",options:t,updateOptions:e})]}),C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto auto"},children:[C.jsx(fa,{optionKey:"separator",label:"Separator character",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"comment",label:"Comment character",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"quote",label:"Quote character",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"escape",label:"Escape character",options:t,updateOptions:e}),C.jsx("div",{}),C.jsxs("span",{children:[C.jsx(FF,{checked:t.trim,onChange:r=>e({trim:r.target.checked}),size:"small"}),C.jsx("span",{children:"Remove whitespaces"})]}),C.jsx(fa,{optionKey:"nanToken",label:"Not-a-number token",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"trueToken",label:"True token",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"falseToken",label:"False token",options:t,updateOptions:e})]})]})},U2=yue(),cqn=oa("div")(({theme:t})=>({paddingTop:t.spacing(2)})),uqn=({options:t,updateOptions:e})=>C.jsx(cqn,{children:C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(U2,{optionKey:"time",label:"Time (UTC, ISO-format)",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(U2,{label:"Group",options:t,optionKey:"group",updateOptions:e}),C.jsx(U2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e,disabled:t.group.trim()!==""}),C.jsx(U2,{label:"Label",optionKey:"label",options:t,updateOptions:e}),C.jsx(U2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e,disabled:t.label.trim()!==""})]})}),qG={csv:{...LMe,codeExt:[]},geojson:{...$Me,codeExt:[dHe()]},wkt:{...zMe,codeExt:[]}},XG={spacer:{flexGrow:1},actionButton:t=>({marginRight:t.spacing(1)}),error:{fontSize:"small"}},fqn=oa("div")(({theme:t})=>({paddingTop:t.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),dqn=oa(iqn)(({theme:t})=>({marginRight:t.spacing(1)})),hqn=({open:t,closeDialog:e,userPlacesFormatName:n,userPlacesFormatOptions:r,updateSettings:i,addUserPlacesFromText:o,nextMapInteraction:s,setMapInteraction:a})=>{const[l,c]=D.useState(""),[u,f]=D.useState(null),[d,h]=D.useState(!1),[p,g]=D.useState(!1),[m,v]=D.useState(n),[y,x]=D.useState(r),b=To();if(D.useEffect(()=>{v(n)},[n]),D.useEffect(()=>{x(r)},[r]),!t)return null;const w=()=>{a("Select"),e("addUserPlacesFromText"),i({userPlacesFormatName:m,userPlacesFormatOptions:y}),o(l)},_=()=>{a(s),e("addUserPlacesFromText")},S=()=>{c("")},O=z=>{const F=z[0];h(!0);const N=new FileReader;N.onloadend=()=>{const L=N.result;v($he(L)),c(L),h(!1)},N.onabort=N.onerror=()=>{h(!1)},N.readAsText(F,"UTF-8")},k=()=>{c("")},E=()=>{console.info("PASTE!",l)},P=z=>{let F=m;l===""&&z.length>10&&(F=$he(z),v(F)),c(z),f(qG[F].checkError(z))};function A(z){v(z.target.value)}function R(z){x({...y,csv:{...y.csv,...z}})}function T(z){x({...y,geojson:{...y.geojson,...z}})}function M(z){x({...y,wkt:{...y.wkt,...z}})}let I;return m==="csv"?I=C.jsx(lqn,{options:y.csv,updateOptions:R}):m==="geojson"?I=C.jsx(sqn,{options:y.geojson,updateOptions:T}):I=C.jsx(uqn,{options:y.wkt,updateOptions:M}),C.jsxs(ed,{fullWidth:!0,open:t,onClose:_,"aria-labelledby":"server-dialog-title",children:[C.jsx($y,{id:"server-dialog-title",children:pe.get("Import places")}),C.jsxs(Nf,{dividers:!0,children:[C.jsxs(_4,{row:!0,value:m,onChange:z=>A(z),children:[C.jsx(sg,{value:"csv",label:pe.get(LMe.name),control:C.jsx(F_,{})},"csv"),C.jsx(sg,{value:"geojson",label:pe.get($Me.name),control:C.jsx(F_,{})},"geojson"),C.jsx(sg,{value:"wkt",label:pe.get(zMe.name),control:C.jsx(F_,{})},"wkt")]}),C.jsx(zU,{theme:b.palette.mode,placeholder:pe.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:qG[m].codeExt,value:l,onChange:P,onDrop:k,onPaste:E,onPasteCapture:E}),u&&C.jsx(Jt,{color:"error",sx:XG.error,children:u}),C.jsxs(fqn,{children:[C.jsx(dqn,{title:pe.get("From File")+"...",accept:qG[m].fileExt,multiple:!1,onSelect:O,disabled:d}),C.jsx(Hr,{onClick:S,disabled:l.trim()===""||d,sx:XG.actionButton,variant:"outlined",size:"small",children:pe.get("Clear")}),C.jsx(ot,{sx:XG.spacer}),C.jsx(Hr,{onClick:()=>g(!p),endIcon:p?C.jsx(rqn,{}):C.jsx(nqn,{}),variant:"outlined",size:"small",children:pe.get("Options")})]}),C.jsx(MF,{in:p,timeout:"auto",unmountOnExit:!0,children:I})]}),C.jsxs(Jb,{children:[C.jsx(Hr,{onClick:_,variant:"text",children:pe.get("Cancel")}),C.jsx(Hr,{onClick:w,disabled:l.trim()===""||u!==null||d,variant:"text",children:pe.get("OK")})]})]})},pqn=t=>({open:t.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:t.controlState.userPlacesFormatName,userPlacesFormatOptions:t.controlState.userPlacesFormatOptions,nextMapInteraction:t.controlState.lastMapInteraction}),gqn={closeDialog:WO,updateSettings:KR,setMapInteraction:E8e,addUserPlacesFromText:VUe},mqn=Rn(pqn,gqn)(hqn),JYe=lt(C.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 xue(t,e){return eQe(t,e,[]).join("")}function eQe(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)eQe(r,e,n)}return n}function vqn(t){return"documentElement"in t}function yqn(t){return new DOMParser().parseFromString(t,"application/xml")}function tQe(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 Hl(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName,l=void 0;a in s?l=s[a]:(l=[],s[a]=l),l.push(o)}}}function Lt(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName;s[a]=o}}}function Es(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(fj(o)){const s=o.Title,a=o.OnlineResource;s&&a?i=`© ${s}`:a?i=`${a}`:s&&(i=`${s}`)}return{name:n,title:r,attribution:i}})}function aXn(t){const e=rXn.read(t);if(fj(e)){const n=e.Capability;if(fj(n))return gJ(n,!0)}throw new Error("invalid WMSCapabilities object")}function gJ(t,e){let n,r;if(e)n=t.Layer;else{const{Layer:o,...s}=t;n=o,r=s}let i;return Array.isArray(n)?i=n.flatMap(o=>gJ(o)):fj(n)?i=gJ(n):i=[{}],i.map(o=>lXn(r,o))}function lXn(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 fj(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const cXn=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=D.useState(t.url),[o,s]=D.useState(null),[a,l]=D.useState(-1);D.useEffect(()=>{iXn(r).then(f=>{s(f)})},[r]),D.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&&a!=-1,u=()=>{o&&a!==-1&&e({...t,group:rte,title:o[a].title,url:r.trim(),attribution:o[a].attribution,wms:{layerName:o[a].name}})};return C.jsxs(ot,{sx:{display:"flex",gap:2,flexDirection:"column",padding:"5px 15px"},children:[C.jsx(Jr,{required:!0,label:pe.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),C.jsx(Hg,{disabled:!o||!o.length,variant:"standard",onChange:f=>l(f.target.value),value:a,size:"small",renderValue:()=>o&&o.length&&a>=0?o[a].title:pe.get("WMS Layer"),children:(o||[]).map((f,d)=>C.jsx(Br,{value:d,selected:a===d,children:C.jsx(fu,{primary:f.title})},f.name))}),C.jsx(iD,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:pe.get("docs/add-layer-wms.en.md")})]})},uXn=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=he.useState(t.title),[o,s]=he.useState(t.url),[a,l]=he.useState(t.attribution||""),c=(d,h)=>{const p=d!=="",g=h!==""&&(h.startsWith("http://")||h.trim().startsWith("https://"));return p&&g},u=()=>c(r.trim(),o.trim()),f=()=>e({...t,group:rte,title:r.trim(),url:o.trim(),attribution:a.trim()});return C.jsxs(ot,{sx:{display:"flex",gap:1,flexDirection:"column",padding:"5px 15px"},children:[C.jsx(Jr,{required:!0,label:pe.get("XYZ Layer URL"),variant:"standard",size:"small",value:o,fullWidth:!0,onChange:d=>s(d.currentTarget.value)}),C.jsxs(ot,{sx:{display:"flex",gap:1},children:[C.jsx(Jr,{required:!0,label:pe.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),C.jsx(Jr,{label:pe.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:a,onChange:d=>l(d.currentTarget.value)})]}),C.jsx(iD,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:pe.get("docs/add-layer-xyz.en.md")})]})},fXn={paper:t=>({backgroundColor:(t.palette.mode==="dark"?Eh:Oh)(t.palette.background.paper,.1),marginBottom:t.spacing(2)})},c2e=({userLayers:t,setUserLayers:e,selectedId:n,setSelectedId:r})=>{const[i,o]=he.useState(n),[s,a]=he.useState(null),[l,c]=r9e();if(!open)return null;const u=x=>{c(()=>e(t)),a({editId:x.id,editMode:"edit"})},f=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);e([...t.slice(0,b+1),{...x,id:Uf("user-layer"),title:x.title+" Copy"},...t.slice(b+1)])},d=x=>{c(void 0);const b=t.findIndex(w=>w.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=Uf("user-layer-");e([...t,{id:b,group:rte,title:"",url:"",attribution:"",wms:x==="wms"?{layerName:""}:void 0}]),a({editId:b,editMode:"add"})},p=()=>{h("wms")},g=()=>{h("xyz")},m=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);n===x.id&&r(i),e([...t.slice(0,b),x,...t.slice(b+1)]),a(null)},v=()=>{if(l(),s&&s.editMode==="add"){const x=t.findIndex(b=>b.id===s.editId);e([...t.slice(0,x),...t.slice(x+1)])}a(null)},y=s!==null;return C.jsx(kl,{sx:fXn.paper,children:C.jsxs(MM,{component:"nav",dense:!0,children:[t.map(x=>{const b=n===x.id;return s&&s.editId===x.id?x.wms?C.jsx(cXn,{userLayer:x,onChange:m,onCancel:v},x.id):C.jsx(uXn,{userLayer:x,onChange:m,onCancel:v},x.id):C.jsxs(TPe,{selected:b,onClick:()=>r(b?null:x.id),children:[C.jsx(fu,{primary:x.title,secondary:x.url}),C.jsxs(sA,{children:[C.jsx(Gt,{onClick:()=>u(x),size:"small",disabled:y,children:C.jsx(qO,{})}),C.jsx(Gt,{onClick:()=>f(x),size:"small",disabled:y,children:C.jsx(JYe,{})}),C.jsx(Gt,{onClick:()=>d(x),size:"small",disabled:y,children:C.jsx(VO,{})})]})]},x.id)}),!y&&C.jsx($_,{sx:{minHeight:"3em"},children:C.jsx(sA,{children:C.jsxs(ot,{sx:{display:"flex",gap:2,paddingTop:2},children:[C.jsx(Mt,{title:pe.get("Add layer from a Web Map Service"),children:C.jsx(Hr,{onClick:p,startIcon:C.jsx(pJ,{}),children:"WMS"})}),C.jsx(Mt,{title:pe.get("Add layer from a Tiled Web Map"),children:C.jsx(Hr,{onClick:g,startIcon:C.jsx(pJ,{}),children:"XYZ"})})]})})})]})})},dXn=({dialogId:t,open:e,closeDialog:n,settings:r,updateSettings:i})=>{const[o,s]=he.useState(t==="userBaseMaps"?0:1);if(!e)return null;const a=r.userBaseMaps,l=m=>{i({userBaseMaps:m})},c=r.userOverlays,u=m=>{i({userOverlays:m})},f=r.selectedBaseMapId,d=m=>{i({selectedBaseMapId:m})},h=r.selectedOverlayId,p=m=>{i({selectedOverlayId:m})};function g(){n(t)}return C.jsxs(ed,{open:e,fullWidth:!0,maxWidth:"sm",onClose:g,scroll:"body",children:[C.jsx($y,{children:pe.get("User Layers")}),C.jsxs(Nf,{children:[C.jsx(ot,{sx:{borderBottom:1,borderColor:"divider"},children:C.jsxs(O4,{value:o,onChange:(m,v)=>s(v),children:[C.jsx(sb,{label:"Base Maps"}),C.jsx(sb,{label:"Overlays"})]})}),o===0&&C.jsx(c2e,{userLayers:a,setUserLayers:l,selectedId:f,setSelectedId:d},"baseMaps"),o===1&&C.jsx(c2e,{userLayers:c,setUserLayers:u,selectedId:h,setSelectedId:p},"overlays")]})]})},hXn=(t,e)=>({open:t.controlState.dialogOpen[e.dialogId],settings:t.controlState,dialogId:e.dialogId}),pXn={closeDialog:WO,updateSettings:KR},u2e=Rn(hXn,pXn)(dXn);function sQe({selected:t,title:e,actions:n}){return C.jsxs(C4,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t&&{background:r=>kt(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[C.jsx(PQ,{}),C.jsx(Jt,{sx:{flex:"1 1 100%",paddingLeft:1},children:e}),n]})}const gXn={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function mXn({userVariables:t,setUserVariables:e,selectedIndex:n,setSelectedIndex:r,setEditedVariable:i}){const o=n>=0?t[n]:null,s=n>=0,a=d=>{r(n!==d?d:-1)},l=()=>{i({editMode:"add",variable:nrn()})},c=()=>{const d=t[n];e([...t.slice(0,n+1),rrn(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 C.jsxs(C.Fragment,{children:[C.jsx(sQe,{selected:n!==null,title:pe.get("Manage user variables"),actions:C.jsxs(C.Fragment,{children:[C.jsx(Mt,{title:pe.get("Add user variable"),children:C.jsx(Gt,{color:"primary",onClick:l,children:C.jsx(kU,{})})}),s&&C.jsx(Mt,{title:pe.get("Duplicate user variable"),children:C.jsx(Gt,{onClick:c,children:C.jsx(JYe,{})})}),s&&C.jsx(Mt,{title:pe.get("Edit user variable"),children:C.jsx(Gt,{onClick:u,children:C.jsx(qO,{})})}),s&&C.jsx(Mt,{title:pe.get("Remove user variable"),children:C.jsx(Gt,{onClick:f,children:C.jsx(ZYe,{})})})]})}),C.jsx(NPe,{sx:gXn.tableContainer,children:C.jsxs(Jee,{size:"small",children:[C.jsx(Ift,{children:C.jsxs(Ad,{children:[C.jsx(ui,{sx:{width:"15%"},children:pe.get("Name")}),C.jsx(ui,{sx:{width:"15%"},children:pe.get("Title")}),C.jsx(ui,{sx:{width:"10%"},children:pe.get("Units")}),C.jsx(ui,{children:pe.get("Expression")})]})}),C.jsx(ete,{children:t.map((d,h)=>C.jsxs(Ad,{hover:!0,selected:h===n,onClick:()=>a(h),children:[C.jsx(ui,{component:"th",scope:"row",children:d.name}),C.jsx(ui,{children:d.title}),C.jsx(ui,{children:d.units}),C.jsx(ui,{children:d.expression||""})]},d.id))})]})})]})}const vXn=lt(C.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),yXn=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function xXn(t){return yXn.test(t)}const f2e={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function d2e({part:t,partType:e,onPartClicked:n}){return C.jsx(ot,{component:"span",sx:f2e.expressionPart,children:C.jsx(pPe,{label:t,sx:f2e.expressionPartChip,size:"small",variant:"outlined",color:e==="variables"||e==="constants"?"default":e.includes("Functions")?"primary":"secondary",onClick:()=>n(t)})})}function bXn({anchorEl:t,exprPartTypes:e,setExprPartTypes:n,onClose:r}){const i=o=>{n({...e,[o]:!e[o]})};return C.jsx(Ny,{open:!!t,anchorEl:t,onClose:r,children:jWe.map(o=>C.jsx(KYe,{selected:e[o],title:pe.get(orn[o]),onClick:()=>i(o),dense:!0},o))})}function wXn({expression:t,onExpressionChange:e,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=Zb(),s=D.useRef(null),a=D.useCallback(c=>{var f;const u=(f=s.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)}},[]);D.useEffect(()=>{i.current=a},[i,a]);const l=D.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 C.jsx(zU,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:pe.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[sHe({override:[l]})],value:t,onChange:e,ref:s})}async function _Xn(t,e,n){if(n.trim()==="")return pe.get("Must not be empty");const r=`${t}/expressions/validate/${lO(e)}/${encodeURIComponent(n)}`;try{return await aRe(r),null}catch(i){const o=i.message;if(o){const s=o.indexOf("("),a=o.lastIndexOf(")");return o.slice(s>=0?s+1:0,a>=0?a:o.length)}return pe.get("Invalid expression")}}const j$={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 SXn({userVariables:t,setUserVariables:e,editedVariable:n,setEditedVariable:r,contextDataset:i,expressionCapabilities:o,serverUrl:s}){const[a,l]=D.useState(irn),[c,u]=D.useState(null),f=[...t,...i.variables],d=i.variables.filter($=>!jM($)).map($=>$.name),{id:h,name:p,title:g,units:m,expression:v}=n.variable,y=f.findIndex($=>$.id!==h&&$.name===p)>=0,x=!xXn(p),b=y?pe.get("Already in use"):x?pe.get("Not a valid identifier"):null,w=!b,[_,S]=D.useState(null),k=w&&!_,E=D.useRef(null);D.useEffect(()=>{const $=setTimeout(()=>{_Xn(s,i.id,n.variable.expression).then(S)},500);return()=>{clearTimeout($)}},[s,i.id,n.variable.expression]);const P=($,j)=>{r({...n,variable:{...n.variable,[$]:j}})},A=()=>{if(n.editMode==="add")e([n.variable,...t]);else{const $=t.findIndex(j=>j.id===n.variable.id);if($>=0){const j=[...t];j[$]=n.variable,e(j)}}r(null)},R=()=>{r(null)},T=$=>{P("name",$.target.value)},M=$=>{P("title",$.target.value)},I=$=>{P("units",$.target.value)},z=$=>{P("expression",$)},F=$=>{E.current($)},N=$=>{u($.currentTarget)},L=()=>{u(null)},B=[C.jsx(Gt,{size:"small",onClick:N,children:C.jsx(Mt,{arrow:!0,title:pe.get("Display further elements to be used in expressions"),children:C.jsx(vXn,{})})},"filter")];return jWe.forEach($=>{a[$]&&($==="variables"?d.forEach(j=>{B.push(C.jsx(d2e,{part:j,partType:$,onPartClicked:F},`${$}-${j}`))}):o.namespace[$].forEach(j=>{B.push(C.jsx(d2e,{part:j,partType:$,onPartClicked:F},`${$}-${j}`))}))}),C.jsxs(C.Fragment,{children:[C.jsx(bXn,{anchorEl:c,exprPartTypes:a,setExprPartTypes:l,onClose:L}),C.jsx(sQe,{selected:!0,title:n.editMode==="add"?pe.get("Add user variable"):pe.get("Edit user variable"),actions:C.jsx(iD,{size:"medium",onDone:A,doneDisabled:!k,onCancel:R})}),C.jsxs(ot,{sx:j$.content,children:[C.jsxs(ot,{sx:j$.propertiesRow,children:[C.jsx(Jr,{sx:{flexGrow:.3},error:!w,helperText:b,size:"small",variant:"standard",label:pe.get("Name"),value:p,onChange:T}),C.jsx(Jr,{sx:{flexGrow:.6},size:"small",variant:"standard",label:pe.get("Title"),value:g,onChange:M}),C.jsx(Jr,{sx:{flexGrow:.1},size:"small",variant:"standard",label:pe.get("Units"),value:m,onChange:I})]}),C.jsxs(ot,{sx:j$.expressionRow,children:[C.jsx(Jt,{sx:$=>({paddingBottom:1,color:$.palette.text.secondary}),children:pe.get("Expression")}),C.jsx(wXn,{expression:v,onExpressionChange:z,variableNames:d,expressionCapabilities:o,handleInsertPartRef:E}),_&&C.jsx(Jt,{sx:{paddingBottom:1},color:"error",fontSize:"small",children:_}),C.jsx(ot,{sx:j$.expressionParts,children:B})]})]})]})}const h2e={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function CXn({open:t,closeDialog:e,selectedDataset:n,selectedVariableName:r,selectVariable:i,userVariables:o,updateDatasetUserVariables:s,expressionCapabilities:a,serverUrl:l}){const[c,u]=D.useState(o),[f,d]=D.useState(c.findIndex(v=>v.name===r)),[h,p]=D.useState(null);if(D.useEffect(()=>{u(o)},[o]),!t||!n||!a)return null;function g(){s(n.id,c),e(Q5),f>=0&&i(c[f].name)}function m(){u(o),e(Q5)}return C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"md",onClose:m,scroll:"body",children:[C.jsx($y,{children:pe.get("User Variables")}),C.jsx(Nf,{dividers:!0,sx:h2e.dialogContent,children:h===null?C.jsx(mXn,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):C.jsx(SXn,{userVariables:c,setUserVariables:u,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:a,serverUrl:l})}),C.jsxs(Jb,{sx:h2e.dialogActions,children:[C.jsx(ot,{children:C.jsx(i9e,{size:"medium",helpUrl:pe.get("docs/user-variables.en.md")})}),C.jsxs(ot,{children:[C.jsx(Hr,{onClick:m,children:pe.get("Cancel")}),C.jsx(Hr,{onClick:g,disabled:h!==null||!OXn(c),children:pe.get("OK")})]})]})]})}function OXn(t){const e=new Set;return t.forEach(n=>e.add(n.name)),e.size===t.length}const EXn=t=>({open:t.controlState.dialogOpen[Q5],selectedDataset:fo(t),selectedVariableName:a1(t),userVariables:q_t(t),expressionCapabilities:c_t(t),serverUrl:zi(t).url,themeMode:t.controlState.themeMode}),TXn={closeDialog:WO,selectVariable:x8e,updateDatasetUserVariables:yKt},kXn=Rn(EXn,TXn)(CXn),AXn=t=>({compact:Pn.instance.branding.compact,themeMode:t.controlState.themeMode}),PXn={},MXn=({compact:t,themeMode:e})=>{const n=Tee("(prefers-color-scheme: dark)")?"dark":"light",r=D.useMemo(()=>{const i=BMe(e,n);return n4({typography:{fontSize:12,htmlFontSize:14},palette:{mode:i,primary:Pn.instance.branding.primaryColor,secondary:Pn.instance.branding.secondaryColor}})},[e,n]);return C.jsx(Wmt,{children:C.jsx(Qet,{injectFirst:!0,children:C.jsxs(yrt,{theme:r,children:[C.jsx(lat,{}),!t&&C.jsx(qnn,{}),C.jsx(mHn,{}),C.jsx(kHn,{}),C.jsx(UHn,{}),C.jsx(XHn,{}),C.jsx(u2e,{dialogId:"userOverlays"},"userOverlays"),C.jsx(u2e,{dialogId:"userBaseMaps"},"userBaseMaps"),C.jsx(kXn,{}),C.jsx(mqn,{}),C.jsx(tqn,{}),C.jsx(wHn,{}),C.jsx(NHn,{})]})})})},RXn=Rn(AXn,PXn)(MXn);function DXn(t,e,n){switch(t===void 0&&(t=Bgt()),e.type){case Jae:{const{controlState:r}=e.persistedState.state;return{...t,...r}}case fle:{const r={...t,...e.settings};return vd(r),r}case U8e:return vd(t),t;case JA:{let r=t.selectedDatasetId||Up.get("dataset"),i=t.selectedVariableName||Up.get("variable"),o=t.mapInteraction,s=dA(e.datasets,r);const a=s&&Lq(s,i)||null;return s?a||(i=s.variables.length?s.variables[0].name:null):(r=null,i=null,s=e.datasets.length?e.datasets[0]:null,s&&(r=s.id,s.variables.length>0&&(i=s.variables[0].name))),r||(o="Select"),{...t,selectedDatasetId:r,selectedVariableName:i,mapInteraction:o}}case l8e:{let r=t.selectedVariableName;const i=dA(e.datasets,e.selectedDatasetId);!Lq(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const s=e.selectedDatasetId,a=fRe(i),l=a?a[1]:null;return{...t,selectedDatasetId:s,selectedVariableName:r,selectedTimeRange:a,selectedTime:l}}case d8e:{const{location:r}=e;return t.flyTo!==r?{...t,flyTo:r}:t}case h8e:{const r=e.selectedPlaceGroupIds;return{...t,selectedPlaceGroupIds:r,selectedPlaceId:null}}case p8e:{const{placeId:r}=e;return{...t,selectedPlaceId:r}}case y8e:return{...t,selectedVariableName:e.selectedVariableName};case g8e:return{...t,layerVisibilities:{...t.layerVisibilities,[e.layerId]:e.visible}};case m8e:{const{mapPointInfoBoxEnabled:r}=e;return{...t,mapPointInfoBoxEnabled:r}}case v8e:{const{variableCompareMode:r}=e;return{...t,variableCompareMode:r,variableSplitPos:void 0}}case ale:{const{variableSplitPos:r}=e;return{...t,variableSplitPos:r}}case w8e:{let{selectedTime:r}=e;if(r!==null&&n){const i=Zq(n),o=i?cDe(i,r):-1;o>=0&&(r=i[o])}return t.selectedTime!==r?{...t,selectedTime:r}:t}case _8e:{if(n){let r=lIe(n);if(r>=0){const i=Zq(n);r+=e.increment,r<0&&(r=i.length-1),r>i.length-1&&(r=0);let o=i[r];const s=t.selectedTimeRange;if(s!==null&&(os[1]&&(o=s[1])),t.selectedTime!==o)return{...t,selectedTime:o}}}return t}case lle:return{...t,selectedTimeRange:e.selectedTimeRange};case uZt:return{...t,timeSeriesUpdateMode:e.timeSeriesUpdateMode};case C8e:return{...t,timeAnimationActive:e.timeAnimationActive,timeAnimationInterval:e.timeAnimationInterval};case tle:{const{id:r,selected:i}=e;return i?IXn(t,wf,r):t}case nle:{const{placeGroups:r}=e;return r.length>0?{...t,selectedPlaceGroupIds:[...t.selectedPlaceGroupIds||[],r[0].id]}:t}case rle:{const{placeGroupId:r,newName:i}=e;return r===wf?{...t,userDrawnPlaceGroupName:i}:t}case ile:{const{placeId:r,places:i}=e;if(r===t.selectedPlaceId){let o=null;const s=i.findIndex(a=>a.id===r);return s>=0&&(s0&&(o=i[s-1].id)),{...t,selectedPlaceId:o}}return t}case G8e:{const r=e.colorBarId;return{...t,userColorBars:[{id:r,type:"continuous",code:hRe},...t.userColorBars]}}case H8e:{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 vd(o),o}return t}case Y8e:{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 O8e:{let r={...t,mapInteraction:e.mapInteraction,lastMapInteraction:t.mapInteraction};return e.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...t.dialogOpen,addUserPlacesFromText:!0}}),r}case T8e:{const{layerMenuOpen:r}=e;return t={...t,layerMenuOpen:r},vd(t),t}case A8e:{const{sidebarPosition:r}=e;return t={...t,sidebarPosition:r},t}case P8e:{const{sidebarOpen:r}=e;return t={...t,sidebarOpen:r},vd(t),t}case M8e:{const{sidebarPanelId:r}=e;return t={...t,sidebarPanelId:r},vd(t),t}case R8e:return t={...t,volumeRenderMode:e.volumeRenderMode},vd(t),t;case D8e:{const{volumeId:r,volumeState:i}=e;return t={...t,volumeStates:{...t.volumeStates,[r]:i}},t}case I8e:{const r={...t.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:e.visibleElements.includes(i)}}),t={...t,infoCardElementStates:r},vd(t),t}case L8e:{const{elementType:r,viewMode:i}=e,o={...t,infoCardElementStates:{...t.infoCardElementStates,[r]:{...t.infoCardElementStates[r],viewMode:i}}};return vd(o),o}case $8e:return{...t,activities:{...t.activities,[e.id]:e.message}};case F8e:{const r={...t.activities};return delete r[e.id],{...t,activities:r}}case N8e:{const r=e.locale;return pe.locale=r,r!==t.locale&&(t={...t,locale:r},vd(t)),t}case j8e:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!0}}}case B8e:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!1}}}case b8e:{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 ole:if(t.selectedServerId!==e.selectedServerId)return{...t,selectedServerId:e.selectedServerId}}return t}function IXn(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 LXn(){const t=Rgt(),e=[{...Pn.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 $Xn(t,e){switch(t===void 0&&(t=LXn()),e.type){case Jae:{const{dataState:n}=e.persistedState.state;return{...t,...n}}case X5:return{...t,serverInfo:e.serverInfo};case n8e:return{...t,expressionCapabilities:e.expressionCapabilities};case JA:return{...t,datasets:e.datasets};case WUe:{const{datasetId:n,userVariables:r}=e,i=t.datasets.findIndex(l=>l.id===n),o=t.datasets[i],[s,a]=Fte(o);return{...t,datasets:[...t.datasets.slice(0,i),{...o,variables:[...s,...r]},...t.datasets.slice(i+1)]}}case i8e:{const{datasetId:n,variableName:r,colorBarName:i,colorBarMinMax:o,colorBarNorm:s,opacity:a}=e,l={colorBarName:i,colorBarMin:o[0],colorBarMax:o[1],colorBarNorm:s,opacity:a};return p2e(t,n,r,l)}case s8e:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=e;return p2e(t,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case ele:{const n=e.placeGroup,r=t.datasets.map(i=>{if(i.placeGroups){const o=i.placeGroups.findIndex(s=>s.id===n.id);if(o>=0){const s=[...i.placeGroups];return s[o]=n,{...i,placeGroups:s}}}return i});return{...t,datasets:r}}case tle:{const{placeGroupTitle:n,id:r,properties:i,geometry:o}=e,s={type:"Feature",id:r,properties:i,geometry:o},a=t.userPlaceGroups,l=a.findIndex(c=>c.id===wf);if(l>=0){const c=a[l];return{...t,userPlaceGroups:[...a.slice(0,l),{...c,features:[...c.features,s]},...a.slice(l+1)]}}else{const c=n&&n!==""?n:pe.get("My places");return{...t,userPlaceGroups:[{type:"FeatureCollection",id:wf,title:c,features:[s]},...a]}}}case nle:{const{placeGroups:n}=e;return{...t,userPlaceGroups:[...t.userPlaceGroups,...n]}}case rle:{const{placeGroupId:n,newName:r}=e,i=t.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o];return{...t,userPlaceGroups:[...i.slice(0,o),{...s,title:r},...i.slice(o+1)]}}return t}case GUe:{const{placeGroupId:n,placeId:r,newName:i}=e,o=t.userPlaceGroups,s=m2e(o,n,r,{label:i});return s?{...t,userPlaceGroups:s}:t}case HUe:{const{placeGroupId:n,placeId:r,placeStyle:i}=e,o=t.userPlaceGroups,s=m2e(o,n,r,i);return s?{...t,userPlaceGroups:s}:t}case ile:{const{placeGroupId:n,placeId:r}=e,i=t.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o],a=s.features.findIndex(l=>l.id===r);if(a>=0){const l=g2e(t.timeSeriesGroups,[r]);let c=t.timeSeriesGroups;return l.forEach(u=>{c=KG(c,u,"remove","append")}),{...t,userPlaceGroups:[...i.slice(0,o),{...s,features:[...s.features.slice(0,a),...s.features.slice(a+1)]},...i.slice(o+1)],timeSeriesGroups:c}}}return t}case qUe:{const{placeGroupId:n}=e,r=t.userPlaceGroups,i=r.findIndex(o=>o.id===n);if(i>=0){const s=r[i].features.map(c=>c.id),a=g2e(t.timeSeriesGroups,s);let l=t.timeSeriesGroups;return a.forEach(c=>{l=KG(l,c,"remove","append")}),{...t,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return t}case r8e:return{...t,colorBars:e.colorBars};case ZUe:{const{timeSeriesGroupId:n,timeSeries:r}=e,i=t.timeSeriesGroups,o=i.findIndex(l=>l.id===n),s=i[o],a=[...i];return a[o]={...s,timeSeriesArray:[...s.timeSeriesArray,r]},{...t,timeSeriesGroups:a}}case YUe:{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 QUe:{const{index:n}=e,r=t.statistics,i=r.records;return{...t,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case KUe:{const{timeSeries:n,updateMode:r,dataMode:i}=e,o=KG(t.timeSeriesGroups,n,r,i);return o!==t.timeSeriesGroups?{...t,timeSeriesGroups:o}:t}case JUe:{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 e8e:{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 t8e:return{...t,timeSeriesGroups:[]};case lle:{const{selectedGroupId:n,selectedValueRange:r}=e;if(!n)return t;const i=t.timeSeriesGroups.findIndex(s=>s.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 ole:return t.userServers!==e.servers?(Mgt(e.servers),{...t,userServers:e.servers}):t;default:return t}}function p2e(t,e,n,r){const i=t.datasets.findIndex(o=>o.id===e);if(i>=0){const o=t.datasets[i],s=o.variables.findIndex(a=>a.name===n);if(s>=0){const a=o.variables[s],l=t.datasets.slice(),c=o.variables.slice();return c[s]={...a,...r},l[i]={...o,variables:c},{...t,datasets:l}}}return t}function KG(t,e,n,r){let i=e,o;const s=t.findIndex(a=>a.variableUnits===i.source.variableUnits);if(s>=0){const a=t[s],l=a.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=[{...a,timeSeriesArray:u}]:n==="add"?(o=t.slice(),o[s]={...a,timeSeriesArray:u}):u.length>=0?(o=t.slice(),o[s]={...a,timeSeriesArray:u}):(o=t.slice(),o.splice(s,1))}else n==="replace"?o=[{id:Uf("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:Uf("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...t]:o=t;return o}function g2e(t,e){const n=[];return t.forEach(r=>{r.timeSeriesArray.forEach(i=>{e.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function m2e(t,e,n,r){const i=t.findIndex(o=>o.id===e);if(i>=0){const o=t[i],s=o.features,a=s.findIndex(l=>l.id===n);if(a>=0){const l=s[a];return[...t.slice(0,i),{...o,features:[...s.slice(0,a),{...l,properties:{...l.properties,...r}},...s.slice(a+1)]},...t.slice(i+1)]}}}function FXn(){return{newEntries:[],oldEntries:[]}}let NXn=0;function zXn(t,e){t===void 0&&(t=FXn());const n=t.newEntries;switch(e.type){case FUe:{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:++NXn,type:r,text:i},{...t,newEntries:[o,...n]})}case NUe:{const r=n.findIndex(i=>i.id===e.messageId);if(r>=0){const i=n[r],o=[...n];o.splice(r,1);const s=[i,...t.oldEntries];return{...t,newEntries:o,oldEntries:s}}}}return t}function jXn(){return{accessToken:null}}function BXn(t,e){switch(t===void 0&&(t=jXn()),e.type){case FWe:return{...t,accessToken:e.accessToken}}return t}function UXn(t,e){return{dataState:$Xn(t&&t.dataState,e),controlState:DXn(t&&t.controlState,e,t),messageLogState:zXn(t&&t.messageLogState,e),userAuthState:BXn(t&&t.userAuthState,e)}}console.debug("baseUrl:",RM);Pn.load().then(()=>{const t=(o,s)=>s.type!==ale,e=XJe.createLogger({collapsed:!0,diff:!1,predicate:t}),n=qJe(Kke,e),r=Yke(UXn,n),i=r.dispatch;i(z8e(r.getState().controlState.locale)),i(xZt()),r.getState().controlState.privacyNoticeAccepted&&i(sle(r,!0)),ZG.createRoot(document.getElementById("root")).render(C.jsx(VZe,{store:r,children:C.jsx(RXn,{})}))}); diff --git a/xcube/webapi/viewer/dist/index.html b/xcube/webapi/viewer/dist/index.html index 0ac917768..0c96f44b3 100644 --- a/xcube/webapi/viewer/dist/index.html +++ b/xcube/webapi/viewer/dist/index.html @@ -1,48 +1,48 @@ - - - - - - - - - - - - - - - xcube Viewer - + + + + + + + + + + + + + + + xcube Viewer + - - - -
- - + + + +
+ +