var uB=Object.defineProperty;var cB=(e,t,r)=>t in e?uB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var v6=(e,t,r)=>(cB(e,typeof t!="symbol"?t+"":t,r),r);function CI(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var bl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function I4(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={exports:{}},nn={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var tv=Symbol.for("react.element"),dB=Symbol.for("react.portal"),fB=Symbol.for("react.fragment"),hB=Symbol.for("react.strict_mode"),pB=Symbol.for("react.profiler"),mB=Symbol.for("react.provider"),vB=Symbol.for("react.context"),gB=Symbol.for("react.forward_ref"),yB=Symbol.for("react.suspense"),xB=Symbol.for("react.memo"),_B=Symbol.for("react.lazy"),g6=Symbol.iterator;function bB(e){return e===null||typeof e!="object"?null:(e=g6&&e[g6]||e["@@iterator"],typeof e=="function"?e:null)}var SI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},EI=Object.assign,kI={};function th(e,t,r){this.props=e,this.context=t,this.refs=kI,this.updater=r||SI}th.prototype.isReactComponent={};th.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};th.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function TI(){}TI.prototype=th.prototype;function R4(e,t,r){this.props=e,this.context=t,this.refs=kI,this.updater=r||SI}var O4=R4.prototype=new TI;O4.constructor=R4;EI(O4,th.prototype);O4.isPureReactComponent=!0;var y6=Array.isArray,PI=Object.prototype.hasOwnProperty,A4={current:null},MI={key:!0,ref:!0,__self:!0,__source:!0};function II(e,t,r){var n,i={},a=null,u=null;if(t!=null)for(n in t.ref!==void 0&&(u=t.ref),t.key!==void 0&&(a=""+t.key),t)PI.call(t,n)&&!MI.hasOwnProperty(n)&&(i[n]=t[n]);var o=arguments.length-2;if(o===1)i.children=r;else if(1>>1,ke=oe[Te];if(0>>1;Tei(Ne,Re))Dei(Ve,Ne)?(oe[Te]=Ve,oe[De]=Re,Te=De):(oe[Te]=Ne,oe[Ie]=Re,Te=Ie);else if(Dei(Ve,Re))oe[Te]=Ve,oe[De]=Re,Te=De;else break e}}return ye}function i(oe,ye){var Re=oe.sortIndex-ye.sortIndex;return Re!==0?Re:oe.id-ye.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var f=[],p=[],v=1,y=null,w=3,k=!1,T=!1,R=!1,A=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(oe){for(var ye=r(p);ye!==null;){if(ye.callback===null)n(p);else if(ye.startTime<=oe)n(p),ye.sortIndex=ye.expirationTime,t(f,ye);else break;ye=r(p)}}function L(oe){if(R=!1,N(oe),!T)if(r(f)!==null)T=!0,ne(B);else{var ye=r(p);ye!==null&&de(L,ye.startTime-oe)}}function B(oe,ye){T=!1,R&&(R=!1,I(H),H=-1),k=!0;var Re=w;try{for(N(ye),y=r(f);y!==null&&(!(y.expirationTime>ye)||oe&&!le());){var Te=y.callback;if(typeof Te=="function"){y.callback=null,w=y.priorityLevel;var ke=Te(y.expirationTime<=ye);ye=e.unstable_now(),typeof ke=="function"?y.callback=ke:y===r(f)&&n(f),N(ye)}else n(f);y=r(f)}if(y!==null)var ze=!0;else{var Ie=r(p);Ie!==null&&de(L,Ie.startTime-ye),ze=!1}return ze}finally{y=null,w=Re,k=!1}}var j=!1,G=null,H=-1,te=5,Y=-1;function le(){return!(e.unstable_now()-Yoe||125Te?(oe.sortIndex=Re,t(p,oe),r(f)===null&&oe===r(p)&&(R?(I(H),H=-1):R=!0,de(L,Re-Te))):(oe.sortIndex=ke,t(f,oe),T||k||(T=!0,ne(B))),oe},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(oe){var ye=w;return function(){var Re=w;w=ye;try{return oe.apply(this,arguments)}finally{w=Re}}}})(OI);(function(e){e.exports=OI})(RI);/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var AI=C.exports,ga=RI.exports;function Kt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),U2=Object.prototype.hasOwnProperty,kB=/^[: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]*$/,_6={},b6={};function TB(e){return U2.call(b6,e)?!0:U2.call(_6,e)?!1:kB.test(e)?b6[e]=!0:(_6[e]=!0,!1)}function PB(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function MB(e,t,r,n){if(t===null||typeof t>"u"||PB(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Bo(e,t,r,n,i,a,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=u}var so={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){so[e]=new Bo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];so[t]=new Bo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){so[e]=new Bo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){so[e]=new Bo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){so[e]=new Bo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){so[e]=new Bo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){so[e]=new Bo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){so[e]=new Bo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){so[e]=new Bo(e,5,!1,e.toLowerCase(),null,!1,!1)});var z4=/[\-:]([a-z])/g;function D4(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(z4,D4);so[t]=new Bo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(z4,D4);so[t]=new Bo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(z4,D4);so[t]=new Bo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){so[e]=new Bo(e,1,!1,e.toLowerCase(),null,!1,!1)});so.xlinkHref=new Bo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){so[e]=new Bo(e,1,!1,e.toLowerCase(),null,!0,!0)});function L4(e,t,r,n){var i=so.hasOwnProperty(t)?so[t]:null;(i!==null?i.type!==0:n||!(2o||i[u]!==a[o]){var f=` `+i[u].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=u&&0<=o);break}}}finally{ab=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vp(e):""}function IB(e){switch(e.tag){case 5:return Vp(e.type);case 16:return Vp("Lazy");case 13:return Vp("Suspense");case 19:return Vp("SuspenseList");case 0:case 2:case 15:return e=sb(e.type,!1),e;case 11:return e=sb(e.type.render,!1),e;case 1:return e=sb(e.type,!0),e;default:return""}}function q2(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case sf:return"Fragment";case af:return"Portal";case K2:return"Profiler";case F4:return"StrictMode";case H2:return"Suspense";case W2:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case DI:return(e.displayName||"Context")+".Consumer";case zI:return(e._context.displayName||"Context")+".Provider";case $4:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B4:return t=e.displayName||null,t!==null?t:q2(e.type)||"Memo";case pu:t=e._payload,e=e._init;try{return q2(e(t))}catch{}}return null}function RB(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q2(t);case 8:return t===F4?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function FI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OB(e){var t=FI(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(u){n=""+u,a.call(this,u)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(u){n=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hg(e){e._valueTracker||(e._valueTracker=OB(e))}function $I(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=FI(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function f0(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function G2(e,t){var r=t.checked;return ui({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r!=null?r:e._wrapperState.initialChecked})}function C6(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Vu(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function BI(e,t){t=t.checked,t!=null&&L4(e,"checked",t,!1)}function Z2(e,t){BI(e,t);var r=Vu(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?X2(e,t.type,r):t.hasOwnProperty("defaultValue")&&X2(e,t.type,Vu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function S6(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function X2(e,t,r){(t!=="number"||f0(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var jp=Array.isArray;function wf(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Wg.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _m(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Jp={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},AB=["Webkit","ms","Moz","O"];Object.keys(Jp).forEach(function(e){AB.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jp[t]=Jp[e]})});function KI(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Jp.hasOwnProperty(e)&&Jp[e]?(""+t).trim():t+"px"}function HI(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=KI(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var NB=ui({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 J2(e,t){if(t){if(NB[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Kt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Kt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Kt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Kt(62))}}function ew(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tw=null;function V4(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rw=null,Cf=null,Sf=null;function T6(e){if(e=iv(e)){if(typeof rw!="function")throw Error(Kt(280));var t=e.stateNode;t&&(t=k1(t),rw(e.stateNode,e.type,t))}}function WI(e){Cf?Sf?Sf.push(e):Sf=[e]:Cf=e}function qI(){if(Cf){var e=Cf,t=Sf;if(Sf=Cf=null,T6(e),t)for(e=0;e>>=0,e===0?32:31-(HB(e)/WB|0)|0}var qg=64,Gg=4194304;function Up(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function v0(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,u=r&268435455;if(u!==0){var o=u&~i;o!==0?n=Up(o):(a&=u,a!==0&&(n=Up(a)))}else u=r&~i,u!==0?n=Up(u):a!==0&&(n=Up(a));if(n===0)return 0;if(t!==0&&t!==n&&(t&i)===0&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if((n&4)!==0&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function rv(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vs(t),e[t]=r}function XB(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=tm),D6=String.fromCharCode(32),L6=!1;function hR(e,t){switch(e){case"keyup":return SV.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var lf=!1;function kV(e,t){switch(e){case"compositionend":return pR(t);case"keypress":return t.which!==32?null:(L6=!0,D6);case"textInput":return e=t.data,e===D6&&L6?null:e;default:return null}}function TV(e,t){if(lf)return e==="compositionend"||!Z4&&hR(e,t)?(e=dR(),By=W4=_u=null,lf=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=V6(r)}}function yR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xR(){for(var e=window,t=f0();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=f0(e.document)}return t}function X4(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function DV(e){var t=xR(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&yR(r.ownerDocument.documentElement,r)){if(n!==null&&X4(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=j6(r,a);var u=j6(r,n);i&&u&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(u.node,u.offset)):(t.setEnd(u.node,u.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,uf=null,lw=null,nm=null,uw=!1;function U6(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;uw||uf==null||uf!==f0(n)||(n=uf,"selectionStart"in n&&X4(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),nm&&km(nm,n)||(nm=n,n=x0(lw,"onSelect"),0ff||(e.current=mw[ff],mw[ff]=null,ff--)}function Un(e,t){ff++,mw[ff]=e.current,e.current=t}var ju={},xo=Yu(ju),Go=Yu(!1),Yc=ju;function Of(e,t){var r=e.type.contextTypes;if(!r)return ju;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Zo(e){return e=e.childContextTypes,e!=null}function b0(){Zn(Go),Zn(xo)}function X6(e,t,r){if(xo.current!==ju)throw Error(Kt(168));Un(xo,t),Un(Go,r)}function PR(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Kt(108,RB(e)||"Unknown",i));return ui({},r,n)}function w0(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ju,Yc=xo.current,Un(xo,e),Un(Go,Go.current),!0}function Y6(e,t,r){var n=e.stateNode;if(!n)throw Error(Kt(169));r?(e=PR(e,t,Yc),n.__reactInternalMemoizedMergedChildContext=e,Zn(Go),Zn(xo),Un(xo,e)):Zn(Go),Un(Go,r)}var gl=null,T1=!1,bb=!1;function MR(e){gl===null?gl=[e]:gl.push(e)}function GV(e){T1=!0,MR(e)}function Qu(){if(!bb&&gl!==null){bb=!0;var e=0,t=En;try{var r=gl;for(En=1;e>=u,i-=u,wl=1<<32-vs(t)+i|r<H?(te=G,G=null):te=G.sibling;var Y=w(I,G,N[H],L);if(Y===null){G===null&&(G=te);break}e&&G&&Y.alternate===null&&t(I,G),O=a(Y,O,H),j===null?B=Y:j.sibling=Y,j=Y,G=te}if(H===N.length)return r(I,G),ni&&Ac(I,H),B;if(G===null){for(;HH?(te=G,G=null):te=G.sibling;var le=w(I,G,Y.value,L);if(le===null){G===null&&(G=te);break}e&&G&&le.alternate===null&&t(I,G),O=a(le,O,H),j===null?B=le:j.sibling=le,j=le,G=te}if(Y.done)return r(I,G),ni&&Ac(I,H),B;if(G===null){for(;!Y.done;H++,Y=N.next())Y=y(I,Y.value,L),Y!==null&&(O=a(Y,O,H),j===null?B=Y:j.sibling=Y,j=Y);return ni&&Ac(I,H),B}for(G=n(I,G);!Y.done;H++,Y=N.next())Y=k(G,I,H,Y.value,L),Y!==null&&(e&&Y.alternate!==null&&G.delete(Y.key===null?H:Y.key),O=a(Y,O,H),j===null?B=Y:j.sibling=Y,j=Y);return e&&G.forEach(function(J){return t(I,J)}),ni&&Ac(I,H),B}function A(I,O,N,L){if(typeof N=="object"&&N!==null&&N.type===sf&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case Kg:e:{for(var B=N.key,j=O;j!==null;){if(j.key===B){if(B=N.type,B===sf){if(j.tag===7){r(I,j.sibling),O=i(j,N.props.children),O.return=I,I=O;break e}}else if(j.elementType===B||typeof B=="object"&&B!==null&&B.$$typeof===pu&&ik(B)===j.type){r(I,j.sibling),O=i(j,N.props),O.ref=Pp(I,j,N),O.return=I,I=O;break e}r(I,j);break}else t(I,j);j=j.sibling}N.type===sf?(O=Zc(N.props.children,I.mode,L,N.key),O.return=I,I=O):(L=Gy(N.type,N.key,N.props,null,I.mode,L),L.ref=Pp(I,O,N),L.return=I,I=L)}return u(I);case af:e:{for(j=N.key;O!==null;){if(O.key===j)if(O.tag===4&&O.stateNode.containerInfo===N.containerInfo&&O.stateNode.implementation===N.implementation){r(I,O.sibling),O=i(O,N.children||[]),O.return=I,I=O;break e}else{r(I,O);break}else t(I,O);O=O.sibling}O=Mb(N,I.mode,L),O.return=I,I=O}return u(I);case pu:return j=N._init,A(I,O,j(N._payload),L)}if(jp(N))return T(I,O,N,L);if(Cp(N))return R(I,O,N,L);ty(I,N)}return typeof N=="string"&&N!==""||typeof N=="number"?(N=""+N,O!==null&&O.tag===6?(r(I,O.sibling),O=i(O,N),O.return=I,I=O):(r(I,O),O=Pb(N,I.mode,L),O.return=I,I=O),u(I)):r(I,O)}return A}var Nf=LR(!0),FR=LR(!1),ov={},Us=Yu(ov),Im=Yu(ov),Rm=Yu(ov);function Uc(e){if(e===ov)throw Error(Kt(174));return e}function oS(e,t){switch(Un(Rm,t),Un(Im,e),Un(Us,ov),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Q2(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Q2(t,e)}Zn(Us),Un(Us,t)}function zf(){Zn(Us),Zn(Im),Zn(Rm)}function $R(e){Uc(Rm.current);var t=Uc(Us.current),r=Q2(t,e.type);t!==r&&(Un(Im,e),Un(Us,r))}function aS(e){Im.current===e&&(Zn(Us),Zn(Im))}var si=Yu(0);function P0(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var wb=[];function sS(){for(var e=0;er?r:4,e(!0);var n=Cb.transition;Cb.transition={};try{e(!1),t()}finally{En=r,Cb.transition=n}}function t7(){return Wa().memoizedState}function QV(e,t,r){var n=Nu(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},r7(e))n7(t,r);else if(r=AR(e,t,r,n),r!==null){var i=No();gs(r,e,n,i),i7(r,t,n)}}function JV(e,t,r){var n=Nu(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(r7(e))n7(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var u=t.lastRenderedState,o=a(u,r);if(i.hasEagerState=!0,i.eagerState=o,xs(o,u)){var f=t.interleaved;f===null?(i.next=i,nS(t)):(i.next=f.next,f.next=i),t.interleaved=i;return}}catch{}finally{}r=AR(e,t,i,n),r!==null&&(i=No(),gs(r,e,n,i),i7(r,t,n))}}function r7(e){var t=e.alternate;return e===li||t!==null&&t===li}function n7(e,t){im=M0=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function i7(e,t,r){if((r&4194240)!==0){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,U4(e,r)}}var I0={readContext:Ha,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useInsertionEffect:mo,useLayoutEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useMutableSource:mo,useSyncExternalStore:mo,useId:mo,unstable_isNewReconciler:!1},ej={readContext:Ha,useCallback:function(e,t){return Ds().memoizedState=[e,t===void 0?null:t],e},useContext:Ha,useEffect:ak,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ky(4194308,4,XR.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ky(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ky(4,2,e,t)},useMemo:function(e,t){var r=Ds();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ds();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=QV.bind(null,li,e),[n.memoizedState,e]},useRef:function(e){var t=Ds();return e={current:e},t.memoizedState=e},useState:ok,useDebugValue:fS,useDeferredValue:function(e){return Ds().memoizedState=e},useTransition:function(){var e=ok(!1),t=e[0];return e=YV.bind(null,e[1]),Ds().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=li,i=Ds();if(ni){if(r===void 0)throw Error(Kt(407));r=r()}else{if(r=t(),Xi===null)throw Error(Kt(349));(Jc&30)!==0||jR(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,ak(KR.bind(null,n,a,e),[e]),n.flags|=2048,Nm(9,UR.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ds(),t=Xi.identifierPrefix;if(ni){var r=Cl,n=wl;r=(n&~(1<<32-vs(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Om++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=u.createElement(r,{is:n.is}):(e=u.createElement(r),r==="select"&&(u=e,n.multiple?u.multiple=!0:n.size&&(u.size=n.size))):e=u.createElementNS(e,r),e[Ls]=t,e[Mm]=n,h7(e,t,!1,!1),t.stateNode=e;e:{switch(u=ew(r,n),r){case"dialog":Hn("cancel",e),Hn("close",e),i=n;break;case"iframe":case"object":case"embed":Hn("load",e),i=n;break;case"video":case"audio":for(i=0;iLf&&(t.flags|=128,n=!0,Mp(a,!1),t.lanes=4194304)}else{if(!n)if(e=P0(u),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Mp(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!ni)return vo(t),null}else 2*wi()-a.renderingStartTime>Lf&&r!==1073741824&&(t.flags|=128,n=!0,Mp(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(r=a.last,r!==null?r.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=wi(),t.sibling=null,r=si.current,Un(si,n?r&1|2:r&1),t):(vo(t),null);case 22:case 23:return yS(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&(t.mode&1)!==0?(da&1073741824)!==0&&(vo(t),t.subtreeFlags&6&&(t.flags|=8192)):vo(t),null;case 24:return null;case 25:return null}throw Error(Kt(156,t.tag))}function lj(e,t){switch(Q4(t),t.tag){case 1:return Zo(t.type)&&b0(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zf(),Zn(Go),Zn(xo),sS(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return aS(t),null;case 13:if(Zn(si),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Kt(340));Af()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zn(si),null;case 4:return zf(),null;case 10:return rS(t.type._context),null;case 22:case 23:return yS(),null;case 24:return null;default:return null}}var ny=!1,go=!1,uj=typeof WeakSet=="function"?WeakSet:Set,yr=null;function vf(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){hi(e,t,n)}else r.current=null}function Tw(e,t,r){try{r()}catch(n){hi(e,t,n)}}var mk=!1;function cj(e,t){if(cw=g0,e=xR(),X4(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var u=0,o=-1,f=-1,p=0,v=0,y=e,w=null;t:for(;;){for(var k;y!==r||i!==0&&y.nodeType!==3||(o=u+i),y!==a||n!==0&&y.nodeType!==3||(f=u+n),y.nodeType===3&&(u+=y.nodeValue.length),(k=y.firstChild)!==null;)w=y,y=k;for(;;){if(y===e)break t;if(w===r&&++p===i&&(o=u),w===a&&++v===n&&(f=u),(k=y.nextSibling)!==null)break;y=w,w=y.parentNode}y=k}r=o===-1||f===-1?null:{start:o,end:f}}else r=null}r=r||{start:0,end:0}}else r=null;for(dw={focusedElem:e,selectionRange:r},g0=!1,yr=t;yr!==null;)if(t=yr,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,yr=e;else for(;yr!==null;){t=yr;try{var T=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(T!==null){var R=T.memoizedProps,A=T.memoizedState,I=t.stateNode,O=I.getSnapshotBeforeUpdate(t.elementType===t.type?R:cs(t.type,R),A);I.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var N=t.stateNode.containerInfo;N.nodeType===1?N.textContent="":N.nodeType===9&&N.documentElement&&N.removeChild(N.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Kt(163))}}catch(L){hi(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,yr=e;break}yr=t.return}return T=mk,mk=!1,T}function om(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Tw(t,r,a)}i=i.next}while(i!==n)}}function I1(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Pw(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function v7(e){var t=e.alternate;t!==null&&(e.alternate=null,v7(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ls],delete t[Mm],delete t[pw],delete t[WV],delete t[qV])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function g7(e){return e.tag===5||e.tag===3||e.tag===4}function vk(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||g7(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mw(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=_0));else if(n!==4&&(e=e.child,e!==null))for(Mw(e,t,r),e=e.sibling;e!==null;)Mw(e,t,r),e=e.sibling}function Iw(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Iw(e,t,r),e=e.sibling;e!==null;)Iw(e,t,r),e=e.sibling}var no=null,ds=!1;function lu(e,t,r){for(r=r.child;r!==null;)y7(e,t,r),r=r.sibling}function y7(e,t,r){if(js&&typeof js.onCommitFiberUnmount=="function")try{js.onCommitFiberUnmount(w1,r)}catch{}switch(r.tag){case 5:go||vf(r,t);case 6:var n=no,i=ds;no=null,lu(e,t,r),no=n,ds=i,no!==null&&(ds?(e=no,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):no.removeChild(r.stateNode));break;case 18:no!==null&&(ds?(e=no,r=r.stateNode,e.nodeType===8?_b(e.parentNode,r):e.nodeType===1&&_b(e,r),Sm(e)):_b(no,r.stateNode));break;case 4:n=no,i=ds,no=r.stateNode.containerInfo,ds=!0,lu(e,t,r),no=n,ds=i;break;case 0:case 11:case 14:case 15:if(!go&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,u=a.destroy;a=a.tag,u!==void 0&&((a&2)!==0||(a&4)!==0)&&Tw(r,t,u),i=i.next}while(i!==n)}lu(e,t,r);break;case 1:if(!go&&(vf(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){hi(r,t,o)}lu(e,t,r);break;case 21:lu(e,t,r);break;case 22:r.mode&1?(go=(n=go)||r.memoizedState!==null,lu(e,t,r),go=n):lu(e,t,r);break;default:lu(e,t,r)}}function gk(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new uj),t.forEach(function(n){var i=xj.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ss(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=u),n&=~a}if(n=i,n=wi()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*fj(n/1960))-n,10e?16:e,bu===null)var n=!1;else{if(e=bu,bu=null,A0=0,(pn&6)!==0)throw Error(Kt(331));var i=pn;for(pn|=4,yr=e.current;yr!==null;){var a=yr,u=a.child;if((yr.flags&16)!==0){var o=a.deletions;if(o!==null){for(var f=0;fwi()-vS?Gc(e,0):mS|=r),Xo(e,t)}function k7(e,t){t===0&&((e.mode&1)===0?t=1:(t=Gg,Gg<<=1,(Gg&130023424)===0&&(Gg=4194304)));var r=No();e=Il(e,t),e!==null&&(rv(e,t,r),Xo(e,r))}function yj(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),k7(e,r)}function xj(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Kt(314))}n!==null&&n.delete(t),k7(e,r)}var T7;T7=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Go.current)qo=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return qo=!1,aj(e,t,r);qo=(e.flags&131072)!==0}else qo=!1,ni&&(t.flags&1048576)!==0&&IR(t,S0,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Hy(e,t),e=t.pendingProps;var i=Of(t,xo.current);kf(t,r),i=uS(null,t,n,e,i,r);var a=cS();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Zo(n)?(a=!0,w0(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,iS(t),i.updater=P1,t.stateNode=i,i._reactInternals=t,_w(t,n,e,r),t=Cw(null,t,n,!0,a,r)):(t.tag=0,ni&&a&&Y4(t),Ro(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Hy(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=bj(n),e=cs(n,e),i){case 0:t=ww(null,t,n,e,r);break e;case 1:t=fk(null,t,n,e,r);break e;case 11:t=ck(null,t,n,e,r);break e;case 14:t=dk(null,t,n,cs(n.type,e),r);break e}throw Error(Kt(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cs(n,i),ww(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cs(n,i),fk(e,t,n,i,r);case 3:e:{if(c7(t),e===null)throw Error(Kt(387));n=t.pendingProps,a=t.memoizedState,i=a.element,NR(e,t),T0(t,n,null,r);var u=t.memoizedState;if(n=u.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Df(Error(Kt(423)),t),t=hk(e,t,n,r,i);break e}else if(n!==i){i=Df(Error(Kt(424)),t),t=hk(e,t,n,r,i);break e}else for(ha=Ru(t.stateNode.containerInfo.firstChild),va=t,ni=!0,hs=null,r=FR(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Af(),n===i){t=Rl(e,t,r);break e}Ro(e,t,n,r)}t=t.child}return t;case 5:return $R(t),e===null&&gw(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,u=i.children,fw(n,i)?u=null:a!==null&&fw(n,a)&&(t.flags|=32),u7(e,t),Ro(e,t,u,r),t.child;case 6:return e===null&&gw(t),null;case 13:return d7(e,t,r);case 4:return oS(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Nf(t,null,n,r):Ro(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cs(n,i),ck(e,t,n,i,r);case 7:return Ro(e,t,t.pendingProps,r),t.child;case 8:return Ro(e,t,t.pendingProps.children,r),t.child;case 12:return Ro(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,u=i.value,Un(E0,n._currentValue),n._currentValue=u,a!==null)if(xs(a.value,u)){if(a.children===i.children&&!Go.current){t=Rl(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var o=a.dependencies;if(o!==null){u=a.child;for(var f=o.firstContext;f!==null;){if(f.context===n){if(a.tag===1){f=El(-1,r&-r),f.tag=2;var p=a.updateQueue;if(p!==null){p=p.shared;var v=p.pending;v===null?f.next=f:(f.next=v.next,v.next=f),p.pending=f}}a.lanes|=r,f=a.alternate,f!==null&&(f.lanes|=r),yw(a.return,r,t),o.lanes|=r;break}f=f.next}}else if(a.tag===10)u=a.type===t.type?null:a.child;else if(a.tag===18){if(u=a.return,u===null)throw Error(Kt(341));u.lanes|=r,o=u.alternate,o!==null&&(o.lanes|=r),yw(u,r,t),u=a.sibling}else u=a.child;if(u!==null)u.return=a;else for(u=a;u!==null;){if(u===t){u=null;break}if(a=u.sibling,a!==null){a.return=u.return,u=a;break}u=u.return}a=u}Ro(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,kf(t,r),i=Ha(i),n=n(i),t.flags|=1,Ro(e,t,n,r),t.child;case 14:return n=t.type,i=cs(n,t.pendingProps),i=cs(n.type,i),dk(e,t,n,i,r);case 15:return s7(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cs(n,i),Hy(e,t),t.tag=1,Zo(n)?(e=!0,w0(t)):e=!1,kf(t,r),DR(t,n,i),_w(t,n,i,r),Cw(null,t,n,!0,e,r);case 19:return f7(e,t,r);case 22:return l7(e,t,r)}throw Error(Kt(156,t.tag))};function P7(e,t){return eR(e,t)}function _j(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ba(e,t,r,n){return new _j(e,t,r,n)}function _S(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bj(e){if(typeof e=="function")return _S(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$4)return 11;if(e===B4)return 14}return 2}function zu(e,t){var r=e.alternate;return r===null?(r=Ba(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Gy(e,t,r,n,i,a){var u=2;if(n=e,typeof e=="function")_S(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case sf:return Zc(r.children,i,a,t);case F4:u=8,i|=8;break;case K2:return e=Ba(12,r,t,i|2),e.elementType=K2,e.lanes=a,e;case H2:return e=Ba(13,r,t,i),e.elementType=H2,e.lanes=a,e;case W2:return e=Ba(19,r,t,i),e.elementType=W2,e.lanes=a,e;case LI:return O1(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case zI:u=10;break e;case DI:u=9;break e;case $4:u=11;break e;case B4:u=14;break e;case pu:u=16,n=null;break e}throw Error(Kt(130,e==null?e:typeof e,""))}return t=Ba(u,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Zc(e,t,r,n){return e=Ba(7,e,n,t),e.lanes=r,e}function O1(e,t,r,n){return e=Ba(22,e,n,t),e.elementType=LI,e.lanes=r,e.stateNode={isHidden:!1},e}function Pb(e,t,r){return e=Ba(6,e,null,t),e.lanes=r,e}function Mb(e,t,r){return t=Ba(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function wj(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ub(0),this.expirationTimes=ub(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ub(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bS(e,t,r,n,i,a,u,o,f){return e=new wj(e,t,r,o,f),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ba(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},iS(a),e}function Cj(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}t(),e.exports=ba})(Zu);const rd=I4(Zu.exports),Pj=CI({__proto__:null,default:rd},[Zu.exports]);var Ek=Zu.exports;j2.createRoot=Ek.createRoot,j2.hydrateRoot=Ek.hydrateRoot;/** * @remix-run/router v1.3.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Dm(){return Dm=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ij(){return Math.random().toString(36).substr(2,8)}function Tk(e,t){return{usr:e.state,key:e.key,idx:t}}function zw(e,t,r,n){return r===void 0&&(r=null),Dm({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ih(t):t,{state:r,key:t&&t.key||n||Ij()})}function D0(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ih(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Rj(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,u=i.history,o=wu.Pop,f=null,p=v();p==null&&(p=0,u.replaceState(Dm({},u.state,{idx:p}),""));function v(){return(u.state||{idx:null}).idx}function y(){o=wu.Pop;let A=v(),I=A==null?null:A-p;p=A,f&&f({action:o,location:R.location,delta:I})}function w(A,I){o=wu.Push;let O=zw(R.location,A,I);r&&r(O,A),p=v()+1;let N=Tk(O,p),L=R.createHref(O);try{u.pushState(N,"",L)}catch{i.location.assign(L)}a&&f&&f({action:o,location:R.location,delta:1})}function k(A,I){o=wu.Replace;let O=zw(R.location,A,I);r&&r(O,A),p=v();let N=Tk(O,p),L=R.createHref(O);u.replaceState(N,"",L),a&&f&&f({action:o,location:R.location,delta:0})}function T(A){let I=i.location.origin!=="null"?i.location.origin:i.location.href,O=typeof A=="string"?A:D0(A);return Ai(I,"No window.location.(origin|href) available to create URL for href: "+O),new URL(O,I)}let R={get action(){return o},get location(){return e(i,u)},listen(A){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(kk,y),f=A,()=>{i.removeEventListener(kk,y),f=null}},createHref(A){return t(i,A)},createURL:T,encodeLocation(A){let I=T(A);return{pathname:I.pathname,search:I.search,hash:I.hash}},push:w,replace:k,go(A){return u.go(A)}};return R}var Pk;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Pk||(Pk={}));function Oj(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ih(t):t,i=N7(n.pathname||"/",r);if(i==null)return null;let a=O7(e);Aj(a);let u=null;for(let o=0;u==null&&o{let f={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:u,route:a};f.relativePath.startsWith("/")&&(Ai(f.relativePath.startsWith(n),'Absolute route path "'+f.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),f.relativePath=f.relativePath.slice(n.length));let p=Du([n,f.relativePath]),v=r.concat(f);a.children&&a.children.length>0&&(Ai(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),O7(a.children,t,v,p)),!(a.path==null&&!a.index)&&t.push({path:p,score:Bj(p,a.index),routesMeta:v})};return e.forEach((a,u)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))i(a,u);else for(let f of A7(a.path))i(a,u,f)}),t}function A7(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let u=A7(n.join("/")),o=[];return o.push(...u.map(f=>f===""?a:[a,f].join("/"))),i&&o.push(...u),o.map(f=>e.startsWith("/")&&f===""?"/":f)}function Aj(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Vj(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Nj=/^:\w+$/,zj=3,Dj=2,Lj=1,Fj=10,$j=-2,Mk=e=>e==="*";function Bj(e,t){let r=e.split("/"),n=r.length;return r.some(Mk)&&(n+=$j),t&&(n+=Dj),r.filter(i=>!Mk(i)).reduce((i,a)=>i+(Nj.test(a)?zj:a===""?Lj:Fj),n)}function Vj(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function jj(e,t){let{routesMeta:r}=e,n={},i="/",a=[];for(let u=0;u{if(v==="*"){let w=o[y]||"";u=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}return p[v]=Wj(o[y]||"",v),p},{}),pathname:a,pathnameBase:u,pattern:e}}function Kj(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ES(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(u,o)=>(n.push(o),"/([^\\/]+)"));return e.endsWith("*")?(n.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function Hj(e){try{return decodeURI(e)}catch(t){return ES(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Wj(e,t){try{return decodeURIComponent(e)}catch(r){return ES(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function N7(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function ES(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qj(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?ih(e):e;return{pathname:r?r.startsWith("/")?r:Gj(r,t):t,search:Xj(n),hash:Yj(i)}}function Gj(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Ib(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function z7(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function D7(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=ih(e):(i=Dm({},e),Ai(!i.pathname||!i.pathname.includes("?"),Ib("?","pathname","search",i)),Ai(!i.pathname||!i.pathname.includes("#"),Ib("#","pathname","hash",i)),Ai(!i.search||!i.search.includes("#"),Ib("#","search","hash",i)));let a=e===""||i.pathname==="",u=a?"/":i.pathname,o;if(n||u==null)o=r;else{let y=t.length-1;if(u.startsWith("..")){let w=u.split("/");for(;w[0]==="..";)w.shift(),y-=1;i.pathname=w.join("/")}o=y>=0?t[y]:"/"}let f=qj(i,o),p=u&&u!=="/"&&u.endsWith("/"),v=(a||u===".")&&r.endsWith("/");return!f.pathname.endsWith("/")&&(p||v)&&(f.pathname+="/"),f}const Du=e=>e.join("/").replace(/\/\/+/g,"/"),Zj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Xj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Yj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Qj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Jj=["post","put","patch","delete"];[...Jj];var L1={exports:{}},F1={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var eU=C.exports,tU=Symbol.for("react.element"),rU=Symbol.for("react.fragment"),nU=Object.prototype.hasOwnProperty,iU=eU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,oU={key:!0,ref:!0,__self:!0,__source:!0};function L7(e,t,r){var n,i={},a=null,u=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(u=t.ref);for(n in t)nU.call(t,n)&&!oU.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:tU,type:e,key:a,ref:u,props:i,_owner:iU.current}}F1.Fragment=rU;F1.jsx=L7;F1.jsxs=L7;(function(e){e.exports=F1})(L1);const Fr=L1.exports.Fragment,E=L1.exports.jsx,Qe=L1.exports.jsxs;/** * React Router v6.8.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Dw(){return Dw=Object.assign?Object.assign.bind():function(e){for(var t=1;t{i.value=n,i.getSnapshot=t,Rb(i)&&a({inst:i})},[e,n,t]),uU(()=>(Rb(i)&&a({inst:i}),e(()=>{Rb(i)&&a({inst:i})})),[e]),dU(n),n}function Rb(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!sU(r,n)}catch{return!0}}function hU(e,t,r){return t()}const pU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mU=!pU,vU=mU?hU:fU;"useSyncExternalStore"in d0&&(e=>e.useSyncExternalStore)(d0);const F7=C.exports.createContext(null),kS=C.exports.createContext(null),$1=C.exports.createContext(null),B1=C.exports.createContext(null),oh=C.exports.createContext({outlet:null,matches:[]}),$7=C.exports.createContext(null);function gU(e,t){let{relative:r}=t===void 0?{}:t;ah()||Ai(!1);let{basename:n,navigator:i}=C.exports.useContext($1),{hash:a,pathname:u,search:o}=B7(e,{relative:r}),f=u;return n!=="/"&&(f=u==="/"?n:Du([n,u])),i.createHref({pathname:f,search:o,hash:a})}function ah(){return C.exports.useContext(B1)!=null}function av(){return ah()||Ai(!1),C.exports.useContext(B1).location}function TS(){ah()||Ai(!1);let{basename:e,navigator:t}=C.exports.useContext($1),{matches:r}=C.exports.useContext(oh),{pathname:n}=av(),i=JSON.stringify(z7(r).map(o=>o.pathnameBase)),a=C.exports.useRef(!1);return C.exports.useEffect(()=>{a.current=!0}),C.exports.useCallback(function(o,f){if(f===void 0&&(f={}),!a.current)return;if(typeof o=="number"){t.go(o);return}let p=D7(o,JSON.parse(i),n,f.relative==="path");e!=="/"&&(p.pathname=p.pathname==="/"?e:Du([e,p.pathname])),(f.replace?t.replace:t.push)(p,f.state,f)},[e,t,i,n])}function B7(e,t){let{relative:r}=t===void 0?{}:t,{matches:n}=C.exports.useContext(oh),{pathname:i}=av(),a=JSON.stringify(z7(n).map(u=>u.pathnameBase));return C.exports.useMemo(()=>D7(e,JSON.parse(a),i,r==="path"),[e,a,i,r])}function yU(e,t){ah()||Ai(!1);let{navigator:r}=C.exports.useContext($1),n=C.exports.useContext(kS),{matches:i}=C.exports.useContext(oh),a=i[i.length-1],u=a?a.params:{};a&&a.pathname;let o=a?a.pathnameBase:"/";a&&a.route;let f=av(),p;if(t){var v;let R=typeof t=="string"?ih(t):t;o==="/"||((v=R.pathname)==null?void 0:v.startsWith(o))||Ai(!1),p=R}else p=f;let y=p.pathname||"/",w=o==="/"?y:y.slice(o.length)||"/",k=Oj(e,{pathname:w}),T=wU(k&&k.map(R=>Object.assign({},R,{params:Object.assign({},u,R.params),pathname:Du([o,r.encodeLocation?r.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?o:Du([o,r.encodeLocation?r.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),i,n||void 0);return t&&T?E(B1.Provider,{value:{location:Dw({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:wu.Pop},children:T}):T}function xU(){let e=kU(),t=Qj(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return Qe(Fr,{children:[E("h2",{children:"Unexpected Application Error!"}),E("h3",{style:{fontStyle:"italic"},children:t}),r?E("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},children:r}):null,null]})}class _U extends C.exports.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location?{error:t.error,location:t.location}:{error:t.error||r.error,location:r.location}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error?E(oh.Provider,{value:this.props.routeContext,children:E($7.Provider,{value:this.state.error,children:this.props.component})}):this.props.children}}function bU(e){let{routeContext:t,match:r,children:n}=e,i=C.exports.useContext(F7);return i&&i.static&&i.staticContext&&r.route.errorElement&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),E(oh.Provider,{value:t,children:n})}function wU(e,t,r){if(t===void 0&&(t=[]),e==null)if(r!=null&&r.errors)e=r.matches;else return null;let n=e,i=r==null?void 0:r.errors;if(i!=null){let a=n.findIndex(u=>u.route.id&&(i==null?void 0:i[u.route.id]));a>=0||Ai(!1),n=n.slice(0,Math.min(n.length,a+1))}return n.reduceRight((a,u,o)=>{let f=u.route.id?i==null?void 0:i[u.route.id]:null,p=r?u.route.errorElement||E(xU,{}):null,v=t.concat(n.slice(0,o+1)),y=()=>E(bU,{match:u,routeContext:{outlet:a,matches:v},children:f?p:u.route.element!==void 0?u.route.element:a});return r&&(u.route.errorElement||o===0)?E(_U,{location:r.location,component:p,error:f,children:y(),routeContext:{outlet:null,matches:v}}):y()},null)}var Ik;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(Ik||(Ik={}));var L0;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(L0||(L0={}));function CU(e){let t=C.exports.useContext(kS);return t||Ai(!1),t}function SU(e){let t=C.exports.useContext(oh);return t||Ai(!1),t}function EU(e){let t=SU(),r=t.matches[t.matches.length-1];return r.route.id||Ai(!1),r.route.id}function kU(){var e;let t=C.exports.useContext($7),r=CU(L0.UseRouteError),n=EU(L0.UseRouteError);return t||((e=r.errors)==null?void 0:e[n])}function V1(e){let{to:t,replace:r,state:n,relative:i}=e;ah()||Ai(!1);let a=C.exports.useContext(kS),u=TS();return C.exports.useEffect(()=>{a&&a.navigation.state!=="idle"||u(t,{replace:r,state:n,relative:i})}),null}function Hp(e){Ai(!1)}function TU(e){let{basename:t="/",children:r=null,location:n,navigationType:i=wu.Pop,navigator:a,static:u=!1}=e;ah()&&Ai(!1);let o=t.replace(/^\/*/,"/"),f=C.exports.useMemo(()=>({basename:o,navigator:a,static:u}),[o,a,u]);typeof n=="string"&&(n=ih(n));let{pathname:p="/",search:v="",hash:y="",state:w=null,key:k="default"}=n,T=C.exports.useMemo(()=>{let R=N7(p,o);return R==null?null:{pathname:R,search:v,hash:y,state:w,key:k}},[o,p,v,y,w,k]);return T==null?null:E($1.Provider,{value:f,children:E(B1.Provider,{children:r,value:{location:T,navigationType:i}})})}function PU(e){let{children:t,location:r}=e,n=C.exports.useContext(F7),i=n&&!t?n.router.routes:Lw(t);return yU(i,r)}var Rk;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(Rk||(Rk={}));new Promise(()=>{});function Lw(e,t){t===void 0&&(t=[]);let r=[];return C.exports.Children.forEach(e,(n,i)=>{if(!C.exports.isValidElement(n))return;if(n.type===C.exports.Fragment){r.push.apply(r,Lw(n.props.children,t));return}n.type!==Hp&&Ai(!1),!n.props.index||!n.props.children||Ai(!1);let a=[...t,i],u={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,hasErrorBoundary:n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle};n.props.children&&(u.children=Lw(n.props.children,a)),r.push(u)}),r}/** * React Router DOM v6.8.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function MU(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function IU(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function RU(e,t){return e.button===0&&(!t||t==="_self")&&!IU(e)}function Fw(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function OU(e,t){let r=Fw(e);if(t)for(let n of t.keys())r.has(n)||t.getAll(n).forEach(i=>{r.append(n,i)});return r}const AU=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function NU(e){let{basename:t,children:r,window:n}=e,i=C.exports.useRef();i.current==null&&(i.current=Mj({window:n,v5Compat:!0}));let a=i.current,[u,o]=C.exports.useState({action:a.action,location:a.location});return C.exports.useLayoutEffect(()=>a.listen(o),[a]),E(TU,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:a})}const zU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$w=C.exports.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:u,state:o,target:f,to:p,preventScrollReset:v}=t,y=MU(t,AU),w,k=!1;if(zU&&typeof p=="string"&&/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(p)){w=p;let I=new URL(window.location.href),O=p.startsWith("//")?new URL(I.protocol+p):new URL(p);O.origin===I.origin?p=O.pathname+O.search+O.hash:k=!0}let T=gU(p,{relative:i}),R=DU(p,{replace:u,state:o,target:f,preventScrollReset:v,relative:i});function A(I){n&&n(I),I.defaultPrevented||R(I)}return E("a",{...y,href:w||T,onClick:k||a?n:A,ref:r,target:f})});var Ok;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(Ok||(Ok={}));var Ak;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ak||(Ak={}));function DU(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:u}=t===void 0?{}:t,o=TS(),f=av(),p=B7(e,{relative:u});return C.exports.useCallback(v=>{if(RU(v,r)){v.preventDefault();let y=n!==void 0?n:D0(f)===D0(p);o(e,{replace:y,state:i,preventScrollReset:a,relative:u})}},[f,o,p,n,i,r,e,a,u])}function LU(e){let t=C.exports.useRef(Fw(e)),r=C.exports.useRef(!1),n=av(),i=C.exports.useMemo(()=>OU(n.search,r.current?null:t.current),[n.search]),a=TS(),u=C.exports.useCallback((o,f)=>{const p=Fw(typeof o=="function"?o(i):o);r.current=!0,a("?"+p,f)},[a,i]);return[i,u]}let Ob=0,Nk=[];function FU(){return Ob+=1,()=>{if(Ob-=1,Ob===0){let e=Nk;Nk=[];for(let t of e)t()}}}let ay=Symbol(),$U=(e,t,r,n)=>{let i={...e};i.set=(...u)=>{e[ay]=t,e.set(...u),delete e[ay]},e.setKey&&(i.setKey=(...u)=>{e[ay]=t,e.setKey(...u),delete e[ay]});let a=r(i,...n);if(a instanceof Promise){let u=FU();return a.finally(u)}return a},BU=(e,t,r)=>(...n)=>$U(e,t,r,n),Io=[],sh=(e,t)=>{let r,n=[],i={lc:0,l:t||0,value:e,set(a){i.value=a,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(a){r=n;let u=!Io.length;for(let o=0;o{n===r&&(n=n.slice());let o=n.indexOf(a);~o&&(n.splice(o,2),i.lc--)}},subscribe(a,u){let o=i.listen(a,u);return a(i.value),o},off(){}};return i};function VU(e,t,r){let n=new Set([...t,void 0]);return e.listen((i,a)=>{n.has(a)&&r(i,a)})}var j1={exports:{}},V7={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ff=C.exports;function jU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var UU=typeof Object.is=="function"?Object.is:jU,KU=Ff.useState,HU=Ff.useEffect,WU=Ff.useLayoutEffect,qU=Ff.useDebugValue;function GU(e,t){var r=t(),n=KU({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return WU(function(){i.value=r,i.getSnapshot=t,Ab(i)&&a({inst:i})},[e,r,t]),HU(function(){return Ab(i)&&a({inst:i}),e(function(){Ab(i)&&a({inst:i})})},[e]),qU(r),r}function Ab(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!UU(e,r)}catch{return!0}}function ZU(e,t){return t()}var XU=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ZU:GU;V7.useSyncExternalStore=Ff.useSyncExternalStore!==void 0?Ff.useSyncExternalStore:XU;(function(e){e.exports=V7})(j1);function Uu(e,t={}){let r=C.exports.useCallback(i=>t.keys?VU(e,t.keys,i):e.listen(i),[t.keys,e]),n=e.get.bind(e);return j1.exports.useSyncExternalStore(r,n,n)}function tt(){return tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"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 Or(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JU(e,t){if(t&&(ar(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Or(e)}function gi(e){var t=QU();return function(){var n=F0(e),i;if(t){var a=F0(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return JU(this,i)}}var U7={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{},r=[];return en.Children.forEach(e,function(n){n==null&&!t.keepEmpty||(Array.isArray(n)?r=r.concat(lo(n)):PS.exports.isFragment(n)&&n.props?r=r.concat(lo(n.props.children,t)):r.push(n))}),r}var Dk={};function oK(e,t){}function aK(e,t,r){!t&&!Dk[r]&&(e(!1,r),Dk[r]=!0)}function Fn(e,t){aK(oK,e,t)}function Lk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ve(e){for(var t=1;t0},e.prototype.connect_=function(){!Vw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),fK?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Vw||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,i=dK.some(function(a){return!!~n.indexOf(a)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),q7=function(e,t){for(var r=0,n=Object.keys(t);r"u"||!(Element instanceof Object))){if(!(t instanceof $f(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new bK(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof $f(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;!r.has(t)||(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new wK(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Z7=typeof WeakMap<"u"?new WeakMap:new W7,X7=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=hK.getInstance(),n=new CK(t,r,this);Z7.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){X7.prototype[e]=function(){var t;return(t=Z7.get(this))[e].apply(t,arguments)}});var Y7=function(){return typeof B0.ResizeObserver<"u"?B0.ResizeObserver:X7}(),Cu=new Map;function SK(e){e.forEach(function(t){var r,n=t.target;(r=Cu.get(n))===null||r===void 0||r.forEach(function(i){return i(n)})})}var Q7=new Y7(SK);function EK(e,t){Cu.has(e)||(Cu.set(e,new Set),Q7.observe(e)),Cu.get(e).add(t)}function kK(e,t){Cu.has(e)&&(Cu.get(e).delete(t),Cu.get(e).size||(Q7.unobserve(e),Cu.delete(e)))}var TK=function(e){vi(r,e);var t=gi(r);function r(){return Yn(this,r),t.apply(this,arguments)}return Qn(r,[{key:"render",value:function(){return this.props.children}}]),r}(C.exports.Component),jw=C.exports.createContext(null);function PK(e){var t=e.children,r=e.onBatchResize,n=C.exports.useRef(0),i=C.exports.useRef([]),a=C.exports.useContext(jw),u=C.exports.useCallback(function(o,f,p){n.current+=1;var v=n.current;i.current.push({size:o,element:f,data:p}),Promise.resolve().then(function(){v===n.current&&(r==null||r(i.current),i.current=[])}),a==null||a(o,f,p)},[r,a]);return E(jw.Provider,{value:u,children:t})}function MK(e,t){var r=e.children,n=e.disabled,i=C.exports.useRef(null),a=C.exports.useRef(null),u=C.exports.useContext(jw),o=typeof r=="function",f=o?r(i):r,p=C.exports.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),v=!o&&C.exports.isValidElement(f)&&fd(f),y=v?f.ref:null,w=C.exports.useMemo(function(){return ta(y,i)},[y,i]),k=function(){return Lm(i.current)||Lm(a.current)};C.exports.useImperativeHandle(t,function(){return k()});var T=C.exports.useRef(e);T.current=e;var R=C.exports.useCallback(function(A){var I=T.current,O=I.onResize,N=I.data,L=A.getBoundingClientRect(),B=L.width,j=L.height,G=A.offsetWidth,H=A.offsetHeight,te=Math.floor(B),Y=Math.floor(j);if(p.current.width!==te||p.current.height!==Y||p.current.offsetWidth!==G||p.current.offsetHeight!==H){var le={width:te,height:Y,offsetWidth:G,offsetHeight:H};p.current=le;var J=G===Math.round(B)?B:G,Z=H===Math.round(j)?j:H,Q=ve(ve({},le),{},{offsetWidth:J,offsetHeight:Z});u==null||u(Q,A,N),O&&Promise.resolve().then(function(){O(Q,A)})}},[]);return C.exports.useEffect(function(){var A=k();return A&&!n&&EK(A,R),function(){return kK(A,R)}},[i.current,n]),E(TK,{ref:a,children:v?C.exports.cloneElement(f,{ref:w}):f})}var IK=C.exports.forwardRef(MK),RK="rc-observer-key";function OK(e,t){var r=e.children,n=typeof r=="function"?[r]:lo(r);return n.map(function(i,a){var u=(i==null?void 0:i.key)||"".concat(RK,"-").concat(a);return C.exports.createElement(IK,{...e,key:u,ref:a===0?t:void 0},i)})}var Bl=C.exports.forwardRef(OK);Bl.Collection=PK;function Si(e,t){var r=ve({},e);return Array.isArray(t)&&t.forEach(function(n){delete r[n]}),r}var AK=C.exports.createContext({});const OS=AK;function NK(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Pr(e,t){if(e==null)return{};var r=NK(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}function Uw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--ne){var de=this.tryEntries[ne],oe=de.completion;if(de.tryLoc==="root")return ge("end");if(de.tryLoc<=this.prev){var ye=r.call(de,"catchLoc"),Re=r.call(de,"finallyLoc");if(ye&&Re){if(this.prev=0;--ge){var ne=this.tryEntries[ge];if(ne.tryLoc<=this.prev&&r.call(ne,"finallyLoc")&&this.prev=0;--Q){var ge=this.tryEntries[Q];if(ge.finallyLoc===Z)return this.complete(ge.completion,ge.afterLoc),H(ge),y}},catch:function(Z){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var ge=this.tryEntries[Q];if(ge.tryLoc===Z){var ne=ge.completion;if(ne.type==="throw"){var de=ne.arg;H(ge)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(Z,Q,ge){return this.delegate={iterator:Y(Z),resultName:Q,nextLoc:ge},this.method==="next"&&(this.arg=void 0),y}},e}function $k(e,t,r,n,i,a,u){try{var o=e[a](u),f=o.value}catch(p){r(p);return}o.done?t(f):Promise.resolve(f).then(n,i)}function hd(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function u(f){$k(a,n,i,u,o,"next",f)}function o(f){$k(a,n,i,u,o,"throw",f)}u(void 0)})}}function Hc(){return Hc=Object.assign?Object.assign.bind():function(e){for(var t=1;t"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 Zy(e,t,r){return FK()?Zy=Reflect.construct.bind():Zy=function(i,a,u){var o=[null];o.push.apply(o,a);var f=Function.bind.apply(i,o),p=new f;return u&&Fm(p,u.prototype),p},Zy.apply(null,arguments)}function $K(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ww(e){var t=typeof Map=="function"?new Map:void 0;return Ww=function(n){if(n===null||!$K(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return Zy(n,arguments,Hw(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Fm(i,n)},Ww(e)}var BK=/%[sdj%]/g,VK=function(){};typeof process<"u"&&process.env;function qw(e){if(!e||!e.length)return null;var t={};return e.forEach(function(r){var n=r.field;t[n]=t[n]||[],t[n].push(r)}),t}function pa(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=a)return o;switch(o){case"%s":return String(r[i++]);case"%d":return Number(r[i++]);case"%j":try{return JSON.stringify(r[i++])}catch{return"[Circular]"}break;default:return o}});return u}return e}function jK(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Vi(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||jK(t)&&typeof e=="string"&&!e)}function UK(e,t,r){var n=[],i=0,a=e.length;function u(o){n.push.apply(n,o||[]),i++,i===a&&r(n)}e.forEach(function(o){t(o,u)})}function Bk(e,t,r){var n=0,i=e.length;function a(u){if(u&&u.length){r(u);return}var o=n;n=n+1,o()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Wp={integer:function(t){return Wp.number(t)&&parseInt(t,10)===t},float:function(t){return Wp.number(t)&&!Wp.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Wp.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(Kk.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(ZK())},hex:function(t){return typeof t=="string"&&!!t.match(Kk.hex)}},XK=function(t,r,n,i,a){if(t.required&&r===void 0){eO(t,r,n,i,a);return}var u=["integer","float","array","regexp","object","method","email","number","date","url","hex"],o=t.type;u.indexOf(o)>-1?Wp[o](r)||i.push(pa(a.messages.types[o],t.fullField,t.type)):o&&typeof r!==t.type&&i.push(pa(a.messages.types[o],t.fullField,t.type))},YK=function(t,r,n,i,a){var u=typeof t.len=="number",o=typeof t.min=="number",f=typeof t.max=="number",p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v=r,y=null,w=typeof r=="number",k=typeof r=="string",T=Array.isArray(r);if(w?y="number":k?y="string":T&&(y="array"),!y)return!1;T&&(v=r.length),k&&(v=r.replace(p,"_").length),u?v!==t.len&&i.push(pa(a.messages[y].len,t.fullField,t.len)):o&&!f&&vt.max?i.push(pa(a.messages[y].max,t.fullField,t.max)):o&&f&&(vt.max)&&i.push(pa(a.messages[y].range,t.fullField,t.min,t.max))},Yd="enum",QK=function(t,r,n,i,a){t[Yd]=Array.isArray(t[Yd])?t[Yd]:[],t[Yd].indexOf(r)===-1&&i.push(pa(a.messages[Yd],t.fullField,t[Yd].join(", ")))},JK=function(t,r,n,i,a){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(r)||i.push(pa(a.messages.pattern.mismatch,t.fullField,r,t.pattern));else if(typeof t.pattern=="string"){var u=new RegExp(t.pattern);u.test(r)||i.push(pa(a.messages.pattern.mismatch,t.fullField,r,t.pattern))}}},rn={required:eO,whitespace:GK,type:XK,range:YK,enum:QK,pattern:JK},eH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r,"string")&&!t.required)return n();rn.required(t,r,i,u,a,"string"),Vi(r,"string")||(rn.type(t,r,i,u,a),rn.range(t,r,i,u,a),rn.pattern(t,r,i,u,a),t.whitespace===!0&&rn.whitespace(t,r,i,u,a))}n(u)},tH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();rn.required(t,r,i,u,a),r!==void 0&&rn.type(t,r,i,u,a)}n(u)},rH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(r===""&&(r=void 0),Vi(r)&&!t.required)return n();rn.required(t,r,i,u,a),r!==void 0&&(rn.type(t,r,i,u,a),rn.range(t,r,i,u,a))}n(u)},nH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();rn.required(t,r,i,u,a),r!==void 0&&rn.type(t,r,i,u,a)}n(u)},iH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();rn.required(t,r,i,u,a),Vi(r)||rn.type(t,r,i,u,a)}n(u)},oH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();rn.required(t,r,i,u,a),r!==void 0&&(rn.type(t,r,i,u,a),rn.range(t,r,i,u,a))}n(u)},aH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();rn.required(t,r,i,u,a),r!==void 0&&(rn.type(t,r,i,u,a),rn.range(t,r,i,u,a))}n(u)},sH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(r==null&&!t.required)return n();rn.required(t,r,i,u,a,"array"),r!=null&&(rn.type(t,r,i,u,a),rn.range(t,r,i,u,a))}n(u)},lH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();rn.required(t,r,i,u,a),r!==void 0&&rn.type(t,r,i,u,a)}n(u)},uH="enum",cH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();rn.required(t,r,i,u,a),r!==void 0&&rn[uH](t,r,i,u,a)}n(u)},dH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r,"string")&&!t.required)return n();rn.required(t,r,i,u,a),Vi(r,"string")||rn.pattern(t,r,i,u,a)}n(u)},fH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r,"date")&&!t.required)return n();if(rn.required(t,r,i,u,a),!Vi(r,"date")){var f;r instanceof Date?f=r:f=new Date(r),rn.type(t,f,i,u,a),f&&rn.range(t,f.getTime(),i,u,a)}}n(u)},hH=function(t,r,n,i,a){var u=[],o=Array.isArray(r)?"array":typeof r;rn.required(t,r,i,u,a,o),n(u)},Nb=function(t,r,n,i,a){var u=t.type,o=[],f=t.required||!t.required&&i.hasOwnProperty(t.field);if(f){if(Vi(r,u)&&!t.required)return n();rn.required(t,r,i,o,a,u),Vi(r,u)||rn.type(t,r,i,o,a)}n(o)},pH=function(t,r,n,i,a){var u=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Vi(r)&&!t.required)return n();rn.required(t,r,i,u,a)}n(u)},lm={string:eH,method:tH,number:rH,boolean:nH,regexp:iH,integer:oH,float:aH,array:sH,object:lH,enum:cH,pattern:dH,date:fH,url:Nb,hex:Nb,email:Nb,required:hH,any:pH};function Gw(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var Zw=Gw(),lv=function(){function e(r){this.rules=null,this._messages=Zw,this.define(r)}var t=e.prototype;return t.define=function(n){var i=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(a){var u=n[a];i.rules[a]=Array.isArray(u)?u:[u]})},t.messages=function(n){return n&&(this._messages=Uk(Gw(),n)),this._messages},t.validate=function(n,i,a){var u=this;i===void 0&&(i={}),a===void 0&&(a=function(){});var o=n,f=i,p=a;if(typeof f=="function"&&(p=f,f={}),!this.rules||Object.keys(this.rules).length===0)return p&&p(null,o),Promise.resolve(o);function v(R){var A=[],I={};function O(L){if(Array.isArray(L)){var B;A=(B=A).concat.apply(B,L)}else A.push(L)}for(var N=0;N3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&n&&r===void 0&&!rO(e,t.slice(0,-1))?e:oO(e,t,r,n)}function ex(e){return Array.isArray(e)?gH(e):ar(e)==="object"&&e!==null?vH(e):e}function vH(e){if(Object.getPrototypeOf(e)===Object.prototype){var t={};for(var r in e)t[r]=ex(e[r]);return t}return e}function gH(e){return e.map(function(t){return ex(t)})}function bi(e){return Kw(e)}function Su(e,t){var r=rO(e,t);return r}function fu(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=mH(e,t,r,n);return i}function Hk(e,t){var r={};return t.forEach(function(n){var i=Su(e,n);r=fu(r,n,i)}),r}function um(e,t){return e&&e.some(function(r){return sO(r,t)})}function Wk(e){return ar(e)==="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function aO(e,t){var r=Array.isArray(e)?wt(e):ve({},e);return t&&Object.keys(t).forEach(function(n){var i=r[n],a=t[n],u=Wk(i)&&Wk(a);r[n]=u?aO(i,a||{}):ex(a)}),r}function Xy(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=n||r<0||r>=n)return e;var i=e[t],a=t-r;return a>0?[].concat(wt(e.slice(0,r)),[i],wt(e.slice(r,t)),wt(e.slice(t+1,n))):a<0?[].concat(wt(e.slice(0,t)),wt(e.slice(t+1,r+1)),[i],wt(e.slice(r+1,n))):e}var _H=lv;function bH(e,t){return e.replace(/\$\{\w+\}/g,function(r){var n=r.slice(2,-1);return t[n]})}var Gk="CODE_LOGIC_ERROR";function Xw(e,t,r,n,i){return Yw.apply(this,arguments)}function Yw(){return Yw=hd(Do().mark(function e(t,r,n,i,a){var u,o,f,p,v,y,w,k,T;return Do().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return u=ve({},n),delete u.ruleIndex,u.validator&&(o=u.validator,u.validator=function(){try{return o.apply(void 0,arguments)}catch(I){return console.error(I),Promise.reject(Gk)}}),f=null,u&&u.type==="array"&&u.defaultField&&(f=u.defaultField,delete u.defaultField),p=new _H(se({},t,[u])),v=Xy({},tO,i.validateMessages),p.messages(v),y=[],A.prev=9,A.next=12,Promise.resolve(p.validate(se({},t,r),ve({},i)));case 12:A.next=17;break;case 14:A.prev=14,A.t0=A.catch(9),A.t0.errors&&(y=A.t0.errors.map(function(I,O){var N=I.message,L=N===Gk?v.default:N;return C.exports.isValidElement(L)?C.exports.cloneElement(L,{key:"error_".concat(O)}):L}));case 17:if(!(!y.length&&f)){A.next=22;break}return A.next=20,Promise.all(r.map(function(I,O){return Xw("".concat(t,".").concat(O),I,f,i,a)}));case 20:return w=A.sent,A.abrupt("return",w.reduce(function(I,O){return[].concat(wt(I),wt(O))},[]));case 22:return k=ve(ve({},n),{},{name:t,enum:(n.enum||[]).join(", ")},a),T=y.map(function(I){return typeof I=="string"?bH(I,k):I}),A.abrupt("return",T);case 25:case"end":return A.stop()}},e,null,[[9,14]])})),Yw.apply(this,arguments)}function wH(e,t,r,n,i,a){var u=e.join("."),o=r.map(function(v,y){var w=v.validator,k=ve(ve({},v),{},{ruleIndex:y});return w&&(k.validator=function(T,R,A){var I=!1,O=function(){for(var B=arguments.length,j=new Array(B),G=0;G0&&arguments[0]!==void 0?arguments[0]:Ra;if(i.validatePromise===y){var B;i.validatePromise=null;var j=[],G=[];(B=L.forEach)===null||B===void 0||B.call(L,function(H){var te=H.rule.warningOnly,Y=H.errors,le=Y===void 0?Ra:Y;te?G.push.apply(G,wt(le)):j.push.apply(j,wt(le))}),i.errors=j,i.warnings=G,i.triggerMetaEvent(),i.reRender()}}),N});return i.validatePromise=y,i.dirty=!0,i.errors=Ra,i.warnings=Ra,i.triggerMetaEvent(),i.reRender(),y},i.isFieldValidating=function(){return!!i.validatePromise},i.isFieldTouched=function(){return i.touched},i.isFieldDirty=function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var f=i.props.fieldContext,p=f.getInternalHooks(Kc),v=p.getInitialValue;return v(i.getNamePath())!==void 0},i.getErrors=function(){return i.errors},i.getWarnings=function(){return i.warnings},i.isListField=function(){return i.props.isListField},i.isList=function(){return i.props.isList},i.isPreserve=function(){return i.props.preserve},i.getMeta=function(){i.prevValidating=i.isFieldValidating();var f={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath()};return f},i.getOnlyChild=function(f){if(typeof f=="function"){var p=i.getMeta();return ve(ve({},i.getOnlyChild(f(i.getControlled(),p,i.props.fieldContext))),{},{isFunction:!0})}var v=lo(f);return v.length!==1||!C.exports.isValidElement(v[0])?{child:v,isFunction:!1}:{child:v[0],isFunction:!1}},i.getValue=function(f){var p=i.props.fieldContext.getFieldsValue,v=i.getNamePath();return Su(f||p(!0),v)},i.getControlled=function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=i.props,v=p.trigger,y=p.validateTrigger,w=p.getValueFromEvent,k=p.normalize,T=p.valuePropName,R=p.getValueProps,A=p.fieldContext,I=y!==void 0?y:A.validateTrigger,O=i.getNamePath(),N=A.getInternalHooks,L=A.getFieldsValue,B=N(Kc),j=B.dispatch,G=i.getValue(),H=R||function(J){return se({},T,J)},te=f[v],Y=ve(ve({},f),H(G));Y[v]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var J,Z=arguments.length,Q=new Array(Z),ge=0;ge=0&&te<=Y.length?(p.keys=[].concat(wt(p.keys.slice(0,te)),[p.id],wt(p.keys.slice(te))),O([].concat(wt(Y.slice(0,te)),[H],wt(Y.slice(te))))):(p.keys=[].concat(wt(p.keys),[p.id]),O([].concat(wt(Y),[H]))),p.id+=1},remove:function(H){var te=L(),Y=new Set(Array.isArray(H)?H:[H]);Y.size<=0||(p.keys=p.keys.filter(function(le,J){return!Y.has(J)}),O(te.filter(function(le,J){return!Y.has(J)})))},move:function(H,te){if(H!==te){var Y=L();H<0||H>=Y.length||te<0||te>=Y.length||(p.keys=qk(p.keys,H,te),O(qk(Y,H,te)))}}},j=I||[];return Array.isArray(j)||(j=[]),i(j.map(function(G,H){var te=p.keys[H];return te===void 0&&(p.keys[H]=p.id,te=p.keys[H],p.id+=1),{name:H,key:te,isListField:!0}}),B,R)}})})})};function kH(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,u,o=[],f=!0,p=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;f=!1}else for(;!(f=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);f=!0);}catch(v){p=!0,i=v}finally{try{if(!f&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(p)throw i}}return o}}function Le(e,t){return nO(e)||kH(e,t)||AS(e,t)||iO()}function TH(e){var t=!1,r=e.length,n=[];return e.length?new Promise(function(i,a){e.forEach(function(u,o){u.catch(function(f){return t=!0,f}).then(function(f){r-=1,n[o]=f,!(r>0)&&(t&&a(n),i(n))})})}):Promise.resolve([])}var cO="__@field_split__";function zb(e){return e.map(function(t){return"".concat(ar(t),":").concat(t)}).join(cO)}var Qd=function(){function e(){Yn(this,e),this.kvs=new Map}return Qn(e,[{key:"set",value:function(r,n){this.kvs.set(zb(r),n)}},{key:"get",value:function(r){return this.kvs.get(zb(r))}},{key:"update",value:function(r,n){var i=this.get(r),a=n(i);a?this.set(r,a):this.delete(r)}},{key:"delete",value:function(r){this.kvs.delete(zb(r))}},{key:"map",value:function(r){return wt(this.kvs.entries()).map(function(n){var i=Le(n,2),a=i[0],u=i[1],o=a.split(cO);return r({key:o.map(function(f){var p=f.match(/^([^:]*):(.*)$/),v=Le(p,3),y=v[1],w=v[2];return y==="number"?Number(w):w}),value:u})})}},{key:"toJSON",value:function(){var r={};return this.map(function(n){var i=n.key,a=n.value;return r[i.join(".")]=a,null}),r}}]),e}(),PH=["name","errors"],MH=Qn(function e(t){var r=this;Yn(this,e),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:r.getFieldValue,getFieldsValue:r.getFieldsValue,getFieldError:r.getFieldError,getFieldWarning:r.getFieldWarning,getFieldsError:r.getFieldsError,isFieldsTouched:r.isFieldsTouched,isFieldTouched:r.isFieldTouched,isFieldValidating:r.isFieldValidating,isFieldsValidating:r.isFieldsValidating,resetFields:r.resetFields,setFields:r.setFields,setFieldValue:r.setFieldValue,setFieldsValue:r.setFieldsValue,validateFields:r.validateFields,submit:r.submit,_init:!0,getInternalHooks:r.getInternalHooks}},this.getInternalHooks=function(n){return n===Kc?(r.formHooked=!0,{dispatch:r.dispatch,initEntityValue:r.initEntityValue,registerField:r.registerField,useSubscribe:r.useSubscribe,setInitialValues:r.setInitialValues,destroyForm:r.destroyForm,setCallbacks:r.setCallbacks,setValidateMessages:r.setValidateMessages,getFields:r.getFields,setPreserve:r.setPreserve,getInitialValue:r.getInitialValue,registerWatch:r.registerWatch}):(Fn(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(n){r.subscribable=n},this.prevWithoutPreserves=null,this.setInitialValues=function(n,i){if(r.initialValues=n||{},i){var a,u=Xy({},n,r.store);(a=r.prevWithoutPreserves)===null||a===void 0||a.map(function(o){var f=o.key;u=fu(u,f,Su(n,f))}),r.prevWithoutPreserves=null,r.updateStore(u)}},this.destroyForm=function(){var n=new Qd;r.getFieldEntities(!0).forEach(function(i){r.isMergedPreserve(i.isPreserve())||n.set(i.getNamePath(),!0)}),r.prevWithoutPreserves=n},this.getInitialValue=function(n){var i=Su(r.initialValues,n);return n.length?ex(i):i},this.setCallbacks=function(n){r.callbacks=n},this.setValidateMessages=function(n){r.validateMessages=n},this.setPreserve=function(n){r.preserve=n},this.watchList=[],this.registerWatch=function(n){return r.watchList.push(n),function(){r.watchList=r.watchList.filter(function(i){return i!==n})}},this.notifyWatch=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(r.watchList.length){var i=r.getFieldsValue();r.watchList.forEach(function(a){a(i,n)})}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(n){r.store=n},this.getFieldEntities=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?r.fieldEntities.filter(function(i){return i.getNamePath().length}):r.fieldEntities},this.getFieldsMap=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new Qd;return r.getFieldEntities(n).forEach(function(a){var u=a.getNamePath();i.set(u,a)}),i},this.getFieldEntitiesForNamePathList=function(n){if(!n)return r.getFieldEntities(!0);var i=r.getFieldsMap(!0);return n.map(function(a){var u=bi(a);return i.get(u)||{INVALIDATE_NAME_PATH:bi(a)}})},this.getFieldsValue=function(n,i){if(r.warningUnhooked(),n===!0&&!i)return r.store;var a=r.getFieldEntitiesForNamePathList(Array.isArray(n)?n:null),u=[];return a.forEach(function(o){var f,p="INVALIDATE_NAME_PATH"in o?o.INVALIDATE_NAME_PATH:o.getNamePath();if(!(!n&&((f=o.isListField)===null||f===void 0?void 0:f.call(o))))if(!i)u.push(p);else{var v="getMeta"in o?o.getMeta():null;i(v)&&u.push(p)}}),Hk(r.store,u.map(bi))},this.getFieldValue=function(n){r.warningUnhooked();var i=bi(n);return Su(r.store,i)},this.getFieldsError=function(n){r.warningUnhooked();var i=r.getFieldEntitiesForNamePathList(n);return i.map(function(a,u){return a&&!("INVALIDATE_NAME_PATH"in a)?{name:a.getNamePath(),errors:a.getErrors(),warnings:a.getWarnings()}:{name:bi(n[u]),errors:[],warnings:[]}})},this.getFieldError=function(n){r.warningUnhooked();var i=bi(n),a=r.getFieldsError([i])[0];return a.errors},this.getFieldWarning=function(n){r.warningUnhooked();var i=bi(n),a=r.getFieldsError([i])[0];return a.warnings},this.isFieldsTouched=function(){r.warningUnhooked();for(var n=arguments.length,i=new Array(n),a=0;a0&&arguments[0]!==void 0?arguments[0]:{},i=new Qd,a=r.getFieldEntities(!0);a.forEach(function(f){var p=f.props.initialValue,v=f.getNamePath();if(p!==void 0){var y=i.get(v)||new Set;y.add({entity:f,value:p}),i.set(v,y)}});var u=function(p){p.forEach(function(v){var y=v.props.initialValue;if(y!==void 0){var w=v.getNamePath(),k=r.getInitialValue(w);if(k!==void 0)Fn(!1,"Form already set 'initialValues' with path '".concat(w.join("."),"'. Field can not overwrite it."));else{var T=i.get(w);if(T&&T.size>1)Fn(!1,"Multiple Field with path '".concat(w.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(T){var R=r.getFieldValue(w);(!n.skipExist||R===void 0)&&r.updateStore(fu(r.store,w,wt(T)[0].value))}}}})},o;n.entities?o=n.entities:n.namePathList?(o=[],n.namePathList.forEach(function(f){var p=i.get(f);if(p){var v;(v=o).push.apply(v,wt(wt(p).map(function(y){return y.entity})))}})):o=a,u(o)},this.resetFields=function(n){r.warningUnhooked();var i=r.store;if(!n){r.updateStore(Xy({},r.initialValues)),r.resetWithFieldInitialValue(),r.notifyObservers(i,null,{type:"reset"}),r.notifyWatch();return}var a=n.map(bi);a.forEach(function(u){var o=r.getInitialValue(u);r.updateStore(fu(r.store,u,o))}),r.resetWithFieldInitialValue({namePathList:a}),r.notifyObservers(i,a,{type:"reset"}),r.notifyWatch(a)},this.setFields=function(n){r.warningUnhooked();var i=r.store,a=[];n.forEach(function(u){var o=u.name;u.errors;var f=Pr(u,PH),p=bi(o);a.push(p),"value"in f&&r.updateStore(fu(r.store,p,f.value)),r.notifyObservers(i,[p],{type:"setField",data:u})}),r.notifyWatch(a)},this.getFields=function(){var n=r.getFieldEntities(!0),i=n.map(function(a){var u=a.getNamePath(),o=a.getMeta(),f=ve(ve({},o),{},{name:u,value:r.getFieldValue(u)});return Object.defineProperty(f,"originRCField",{value:!0}),f});return i},this.initEntityValue=function(n){var i=n.props.initialValue;if(i!==void 0){var a=n.getNamePath(),u=Su(r.store,a);u===void 0&&r.updateStore(fu(r.store,a,i))}},this.isMergedPreserve=function(n){var i=n!==void 0?n:r.preserve;return i!=null?i:!0},this.registerField=function(n){r.fieldEntities.push(n);var i=n.getNamePath();if(r.notifyWatch([i]),n.props.initialValue!==void 0){var a=r.store;r.resetWithFieldInitialValue({entities:[n],skipExist:!0}),r.notifyObservers(a,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(u,o){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r.fieldEntities=r.fieldEntities.filter(function(y){return y!==n}),!r.isMergedPreserve(o)&&(!u||f.length>1)){var p=u?void 0:r.getInitialValue(i);if(i.length&&r.getFieldValue(i)!==p&&r.fieldEntities.every(function(y){return!sO(y.getNamePath(),i)})){var v=r.store;r.updateStore(fu(v,i,p,!0)),r.notifyObservers(v,[i],{type:"remove"}),r.triggerDependenciesUpdate(v,i)}}r.notifyWatch([i])}},this.dispatch=function(n){switch(n.type){case"updateValue":{var i=n.namePath,a=n.value;r.updateValue(i,a);break}case"validateField":{var u=n.namePath,o=n.triggerName;r.validateFields([u],{triggerName:o});break}}},this.notifyObservers=function(n,i,a){if(r.subscribable){var u=ve(ve({},a),{},{store:r.getFieldsValue(!0)});r.getFieldEntities().forEach(function(o){var f=o.onStoreChange;f(n,i,u)})}else r.forceRootUpdate()},this.triggerDependenciesUpdate=function(n,i){var a=r.getDependencyChildrenFields(i);return a.length&&r.validateFields(a),r.notifyObservers(n,a,{type:"dependenciesUpdate",relatedFields:[i].concat(wt(a))}),a},this.updateValue=function(n,i){var a=bi(n),u=r.store;r.updateStore(fu(r.store,a,i)),r.notifyObservers(u,[a],{type:"valueUpdate",source:"internal"}),r.notifyWatch([a]);var o=r.triggerDependenciesUpdate(u,a),f=r.callbacks.onValuesChange;if(f){var p=Hk(r.store,[a]);f(p,r.getFieldsValue())}r.triggerOnFieldsChange([a].concat(wt(o)))},this.setFieldsValue=function(n){r.warningUnhooked();var i=r.store;if(n){var a=Xy(r.store,n);r.updateStore(a)}r.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),r.notifyWatch()},this.setFieldValue=function(n,i){r.setFields([{name:n,value:i}])},this.getDependencyChildrenFields=function(n){var i=new Set,a=[],u=new Qd;r.getFieldEntities().forEach(function(f){var p=f.props.dependencies;(p||[]).forEach(function(v){var y=bi(v);u.update(y,function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return w.add(f),w})})});var o=function f(p){var v=u.get(p)||new Set;v.forEach(function(y){if(!i.has(y)){i.add(y);var w=y.getNamePath();y.isFieldDirty()&&w.length&&(a.push(w),f(w))}})};return o(n),a},this.triggerOnFieldsChange=function(n,i){var a=r.callbacks.onFieldsChange;if(a){var u=r.getFields();if(i){var o=new Qd;i.forEach(function(p){var v=p.name,y=p.errors;o.set(v,y)}),u.forEach(function(p){p.errors=o.get(p.name)||p.errors})}var f=u.filter(function(p){var v=p.name;return um(n,v)});a(f,u)}},this.validateFields=function(n,i){r.warningUnhooked();var a=!!n,u=a?n.map(bi):[],o=[];r.getFieldEntities(!0).forEach(function(v){if(a||u.push(v.getNamePath()),(i==null?void 0:i.recursive)&&a){var y=v.getNamePath();y.every(function(T,R){return n[R]===T||n[R]===void 0})&&u.push(y)}if(!(!v.props.rules||!v.props.rules.length)){var w=v.getNamePath();if(!a||um(u,w)){var k=v.validateRules(ve({validateMessages:ve(ve({},tO),r.validateMessages)},i));o.push(k.then(function(){return{name:w,errors:[],warnings:[]}}).catch(function(T){var R,A=[],I=[];return(R=T.forEach)===null||R===void 0||R.call(T,function(O){var N=O.rule.warningOnly,L=O.errors;N?I.push.apply(I,wt(L)):A.push.apply(A,wt(L))}),A.length?Promise.reject({name:w,errors:A,warnings:I}):{name:w,errors:A,warnings:I}}))}}});var f=TH(o);r.lastValidatePromise=f,f.catch(function(v){return v}).then(function(v){var y=v.map(function(w){var k=w.name;return k});r.notifyObservers(r.store,y,{type:"validateFinish"}),r.triggerOnFieldsChange(y,v)});var p=f.then(function(){return r.lastValidatePromise===f?Promise.resolve(r.getFieldsValue(u)):Promise.reject([])}).catch(function(v){var y=v.filter(function(w){return w&&w.errors.length});return Promise.reject({values:r.getFieldsValue(u),errorFields:y,outOfDate:r.lastValidatePromise!==f})});return p.catch(function(v){return v}),p},this.submit=function(){r.warningUnhooked(),r.validateFields().then(function(n){var i=r.callbacks.onFinish;if(i)try{i(n)}catch(a){console.error(a)}}).catch(function(n){var i=r.callbacks.onFinishFailed;i&&i(n)})},this.forceRootUpdate=t});function LS(e){var t=C.exports.useRef(),r=C.exports.useState({}),n=Le(r,2),i=n[1];if(!t.current)if(e)t.current=e;else{var a=function(){i({})},u=new MH(a);t.current=u.getForm()}return[t.current]}var eC=C.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),FS=function(t){var r=t.validateMessages,n=t.onFormChange,i=t.onFormFinish,a=t.children,u=C.exports.useContext(eC),o=C.exports.useRef({});return E(eC.Provider,{value:ve(ve({},u),{},{validateMessages:ve(ve({},u.validateMessages),r),triggerFormChange:function(p,v){n&&n(p,{changedFields:v,forms:o.current}),u.triggerFormChange(p,v)},triggerFormFinish:function(p,v){i&&i(p,{values:v,forms:o.current}),u.triggerFormFinish(p,v)},registerForm:function(p,v){p&&(o.current=ve(ve({},o.current),{},se({},p,v))),u.registerForm(p,v)},unregisterForm:function(p){var v=ve({},o.current);delete v[p],o.current=v,u.unregisterForm(p)}}),children:a})},IH=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],RH=function(t,r){var n=t.name,i=t.initialValues,a=t.fields,u=t.form,o=t.preserve,f=t.children,p=t.component,v=p===void 0?"form":p,y=t.validateMessages,w=t.validateTrigger,k=w===void 0?"onChange":w,T=t.onValuesChange,R=t.onFieldsChange,A=t.onFinish,I=t.onFinishFailed,O=Pr(t,IH),N=C.exports.useContext(eC),L=LS(u),B=Le(L,1),j=B[0],G=j.getInternalHooks(Kc),H=G.useSubscribe,te=G.setInitialValues,Y=G.setCallbacks,le=G.setValidateMessages,J=G.setPreserve,Z=G.destroyForm;C.exports.useImperativeHandle(r,function(){return j}),C.exports.useEffect(function(){return N.registerForm(n,j),function(){N.unregisterForm(n)}},[N,j,n]),le(ve(ve({},N.validateMessages),y)),Y({onValuesChange:T,onFieldsChange:function(ke){if(N.triggerFormChange(n,ke),R){for(var ze=arguments.length,Ie=new Array(ze>1?ze-1:0),Ne=1;Ne1)&&(e=1),e}function uy(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Wc(e){return e.length===1?"0"+e:String(e)}function WH(e,t,r){return{r:oo(e,255)*255,g:oo(t,255)*255,b:oo(r,255)*255}}function Jk(e,t,r){e=oo(e,255),t=oo(t,255),r=oo(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,u=0,o=(n+i)/2;if(n===i)u=0,a=0;else{var f=n-i;switch(u=o>.5?f/(2-n-i):f/(n+i),n){case e:a=(t-r)/f+(t1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function qH(e,t,r){var n,i,a;if(e=oo(e,360),t=oo(t,100),r=oo(r,100),t===0)i=r,a=r,n=r;else{var u=r<.5?r*(1+t):r+t-r*t,o=2*r-u;n=Db(o,u,e+1/3),i=Db(o,u,e),a=Db(o,u,e-1/3)}return{r:n*255,g:i*255,b:a*255}}function j0(e,t,r){e=oo(e,255),t=oo(t,255),r=oo(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,u=n,o=n-i,f=n===0?0:o/n;if(n===i)a=0;else{switch(n){case e:a=(t-r)/o+(t>16,g:(e&65280)>>8,b:e&255}}var tC={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",darkgreen:"#006400",darkgrey:"#a9a9a9",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",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",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 ps(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,u=!1,o=!1;return typeof e=="string"&&(e=eW(e)),typeof e=="object"&&(hl(e.r)&&hl(e.g)&&hl(e.b)?(t=WH(e.r,e.g,e.b),u=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):hl(e.h)&&hl(e.s)&&hl(e.v)?(n=uy(e.s),i=uy(e.v),t=GH(e.h,n,i),u=!0,o="hsv"):hl(e.h)&&hl(e.s)&&hl(e.l)&&(n=uy(e.s),a=uy(e.l),t=qH(e.h,n,a),u=!0,o="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=vO(r),{ok:u,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var QH="[-\\+]?\\d+%?",JH="[-\\+]?\\d*\\.\\d+%?",Eu="(?:".concat(JH,")|(?:").concat(QH,")"),Lb="[\\s|\\(]+(".concat(Eu,")[,|\\s]+(").concat(Eu,")[,|\\s]+(").concat(Eu,")\\s*\\)?"),Fb="[\\s|\\(]+(".concat(Eu,")[,|\\s]+(").concat(Eu,")[,|\\s]+(").concat(Eu,")[,|\\s]+(").concat(Eu,")\\s*\\)?"),us={CSS_UNIT:new RegExp(Eu),rgb:new RegExp("rgb"+Lb),rgba:new RegExp("rgba"+Fb),hsl:new RegExp("hsl"+Lb),hsla:new RegExp("hsla"+Fb),hsv:new RegExp("hsv"+Lb),hsva:new RegExp("hsva"+Fb),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function eW(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(tC[e])e=tC[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=us.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=us.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=us.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=us.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=us.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=us.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=us.hex8.exec(e),r?{r:ca(r[1]),g:ca(r[2]),b:ca(r[3]),a:eT(r[4]),format:t?"name":"hex8"}:(r=us.hex6.exec(e),r?{r:ca(r[1]),g:ca(r[2]),b:ca(r[3]),format:t?"name":"hex"}:(r=us.hex4.exec(e),r?{r:ca(r[1]+r[1]),g:ca(r[2]+r[2]),b:ca(r[3]+r[3]),a:eT(r[4]+r[4]),format:t?"name":"hex8"}:(r=us.hex3.exec(e),r?{r:ca(r[1]+r[1]),g:ca(r[2]+r[2]),b:ca(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function hl(e){return Boolean(us.CSS_UNIT.exec(String(e)))}var $b=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var n;if(t instanceof e)return t;typeof t=="number"&&(t=YH(t)),this.originalInput=t;var i=ps(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:i.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,n,i,a=t.r/255,u=t.g/255,o=t.b/255;return a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),u<=.03928?n=u/12.92:n=Math.pow((u+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),.2126*r+.7152*n+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=vO(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=j0(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=j0(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=Jk(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Jk(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),U0(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),ZH(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(n,")"):"rgba(".concat(t,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(oo(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(oo(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+U0(this.r,this.g,this.b,!1),r=0,n=Object.entries(tC);r=0,a=!r&&i&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=ly(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=ly(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=ly(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=ly(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var n=this.toRgb(),i=new e(t).toRgb(),a=r/100,u={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return new e(u)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var n=this.toHsl(),i=360/r,a=[this];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(new e(n));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),n=r.h,i=r.s,a=r.v,u=[],o=1/t;t--;)u.push(new e({h:n,s:i,v:a})),a=(a+o)%1;return u},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),i=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/i,g:(r.g*r.a+n.g*n.a*(1-r.a))/i,b:(r.b*r.a+n.b*n.a*(1-r.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,i=[this],a=360/t,u=1;u=60&&Math.round(e.h)<=240?n=r?Math.round(e.h)-cy*t:Math.round(e.h)+cy*t:n=r?Math.round(e.h)+cy*t:Math.round(e.h)-cy*t,n<0?n+=360:n>=360&&(n-=360),n}function iT(e,t,r){if(e.h===0&&e.s===0)return e.s;var n;return r?n=e.s-tT*t:t===yO?n=e.s+tT:n=e.s+tW*t,n>1&&(n=1),r&&t===gO&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function oT(e,t,r){var n;return r?n=e.v+rW*t:n=e.v-nW*t,n>1&&(n=1),Number(n.toFixed(2))}function $m(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[],n=ps(e),i=gO;i>0;i-=1){var a=rT(n),u=dy(ps({h:nT(a,i,!0),s:iT(a,i,!0),v:oT(a,i,!0)}));r.push(u)}r.push(dy(n));for(var o=1;o<=yO;o+=1){var f=rT(n),p=dy(ps({h:nT(f,o),s:iT(f,o),v:oT(f,o)}));r.push(p)}return t.theme==="dark"?iW.map(function(v){var y=v.index,w=v.opacity,k=dy(oW(ps(t.backgroundColor||"#141414"),ps(r[y]),w*100));return k}):r}var Bb={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Vb={},jb={};Object.keys(Bb).forEach(function(e){Vb[e]=$m(Bb[e]),Vb[e].primary=Vb[e][5],jb[e]=$m(Bb[e],{theme:"dark",backgroundColor:"#141414"}),jb[e].primary=jb[e][5]});function Lo(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Xc(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var r=t;r;){if(r===e)return!0;r=r.parentNode}return!1}var aT="data-rc-order",aW="rc-util-key",rC=new Map;function xO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):aW}function tx(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function sW(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function _O(e){return Array.from((rC.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function bO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Lo())return null;var r=t.csp,n=t.prepend,i=document.createElement("style");i.setAttribute(aT,sW(n)),r!=null&&r.nonce&&(i.nonce=r==null?void 0:r.nonce),i.innerHTML=e;var a=tx(t),u=a.firstChild;if(n){if(n==="queue"){var o=_O(a).filter(function(f){return["prepend","prependQueue"].includes(f.getAttribute(aT))});if(o.length)return a.insertBefore(i,o[o.length-1].nextSibling),i}a.insertBefore(i,u)}else a.appendChild(i);return i}function wO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=tx(t);return _O(r).find(function(n){return n.getAttribute(xO(t))===e})}function sT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=wO(e,t);if(r){var n=tx(t);n.removeChild(r)}}function lW(e,t){var r=rC.get(e);if(!r||!Xc(document,r)){var n=bO("",t),i=n.parentNode;rC.set(e,i),e.removeChild(n)}}function cv(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=tx(r);lW(n,r);var i=wO(t,r);if(i){var a,u;if((a=r.csp)!==null&&a!==void 0&&a.nonce&&i.nonce!==((u=r.csp)===null||u===void 0?void 0:u.nonce)){var o;i.nonce=(o=r.csp)===null||o===void 0?void 0:o.nonce}return i.innerHTML!==e&&(i.innerHTML=e),i}var f=bO(e,r);return f.setAttribute(xO(r),t),f}function uW(e,t){Fn(e,"[@ant-design/icons] ".concat(t))}function lT(e){return ar(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(ar(e.icon)==="object"||typeof e.icon=="function")}function uT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,r){var n=e[r];switch(r){case"class":t.className=n,delete t.class;break;default:t[r]=n}return t},{})}function nC(e,t,r){return r?en.createElement(e.tag,ve(ve({key:t},uT(e.attrs)),r),(e.children||[]).map(function(n,i){return nC(n,"".concat(t,"-").concat(e.tag,"-").concat(i))})):en.createElement(e.tag,ve({key:t},uT(e.attrs)),(e.children||[]).map(function(n,i){return nC(n,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function CO(e){return $m(e)[0]}function SO(e){return e?Array.isArray(e)?e:[e]:[]}var cW=` .anticon { display: inline-block; color: inherit; font-style: normal; line-height: 0; text-align: center; text-transform: none; vertical-align: -0.125em; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .anticon > * { line-height: 1; } .anticon svg { display: inline-block; } .anticon::before { display: none; } .anticon .anticon-icon { display: block; } .anticon[tabindex] { cursor: pointer; } .anticon-spin::before, .anticon-spin { display: inline-block; -webkit-animation: loadingCircle 1s infinite linear; animation: loadingCircle 1s infinite linear; } @-webkit-keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,dW=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cW,r=C.exports.useContext(OS),n=r.csp;C.exports.useEffect(function(){cv(t,"@ant-design-icons",{prepend:!0,csp:n})},[])},fW=["icon","className","onClick","style","primaryColor","secondaryColor"],cm={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function hW(e){var t=e.primaryColor,r=e.secondaryColor;cm.primaryColor=t,cm.secondaryColor=r||CO(t),cm.calculated=!!r}function pW(){return ve({},cm)}var rx=function(t){var r=t.icon,n=t.className,i=t.onClick,a=t.style,u=t.primaryColor,o=t.secondaryColor,f=Pr(t,fW),p=cm;if(u&&(p={primaryColor:u,secondaryColor:o||CO(u)}),dW(),uW(lT(r),"icon should be icon definiton, but got ".concat(r)),!lT(r))return null;var v=r;return v&&typeof v.icon=="function"&&(v=ve(ve({},v),{},{icon:v.icon(p.primaryColor,p.secondaryColor)})),nC(v.icon,"svg-".concat(v.name),ve({className:n,onClick:i,style:a,"data-icon":v.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f))};rx.displayName="IconReact";rx.getTwoToneColors=pW;rx.setTwoToneColors=hW;const BS=rx;function EO(e){var t=SO(e),r=Le(t,2),n=r[0],i=r[1];return BS.setTwoToneColors({primaryColor:n,secondaryColor:i})}function mW(){var e=BS.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var vW=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];EO("#1890ff");var nx=C.exports.forwardRef(function(e,t){var r,n=e.className,i=e.icon,a=e.spin,u=e.rotate,o=e.tabIndex,f=e.onClick,p=e.twoToneColor,v=Pr(e,vW),y=C.exports.useContext(OS),w=y.prefixCls,k=w===void 0?"anticon":w,T=y.rootClassName,R=Ye(T,k,(r={},se(r,"".concat(k,"-").concat(i.name),!!i.name),se(r,"".concat(k,"-spin"),!!a||i.name==="loading"),r),n),A=o;A===void 0&&f&&(A=-1);var I=u?{msTransform:"rotate(".concat(u,"deg)"),transform:"rotate(".concat(u,"deg)")}:void 0,O=SO(p),N=Le(O,2),L=N[0],B=N[1];return E("span",{...ve(ve({role:"img","aria-label":i.name},v),{},{ref:t,tabIndex:A,onClick:f,className:R}),children:E(BS,{icon:i,primaryColor:L,secondaryColor:B,style:I})})});nx.displayName="AntdIcon";nx.getTwoToneColor=mW;nx.setTwoToneColor=EO;const un=nx;var kO=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:UH})})};kO.displayName="CheckCircleFilled";const ix=C.exports.forwardRef(kO);var gW={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"};const yW=gW;var TO=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:yW})})};TO.displayName="CloseCircleFilled";const pd=C.exports.forwardRef(TO);var xW={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"};const _W=xW;var PO=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:_W})})};PO.displayName="ExclamationCircleFilled";const ox=C.exports.forwardRef(PO);var bW={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};const wW=bW;var MO=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:wW})})};MO.displayName="InfoCircleFilled";const IO=C.exports.forwardRef(MO);var CW={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const SW=CW;var RO=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:SW})})};RO.displayName="LoadingOutlined";const Bf=C.exports.forwardRef(RO);var dv=ve({},Pj),EW=dv.version,kW=dv.render,TW=dv.unmountComponentAtNode,ax;try{var PW=Number((EW||"").split(".")[0]);PW>=18&&(ax=dv.createRoot)}catch{}function cT(e){var t=dv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&ar(t)==="object"&&(t.usingClientEntryPoint=e)}var K0="__rc_react_root__";function MW(e,t){cT(!0);var r=t[K0]||ax(t);cT(!1),r.render(e),t[K0]=r}function IW(e,t){kW(e,t)}function OO(e,t){if(ax){MW(e,t);return}IW(e,t)}function RW(e){return iC.apply(this,arguments)}function iC(){return iC=hd(Do().mark(function e(t){return Do().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var i;(i=t[K0])===null||i===void 0||i.unmount(),delete t[K0]}));case 1:case"end":return n.stop()}},e)})),iC.apply(this,arguments)}function OW(e){TW(e)}function AO(e){return oC.apply(this,arguments)}function oC(){return oC=hd(Do().mark(function e(t){return Do().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(ax===void 0){n.next=2;break}return n.abrupt("return",RW(t));case 2:OW(t);case 3:case"end":return n.stop()}},e)})),oC.apply(this,arguments)}function dT(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit".concat(e)]="webkit".concat(t),r["Moz".concat(e)]="moz".concat(t),r["ms".concat(e)]="MS".concat(t),r["O".concat(e)]="o".concat(t.toLowerCase()),r}function AW(e,t){var r={animationend:dT("Animation","AnimationEnd"),transitionend:dT("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete r.animationend.animation,"TransitionEvent"in t||delete r.transitionend.transition),r}var NW=AW(Lo(),typeof window<"u"?window:{}),NO={};if(Lo()){var zW=document.createElement("div");NO=zW.style}var fy={};function zO(e){if(fy[e])return fy[e];var t=NW[e];if(t)for(var r=Object.keys(t),n=r.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:1;vT+=1;var n=vT;function i(a){if(a===0)VO(n),t();else{var u=$O(function(){i(a-1)});jS.set(n,u)}}return i(r),n};tn.cancel=function(e){var t=jS.get(e);return VO(t),BO(t)};const DW=function(){var e=C.exports.useRef(null);function t(){tn.cancel(e.current)}function r(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var a=tn(function(){i<=1?n({isCanceled:function(){return a!==e.current}}):r(n,i-1)});e.current=a}return C.exports.useEffect(function(){return function(){t()}},[]),[r,t]};var jO=Lo()?C.exports.useLayoutEffect:C.exports.useEffect,gT=[yl,yf,xf,VS],UO=!1,LW=!0;function KO(e){return e===xf||e===VS}const FW=function(e,t){var r=Ks(mT),n=Le(r,2),i=n[0],a=n[1],u=DW(),o=Le(u,2),f=o[0],p=o[1];function v(){a(yl,!0)}return jO(function(){if(i!==mT&&i!==VS){var y=gT.indexOf(i),w=gT[y+1],k=t(i);k===UO?a(w,!0):f(function(T){function R(){T.isCanceled()||a(w,!0)}k===!0?R():Promise.resolve(k).then(R)})}},[e,i]),C.exports.useEffect(function(){return function(){p()}},[]),[v,i]},$W=function(e){var t=C.exports.useRef(),r=C.exports.useRef(e);r.current=e;var n=C.exports.useCallback(function(u){r.current(u)},[]);function i(u){u&&(u.removeEventListener(hT,n),u.removeEventListener(fT,n))}function a(u){t.current&&t.current!==u&&i(t.current),u&&u!==t.current&&(u.addEventListener(hT,n),u.addEventListener(fT,n),t.current=u)}return C.exports.useEffect(function(){return function(){i(t.current)}},[]),[a,i]};function BW(e,t,r,n){var i=n.motionEnter,a=i===void 0?!0:i,u=n.motionAppear,o=u===void 0?!0:u,f=n.motionLeave,p=f===void 0?!0:f,v=n.motionDeadline,y=n.motionLeaveImmediately,w=n.onAppearPrepare,k=n.onEnterPrepare,T=n.onLeavePrepare,R=n.onAppearStart,A=n.onEnterStart,I=n.onLeaveStart,O=n.onAppearActive,N=n.onEnterActive,L=n.onLeaveActive,B=n.onAppearEnd,j=n.onEnterEnd,G=n.onLeaveEnd,H=n.onVisibleChanged,te=Ks(),Y=Le(te,2),le=Y[0],J=Y[1],Z=Ks(nf),Q=Le(Z,2),ge=Q[0],ne=Q[1],de=Ks(null),oe=Le(de,2),ye=oe[0],Re=oe[1],Te=C.exports.useRef(!1),ke=C.exports.useRef(null);function ze(){return r()}var Ie=C.exports.useRef(!1);function Ne(Ct){var Dt=ze();if(!(Ct&&!Ct.deadline&&Ct.target!==Dt)){var lt=Ie.current,dt;ge===hy&<?dt=B==null?void 0:B(Dt,Ct):ge===py&<?dt=j==null?void 0:j(Dt,Ct):ge===my&<&&(dt=G==null?void 0:G(Dt,Ct)),ge!==nf&<&&dt!==!1&&(ne(nf,!0),Re(null,!0))}}var De=$W(Ne),Ve=Le(De,1),Ge=Ve[0],je=C.exports.useMemo(function(){var Ct,Dt,lt;switch(ge){case hy:return Ct={},se(Ct,yl,w),se(Ct,yf,R),se(Ct,xf,O),Ct;case py:return Dt={},se(Dt,yl,k),se(Dt,yf,A),se(Dt,xf,N),Dt;case my:return lt={},se(lt,yl,T),se(lt,yf,I),se(lt,xf,L),lt;default:return{}}},[ge]),ct=FW(ge,function(Ct){if(Ct===yl){var Dt=je[yl];return Dt?Dt(ze()):UO}if(Xe in je){var lt;Re(((lt=je[Xe])===null||lt===void 0?void 0:lt.call(je,ze(),null))||null)}return Xe===xf&&(Ge(ze()),v>0&&(clearTimeout(ke.current),ke.current=setTimeout(function(){Ne({deadline:!0})},v))),LW}),pt=Le(ct,2),Tt=pt[0],Xe=pt[1],Pt=KO(Xe);Ie.current=Pt,jO(function(){J(t);var Ct=Te.current;if(Te.current=!0,!!e){var Dt;!Ct&&t&&o&&(Dt=hy),Ct&&t&&a&&(Dt=py),(Ct&&!t&&p||!Ct&&y&&!t&&p)&&(Dt=my),Dt&&(ne(Dt),Tt())}},[t]),C.exports.useEffect(function(){(ge===hy&&!o||ge===py&&!a||ge===my&&!p)&&ne(nf)},[o,a,p]),C.exports.useEffect(function(){return function(){Te.current=!1,clearTimeout(ke.current)}},[]);var mt=C.exports.useRef(!1);C.exports.useEffect(function(){le&&(mt.current=!0),le!==void 0&&ge===nf&&((mt.current||le)&&(H==null||H(le)),mt.current=!0)},[le,ge]);var It=ye;return je[yl]&&Xe===yf&&(It=ve({transition:"none"},It)),[ge,Xe,It,le!=null?le:t]}var VW=function(e){vi(r,e);var t=gi(r);function r(){return Yn(this,r),t.apply(this,arguments)}return Qn(r,[{key:"render",value:function(){return this.props.children}}]),r}(C.exports.Component);function jW(e){var t=e;ar(e)==="object"&&(t=e.transitionSupport);function r(i){return!!(i.motionName&&t)}var n=C.exports.forwardRef(function(i,a){var u=i.visible,o=u===void 0?!0:u,f=i.removeOnLeave,p=f===void 0?!0:f,v=i.forceRender,y=i.children,w=i.motionName,k=i.leavedClassName,T=i.eventProps,R=r(i),A=C.exports.useRef(),I=C.exports.useRef();function O(){try{return A.current instanceof HTMLElement?A.current:Lm(I.current)}catch{return null}}var N=BW(R,o,O,i),L=Le(N,4),B=L[0],j=L[1],G=L[2],H=L[3],te=C.exports.useRef(H);H&&(te.current=!0);var Y=C.exports.useCallback(function(de){A.current=de,$0(a,de)},[a]),le,J=ve(ve({},T),{},{visible:o});if(!y)le=null;else if(B===nf||!r(i))H?le=y(ve({},J),Y):!p&&te.current&&k?le=y(ve(ve({},J),{},{className:k}),Y):v||!p&&!k?le=y(ve(ve({},J),{},{style:{display:"none"}}),Y):le=null;else{var Z,Q;j===yl?Q="prepare":KO(j)?Q="active":j===yf&&(Q="start"),le=y(ve(ve({},J),{},{className:Ye(pT(w,B),(Z={},se(Z,pT(w,"".concat(B,"-").concat(Q)),Q),se(Z,w,typeof w=="string"),Z)),style:G}),Y)}if(C.exports.isValidElement(le)&&fd(le)){var ge=le,ne=ge.ref;ne||(le=C.exports.cloneElement(le,{ref:Y}))}return E(VW,{ref:I,children:le})});return n.displayName="CSSMotion",n}const Ga=jW(FO);var aC="add",sC="keep",lC="remove",Ub="removed";function UW(e){var t;return e&&ar(e)==="object"&&"key"in e?t=e:t={key:e},ve(ve({},t),{},{key:String(t.key)})}function uC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(UW)}function KW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=[],n=0,i=t.length,a=uC(e),u=uC(t);a.forEach(function(p){for(var v=!1,y=n;y1});return f.forEach(function(p){r=r.filter(function(v){var y=v.key,w=v.status;return y!==p||w!==lC}),r.forEach(function(v){v.key===p&&(v.status=sC)})}),r}var HW=["component","children","onVisibleChanged","onAllRemoved"],WW=["status"],qW=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function GW(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ga,r=function(n){vi(a,n);var i=gi(a);function a(){var u;Yn(this,a);for(var o=arguments.length,f=new Array(o),p=0;p=w&&(y.key=A[0].notice.key,y.updateMark=xT(),y.userPassKey=v,A.shift()),A.push({notice:y,holderCallback:f})),{notices:A}})},n.remove=function(o){n.setState(function(f){var p=f.notices;return{notices:p.filter(function(v){var y=v.notice,w=y.key,k=y.userPassKey,T=k!=null?k:w;return T!==o})}})},n.noticePropsMap={},n}return Qn(r,[{key:"getTransitionName",value:function(){var i=this.props,a=i.prefixCls,u=i.animation,o=this.props.transitionName;return!o&&u&&(o="".concat(a,"-").concat(u)),o}},{key:"render",value:function(){var i=this,a=this.state.notices,u=this.props,o=u.prefixCls,f=u.className,p=u.closeIcon,v=u.style,y=[];return a.forEach(function(w,k){var T=w.notice,R=w.holderCallback,A=k===a.length-1?T.updateMark:void 0,I=T.key,O=T.userPassKey,N=ve(ve(ve({prefixCls:o,closeIcon:p},T),T.props),{},{key:I,noticeKey:O||I,updateMark:A,onClose:function(B){var j;i.remove(B),(j=T.onClose)===null||j===void 0||j.call(T)},onClick:T.onClick,children:T.content});y.push(I),i.noticePropsMap[I]={props:N,holderCallback:R}}),E("div",{className:Ye(o,f),style:v,children:E(HO,{keys:y,motionName:this.getTransitionName(),onVisibleChanged:function(k,T){var R=T.key;k||delete i.noticePropsMap[R]},children:function(w){var k=w.key,T=w.className,R=w.style,A=w.visible,I=i.noticePropsMap[k],O=I.props,N=I.holderCallback;return N?E("div",{className:Ye(T,"".concat(o,"-hook-holder")),style:ve({},R),ref:function(B){typeof k>"u"||(B?(i.hookRefs.set(k,B),N(B,O)):i.hookRefs.delete(k))}},k):E(US,{...O,className:Ye(T,O==null?void 0:O.className),style:ve(ve({},R),O==null?void 0:O.style),visible:A})}})})}}]),r}(C.exports.Component);Vf.newInstance=void 0;Vf.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}};Vf.newInstance=function(t,r){var n=t||{},i=n.getContainer,a=Pr(n,ZW),u=document.createElement("div");if(i){var o=i();o.appendChild(u)}else document.body.appendChild(u);var f=!1;function p(v){f||(f=!0,r({notice:function(w){v.add(w)},removeNotice:function(w){v.remove(w)},component:v,destroy:function(){AO(u),u.parentNode&&u.parentNode.removeChild(u)},useNotification:function(){return KS(v)}}))}OO(E(Vf,{...a,ref:p}),u)};function YW(e,t){var r=function(){var i,a,u=null,o={add:function(R,A){u==null||u.component.add(R,A)}},f=KS(o),p=Le(f,2),v=p[0],y=p[1];function w(T){var R=T.prefixCls,A=i("message",R),I=i(),O=T.key||JO(),N=new Promise(function(B){var j=function(){return typeof T.onClose=="function"&&T.onClose(),B(!0)};e(tt(tt({},T),{prefixCls:A,rootPrefixCls:I,getPopupContainer:a}),function(G){var H=G.prefixCls,te=G.instance;u=te,v(t(tt(tt({},T),{key:O,onClose:j}),H))})}),L=function(){u&&u.removeNotice(O)};return L.then=function(B,j){return N.then(B,j)},L.promise=N,L}var k=C.exports.useRef({});return k.current.open=w,rA.forEach(function(T){return iA(k.current,T)}),[k.current,E(Ju,{children:function(T){return i=T.getPrefixCls,a=T.getPopupContainer,y}},"holder")]};return r}var Oo,WO=3,qO,QW=1,GO="",cC="move-up",ZO=!1,XO,YO,QO=!1;function JO(){return QW++}function JW(e){e.top!==void 0&&(qO=e.top,Oo=null),e.duration!==void 0&&(WO=e.duration),e.prefixCls!==void 0&&(GO=e.prefixCls),e.getContainer!==void 0&&(XO=e.getContainer,Oo=null),e.transitionName!==void 0&&(cC=e.transitionName,Oo=null,ZO=!0),e.maxCount!==void 0&&(YO=e.maxCount,Oo=null),e.rtl!==void 0&&(QO=e.rtl)}function eA(e,t){var r=e.prefixCls,n=e.getPopupContainer,i=GS(),a=i.getPrefixCls,u=i.getRootPrefixCls,o=i.getIconPrefixCls,f=a("message",r||GO),p=u(e.rootPrefixCls,f),v=o();if(Oo){t({prefixCls:f,rootPrefixCls:p,iconPrefixCls:v,instance:Oo});return}var y={prefixCls:f,transitionName:ZO?cC:"".concat(p,"-").concat(cC),style:{top:qO},getContainer:XO||n,maxCount:YO};Vf.newInstance(y,function(w){if(Oo){t({prefixCls:f,rootPrefixCls:p,iconPrefixCls:v,instance:Oo});return}Oo=w,t({prefixCls:f,rootPrefixCls:p,iconPrefixCls:v,instance:w})})}var tA={info:IO,success:ix,error:pd,warning:ox,loading:Bf},rA=Object.keys(tA);function nA(e,t,r){var n,i=e.duration!==void 0?e.duration:WO,a=tA[e.type],u=Ye("".concat(t,"-custom-content"),(n={},se(n,"".concat(t,"-").concat(e.type),e.type),se(n,"".concat(t,"-rtl"),QO===!0),n));return{key:e.key,duration:i,style:e.style||{},className:e.className,content:E(uh,{iconPrefixCls:r,children:Qe("div",{className:u,children:[e.icon||a&&E(a,{}),E("span",{children:e.content})]})}),onClose:e.onClose,onClick:e.onClick}}function eq(e){var t=e.key||JO(),r=new Promise(function(i){var a=function(){return typeof e.onClose=="function"&&e.onClose(),i(!0)};eA(e,function(u){var o=u.prefixCls,f=u.iconPrefixCls,p=u.instance;p.notice(nA(tt(tt({},e),{key:t,onClose:a}),o,f))})}),n=function(){var a;Oo&&(Oo.removeNotice(t),(a=e.onClose)===null||a===void 0||a.call(e))};return n.then=function(i,a){return r.then(i,a)},n.promise=r,n}function tq(e){return Object.prototype.toString.call(e)==="[object Object]"&&!!e.content}var Bm={open:eq,config:JW,destroy:function(t){if(Oo)if(t){var r=Oo,n=r.removeNotice;n(t)}else{var i=Oo,a=i.destroy;a(),Oo=null}}};function iA(e,t){e[t]=function(r,n,i){return tq(r)?e.open(tt(tt({},r),{type:t})):(typeof n=="function"&&(i=n,n=void 0),e.open({content:r,duration:n,type:t,onClose:i}))}}rA.forEach(function(e){return iA(Bm,e)});Bm.warn=Bm.warning;Bm.useMessage=YW(eA,nA);const rq=Bm;var nq={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};const iq=nq;var oA=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:iq})})};oA.displayName="CheckCircleOutlined";const HS=C.exports.forwardRef(oA);var oq={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}},{tag:"path",attrs:{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"close-circle",theme:"outlined"};const aq=oq;var aA=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:aq})})};aA.displayName="CloseCircleOutlined";const WS=C.exports.forwardRef(aA);var sq={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"};const lq=sq;var sA=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:lq})})};sA.displayName="CloseOutlined";const sx=C.exports.forwardRef(sA);var uq={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"};const cq=uq;var lA=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:cq})})};lA.displayName="ExclamationCircleOutlined";const lx=C.exports.forwardRef(lA);var dq={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};const fq=dq;var uA=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:fq})})};uA.displayName="InfoCircleOutlined";const qS=C.exports.forwardRef(uA);function hq(e,t){var r=function(){var i,a=null,u={add:function(T,R){a==null||a.component.add(T,R)}},o=KS(u),f=Le(o,2),p=f[0],v=f[1];function y(k){var T=k.prefixCls,R=i("notification",T);e(tt(tt({},k),{prefixCls:R}),function(A){var I=A.prefixCls,O=A.instance;a=O,p(t(k,I))})}var w=C.exports.useRef({});return w.current.open=y,["success","info","warning","error"].forEach(function(k){w.current[k]=function(T){return w.current.open(tt(tt({},T),{type:k}))}}),[w.current,E(Ju,{children:function(k){return i=k.getPrefixCls,v}},"holder")]};return r}globalThis&&globalThis.__awaiter;var $c={},cA=4.5,dA=24,fA=24,hA="",dC="topRight",pA,mA,vA=!1,gA;function pq(e){var t=e.duration,r=e.placement,n=e.bottom,i=e.top,a=e.getContainer,u=e.closeIcon,o=e.prefixCls;o!==void 0&&(hA=o),t!==void 0&&(cA=t),r!==void 0?dC=r:e.rtl&&(dC="topLeft"),n!==void 0&&(fA=n),i!==void 0&&(dA=i),a!==void 0&&(pA=a),u!==void 0&&(mA=u),e.rtl!==void 0&&(vA=e.rtl),e.maxCount!==void 0&&(gA=e.maxCount)}function mq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dA,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fA,n;switch(e){case"top":n={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":n={left:0,top:t,bottom:"auto"};break;case"topRight":n={right:0,top:t,bottom:"auto"};break;case"bottom":n={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:r};break;case"bottomLeft":n={left:0,top:"auto",bottom:r};break;default:n={right:0,top:"auto",bottom:r};break}return n}function yA(e,t){var r=e.placement,n=r===void 0?dC:r,i=e.top,a=e.bottom,u=e.getContainer,o=u===void 0?pA:u,f=e.prefixCls,p=GS(),v=p.getPrefixCls,y=p.getIconPrefixCls,w=v("notification",f||hA),k=y(),T="".concat(w,"-").concat(n),R=$c[T];if(R){Promise.resolve(R).then(function(I){t({prefixCls:"".concat(w,"-notice"),iconPrefixCls:k,instance:I})});return}var A=Ye("".concat(w,"-").concat(n),se({},"".concat(w,"-rtl"),vA===!0));$c[T]=new Promise(function(I){Vf.newInstance({prefixCls:w,className:A,style:mq(n,i,a),getContainer:o,maxCount:gA},function(O){I(O),t({prefixCls:"".concat(w,"-notice"),iconPrefixCls:k,instance:O})})})}var vq={success:HS,info:qS,error:WS,warning:lx};function xA(e,t,r){var n=e.duration,i=e.icon,a=e.type,u=e.description,o=e.message,f=e.btn,p=e.onClose,v=e.onClick,y=e.key,w=e.style,k=e.className,T=e.closeIcon,R=T===void 0?mA:T,A=e.props,I=n===void 0?cA:n,O=null;i?O=E("span",{className:"".concat(t,"-icon"),children:e.icon}):a&&(O=C.exports.createElement(vq[a]||null,{className:"".concat(t,"-icon ").concat(t,"-icon-").concat(a)}));var N=E("span",{className:"".concat(t,"-close-x"),children:R||E(sx,{className:"".concat(t,"-close-icon")})}),L=!u&&O?E("span",{className:"".concat(t,"-message-single-line-auto-margin")}):null;return{content:E(uh,{iconPrefixCls:r,children:Qe("div",{className:O?"".concat(t,"-with-icon"):"",role:"alert",children:[O,Qe("div",{className:"".concat(t,"-message"),children:[L,o]}),E("div",{className:"".concat(t,"-description"),children:u}),f?E("span",{className:"".concat(t,"-btn"),children:f}):null]})}),duration:I,closable:!0,closeIcon:N,onClose:p,onClick:v,key:y,style:w||{},className:Ye(k,se({},"".concat(t,"-").concat(a),!!a)),props:A}}function gq(e){yA(e,function(t){var r=t.prefixCls,n=t.iconPrefixCls,i=t.instance;i.notice(xA(e,r,n))})}var jf={open:gq,close:function(t){Object.keys($c).forEach(function(r){return Promise.resolve($c[r]).then(function(n){n.removeNotice(t)})})},config:pq,destroy:function(){Object.keys($c).forEach(function(t){Promise.resolve($c[t]).then(function(r){r.destroy()}),delete $c[t]})}};["success","info","warning","error"].forEach(function(e){jf[e]=function(t){return jf.open(tt(tt({},t),{type:e}))}});jf.warn=jf.warning;jf.useNotification=hq(yA,xA);const yq=jf;var xq=function(t,r){return r||(t?"ant-".concat(t):"ant")},Ar=C.exports.createContext({getPrefixCls:xq}),Ju=Ar.Consumer,_q="-ant-".concat(Date.now(),"-").concat(Math.random());function bq(e,t){var r={},n=function(v,y){var w=v.clone();return w=(y==null?void 0:y(w))||w,w.toRgbString()},i=function(v,y){var w=new $b(v),k=$m(w.toRgbString());r["".concat(y,"-color")]=n(w),r["".concat(y,"-color-disabled")]=k[1],r["".concat(y,"-color-hover")]=k[4],r["".concat(y,"-color-active")]=k[6],r["".concat(y,"-color-outline")]=w.clone().setAlpha(.2).toRgbString(),r["".concat(y,"-color-deprecated-bg")]=k[0],r["".concat(y,"-color-deprecated-border")]=k[2]};if(t.primaryColor){i(t.primaryColor,"primary");var a=new $b(t.primaryColor),u=$m(a.toRgbString());u.forEach(function(p,v){r["primary-".concat(v+1)]=p}),r["primary-color-deprecated-l-35"]=n(a,function(p){return p.lighten(35)}),r["primary-color-deprecated-l-20"]=n(a,function(p){return p.lighten(20)}),r["primary-color-deprecated-t-20"]=n(a,function(p){return p.tint(20)}),r["primary-color-deprecated-t-50"]=n(a,function(p){return p.tint(50)}),r["primary-color-deprecated-f-12"]=n(a,function(p){return p.setAlpha(p.getAlpha()*.12)});var o=new $b(u[0]);r["primary-color-active-deprecated-f-30"]=n(o,function(p){return p.setAlpha(p.getAlpha()*.3)}),r["primary-color-active-deprecated-d-02"]=n(o,function(p){return p.darken(2)})}t.successColor&&i(t.successColor,"success"),t.warningColor&&i(t.warningColor,"warning"),t.errorColor&&i(t.errorColor,"error"),t.infoColor&&i(t.infoColor,"info");var f=Object.keys(r).map(function(p){return"--".concat(e,"-").concat(p,": ").concat(r[p],";")});return` :root { `.concat(f.join(` `),` } `).trim()}function wq(e,t){var r=bq(e,t);Lo()&&cv(r,"".concat(_q,"-dynamic-theme"))}var fC=C.exports.createContext(!1),_A=function(t){var r=t.children,n=t.disabled,i=C.exports.useContext(fC);return E(fC.Provider,{value:n!=null?n:i,children:r})};const ec=fC;var hC=C.exports.createContext(void 0),bA=function(t){var r=t.children,n=t.size;return E(hC.Consumer,{children:function(i){return E(hC.Provider,{value:n||i,children:r})}})};const qs=hC;var Cq=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form"],Sq="ant",Eq="anticon",H0,wA;function Qy(){return H0||Sq}function kq(){return wA||Eq}var Tq=function(t){var r=t.prefixCls,n=t.iconPrefixCls,i=t.theme;r!==void 0&&(H0=r),n!==void 0&&(wA=n),i&&wq(Qy(),i)},GS=function(){return{getPrefixCls:function(r,n){return n||(r?"".concat(Qy(),"-").concat(r):Qy())},getIconPrefixCls:kq,getRootPrefixCls:function(r,n){return r||H0||(n&&n.includes("-")?n.replace(/^(.*)-[^-]*$/,"$1"):Qy())}}},Pq=function(t){var r,n,i=t.children,a=t.csp,u=t.autoInsertSpaceInButton,o=t.form,f=t.locale,p=t.componentSize,v=t.direction,y=t.space,w=t.virtual,k=t.dropdownMatchSelectWidth,T=t.legacyLocale,R=t.parentContext,A=t.iconPrefixCls,I=t.componentDisabled,O=C.exports.useCallback(function(H,te){var Y=t.prefixCls;if(te)return te;var le=Y||R.getPrefixCls("");return H?"".concat(le,"-").concat(H):le},[R.getPrefixCls,t.prefixCls]),N=tt(tt({},R),{csp:a,autoInsertSpaceInButton:u,locale:f||T,direction:v,space:y,virtual:w,dropdownMatchSelectWidth:k,getPrefixCls:O});Cq.forEach(function(H){var te=t[H];te&&(N[H]=te)});var L=sv(function(){return N},N,function(H,te){var Y=Object.keys(H),le=Object.keys(te);return Y.length!==le.length||Y.some(function(J){return H[J]!==te[J]})}),B=C.exports.useMemo(function(){return{prefixCls:A,csp:a}},[A,a]),j=i,G={};return f&&(G=((r=f.Form)===null||r===void 0?void 0:r.defaultValidateMessages)||((n=Ol.Form)===null||n===void 0?void 0:n.defaultValidateMessages)||{}),o&&o.validateMessages&&(G=tt(tt({},G),o.validateMessages)),Object.keys(G).length>0&&(j=E(FS,{validateMessages:G,children:i})),f&&(j=E(BH,{locale:f,_ANT_MARK__:FH,children:j})),(A||a)&&(j=E(OS.Provider,{value:B,children:j})),p&&(j=E(bA,{size:p,children:j})),I!==void 0&&(j=E(_A,{disabled:I,children:j})),E(Ar.Provider,{value:L,children:j})},uh=function(t){return C.exports.useEffect(function(){t.direction&&(rq.config({rtl:t.direction==="rtl"}),yq.config({rtl:t.direction==="rtl"}))},[t.direction]),E(uv,{children:function(r,n,i){return E(Ju,{children:function(a){return E(Pq,{parentContext:a,legacyLocale:i,...t})}})}})};uh.ConfigContext=Ar;uh.SizeContext=qs;uh.config=Tq;function Sl(e,t,r,n){var i=rd.unstable_batchedUpdates?function(u){rd.unstable_batchedUpdates(r,u)}:r;return e.addEventListener&&e.addEventListener(t,i,n),{remove:function(){e.removeEventListener&&e.removeEventListener(t,i,n)}}}function CA(e){return Object.keys(e).reduce(function(t,r){return(r.startsWith("data-")||r.startsWith("aria-")||r==="role")&&!r.startsWith("data-__")&&(t[r]=e[r]),t},{})}var Yo=C.exports.isValidElement;function SA(e){return e&&Yo(e)&&e.type===C.exports.Fragment}function EA(e,t,r){return Yo(e)?C.exports.cloneElement(e,typeof r=="function"?r(e.props||{}):r):t}function Ni(e,t){return EA(e,e,t)}var Mq=function(e){vi(r,e);var t=gi(r);function r(){var n;return Yn(this,r),n=t.apply(this,arguments),n.state={error:void 0,info:{componentStack:""}},n}return Qn(r,[{key:"componentDidCatch",value:function(i,a){this.setState({error:i,info:a})}},{key:"render",value:function(){var i=this.props,a=i.message,u=i.description,o=i.children,f=this.state,p=f.error,v=f.info,y=v&&v.componentStack?v.componentStack:null,w=typeof a>"u"?(p||"").toString():a,k=typeof u>"u"?y:u;return p?E(ux,{type:"error",message:w,description:E("pre",{children:k})}):o}}]),r}(C.exports.Component);const Iq=Mq;var Rq=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i"u")return 0;var i=t?"scrollTop":"scrollLeft",a=0;return pC(e)?a=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?a=e.documentElement[i]:(e instanceof HTMLElement||e)&&(a=e[i]),e&&!pC(e)&&typeof a!="number"&&(a=(n=((r=e.ownerDocument)!==null&&r!==void 0?r:e).documentElement)===null||n===void 0?void 0:n[i]),a}function Lq(e,t,r,n){var i=r-t;return e/=n/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function Fq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.getContainer,n=r===void 0?function(){return window}:r,i=t.callback,a=t.duration,u=a===void 0?450:a,o=n(),f=Dq(o,!0),p=Date.now(),v=function y(){var w=Date.now(),k=w-p,T=Lq(k>u?u:k,f,e,u);pC(o)?o.scrollTo(window.pageXOffset,T):o instanceof Document||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=T:o.scrollTop=T,k"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};var Et={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var r=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||r>=Et.F1&&r<=Et.F12)return!1;switch(r){case Et.ALT:case Et.CAPS_LOCK:case Et.CONTEXT_MENU:case Et.CTRL:case Et.DOWN:case Et.END:case Et.ESC:case Et.HOME:case Et.INSERT:case Et.LEFT:case Et.MAC_FF_META:case Et.META:case Et.NUMLOCK:case Et.NUM_CENTER:case Et.PAGE_DOWN:case Et.PAGE_UP:case Et.PAUSE:case Et.PRINT_SCREEN:case Et.RIGHT:case Et.SHIFT:case Et.UP:case Et.WIN_KEY:case Et.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=Et.ZERO&&t<=Et.NINE||t>=Et.NUM_ZERO&&t<=Et.NUM_MULTIPLY||t>=Et.A&&t<=Et.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case Et.SPACE:case Et.QUESTION_MARK:case Et.NUM_PLUS:case Et.NUM_MINUS:case Et.NUM_PERIOD:case Et.NUM_DIVISION:case Et.SEMICOLON:case Et.DASH:case Et.EQUALS:case Et.COMMA:case Et.PERIOD:case Et.SLASH:case Et.APOSTROPHE:case Et.SINGLE_QUOTE:case Et.OPEN_SQUARE_BRACKET:case Et.BACKSLASH:case Et.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},PA=C.exports.createContext(null);function MA(){return C.exports.useContext(PA)}function $q(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=C.exports.useState(!1),r=Le(t,2),n=r[0],i=r[1],a=C.exports.useRef(null),u=function(){window.clearTimeout(a.current)};C.exports.useEffect(function(){return u},[]);var o=function(p,v){u(),a.current=window.setTimeout(function(){i(p),v&&v()},e)};return[n,o,u]}function IA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=C.exports.useRef(null),r=C.exports.useRef(null);C.exports.useEffect(function(){return function(){window.clearTimeout(r.current)}},[]);function n(i){(i||t.current===null)&&(t.current=i),window.clearTimeout(r.current),r.current=window.setTimeout(function(){t.current=null},e)}return[function(){return t.current},n]}function Bq(e,t,r,n){var i=C.exports.useRef(null);i.current={open:t,triggerOpen:r,customizedTrigger:n},C.exports.useEffect(function(){function a(u){var o;if(!((o=i.current)!==null&&o!==void 0&&o.customizedTrigger)){var f=u.target;f.shadowRoot&&u.composed&&(f=u.composedPath()[0]||f),i.current.open&&e().filter(function(p){return p}).every(function(p){return!p.contains(f)&&p!==f})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",a),function(){return window.removeEventListener("mousedown",a)}},[])}var Vq=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name noValidate nonce open optimum pattern placeholder poster preload radioGroup readOnly rel required reversed role rowSpan rows sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap`,jq=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Uq="".concat(Vq," ").concat(jq).split(/[\s\n]+/),Kq="aria-",Hq="data-";function bT(e,t){return e.indexOf(t)===0}function Ku(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r;t===!1?r={aria:!0,data:!0,attr:!0}:t===!0?r={aria:!0}:r=ve({},t);var n={};return Object.keys(e).forEach(function(i){(r.aria&&(i==="role"||bT(i,Kq))||r.data&&bT(i,Hq)||r.attr&&Uq.includes(i))&&(n[i]=e[i])}),n}var Wq=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Jd=void 0;function qq(e,t){var r=e.prefixCls,n=e.invalidate,i=e.item,a=e.renderItem,u=e.responsive,o=e.responsiveDisabled,f=e.registerSize,p=e.itemKey,v=e.className,y=e.style,w=e.children,k=e.display,T=e.order,R=e.component,A=R===void 0?"div":R,I=Pr(e,Wq),O=u&&!k;function N(H){f(p,H)}C.exports.useEffect(function(){return function(){N(null)}},[]);var L=a&&i!==Jd?a(i):w,B;n||(B={opacity:O?0:1,height:O?0:Jd,overflowY:O?"hidden":Jd,order:u?T:Jd,pointerEvents:O?"none":Jd,position:O?"absolute":Jd});var j={};O&&(j["aria-hidden"]=!0);var G=E(A,{className:Ye(!n&&r,v),style:ve(ve({},B),y),...j,...I,ref:t,children:L});return u&&(G=E(Bl,{onResize:function(te){var Y=te.offsetWidth;N(Y)},disabled:o,children:G})),G}var dm=C.exports.forwardRef(qq);dm.displayName="Item";function Gq(){var e=Ks({}),t=Le(e,2),r=t[1],n=C.exports.useRef([]),i=0,a=0;function u(o){var f=i;i+=1,n.current.lengthT,qe=C.exports.useMemo(function(){var ot=a;return jt?le===null&&H?ot=a:ot=a.slice(0,Math.min(a.length,Z/v)):typeof T=="number"&&(ot=a.slice(0,T)),ot},[a,v,le,T,jt]),Xt=C.exports.useMemo(function(){return jt?a.slice(Dt+1):a.slice(qe.length)},[a,qe,jt,Dt]),cr=C.exports.useCallback(function(ot,ht){var Ot;return typeof f=="function"?f(ot):(Ot=f&&(ot==null?void 0:ot[f]))!==null&&Ot!==void 0?Ot:ht},[f]),Vt=C.exports.useCallback(u||function(ot){return ot},[u]);function Ut(ot,ht,Ot){It===ot&&(ht===void 0||ht===Tt)||(Ct(ot),Ot||(it(otZ){Ut($t-1,ot-ur-Ge+Ie);break}}I&&qt(0)+Ge>Z&&Xe(null)}},[Z,ne,Ie,Ge,cr,qe]);var or=ut&&!!Xt.length,Lr={};Tt!==null&&jt&&(Lr={position:"absolute",left:Tt,top:0});var Er={prefixCls:ft,responsive:jt,component:L,invalidate:Qt},Lt=o?function(ot,ht){var Ot=cr(ot,ht);return E(W0.Provider,{value:ve(ve({},Er),{},{order:ht,item:ot,itemKey:Ot,registerSize:xr,display:ht<=Dt}),children:o(ot,ht)},Ot)}:function(ot,ht){var Ot=cr(ot,ht);return C.exports.createElement(dm,{...Er,order:ht,key:Ot,item:ot,renderItem:Vt,itemKey:Ot,registerSize:xr,display:ht<=Dt})},kr,wr={order:or?Dt:Number.MAX_SAFE_INTEGER,className:"".concat(ft,"-rest"),registerSize:Rr,display:or};if(A)A&&(kr=E(W0.Provider,{value:ve(ve({},Er),wr),children:A(Xt)}));else{var fr=R||eG;kr=E(dm,{...Er,...wr,children:typeof fr=="function"?fr(Xt):fr})}var Nt=Qe(N,{className:Ye(!Qt&&n,k),style:w,ref:t,...j,children:[qe.map(Lt),Fe?kr:null,I&&E(dm,{...Er,responsive:Wt,responsiveDisabled:!jt,order:Dt,className:"".concat(ft,"-suffix"),registerSize:_t,display:!0,style:Lr,children:I})]});return Wt&&(Nt=E(Bl,{onResize:rr,disabled:!jt,children:Nt})),Nt}var Hs=C.exports.forwardRef(tG);Hs.displayName="Overflow";Hs.Item=RA;Hs.RESPONSIVE=OA;Hs.INVALIDATE=AA;var q0=function(t){var r=t.className,n=t.customizeIcon,i=t.customizeIconProps,a=t.onMouseDown,u=t.onClick,o=t.children,f;return typeof n=="function"?f=n(i):f=n,E("span",{className:r,onMouseDown:function(v){v.preventDefault(),a&&a(v)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:u,"aria-hidden":!0,children:f!==void 0?f:E("span",{className:Ye(r.split(/\s+/).map(function(p){return"".concat(p,"-icon")})),children:o})})},rG=function(t,r){var n,i,a=t.prefixCls,u=t.id,o=t.inputElement,f=t.disabled,p=t.tabIndex,v=t.autoFocus,y=t.autoComplete,w=t.editable,k=t.activeDescendantId,T=t.value,R=t.maxLength,A=t.onKeyDown,I=t.onMouseDown,O=t.onChange,N=t.onPaste,L=t.onCompositionStart,B=t.onCompositionEnd,j=t.open,G=t.attrs,H=o||E("input",{}),te=H,Y=te.ref,le=te.props,J=le.onKeyDown,Z=le.onChange,Q=le.onMouseDown,ge=le.onCompositionStart,ne=le.onCompositionEnd,de=le.style;return"maxLength"in H.props,H=C.exports.cloneElement(H,ve(ve(ve({type:"search"},le),{},{id:u,ref:ta(r,Y),disabled:f,tabIndex:p,autoComplete:y||"off",autoFocus:v,className:Ye("".concat(a,"-selection-search-input"),(n=H)===null||n===void 0||(i=n.props)===null||i===void 0?void 0:i.className),role:"combobox","aria-expanded":j,"aria-haspopup":"listbox","aria-owns":"".concat(u,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(u,"_list"),"aria-activedescendant":k},G),{},{value:w?T:"",maxLength:R,readOnly:!w,unselectable:w?null:"on",style:ve(ve({},de),{},{opacity:w?null:0}),onKeyDown:function(ye){A(ye),J&&J(ye)},onMouseDown:function(ye){I(ye),Q&&Q(ye)},onChange:function(ye){O(ye),Z&&Z(ye)},onCompositionStart:function(ye){L(ye),ge&&ge(ye)},onCompositionEnd:function(ye){B(ye),ne&&ne(ye)},onPaste:N})),H},ZS=C.exports.forwardRef(rG);ZS.displayName="Input";function NA(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}var nG=typeof window<"u"&&window.document&&window.document.documentElement,iG=nG;function oG(e){return e!=null}function wT(e){return["string","number"].includes(ar(e))}function zA(e){var t=void 0;return e&&(wT(e.title)?t=e.title.toString():wT(e.label)&&(t=e.label.toString())),t}function aG(e,t){iG?C.exports.useLayoutEffect(e,t):C.exports.useEffect(e,t)}function sG(e){var t;return(t=e.key)!==null&&t!==void 0?t:e.value}var CT=function(t){t.preventDefault(),t.stopPropagation()},lG=function(t){var r=t.id,n=t.prefixCls,i=t.values,a=t.open,u=t.searchValue,o=t.autoClearSearchValue,f=t.inputRef,p=t.placeholder,v=t.disabled,y=t.mode,w=t.showSearch,k=t.autoFocus,T=t.autoComplete,R=t.activeDescendantId,A=t.tabIndex,I=t.removeIcon,O=t.maxTagCount,N=t.maxTagTextLength,L=t.maxTagPlaceholder,B=L===void 0?function(Xe){return"+ ".concat(Xe.length," ...")}:L,j=t.tagRender,G=t.onToggleOpen,H=t.onRemove,te=t.onInputChange,Y=t.onInputPaste,le=t.onInputKeyDown,J=t.onInputMouseDown,Z=t.onInputCompositionStart,Q=t.onInputCompositionEnd,ge=C.exports.useRef(null),ne=C.exports.useState(0),de=Le(ne,2),oe=de[0],ye=de[1],Re=C.exports.useState(!1),Te=Le(Re,2),ke=Te[0],ze=Te[1],Ie="".concat(n,"-selection"),Ne=a||y==="multiple"&&o===!1||y==="tags"?u:"",De=y==="tags"||y==="multiple"&&o===!1||w&&(a||ke);aG(function(){ye(ge.current.scrollWidth)},[Ne]);function Ve(Xe,Pt,mt,It,Ct){return Qe("span",{className:Ye("".concat(Ie,"-item"),se({},"".concat(Ie,"-item-disabled"),mt)),title:zA(Xe),children:[E("span",{className:"".concat(Ie,"-item-content"),children:Pt}),It&&E(q0,{className:"".concat(Ie,"-item-remove"),onMouseDown:CT,onClick:Ct,customizeIcon:I,children:"\xD7"})]})}function Ge(Xe,Pt,mt,It,Ct){var Dt=function(dt){CT(dt),G(!a)};return E("span",{onMouseDown:Dt,children:j({label:Pt,value:Xe,disabled:mt,closable:It,onClose:Ct})})}function je(Xe){var Pt=Xe.disabled,mt=Xe.label,It=Xe.value,Ct=!v&&!Pt,Dt=mt;if(typeof N=="number"&&(typeof mt=="string"||typeof mt=="number")){var lt=String(Dt);lt.length>N&&(Dt="".concat(lt.slice(0,N),"..."))}var dt=function(it){it&&it.stopPropagation(),H(Xe)};return typeof j=="function"?Ge(It,Dt,Pt,Ct,dt):Ve(Xe,Dt,Pt,Ct,dt)}function ct(Xe){var Pt=typeof B=="function"?B(Xe):B;return Ve({title:Pt},Pt,!1)}var pt=Qe("div",{className:"".concat(Ie,"-search"),style:{width:oe},onFocus:function(){ze(!0)},onBlur:function(){ze(!1)},children:[E(ZS,{ref:f,open:a,prefixCls:n,id:r,inputElement:null,disabled:v,autoFocus:k,autoComplete:T,editable:De,activeDescendantId:R,value:Ne,onKeyDown:le,onMouseDown:J,onChange:te,onPaste:Y,onCompositionStart:Z,onCompositionEnd:Q,tabIndex:A,attrs:Ku(t,!0)}),Qe("span",{ref:ge,className:"".concat(Ie,"-search-mirror"),"aria-hidden":!0,children:[Ne,"\xA0"]})]}),Tt=E(Hs,{prefixCls:"".concat(Ie,"-overflow"),data:i,renderItem:je,renderRest:ct,suffix:pt,itemKey:sG,maxCount:O});return Qe(Fr,{children:[Tt,!i.length&&!Ne&&E("span",{className:"".concat(Ie,"-placeholder"),children:p})]})},uG=function(t){var r=t.inputElement,n=t.prefixCls,i=t.id,a=t.inputRef,u=t.disabled,o=t.autoFocus,f=t.autoComplete,p=t.activeDescendantId,v=t.mode,y=t.open,w=t.values,k=t.placeholder,T=t.tabIndex,R=t.showSearch,A=t.searchValue,I=t.activeValue,O=t.maxLength,N=t.onInputKeyDown,L=t.onInputMouseDown,B=t.onInputChange,j=t.onInputPaste,G=t.onInputCompositionStart,H=t.onInputCompositionEnd,te=C.exports.useState(!1),Y=Le(te,2),le=Y[0],J=Y[1],Z=v==="combobox",Q=Z||R,ge=w[0],ne=A||"";Z&&I&&!le&&(ne=I),C.exports.useEffect(function(){Z&&J(!1)},[Z,I]);var de=v!=="combobox"&&!y&&!R?!1:!!ne,oe=zA(ge),ye=function(){if(ge)return null;var Te=de?{visibility:"hidden"}:void 0;return E("span",{className:"".concat(n,"-selection-placeholder"),style:Te,children:k})};return Qe(Fr,{children:[E("span",{className:"".concat(n,"-selection-search"),children:E(ZS,{ref:a,prefixCls:n,id:i,open:y,inputElement:r,disabled:u,autoFocus:o,autoComplete:f,editable:Q,activeDescendantId:p,value:ne,onKeyDown:N,onMouseDown:L,onChange:function(Te){J(!0),B(Te)},onPaste:j,onCompositionStart:G,onCompositionEnd:H,tabIndex:T,attrs:Ku(t,!0),maxLength:Z?O:void 0})}),!Z&&ge&&!de&&E("span",{className:"".concat(n,"-selection-item"),title:oe,children:ge.label}),ye()]})};function cG(e){return![Et.ESC,Et.SHIFT,Et.BACKSPACE,Et.TAB,Et.WIN_KEY,Et.ALT,Et.META,Et.WIN_KEY_RIGHT,Et.CTRL,Et.SEMICOLON,Et.EQUALS,Et.CAPS_LOCK,Et.CONTEXT_MENU,Et.F1,Et.F2,Et.F3,Et.F4,Et.F5,Et.F6,Et.F7,Et.F8,Et.F9,Et.F10,Et.F11,Et.F12].includes(e)}var dG=function(t,r){var n=C.exports.useRef(null),i=C.exports.useRef(!1),a=t.prefixCls,u=t.open,o=t.mode,f=t.showSearch,p=t.tokenWithEnter,v=t.autoClearSearchValue,y=t.onSearch,w=t.onSearchSubmit,k=t.onToggleOpen,T=t.onInputKeyDown,R=t.domRef;C.exports.useImperativeHandle(r,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var A=IA(0),I=Le(A,2),O=I[0],N=I[1],L=function(de){var oe=de.which;(oe===Et.UP||oe===Et.DOWN)&&de.preventDefault(),T&&T(de),oe===Et.ENTER&&o==="tags"&&!i.current&&!u&&(w==null||w(de.target.value)),cG(oe)&&k(!0)},B=function(){N(!0)},j=C.exports.useRef(null),G=function(de){y(de,!0,i.current)!==!1&&k(!0)},H=function(){i.current=!0},te=function(de){i.current=!1,o!=="combobox"&&G(de.target.value)},Y=function(de){var oe=de.target.value;if(p&&j.current&&/[\r\n]/.test(j.current)){var ye=j.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");oe=oe.replace(ye,j.current)}j.current=null,G(oe)},le=function(de){var oe=de.clipboardData,ye=oe.getData("text");j.current=ye},J=function(de){var oe=de.target;if(oe!==n.current){var ye=document.body.style.msTouchAction!==void 0;ye?setTimeout(function(){n.current.focus()}):n.current.focus()}},Z=function(de){var oe=O();de.target!==n.current&&!oe&&o!=="combobox"&&de.preventDefault(),(o!=="combobox"&&(!f||!oe)||!u)&&(u&&v!==!1&&y("",!0,!1),k())},Q={inputRef:n,onInputKeyDown:L,onInputMouseDown:B,onInputChange:Y,onInputPaste:le,onInputCompositionStart:H,onInputCompositionEnd:te},ge=o==="multiple"||o==="tags"?E(lG,{...t,...Q}):E(uG,{...t,...Q});return E("div",{ref:R,className:"".concat(a,"-selector"),onClick:J,onMouseDown:Z,children:ge})},DA=C.exports.forwardRef(dG);DA.displayName="Selector";var fG=C.exports.forwardRef(function(e,t){var r=e.didUpdate,n=e.getContainer,i=e.children,a=C.exports.useRef(),u=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{}});var o=C.exports.useRef(!1);return!o.current&&Lo()&&(u.current=n(),a.current=u.current.parentNode,o.current=!0),C.exports.useEffect(function(){r==null||r(e)}),C.exports.useEffect(function(){return u.current.parentNode===null&&a.current!==null&&a.current.appendChild(u.current),function(){var f,p;(f=u.current)===null||f===void 0||(p=f.parentNode)===null||p===void 0||p.removeChild(u.current)}},[]),u.current?rd.createPortal(i,u.current):null});function hG(e,t,r){return r?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function pG(e,t,r){var n=e[t]||{};return ve(ve({},n),r)}function mG(e,t,r,n){for(var i=r.points,a=Object.keys(e),u=0;u=0&&r.left>=0&&r.bottom>r.top&&r.right>r.left?r:null}function $G(e,t,r,n){var i=Ur.clone(e),a={width:t.width,height:t.height};return n.adjustX&&i.left=r.left&&i.left+a.width>r.right&&(a.width-=i.left+a.width-r.right),n.adjustX&&i.left+a.width>r.right&&(i.left=Math.max(r.right-a.width,r.left)),n.adjustY&&i.top=r.top&&i.top+a.height>r.bottom&&(a.height-=i.top+a.height-r.bottom),n.adjustY&&i.top+a.height>r.bottom&&(i.top=Math.max(r.bottom-a.height,r.top)),Ur.mix(i,a)}function JS(e){var t,r,n;if(!Ur.isWindow(e)&&e.nodeType!==9)t=Ur.offset(e),r=Ur.outerWidth(e),n=Ur.outerHeight(e);else{var i=Ur.getWindow(e);t={left:Ur.getWindowScrollLeft(i),top:Ur.getWindowScrollTop(i)},r=Ur.viewportWidth(i),n=Ur.viewportHeight(i)}return t.width=r,t.height=n,t}function AT(e,t){var r=t.charAt(0),n=t.charAt(1),i=e.width,a=e.height,u=e.left,o=e.top;return r==="c"?o+=a/2:r==="b"&&(o+=a),n==="c"?u+=i/2:n==="r"&&(u+=i),{left:u,top:o}}function gy(e,t,r,n,i){var a=AT(t,r[1]),u=AT(e,r[0]),o=[u.left-a.left,u.top-a.top];return{left:Math.round(e.left-o[0]+n[0]-i[0]),top:Math.round(e.top-o[1]+n[1]-i[1])}}function NT(e,t,r){return e.leftr.right}function zT(e,t,r){return e.topr.bottom}function BG(e,t,r){return e.left>r.right||e.left+t.widthr.bottom||e.top+t.height=r.right||n.top>=r.bottom}function e3(e,t,r){var n=r.target||t,i=JS(n),a=!jG(n,r.overflow&&r.overflow.alwaysByViewport);return HA(e,i,r,a)}e3.__getOffsetParent=yC;e3.__getVisibleRectForElement=QS;function UG(e,t,r){var n,i,a=Ur.getDocument(e),u=a.defaultView||a.parentWindow,o=Ur.getWindowScrollLeft(u),f=Ur.getWindowScrollTop(u),p=Ur.viewportWidth(u),v=Ur.viewportHeight(u);"pageX"in t?n=t.pageX:n=o+t.clientX,"pageY"in t?i=t.pageY:i=f+t.clientY;var y={left:n,top:i,width:0,height:0},w=n>=0&&n<=o+p&&i>=0&&i<=f+v,k=[r.points[0],"cc"];return HA(e,y,ET(ET({},r),{},{points:k}),w)}function t3(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function i(a,u){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=n.has(a);if(Fn(!f,"Warning: There may be circular references"),f)return!1;if(a===u)return!0;if(r&&o>1)return!1;n.add(a);var p=o+1;if(Array.isArray(a)){if(!Array.isArray(u)||a.length!==u.length)return!1;for(var v=0;v1&&(Tt=E("div",{className:"".concat(n,"-content"),children:u})),E(Ga,{visible:r,ref:j,leavedClassName:"".concat(n,"-hidden"),...Ge,onAppearPrepare:je,onEnterPrepare:je,removeOnLeave:p,forceRender:v,children:function(Xe,Pt){var mt=Xe.className,It=Xe.style,Ct=Ye(n,i,te,mt);return E(WA,{target:Ne(),ref:B,monitorWindowResize:!0,disabled:pt,align:y,onAlign:Ve,children:E("div",{ref:Pt,className:Ct,onMouseEnter:A,onMouseLeave:I,onMouseDownCapture:O,onTouchStartCapture:N,onClick:L,style:ve(ve({},It),ct),children:Tt})},"popup")}})});qA.displayName="PopupInner";var GA=C.exports.forwardRef(function(e,t){var r=e.prefixCls,n=e.visible,i=e.zIndex,a=e.children,u=e.mobile;u=u===void 0?{}:u;var o=u.popupClassName,f=u.popupStyle,p=u.popupMotion,v=p===void 0?{}:p,y=u.popupRender,w=e.onClick,k=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{forceAlign:function(){},getElement:function(){return k.current}}});var T=ve({zIndex:i},f),R=a;return C.exports.Children.count(a)>1&&(R=E("div",{className:"".concat(r,"-content"),children:a})),y&&(R=y(R)),E(Ga,{visible:n,ref:k,removeOnLeave:!0,...v,children:function(A,I){var O=A.className,N=A.style,L=Ye(r,o,O);return E("div",{ref:I,className:L,onClick:w,style:ve(ve({},N),T),children:R})}})});GA.displayName="MobilePopupInner";var XG=["visible","mobile"],ZA=C.exports.forwardRef(function(e,t){var r=e.visible,n=e.mobile,i=Pr(e,XG),a=C.exports.useState(r),u=Le(a,2),o=u[0],f=u[1],p=C.exports.useState(!1),v=Le(p,2),y=v[0],w=v[1],k=ve(ve({},i),{},{visible:o});C.exports.useEffect(function(){f(r),r&&n&&w(TA())},[r,n]);var T=y?E(GA,{...k,mobile:n,ref:t}):E(qA,{...k,ref:t});return Qe("div",{children:[E(vG,{...k}),T]})});ZA.displayName="Popup";var jT=C.exports.createContext(null);function Zb(){}function YG(){return""}function QG(e){return e?e.ownerDocument:window.document}var JG=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function eZ(e){var t=function(r){vi(i,r);var n=gi(i);function i(a){var u;Yn(this,i),u=n.call(this,a),se(Or(u),"popupRef",C.exports.createRef()),se(Or(u),"triggerRef",C.exports.createRef()),se(Or(u),"portalContainer",void 0),se(Or(u),"attachId",void 0),se(Or(u),"clickOutsideHandler",void 0),se(Or(u),"touchOutsideHandler",void 0),se(Or(u),"contextMenuOutsideHandler1",void 0),se(Or(u),"contextMenuOutsideHandler2",void 0),se(Or(u),"mouseDownTimeout",void 0),se(Or(u),"focusTime",void 0),se(Or(u),"preClickTime",void 0),se(Or(u),"preTouchTime",void 0),se(Or(u),"delayTimer",void 0),se(Or(u),"hasPopupMouseDown",void 0),se(Or(u),"onMouseEnter",function(f){var p=u.props.mouseEnterDelay;u.fireEvents("onMouseEnter",f),u.delaySetPopupVisible(!0,p,p?null:f)}),se(Or(u),"onMouseMove",function(f){u.fireEvents("onMouseMove",f),u.setPoint(f)}),se(Or(u),"onMouseLeave",function(f){u.fireEvents("onMouseLeave",f),u.delaySetPopupVisible(!1,u.props.mouseLeaveDelay)}),se(Or(u),"onPopupMouseEnter",function(){u.clearDelayTimer()}),se(Or(u),"onPopupMouseLeave",function(f){var p;f.relatedTarget&&!f.relatedTarget.setTimeout&&Xc((p=u.popupRef.current)===null||p===void 0?void 0:p.getElement(),f.relatedTarget)||u.delaySetPopupVisible(!1,u.props.mouseLeaveDelay)}),se(Or(u),"onFocus",function(f){u.fireEvents("onFocus",f),u.clearDelayTimer(),u.isFocusToShow()&&(u.focusTime=Date.now(),u.delaySetPopupVisible(!0,u.props.focusDelay))}),se(Or(u),"onMouseDown",function(f){u.fireEvents("onMouseDown",f),u.preClickTime=Date.now()}),se(Or(u),"onTouchStart",function(f){u.fireEvents("onTouchStart",f),u.preTouchTime=Date.now()}),se(Or(u),"onBlur",function(f){u.fireEvents("onBlur",f),u.clearDelayTimer(),u.isBlurToHide()&&u.delaySetPopupVisible(!1,u.props.blurDelay)}),se(Or(u),"onContextMenu",function(f){f.preventDefault(),u.fireEvents("onContextMenu",f),u.setPopupVisible(!0,f)}),se(Or(u),"onContextMenuClose",function(){u.isContextMenuToShow()&&u.close()}),se(Or(u),"onClick",function(f){if(u.fireEvents("onClick",f),u.focusTime){var p;if(u.preClickTime&&u.preTouchTime?p=Math.min(u.preClickTime,u.preTouchTime):u.preClickTime?p=u.preClickTime:u.preTouchTime&&(p=u.preTouchTime),Math.abs(p-u.focusTime)<20)return;u.focusTime=0}u.preClickTime=0,u.preTouchTime=0,u.isClickToShow()&&(u.isClickToHide()||u.isBlurToHide())&&f&&f.preventDefault&&f.preventDefault();var v=!u.state.popupVisible;(u.isClickToHide()&&!v||v&&u.isClickToShow())&&u.setPopupVisible(!u.state.popupVisible,f)}),se(Or(u),"onPopupMouseDown",function(){if(u.hasPopupMouseDown=!0,clearTimeout(u.mouseDownTimeout),u.mouseDownTimeout=window.setTimeout(function(){u.hasPopupMouseDown=!1},0),u.context){var f;(f=u.context).onPopupMouseDown.apply(f,arguments)}}),se(Or(u),"onDocumentClick",function(f){if(!(u.props.mask&&!u.props.maskClosable)){var p=f.target,v=u.getRootDomNode(),y=u.getPopupDomNode();(!Xc(v,p)||u.isContextMenuOnly())&&!Xc(y,p)&&!u.hasPopupMouseDown&&u.close()}}),se(Or(u),"getRootDomNode",function(){var f=u.props.getTriggerDOMNode;if(f)return f(u.triggerRef.current);try{var p=Lm(u.triggerRef.current);if(p)return p}catch{}return rd.findDOMNode(Or(u))}),se(Or(u),"getPopupClassNameFromAlign",function(f){var p=[],v=u.props,y=v.popupPlacement,w=v.builtinPlacements,k=v.prefixCls,T=v.alignPoint,R=v.getPopupClassNameFromAlign;return y&&w&&p.push(mG(w,k,f,T)),R&&p.push(R(f)),p.join(" ")}),se(Or(u),"getComponent",function(){var f=u.props,p=f.prefixCls,v=f.destroyPopupOnHide,y=f.popupClassName,w=f.onPopupAlign,k=f.popupMotion,T=f.popupAnimation,R=f.popupTransitionName,A=f.popupStyle,I=f.mask,O=f.maskAnimation,N=f.maskTransitionName,L=f.maskMotion,B=f.zIndex,j=f.popup,G=f.stretch,H=f.alignPoint,te=f.mobile,Y=f.forceRender,le=f.onPopupClick,J=u.state,Z=J.popupVisible,Q=J.point,ge=u.getPopupAlign(),ne={};return u.isMouseEnterToShow()&&(ne.onMouseEnter=u.onPopupMouseEnter),u.isMouseLeaveToHide()&&(ne.onMouseLeave=u.onPopupMouseLeave),ne.onMouseDown=u.onPopupMouseDown,ne.onTouchStart=u.onPopupMouseDown,E(ZA,{prefixCls:p,destroyPopupOnHide:v,visible:Z,point:H&&Q,className:y,align:ge,onAlign:w,animation:T,getClassNameFromAlign:u.getPopupClassNameFromAlign,...ne,stretch:G,getRootDomNode:u.getRootDomNode,style:A,mask:I,zIndex:B,transitionName:R,maskAnimation:O,maskTransitionName:N,maskMotion:L,ref:u.popupRef,motion:k,mobile:te,forceRender:Y,onClick:le,children:typeof j=="function"?j():j})}),se(Or(u),"attachParent",function(f){tn.cancel(u.attachId);var p=u.props,v=p.getPopupContainer,y=p.getDocument,w=u.getRootDomNode(),k;v?(w||v.length===0)&&(k=v(w)):k=y(u.getRootDomNode()).body,k?k.appendChild(f):u.attachId=tn(function(){u.attachParent(f)})}),se(Or(u),"getContainer",function(){if(!u.portalContainer){var f=u.props.getDocument,p=f(u.getRootDomNode()).createElement("div");p.style.position="absolute",p.style.top="0",p.style.left="0",p.style.width="100%",u.portalContainer=p}return u.attachParent(u.portalContainer),u.portalContainer}),se(Or(u),"setPoint",function(f){var p=u.props.alignPoint;!p||!f||u.setState({point:{pageX:f.pageX,pageY:f.pageY}})}),se(Or(u),"handlePortalUpdate",function(){u.state.prevPopupVisible!==u.state.popupVisible&&u.props.afterPopupVisibleChange(u.state.popupVisible)}),se(Or(u),"triggerContextValue",{onPopupMouseDown:u.onPopupMouseDown});var o;return"popupVisible"in a?o=!!a.popupVisible:o=!!a.defaultPopupVisible,u.state={prevPopupVisible:o,popupVisible:o},JG.forEach(function(f){u["fire".concat(f)]=function(p){u.fireEvents(f,p)}}),u}return Qn(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var u=this.props,o=this.state;if(o.popupVisible){var f;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(f=u.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Sl(f,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(f=f||u.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Sl(f,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(f=f||u.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Sl(f,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Sl(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),tn.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var u;return((u=this.popupRef.current)===null||u===void 0?void 0:u.getElement())||null}},{key:"getPopupAlign",value:function(){var u=this.props,o=u.popupPlacement,f=u.popupAlign,p=u.builtinPlacements;return o&&p?pG(p,o,f):f}},{key:"setPopupVisible",value:function(u,o){var f=this.props.alignPoint,p=this.state.popupVisible;this.clearDelayTimer(),p!==u&&("popupVisible"in this.props||this.setState({popupVisible:u,prevPopupVisible:p}),this.props.onPopupVisibleChange(u)),f&&o&&u&&this.setPoint(o)}},{key:"delaySetPopupVisible",value:function(u,o,f){var p=this,v=o*1e3;if(this.clearDelayTimer(),v){var y=f?{pageX:f.pageX,pageY:f.pageY}:null;this.delayTimer=window.setTimeout(function(){p.setPopupVisible(u,y),p.clearDelayTimer()},v)}else this.setPopupVisible(u,f)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(u){var o=this.props.children.props,f=this.props;return o[u]&&f[u]?this["fire".concat(u)]:o[u]||f[u]}},{key:"isClickToShow",value:function(){var u=this.props,o=u.action,f=u.showAction;return o.indexOf("click")!==-1||f.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var u=this.props.action;return u==="contextMenu"||u.length===1&&u[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var u=this.props,o=u.action,f=u.showAction;return o.indexOf("contextMenu")!==-1||f.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var u=this.props,o=u.action,f=u.hideAction;return o.indexOf("click")!==-1||f.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var u=this.props,o=u.action,f=u.showAction;return o.indexOf("hover")!==-1||f.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var u=this.props,o=u.action,f=u.hideAction;return o.indexOf("hover")!==-1||f.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var u=this.props,o=u.action,f=u.showAction;return o.indexOf("focus")!==-1||f.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var u=this.props,o=u.action,f=u.hideAction;return o.indexOf("focus")!==-1||f.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var u;(u=this.popupRef.current)===null||u===void 0||u.forceAlign()}}},{key:"fireEvents",value:function(u,o){var f=this.props.children.props[u];f&&f(o);var p=this.props[u];p&&p(o)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var u=this.state.popupVisible,o=this.props,f=o.children,p=o.forceRender,v=o.alignPoint,y=o.className,w=o.autoDestroy,k=C.exports.Children.only(f),T={key:"trigger"};this.isContextMenuToShow()?T.onContextMenu=this.onContextMenu:T.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(T.onClick=this.onClick,T.onMouseDown=this.onMouseDown,T.onTouchStart=this.onTouchStart):(T.onClick=this.createTwoChains("onClick"),T.onMouseDown=this.createTwoChains("onMouseDown"),T.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(T.onMouseEnter=this.onMouseEnter,v&&(T.onMouseMove=this.onMouseMove)):T.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?T.onMouseLeave=this.onMouseLeave:T.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(T.onFocus=this.onFocus,T.onBlur=this.onBlur):(T.onFocus=this.createTwoChains("onFocus"),T.onBlur=this.createTwoChains("onBlur"));var R=Ye(k&&k.props&&k.props.className,y);R&&(T.className=R);var A=ve({},T);fd(k)&&(A.ref=ta(this.triggerRef,k.ref));var I=C.exports.cloneElement(k,A),O;return(u||this.popupRef.current||p)&&(O=E(e,{getContainer:this.getContainer,didUpdate:this.handlePortalUpdate,children:this.getComponent()},"portal")),!u&&w&&(O=null),Qe(jT.Provider,{value:this.triggerContextValue,children:[I,O]})}}],[{key:"getDerivedStateFromProps",value:function(u,o){var f=u.popupVisible,p={};return f!==void 0&&o.popupVisible!==f&&(p.popupVisible=f,p.prevPopupVisible=o.popupVisible),p}}]),i}(C.exports.Component);return se(t,"contextType",jT),se(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:YG,getDocument:QG,onPopupVisibleChange:Zb,afterPopupVisibleChange:Zb,onPopupAlign:Zb,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),t}const dx=eZ(fG);var tZ=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],rZ=function(t){var r=t===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:r,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:r,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:r,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:r,adjustY:1}}}},nZ=function(t,r){var n=t.prefixCls;t.disabled;var i=t.visible,a=t.children,u=t.popupElement,o=t.containerWidth,f=t.animation,p=t.transitionName,v=t.dropdownStyle,y=t.dropdownClassName,w=t.direction,k=w===void 0?"ltr":w,T=t.placement,R=t.dropdownMatchSelectWidth,A=t.dropdownRender,I=t.dropdownAlign,O=t.getPopupContainer,N=t.empty,L=t.getTriggerDOMNode,B=t.onPopupVisibleChange,j=t.onPopupMouseEnter,G=Pr(t,tZ),H="".concat(n,"-dropdown"),te=u;A&&(te=A(u));var Y=C.exports.useMemo(function(){return rZ(R)},[R]),le=f?"".concat(H,"-").concat(f):p,J=C.exports.useRef(null);C.exports.useImperativeHandle(r,function(){return{getPopupElement:function(){return J.current}}});var Z=ve({minWidth:o},v);return typeof R=="number"?Z.width=R:R&&(Z.width=o),E(dx,{...G,showAction:B?["click"]:[],hideAction:B?["click"]:[],popupPlacement:T||(k==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Y,prefixCls:H,popupTransitionName:le,popup:E("div",{ref:J,onMouseEnter:j,children:te}),popupAlign:I,popupVisible:i,getPopupContainer:O,popupClassName:Ye(y,se({},"".concat(H,"-empty"),N)),popupStyle:Z,getTriggerDOMNode:L,onPopupVisibleChange:B,children:a})},XA=C.exports.forwardRef(nZ);XA.displayName="SelectTrigger";function UT(e,t){var r=e.key,n;return"value"in e&&(n=e.value),r!=null?r:n!==void 0?n:"rc-index-key-".concat(t)}function YA(e,t){var r=e||{},n=r.label,i=r.value,a=r.options;return{label:n||(t?"children":"label"),value:i||"value",options:a||"options"}}function iZ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.fieldNames,n=t.childrenAsData,i=[],a=YA(r,!1),u=a.label,o=a.value,f=a.options;function p(v,y){v.forEach(function(w){var k=w[u];if(y||!(f in w)){var T=w[o];i.push({key:UT(w,i.length),groupOption:y,data:w,label:k,value:T})}else{var R=k;R===void 0&&n&&(R=w.label),i.push({key:UT(w,i.length),group:!0,data:w,label:R}),p(w[f],!0)}})}return p(e,!1),i}function xC(e){var t=ve({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Fn(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}function oZ(e,t){if(!t||!t.length)return null;var r=!1;function n(a,u){var o=NS(u),f=o[0],p=o.slice(1);if(!f)return[a];var v=a.split(f);return r=r||v.length>1,v.reduce(function(y,w){return[].concat(wt(y),wt(n(w,p)))},[]).filter(function(y){return y})}var i=n(e,t);return r?i:null}var aZ=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],sZ=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function _C(e){return e==="tags"||e==="multiple"}var QA=C.exports.forwardRef(function(e,t){var r,n,i=e.id,a=e.prefixCls,u=e.className,o=e.showSearch,f=e.tagRender,p=e.direction,v=e.omitDomProps,y=e.displayValues,w=e.onDisplayValuesChange,k=e.emptyOptions,T=e.notFoundContent,R=T===void 0?"Not Found":T,A=e.onClear,I=e.mode,O=e.disabled,N=e.loading,L=e.getInputElement,B=e.getRawInputElement,j=e.open,G=e.defaultOpen,H=e.onDropdownVisibleChange,te=e.activeValue,Y=e.onActiveValueChange,le=e.activeDescendantId,J=e.searchValue,Z=e.autoClearSearchValue,Q=e.onSearch,ge=e.onSearchSplit,ne=e.tokenSeparators,de=e.allowClear,oe=e.showArrow,ye=e.inputIcon,Re=e.clearIcon,Te=e.OptionList,ke=e.animation,ze=e.transitionName,Ie=e.dropdownStyle,Ne=e.dropdownClassName,De=e.dropdownMatchSelectWidth,Ve=e.dropdownRender,Ge=e.dropdownAlign,je=e.placement,ct=e.getPopupContainer,pt=e.showAction,Tt=pt===void 0?[]:pt,Xe=e.onFocus,Pt=e.onBlur,mt=e.onKeyUp,It=e.onKeyDown,Ct=e.onMouseDown,Dt=Pr(e,aZ),lt=_C(I),dt=(o!==void 0?o:lt)||I==="combobox",ut=ve({},Dt);sZ.forEach(function(Tr){delete ut[Tr]}),v==null||v.forEach(function(Tr){delete ut[Tr]});var it=C.exports.useState(!1),ft=Le(it,2),xt=ft[0],Wt=ft[1];C.exports.useEffect(function(){Wt(TA())},[]);var jt=C.exports.useRef(null),Qt=C.exports.useRef(null),Fe=C.exports.useRef(null),qe=C.exports.useRef(null),Xt=C.exports.useRef(null),cr=$q(),Vt=Le(cr,3),Ut=Vt[0],rr=Vt[1],xr=Vt[2];C.exports.useImperativeHandle(t,function(){var Tr,Cr;return{focus:(Tr=qe.current)===null||Tr===void 0?void 0:Tr.focus,blur:(Cr=qe.current)===null||Cr===void 0?void 0:Cr.blur,scrollTo:function(Jn){var gn;return(gn=Xt.current)===null||gn===void 0?void 0:gn.scrollTo(Jn)}}});var Rr=C.exports.useMemo(function(){var Tr;if(I!=="combobox")return J;var Cr=(Tr=y[0])===null||Tr===void 0?void 0:Tr.value;return typeof Cr=="string"||typeof Cr=="number"?String(Cr):""},[J,I,y]),_t=I==="combobox"&&typeof L=="function"&&L()||null,qt=typeof B=="function"&&B(),or=H7(Qt,qt==null||(r=qt.props)===null||r===void 0?void 0:r.ref),Lr=Yi(void 0,{defaultValue:G,value:j}),Er=Le(Lr,2),Lt=Er[0],kr=Er[1],wr=Lt,fr=!R&&k;(O||fr&&wr&&I==="combobox")&&(wr=!1);var Nt=fr?!1:wr,ot=C.exports.useCallback(function(Tr){var Cr=Tr!==void 0?Tr:!wr;O||(kr(Cr),wr!==Cr&&(H==null||H(Cr)))},[O,wr,kr,H]),ht=C.exports.useMemo(function(){return(ne||[]).some(function(Tr){return[` `,`\r `].includes(Tr)})},[ne]),Ot=function(Cr,Ir,Jn){var gn=!0,jr=Cr;Y==null||Y(null);var zr=Jn?null:oZ(Cr,ne);return I!=="combobox"&&zr&&(jr="",ge==null||ge(zr),ot(!1),gn=!1),Q&&Rr!==jr&&Q(jr,{source:Ir?"typing":"effect"}),gn},$t=function(Cr){!Cr||!Cr.trim()||Q(Cr,{source:"submit"})};C.exports.useEffect(function(){!wr&&!lt&&I!=="combobox"&&Ot("",!1,!1)},[wr]),C.exports.useEffect(function(){Lt&&O&&kr(!1),O&&rr(!1)},[O]);var ur=IA(),Mr=Le(ur,2),Wr=Mr[0],qr=Mr[1],me=function(Cr){var Ir=Wr(),Jn=Cr.which;if(Jn===Et.ENTER&&(I!=="combobox"&&Cr.preventDefault(),wr||ot(!0)),qr(!!Rr),Jn===Et.BACKSPACE&&!Ir&<&&!Rr&&y.length){for(var gn=wt(y),jr=null,zr=gn.length-1;zr>=0;zr-=1){var Xr=gn[zr];if(!Xr.disabled){gn.splice(zr,1),jr=Xr;break}}jr&&w(gn,{type:"remove",values:[jr]})}for(var bn=arguments.length,Cn=new Array(bn>1?bn-1:0),Bn=1;Bn1?Ir-1:0),gn=1;gn1?zr-1:0),bn=1;bn1&&arguments[1]!==void 0?arguments[1]:!1;return lo(e).map(function(r,n){if(!C.exports.isValidElement(r)||!r.type)return null;var i=r,a=i.type.isSelectOptGroup,u=i.key,o=i.props,f=o.children,p=Pr(o,hZ);return t||!a?pZ(r):ve(ve({key:"__RC_SELECT_GRP__".concat(u===null?n:u,"__"),label:u},p),{},{options:eN(f)})}).filter(function(r){return r})}function mZ(e,t,r,n,i){return C.exports.useMemo(function(){var a=e,u=!e;u&&(a=eN(t));var o=new Map,f=new Map,p=function(w,k,T){T&&typeof T=="string"&&w.set(k[T],k)};function v(y){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,k=0;kf},n}return Qn(r,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(i){i.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var i=this.state,a=i.dragging,u=i.visible,o=this.props.prefixCls,f=this.getSpinHeight(),p=this.getTop(),v=this.showScroll(),y=v&&u;return E("div",{ref:this.scrollbarRef,className:Ye("".concat(o,"-scrollbar"),se({},"".concat(o,"-scrollbar-show"),v)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:y?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden,children:E("div",{ref:this.thumbRef,className:Ye("".concat(o,"-scrollbar-thumb"),se({},"".concat(o,"-scrollbar-thumb-moving"),a)),style:{width:"100%",height:f,top:p,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown})})}}]),r}(C.exports.Component);function yZ(e){var t=e.children,r=e.setRef,n=C.exports.useCallback(function(i){r(i)},[]);return C.exports.cloneElement(t,{ref:n})}function xZ(e,t,r,n,i,a){var u=a.getKey;return e.slice(t,r+1).map(function(o,f){var p=t+f,v=i(o,p,{}),y=u(o);return E(yZ,{setRef:function(k){return n(o,k)},children:v},y)})}var _Z=function(){function e(){Yn(this,e),this.maps=void 0,this.maps=Object.create(null)}return Qn(e,[{key:"set",value:function(r,n){this.maps[r]=n}},{key:"get",value:function(r){return this.maps[r]}}]),e}();function bZ(e,t,r){var n=C.exports.useState(0),i=Le(n,2),a=i[0],u=i[1],o=C.exports.useRef(new Map),f=C.exports.useRef(new _Z),p=C.exports.useRef();function v(){tn.cancel(p.current)}function y(){v(),p.current=tn(function(){o.current.forEach(function(k,T){if(k&&k.offsetParent){var R=Lm(k),A=R.offsetHeight;f.current.get(T)!==A&&f.current.set(T,R.offsetHeight)}}),u(function(k){return k+1})})}function w(k,T){var R=e(k),A=o.current.get(R);T?(o.current.set(R,T),y()):o.current.delete(R),!A!=!T&&(T?t==null||t(k):r==null||r(k))}return C.exports.useEffect(function(){return v},[]),[w,y,f.current,a]}function wZ(e,t,r,n,i,a,u,o){var f=C.exports.useRef();return function(p){if(p==null){o();return}if(tn.cancel(f.current),typeof p=="number")u(p);else if(p&&ar(p)==="object"){var v,y=p.align;"index"in p?v=p.index:v=t.findIndex(function(R){return i(R)===p.key});var w=p.offset,k=w===void 0?0:w,T=function R(A,I){if(!(A<0||!e.current)){var O=e.current.clientHeight,N=!1,L=I;if(O){for(var B=I||y,j=0,G=0,H=0,te=Math.min(t.length,v),Y=0;Y<=te;Y+=1){var le=i(t[Y]);G=j;var J=r.get(le);H=G+(J===void 0?n:J),j=H,Y===v&&J===void 0&&(N=!0)}var Z=null;switch(B){case"top":Z=G-k;break;case"bottom":Z=H-O+k;break;default:{var Q=e.current.scrollTop,ge=Q+O;Gge&&(L="bottom")}}Z!==null&&Z!==e.current.scrollTop&&u(Z)}f.current=tn(function(){N&&a(),R(A-1,L)},2)}};T(3)}}}function CZ(e,t,r){var n=e.length,i=t.length,a,u;if(n===0&&i===0)return null;n"u"?"undefined":ar(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const rN=function(e,t){var r=C.exports.useRef(!1),n=C.exports.useRef(null);function i(){clearTimeout(n.current),r.current=!0,n.current=setTimeout(function(){r.current=!1},50)}var a=C.exports.useRef({top:e,bottom:t});return a.current.top=e,a.current.bottom=t,function(u){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=u<0&&a.current.top||u>0&&a.current.bottom;return o&&f?(clearTimeout(n.current),r.current=!1):(!f||r.current)&&i(),!r.current&&f}};function kZ(e,t,r,n){var i=C.exports.useRef(0),a=C.exports.useRef(null),u=C.exports.useRef(null),o=C.exports.useRef(!1),f=rN(t,r);function p(y){if(!!e){tn.cancel(a.current);var w=y.deltaY;i.current+=w,u.current=w,!f(w)&&(EZ||y.preventDefault(),a.current=tn(function(){var k=o.current?10:1;n(i.current*k),i.current=0}))}}function v(y){!e||(o.current=y.detail===u.current)}return[p,v]}var TZ=14/15;function PZ(e,t,r){var n=C.exports.useRef(!1),i=C.exports.useRef(0),a=C.exports.useRef(null),u=C.exports.useRef(null),o,f=function(w){if(n.current){var k=Math.ceil(w.touches[0].pageY),T=i.current-k;i.current=k,r(T)&&w.preventDefault(),clearInterval(u.current),u.current=setInterval(function(){T*=TZ,(!r(T,!0)||Math.abs(T)<=.1)&&clearInterval(u.current)},16)}},p=function(){n.current=!1,o()},v=function(w){o(),w.touches.length===1&&!n.current&&(n.current=!0,i.current=Math.ceil(w.touches[0].pageY),a.current=w.target,a.current.addEventListener("touchmove",f),a.current.addEventListener("touchend",p))};o=function(){a.current&&(a.current.removeEventListener("touchmove",f),a.current.removeEventListener("touchend",p))},mi(function(){return e&&t.current.addEventListener("touchstart",v),function(){var y;(y=t.current)===null||y===void 0||y.removeEventListener("touchstart",v),o(),clearInterval(u.current)}},[e])}var MZ=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],IZ=[],RZ={overflowY:"auto",overflowAnchor:"none"};function OZ(e,t){var r=e.prefixCls,n=r===void 0?"rc-virtual-list":r,i=e.className,a=e.height,u=e.itemHeight,o=e.fullHeight,f=o===void 0?!0:o,p=e.style,v=e.data,y=e.children,w=e.itemKey,k=e.virtual,T=e.component,R=T===void 0?"div":T,A=e.onScroll,I=e.onVisibleChange,O=e.innerProps,N=Pr(e,MZ),L=!!(k!==!1&&a&&u),B=L&&v&&u*v.length>a,j=C.exports.useState(0),G=Le(j,2),H=G[0],te=G[1],Y=C.exports.useState(!1),le=Le(Y,2),J=le[0],Z=le[1],Q=Ye(n,i),ge=v||IZ,ne=C.exports.useRef(),de=C.exports.useRef(),oe=C.exports.useRef(),ye=C.exports.useCallback(function(Ut){return typeof w=="function"?w(Ut):Ut==null?void 0:Ut[w]},[w]),Re={getKey:ye};function Te(Ut){te(function(rr){var xr;typeof Ut=="function"?xr=Ut(rr):xr=Ut;var Rr=dt(xr);return ne.current.scrollTop=Rr,Rr})}var ke=C.exports.useRef({start:0,end:ge.length}),ze=C.exports.useRef(),Ie=SZ(ge,ye),Ne=Le(Ie,1),De=Ne[0];ze.current=De;var Ve=bZ(ye,null,null),Ge=Le(Ve,4),je=Ge[0],ct=Ge[1],pt=Ge[2],Tt=Ge[3],Xe=C.exports.useMemo(function(){if(!L)return{scrollHeight:void 0,start:0,end:ge.length-1,offset:void 0};if(!B){var Ut;return{scrollHeight:((Ut=de.current)===null||Ut===void 0?void 0:Ut.offsetHeight)||0,start:0,end:ge.length-1,offset:void 0}}for(var rr=0,xr,Rr,_t,qt=ge.length,or=0;or=H&&xr===void 0&&(xr=or,Rr=rr),kr>H+a&&_t===void 0&&(_t=or),rr=kr}return xr===void 0&&(xr=0,Rr=0,_t=Math.ceil(a/u)),_t===void 0&&(_t=ge.length-1),_t=Math.min(_t+1,ge.length),{scrollHeight:rr,start:xr,end:_t,offset:Rr}},[B,L,H,ge,Tt,a]),Pt=Xe.scrollHeight,mt=Xe.start,It=Xe.end,Ct=Xe.offset;ke.current.start=mt,ke.current.end=It;var Dt=Pt-a,lt=C.exports.useRef(Dt);lt.current=Dt;function dt(Ut){var rr=Ut;return Number.isNaN(lt.current)||(rr=Math.min(rr,lt.current)),rr=Math.max(rr,0),rr}var ut=H<=0,it=H>=Dt,ft=rN(ut,it);function xt(Ut){var rr=Ut;Te(rr)}function Wt(Ut){var rr=Ut.currentTarget.scrollTop;rr!==H&&Te(rr),A==null||A(Ut)}var jt=kZ(L,ut,it,function(Ut){Te(function(rr){var xr=rr+Ut;return xr})}),Qt=Le(jt,2),Fe=Qt[0],qe=Qt[1];PZ(L,ne,function(Ut,rr){return ft(Ut,rr)?!1:(Fe({preventDefault:function(){},deltaY:Ut}),!0)}),mi(function(){function Ut(rr){L&&rr.preventDefault()}return ne.current.addEventListener("wheel",Fe),ne.current.addEventListener("DOMMouseScroll",qe),ne.current.addEventListener("MozMousePixelScroll",Ut),function(){ne.current&&(ne.current.removeEventListener("wheel",Fe),ne.current.removeEventListener("DOMMouseScroll",qe),ne.current.removeEventListener("MozMousePixelScroll",Ut))}},[L]);var Xt=wZ(ne,ge,pt,u,ye,ct,Te,function(){var Ut;(Ut=oe.current)===null||Ut===void 0||Ut.delayHidden()});C.exports.useImperativeHandle(t,function(){return{scrollTo:Xt}}),mi(function(){if(I){var Ut=ge.slice(mt,It+1);I(Ut,ge)}},[mt,It,ge]);var cr=xZ(ge,mt,It,je,y,Re),Vt=null;return a&&(Vt=ve(se({},f?"height":"maxHeight",a),RZ),L&&(Vt.overflowY="hidden",J&&(Vt.pointerEvents="none"))),Qe("div",{style:ve(ve({},p),{},{position:"relative"}),className:Q,...N,children:[E(R,{className:"".concat(n,"-holder"),style:Vt,ref:ne,onScroll:Wt,children:E(tN,{prefixCls:n,height:Pt,offset:Ct,onInnerResize:ct,ref:de,innerProps:O,children:cr})}),L&&E(gZ,{ref:oe,prefixCls:n,scrollTop:H,height:a,scrollHeight:Pt,count:ge.length,onScroll:xt,onStartMove:function(){Z(!0)},onStopMove:function(){Z(!1)}})]})}var o3=C.exports.forwardRef(OZ);o3.displayName="List";function AZ(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var nN=C.exports.createContext(null),NZ=["disabled","title","children","style","className"];function qT(e){return typeof e=="string"||typeof e=="number"}var zZ=function(t,r){var n=MA(),i=n.prefixCls,a=n.id,u=n.open,o=n.multiple,f=n.mode,p=n.searchValue,v=n.toggleOpen,y=n.notFoundContent,w=n.onPopupScroll,k=C.exports.useContext(nN),T=k.flattenOptions,R=k.onActiveValue,A=k.defaultActiveFirstOption,I=k.onSelect,O=k.menuItemSelectedIcon,N=k.rawValues,L=k.fieldNames,B=k.virtual,j=k.listHeight,G=k.listItemHeight,H="".concat(i,"-item"),te=sv(function(){return T},[u,T],function(Ie,Ne){return Ne[0]&&Ie[1]!==Ne[1]}),Y=C.exports.useRef(null),le=function(Ne){Ne.preventDefault()},J=function(Ne){Y.current&&Y.current.scrollTo(typeof Ne=="number"?{index:Ne}:Ne)},Z=function(Ne){for(var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ve=te.length,Ge=0;Ge1&&arguments[1]!==void 0?arguments[1]:!1;de(Ne);var Ve={source:De?"keyboard":"mouse"},Ge=te[Ne];if(!Ge){R(null,-1,Ve);return}R(Ge.value,Ne,Ve)};C.exports.useEffect(function(){oe(A!==!1?Z(0):-1)},[te.length,p]);var ye=C.exports.useCallback(function(Ie){return N.has(Ie)&&f!=="combobox"},[f,wt(N).toString(),N.size]);C.exports.useEffect(function(){var Ie=setTimeout(function(){if(!o&&u&&N.size===1){var De=Array.from(N)[0],Ve=te.findIndex(function(Ge){var je=Ge.data;return je.value===De});Ve!==-1&&(oe(Ve),J(Ve))}});if(u){var Ne;(Ne=Y.current)===null||Ne===void 0||Ne.scrollTo(void 0)}return function(){return clearTimeout(Ie)}},[u,p]);var Re=function(Ne){Ne!==void 0&&I(Ne,{selected:!N.has(Ne)}),o||v(!1)};if(C.exports.useImperativeHandle(r,function(){return{onKeyDown:function(Ne){var De=Ne.which,Ve=Ne.ctrlKey;switch(De){case Et.N:case Et.P:case Et.UP:case Et.DOWN:{var Ge=0;if(De===Et.UP?Ge=-1:De===Et.DOWN?Ge=1:AZ()&&Ve&&(De===Et.N?Ge=1:De===Et.P&&(Ge=-1)),Ge!==0){var je=Z(ne+Ge,Ge);J(je),oe(je,!0)}break}case Et.ENTER:{var ct=te[ne];ct&&!ct.data.disabled?Re(ct.value):Re(void 0),u&&Ne.preventDefault();break}case Et.ESC:v(!1),u&&Ne.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Ne){J(Ne)}}}),te.length===0)return E("div",{role:"listbox",id:"".concat(a,"_list"),className:"".concat(H,"-empty"),onMouseDown:le,children:y});var Te=Object.keys(L).map(function(Ie){return L[Ie]}),ke=function(Ne){return Ne.label},ze=function(Ne){var De=te[Ne];if(!De)return null;var Ve=De.data||{},Ge=Ve.value,je=De.group,ct=Ku(Ve,!0),pt=ke(De);return De?C.exports.createElement("div",{"aria-label":typeof pt=="string"&&!je?pt:null,...ct,key:Ne,role:je?"presentation":"option",id:"".concat(a,"_list_").concat(Ne),"aria-selected":ye(Ge)},Ge):null};return Qe(Fr,{children:[Qe("div",{role:"listbox",id:"".concat(a,"_list"),style:{height:0,width:0,overflow:"hidden"},children:[ze(ne-1),ze(ne),ze(ne+1)]}),E(o3,{itemKey:"key",ref:Y,data:te,height:j,itemHeight:G,fullHeight:!1,onMouseDown:le,onScroll:w,virtual:B,children:function(Ie,Ne){var De,Ve=Ie.group,Ge=Ie.groupOption,je=Ie.data,ct=Ie.label,pt=Ie.value,Tt=je.key;if(Ve){var Xe,Pt=(Xe=je.title)!==null&&Xe!==void 0?Xe:qT(ct)?ct.toString():void 0;return E("div",{className:Ye(H,"".concat(H,"-group")),title:Pt,children:ct!==void 0?ct:Tt})}var mt=je.disabled,It=je.title;je.children;var Ct=je.style,Dt=je.className,lt=Pr(je,NZ),dt=Si(lt,Te),ut=ye(pt),it="".concat(H,"-option"),ft=Ye(H,it,Dt,(De={},se(De,"".concat(it,"-grouped"),Ge),se(De,"".concat(it,"-active"),ne===Ne&&!mt),se(De,"".concat(it,"-disabled"),mt),se(De,"".concat(it,"-selected"),ut),De)),xt=ke(Ie),Wt=!O||typeof O=="function"||ut,jt=typeof xt=="number"?xt:xt||pt,Qt=qT(jt)?jt.toString():void 0;return It!==void 0&&(Qt=It),Qe("div",{...Ku(dt),"aria-selected":ut,className:ft,title:Qt,onMouseMove:function(){ne===Ne||mt||oe(Ne)},onClick:function(){mt||Re(pt)},style:Ct,children:[E("div",{className:"".concat(it,"-content"),children:jt}),C.exports.isValidElement(O)||ut,Wt&&E(q0,{className:"".concat(H,"-option-state"),customizeIcon:O,customizeIconProps:{isSelected:ut},children:ut?"\u2713":null})]})}})]})},iN=C.exports.forwardRef(zZ);iN.displayName="OptionList";var DZ=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],LZ=["inputValue"];function FZ(e){return!e||ar(e)!=="object"}var $Z=C.exports.forwardRef(function(e,t){var r=e.id,n=e.mode,i=e.prefixCls,a=i===void 0?"rc-select":i,u=e.backfill,o=e.fieldNames,f=e.inputValue,p=e.searchValue,v=e.onSearch,y=e.autoClearSearchValue,w=y===void 0?!0:y,k=e.onSelect,T=e.onDeselect,R=e.dropdownMatchSelectWidth,A=R===void 0?!0:R,I=e.filterOption,O=e.filterSort,N=e.optionFilterProp,L=e.optionLabelProp,B=e.options,j=e.children,G=e.defaultActiveFirstOption,H=e.menuItemSelectedIcon,te=e.virtual,Y=e.listHeight,le=Y===void 0?200:Y,J=e.listItemHeight,Z=J===void 0?20:J,Q=e.value,ge=e.defaultValue,ne=e.labelInValue,de=e.onChange,oe=Pr(e,DZ),ye=JA(r),Re=_C(n),Te=!!(!B&&j),ke=C.exports.useMemo(function(){return I===void 0&&n==="combobox"?!1:I},[I,n]),ze=C.exports.useMemo(function(){return YA(o,Te)},[JSON.stringify(o),Te]),Ie=Yi("",{value:p!==void 0?p:f,postState:function(ht){return ht||""}}),Ne=Le(Ie,2),De=Ne[0],Ve=Ne[1],Ge=mZ(B,j,ze,N,L),je=Ge.valueOptions,ct=Ge.labelOptions,pt=Ge.options,Tt=C.exports.useCallback(function(ot){var ht=NA(ot);return ht.map(function(Ot){var $t,ur,Mr,Wr,qr;if(FZ(Ot))$t=Ot;else{var me;Mr=Ot.key,ur=Ot.label,$t=(me=Ot.value)!==null&&me!==void 0?me:Mr}var K=je.get($t);if(K){var q;ur===void 0&&(ur=K==null?void 0:K[L||ze.label]),Mr===void 0&&(Mr=(q=K==null?void 0:K.key)!==null&&q!==void 0?q:$t),Wr=K==null?void 0:K.disabled,qr=K==null?void 0:K.title}return{label:ur,value:$t,key:Mr,disabled:Wr,title:qr}})},[ze,L,je]),Xe=Yi(ge,{value:Q}),Pt=Le(Xe,2),mt=Pt[0],It=Pt[1],Ct=C.exports.useMemo(function(){var ot,ht=Tt(mt);return n==="combobox"&&!((ot=ht[0])!==null&&ot!==void 0&&ot.value)?[]:ht},[mt,Tt,n]),Dt=lZ(Ct,je),lt=Le(Dt,2),dt=lt[0],ut=lt[1],it=C.exports.useMemo(function(){if(!n&&dt.length===1){var ot=dt[0];if(ot.value===null&&(ot.label===null||ot.label===void 0))return[]}return dt.map(function(ht){var Ot;return ve(ve({},ht),{},{label:(Ot=ht.label)!==null&&Ot!==void 0?Ot:ht.value})})},[n,dt]),ft=C.exports.useMemo(function(){return new Set(dt.map(function(ot){return ot.value}))},[dt]);C.exports.useEffect(function(){if(n==="combobox"){var ot,ht=(ot=dt[0])===null||ot===void 0?void 0:ot.value;Ve(oG(ht)?String(ht):"")}},[dt]);var xt=HT(function(ot,ht){var Ot,$t=ht!=null?ht:ot;return Ot={},se(Ot,ze.value,ot),se(Ot,ze.label,$t),Ot}),Wt=C.exports.useMemo(function(){if(n!=="tags")return pt;var ot=wt(pt),ht=function($t){return je.has($t)};return wt(dt).sort(function(Ot,$t){return Ot.value<$t.value?-1:1}).forEach(function(Ot){var $t=Ot.value;ht($t)||ot.push(xt($t,Ot.label))}),ot},[xt,pt,je,dt,n]),jt=uZ(Wt,ze,De,ke,N),Qt=C.exports.useMemo(function(){return n!=="tags"||!De||jt.some(function(ot){return ot[N||"value"]===De})?jt:[xt(De)].concat(wt(jt))},[xt,N,n,jt,De]),Fe=C.exports.useMemo(function(){return O?wt(Qt).sort(function(ot,ht){return O(ot,ht)}):Qt},[Qt,O]),qe=C.exports.useMemo(function(){return iZ(Fe,{fieldNames:ze,childrenAsData:Te})},[Fe,ze,Te]),Xt=function(ht){var Ot=Tt(ht);if(It(Ot),de&&(Ot.length!==dt.length||Ot.some(function(Mr,Wr){var qr;return((qr=dt[Wr])===null||qr===void 0?void 0:qr.value)!==(Mr==null?void 0:Mr.value)}))){var $t=ne?Ot:Ot.map(function(Mr){return Mr.value}),ur=Ot.map(function(Mr){return xC(ut(Mr.value))});de(Re?$t:$t[0],Re?ur:ur[0])}},cr=C.exports.useState(null),Vt=Le(cr,2),Ut=Vt[0],rr=Vt[1],xr=C.exports.useState(0),Rr=Le(xr,2),_t=Rr[0],qt=Rr[1],or=G!==void 0?G:n!=="combobox",Lr=C.exports.useCallback(function(ot,ht){var Ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},$t=Ot.source,ur=$t===void 0?"keyboard":$t;qt(ht),u&&n==="combobox"&&ot!==null&&ur==="keyboard"&&rr(String(ot))},[u,n]),Er=function(ht,Ot,$t){var ur=function(){var Ee,be=ut(ht);return[ne?{label:be==null?void 0:be[ze.label],value:ht,key:(Ee=be==null?void 0:be.key)!==null&&Ee!==void 0?Ee:ht}:ht,xC(be)]};if(Ot&&k){var Mr=ur(),Wr=Le(Mr,2),qr=Wr[0],me=Wr[1];k(qr,me)}else if(!Ot&&T&&$t!=="clear"){var K=ur(),q=Le(K,2),ce=q[0],ae=q[1];T(ce,ae)}},Lt=HT(function(ot,ht){var Ot,$t=Re?ht.selected:!0;$t?Ot=Re?[].concat(wt(dt),[ot]):[ot]:Ot=dt.filter(function(ur){return ur.value!==ot}),Xt(Ot),Er(ot,$t),n==="combobox"?rr(""):(!_C||w)&&(Ve(""),rr(""))}),kr=function(ht,Ot){Xt(ht);var $t=Ot.type,ur=Ot.values;($t==="remove"||$t==="clear")&&ur.forEach(function(Mr){Er(Mr.value,!1,$t)})},wr=function(ht,Ot){if(Ve(ht),rr(null),Ot.source==="submit"){var $t=(ht||"").trim();if($t){var ur=Array.from(new Set([].concat(wt(ft),[$t])));Xt(ur),Er($t,!0),Ve("")}return}Ot.source!=="blur"&&(n==="combobox"&&Xt(ht),v==null||v(ht))},fr=function(ht){var Ot=ht;n!=="tags"&&(Ot=ht.map(function(ur){var Mr=ct.get(ur);return Mr==null?void 0:Mr.value}).filter(function(ur){return ur!==void 0}));var $t=Array.from(new Set([].concat(wt(ft),wt(Ot))));Xt($t),$t.forEach(function(ur){Er(ur,!0)})},Nt=C.exports.useMemo(function(){var ot=te!==!1&&A!==!1;return ve(ve({},Ge),{},{flattenOptions:qe,onActiveValue:Lr,defaultActiveFirstOption:or,onSelect:Lt,menuItemSelectedIcon:H,rawValues:ft,fieldNames:ze,virtual:ot,listHeight:le,listItemHeight:Z,childrenAsData:Te})},[Ge,qe,Lr,or,Lt,H,ft,ze,te,A,le,Z,Te]);return E(nN.Provider,{value:Nt,children:E(QA,{...oe,id:ye,prefixCls:a,ref:t,omitDomProps:LZ,mode:n,displayValues:it,onDisplayValuesChange:kr,searchValue:De,onSearch:wr,autoClearSearchValue:w,onSearchSplit:fr,dropdownMatchSelectWidth:A,OptionList:iN,emptyOptions:!qe.length,activeValue:Ut,activeDescendantId:"".concat(ye,"_list_").concat(_t)})})}),a3=$Z;a3.Option=i3;a3.OptGroup=n3;var BZ=function(){var t=C.exports.useContext(Ar),r=t.getPrefixCls,n=r("empty-img-default");return E("svg",{className:n,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg",children:Qe("g",{fill:"none",fillRule:"evenodd",children:[Qe("g",{transform:"translate(24 31.67)",children:[E("ellipse",{className:"".concat(n,"-ellipse"),cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),E("path",{className:"".concat(n,"-path-1"),d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),E("path",{className:"".concat(n,"-path-2"),d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",transform:"translate(13.56)"}),E("path",{className:"".concat(n,"-path-3"),d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),E("path",{className:"".concat(n,"-path-4"),d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})]}),E("path",{className:"".concat(n,"-path-5"),d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),Qe("g",{className:"".concat(n,"-g"),transform:"translate(149.65 15.383)",children:[E("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),E("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})]})]})})};const VZ=BZ;var jZ=function(){var t=C.exports.useContext(Ar),r=t.getPrefixCls,n=r("empty-img-simple");return E("svg",{className:n,width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:Qe("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd",children:[E("ellipse",{className:"".concat(n,"-ellipse"),cx:"32",cy:"33",rx:"32",ry:"7"}),Qe("g",{className:"".concat(n,"-g"),fillRule:"nonzero",children:[E("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),E("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",className:"".concat(n,"-path")})]})]})})};const UZ=jZ;var KZ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=1},subscribe:function(t){return Oc.size||this.register(),Jb+=1,Oc.set(Jb,t),t(by),Jb},unsubscribe:function(t){Oc.delete(t),Oc.size||this.unregister()},unregister:function(){var t=this;Object.keys(_y).forEach(function(r){var n=_y[r],i=t.matchHandlers[n];i==null||i.mql.removeListener(i==null?void 0:i.listener)}),Oc.clear()},register:function(){var t=this;Object.keys(_y).forEach(function(r){var n=_y[r],i=function(o){var f=o.matches;t.dispatch(tt(tt({},by),se({},r,f)))},a=window.matchMedia(n);a.addListener(i),t.matchHandlers[n]={mql:a,listener:i},i(a)})}};const Y0=sX;function _N(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=C.exports.useRef({}),r=xN();return C.exports.useEffect(function(){var n=Y0.subscribe(function(i){t.current=i,e&&r()});return function(){return Y0.unsubscribe(n)}},[]),t.current}var Oa={adjustX:1,adjustY:1},Aa=[0,0],bN={left:{points:["cr","cl"],overflow:Oa,offset:[-4,0],targetOffset:Aa},right:{points:["cl","cr"],overflow:Oa,offset:[4,0],targetOffset:Aa},top:{points:["bc","tc"],overflow:Oa,offset:[0,-4],targetOffset:Aa},bottom:{points:["tc","bc"],overflow:Oa,offset:[0,4],targetOffset:Aa},topLeft:{points:["bl","tl"],overflow:Oa,offset:[0,-4],targetOffset:Aa},leftTop:{points:["tr","tl"],overflow:Oa,offset:[-4,0],targetOffset:Aa},topRight:{points:["br","tr"],overflow:Oa,offset:[0,-4],targetOffset:Aa},rightTop:{points:["tl","tr"],overflow:Oa,offset:[4,0],targetOffset:Aa},bottomRight:{points:["tr","br"],overflow:Oa,offset:[0,4],targetOffset:Aa},rightBottom:{points:["bl","br"],overflow:Oa,offset:[4,0],targetOffset:Aa},bottomLeft:{points:["tl","bl"],overflow:Oa,offset:[0,4],targetOffset:Aa},leftBottom:{points:["br","bl"],overflow:Oa,offset:[-4,0],targetOffset:Aa}};function lX(e){var t=e.showArrow,r=e.arrowContent,n=e.children,i=e.prefixCls,a=e.id,u=e.overlayInnerStyle,o=e.className,f=e.style;return Qe("div",{className:Ye("".concat(i,"-content"),o),style:f,children:[t!==!1&&E("div",{className:"".concat(i,"-arrow"),children:r},"arrow"),E("div",{className:"".concat(i,"-inner"),id:a,role:"tooltip",style:u,children:typeof n=="function"?n():n})]})}var uX=function(t,r){var n=t.overlayClassName,i=t.trigger,a=i===void 0?["hover"]:i,u=t.mouseEnterDelay,o=u===void 0?0:u,f=t.mouseLeaveDelay,p=f===void 0?.1:f,v=t.overlayStyle,y=t.prefixCls,w=y===void 0?"rc-tooltip":y,k=t.children,T=t.onVisibleChange,R=t.afterVisibleChange,A=t.transitionName,I=t.animation,O=t.motion,N=t.placement,L=N===void 0?"right":N,B=t.align,j=B===void 0?{}:B,G=t.destroyTooltipOnHide,H=G===void 0?!1:G,te=t.defaultVisible,Y=t.getTooltipContainer,le=t.overlayInnerStyle,J=t.arrowContent,Z=t.overlay,Q=t.id,ge=t.showArrow,ne=Pr(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),de=C.exports.useRef(null);C.exports.useImperativeHandle(r,function(){return de.current});var oe=ve({},ne);"visible"in t&&(oe.popupVisible=t.visible);var ye=function(){return E(lX,{showArrow:ge,arrowContent:J,prefixCls:w,id:Q,overlayInnerStyle:le,children:Z},"content")},Re=!1,Te=!1;if(typeof H=="boolean")Re=H;else if(H&&ar(H)==="object"){var ke=H.keepParent;Re=ke===!0,Te=ke===!1}return E(dx,{popupClassName:n,prefixCls:w,popup:ye,action:a,builtinPlacements:bN,popupPlacement:L,ref:de,popupAlign:j,getPopupContainer:Y,onPopupVisibleChange:T,afterPopupVisibleChange:R,popupTransitionName:A,popupAnimation:I,popupMotion:O,defaultPopupVisible:te,destroyPopupOnHide:Re,autoDestroy:Te,mouseLeaveDelay:p,popupStyle:v,mouseEnterDelay:o,...oe,children:k})};const cX=C.exports.forwardRef(uX);Sa("success","processing","error","default","warning");var dX=Sa("pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"),fX={adjustX:1,adjustY:1},XT={adjustX:0,adjustY:0},hX=[0,0];function YT(e){return typeof e=="boolean"?e?fX:XT:tt(tt({},XT),e)}function wN(e){var t=e.arrowWidth,r=t===void 0?4:t,n=e.horizontalArrowShift,i=n===void 0?16:n,a=e.verticalArrowShift,u=a===void 0?8:a,o=e.autoAdjustOverflow,f=e.arrowPointAtCenter,p={left:{points:["cr","cl"],offset:[-4,0]},right:{points:["cl","cr"],offset:[4,0]},top:{points:["bc","tc"],offset:[0,-4]},bottom:{points:["tc","bc"],offset:[0,4]},topLeft:{points:["bl","tc"],offset:[-(i+r),-4]},leftTop:{points:["tr","cl"],offset:[-4,-(u+r)]},topRight:{points:["br","tc"],offset:[i+r,-4]},rightTop:{points:["tl","cr"],offset:[4,-(u+r)]},bottomRight:{points:["tr","bc"],offset:[i+r,4]},rightBottom:{points:["bl","cr"],offset:[4,u+r]},bottomLeft:{points:["tl","bc"],offset:[-(i+r),4]},leftBottom:{points:["br","cl"],offset:[-4,u+r]}};return Object.keys(p).forEach(function(v){p[v]=f?tt(tt({},p[v]),{overflow:YT(o),targetOffset:hX}):tt(tt({},bN[v]),{overflow:YT(o)}),p[v].ignoreShake=!0}),p}var pX=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:!1;if(r3(e)){var r=e.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(r)||e.isContentEditable||r==="a"&&!!e.getAttribute("href"),i=e.getAttribute("tabindex"),a=Number(i),u=null;return i&&!Number.isNaN(a)?u=a:n&&u===null&&(u=0),n&&e.disabled&&(u=null),u!==null&&(u>=0||t&&u<0)}return!1}function IN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=wt(e.querySelectorAll("*")).filter(function(n){return eP(n,t)});return eP(e,t)&&r.unshift(e),r}var CC=Et.LEFT,SC=Et.RIGHT,EC=Et.UP,Jy=Et.DOWN,e0=Et.ENTER,RN=Et.ESC,Op=Et.HOME,Ap=Et.END,tP=[EC,Jy,CC,SC];function kX(e,t,r,n){var i,a,u,o,f="prev",p="next",v="children",y="parent";if(e==="inline"&&n===e0)return{inlineTrigger:!0};var w=(i={},se(i,EC,f),se(i,Jy,p),i),k=(a={},se(a,CC,r?p:f),se(a,SC,r?f:p),se(a,Jy,v),se(a,e0,v),a),T=(u={},se(u,EC,f),se(u,Jy,p),se(u,e0,v),se(u,RN,y),se(u,CC,r?v:y),se(u,SC,r?y:v),u),R={inline:w,horizontal:k,vertical:T,inlineSub:w,horizontalSub:T,verticalSub:T},A=(o=R["".concat(e).concat(t?"":"Sub")])===null||o===void 0?void 0:o[n];switch(A){case f:return{offset:-1,sibling:!0};case p:return{offset:1,sibling:!0};case y:return{offset:-1,sibling:!1};case v:return{offset:1,sibling:!1};default:return null}}function TX(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function PX(e,t){for(var r=e||document.activeElement;r;){if(t.has(r))return r;r=r.parentElement}return null}function ON(e,t){var r=IN(e,!0);return r.filter(function(n){return t.has(n)})}function rP(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var i=ON(e,t),a=i.length,u=i.findIndex(function(o){return r===o});return n<0?u===-1?u=a-1:u-=1:n>0&&(u+=1),u=(u+a)%a,i[u]}function MX(e,t,r,n,i,a,u,o,f,p){var v=C.exports.useRef(),y=C.exports.useRef();y.current=t;var w=function(){tn.cancel(v.current)};return C.exports.useEffect(function(){return function(){w()}},[]),function(k){var T=k.which;if([].concat(tP,[e0,RN,Op,Ap]).includes(T)){var R,A,I,O=function(){R=new Set,A=new Map,I=new Map;var ge=a();return ge.forEach(function(ne){var de=document.querySelector("[data-menu-id='".concat(f3(n,ne),"']"));de&&(R.add(de),I.set(de,ne),A.set(ne,de))}),R};O();var N=A.get(t),L=PX(N,R),B=I.get(L),j=kX(e,u(B,!0).length===1,r,T);if(!j&&T!==Op&&T!==Ap)return;(tP.includes(T)||[Op,Ap].includes(T))&&k.preventDefault();var G=function(ge){if(ge){var ne=ge,de=ge.querySelector("a");de!=null&&de.getAttribute("href")&&(ne=de);var oe=I.get(ge);o(oe),w(),v.current=tn(function(){y.current===oe&&ne.focus()})}};if([Op,Ap].includes(T)||j.sibling||!L){var H;!L||e==="inline"?H=i.current:H=TX(L);var te,Y=ON(H,R);T===Op?te=Y[0]:T===Ap?te=Y[Y.length-1]:te=rP(H,R,L,j.offset),G(te)}else if(j.inlineTrigger)f(B);else if(j.offset>0)f(B,!0),w(),v.current=tn(function(){O();var Q=L.getAttribute("aria-controls"),ge=document.getElementById(Q),ne=rP(ge,R);G(ne)},5);else if(j.offset<0){var le=u(B,!0),J=le[le.length-2],Z=A.get(J);f(J,!1),G(Z)}}p==null||p(k)}}function IX(e){Promise.resolve().then(e)}var p3="__RC_UTIL_PATH_SPLIT__",nP=function(t){return t.join(p3)},RX=function(t){return t.split(p3)},kC="rc-menu-more";function OX(){var e=C.exports.useState({}),t=Le(e,2),r=t[1],n=C.exports.useRef(new Map),i=C.exports.useRef(new Map),a=C.exports.useState([]),u=Le(a,2),o=u[0],f=u[1],p=C.exports.useRef(0),v=C.exports.useRef(!1),y=function(){v.current||r({})},w=C.exports.useCallback(function(N,L){var B=nP(L);i.current.set(B,N),n.current.set(N,B),p.current+=1;var j=p.current;IX(function(){j===p.current&&y()})},[]),k=C.exports.useCallback(function(N,L){var B=nP(L);i.current.delete(B),n.current.delete(N)},[]),T=C.exports.useCallback(function(N){f(N)},[]),R=C.exports.useCallback(function(N,L){var B=n.current.get(N)||"",j=RX(B);return L&&o.includes(j[0])&&j.unshift(kC),j},[o]),A=C.exports.useCallback(function(N,L){return N.some(function(B){var j=R(B,!0);return j.includes(L)})},[R]),I=function(){var L=wt(n.current.keys());return o.length&&L.push(kC),L},O=C.exports.useCallback(function(N){var L="".concat(n.current.get(N)).concat(p3),B=new Set;return wt(i.current.keys()).forEach(function(j){j.startsWith(L)&&B.add(i.current.get(j))}),B},[]);return C.exports.useEffect(function(){return function(){v.current=!0}},[]),{registerPath:w,unregisterPath:k,refreshOverflowKeys:T,isSubPathKey:A,getKeyPath:R,getKeys:I,getSubPathKeys:O}}function of(e){var t=C.exports.useRef(e);t.current=e;var r=C.exports.useCallback(function(){for(var n,i=arguments.length,a=new Array(i),u=0;u1&&(O.motionAppear=!1);var N=O.onVisibleChanged;return O.onVisibleChanged=function(L){return!w.current&&!L&&A(!0),N==null?void 0:N(L)},R?null:E(Km,{mode:a,locked:!w.current,children:E(Ga,{visible:I,...O,forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(o,"-hidden"),children:function(L){var B=L.className,j=L.style;return E(m3,{id:t,className:B,style:j,children:i})}})})}var XX=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],YX=["active"],QX=function(t){var r,n=t.style,i=t.className,a=t.title,u=t.eventKey;t.warnKey;var o=t.disabled,f=t.internalPopupClose,p=t.children,v=t.itemIcon,y=t.expandIcon,w=t.popupClassName,k=t.popupOffset,T=t.onClick,R=t.onMouseEnter,A=t.onMouseLeave,I=t.onTitleClick,O=t.onTitleMouseEnter,N=t.onTitleMouseLeave,L=Pr(t,XX),B=kN(u),j=C.exports.useContext(_s),G=j.prefixCls,H=j.mode,te=j.openKeys,Y=j.disabled,le=j.overflowDisabled,J=j.activeKey,Z=j.selectedKeys,Q=j.itemIcon,ge=j.expandIcon,ne=j.onItemClick,de=j.onOpenChange,oe=j.onActive,ye=C.exports.useContext(h3),Re=ye._internalRenderSubMenuItem,Te=C.exports.useContext(MN),ke=Te.isSubPathKey,ze=dh(),Ie="".concat(G,"-submenu"),Ne=Y||o,De=C.exports.useRef(),Ve=C.exports.useRef(),Ge=v||Q,je=y||ge,ct=te.includes(u),pt=!le&&ct,Tt=ke(Z,u),Xe=AN(u,Ne,O,N),Pt=Xe.active,mt=Pr(Xe,YX),It=C.exports.useState(!1),Ct=Le(It,2),Dt=Ct[0],lt=Ct[1],dt=function(xr){Ne||lt(xr)},ut=function(xr){dt(!0),R==null||R({key:u,domEvent:xr})},it=function(xr){dt(!1),A==null||A({key:u,domEvent:xr})},ft=C.exports.useMemo(function(){return Pt||(H!=="inline"?Dt||ke([J],u):!1)},[H,Pt,J,Dt,u,ke]),xt=zN(ze.length),Wt=function(xr){Ne||(I==null||I({key:u,domEvent:xr}),H==="inline"&&de(u,!ct))},jt=of(function(rr){T==null||T(Q0(rr)),ne(rr)}),Qt=function(xr){H!=="inline"&&de(u,xr)},Fe=function(){oe(u)},qe=B&&"".concat(B,"-popup"),Xt=Qe("div",{role:"menuitem",style:xt,className:"".concat(Ie,"-title"),tabIndex:Ne?null:-1,ref:De,title:typeof a=="string"?a:null,"data-menu-id":le&&B?null:B,"aria-expanded":pt,"aria-haspopup":!0,"aria-controls":qe,"aria-disabled":Ne,onClick:Wt,onFocus:Fe,...mt,children:[a,E(NN,{icon:H!=="horizontal"?je:null,props:ve(ve({},t),{},{isOpen:pt,isSubMenu:!0}),children:E("i",{className:"".concat(Ie,"-arrow")})})]}),cr=C.exports.useRef(H);if(H!=="inline"&&ze.length>1?cr.current="vertical":cr.current=H,!le){var Vt=cr.current;Xt=E(GX,{mode:Vt,prefixCls:Ie,visible:!f&&pt&&H!=="inline",popupClassName:w,popupOffset:k,popup:E(Km,{mode:Vt==="horizontal"?"vertical":Vt,children:E(m3,{id:qe,ref:Ve,children:p})}),disabled:Ne,onVisibleChange:Qt,children:Xt})}var Ut=Qe(Hs.Item,{role:"none",...L,component:"li",style:n,className:Ye(Ie,"".concat(Ie,"-").concat(H),i,(r={},se(r,"".concat(Ie,"-open"),pt),se(r,"".concat(Ie,"-active"),ft),se(r,"".concat(Ie,"-selected"),Tt),se(r,"".concat(Ie,"-disabled"),Ne),r)),onMouseEnter:ut,onMouseLeave:it,children:[Xt,!le&&E(ZX,{id:qe,open:pt,keyPath:ze,children:p})]});return Re&&(Ut=Re(Ut,t,{selected:Tt,active:ft,open:pt,disabled:Ne})),E(Km,{onItemClick:jt,mode:H==="horizontal"?"vertical":H,itemIcon:Ge,expandIcon:je,children:Ut})};function vx(e){var t=e.eventKey,r=e.children,n=dh(t),i=v3(r,n),a=px();C.exports.useEffect(function(){if(a)return a.registerPath(t,n),function(){a.unregisterPath(t,n)}},[n]);var u;return a?u=i:u=E(QX,{...e,children:i}),E(PN.Provider,{value:n,children:u})}var JX=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],ef=[],eY=C.exports.forwardRef(function(e,t){var r,n,i=e,a=i.prefixCls,u=a===void 0?"rc-menu":a,o=i.rootClassName,f=i.style,p=i.className,v=i.tabIndex,y=v===void 0?0:v,w=i.items,k=i.children,T=i.direction,R=i.id,A=i.mode,I=A===void 0?"vertical":A,O=i.inlineCollapsed,N=i.disabled,L=i.disabledOverflow,B=i.subMenuOpenDelay,j=B===void 0?.1:B,G=i.subMenuCloseDelay,H=G===void 0?.1:G,te=i.forceSubMenuRender,Y=i.defaultOpenKeys,le=i.openKeys,J=i.activeKey,Z=i.defaultActiveFirst,Q=i.selectable,ge=Q===void 0?!0:Q,ne=i.multiple,de=ne===void 0?!1:ne,oe=i.defaultSelectedKeys,ye=i.selectedKeys,Re=i.onSelect,Te=i.onDeselect,ke=i.inlineIndent,ze=ke===void 0?24:ke,Ie=i.motion,Ne=i.defaultMotions,De=i.triggerSubMenuAction,Ve=De===void 0?"hover":De,Ge=i.builtinPlacements,je=i.itemIcon,ct=i.expandIcon,pt=i.overflowedIndicator,Tt=pt===void 0?"...":pt,Xe=i.overflowedIndicatorPopupClassName,Pt=i.getPopupContainer,mt=i.onClick,It=i.onOpenChange,Ct=i.onKeyDown;i.openAnimation,i.openTransitionName;var Dt=i._internalRenderMenuItem,lt=i._internalRenderSubMenuItem,dt=Pr(i,JX),ut=C.exports.useMemo(function(){return KX(k,w,ef)},[k,w]),it=C.exports.useState(!1),ft=Le(it,2),xt=ft[0],Wt=ft[1],jt=C.exports.useRef(),Qt=NX(R),Fe=T==="rtl",qe=Yi(Y,{value:le,postState:function(zr){return zr||ef}}),Xt=Le(qe,2),cr=Xt[0],Vt=Xt[1],Ut=function(zr){var Xr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function bn(){Vt(zr),It==null||It(zr)}Xr?Zu.exports.flushSync(bn):bn()},rr=C.exports.useState(cr),xr=Le(rr,2),Rr=xr[0],_t=xr[1],qt=C.exports.useRef(!1),or=C.exports.useMemo(function(){return(I==="inline"||I==="vertical")&&O?["vertical",O]:[I,!1]},[I,O]),Lr=Le(or,2),Er=Lr[0],Lt=Lr[1],kr=Er==="inline",wr=C.exports.useState(Er),fr=Le(wr,2),Nt=fr[0],ot=fr[1],ht=C.exports.useState(Lt),Ot=Le(ht,2),$t=Ot[0],ur=Ot[1];C.exports.useEffect(function(){ot(Er),ur(Lt),qt.current&&(kr?Vt(Rr):Ut(ef))},[Er,Lt]);var Mr=C.exports.useState(0),Wr=Le(Mr,2),qr=Wr[0],me=Wr[1],K=qr>=ut.length-1||Nt!=="horizontal"||L;C.exports.useEffect(function(){kr&&_t(cr)},[cr]),C.exports.useEffect(function(){return qt.current=!0,function(){qt.current=!1}},[]);var q=OX(),ce=q.registerPath,ae=q.unregisterPath,xe=q.refreshOverflowKeys,Ee=q.isSubPathKey,be=q.getKeyPath,Ce=q.getKeys,Ae=q.getSubPathKeys,He=C.exports.useMemo(function(){return{registerPath:ce,unregisterPath:ae}},[ce,ae]),We=C.exports.useMemo(function(){return{isSubPathKey:Ee}},[Ee]);C.exports.useEffect(function(){xe(K?ef:ut.slice(qr+1).map(function(jr){return jr.key}))},[qr,K]);var Be=Yi(J||Z&&((r=ut[0])===null||r===void 0?void 0:r.key),{value:J}),At=Le(Be,2),bt=At[0],Je=At[1],Rt=of(function(jr){Je(jr)}),Bt=of(function(){Je(void 0)});C.exports.useImperativeHandle(t,function(){return{list:jt.current,focus:function(zr){var Xr,bn=bt!=null?bt:(Xr=ut.find(function(Wl){return!Wl.props.disabled}))===null||Xr===void 0?void 0:Xr.key;if(bn){var Cn,Bn,bo;(Cn=jt.current)===null||Cn===void 0||(Bn=Cn.querySelector("li[data-menu-id='".concat(f3(Qt,bn),"']")))===null||Bn===void 0||(bo=Bn.focus)===null||bo===void 0||bo.call(Bn,zr)}}}});var vr=Yi(oe||[],{value:ye,postState:function(zr){return Array.isArray(zr)?zr:zr==null?ef:[zr]}}),ir=Le(vr,2),gr=ir[0],$r=ir[1],Qr=function(zr){if(ge){var Xr=zr.key,bn=gr.includes(Xr),Cn;de?bn?Cn=gr.filter(function(bo){return bo!==Xr}):Cn=[].concat(wt(gr),[Xr]):Cn=[Xr],$r(Cn);var Bn=ve(ve({},zr),{},{selectedKeys:Cn});bn?Te==null||Te(Bn):Re==null||Re(Bn)}!de&&cr.length&&Nt!=="inline"&&Ut(ef)},$n=of(function(jr){mt==null||mt(Q0(jr)),Qr(jr)}),on=of(function(jr,zr){var Xr=cr.filter(function(Cn){return Cn!==jr});if(zr)Xr.push(jr);else if(Nt!=="inline"){var bn=Ae(jr);Xr=Xr.filter(function(Cn){return!bn.has(Cn)})}t3(cr,Xr,!0)||Ut(Xr,!0)}),Rn=of(Pt),Tr=function(zr,Xr){var bn=Xr!=null?Xr:!cr.includes(zr);on(zr,bn)},Cr=MX(Nt,bt,Fe,Qt,jt,Ce,be,Je,Tr,Ct);C.exports.useEffect(function(){Wt(!0)},[]);var Ir=C.exports.useMemo(function(){return{_internalRenderMenuItem:Dt,_internalRenderSubMenuItem:lt}},[Dt,lt]),Jn=Nt!=="horizontal"||L?ut:ut.map(function(jr,zr){return E(Km,{overflowDisabled:zr>qr,children:jr},jr.key)}),gn=E(Hs,{id:R,ref:jt,prefixCls:"".concat(u,"-overflow"),component:"ul",itemComponent:mx,className:Ye(u,"".concat(u,"-root"),"".concat(u,"-").concat(Nt),p,(n={},se(n,"".concat(u,"-inline-collapsed"),$t),se(n,"".concat(u,"-rtl"),Fe),n),o),dir:T,style:f,role:"menu",tabIndex:y,data:Jn,renderRawItem:function(zr){return zr},renderRawRest:function(zr){var Xr=zr.length,bn=Xr?ut.slice(-Xr):null;return E(vx,{eventKey:kC,title:Tt,disabled:K,internalPopupClose:Xr===0,popupClassName:Xe,children:bn})},maxCount:Nt!=="horizontal"||L?Hs.INVALIDATE:Hs.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(zr){me(zr)},onKeyDown:Cr,...dt});return E(h3.Provider,{value:Ir,children:E(EN.Provider,{value:Qt,children:Qe(Km,{prefixCls:u,rootClassName:o,mode:Nt,openKeys:cr,rtl:Fe,disabled:N,motion:xt?Ie:null,defaultMotions:xt?Ne:null,activeKey:bt,onActive:Rt,onInactive:Bt,selectedKeys:gr,inlineIndent:ze,subMenuOpenDelay:j,subMenuCloseDelay:H,forceSubMenuRender:te,builtinPlacements:Ge,triggerSubMenuAction:Ve,getPopupContainer:Rn,itemIcon:je,expandIcon:ct,onItemClick:$n,onOpenChange:on,children:[E(MN.Provider,{value:We,children:gn}),E("div",{style:{display:"none"},"aria-hidden":!0,children:E(TN.Provider,{value:He,children:ut})})]})})})}),tY=["className","title","eventKey","children"],rY=["children"],nY=function(t){var r=t.className,n=t.title;t.eventKey;var i=t.children,a=Pr(t,tY),u=C.exports.useContext(_s),o=u.prefixCls,f="".concat(o,"-item-group");return Qe("li",{role:"presentation",...a,onClick:function(v){return v.stopPropagation()},className:Ye(f,r),children:[E("div",{role:"presentation",className:"".concat(f,"-title"),title:typeof n=="string"?n:void 0,children:n}),E("ul",{role:"group",className:"".concat(f,"-list"),children:i})]})};function gx(e){var t=e.children,r=Pr(e,rY),n=dh(r.eventKey),i=v3(t,n),a=px();return a?i:E(nY,{...Si(r,["warnKey"]),children:i})}function g3(e){var t=e.className,r=e.style,n=C.exports.useContext(_s),i=n.prefixCls,a=px();return a?null:E("li",{className:Ye("".concat(i,"-item-divider"),t),style:r})}var pv=eY;pv.Item=mx;pv.SubMenu=vx;pv.ItemGroup=gx;pv.Divider=g3;var iY={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"};const oY=iY;var LN=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:oY})})};LN.displayName="LeftOutlined";const aY=C.exports.forwardRef(LN);var sY={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};const lY=sY;var FN=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:lY})})};FN.displayName="RightOutlined";const y3=C.exports.forwardRef(FN);globalThis&&globalThis.__rest;var $N=C.exports.createContext({}),uY=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i"u"?j=v?A:"":O===!1&&(j="");var G={title:j};!u&&!y&&(G.title=null,G.open=!1);var H=lo(A).length,te=Qe(mx,{...B,className:Ye((a={},se(a,"".concat(p,"-item-danger"),L),se(a,"".concat(p,"-item-only-child"),(N?H+1:H)===1),a),R),title:typeof O=="string"?O:void 0,children:[Ni(N,{className:Ye(Yo(N)?(o=N.props)===null||o===void 0?void 0:o.className:"","".concat(p,"-item-icon"))}),n.renderItemChildren(y)]});return k||(te=E(yo,{...G,placement:w==="rtl"?"left":"right",overlayClassName:"".concat(p,"-inline-collapsed-tooltip"),children:te})),te},n}return Qn(r,[{key:"renderItemChildren",value:function(i){var a=this.context,u=a.prefixCls,o=a.firstLevel,f=this.props,p=f.icon,v=f.children,y=E("span",{className:"".concat(u,"-title-content"),children:v});return(!p||Yo(v)&&v.type==="span")&&v&&i&&o&&typeof v=="string"?E("div",{className:"".concat(u,"-inline-collapsed-noicon"),children:v.charAt(0)}):y}},{key:"render",value:function(){return E($N.Consumer,{children:this.renderItem})}}]),r}(C.exports.Component);x3.contextType=J0;function VN(e){var t,r=e.popupClassName,n=e.icon,i=e.title,a=e.theme,u=C.exports.useContext(J0),o=u.prefixCls,f=u.inlineCollapsed,p=u.antdMenuTheme,v=dh(),y;if(!n)y=f&&!v.length&&i&&typeof i=="string"?E("div",{className:"".concat(o,"-inline-collapsed-noicon"),children:i.charAt(0)}):E("span",{className:"".concat(o,"-title-content"),children:i});else{var w=Yo(i)&&i.type==="span";y=Qe(Fr,{children:[Ni(n,{className:Ye(Yo(n)?(t=n.props)===null||t===void 0?void 0:t.className:"","".concat(o,"-item-icon"))}),w?i:E("span",{className:"".concat(o,"-title-content"),children:i})]})}var k=C.exports.useMemo(function(){return tt(tt({},u),{firstLevel:!1})},[u]);return E(J0.Provider,{value:k,children:E(vx,{...Si(e,["icon"]),title:y,popupClassName:Ye(o,"".concat(o,"-").concat(a||p),r)})})}var hY=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:1,r=EY++,n=t;function i(){n-=1,n<=0?(e(),delete Mf[r]):Mf[r]=tn(i)}return Mf[r]=tn(i),r}t1.cancel=function(t){t!==void 0&&(tn.cancel(Mf[t]),delete Mf[t])};t1.ids=Mf;var e2;function oP(e){return!e||e.offsetParent===null||e.hidden}function kY(e){return e instanceof Document?e.body:Array.from(e.childNodes).find(function(t){return(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE})}function TY(e){var t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return t&&t[1]&&t[2]&&t[3]?!(t[1]===t[2]&&t[2]===t[3]):!0}var KN=function(e){vi(r,e);var t=gi(r);function r(){var n;return Yn(this,r),n=t.apply(this,arguments),n.containerRef=C.exports.createRef(),n.animationStart=!1,n.destroyed=!1,n.onClick=function(i,a){var u,o,f=n.props,p=f.insertExtraNode,v=f.disabled;if(!(v||!i||oP(i)||i.className.includes("-leave"))){n.extraNode=document.createElement("div");var y=Or(n),w=y.extraNode,k=n.context.getPrefixCls;w.className="".concat(k(""),"-click-animating-node");var T=n.getAttributeName();if(i.setAttribute(T,"true"),a&&a!=="#fff"&&a!=="#ffffff"&&a!=="rgb(255, 255, 255)"&&a!=="rgba(255, 255, 255, 1)"&&TY(a)&&!/rgba\((?:\d*, ){3}0\)/.test(a)&&a!=="transparent"){w.style.borderColor=a;var R=((u=i.getRootNode)===null||u===void 0?void 0:u.call(i))||i.ownerDocument,A=(o=kY(R))!==null&&o!==void 0?o:R;e2=cv(` [`.concat(k(""),"-click-animating-without-extra-node='true']::after, .").concat(k(""),`-click-animating-node { --antd-wave-shadow-color: `).concat(a,`; }`),"antd-wave",{csp:n.csp,attachTo:A})}p&&i.appendChild(w),["transition","animation"].forEach(function(I){i.addEventListener("".concat(I,"start"),n.onTransitionStart),i.addEventListener("".concat(I,"end"),n.onTransitionEnd)})}},n.onTransitionStart=function(i){if(!n.destroyed){var a=n.containerRef.current;!i||i.target!==a||n.animationStart||n.resetEffect(a)}},n.onTransitionEnd=function(i){!i||i.animationName!=="fadeEffect"||n.resetEffect(i.target)},n.bindAnimationEvent=function(i){if(!(!i||!i.getAttribute||i.getAttribute("disabled")||i.className.includes("disabled"))){var a=function(o){if(!(o.target.tagName==="INPUT"||oP(o.target))){n.resetEffect(i);var f=getComputedStyle(i).getPropertyValue("border-top-color")||getComputedStyle(i).getPropertyValue("border-color")||getComputedStyle(i).getPropertyValue("background-color");n.clickWaveTimeoutId=window.setTimeout(function(){return n.onClick(i,f)},0),t1.cancel(n.animationStartId),n.animationStart=!0,n.animationStartId=t1(function(){n.animationStart=!1},10)}};return i.addEventListener("click",a,!0),{cancel:function(){i.removeEventListener("click",a,!0)}}}},n.renderWave=function(i){var a=i.csp,u=n.props.children;if(n.csp=a,!C.exports.isValidElement(u))return u;var o=n.containerRef;return fd(u)&&(o=ta(u.ref,n.containerRef)),Ni(u,{ref:o})},n}return Qn(r,[{key:"componentDidMount",value:function(){this.destroyed=!1;var i=this.containerRef.current;!i||i.nodeType!==1||(this.instance=this.bindAnimationEvent(i))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var i=this.context.getPrefixCls,a=this.props.insertExtraNode;return a?"".concat(i(""),"-click-animating"):"".concat(i(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(i){var a=this;if(!(!i||i===this.extraNode||!(i instanceof Element))){var u=this.props.insertExtraNode,o=this.getAttributeName();i.setAttribute(o,"false"),e2&&(e2.innerHTML=""),u&&this.extraNode&&i.contains(this.extraNode)&&i.removeChild(this.extraNode),["transition","animation"].forEach(function(f){i.removeEventListener("".concat(f,"start"),a.onTransitionStart),i.removeEventListener("".concat(f,"end"),a.onTransitionEnd)})}}},{key:"render",value:function(){return E(Ju,{children:this.renderWave})}}]),r}(C.exports.Component);KN.contextType=Ar;const PY=KN;var MY=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0&&(Z=R.map(function(ne){return typeof ne=="string"||typeof ne=="number"?E(r1,{prefixCls:le,disabled:O,value:ne,checked:p===ne,children:ne},ne.toString()):E(r1,{prefixCls:le,disabled:ne.disabled||O,value:ne.value,checked:p===ne.value,style:ne.style,children:ne.label},"radio-group-value-options-".concat(ne.value))}));var Q=L||u,ge=Ye(J,"".concat(J,"-").concat(I),(r={},se(r,"".concat(J,"-").concat(Q),Q),se(r,"".concat(J,"-rtl"),a==="rtl"),r),T);return E("div",{...CA(e),className:ge,style:B,onMouseEnter:G,onMouseLeave:H,onFocus:te,onBlur:Y,id:j,ref:t,children:E(DQ,{value:{onChange:y,value:p,disabled:e.disabled,name:e.name,optionType:e.optionType},children:Z})})});const jQ=C.exports.memo(VQ);var UQ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=t||G<0||y&&H>=a}function I(){var j=i2();if(A(j))return O(j);o=setTimeout(I,R(j))}function O(j){return o=void 0,w&&n?k(j):(n=i=void 0,u)}function N(){o!==void 0&&clearTimeout(o),p=0,n=f=i=o=void 0}function L(){return o===void 0?u:O(i2())}function B(){var j=i2(),G=A(j);if(n=arguments,i=this,f=j,G){if(o===void 0)return T(f);if(y)return clearTimeout(o),o=setTimeout(I,t),k(f)}return o===void 0&&(o=setTimeout(I,t)),u}return B.cancel=N,B.flush=L,B}var eJ=JQ;function o9(e,t){var r=new Set;return e.forEach(function(n){t.has(n)||r.add(n)}),r}function tJ(e){var t=e||{},r=t.disabled,n=t.disableCheckbox,i=t.checkable;return!!(r||n)||i===!1}function rJ(e,t,r,n){for(var i=new Set(e),a=new Set,u=0;u<=r;u+=1){var o=t.get(u)||new Set;o.forEach(function(y){var w=y.key,k=y.node,T=y.children,R=T===void 0?[]:T;i.has(w)&&!n(k)&&R.filter(function(A){return!n(A.node)}).forEach(function(A){i.add(A.key)})})}for(var f=new Set,p=r;p>=0;p-=1){var v=t.get(p)||new Set;v.forEach(function(y){var w=y.parent,k=y.node;if(!(n(k)||!y.parent||f.has(y.parent.key))){if(n(y.parent.node)){f.add(w.key);return}var T=!0,R=!1;(w.children||[]).filter(function(A){return!n(A.node)}).forEach(function(A){var I=A.key,O=i.has(I);T&&!O&&(T=!1),!R&&(O||a.has(I))&&(R=!0)}),T&&i.add(w.key),R&&a.add(w.key),f.add(w.key)}})}return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(o9(a,i))}}function nJ(e,t,r,n,i){for(var a=new Set(e),u=new Set(t),o=0;o<=n;o+=1){var f=r.get(o)||new Set;f.forEach(function(w){var k=w.key,T=w.node,R=w.children,A=R===void 0?[]:R;!a.has(k)&&!u.has(k)&&!i(T)&&A.filter(function(I){return!i(I.node)}).forEach(function(I){a.delete(I.key)})})}u=new Set;for(var p=new Set,v=n;v>=0;v-=1){var y=r.get(v)||new Set;y.forEach(function(w){var k=w.parent,T=w.node;if(!(i(T)||!w.parent||p.has(w.parent.key))){if(i(w.parent.node)){p.add(k.key);return}var R=!0,A=!1;(k.children||[]).filter(function(I){return!i(I.node)}).forEach(function(I){var O=I.key,N=a.has(O);R&&!N&&(R=!1),!A&&(N||u.has(O))&&(A=!0)}),R||a.delete(k.key),A&&u.add(k.key),p.add(k.key)}})}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(o9(u,a))}}function kl(e,t,r,n){var i=[],a;n?a=n:a=tJ;var u=new Set(e.filter(function(v){var y=!!r[v];return y||i.push(v),y})),o=new Map,f=0;Object.keys(r).forEach(function(v){var y=r[v],w=y.level,k=o.get(w);k||(k=new Set,o.set(w,k)),k.add(y),f=Math.max(f,w)}),Fn(!i.length,"Tree missing follow keys: ".concat(i.slice(0,100).map(function(v){return"'".concat(v,"'")}).join(", ")));var p;return t===!0?p=rJ(u,o,f,a):p=nJ(u,t.halfCheckedKeys,o,f,a),p}var k3=C.exports.createContext(null),iJ=function(t){for(var r=t.prefixCls,n=t.level,i=t.isStart,a=t.isEnd,u="".concat(r,"-indent-unit"),o=[],f=0;f=0&&r.splice(n,1),r}function pl(e,t){var r=(e||[]).slice();return r.indexOf(t)===-1&&r.push(t),r}function T3(e){return e.split("-")}function a9(e,t){return"".concat(e,"-").concat(t)}function uJ(e){return e&&e.type&&e.type.isTreeNode}function cJ(e,t){var r=[],n=t[e];function i(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a.forEach(function(u){var o=u.key,f=u.children;r.push(o),i(f)})}return i(n.children),r}function dJ(e){if(e.parent){var t=T3(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function fJ(e){var t=T3(e.pos);return Number(t[t.length-1])===0}function mP(e,t,r,n,i,a,u,o,f,p){var v,y=e.clientX,w=e.clientY,k=e.target.getBoundingClientRect(),T=k.top,R=k.height,A=(p==="rtl"?-1:1)*(((i==null?void 0:i.x)||0)-y),I=(A-12)/n,O=o[r.props.eventKey];if(w-1.5?a({dragNode:J,dropNode:Z,dropPosition:1})?te=1:Q=!1:a({dragNode:J,dropNode:Z,dropPosition:0})?te=0:a({dragNode:J,dropNode:Z,dropPosition:1})?te=1:Q=!1:a({dragNode:J,dropNode:Z,dropPosition:1})?te=1:Q=!1,{dropPosition:te,dropLevelOffset:Y,dropTargetKey:O.key,dropTargetPos:O.pos,dragOverNodeKey:H,dropContainerKey:te===0?null:((v=O.parent)===null||v===void 0?void 0:v.key)||null,dropAllowed:Q}}function vP(e,t){if(!!e){var r=t.multiple;return r?e.slice():e.length?[e[0]]:e}}function o2(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(ar(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return Fn(!1,"`checkedKeys` is not an array or an object"),null;return t}function RC(e,t){var r=new Set;function n(i){if(!r.has(i)){var a=t[i];if(!!a){r.add(i);var u=a.parent,o=a.node;o.disabled||u&&n(u.key)}}}return(e||[]).forEach(function(i){n(i)}),wt(r)}var hJ=["children"];function yv(e,t){return e!=null?e:t}function n1(e){var t=e||{},r=t.title,n=t._title,i=t.key,a=t.children,u=r||"title";return{title:u,_title:n||[u],key:i||"key",children:a||"children"}}function s9(e){function t(r){var n=lo(r);return n.map(function(i){if(!uJ(i))return Fn(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var a=i.key,u=i.props,o=u.children,f=Pr(u,hJ),p=ve({key:a},f),v=t(o);return v.length&&(p.children=v),p}).filter(function(i){return i})}return t(e)}function a2(e,t,r){var n=n1(r),i=n._title,a=n.key,u=n.children,o=new Set(t===!0?[]:t),f=[];function p(v){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return v.map(function(w,k){for(var T=a9(y?y.pos:"0",k),R=yv(w[a],T),A,I=0;I1&&arguments[1]!==void 0?arguments[1]:{},r=t.initWrapper,n=t.processEntity,i=t.onProcessFinished,a=t.externalGetKey,u=t.childrenPropName,o=t.fieldNames,f=arguments.length>2?arguments[2]:void 0,p=a||f,v={},y={},w={posEntities:v,keyEntities:y};return r&&(w=r(w)||w),pJ(e,function(k){var T=k.node,R=k.index,A=k.pos,I=k.key,O=k.parentPos,N=k.level,L=k.nodes,B={node:T,nodes:L,index:R,key:I,pos:A,level:N},j=yv(I,A);v[A]=B,y[j]=B,B.parent=v[O],B.parent&&(B.parent.children=B.parent.children||[],B.parent.children.push(B)),n&&n(B,w)},{externalGetKey:p,childrenPropName:u,fieldNames:o}),i&&i(w),w}function fm(e,t){var r=t.expandedKeys,n=t.selectedKeys,i=t.loadedKeys,a=t.loadingKeys,u=t.checkedKeys,o=t.halfCheckedKeys,f=t.dragOverNodeKey,p=t.dropPosition,v=t.keyEntities,y=v[e],w={eventKey:e,expanded:r.indexOf(e)!==-1,selected:n.indexOf(e)!==-1,loaded:i.indexOf(e)!==-1,loading:a.indexOf(e)!==-1,checked:u.indexOf(e)!==-1,halfChecked:o.indexOf(e)!==-1,pos:String(y?y.pos:""),dragOver:f===e&&p===0,dragOverGapTop:f===e&&p===-1,dragOverGapBottom:f===e&&p===1};return w}function Ri(e){var t=e.data,r=e.expanded,n=e.selected,i=e.checked,a=e.loaded,u=e.loading,o=e.halfChecked,f=e.dragOver,p=e.dragOverGapTop,v=e.dragOverGapBottom,y=e.pos,w=e.active,k=e.eventKey,T=ve(ve({},t),{},{expanded:r,selected:n,checked:i,loaded:a,loading:u,halfChecked:o,dragOver:f,dragOverGapTop:p,dragOverGapBottom:v,pos:y,active:w,key:k});return"props"in T||Object.defineProperty(T,"props",{get:function(){return Fn(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),T}var mJ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0&&(i=G().map(function(ne){return E(u9,{prefixCls:le,disabled:"disabled"in ne?ne.disabled:y.disabled,value:ne.value,checked:I.includes(ne.value),onChange:ne.onChange,className:"".concat(J,"-item"),style:ne.style,children:ne.label},ne.value.toString())}));var Q={toggleOption:Y,value:I,disabled:y.disabled,name:y.name,registerValue:te,cancelValue:H},ge=Ye(J,se({},"".concat(J,"-rtl"),T==="rtl"),f);return E("div",{className:ge,style:p,...Z,ref:r,children:E(l9.Provider,{value:Q,children:i})})},gJ=C.exports.forwardRef(vJ);const yJ=C.exports.memo(gJ);var xJ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0){var te=o[0]/2;H.paddingLeft=te,H.paddingRight=te}if(o&&o[1]>0&&!p){var Y=o[1]/2;H.paddingTop=Y,H.paddingBottom=Y}return O&&(H.flex=SJ(O),f===!1&&!H.minWidth&&(H.minWidth=0)),E("div",{...L,style:tt(tt({},H),N),className:G,ref:t,children:I})});const i1=kJ;var TJ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0?Q[0]/-2:void 0,oe=Q[1]!=null&&Q[1]>0?Q[1]/-2:void 0;if(de&&(ne.marginLeft=de,ne.marginRight=de),Y){var ye=Le(Q,2);ne.rowGap=ye[1]}else oe&&(ne.marginTop=oe,ne.marginBottom=oe);var Re=Le(Q,2),Te=Re[0],ke=Re[1],ze=C.exports.useMemo(function(){return{gutter:[Te,ke],wrap:y,supportFlexGap:Y}},[Te,ke,y,Y]);return E(c9.Provider,{value:ze,children:E("div",{...w,className:ge,style:tt(tt({},ne),o),ref:t,children:f})})});const d9=PJ;var f9=C.exports.forwardRef(function(e,t){var r,n=e.prefixCls,i=e.forceRender,a=e.className,u=e.style,o=e.children,f=e.isActive,p=e.role,v=C.exports.useState(f||i),y=Le(v,2),w=y[0],k=y[1];return C.exports.useEffect(function(){(i||f)&&k(!0)},[i,f]),w?E("div",{ref:t,className:Ye("".concat(n,"-content"),(r={},se(r,"".concat(n,"-content-active"),f),se(r,"".concat(n,"-content-inactive"),!f),r),a),style:u,role:p,children:E("div",{className:"".concat(n,"-content-box"),children:o})}):null});f9.displayName="PanelContent";var MJ=["className","id","style","prefixCls","headerClass","children","isActive","destroyInactivePanel","accordion","forceRender","openMotion","extra","collapsible"],h9=function(e){vi(r,e);var t=gi(r);function r(){var n;Yn(this,r);for(var i=arguments.length,a=new Array(i),u=0;u-1;y?p.splice(v,1):p.push(f)}i.setActiveKey(p)},i.getNewChild=function(f,p){if(!f)return null;var v=i.state.activeKey,y=i.props,w=y.prefixCls,k=y.openMotion,T=y.accordion,R=y.destroyInactivePanel,A=y.expandIcon,I=y.collapsible,O=f.key||String(p),N=f.props,L=N.header,B=N.headerClass,j=N.destroyInactivePanel,G=N.collapsible,H=!1;T?H=v[0]===O:H=v.indexOf(O)>-1;var te=G!=null?G:I,Y={key:O,panelKey:O,header:L,headerClass:B,isActive:H,prefixCls:w,destroyInactivePanel:j!=null?j:R,openMotion:k,accordion:T,children:f.props.children,onItemClick:te==="disabled"?null:i.onClickItem,expandIcon:A,collapsible:te};return typeof f.type=="string"?f:(Object.keys(Y).forEach(function(le){typeof Y[le]>"u"&&delete Y[le]}),C.exports.cloneElement(f,Y))},i.getItems=function(){var f=i.props.children;return lo(f).map(i.getNewChild)},i.setActiveKey=function(f){"activeKey"in i.props||i.setState({activeKey:f}),i.props.onChange(i.props.accordion?f[0]:f)};var a=n.activeKey,u=n.defaultActiveKey,o=u;return"activeKey"in n&&(o=a),i.state={activeKey:yP(o)},i}return Qn(r,[{key:"shouldComponentUpdate",value:function(i,a){return!id(this.props,i)||!id(this.state,a)}},{key:"render",value:function(){var i,a=this.props,u=a.prefixCls,o=a.className,f=a.style,p=a.accordion,v=Ye((i={},se(i,u,!0),se(i,o,!!o),i));return E("div",{className:v,style:f,role:p?"tablist":null,children:this.getItems()})}}],[{key:"getDerivedStateFromProps",value:function(i){var a={};return"activeKey"in i&&(a.activeKey=yP(i.activeKey)),a}}]),r}(C.exports.Component);xv.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1};xv.Panel=h9;xv.Panel;var IJ=function(t){var r=C.exports.useContext(Ar),n=r.getPrefixCls,i=t.prefixCls,a=t.className,u=a===void 0?"":a,o=t.showArrow,f=o===void 0?!0:o,p=n("collapse",i),v=Ye(se({},"".concat(p,"-no-arrow"),!f),u);return E(xv.Panel,{...t,prefixCls:p,className:v})};const RJ=IJ;var p9=function(t){var r,n=C.exports.useContext(Ar),i=n.getPrefixCls,a=n.direction,u=t.prefixCls,o=t.className,f=o===void 0?"":o,p=t.bordered,v=p===void 0?!0:p,y=t.ghost,w=t.expandIconPosition,k=w===void 0?"start":w,T=i("collapse",u),R=C.exports.useMemo(function(){return k==="left"?"start":k==="right"?"end":k},[k]),A=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},j=t.expandIcon,G=j?j(B):E(y3,{rotate:B.isActive?90:void 0});return Ni(G,function(){return{className:Ye(G.props.className,"".concat(T,"-arrow"))}})},I=Ye("".concat(T,"-icon-position-").concat(R),(r={},se(r,"".concat(T,"-borderless"),!v),se(r,"".concat(T,"-rtl"),a==="rtl"),se(r,"".concat(T,"-ghost"),!!y),r),f),O=tt(tt({},Um),{motionAppear:!1,leavedClassName:"".concat(T,"-content-hidden")}),N=function(){var B=t.children;return lo(B).map(function(j,G){var H;if(!((H=j.props)===null||H===void 0)&&H.disabled){var te=j.key||String(G),Y=j.props,le=Y.disabled,J=Y.collapsible,Z=tt(tt({},Si(j.props,["disabled"])),{key:te,collapsible:J!=null?J:le?"disabled":void 0});return Ni(j,Z)}return j})};return E(xv,{openMotion:O,...t,expandIcon:A,prefixCls:T,className:I,children:N()})};p9.Panel=RJ;const xP=p9;var m9=C.exports.createContext(null),_P=[];function OJ(e,t){var r=C.exports.useState(function(){if(!Lo())return null;var T=document.createElement("div");return T}),n=Le(r,1),i=n[0],a=C.exports.useRef(!1),u=C.exports.useContext(m9),o=C.exports.useState(_P),f=Le(o,2),p=f[0],v=f[1],y=u||(a.current?void 0:function(T){v(function(R){var A=[T].concat(wt(R));return A})});function w(){i.parentElement||document.body.appendChild(i),a.current=!0}function k(){var T;(T=i.parentElement)===null||T===void 0||T.removeChild(i),a.current=!1}return mi(function(){return e?u?u(w):w():k(),k},[e]),mi(function(){p.length&&(p.forEach(function(T){return T()}),v(_P))},[p]),[i,y]}var s2;function o1(e){if(typeof document>"u")return 0;if(e||s2===void 0){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var r=document.createElement("div"),n=r.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",r.appendChild(t),document.body.appendChild(r);var i=t.offsetWidth;r.style.overflow="scroll";var a=t.offsetWidth;i===a&&(a=r.clientWidth),document.body.removeChild(r),s2=i-a}return s2}function bP(e){var t=e.match(/^(.*)px$/),r=Number(t==null?void 0:t[1]);return Number.isNaN(r)?o1():r}function wP(e){if(typeof document>"u"||!e||!(e instanceof Element))return{width:0,height:0};var t=getComputedStyle(e,"::-webkit-scrollbar"),r=t.width,n=t.height;return{width:bP(r),height:bP(n)}}function AJ(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var NJ="rc-util-locker-".concat(Date.now()),CP=0;function zJ(e){var t=!!e,r=C.exports.useState(function(){return CP+=1,"".concat(NJ,"_").concat(CP)}),n=Le(r,1),i=n[0];mi(function(){if(t){var a=o1(),u=AJ();cv(` html body { overflow-y: hidden; `.concat(u?"width: calc(100% - ".concat(a,"px);"):"",` }`),i)}else sT(i);return function(){sT(i)}},[t,i])}var SP=!1;function DJ(e){return typeof e=="boolean"&&(SP=e),SP}var EP=function(t){return t===!1?!1:!Lo()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},LJ=C.exports.forwardRef(function(e,t){var r=e.open,n=e.autoLock,i=e.getContainer;e.debug;var a=e.autoDestroy,u=a===void 0?!0:a,o=e.children,f=C.exports.useState(r),p=Le(f,2),v=p[0],y=p[1],w=v||r;C.exports.useEffect(function(){(u||r)&&y(r)},[r,u]);var k=C.exports.useState(function(){return EP(i)}),T=Le(k,2),R=T[0],A=T[1];C.exports.useEffect(function(){var le=EP(i);A(le!=null?le:null)});var I=OJ(w&&!R),O=Le(I,2),N=O[0],L=O[1],B=R!=null?R:N;zJ(n&&r&&Lo()&&(B===N||B===document.body));var j=null;if(o&&fd(o)&&t){var G=o;j=G.ref}var H=H7(j,t);if(!w||!Lo()||R===void 0)return null;var te=B===!1||DJ(),Y=o;return t&&(Y=C.exports.cloneElement(o,{ref:H})),E(m9.Provider,{value:L,children:te?Y:Zu.exports.createPortal(Y,B)})});function a1(e){var t=C.exports.useState(e),r=Le(t,2),n=r[0],i=r[1];return C.exports.useEffect(function(){var a=setTimeout(function(){i(e)},e.length?0:10);return function(){clearTimeout(a)}},[e]),n}var kP=[];function l2(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof e=="string"?e:"".concat(r,"-").concat(n),error:e,errorStatus:t}}function v9(e){var t=e.help,r=e.helpStatus,n=e.errors,i=n===void 0?kP:n,a=e.warnings,u=a===void 0?kP:a,o=e.className,f=e.fieldId,p=e.onVisibleChanged,v=C.exports.useContext(u3),y=v.prefixCls,w=C.exports.useContext(Ar),k=w.getPrefixCls,T="".concat(y,"-item-explain"),R=k(),A=a1(i),I=a1(u),O=C.exports.useMemo(function(){return t!=null?[l2(t,r,"help")]:[].concat(wt(A.map(function(L,B){return l2(L,"error","error",B)})),wt(I.map(function(L,B){return l2(L,"warning","warning",B)})))},[t,r,A,I]),N={};return f&&(N.id="".concat(f,"_help")),E(Ga,{motionDeadline:Um.motionDeadline,motionName:"".concat(R,"-show-help"),visible:!!O.length,onVisibleChanged:p,children:function(L){var B=L.className,j=L.style;return E("div",{...N,className:Ye(T,B,o),style:j,role:"alert",children:E(HO,{keys:O,...Um,motionName:"".concat(R,"-show-help-item"),component:!1,children:function(G){var H=G.key,te=G.error,Y=G.errorStatus,le=G.className,J=G.style;return E("div",{className:Ye(le,se({},"".concat(T,"-").concat(Y),Y)),style:J,children:te},H)}})})}})}function TP(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function PP(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function u2(e,t){if(e.clientHeightt||a>e&&u=t&&o>=r?a-e-n:u>t&&or?u-t+i:0}var MP=function(e,t){var r=window,n=t.scrollMode,i=t.block,a=t.inline,u=t.boundary,o=t.skipOverflowHiddenElements,f=typeof u=="function"?u:function(Pt){return Pt!==u};if(!TP(e))throw new TypeError("Invalid target");for(var p,v,y=document.scrollingElement||document.documentElement,w=[],k=e;TP(k)&&f(k);){if((k=(v=(p=k).parentElement)==null?p.getRootNode().host||null:v)===y){w.push(k);break}k!=null&&k===document.body&&u2(k)&&!u2(document.documentElement)||k!=null&&u2(k,o)&&w.push(k)}for(var T=r.visualViewport?r.visualViewport.width:innerWidth,R=r.visualViewport?r.visualViewport.height:innerHeight,A=window.scrollX||pageXOffset,I=window.scrollY||pageYOffset,O=e.getBoundingClientRect(),N=O.height,L=O.width,B=O.top,j=O.right,G=O.bottom,H=O.left,te=i==="start"||i==="nearest"?B:i==="end"?G:B+N/2,Y=a==="center"?H+L/2:a==="end"?j:H,le=[],J=0;J=0&&H>=0&&G<=R&&j<=T&&B>=de&&G<=ye&&H>=Re&&j<=oe)return le;var Te=getComputedStyle(Z),ke=parseInt(Te.borderLeftWidth,10),ze=parseInt(Te.borderTopWidth,10),Ie=parseInt(Te.borderRightWidth,10),Ne=parseInt(Te.borderBottomWidth,10),De=0,Ve=0,Ge="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-ke-Ie:0,je="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-ze-Ne:0,ct="offsetWidth"in Z?Z.offsetWidth===0?0:ne/Z.offsetWidth:0,pt="offsetHeight"in Z?Z.offsetHeight===0?0:ge/Z.offsetHeight:0;if(y===Z)De=i==="start"?te:i==="end"?te-R:i==="nearest"?Cy(I,I+R,R,ze,Ne,I+te,I+te+N,N):te-R/2,Ve=a==="start"?Y:a==="center"?Y-T/2:a==="end"?Y-T:Cy(A,A+T,T,ke,Ie,A+Y,A+Y+L,L),De=Math.max(0,De+I),Ve=Math.max(0,Ve+A);else{De=i==="start"?te-de-ze:i==="end"?te-ye+Ne+je:i==="nearest"?Cy(de,ye,ge,ze,Ne+je,te,te+N,N):te-(de+ge/2)+je/2,Ve=a==="start"?Y-Re-ke:a==="center"?Y-(Re+ne/2)+Ge/2:a==="end"?Y-oe+Ie+Ge:Cy(Re,oe,ne,ke,Ie+Ge,Y,Y+L,L);var Tt=Z.scrollLeft,Xe=Z.scrollTop;te+=Xe-(De=Math.max(0,Math.min(Xe+De/pt,Z.scrollHeight-ge/pt+je))),Y+=Tt-(Ve=Math.max(0,Math.min(Tt+Ve/ct,Z.scrollWidth-ne/ct+Ge)))}le.push({el:Z,top:De,left:Ve})}return le};function g9(e){return e===Object(e)&&Object.keys(e).length!==0}function FJ(e,t){t===void 0&&(t="auto");var r="scrollBehavior"in document.body.style;e.forEach(function(n){var i=n.el,a=n.top,u=n.left;i.scroll&&r?i.scroll({top:a,left:u,behavior:t}):(i.scrollTop=a,i.scrollLeft=u)})}function $J(e){return e===!1?{block:"end",inline:"nearest"}:g9(e)?e:{block:"start",inline:"nearest"}}function BJ(e,t){var r=e.isConnected||e.ownerDocument.documentElement.contains(e);if(g9(t)&&typeof t.behavior=="function")return t.behavior(r?MP(e,t):[]);if(!!r){var n=$J(t);return FJ(MP(e,n),n.behavior)}}var VJ=["parentNode"],jJ="form_item";function hm(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function y9(e,t){if(!!e.length){var r=e.join("_");if(t)return"".concat(t,"_").concat(r);var n=VJ.includes(r);return n?"".concat(jJ,"_").concat(r):r}}function IP(e){var t=hm(e);return t.join("_")}function x9(e){var t=LS(),r=Le(t,1),n=r[0],i=C.exports.useRef({}),a=C.exports.useMemo(function(){return e!=null?e:tt(tt({},n),{__INTERNAL__:{itemRef:function(o){return function(f){var p=IP(o);f?i.current[p]=f:delete i.current[p]}}},scrollToField:function(o){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=hm(o),v=y9(p,a.__INTERNAL__.name),y=v?document.getElementById(v):null;y&&BJ(y,tt({scrollMode:"if-needed",block:"nearest"},f))},getFieldInstance:function(o){var f=IP(o);return i.current[f]}})},[e,n]);return[a]}var UJ=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0||Ne.length>0||e.extra){var Dt=[];(e.help||Ie.length>0)&&Dt.push("".concat(Xe,"_help")),e.extra&&Dt.push("".concat(Xe,"_extra")),Ct["aria-describedby"]=Dt.join(" ")}Ie.length>0&&(Ct["aria-invalid"]="true"),Pt&&(Ct["aria-required"]="true"),fd(o)&&(Ct.ref=De(Tt,o));var lt=new Set([].concat(wt(hm(w)),wt(hm(G))));lt.forEach(function(ut){Ct[ut]=function(){for(var it,ft,xt,Wt,jt,Qt=arguments.length,Fe=new Array(Qt),qe=0;qe"u"||e===null?"":String(e)}var Ree=function(t){var r=t.inputElement,n=t.prefixCls,i=t.prefix,a=t.suffix,u=t.addonBefore,o=t.addonAfter,f=t.className,p=t.style,v=t.affixWrapperClassName,y=t.groupClassName,w=t.wrapperClassName,k=t.disabled,T=t.readOnly,R=t.focused,A=t.triggerFocus,I=t.allowClear,O=t.value,N=t.handleReset,L=t.hidden,B=C.exports.useRef(null),j=function(oe){var ye;(ye=B.current)!==null&&ye!==void 0&&ye.contains(oe.target)&&(A==null||A())},G=function(){var oe;if(!I)return null;var ye=!k&&!T&&O,Re="".concat(n,"-clear-icon"),Te=ar(I)==="object"&&I!==null&&I!==void 0&&I.clearIcon?I.clearIcon:"\u2716";return E("span",{onClick:N,onMouseDown:function(ze){return ze.preventDefault()},className:Ye(Re,(oe={},se(oe,"".concat(Re,"-hidden"),!ye),se(oe,"".concat(Re,"-has-suffix"),!!a),oe)),role:"button",tabIndex:-1,children:Te})},H=C.exports.cloneElement(r,{value:O,hidden:L});if(E9(t)){var te,Y="".concat(n,"-affix-wrapper"),le=Ye(Y,(te={},se(te,"".concat(Y,"-disabled"),k),se(te,"".concat(Y,"-focused"),R),se(te,"".concat(Y,"-readonly"),T),se(te,"".concat(Y,"-input-with-clear-btn"),a&&I&&O),te),!t0(t)&&f,v),J=(a||I)&&Qe("span",{className:"".concat(n,"-suffix"),children:[G(),a]});H=Qe("span",{className:le,style:p,hidden:!t0(t)&&L,onClick:j,ref:B,children:[i&&E("span",{className:"".concat(n,"-prefix"),children:i}),C.exports.cloneElement(r,{style:null,value:O,hidden:null}),J]})}if(t0(t)){var Z="".concat(n,"-group"),Q="".concat(Z,"-addon"),ge=Ye("".concat(n,"-wrapper"),Z,w),ne=Ye("".concat(n,"-group-wrapper"),f,y);return E("span",{className:ne,style:p,hidden:L,children:Qe("span",{className:ge,children:[u&&E("span",{className:Q,children:u}),C.exports.cloneElement(H,{style:null,hidden:null}),o&&E("span",{className:Q,children:o})]})})}return H},Oee=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],Aee=C.exports.forwardRef(function(e,t){var r=e.autoComplete,n=e.onChange,i=e.onFocus,a=e.onBlur,u=e.onPressEnter,o=e.onKeyDown,f=e.prefixCls,p=f===void 0?"rc-input":f,v=e.disabled,y=e.htmlSize,w=e.className,k=e.maxLength,T=e.suffix,R=e.showCount,A=e.type,I=A===void 0?"text":A,O=e.inputClassName,N=Pr(e,Oee),L=Yi(e.defaultValue,{value:e.value}),B=Le(L,2),j=B[0],G=B[1],H=C.exports.useState(!1),te=Le(H,2),Y=te[0],le=te[1],J=C.exports.useRef(null),Z=function(ke){J.current&&Iee(J.current,ke)};C.exports.useImperativeHandle(t,function(){return{focus:Z,blur:function(){var ke;(ke=J.current)===null||ke===void 0||ke.blur()},setSelectionRange:function(ke,ze,Ie){var Ne;(Ne=J.current)===null||Ne===void 0||Ne.setSelectionRange(ke,ze,Ie)},select:function(){var ke;(ke=J.current)===null||ke===void 0||ke.select()},input:J.current}}),C.exports.useEffect(function(){le(function(Te){return Te&&v?!1:Te})},[v]);var Q=function(ke){e.value===void 0&&G(ke.target.value),J.current&&LP(J.current,ke,n)},ge=function(ke){u&&ke.key==="Enter"&&u(ke),o==null||o(ke)},ne=function(ke){le(!0),i==null||i(ke)},de=function(ke){le(!1),a==null||a(ke)},oe=function(ke){G(""),Z(),J.current&&LP(J.current,ke,n)},ye=function(){var ke=Si(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]);return E("input",{autoComplete:r,...ke,onChange:Q,onFocus:ne,onBlur:de,onKeyDown:ge,className:Ye(p,se({},"".concat(p,"-disabled"),v),O,!t0(e)&&!E9(e)&&w),ref:J,size:y,type:I})},Re=function(){var ke=Number(k)>0;if(T||R){var ze=FP(j),Ie=wt(ze).length,Ne=ar(R)==="object"?R.formatter({value:ze,count:Ie,maxLength:k}):"".concat(Ie).concat(ke?" / ".concat(k):"");return Qe(Fr,{children:[!!R&&E("span",{className:Ye("".concat(p,"-show-count-suffix"),se({},"".concat(p,"-show-count-has-suffix"),!!T)),children:Ne}),T]})}return null};return E(Ree,{...N,prefixCls:p,className:w,inputElement:ye(),handleReset:oe,value:FP(j),focused:Y,triggerFocus:Z,suffix:Re(),disabled:v})});function k9(e,t){var r=C.exports.useRef([]),n=function(){r.current.push(setTimeout(function(){var a,u,o,f;((a=e.current)===null||a===void 0?void 0:a.input)&&((u=e.current)===null||u===void 0?void 0:u.input.getAttribute("type"))==="password"&&((o=e.current)===null||o===void 0?void 0:o.input.hasAttribute("value"))&&((f=e.current)===null||f===void 0||f.input.removeAttribute("value"))}))};return C.exports.useEffect(function(){return t&&n(),function(){return r.current.forEach(function(i){i&&clearTimeout(i)})}},[]),n}function Nee(e){return!!(e.prefix||e.suffix||e.allowClear)}var zee=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i"u"||e===null?"":String(e)}function c2(e,t,r,n){if(!!r){var i=t;if(t.type==="click"){var a=e.cloneNode(!0);i=Object.create(t,{target:{value:a},currentTarget:{value:a}}),a.value="",r(i);return}if(n!==void 0){i=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=n,r(i);return}r(i)}}function Lee(e,t){if(!!e){e.focus(t);var r=t||{},n=r.cursor;if(n){var i=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(i,i);break;default:e.setSelectionRange(0,i);break}}}}var Fee=C.exports.forwardRef(function(e,t){var r,n,i,a=e.prefixCls,u=e.bordered,o=u===void 0?!0:u,f=e.status,p=e.size,v=e.disabled,y=e.onBlur,w=e.onFocus,k=e.suffix,T=e.allowClear,R=e.addonAfter,A=e.addonBefore,I=e.className,O=e.onChange,N=zee(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","onChange"]),L=en.useContext(Ar),B=L.getPrefixCls,j=L.direction,G=L.input,H=B("input",a),te=C.exports.useRef(null),Y=ch(H,j),le=Y.compactSize,J=Y.compactItemClassnames,Z=en.useContext(qs),Q=le||p||Z,ge=en.useContext(ec),ne=v!=null?v:ge,de=C.exports.useContext(ya),oe=de.status,ye=de.hasFeedback,Re=de.feedbackIcon,Te=hv(oe,f),ke=Nee(e)||!!ye,ze=C.exports.useRef(ke);C.exports.useEffect(function(){ke&&ze.current,ze.current=ke},[ke]);var Ie=k9(te,!0),Ne=function(pt){Ie(),y==null||y(pt)},De=function(pt){Ie(),w==null||w(pt)},Ve=function(pt){Ie(),O==null||O(pt)},Ge=(ye||k)&&Qe(Fr,{children:[k,ye&&Re]}),je;return ar(T)==="object"&&(T==null?void 0:T.clearIcon)?je=T:T&&(je={clearIcon:E(pd,{})}),E(Aee,{ref:ta(t,te),prefixCls:H,autoComplete:G==null?void 0:G.autoComplete,...N,disabled:ne||void 0,onBlur:Ne,onFocus:De,suffix:Ge,allowClear:je,className:Ye(I,J),onChange:Ve,addonAfter:R&&E(Z0,{children:E(bC,{override:!0,status:!0,children:R})}),addonBefore:A&&E(Z0,{children:E(bC,{override:!0,status:!0,children:A})}),inputClassName:Ye((r={},se(r,"".concat(H,"-sm"),Q==="small"),se(r,"".concat(H,"-lg"),Q==="large"),se(r,"".concat(H,"-rtl"),j==="rtl"),se(r,"".concat(H,"-borderless"),!o),r),!ke&&Lu(H,Te)),affixWrapperClassName:Ye((n={},se(n,"".concat(H,"-affix-wrapper-sm"),Q==="small"),se(n,"".concat(H,"-affix-wrapper-lg"),Q==="large"),se(n,"".concat(H,"-affix-wrapper-rtl"),j==="rtl"),se(n,"".concat(H,"-affix-wrapper-borderless"),!o),n),Lu("".concat(H,"-affix-wrapper"),Te,ye)),wrapperClassName:Ye(se({},"".concat(H,"-group-rtl"),j==="rtl")),groupClassName:Ye((i={},se(i,"".concat(H,"-group-wrapper-sm"),Q==="small"),se(i,"".concat(H,"-group-wrapper-lg"),Q==="large"),se(i,"".concat(H,"-group-wrapper-rtl"),j==="rtl"),i),Lu("".concat(H,"-group-wrapper"),Te,ye))})});const M3=Fee;var $ee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"};const Bee=$ee;var T9=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:Bee})})};T9.displayName="EyeInvisibleOutlined";const Vee=C.exports.forwardRef(T9);var jee=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:!1,r=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&d2[r])return d2[r];var n=window.getComputedStyle(e),i=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),a=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),u=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),o=Yee.map(function(p){return"".concat(p,":").concat(n.getPropertyValue(p))}).join(";"),f={sizingStyle:o,paddingSize:a,borderSize:u,boxSizing:i};return t&&r&&(d2[r]=f),f}function Jee(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Na||(Na=document.createElement("textarea"),Na.setAttribute("tab-index","-1"),Na.setAttribute("aria-hidden","true"),document.body.appendChild(Na)),e.getAttribute("wrap")?Na.setAttribute("wrap",e.getAttribute("wrap")):Na.removeAttribute("wrap");var i=Qee(e,t),a=i.paddingSize,u=i.borderSize,o=i.boxSizing,f=i.sizingStyle;Na.setAttribute("style","".concat(f,";").concat(Xee)),Na.value=e.value||e.placeholder||"";var p=void 0,v=void 0,y,w=Na.scrollHeight;if(o==="border-box"?w+=u:o==="content-box"&&(w-=a),r!==null||n!==null){Na.value=" ";var k=Na.scrollHeight-a;r!==null&&(p=k*r,o==="border-box"&&(p=p+a+u),w=Math.max(p,w)),n!==null&&(v=k*n,o==="border-box"&&(v=v+a+u),y=w>v?"":"hidden",w=Math.min(v,w))}var T={height:w,overflowY:y,resize:"none"};return p&&(T.minHeight=p),v&&(T.maxHeight=v),T}var ete=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],f2=0,h2=1,p2=2,tte=C.exports.forwardRef(function(e,t){var r=e.prefixCls,n=r===void 0?"rc-textarea":r;e.onPressEnter;var i=e.defaultValue,a=e.value,u=e.autoSize,o=e.onResize,f=e.className,p=e.style,v=e.disabled,y=e.onChange;e.onInternalAutoSize;var w=Pr(e,ete),k=Yi(i,{value:a,postState:function(Ie){return Ie!=null?Ie:""}}),T=Le(k,2),R=T[0],A=T[1],I=function(Ie){A(Ie.target.value),y==null||y(Ie)},O=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{textArea:O.current}});var N=C.exports.useMemo(function(){return u&&ar(u)==="object"?[u.minRows,u.maxRows]:[]},[u]),L=Le(N,2),B=L[0],j=L[1],G=!!u,H=function(){try{if(document.activeElement===O.current){var Ie=O.current,Ne=Ie.selectionStart,De=Ie.selectionEnd,Ve=Ie.scrollTop;O.current.setSelectionRange(Ne,De),O.current.scrollTop=Ve}}catch{}},te=C.exports.useState(p2),Y=Le(te,2),le=Y[0],J=Y[1],Z=C.exports.useState(),Q=Le(Z,2),ge=Q[0],ne=Q[1],de=function(){J(f2)};mi(function(){G&&de()},[a,B,j,G]),mi(function(){if(le===f2)J(h2);else if(le===h2){var ze=Jee(O.current,!1,B,j);J(p2),ne(ze)}else H()},[le]);var oe=C.exports.useRef(),ye=function(){tn.cancel(oe.current)},Re=function(Ie){le===p2&&(o==null||o(Ie),u&&(ye(),oe.current=tn(function(){de()})))};C.exports.useEffect(function(){return ye},[]);var Te=G?ge:null,ke=ve(ve({},p),Te);return(le===f2||le===h2)&&(ke.overflowY="hidden",ke.overflowX="hidden"),E(Bl,{onResize:Re,disabled:!(u||o),children:E("textarea",{...w,ref:O,style:ke,className:Ye(n,f,se({},"".concat(n,"-disabled"),v)),disabled:v,value:R,onChange:I})})}),rte=function(e){vi(r,e);var t=gi(r);function r(n){var i;Yn(this,r),i=t.call(this,n),i.resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(u){i.resizableTextArea=u},i.handleChange=function(u){var o=i.props.onChange;i.setValue(u.target.value),o&&o(u)},i.handleKeyDown=function(u){var o=i.props,f=o.onPressEnter,p=o.onKeyDown;u.keyCode===13&&f&&f(u),p&&p(u)};var a=typeof n.value>"u"||n.value===null?n.defaultValue:n.value;return i.state={value:a},i}return Qn(r,[{key:"setValue",value:function(i,a){"value"in this.props||this.setState({value:i},a)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return E(tte,{...this.props,value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea})}}],[{key:"getDerivedStateFromProps",value:function(i){return"value"in i?{value:i.value}:null}}]),r}(C.exports.Component),nte=Sa("text","input");function ite(e){return!!(e.addonBefore||e.addonAfter)}var ote=function(e){vi(r,e);var t=gi(r);function r(){return Yn(this,r),t.apply(this,arguments)}return Qn(r,[{key:"renderClearIcon",value:function(i){var a,u=this.props,o=u.value,f=u.disabled,p=u.readOnly,v=u.handleReset,y=u.suffix,w=!f&&!p&&o,k="".concat(i,"-clear-icon");return E(pd,{onClick:v,onMouseDown:function(R){return R.preventDefault()},className:Ye((a={},se(a,"".concat(k,"-hidden"),!w),se(a,"".concat(k,"-has-suffix"),!!y),a),k),role:"button"})}},{key:"renderTextAreaWithClearIcon",value:function(i,a,u){var o,f=this.props,p=f.value,v=f.allowClear,y=f.className,w=f.style,k=f.direction,T=f.bordered,R=f.hidden,A=f.status,I=u.status,O=u.hasFeedback;if(!v)return Ni(a,{value:p});var N=Ye("".concat(i,"-affix-wrapper"),"".concat(i,"-affix-wrapper-textarea-with-clear-btn"),Lu("".concat(i,"-affix-wrapper"),hv(I,A),O),(o={},se(o,"".concat(i,"-affix-wrapper-rtl"),k==="rtl"),se(o,"".concat(i,"-affix-wrapper-borderless"),!T),se(o,"".concat(y),!ite(this.props)&&y),o));return Qe("span",{className:N,style:w,hidden:R,children:[Ni(a,{style:null,value:p}),this.renderClearIcon(i)]})}},{key:"render",value:function(){var i=this;return E(ya.Consumer,{children:function(a){var u=i.props,o=u.prefixCls,f=u.inputType,p=u.element;if(f===nte[0])return i.renderTextAreaWithClearIcon(o,p,a)}})}}]),r}(C.exports.Component);const ate=ote;var ste=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);in&&(i=t),i}var lte=C.exports.forwardRef(function(e,t){var r,n=e.prefixCls,i=e.bordered,a=i===void 0?!0:i,u=e.showCount,o=u===void 0?!1:u,f=e.maxLength,p=e.className,v=e.style,y=e.size,w=e.disabled,k=e.onCompositionStart,T=e.onCompositionEnd,R=e.onChange,A=e.status,I=ste(e,["prefixCls","bordered","showCount","maxLength","className","style","size","disabled","onCompositionStart","onCompositionEnd","onChange","status"]),O=C.exports.useContext(Ar),N=O.getPrefixCls,L=O.direction,B=C.exports.useContext(qs),j=C.exports.useContext(ec),G=w!=null?w:j,H=C.exports.useContext(ya),te=H.status,Y=H.hasFeedback,le=H.isFormItemInput,J=H.feedbackIcon,Z=hv(te,A),Q=C.exports.useRef(null),ge=C.exports.useRef(null),ne=C.exports.useState(!1),de=Le(ne,2),oe=de[0],ye=de[1],Re=C.exports.useRef(),Te=C.exports.useRef(0),ke=Yi(I.defaultValue,{value:I.value}),ze=Le(ke,2),Ie=ze[0],Ne=ze[1],De=I.hidden,Ve=function(ut,it){I.value===void 0&&(Ne(ut),it==null||it())},Ge=Number(f)>0,je=function(ut){ye(!0),Re.current=Ie,Te.current=ut.currentTarget.selectionStart,k==null||k(ut)},ct=function(ut){var it;ye(!1);var ft=ut.currentTarget.value;if(Ge){var xt=Te.current>=f+1||Te.current===((it=Re.current)===null||it===void 0?void 0:it.length);ft=$P(xt,Re.current,ft,f)}ft!==Ie&&(Ve(ft),c2(ut.currentTarget,ut,R,ft)),T==null||T(ut)},pt=function(ut){var it=ut.target.value;if(!oe&&Ge){var ft=ut.target.selectionStart>=f+1||ut.target.selectionStart===it.length||!ut.target.selectionStart;it=$P(ft,Ie,it,f)}Ve(it),c2(ut.currentTarget,ut,R,it)},Tt=function(ut){var it,ft,xt;Ve(""),(it=Q.current)===null||it===void 0||it.focus(),c2((xt=(ft=Q.current)===null||ft===void 0?void 0:ft.resizableTextArea)===null||xt===void 0?void 0:xt.textArea,ut,R)},Xe=N("input",n);C.exports.useImperativeHandle(t,function(){var dt;return{resizableTextArea:(dt=Q.current)===null||dt===void 0?void 0:dt.resizableTextArea,focus:function(it){var ft,xt;Lee((xt=(ft=Q.current)===null||ft===void 0?void 0:ft.resizableTextArea)===null||xt===void 0?void 0:xt.textArea,it)},blur:function(){var it;return(it=Q.current)===null||it===void 0?void 0:it.blur()}}});var Pt=E(rte,{...Si(I,["allowClear"]),disabled:G,className:Ye((r={},se(r,"".concat(Xe,"-borderless"),!a),se(r,p,p&&!o),se(r,"".concat(Xe,"-sm"),B==="small"||y==="small"),se(r,"".concat(Xe,"-lg"),B==="large"||y==="large"),r),Lu(Xe,Z)),style:o?{resize:v==null?void 0:v.resize}:v,prefixCls:Xe,onCompositionStart:je,onChange:pt,onCompositionEnd:ct,ref:Q}),mt=Dee(Ie);!oe&&Ge&&(I.value===null||I.value===void 0)&&(mt=P9(mt,f));var It=E(ate,{disabled:G,...I,prefixCls:Xe,direction:L,inputType:"text",value:mt,element:Pt,handleReset:Tt,ref:ge,bordered:a,status:A,style:o?void 0:v});if(o||Y){var Ct,Dt=wt(mt).length,lt="";return ar(o)==="object"?lt=o.formatter({value:mt,count:Dt,maxLength:f}):lt="".concat(Dt).concat(Ge?" / ".concat(f):""),Qe("div",{hidden:De,className:Ye("".concat(Xe,"-textarea"),(Ct={},se(Ct,"".concat(Xe,"-textarea-rtl"),L==="rtl"),se(Ct,"".concat(Xe,"-textarea-show-count"),o),se(Ct,"".concat(Xe,"-textarea-in-form-item"),le),Ct),Lu("".concat(Xe,"-textarea"),Z,Y),p),style:v,"data-count":lt,children:[It,Y&&E("span",{className:"".concat(Xe,"-textarea-suffix"),children:J})]})}return It});const M9=lte;var _v=M3;_v.Group=Mee;_v.Search=Zee;_v.TextArea=M9;_v.Password=Wee;const Tu=_v;var ute={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"};const cte=ute;var I9=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:cte})})};I9.displayName="DoubleLeftOutlined";const dte=C.exports.forwardRef(I9);var fte={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"};const hte=fte;var R9=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:hte})})};R9.displayName="DoubleRightOutlined";const pte=C.exports.forwardRef(R9);var zp=function(t){var r,n="".concat(t.rootPrefixCls,"-item"),i=Ye(n,"".concat(n,"-").concat(t.page),(r={},se(r,"".concat(n,"-active"),t.active),se(r,"".concat(n,"-disabled"),!t.page),se(r,t.className,!!t.className),r)),a=function(){t.onClick(t.page)},u=function(f){t.onKeyPress(f,t.onClick,t.page)};return E("li",{title:t.showTitle?t.page:null,className:i,onClick:a,onKeyPress:u,tabIndex:"0",children:t.itemRender(t.page,"page",E("a",{rel:"nofollow",children:t.page}))})};const zc={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};var O9=function(e){vi(r,e);var t=gi(r);function r(){var n;Yn(this,r);for(var i=arguments.length,a=new Array(i),u=0;u=0||o.relatedTarget.className.indexOf("".concat(y,"-item"))>=0))&&v(n.getValidValue()))},n.go=function(o){var f=n.state.goInputText;f!==""&&(o.keyCode===zc.ENTER||o.type==="click")&&(n.setState({goInputText:""}),n.props.quickGo(n.getValidValue()))},n}return Qn(r,[{key:"getValidValue",value:function(){var i=this.state.goInputText;return!i||isNaN(i)?void 0:Number(i)}},{key:"getPageSizeOptions",value:function(){var i=this.props,a=i.pageSize,u=i.pageSizeOptions;return u.some(function(o){return o.toString()===a.toString()})?u:u.concat([a.toString()]).sort(function(o,f){var p=isNaN(Number(o))?0:Number(o),v=isNaN(Number(f))?0:Number(f);return p-v})}},{key:"render",value:function(){var i=this,a=this.props,u=a.pageSize,o=a.locale,f=a.rootPrefixCls,p=a.changeSize,v=a.quickGo,y=a.goButton,w=a.selectComponentClass,k=a.buildOptionText,T=a.selectPrefixCls,R=a.disabled,A=this.state.goInputText,I="".concat(f,"-options"),O=w,N=null,L=null,B=null;if(!p&&!v)return null;var j=this.getPageSizeOptions();if(p&&O){var G=j.map(function(H,te){return E(O.Option,{value:H.toString(),children:(k||i.buildOptionText)(H)},te)});N=E(O,{disabled:R,prefixCls:T,showSearch:!1,className:"".concat(I,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(u||j[0]).toString(),onChange:this.changeSize,getPopupContainer:function(te){return te.parentNode},"aria-label":o.page_size,defaultOpen:!1,children:G})}return v&&(y&&(B=typeof y=="boolean"?E("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:R,className:"".concat(I,"-quick-jumper-button"),children:o.jump_to_confirm}):E("span",{onClick:this.go,onKeyUp:this.go,children:y})),L=Qe("div",{className:"".concat(I,"-quick-jumper"),children:[o.jump_to,E("input",{disabled:R,type:"text",value:A,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":o.page}),o.page,B]})),Qe("li",{className:"".concat(I),children:[N,L]})}}]),r}(en.Component);O9.defaultProps={pageSizeOptions:["10","20","50","100"]};const mte={items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875",page_size:"\u9875\u7801"};function OC(){}function BP(e){var t=Number(e);return typeof t=="number"&&!isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function vte(e,t,r){return r}function uu(e,t,r){var n=typeof e>"u"?t.pageSize:e;return Math.floor((r.total-1)/n)+1}var A9=function(e){vi(r,e);var t=gi(r);function r(n){var i;Yn(this,r),i=t.call(this,n),i.getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(uu(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(p,v){var y=i.props.prefixCls,w=p||E("button",{type:"button","aria-label":v,className:"".concat(y,"-item-link")});return typeof p=="function"&&(w=en.createElement(p,ve({},i.props))),w},i.savePaginationNode=function(p){i.paginationNode=p},i.isValid=function(p){var v=i.props.total;return BP(p)&&p!==i.state.current&&BP(v)&&v>0},i.shouldDisplayQuickJumper=function(){var p=i.props,v=p.showQuickJumper,y=p.total,w=i.state.pageSize;return y<=w?!1:v},i.handleKeyDown=function(p){(p.keyCode===zc.ARROW_UP||p.keyCode===zc.ARROW_DOWN)&&p.preventDefault()},i.handleKeyUp=function(p){var v=i.getValidValue(p),y=i.state.currentInputValue;v!==y&&i.setState({currentInputValue:v}),p.keyCode===zc.ENTER?i.handleChange(v):p.keyCode===zc.ARROW_UP?i.handleChange(v-1):p.keyCode===zc.ARROW_DOWN&&i.handleChange(v+1)},i.handleBlur=function(p){var v=i.getValidValue(p);i.handleChange(v)},i.changePageSize=function(p){var v=i.state.current,y=uu(p,i.state,i.props);v=v>y?y:v,y===0&&(v=i.state.current),typeof p=="number"&&("pageSize"in i.props||i.setState({pageSize:p}),"current"in i.props||i.setState({current:v,currentInputValue:v})),i.props.onShowSizeChange(v,p),"onChange"in i.props&&i.props.onChange&&i.props.onChange(v,p)},i.handleChange=function(p){var v=i.props,y=v.disabled,w=v.onChange,k=i.state,T=k.pageSize,R=k.current,A=k.currentInputValue;if(i.isValid(p)&&!y){var I=uu(void 0,i.state,i.props),O=p;return p>I?O=I:p<1&&(O=1),"current"in i.props||i.setState({current:O}),O!==A&&i.setState({currentInputValue:O}),w(O,T),O}return R},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current2?y-2:0),k=2;k=u?f=u:f=Number(a),f}},{key:"getShowSizeChanger",value:function(){var i=this.props,a=i.showSizeChanger,u=i.total,o=i.totalBoundaryShowSizeChanger;return typeof a<"u"?a:u>o}},{key:"renderPrev",value:function(i){var a=this.props,u=a.prevIcon,o=a.itemRender,f=o(i,"prev",this.getItemIcon(u,"prev page")),p=!this.hasPrev();return C.exports.isValidElement(f)?C.exports.cloneElement(f,{disabled:p}):f}},{key:"renderNext",value:function(i){var a=this.props,u=a.nextIcon,o=a.itemRender,f=o(i,"next",this.getItemIcon(u,"next page")),p=!this.hasNext();return C.exports.isValidElement(f)?C.exports.cloneElement(f,{disabled:p}):f}},{key:"render",value:function(){var i=this,a=this.props,u=a.prefixCls,o=a.className,f=a.style,p=a.disabled,v=a.hideOnSinglePage,y=a.total,w=a.locale,k=a.showQuickJumper,T=a.showLessItems,R=a.showTitle,A=a.showTotal,I=a.simple,O=a.itemRender,N=a.showPrevNextJumpers,L=a.jumpPrevIcon,B=a.jumpNextIcon,j=a.selectComponentClass,G=a.selectPrefixCls,H=a.pageSizeOptions,te=this.state,Y=te.current,le=te.pageSize,J=te.currentInputValue;if(v===!0&&y<=le)return null;var Z=uu(void 0,this.state,this.props),Q=[],ge=null,ne=null,de=null,oe=null,ye=null,Re=k&&k.goButton,Te=T?1:2,ke=Y-1>0?Y-1:0,ze=Y+1y?y:Y*le])});if(I)return Re&&(typeof Re=="boolean"?ye=E("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:w.jump_to_confirm}):ye=E("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:Re}),ye=E("li",{title:R?"".concat(w.jump_to).concat(Y,"/").concat(Z):null,className:"".concat(u,"-simple-pager"),children:ye})),Qe("ul",{className:Ye(u,"".concat(u,"-simple"),se({},"".concat(u,"-disabled"),p),o),style:f,ref:this.savePaginationNode,...Ie,children:[Ne,E("li",{title:R?w.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:Ye("".concat(u,"-prev"),se({},"".concat(u,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev(),children:this.renderPrev(ke)}),Qe("li",{title:R?"".concat(Y,"/").concat(Z):null,className:"".concat(u,"-simple-pager"),children:[E("input",{type:"text",value:J,disabled:p,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:"3"}),E("span",{className:"".concat(u,"-slash"),children:"/"}),Z]}),E("li",{title:R?w.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:Ye("".concat(u,"-next"),se({},"".concat(u,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext(),children:this.renderNext(ze)}),ye]});if(Z<=3+Te*2){var De={locale:w,rootPrefixCls:u,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:R,itemRender:O};Z||Q.push(C.exports.createElement(zp,{...De,key:"noPager",page:1,className:"".concat(u,"-item-disabled")}));for(var Ve=1;Ve<=Z;Ve+=1){var Ge=Y===Ve;Q.push(C.exports.createElement(zp,{...De,key:Ve,page:Ve,active:Ge}))}}else{var je=T?w.prev_3:w.prev_5,ct=T?w.next_3:w.next_5;N&&(ge=E("li",{title:R?je:null,onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:Ye("".concat(u,"-jump-prev"),se({},"".concat(u,"-jump-prev-custom-icon"),!!L)),children:O(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(L,"prev page"))},"prev"),ne=E("li",{title:R?ct:null,tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:Ye("".concat(u,"-jump-next"),se({},"".concat(u,"-jump-next-custom-icon"),!!B)),children:O(this.getJumpNextPage(),"jump-next",this.getItemIcon(B,"next page"))},"next")),oe=E(zp,{locale:w,last:!0,rootPrefixCls:u,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:Z,active:!1,showTitle:R,itemRender:O},Z),de=E(zp,{locale:w,rootPrefixCls:u,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:1,active:!1,showTitle:R,itemRender:O},1);var pt=Math.max(1,Y-Te),Tt=Math.min(Y+Te,Z);Y-1<=Te&&(Tt=1+Te*2),Z-Y<=Te&&(pt=Z-Te*2);for(var Xe=pt;Xe<=Tt;Xe+=1){var Pt=Y===Xe;Q.push(E(zp,{locale:w,rootPrefixCls:u,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:Xe,active:Pt,showTitle:R,itemRender:O},Xe))}Y-1>=Te*2&&Y!==1+2&&(Q[0]=C.exports.cloneElement(Q[0],{className:"".concat(u,"-item-after-jump-prev")}),Q.unshift(ge)),Z-Y>=Te*2&&Y!==Z-2&&(Q[Q.length-1]=C.exports.cloneElement(Q[Q.length-1],{className:"".concat(u,"-item-before-jump-next")}),Q.push(ne)),pt!==1&&Q.unshift(de),Tt!==Z&&Q.push(oe)}var mt=!this.hasPrev()||!Z,It=!this.hasNext()||!Z;return Qe("ul",{className:Ye(u,o,se({},"".concat(u,"-disabled"),p)),style:f,ref:this.savePaginationNode,...Ie,children:[Ne,E("li",{title:R?w.prev_page:null,onClick:this.prev,tabIndex:mt?null:0,onKeyPress:this.runIfEnterPrev,className:Ye("".concat(u,"-prev"),se({},"".concat(u,"-disabled"),mt)),"aria-disabled":mt,children:this.renderPrev(ke)}),Q,E("li",{title:R?w.next_page:null,onClick:this.next,tabIndex:It?null:0,onKeyPress:this.runIfEnterNext,className:Ye("".concat(u,"-next"),se({},"".concat(u,"-disabled"),It)),"aria-disabled":It,children:this.renderNext(ze)}),E(O9,{disabled:p,locale:w,rootPrefixCls:u,selectComponentClass:j,selectPrefixCls:G,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Y,pageSize:le,pageSizeOptions:H,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Re})]})}}],[{key:"getDerivedStateFromProps",value:function(i,a){var u={};if("current"in i&&(u.current=i.current,i.current!==a.current&&(u.currentInputValue=u.current)),"pageSize"in i&&i.pageSize!==a.pageSize){var o=a.current,f=uu(i.pageSize,a,i);o=o>f?f:o,"current"in i||(u.current=o,u.currentInputValue=o),u.pageSize=i.pageSize}return u}}]),r}(en.Component);A9.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:OC,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:OC,locale:mte,style:{},itemRender:vte,totalBoundaryShowSizeChanger:50};var N9=function(t){return E(Nl,{...t,size:"small"})},z9=function(t){return E(Nl,{...t,size:"middle"})};N9.Option=Nl.Option;z9.Option=Nl.Option;var gte=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof R=="number"){var O,N=T[A],L=N+R,B=[];n.forEach(function(Y){B.push(Y.value)}),B.push(e,t),B.push(o(N));var j=R>0?1:-1;I==="unit"?B.push(o(N+j*r)):B.push(o(L)),B=B.filter(function(Y){return Y!==null}).filter(function(Y){return R<0?Y<=N:Y>=N}),I==="unit"&&(B=B.filter(function(Y){return Y!==N}));var G=I==="unit"?N:L;O=B[0];var H=Math.abs(O-G);if(B.forEach(function(Y){var le=Math.abs(Y-G);le1){var te=wt(T);return te[A]=O,k(te,R-j,A,I)}return O}else{if(R==="min")return e;if(R==="max")return t}},v=function(T,R,A){var I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",O=T[A],N=p(T,R,A,I);return{value:N,changed:N!==O}},y=function(T){return a===null&&T===0||typeof a=="number"&&T3&&arguments[3]!==void 0?arguments[3]:"unit",O=T.map(f),N=O[A],L=p(O,R,A,I);if(O[A]=L,i===!1){var B=a||0;A>0&&O[A-1]!==N&&(O[A]=Math.max(O[A],O[A-1]+B)),A0;te-=1)for(var Y=!0;y(O[te]-O[te-1])&&Y;){var le=v(O,-1,te-1);O[te-1]=le.value,Y=le.changed}for(var J=O.length-1;J>0;J-=1)for(var Z=!0;y(O[J]-O[J-1])&&Z;){var Q=v(O,-1,J-1);O[J-1]=Q.value,Z=Q.changed}for(var ge=0;ge=0?J:!1},[J,Ct]),lt=C.exports.useMemo(function(){var me=Object.keys(Ie||{});return me.map(function(K){var q=Ie[K],ce={value:Number(K)};return q&&ar(q)==="object"&&!C.exports.isValidElement(q)&&("label"in q||"style"in q)?(ce.style=q.style,ce.label=q.label):ce.label=q,ce}).filter(function(K){var q=K.label;return q||typeof q=="number"}).sort(function(K,q){return K.value-q.value})},[Ie]),dt=mre(mt,It,Ct,lt,Y,Dt),ut=Le(dt,2),it=ut[0],ft=ut[1],xt=Yi(N,{value:O}),Wt=Le(xt,2),jt=Wt[0],Qt=Wt[1],Fe=C.exports.useMemo(function(){var me=jt==null?[]:Array.isArray(jt)?jt:[jt],K=Le(me,1),q=K[0],ce=q===void 0?mt:q,ae=jt===null?[]:[ce];if(L){if(ae=wt(me),B||jt===void 0){var xe=B>=0?B+1:2;for(ae=ae.slice(0,xe);ae.length=0&&Tt.current.focus(me)}_t(null)},[Rr]);var or=C.exports.useMemo(function(){return Z&&Ct===null?!1:Z},[Z,Ct]),Lr=function(){H==null||H(Xt(qe.current))},Er=lre(Xe,Pt,Fe,mt,It,it,cr,Lr,ft),Lt=Le(Er,4),kr=Lt[0],wr=Lt[1],fr=Lt[2],Nt=Lt[3],ot=function(K,q){Nt(K,q),G==null||G(Xt(qe.current))},ht=kr!==-1;C.exports.useEffect(function(){if(!ht){var me=Fe.lastIndexOf(wr);Tt.current.focus(me)}},[ht]);var Ot=C.exports.useMemo(function(){return wt(fr).sort(function(me,K){return me-K})},[fr]),$t=C.exports.useMemo(function(){return L?[Ot[0],Ot[Ot.length-1]]:[mt,Ot[0]]},[Ot,L,mt]),ur=Le($t,2),Mr=ur[0],Wr=ur[1];C.exports.useImperativeHandle(t,function(){return{focus:function(){Tt.current.focus(0)},blur:function(){var K=document,q=K.activeElement;Xe.current.contains(q)&&(q==null||q.blur())}}}),C.exports.useEffect(function(){p&&Tt.current.focus(0)},[]);var qr=C.exports.useMemo(function(){return{min:mt,max:It,direction:Pt,disabled:f,step:Ct,included:de,includedStart:Mr,includedEnd:Wr,range:L,tabIndex:Ge,ariaLabelForHandle:je,ariaLabelledByForHandle:ct,ariaValueTextFormatterForHandle:pt}},[mt,It,Pt,f,Ct,de,Mr,Wr,L,Ge,je,ct,pt]);return E(md.Provider,{value:qr,children:Qe("div",{ref:Xe,className:Ye(i,a,(r={},se(r,"".concat(i,"-disabled"),f),se(r,"".concat(i,"-vertical"),ge),se(r,"".concat(i,"-horizontal"),!ge),se(r,"".concat(i,"-with-marks"),lt.length),r)),style:u,onMouseDown:Ut,children:[E("div",{className:"".concat(i,"-rail"),style:Te}),E(cre,{prefixCls:i,style:ye,values:Ot,startPoint:oe,onStartMove:or?ot:null}),E(pre,{prefixCls:i,marks:lt,dots:Ne,style:ke,activeStyle:ze}),E(sre,{ref:Tt,prefixCls:i,style:Re,values:fr,draggingIndex:kr,onStartMove:ot,onOffsetChange:qt,onFocus:v,onBlur:y,handleRender:De}),E(fre,{prefixCls:i,marks:lt,onClick:Vt})]})})}),gre=C.exports.forwardRef(function(e,t){var r=e.open,n=C.exports.useRef(null),i=C.exports.useRef(null);function a(){tn.cancel(i.current),i.current=null}function u(){i.current=tn(function(){var o;(o=n.current)===null||o===void 0||o.forcePopupAlign(),i.current=null})}return C.exports.useEffect(function(){return r?u():a(),a},[r,e.title]),E(yo,{ref:ta(n,t),...e})});const yre=gre;var xre=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=r}function Mre(e){return e&&ar(e)==="object"&&!Array.isArray(e)&&!C.exports.isValidElement(e)}function Ire(e){return typeof e=="string"?!0:fd(e)}var Rre=function(t){var r=t.ellipsis,n=t.rowType,i=t.children,a,u=r===!0?{showTitle:!0}:r;return u&&(u.showTitle||n==="header")&&(typeof i=="string"||typeof i=="number"?a=i.toString():C.exports.isValidElement(i)&&typeof i.props.children=="string"&&(a=i.props.children)),a};function Ore(e,t){var r,n,i,a=e.prefixCls,u=e.className,o=e.record,f=e.index,p=e.renderIndex,v=e.dataIndex,y=e.render,w=e.children,k=e.component,T=k===void 0?"td":k,R=e.colSpan,A=e.rowSpan,I=e.fixLeft,O=e.fixRight,N=e.firstFixLeft,L=e.lastFixLeft,B=e.firstFixRight,j=e.lastFixRight,G=e.appendNode,H=e.additionalProps,te=H===void 0?{}:H,Y=e.ellipsis,le=e.align,J=e.rowType,Z=e.isSticky,Q=e.hovering,ge=e.onHover,ne="".concat(a,"-cell"),de=C.exports.useContext(Y9),oe=C.exports.useContext(Z9),ye=C.exports.useContext(Cx),Re=ye.allColumnsFixedLeft,Te=C.exports.useMemo(function(){if(zC(w))return[w];var it=G9(o,v),ft=it,xt=void 0;if(y){var Wt=y(it,o,p);Mre(Wt)?(ft=Wt.children,xt=Wt.props,de.renderWithProps=!0):ft=Wt}return[ft,xt]},[de.renderWithProps?Math.random():0,w,v,de,o,y,p]),ke=Le(Te,2),ze=ke[0],Ie=ke[1],Ne=ze;ar(Ne)==="object"&&!Array.isArray(Ne)&&!C.exports.isValidElement(Ne)&&(Ne=null),Y&&(L||B)&&(Ne=E("span",{className:"".concat(ne,"-content"),children:Ne}));var De=Ie||{},Ve=De.colSpan,Ge=De.rowSpan,je=De.style,ct=De.className,pt=Pr(De,Tre),Tt=(r=Ve!==void 0?Ve:R)!==null&&r!==void 0?r:1,Xe=(n=Ge!==void 0?Ge:A)!==null&&n!==void 0?n:1;if(Tt===0||Xe===0)return null;var Pt={},mt=typeof I=="number"&&oe,It=typeof O=="number"&&oe;mt&&(Pt.position="sticky",Pt.left=I),It&&(Pt.position="sticky",Pt.right=O);var Ct={};le&&(Ct.textAlign=le);var Dt=function(ft){var xt;o&&ge(f,f+Xe-1),te==null||(xt=te.onMouseEnter)===null||xt===void 0||xt.call(te,ft)},lt=function(ft){var xt;o&&ge(-1,-1),te==null||(xt=te.onMouseLeave)===null||xt===void 0||xt.call(te,ft)},dt=Rre({rowType:J,ellipsis:Y,children:ze}),ut=ve(ve(ve({title:dt},pt),te),{},{colSpan:Tt!==1?Tt:null,rowSpan:Xe!==1?Xe:null,className:Ye(ne,u,(i={},se(i,"".concat(ne,"-fix-left"),mt&&oe),se(i,"".concat(ne,"-fix-left-first"),N&&oe),se(i,"".concat(ne,"-fix-left-last"),L&&oe),se(i,"".concat(ne,"-fix-left-all"),L&&Re&&oe),se(i,"".concat(ne,"-fix-right"),It&&oe),se(i,"".concat(ne,"-fix-right-first"),B&&oe),se(i,"".concat(ne,"-fix-right-last"),j&&oe),se(i,"".concat(ne,"-ellipsis"),Y),se(i,"".concat(ne,"-with-append"),G),se(i,"".concat(ne,"-fix-sticky"),(mt||It)&&Z&&oe),se(i,"".concat(ne,"-row-hover"),!Ie&&Q),i),te.className,ct),style:ve(ve(ve(ve({},te.style),Ct),Pt),je),onMouseEnter:Dt,onMouseLeave:lt,ref:Ire(T)?t:null});return Qe(T,{...ut,children:[G,Ne]})}var Q9=C.exports.forwardRef(Ore);Q9.displayName="Cell";var Are=["expanded","className","hovering"],Nre=C.exports.memo(Q9,function(e,t){return t.shouldCellUpdate?Are.every(function(r){return e[r]===t[r]})&&!t.shouldCellUpdate(t.record,e.record):id(e,t)}),Cv=C.exports.forwardRef(function(e,t){var r=e.index,n=e.additionalProps,i=n===void 0?{}:n,a=e.colSpan,u=e.rowSpan,o=i.colSpan,f=i.rowSpan,p=a!=null?a:o,v=u!=null?u:f,y=kre(X9,function(T){var R=Pre(r,v||1,T==null?void 0:T.startRow,T==null?void 0:T.endRow);return{onHover:T==null?void 0:T.onHover,hovering:R}}),w=y.onHover,k=y.hovering;return E(Nre,{...e,colSpan:p,rowSpan:v,hovering:k,ref:t,onHover:w})});Cv.displayName="WrappedCell";var Xs=C.exports.createContext(null);function O3(e,t,r,n,i){var a=r[e]||{},u=r[t]||{},o,f;a.fixed==="left"?o=n.left[e]:u.fixed==="right"&&(f=n.right[t]);var p=!1,v=!1,y=!1,w=!1,k=r[t+1],T=r[e-1];if(i==="rtl"){if(o!==void 0){var R=T&&T.fixed==="left";w=!R}else if(f!==void 0){var A=k&&k.fixed==="right";y=!A}}else if(o!==void 0){var I=k&&k.fixed==="left";p=!I}else if(f!==void 0){var O=T&&T.fixed==="right";v=!O}return{fixLeft:o,fixRight:f,lastFixLeft:p,firstFixRight:v,lastFixRight:y,firstFixLeft:w,isSticky:n.isSticky}}function J9(e){var t=e.cells,r=e.stickyOffsets,n=e.flattenColumns,i=e.rowComponent,a=e.cellComponent,u=e.onHeaderRow,o=e.index,f=C.exports.useContext(Xs),p=f.prefixCls,v=f.direction,y;u&&(y=u(t.map(function(k){return k.column}),o));var w=wx(t.map(function(k){return k.column}));return E(i,{...y,children:t.map(function(k,T){var R=k.column,A=O3(k.colStart,k.colEnd,n,r,v),I;return R&&R.onHeaderCell&&(I=k.column.onHeaderCell(R)),C.exports.createElement(Cv,{...k,ellipsis:R.ellipsis,align:R.align,component:a,prefixCls:p,key:w[T],...A,additionalProps:I,rowType:"header"})})})}J9.displayName="HeaderRow";function zre(e){var t=[];function r(u,o){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[f]=t[f]||[];var p=o,v=u.filter(Boolean).map(function(y){var w={key:y.key,className:y.className||"",children:y.title,column:y,colStart:p},k=1,T=y.children;return T&&T.length>0&&(k=r(T,p,f+1).reduce(function(R,A){return R+A},0),w.hasSubColumns=!0),"colSpan"in y&&(k=y.colSpan),"rowSpan"in y&&(w.rowSpan=y.rowSpan),w.colSpan=k,w.colEnd=w.colStart+k-1,t[f].push(w),p+=k,k});return v}r(e,0);for(var n=t.length,i=function(o){t[o].forEach(function(f){!("rowSpan"in f)&&!f.hasSubColumns&&(f.rowSpan=n-o)})},a=0;a1?mt-1:0),Ct=1;Ct0?[].concat(wt(t),wt(DC(a).map(function(u){return ve({fixed:i},u)}))):[].concat(wt(t),[ve(ve({},r),{},{fixed:i})])},[])}function Kre(e){return e.map(function(t){var r=t.fixed,n=Pr(t,Ure),i=r;return r==="left"?i="right":r==="right"&&(i="left"),ve({fixed:i},n)})}function Hre(e,t){var r=e.prefixCls,n=e.columns,i=e.children,a=e.expandable,u=e.expandedKeys,o=e.columnTitle,f=e.getRowKey,p=e.onTriggerExpand,v=e.expandIcon,y=e.rowExpandable,w=e.expandIconColumnIndex,k=e.direction,T=e.expandRowByClick,R=e.columnWidth,A=e.fixed,I=C.exports.useMemo(function(){return n||A3(i)},[n,i]),O=C.exports.useMemo(function(){if(a){var B,j=I.slice();if(!j.includes(Dc)){var G=w||0;G>=0&&j.splice(G,0,Dc)}var H=j.indexOf(Dc);j=j.filter(function(J,Z){return J!==Dc||Z===H});var te=I[H],Y;(A==="left"||A)&&!w?Y="left":(A==="right"||A)&&w===I.length?Y="right":Y=te?te.fixed:null;var le=(B={},se(B,pm,{className:"".concat(r,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),se(B,"title",o),se(B,"fixed",Y),se(B,"className","".concat(r,"-row-expand-icon-cell")),se(B,"width",R),se(B,"render",function(Z,Q,ge){var ne=f(Q,ge),de=u.has(ne),oe=y?y(Q):!0,ye=v({prefixCls:r,expanded:de,expandable:oe,record:Q,onExpand:p});return T?E("span",{onClick:function(Te){return Te.stopPropagation()},children:ye}):ye}),B);return j.map(function(J){return J===Dc?le:J})}return I.filter(function(J){return J!==Dc})},[a,I,f,u,v,k]),N=C.exports.useMemo(function(){var B=O;return t&&(B=t(B)),B.length||(B=[{render:function(){return null}}]),B},[t,O,k]),L=C.exports.useMemo(function(){return k==="rtl"?Kre(DC(N)):DC(N)},[N,k]);return[N,L]}function az(e){var t=C.exports.useRef(e),r=C.exports.useState({}),n=Le(r,2),i=n[1],a=C.exports.useRef(null),u=C.exports.useRef([]);function o(f){u.current.push(f);var p=Promise.resolve();a.current=p,p.then(function(){if(a.current===p){var v=u.current,y=t.current;u.current=[],v.forEach(function(w){t.current=w(t.current)}),a.current=null,y!==t.current&&i({})}})}return C.exports.useEffect(function(){return function(){a.current=null}},[]),[t.current,o]}function Wre(e){var t=C.exports.useRef(e||null),r=C.exports.useRef();function n(){window.clearTimeout(r.current)}function i(u){t.current=u,n(),r.current=window.setTimeout(function(){t.current=null,r.current=void 0},100)}function a(){return t.current}return C.exports.useEffect(function(){return n},[]),[i,a]}function qre(e,t,r){var n=C.exports.useMemo(function(){for(var i=[],a=[],u=0,o=0,f=0;f=0;o-=1){var f=t[o],p=r&&r[o],v=p&&p[pm];if(f||v||u){var y=v||{};y.columnType;var w=Pr(y,Gre);i.unshift(E("col",{style:{width:f},...w},o)),u=!0}}return E("colgroup",{children:i})}function qP(e){var t=e.className,r=e.children;return E("div",{className:t,children:r})}var lz=C.exports.createContext({});function Zre(e){var t=e.className,r=e.index,n=e.children,i=e.colSpan,a=i===void 0?1:i,u=e.rowSpan,o=e.align,f=C.exports.useContext(Xs),p=f.prefixCls,v=f.direction,y=C.exports.useContext(lz),w=y.scrollColumnIndex,k=y.stickyOffsets,T=y.flattenColumns,R=r+a-1,A=R+1===w?a+1:a,I=O3(r,r+A-1,T,k,v);return E(Cv,{className:t,index:r,component:"td",prefixCls:p,record:null,dataIndex:null,align:o,colSpan:A,rowSpan:u,render:function(){return n},...I})}var Xre=["children"];function Yre(e){var t=e.children,r=Pr(e,Xre);return E("tr",{...r,children:t})}function Sx(e){var t=e.children;return t}Sx.Row=Yre;Sx.Cell=Zre;function Sy(e){var t=e.children,r=e.stickyOffsets,n=e.flattenColumns,i=C.exports.useContext(Xs),a=i.prefixCls,u=n.length-1,o=n[u],f=C.exports.useMemo(function(){return{stickyOffsets:r,flattenColumns:n,scrollColumnIndex:o!=null&&o.scrollbar?u:null}},[o,n,u,r]);return E(lz.Provider,{value:f,children:E("tfoot",{className:"".concat(a,"-summary"),children:t})})}var uz=Sx;function Qre(e){var t,r=e.prefixCls,n=e.record,i=e.onExpand,a=e.expanded,u=e.expandable,o="".concat(r,"-row-expand-icon");if(!u)return E("span",{className:Ye(o,"".concat(r,"-row-spaced"))});var f=function(v){i(n,v),v.stopPropagation()};return E("span",{className:Ye(o,(t={},se(t,"".concat(r,"-row-expanded"),a),se(t,"".concat(r,"-row-collapsed"),!a),t)),onClick:f})}function Jre(e,t,r){var n=[];function i(a){(a||[]).forEach(function(u,o){n.push(t(u,o)),i(u[r])})}return i(e),n}var ene=function(t,r){var n,i,a=t.scrollBodyRef,u=t.onScroll,o=t.offsetScroll,f=t.container,p=C.exports.useContext(Xs),v=p.prefixCls,y=((n=a.current)===null||n===void 0?void 0:n.scrollWidth)||0,w=((i=a.current)===null||i===void 0?void 0:i.clientWidth)||0,k=y&&w*(w/y),T=C.exports.useRef(),R=az({scrollLeft:0,isHiddenScrollBar:!1}),A=Le(R,2),I=A[0],O=A[1],N=C.exports.useRef({delta:0,x:0}),L=C.exports.useState(!1),B=Le(L,2),j=B[0],G=B[1],H=function(){G(!1)},te=function(Q){Q.persist(),N.current.delta=Q.pageX-I.scrollLeft,N.current.x=0,G(!0),Q.preventDefault()},Y=function(Q){var ge,ne=Q||((ge=window)===null||ge===void 0?void 0:ge.event),de=ne.buttons;if(!j||de===0){j&&G(!1);return}var oe=N.current.x+Q.pageX-N.current.x-N.current.delta;oe<=0&&(oe=0),oe+k>=w&&(oe=w-k),u({scrollLeft:oe/w*(y+2)}),N.current.x=Q.pageX},le=function(){if(!!a.current){var Q=OP(a.current).top,ge=Q+a.current.offsetHeight,ne=f===window?document.documentElement.scrollTop+window.innerHeight:OP(f).top+f.clientHeight;ge-o1()<=ne||Q>=ne-o?O(function(de){return ve(ve({},de),{},{isHiddenScrollBar:!0})}):O(function(de){return ve(ve({},de),{},{isHiddenScrollBar:!1})})}},J=function(Q){O(function(ge){return ve(ve({},ge),{},{scrollLeft:Q/y*w||0})})};return C.exports.useImperativeHandle(r,function(){return{setScrollLeft:J}}),C.exports.useEffect(function(){var Z=Sl(document.body,"mouseup",H,!1),Q=Sl(document.body,"mousemove",Y,!1);return le(),function(){Z.remove(),Q.remove()}},[k,j]),C.exports.useEffect(function(){var Z=Sl(f,"scroll",le,!1),Q=Sl(window,"resize",le,!1);return function(){Z.remove(),Q.remove()}},[f]),C.exports.useEffect(function(){I.isHiddenScrollBar||O(function(Z){var Q=a.current;return Q?ve(ve({},Z),{},{scrollLeft:Q.scrollLeft/Q.scrollWidth*Q.clientWidth}):Z})},[I.isHiddenScrollBar]),y<=w||!k||I.isHiddenScrollBar?null:E("div",{style:{height:o1(),width:w,bottom:o},className:"".concat(v,"-sticky-scroll"),children:E("div",{onMouseDown:te,ref:T,className:Ye("".concat(v,"-sticky-scroll-bar"),se({},"".concat(v,"-sticky-scroll-bar-active"),j)),style:{width:"".concat(k,"px"),transform:"translate3d(".concat(I.scrollLeft,"px, 0, 0)")}})})};const tne=C.exports.forwardRef(ene);var GP=Lo()?window:null;function rne(e,t){var r=ar(e)==="object"?e:{},n=r.offsetHeader,i=n===void 0?0:n,a=r.offsetSummary,u=a===void 0?0:a,o=r.offsetScroll,f=o===void 0?0:o,p=r.getContainer,v=p===void 0?function(){return GP}:p,y=v()||GP;return C.exports.useMemo(function(){var w=!!e;return{isSticky:w,stickyClassName:w?"".concat(t,"-sticky-holder"):"",offsetHeader:i,offsetSummary:u,offsetScroll:f,container:y}},[f,i,u,t,y])}var nne=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function ine(e,t){return C.exports.useMemo(function(){for(var r=[],n=0;n=0})},[a]),Y=a[a.length-1],le={fixed:Y?Y.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(N,"-cell-scrollbar")}}},J=C.exports.useMemo(function(){return j?[].concat(wt(i),[le]):i},[j,i]),Z=C.exports.useMemo(function(){return j?[].concat(wt(a),[le]):a},[j,a]),Q=C.exports.useMemo(function(){var ne=f.right,de=f.left;return ve(ve({},f),{},{left:p==="rtl"?[].concat(wt(de.map(function(oe){return oe+j})),[0]):de,right:p==="rtl"?ne:[].concat(wt(ne.map(function(oe){return oe+j})),[0]),isSticky:B})},[j,f,B]),ge=ine(u,o);return E("div",{style:ve({overflow:"hidden"},B?{top:y,bottom:w}:{}),ref:H,className:Ye(r,se({},k,!!k)),children:Qe("table",{style:{tableLayout:"fixed",visibility:n||ge?null:"hidden"},children:[(!n||!R||te)&&E(sz,{colWidths:ge?[].concat(wt(ge),[j]):[],columCount:o+1,columns:Z}),A(ve(ve({},I),{},{stickyOffsets:Q,columns:J,flattenColumns:Z}))]})})});LC.displayName="FixedHolder";var one=[],ane={},n0="rc-table-internal-hook",sne=C.exports.memo(function(e){var t=e.children;return t},function(e,t){return id(e.props,t.props)?e.pingLeft!==t.pingLeft||e.pingRight!==t.pingRight:!1});function vd(e){var t,r=e.prefixCls,n=e.className,i=e.rowClassName,a=e.style,u=e.data,o=e.rowKey,f=e.scroll,p=e.tableLayout,v=e.direction,y=e.title,w=e.footer,k=e.summary,T=e.id,R=e.showHeader,A=e.components,I=e.emptyText,O=e.onRow,N=e.onHeaderRow,L=e.internalHooks,B=e.transformColumns,j=e.internalRefs,G=e.sticky,H=u||one,te=!!H.length,Y=C.exports.useCallback(function(Dr,Gr){return G9(A||{},Dr)||Gr},[A]),le=C.exports.useMemo(function(){return typeof o=="function"?o:function(Dr){var Gr=Dr&&Dr[o];return Gr}},[o]),J=Vre(e),Z=J.expandIcon,Q=J.expandedRowKeys,ge=J.defaultExpandedRowKeys,ne=J.defaultExpandAllRows,de=J.expandedRowRender,oe=J.columnTitle,ye=J.onExpand,Re=J.onExpandedRowsChange,Te=J.expandRowByClick,ke=J.rowExpandable,ze=J.expandIconColumnIndex,Ie=J.expandedRowClassName,Ne=J.childrenColumnName,De=J.indentSize,Ve=Z||Qre,Ge=Ne||"children",je=C.exports.useMemo(function(){return de?"row":e.expandable&&L===n0&&e.expandable.__PARENT_RENDER_ICON__||H.some(function(Dr){return Dr&&ar(Dr)==="object"&&Dr[Ge]})?"nest":!1},[!!de,H]),ct=C.exports.useState(function(){return ge||(ne?Jre(H,le,Ge):[])}),pt=Le(ct,2),Tt=pt[0],Xe=pt[1],Pt=C.exports.useMemo(function(){return new Set(Q||Tt||[])},[Q,Tt]),mt=C.exports.useCallback(function(Dr){var Gr=le(Dr,H.indexOf(Dr)),On,Di=Pt.has(Gr);Di?(Pt.delete(Gr),On=wt(Pt)):On=[].concat(wt(Pt),[Gr]),Xe(On),ye&&ye(!Di,Dr),Re&&Re(On)},[le,Pt,H,ye,Re]),It=C.exports.useState(0),Ct=Le(It,2),Dt=Ct[0],lt=Ct[1],dt=Hre(ve(ve(ve({},e),J),{},{expandable:!!de,columnTitle:oe,expandedKeys:Pt,getRowKey:le,onTriggerExpand:mt,expandIcon:Ve,expandIconColumnIndex:ze,direction:v}),L===n0?B:null),ut=Le(dt,2),it=ut[0],ft=ut[1],xt=C.exports.useMemo(function(){return{columns:it,flattenColumns:ft}},[it,ft]),Wt=C.exports.useRef(),jt=C.exports.useRef(),Qt=C.exports.useRef(),Fe=C.exports.useRef(),qe=C.exports.useRef(),Xt=C.exports.useState(!1),cr=Le(Xt,2),Vt=cr[0],Ut=cr[1],rr=C.exports.useState(!1),xr=Le(rr,2),Rr=xr[0],_t=xr[1],qt=az(new Map),or=Le(qt,2),Lr=or[0],Er=or[1],Lt=wx(ft),kr=Lt.map(function(Dr){return Lr.get(Dr)}),wr=C.exports.useMemo(function(){return kr},[kr.join("_")]),fr=qre(wr,ft.length,v),Nt=f&&zC(f.y),ot=f&&zC(f.x)||Boolean(J.fixed),ht=ot&&ft.some(function(Dr){var Gr=Dr.fixed;return Gr}),Ot=C.exports.useRef(),$t=rne(G,r),ur=$t.isSticky,Mr=$t.offsetHeader,Wr=$t.offsetSummary,qr=$t.offsetScroll,me=$t.stickyClassName,K=$t.container,q=k==null?void 0:k(H),ce=(Nt||ur)&&C.exports.isValidElement(q)&&q.type===Sx&&q.props.fixed,ae,xe,Ee;Nt&&(xe={overflowY:"scroll",maxHeight:f.y}),ot&&(ae={overflowX:"auto"},Nt||(xe={overflowY:"hidden"}),Ee={width:(f==null?void 0:f.x)===!0?"auto":f==null?void 0:f.x,minWidth:"100%"});var be=C.exports.useCallback(function(Dr,Gr){r3(Wt.current)&&Er(function(On){if(On.get(Dr)!==Gr){var Di=new Map(On);return Di.set(Dr,Gr),Di}return On})},[]),Ce=Wre(null),Ae=Le(Ce,2),He=Ae[0],We=Ae[1];function Be(Dr,Gr){!Gr||(typeof Gr=="function"?Gr(Dr):Gr.scrollLeft!==Dr&&(Gr.scrollLeft=Dr))}var At=function(Gr){var On=Gr.currentTarget,Di=Gr.scrollLeft,Ss=v==="rtl",Vo=typeof Di=="number"?Di:On.scrollLeft,Js=On||ane;if(!We()||We()===Js){var Qa;He(Js),Be(Vo,jt.current),Be(Vo,Qt.current),Be(Vo,qe.current),Be(Vo,(Qa=Ot.current)===null||Qa===void 0?void 0:Qa.setScrollLeft)}if(On){var yn=On.scrollWidth,Ja=On.clientWidth;if(yn===Ja){Ut(!1),_t(!1);return}Ss?(Ut(-Vo0)):(Ut(Vo>0),_t(Vo-1}var Ine=Mne,Rne=Tx;function One(e,t){var r=this.__data__,n=Rne(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Ane=One,Nne=vne,zne=Sne,Dne=Tne,Lne=Ine,Fne=Ane;function fh(e){var t=-1,r=e==null?0:e.length;for(this.clear();++to))return!1;var p=a.get(e),v=a.get(t);if(p&&v)return p==t&&v==e;var y=-1,w=!0,k=r&iae?new eae:void 0;for(a.set(e,t),a.set(t,e);++y-1&&e%1==0&&e-1&&e%1==0&&e<=fse}var gz=hse,pse=vv,mse=gz,vse=gv,gse="[object Arguments]",yse="[object Array]",xse="[object Boolean]",_se="[object Date]",bse="[object Error]",wse="[object Function]",Cse="[object Map]",Sse="[object Number]",Ese="[object Object]",kse="[object RegExp]",Tse="[object Set]",Pse="[object String]",Mse="[object WeakMap]",Ise="[object ArrayBuffer]",Rse="[object DataView]",Ose="[object Float32Array]",Ase="[object Float64Array]",Nse="[object Int8Array]",zse="[object Int16Array]",Dse="[object Int32Array]",Lse="[object Uint8Array]",Fse="[object Uint8ClampedArray]",$se="[object Uint16Array]",Bse="[object Uint32Array]",Wn={};Wn[Ose]=Wn[Ase]=Wn[Nse]=Wn[zse]=Wn[Dse]=Wn[Lse]=Wn[Fse]=Wn[$se]=Wn[Bse]=!0;Wn[gse]=Wn[yse]=Wn[Ise]=Wn[xse]=Wn[Rse]=Wn[_se]=Wn[bse]=Wn[wse]=Wn[Cse]=Wn[Sse]=Wn[Ese]=Wn[kse]=Wn[Tse]=Wn[Pse]=Wn[Mse]=!1;function Vse(e){return vse(e)&&mse(e.length)&&!!Wn[pse(e)]}var jse=Vse;function Use(e){return function(t){return e(t)}}var Kse=Use,FC={exports:{}};(function(e,t){var r=e9,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,u=a&&r.process,o=function(){try{var f=i&&i.require&&i.require("util").types;return f||u&&u.binding&&u.binding("util")}catch{}}();e.exports=o})(FC,FC.exports);var Hse=jse,Wse=Kse,n8=FC.exports,i8=n8&&n8.isTypedArray,qse=i8?Wse(i8):Hse,yz=qse,Gse=Zae,Zse=ose,Xse=S3,Yse=l1.exports,Qse=dse,Jse=yz,ele=Object.prototype,tle=ele.hasOwnProperty;function rle(e,t){var r=Xse(e),n=!r&&Zse(e),i=!r&&!n&&Yse(e),a=!r&&!n&&!i&&Jse(e),u=r||n||i||a,o=u?Gse(e.length,String):[],f=o.length;for(var p in e)(t||tle.call(e,p))&&!(u&&(p=="length"||i&&(p=="offset"||p=="parent")||a&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||Qse(p,f)))&&o.push(p);return o}var nle=rle,ile=Object.prototype;function ole(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ile;return e===r}var ale=ole;function sle(e,t){return function(r){return e(t(r))}}var lle=sle,ule=lle,cle=ule(Object.keys,Object),dle=cle,fle=ale,hle=dle,ple=Object.prototype,mle=ple.hasOwnProperty;function vle(e){if(!fle(e))return hle(e);var t=[];for(var r in Object(e))mle.call(e,r)&&r!="constructor"&&t.push(r);return t}var gle=vle,yle=fz,xle=gz;function _le(e){return e!=null&&xle(e.length)&&!yle(e)}var ble=_le,wle=nle,Cle=gle,Sle=ble;function Ele(e){return Sle(e)?wle(e):Cle(e)}var kle=Ele,Tle=Lae,Ple=qae,Mle=kle;function Ile(e){return Tle(e,Mle,Ple)}var Rle=Ile,o8=Rle,Ole=1,Ale=Object.prototype,Nle=Ale.hasOwnProperty;function zle(e,t,r,n,i,a){var u=r&Ole,o=o8(e),f=o.length,p=o8(t),v=p.length;if(f!=v&&!u)return!1;for(var y=f;y--;){var w=o[y];if(!(u?w in t:Nle.call(t,w)))return!1}var k=a.get(e),T=a.get(t);if(k&&T)return k==t&&T==e;var R=!0;a.set(e,t),a.set(t,e);for(var A=u;++y0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=e.length,n=t.length;if(Math.abs(r-n)!==1)return{add:!1,key:null};function i(a,u){var o=new Map;a.forEach(function(p){o.set(p,!0)});var f=u.filter(function(p){return!o.has(p)});return f.length===1?f[0]:null}return r ").concat(t);return t}var Sz=C.exports.forwardRef(function(e,t){var r=e.prefixCls,n=e.data;e.selectable,e.checkable;var i=e.expandedKeys,a=e.selectedKeys,u=e.checkedKeys,o=e.loadedKeys,f=e.loadingKeys,p=e.halfCheckedKeys,v=e.keyEntities,y=e.disabled,w=e.dragging,k=e.dragOverNodeKey,T=e.dropPosition,R=e.motion,A=e.height,I=e.itemHeight,O=e.virtual,N=e.focusable,L=e.activeItem,B=e.focused,j=e.tabIndex,G=e.onKeyDown,H=e.onFocus,te=e.onBlur,Y=e.onActiveChange,le=e.onListChangeStart,J=e.onListChangeEnd,Z=Pr(e,bue),Q=C.exports.useRef(null),ge=C.exports.useRef(null);C.exports.useImperativeHandle(t,function(){return{scrollTo:function(ut){Q.current.scrollTo(ut)},getIndentWidth:function(){return ge.current.offsetWidth}}});var ne=C.exports.useState(i),de=Le(ne,2),oe=de[0],ye=de[1],Re=C.exports.useState(n),Te=Le(Re,2),ke=Te[0],ze=Te[1],Ie=C.exports.useState(n),Ne=Le(Ie,2),De=Ne[0],Ve=Ne[1],Ge=C.exports.useState([]),je=Le(Ge,2),ct=je[0],pt=je[1],Tt=C.exports.useState(null),Xe=Le(Tt,2),Pt=Xe[0],mt=Xe[1],It=C.exports.useRef(n);It.current=n;function Ct(){var dt=It.current;ze(dt),Ve(dt),pt([]),mt(null),J()}C.exports.useEffect(function(){ye(i);var dt=_ue(oe,i);if(dt.key!==null)if(dt.add){var ut=ke.findIndex(function(Qt){var Fe=Qt.key;return Fe===dt.key}),it=w8(x8(ke,n,dt.key),O,A,I),ft=ke.slice();ft.splice(ut+1,0,b8),Ve(ft),pt(it),mt("show")}else{var xt=n.findIndex(function(Qt){var Fe=Qt.key;return Fe===dt.key}),Wt=w8(x8(n,ke,dt.key),O,A,I),jt=n.slice();jt.splice(xt+1,0,b8),Ve(jt),pt(Wt),mt("hide")}else ke!==n&&(ze(n),Ve(n))},[i,n]),C.exports.useEffect(function(){w||Ct()},[w]);var Dt=R?De:n,lt={expandedKeys:i,selectedKeys:a,loadedKeys:o,loadingKeys:f,checkedKeys:u,halfCheckedKeys:p,dragOverNodeKey:k,dropPosition:T,keyEntities:v};return Qe(Fr,{children:[B&&L&&E("span",{style:_8,"aria-live":"assertive",children:Cue(L)}),E("div",{children:E("input",{style:_8,disabled:N===!1||y,tabIndex:N!==!1?j:null,onKeyDown:G,onFocus:H,onBlur:te,value:"",onChange:wue,"aria-label":"for screen reader"})}),E("div",{className:"".concat(r,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0},children:E("div",{className:"".concat(r,"-indent"),children:E("div",{ref:ge,className:"".concat(r,"-indent-unit")})})}),E(o3,{...Z,data:Dt,itemKey:C8,height:A,fullHeight:!1,virtual:O,itemHeight:I,prefixCls:"".concat(r,"-list"),ref:Q,onVisibleChange:function(ut,it){var ft=new Set(ut),xt=it.filter(function(Wt){return!ft.has(Wt)});xt.some(function(Wt){return C8(Wt)===sd})&&Ct()},children:function(dt){var ut=dt.pos,it=tt({},(bz(dt.data),dt.data)),ft=dt.title,xt=dt.key,Wt=dt.isStart,jt=dt.isEnd,Qt=yv(xt,ut);delete it.key,delete it.children;var Fe=fm(Qt,lt);return E(xue,{...it,...Fe,title:ft,active:!!L&&xt===L.key,pos:ut,data:dt.data,isStart:Wt,isEnd:jt,motion:R,motionNodes:xt===sd?ct:null,motionType:Pt,onMotionStart:le,onMotionEnd:Ct,treeNodeRequiredProps:lt,onMouseMove:function(){Y(null)}})}})]})});Sz.displayName="NodeList";function Sue(e){var t=e.dropPosition,r=e.dropLevelOffset,n=e.indent,i={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:i.top=0,i.left=-r*n;break;case 1:i.bottom=0,i.left=-r*n;break;case 0:i.bottom=0,i.left=n;break}return E("div",{style:i})}var Eue=10,Rx=function(e){vi(r,e);var t=gi(r);function r(){var n;Yn(this,r);for(var i=arguments.length,a=new Array(i),u=0;u2&&arguments[2]!==void 0?arguments[2]:!1,y=n.state,w=y.dragChildrenKeys,k=y.dropPosition,T=y.dropTargetKey,R=y.dropTargetPos,A=y.dropAllowed;if(!!A){var I=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),T!==null){var O=ve(ve({},fm(T,n.getTreeNodeRequiredProps())),{},{active:((p=n.getActiveItem())===null||p===void 0?void 0:p.key)===T,data:n.state.keyEntities[T].node}),N=w.indexOf(T)!==-1;Fn(!N,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var L=T3(R),B={event:o,node:Ri(O),dragNode:n.dragNode?Ri(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(w),dropToGap:k!==0,dropPosition:k+Number(L[L.length-1])};v||I==null||I(B),n.dragNode=null}}},n.cleanDragState=function(){var o=n.state.draggingNodeKey;o!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(o,f){var p=n.state,v=p.expandedKeys,y=p.flattenNodes,w=f.expanded,k=f.key,T=f.isLeaf;if(!(T||o.shiftKey||o.metaKey||o.ctrlKey)){var R=y.filter(function(I){return I.key===k})[0],A=Ri(ve(ve({},fm(k,n.getTreeNodeRequiredProps())),{},{data:R.data}));n.setExpandedKeys(w?zs(v,k):pl(v,k)),n.onNodeExpand(o,A)}},n.onNodeClick=function(o,f){var p=n.props,v=p.onClick,y=p.expandAction;y==="click"&&n.triggerExpandActionExpand(o,f),v==null||v(o,f)},n.onNodeDoubleClick=function(o,f){var p=n.props,v=p.onDoubleClick,y=p.expandAction;y==="doubleClick"&&n.triggerExpandActionExpand(o,f),v==null||v(o,f)},n.onNodeSelect=function(o,f){var p=n.state.selectedKeys,v=n.state,y=v.keyEntities,w=v.fieldNames,k=n.props,T=k.onSelect,R=k.multiple,A=f.selected,I=f[w.key],O=!A;O?R?p=pl(p,I):p=[I]:p=zs(p,I);var N=p.map(function(L){var B=y[L];return B?B.node:null}).filter(function(L){return L});n.setUncontrolledState({selectedKeys:p}),T==null||T(p,{event:"select",selected:O,node:f,selectedNodes:N,nativeEvent:o.nativeEvent})},n.onNodeCheck=function(o,f,p){var v=n.state,y=v.keyEntities,w=v.checkedKeys,k=v.halfCheckedKeys,T=n.props,R=T.checkStrictly,A=T.onCheck,I=f.key,O,N={event:"check",node:f,checked:p,nativeEvent:o.nativeEvent};if(R){var L=p?pl(w,I):zs(w,I),B=zs(k,I);O={checked:L,halfChecked:B},N.checkedNodes=L.map(function(le){return y[le]}).filter(function(le){return le}).map(function(le){return le.node}),n.setUncontrolledState({checkedKeys:L})}else{var j=kl([].concat(wt(w),[I]),!0,y),G=j.checkedKeys,H=j.halfCheckedKeys;if(!p){var te=new Set(G);te.delete(I);var Y=kl(Array.from(te),{checked:!1,halfCheckedKeys:H},y);G=Y.checkedKeys,H=Y.halfCheckedKeys}O=G,N.checkedNodes=[],N.checkedNodesPositions=[],N.halfCheckedKeys=H,G.forEach(function(le){var J=y[le];if(!!J){var Z=J.node,Q=J.pos;N.checkedNodes.push(Z),N.checkedNodesPositions.push({node:Z,pos:Q})}}),n.setUncontrolledState({checkedKeys:G},!1,{halfCheckedKeys:H})}A==null||A(O,N)},n.onNodeLoad=function(o){var f=o.key,p=new Promise(function(v,y){n.setState(function(w){var k=w.loadedKeys,T=k===void 0?[]:k,R=w.loadingKeys,A=R===void 0?[]:R,I=n.props,O=I.loadData,N=I.onLoad;if(!O||T.indexOf(f)!==-1||A.indexOf(f)!==-1)return null;var L=O(o);return L.then(function(){var B=n.state.loadedKeys,j=pl(B,f);N==null||N(j,{event:"load",node:o}),n.setUncontrolledState({loadedKeys:j}),n.setState(function(G){return{loadingKeys:zs(G.loadingKeys,f)}}),v()}).catch(function(B){if(n.setState(function(G){return{loadingKeys:zs(G.loadingKeys,f)}}),n.loadingRetryTimes[f]=(n.loadingRetryTimes[f]||0)+1,n.loadingRetryTimes[f]>=Eue){var j=n.state.loadedKeys;Fn(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:pl(j,f)}),v()}y(B)}),{loadingKeys:pl(A,f)}})});return p.catch(function(){}),p},n.onNodeMouseEnter=function(o,f){var p=n.props.onMouseEnter;p==null||p({event:o,node:f})},n.onNodeMouseLeave=function(o,f){var p=n.props.onMouseLeave;p==null||p({event:o,node:f})},n.onNodeContextMenu=function(o,f){var p=n.props.onRightClick;p&&(o.preventDefault(),p({event:o,node:f}))},n.onFocus=function(){var o=n.props.onFocus;n.setState({focused:!0});for(var f=arguments.length,p=new Array(f),v=0;v1&&arguments[1]!==void 0?arguments[1]:!1,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var v=!1,y=!0,w={};Object.keys(o).forEach(function(k){if(k in n.props){y=!1;return}v=!0,w[k]=o[k]}),v&&(!f||y)&&n.setState(ve(ve({},w),p))}},n.scrollTo=function(o){n.listRef.current.scrollTo(o)},n}return Qn(r,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var i=this.props.activeKey;i!==void 0&&i!==this.state.activeKey&&(this.setState({activeKey:i}),i!==null&&this.scrollTo({key:i}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var i,a=this.state,u=a.focused,o=a.flattenNodes,f=a.keyEntities,p=a.draggingNodeKey,v=a.activeKey,y=a.dropLevelOffset,w=a.dropContainerKey,k=a.dropTargetKey,T=a.dropPosition,R=a.dragOverNodeKey,A=a.indent,I=this.props,O=I.prefixCls,N=I.className,L=I.style,B=I.showLine,j=I.focusable,G=I.tabIndex,H=G===void 0?0:G,te=I.selectable,Y=I.showIcon,le=I.icon,J=I.switcherIcon,Z=I.draggable,Q=I.checkable,ge=I.checkStrictly,ne=I.disabled,de=I.motion,oe=I.loadData,ye=I.filterTreeNode,Re=I.height,Te=I.itemHeight,ke=I.virtual,ze=I.titleRender,Ie=I.dropIndicatorRender,Ne=I.onContextMenu,De=I.onScroll,Ve=I.direction,Ge=I.rootClassName,je=I.rootStyle,ct=Ku(this.props,{aria:!0,data:!0}),pt;return Z&&(ar(Z)==="object"?pt=Z:typeof Z=="function"?pt={nodeDraggable:Z}:pt={}),E(k3.Provider,{value:{prefixCls:O,selectable:te,showIcon:Y,icon:le,switcherIcon:J,draggable:pt,draggingNodeKey:p,checkable:Q,checkStrictly:ge,disabled:ne,keyEntities:f,dropLevelOffset:y,dropContainerKey:w,dropTargetKey:k,dropPosition:T,dragOverNodeKey:R,indent:A,direction:Ve,dropIndicatorRender:Ie,loadData:oe,filterTreeNode:ye,titleRender:ze,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop},children:E("div",{role:"tree",className:Ye(O,N,Ge,(i={},se(i,"".concat(O,"-show-line"),B),se(i,"".concat(O,"-focused"),u),se(i,"".concat(O,"-active-focused"),v!==null),i)),style:je,children:E(Sz,{ref:this.listRef,prefixCls:O,style:L,data:o,disabled:ne,selectable:te,checkable:!!Q,motion:de,dragging:p!==null,height:Re,itemHeight:Te,virtual:ke,focusable:j,focused:u,tabIndex:H,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Ne,onScroll:De,...this.getTreeNodeRequiredProps(),...ct})})})}}],[{key:"getDerivedStateFromProps",value:function(i,a){var u=a.prevProps,o={prevProps:i};function f(j){return!u&&j in i||u&&u[j]!==i[j]}var p,v=a.fieldNames;if(f("fieldNames")&&(v=n1(i.fieldNames),o.fieldNames=v),f("treeData")?p=i.treeData:f("children")&&(Fn(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),p=s9(i.children)),p){o.treeData=p;var y=_x(p,{fieldNames:v});o.keyEntities=ve(se({},sd,Cz),y.keyEntities)}var w=o.keyEntities||a.keyEntities;if(f("expandedKeys")||u&&f("autoExpandParent"))o.expandedKeys=i.autoExpandParent||!u&&i.defaultExpandParent?RC(i.expandedKeys,w):i.expandedKeys;else if(!u&&i.defaultExpandAll){var k=ve({},w);delete k[sd],o.expandedKeys=Object.keys(k).map(function(j){return k[j].key})}else!u&&i.defaultExpandedKeys&&(o.expandedKeys=i.autoExpandParent||i.defaultExpandParent?RC(i.defaultExpandedKeys,w):i.defaultExpandedKeys);if(o.expandedKeys||delete o.expandedKeys,p||o.expandedKeys){var T=a2(p||a.treeData,o.expandedKeys||a.expandedKeys,v);o.flattenNodes=T}if(i.selectable&&(f("selectedKeys")?o.selectedKeys=vP(i.selectedKeys,i):!u&&i.defaultSelectedKeys&&(o.selectedKeys=vP(i.defaultSelectedKeys,i))),i.checkable){var R;if(f("checkedKeys")?R=o2(i.checkedKeys)||{}:!u&&i.defaultCheckedKeys?R=o2(i.defaultCheckedKeys)||{}:p&&(R=o2(i.checkedKeys)||{checkedKeys:a.checkedKeys,halfCheckedKeys:a.halfCheckedKeys}),R){var A=R,I=A.checkedKeys,O=I===void 0?[]:I,N=A.halfCheckedKeys,L=N===void 0?[]:N;if(!i.checkStrictly){var B=kl(O,!0,w);O=B.checkedKeys,L=B.halfCheckedKeys}o.checkedKeys=O,o.halfCheckedKeys=L}}return f("loadedKeys")&&(o.loadedKeys=i.loadedKeys),o}}]),r}(C.exports.Component);Rx.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:Sue,allowDrop:function(){return!0},expandAction:!1};Rx.TreeNode=od;var kue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};const Tue=kue;var Ez=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:Tue})})};Ez.displayName="HolderOutlined";const Pue=C.exports.forwardRef(Ez);var S8=4;function Mue(e){var t,r=e.dropPosition,n=e.dropLevelOffset,i=e.prefixCls,a=e.indent,u=e.direction,o=u===void 0?"ltr":u,f=o==="ltr"?"left":"right",p=o==="ltr"?"right":"left",v=(t={},se(t,f,-n*a+S8),se(t,p,0),t);switch(r){case-1:v.top=-3;break;case 1:v.bottom=-3;break;default:v.bottom=-3,v[f]=a+S8;break}return E("div",{style:v,className:"".concat(i,"-drop-indicator")})}var Iue={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};const Rue=Iue;var kz=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:Rue})})};kz.displayName="CaretDownFilled";const Oue=C.exports.forwardRef(kz);var Aue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const Nue=Aue;var Tz=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:Nue})})};Tz.displayName="FileOutlined";const Pz=C.exports.forwardRef(Tz);var zue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const Due=zue;var Mz=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:Due})})};Mz.displayName="MinusSquareOutlined";const Lue=C.exports.forwardRef(Mz);var Fue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};const $ue=Fue;var Iz=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:$ue})})};Iz.displayName="PlusSquareOutlined";const Bue=C.exports.forwardRef(Iz);function Rz(e,t,r,n){var i=n.isLeaf,a=n.expanded,u=n.loading;if(u)return E(Bf,{className:"".concat(e,"-switcher-loading-icon")});var o;if(r&&ar(r)==="object"&&(o=r.showLeafIcon),i){if(!r)return null;if(typeof o!="boolean"&&!!o){var f=typeof o=="function"?o(n):o,p="".concat(e,"-switcher-line-custom-icon");return Yo(f)?Ni(f,{className:Ye(f.props.className||"",p)}):f}return o?E(Pz,{className:"".concat(e,"-switcher-line-icon")}):E("span",{className:"".concat(e,"-switcher-leaf-line")})}var v="".concat(e,"-switcher-icon"),y=typeof t=="function"?t(n):t;return Yo(y)?Ni(y,{className:Ye(y.props.className||"",v)}):y||(r?a?E(Lue,{className:"".concat(e,"-switcher-line-icon")}):E(Bue,{className:"".concat(e,"-switcher-line-icon")}):E(Oue,{className:v}))}var Vue=C.exports.forwardRef(function(e,t){var r,n=C.exports.useContext(Ar),i=n.getPrefixCls,a=n.direction,u=n.virtual,o=e.prefixCls,f=e.className,p=e.showIcon,v=p===void 0?!1:p,y=e.showLine,w=e.switcherIcon,k=e.blockNode,T=k===void 0?!1:k,R=e.children,A=e.checkable,I=A===void 0?!1:A,O=e.selectable,N=O===void 0?!0:O,L=e.draggable,B=e.motion,j=B===void 0?tt(tt({},Um),{motionAppear:!1}):B,G=i("tree",o),H=tt(tt({},e),{checkable:I,selectable:N,showIcon:v,motion:j,blockNode:T,showLine:Boolean(y),dropIndicatorRender:Mue}),te=C.exports.useMemo(function(){if(!L)return!1;var Y={};switch(ar(L)){case"function":Y.nodeDraggable=L;break;case"object":Y=tt({},L);break}return Y.icon!==!1&&(Y.icon=Y.icon||E(Pue,{})),Y},[L]);return E(Rx,{itemHeight:20,ref:t,virtual:u,...H,prefixCls:G,className:Ye((r={},se(r,"".concat(G,"-icon-hide"),!v),se(r,"".concat(G,"-block-node"),T),se(r,"".concat(G,"-unselectable"),!N),se(r,"".concat(G,"-rtl"),a==="rtl"),r),f),direction:a,checkable:I&&E("span",{className:"".concat(G,"-checkbox-inner")}),selectable:N,switcherIcon:function(le){return Rz(G,w,y,le)},draggable:te,children:R})});const Oz=Vue;var jue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const Uue=jue;var Az=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:Uue})})};Az.displayName="FolderOpenOutlined";const Kue=C.exports.forwardRef(Az);var Hue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};const Wue=Hue;var Nz=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:Wue})})};Nz.displayName="FolderOutlined";const que=C.exports.forwardRef(Nz);var vl;(function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"})(vl||(vl={}));function z3(e,t){function r(n){var i=n.key,a=n.children;t(i,n)!==!1&&z3(a||[],t)}e.forEach(r)}function Gue(e){var t=e.treeData,r=e.expandedKeys,n=e.startKey,i=e.endKey,a=[],u=vl.None;if(n&&n===i)return[n];if(!n||!i)return[];function o(f){return f===n||f===i}return z3(t,function(f){if(u===vl.End)return!1;if(o(f)){if(a.push(f),u===vl.None)u=vl.Start;else if(u===vl.Start)return u=vl.End,!1}else u===vl.Start&&a.push(f);return r.includes(f)}),a}function y2(e,t){var r=wt(t),n=[];return z3(e,function(i,a){var u=r.indexOf(i);return u!==-1&&(n.push(a),r.splice(u,1)),!!r.length}),n}var E8=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1},Xt=qe.confirm,cr=qe.closeDropdown;Xt&&pt([]),cr&&J(!1),je(""),oe(B?(j||[]).map(function(Vt){return String(Vt)}):[])},Pt=function(){var qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0},Xt=qe.closeDropdown;Xt&&J(!1),pt(de())},mt=function(qe){qe&&Q!==void 0&&oe(Q||[]),J(qe),!qe&&!i.filterDropdown&&Tt()},It=Ye(se({},"".concat(a,"-menu-without-submenu"),!ice(i.filters||[]))),Ct=function(qe){if(qe.target.checked){var Xt=If(i==null?void 0:i.filters).map(function(cr){return String(cr)});oe(Xt)}else oe([])},Dt=function Fe(qe){var Xt=qe.filters;return(Xt||[]).map(function(cr,Vt){var Ut=String(cr.value),rr={title:cr.text,key:cr.value!==void 0?Ut:Vt};return cr.children&&(rr.children=Fe({filters:cr.children})),rr})},lt=function Fe(qe){var Xt;return tt(tt({},qe),{text:qe.title,value:qe.key,children:((Xt=qe.children)===null||Xt===void 0?void 0:Xt.map(function(cr){return Fe(cr)}))||[]})},dt;if(typeof i.filterDropdown=="function")dt=i.filterDropdown({prefixCls:"".concat(a,"-custom"),setSelectedKeys:function(qe){return ye({selectedKeys:qe})},selectedKeys:de(),confirm:Pt,clearFilters:Xe,filters:i.filters,visible:Z,close:function(){J(!1)}});else if(i.filterDropdown)dt=i.filterDropdown;else{var ut=de()||[],it=function(){return(i.filters||[]).length===0?E(Fs,{image:Fs.PRESENTED_IMAGE_SIMPLE,description:T.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):p==="tree"?Qe(Fr,{children:[E(T8,{filterSearch:y,value:Ge,onChange:ct,tablePrefixCls:r,locale:T}),Qe("div",{className:"".concat(r,"-filter-dropdown-tree"),children:[o?E(ad,{checked:ut.length===If(i.filters).length,indeterminate:ut.length>0&&ut.length0?a:e}),w=Math.ceil((a||e)/y.pageSize);y.current>w&&(y.current=w||1);var k=function(A,I){v({current:A!=null?A:1,pageSize:I||y.pageSize})},T=function(A,I){var O;t&&((O=t.onChange)===null||O===void 0||O.call(t,A,I)),k(A,I),r(A,I||(y==null?void 0:y.pageSize))};return t===!1?[{},function(){}]:[tt(tt({},y),{onChange:T}),k]}var hu={},WC="SELECT_ALL",qC="SELECT_INVERT",GC="SELECT_NONE",I8=[];function $z(e,t){var r=[];return(e||[]).forEach(function(n){r.push(n),n&&ar(n)==="object"&&t in n&&(r=[].concat(wt(r),wt($z(n[t],t))))}),r}function fce(e,t){var r=e||{},n=r.preserveSelectedRowKeys,i=r.selectedRowKeys,a=r.defaultSelectedRowKeys,u=r.getCheckboxProps,o=r.onChange,f=r.onSelect,p=r.onSelectAll,v=r.onSelectInvert,y=r.onSelectNone,w=r.onSelectMultiple,k=r.columnWidth,T=r.type,R=r.selections,A=r.fixed,I=r.renderCell,O=r.hideSelectAll,N=r.checkStrictly,L=N===void 0?!0:N,B=t.prefixCls,j=t.data,G=t.pageData,H=t.getRecordByKey,te=t.getRowKey,Y=t.expandType,le=t.childrenColumnName,J=t.locale,Z=t.getPopupContainer,Q=Yi(i||a||I8,{value:i}),ge=Le(Q,2),ne=ge[0],de=ge[1],oe=C.exports.useRef(new Map),ye=C.exports.useCallback(function(lt){if(n){var dt=new Map;lt.forEach(function(ut){var it=H(ut);!it&&oe.current.has(ut)&&(it=oe.current.get(ut)),dt.set(ut,it)}),oe.current=dt}},[H,n]);C.exports.useEffect(function(){ye(ne)},[ne]);var Re=C.exports.useMemo(function(){return L?{keyEntities:null}:_x(j,{externalGetKey:te,childrenPropName:le})},[j,te,L,le]),Te=Re.keyEntities,ke=C.exports.useMemo(function(){return $z(G,le)},[G,le]),ze=C.exports.useMemo(function(){var lt=new Map;return ke.forEach(function(dt,ut){var it=te(dt,ut),ft=(u?u(dt):null)||{};lt.set(it,ft)}),lt},[ke,te,u]),Ie=C.exports.useCallback(function(lt){var dt;return!!(!((dt=ze.get(te(lt)))===null||dt===void 0)&&dt.disabled)},[ze,te]),Ne=C.exports.useMemo(function(){if(L)return[ne||[],[]];var lt=kl(ne,!0,Te,Ie),dt=lt.checkedKeys,ut=lt.halfCheckedKeys;return[dt||[],ut]},[ne,L,Te,Ie]),De=Le(Ne,2),Ve=De[0],Ge=De[1],je=C.exports.useMemo(function(){var lt=T==="radio"?Ve.slice(0,1):Ve;return new Set(lt)},[Ve,T]),ct=C.exports.useMemo(function(){return T==="radio"?new Set:new Set(Ge)},[Ge,T]),pt=C.exports.useState(null),Tt=Le(pt,2),Xe=Tt[0],Pt=Tt[1];C.exports.useEffect(function(){e||de(I8)},[!!e]);var mt=C.exports.useCallback(function(lt,dt){var ut,it;ye(lt),n?(ut=lt,it=lt.map(function(ft){return oe.current.get(ft)})):(ut=[],it=[],lt.forEach(function(ft){var xt=H(ft);xt!==void 0&&(ut.push(ft),it.push(xt))})),de(ut),o==null||o(ut,it,{type:dt})},[de,H,o,n]),It=C.exports.useCallback(function(lt,dt,ut,it){if(f){var ft=ut.map(function(xt){return H(xt)});f(H(lt),dt,ft,it)}mt(ut,"single")},[f,H,mt]),Ct=C.exports.useMemo(function(){if(!R||O)return null;var lt=R===!0?[WC,qC,GC]:R;return lt.map(function(dt){return dt===WC?{key:"all",text:J.selectionAll,onSelect:function(){mt(j.map(function(it,ft){return te(it,ft)}).filter(function(it){var ft=ze.get(it);return!(ft!=null&&ft.disabled)||je.has(it)}),"all")}}:dt===qC?{key:"invert",text:J.selectInvert,onSelect:function(){var it=new Set(je);G.forEach(function(xt,Wt){var jt=te(xt,Wt),Qt=ze.get(jt);Qt!=null&&Qt.disabled||(it.has(jt)?it.delete(jt):it.add(jt))});var ft=Array.from(it);v&&v(ft),mt(ft,"invert")}}:dt===GC?{key:"none",text:J.selectNone,onSelect:function(){y==null||y(),mt(Array.from(je).filter(function(it){var ft=ze.get(it);return ft==null?void 0:ft.disabled}),"none")}}:dt}).map(function(dt){return tt(tt({},dt),{onSelect:function(){for(var it,ft,xt=arguments.length,Wt=new Array(xt),jt=0;jt2&&arguments[2]!==void 0?arguments[2]:!1,Je=tt(tt({},it),Be);bt&&(it.resetPagination(),Je.pagination.current&&(Je.pagination.current=1),v&&v.onChange&&v.onChange(1,Je.pagination.pageSize)),Y&&Y.scrollToFirstRowOnChange!==!1&&Ct.body.current&&Fq(0,{getContainer:function(){return Ct.body.current}}),O==null||O(Je.pagination,Je.filters,Je.sorter,{currentDataSource:M8(XC(Ge,Je.sorterStates,mt),Je.filterStates),action:At})},xt=function(Be,At){ft({sorter:Be,sorterStates:At},"sort",!1)},Wt=_ce({prefixCls:pt,mergedColumns:oe,onSorterChange:xt,sortDirections:le||["ascend","descend"],tableLocale:Ve,showSorterTooltip:Q}),jt=Le(Wt,4),Qt=jt[0],Fe=jt[1],qe=jt[2],Xt=jt[3],cr=C.exports.useMemo(function(){return XC(Ge,Fe,mt)},[Ge,Fe]);it.sorter=Xt(),it.sorterStates=Fe;var Vt=function(Be,At){ft({filters:Be,filterStates:At},"filter",!0)},Ut=ace({prefixCls:pt,locale:Ve,dropdownPrefixCls:Tt,mergedColumns:oe,onFilterChange:Vt,getPopupContainer:N}),rr=Le(Ut,3),xr=rr[0],Rr=rr[1],_t=rr[2],qt=M8(cr,Rr);it.filters=_t,it.filterStates=Rr;var or=C.exports.useMemo(function(){var We={};return Object.keys(_t).forEach(function(Be){_t[Be]!==null&&(We[Be]=_t[Be])}),tt(tt({},qe),{filters:We})},[qe,_t]),Lr=bce(or),Er=Le(Lr,1),Lt=Er[0],kr=function(Be,At){ft({pagination:tt(tt({},it.pagination),{current:Be,pageSize:At})},"paginate")},wr=dce(qt.length,v,kr),fr=Le(wr,2),Nt=fr[0],ot=fr[1];it.pagination=v===!1?{}:uce(v,Nt),it.resetPagination=ot;var ht=C.exports.useMemo(function(){if(v===!1||!Nt.pageSize)return qt;var We=Nt.current,Be=We===void 0?1:We,At=Nt.total,bt=Nt.pageSize,Je=bt===void 0?Fz:bt;return qt.lengthJe?qt.slice((Be-1)*Je,Be*Je):qt:qt.slice((Be-1)*Je,Be*Je)},[!!v,qt,Nt&&Nt.current,Nt&&Nt.pageSize,Nt&&Nt.total]),Ot=fce(y,{prefixCls:pt,data:qt,pageData:ht,getRowKey:Dt,getRecordByKey:ut,expandType:It,childrenColumnName:mt,locale:Ve,getPopupContainer:N}),$t=Le(Ot,2),ur=$t[0],Mr=$t[1],Wr=function(Be,At,bt){var Je;return typeof T=="function"?Je=Ye(T(Be,At,bt)):Je=Ye(T),Ye(se({},"".concat(pt,"-row-selected"),Mr.has(Dt(Be,At))),Je)};Xe.__PARENT_RENDER_ICON__=Xe.expandIcon,Xe.expandIcon=Xe.expandIcon||B||cne(Ve),It==="nest"&&Xe.expandIconColumnIndex===void 0?Xe.expandIconColumnIndex=y?1:0:Xe.expandIconColumnIndex>0&&y&&(Xe.expandIconColumnIndex-=1),typeof Xe.indentSize!="number"&&(Xe.indentSize=typeof te=="number"?te:15);var qr=C.exports.useCallback(function(We){return Lt(ur(xr(Qt(We))))},[Qt,xr,ur]),me,K;if(v!==!1&&(Nt==null?void 0:Nt.total)){var q;Nt.size?q=Nt.size:q=De==="small"||De==="middle"?"small":void 0;var ce=function(Be){return E(xte,{...Nt,className:Ye("".concat(pt,"-pagination ").concat(pt,"-pagination-").concat(Be),Nt.className),size:q})},ae=Ne==="rtl"?"left":"right",xe=Nt.position;if(xe!==null&&Array.isArray(xe)){var Ee=xe.find(function(We){return We.includes("top")}),be=xe.find(function(We){return We.includes("bottom")}),Ce=xe.every(function(We){return"".concat(We)==="none"});!Ee&&!be&&!Ce&&(K=ce(ae)),Ee&&(me=ce(Ee.toLowerCase().replace("top",""))),be&&(K=ce(be.toLowerCase().replace("bottom","")))}else K=ce(ae)}var Ae;typeof L=="boolean"?Ae={spinning:L}:ar(L)==="object"&&(Ae=tt({spinning:!0},L));var He=Ye("".concat(pt,"-wrapper"),se({},"".concat(pt,"-wrapper-rtl"),Ne==="rtl"),i);return E("div",{ref:t,className:He,style:a,children:Qe(I3,{spinning:!1,...Ae,children:[me,E(vd,{...ye,columns:oe,direction:Ne,expandable:Xe,prefixCls:pt,className:Ye((r={},se(r,"".concat(pt,"-middle"),De==="middle"),se(r,"".concat(pt,"-small"),De==="small"),se(r,"".concat(pt,"-bordered"),o),se(r,"".concat(pt,"-empty"),Ge.length===0),r)),data:ht,rowKey:Dt,rowClassName:Wr,emptyText:J&&J.emptyText||(Ie||l3)("Table"),internalHooks:n0,internalRefs:Ct,transformColumns:qr}),K]})})}var Sce=C.exports.forwardRef(Cce),jl=Sce;jl.SELECTION_COLUMN=hu;jl.EXPAND_COLUMN=vd.EXPAND_COLUMN;jl.SELECTION_ALL=WC;jl.SELECTION_INVERT=qC;jl.SELECTION_NONE=GC;jl.Column=lne;jl.ColumnGroup=une;jl.Summary=uz;const Ece=jl;var Kz=C.exports.createContext(null),Hz=C.exports.createContext(null);function kce(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function Tce(e){var t=e||{},r=t.label,n=t.value,i=t.children,a=n||"value";return{_title:r?[r]:["title","label"],value:a,key:a,children:i||"children"}}function YC(e){return!e||e.disabled||e.disableCheckbox||e.checkable===!1}function Pce(e,t){var r=[];function n(i){i.forEach(function(a){var u=a[t.children];u&&(r.push(a[t.value]),n(u))})}return n(e),r}function N8(e){return e==null}var Mce={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Ice=function(t,r){var n=MA(),i=n.prefixCls,a=n.multiple,u=n.searchValue,o=n.toggleOpen,f=n.open,p=n.notFoundContent,v=C.exports.useContext(Hz),y=v.virtual,w=v.listHeight,k=v.listItemHeight,T=v.treeData,R=v.fieldNames,A=v.onSelect,I=v.dropdownMatchSelectWidth,O=v.treeExpandAction,N=C.exports.useContext(Kz),L=N.checkable,B=N.checkedKeys,j=N.halfCheckedKeys,G=N.treeExpandedKeys,H=N.treeDefaultExpandAll,te=N.treeDefaultExpandedKeys,Y=N.onTreeExpand,le=N.treeIcon,J=N.showTreeIcon,Z=N.switcherIcon,Q=N.treeLine,ge=N.treeNodeFilterProp,ne=N.loadData,de=N.treeLoadedKeys,oe=N.treeMotion,ye=N.onTreeLoad,Re=N.keyEntities,Te=C.exports.useRef(),ke=sv(function(){return T},[f,T],function(xt,Wt){return Wt[0]&&xt[1]!==Wt[1]}),ze=C.exports.useMemo(function(){return L?{checked:B,halfChecked:j}:null},[L,B,j]);C.exports.useEffect(function(){if(f&&!a&&B.length){var xt;(xt=Te.current)===null||xt===void 0||xt.scrollTo({key:B[0]})}},[f]);var Ie=String(u).toLowerCase(),Ne=function(Wt){return Ie?String(Wt[ge]).toLowerCase().includes(Ie):!1},De=C.exports.useState(te),Ve=Le(De,2),Ge=Ve[0],je=Ve[1],ct=C.exports.useState(null),pt=Le(ct,2),Tt=pt[0],Xe=pt[1],Pt=C.exports.useMemo(function(){return G?wt(G):u?Tt:Ge},[Ge,Tt,G,u]);C.exports.useEffect(function(){u&&Xe(Pce(T,R))},[u]);var mt=function(Wt){je(Wt),Xe(Wt),Y&&Y(Wt)},It=function(Wt){Wt.preventDefault()},Ct=function(Wt,jt){var Qt=jt.node;L&&YC(Qt)||(A(Qt.key,{selected:!B.includes(Qt.key)}),a||o(!1))},Dt=C.exports.useState(null),lt=Le(Dt,2),dt=lt[0],ut=lt[1],it=Re[dt];if(C.exports.useImperativeHandle(r,function(){var xt;return{scrollTo:(xt=Te.current)===null||xt===void 0?void 0:xt.scrollTo,onKeyDown:function(jt){var Qt,Fe=jt.which;switch(Fe){case Et.UP:case Et.DOWN:case Et.LEFT:case Et.RIGHT:(Qt=Te.current)===null||Qt===void 0||Qt.onKeyDown(jt);break;case Et.ENTER:{if(it){var qe=(it==null?void 0:it.node)||{},Xt=qe.selectable,cr=qe.value;Xt!==!1&&Ct(null,{node:{key:dt},selected:!B.includes(cr)})}break}case Et.ESC:o(!1)}},onKeyUp:function(){}}}),ke.length===0)return E("div",{role:"listbox",className:"".concat(i,"-empty"),onMouseDown:It,children:p});var ft={fieldNames:R};return de&&(ft.loadedKeys=de),Pt&&(ft.expandedKeys=Pt),Qe("div",{onMouseDown:It,children:[it&&f&&E("span",{style:Mce,"aria-live":"assertive",children:it.node.value}),E(Rx,{ref:Te,focusable:!1,prefixCls:"".concat(i,"-tree"),treeData:ke,height:w,itemHeight:k,virtual:y!==!1&&I!==!1,multiple:a,icon:le,showIcon:J,switcherIcon:Z,showLine:Q,loadData:u?null:ne,motion:oe,activeKey:dt,checkable:L,checkStrictly:!0,checkedKeys:ze,selectedKeys:L?[]:B,defaultExpandAll:H,...ft,onActiveChange:ut,onSelect:Ct,onCheck:Ct,onExpand:mt,onLoad:ye,filterTreeNode:Ne,expandAction:O})]})},Wz=C.exports.forwardRef(Ice);Wz.displayName="OptionList";var L3=function(){return null},qz="SHOW_ALL",F3="SHOW_PARENT",Ox="SHOW_CHILD";function z8(e,t,r,n){var i=new Set(e);return t===Ox?e.filter(function(a){var u=r[a];return!(u&&u.children&&u.children.some(function(o){var f=o.node;return i.has(f[n.value])})&&u.children.every(function(o){var f=o.node;return YC(f)||i.has(f[n.value])}))}):t===F3?e.filter(function(a){var u=r[a],o=u?u.parent:null;return!(o&&!YC(o.node)&&i.has(o.key))}):e}var Rce=["children","value"];function Gz(e){return lo(e).map(function(t){if(!C.exports.isValidElement(t)||!t.type)return null;var r=t,n=r.key,i=r.props,a=i.children,u=i.value,o=Pr(i,Rce),f=ve({key:n,value:u},o),p=Gz(a);return p.length&&(f.children=p),f}).filter(function(t){return t})}function QC(e){if(!e)return e;var t=ve({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Fn(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function Oce(e,t,r,n,i,a){var u=null,o=null;function f(){function p(v){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return v.map(function(k,T){var R="".concat(y,"-").concat(T),A=k[a.value],I=r.includes(A),O=p(k[a.children]||[],R,I),N=E(L3,{...k,children:O.map(function(B){return B.node})});if(t===A&&(u=N),I){var L={pos:R,node:N,children:O};return w||o.push(L),L}return null}).filter(function(k){return k})}o||(o=[],p(n),o.sort(function(v,y){var w=v.node.props.value,k=y.node.props.value,T=r.indexOf(w),R=r.indexOf(k);return T-R}))}Object.defineProperty(e,"triggerNode",{get:function(){return Fn(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),f(),u}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return Fn(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),f(),i?o:o.map(function(v){var y=v.node;return y})}})}function Ace(e,t){var r=t.id,n=t.pId,i=t.rootPId,a={},u=[],o=e.map(function(f){var p=ve({},f),v=p[r];return a[v]=p,p.key=p.key||v,p});return o.forEach(function(f){var p=f[n],v=a[p];v&&(v.children=v.children||[],v.children.push(f)),(p===i||!v&&i===null)&&u.push(f)}),u}function Nce(e,t,r){return C.exports.useMemo(function(){return e?r?Ace(e,ve({id:"id",pId:"pId",rootPId:null},r!==!0?r:{})):e:Gz(t)},[t,r,e])}const zce=function(e){var t=C.exports.useRef({valueLabels:new Map});return C.exports.useMemo(function(){var r=t.current.valueLabels,n=new Map,i=e.map(function(a){var u,o=a.value,f=(u=a.label)!==null&&u!==void 0?u:r.get(o);return n.set(o,f),ve(ve({},a),{},{label:f})});return t.current.valueLabels=n,[i]},[e])};function D8(e){var t=C.exports.useRef();t.current=e;var r=C.exports.useCallback(function(){return t.current.apply(t,arguments)},[]);return r}const Dce=function(e,t){return C.exports.useMemo(function(){var r=_x(e,{fieldNames:t,initWrapper:function(i){return ve(ve({},i),{},{valueEntities:new Map})},processEntity:function(i,a){var u=i.node[t.value];a.valueEntities.set(u,i)}});return r},[e,t])},Lce=function(e,t,r,n){return C.exports.useMemo(function(){var i=e.map(function(f){var p=f.value;return p}),a=t.map(function(f){var p=f.value;return p}),u=i.filter(function(f){return!n[f]});if(r){var o=kl(i,!0,n);i=o.checkedKeys,a=o.halfCheckedKeys}return[Array.from(new Set([].concat(wt(u),wt(i)))),a]},[e,t,r,n])},Fce=function(e,t,r){var n=r.treeNodeFilterProp,i=r.filterTreeNode,a=r.fieldNames,u=a.children;return C.exports.useMemo(function(){if(!t||i===!1)return e;var o;if(typeof i=="function")o=i;else{var f=t.toUpperCase();o=function(y,w){var k=w[n];return String(k).toUpperCase().includes(f)}}function p(v){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return v.map(function(w){var k=w[u],T=y||o(t,QC(w)),R=p(k||[],T);return T||R.length?ve(ve({},w),{},se({isLeaf:void 0},u,R)):null}).filter(function(w){return w})}return p(e)},[e,t,u,n,i])};var $ce=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion"];function Bce(e){return!e||ar(e)!=="object"}var Vce=C.exports.forwardRef(function(e,t){var r=e.id,n=e.prefixCls,i=n===void 0?"rc-tree-select":n,a=e.value,u=e.defaultValue,o=e.onChange,f=e.onSelect,p=e.onDeselect,v=e.searchValue,y=e.inputValue,w=e.onSearch,k=e.autoClearSearchValue,T=k===void 0?!0:k,R=e.filterTreeNode,A=e.treeNodeFilterProp,I=A===void 0?"value":A,O=e.showCheckedStrategy,N=O===void 0?Ox:O,L=e.treeNodeLabelProp,B=e.multiple,j=e.treeCheckable,G=e.treeCheckStrictly,H=e.labelInValue,te=e.fieldNames,Y=e.treeDataSimpleMode,le=e.treeData,J=e.children,Z=e.loadData,Q=e.treeLoadedKeys,ge=e.onTreeLoad,ne=e.treeDefaultExpandAll,de=e.treeExpandedKeys,oe=e.treeDefaultExpandedKeys,ye=e.onTreeExpand,Re=e.treeExpandAction,Te=e.virtual,ke=e.listHeight,ze=ke===void 0?200:ke,Ie=e.listItemHeight,Ne=Ie===void 0?20:Ie,De=e.onDropdownVisibleChange,Ve=e.dropdownMatchSelectWidth,Ge=Ve===void 0?!0:Ve,je=e.treeLine,ct=e.treeIcon,pt=e.showTreeIcon,Tt=e.switcherIcon,Xe=e.treeMotion,Pt=Pr(e,$ce),mt=JA(r),It=j&&!G,Ct=j||G,Dt=G||H,lt=Ct||B,dt=Yi(u,{value:a}),ut=Le(dt,2),it=ut[0],ft=ut[1],xt=C.exports.useMemo(function(){return Tce(te)},[JSON.stringify(te)]),Wt=Yi("",{value:v!==void 0?v:y,postState:function(xe){return xe||""}}),jt=Le(Wt,2),Qt=jt[0],Fe=jt[1],qe=function(xe){Fe(xe),w==null||w(xe)},Xt=Nce(le,J,Y),cr=Dce(Xt,xt),Vt=cr.keyEntities,Ut=cr.valueEntities,rr=C.exports.useCallback(function(ae){var xe=[],Ee=[];return ae.forEach(function(be){Ut.has(be)?Ee.push(be):xe.push(be)}),{missingRawValues:xe,existRawValues:Ee}},[Ut]),xr=Fce(Xt,Qt,{fieldNames:xt,treeNodeFilterProp:I,filterTreeNode:R}),Rr=C.exports.useCallback(function(ae){if(ae){if(L)return ae[L];for(var xe=xt._title,Ee=0;Ee"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var y=L8[t.format]||L8.default;window.clipboardData.setData(y,e)}else v.clipboardData.clearData(),v.clipboardData.setData(t.format,e);t.onCopy&&(v.preventDefault(),t.onCopy(v.clipboardData))}),document.body.appendChild(o),a.selectNodeContents(o),u.addRange(a);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");f=!0}catch(v){r&&console.error("unable to copy using execCommand: ",v),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(y){r&&console.error("unable to copy using clipboardData: ",y),r&&console.error("falling back to prompt"),n=ede("message"in t?t.message:Jce),window.prompt(n,e)}}finally{u&&(typeof u.removeRange=="function"?u.removeRange(a):u.removeAllRanges()),o&&document.body.removeChild(o),i()}return f}var rde=tde,nde={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"};const ide=nde;var Qz=function(t,r){return E(un,{...ve(ve({},t),{},{ref:r,icon:ide})})};Qz.displayName="EnterOutlined";const ode=C.exports.forwardRef(Qz);var ade=function(t){var r=t.prefixCls,n=t["aria-label"],i=t.className,a=t.style,u=t.direction,o=t.maxLength,f=t.autoSize,p=f===void 0?!0:f,v=t.value,y=t.onSave,w=t.onCancel,k=t.onEnd,T=t.component,R=t.enterIcon,A=R===void 0?E(ode,{}):R,I=C.exports.useRef(null),O=C.exports.useRef(!1),N=C.exports.useRef(),L=C.exports.useState(v),B=Le(L,2),j=B[0],G=B[1];C.exports.useEffect(function(){G(v)},[v]),C.exports.useEffect(function(){if(I.current&&I.current.resizableTextArea){var de=I.current.resizableTextArea.textArea;de.focus();var oe=de.value.length;de.setSelectionRange(oe,oe)}},[]);var H=function(oe){var ye=oe.target;G(ye.value.replace(/[\n\r]/g,""))},te=function(){O.current=!0},Y=function(){O.current=!1},le=function(oe){var ye=oe.keyCode;O.current||(N.current=ye)},J=function(){y(j.trim())},Z=function(oe){var ye=oe.keyCode,Re=oe.ctrlKey,Te=oe.altKey,ke=oe.metaKey,ze=oe.shiftKey;N.current===ye&&!O.current&&!Re&&!Te&&!ke&&!ze&&(ye===Et.ENTER?(J(),k==null||k()):ye===Et.ESC&&w())},Q=function(){J()},ge=T?"".concat(r,"-").concat(T):"",ne=Ye(r,"".concat(r,"-edit-content"),se({},"".concat(r,"-rtl"),u==="rtl"),i,ge);return Qe("div",{className:ne,style:a,children:[E(M9,{ref:I,maxLength:o,value:j,onChange:H,onKeyDown:le,onKeyUp:Z,onCompositionStart:te,onCompositionEnd:Y,onBlur:Q,"aria-label":n,rows:1,autoSize:p}),A!==null?Ni(A,{className:"".concat(r,"-edit-content-confirm")}):null]})};const sde=ade;function _2(e,t){return C.exports.useMemo(function(){var r=!!e;return[r,tt(tt({},t),r&&ar(e)==="object"?e:null)]},[e])}var lde=function(t,r){var n=C.exports.useRef(!1);C.exports.useEffect(function(){n.current?t():n.current=!0},r)};const ude=lde;var cde=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);it){var p=t-r;return n.push(String(a).slice(0,p)),n}n.push(a),r=f}return e}var hde=0,ky=1,$8=2,b2=3,B8=4,pde=function(t){var r=t.enabledMeasure,n=t.children,i=t.text,a=t.width,u=t.fontSize,o=t.rows,f=t.onEllipsis,p=C.exports.useState([0,0,0]),v=Le(p,2),y=Le(v[0],3),w=y[0],k=y[1],T=y[2],R=v[1],A=C.exports.useState(hde),I=Le(A,2),O=I[0],N=I[1],L=C.exports.useState(0),B=Le(L,2),j=B[0],G=B[1],H=C.exports.useRef(null),te=C.exports.useRef(null),Y=C.exports.useMemo(function(){return lo(i)},[i]),le=C.exports.useMemo(function(){return fde(Y)},[Y]),J=C.exports.useMemo(function(){return!r||O!==b2?n(Y,!1):n(F8(Y,k),k1&&ot,ur=function(Je){var Rt;jt(!0),(Rt=Lt.onExpand)===null||Rt===void 0||Rt.call(Lt,Je)},Mr=C.exports.useState(0),Wr=Le(Mr,2),qr=Wr[0],me=Wr[1],K=C.exports.useState(0),q=Le(K,2),ce=q[0],ae=q[1],xe=function(Je,Rt){var Bt=Je.offsetWidth,vr;me(Bt),ae(parseInt((vr=window.getComputedStyle)===null||vr===void 0?void 0:vr.call(window,Rt).fontSize,10)||0)},Ee=function(Je){var Rt;Xt(Je),qe!==Je&&((Rt=Lt.onEllipsis)===null||Rt===void 0||Rt.call(Lt,Je))};C.exports.useEffect(function(){var bt=B.current;if(Er&&ot&&bt){var Je=$t?bt.offsetHeight"u"||!bt||!ot||!kr)){var Je=new IntersectionObserver(function(){qt(!!bt.offsetParent)});return Je.observe(bt),function(){Je.disconnect()}}},[ot,kr]);var be={};Lt.tooltip===!0?be={title:(r=J.text)!==null&&r!==void 0?r:v}:C.exports.isValidElement(Lt.tooltip)?be={title:Lt.tooltip}:ar(Lt.tooltip)==="object"?be=tt({title:(n=J.text)!==null&&n!==void 0?n:v},Lt.tooltip):be={title:Lt.tooltip};var Ce=C.exports.useMemo(function(){var bt=function(Rt){return["string","number"].includes(ar(Rt))};if(!(!Er||ot)){if(bt(J.text))return J.text;if(bt(v))return v;if(bt(R))return R;if(bt(be.title))return be.title}},[Er,ot,R,be.title,ht]);if(ge)return E(sde,{value:(i=J.text)!==null&&i!==void 0?i:typeof v=="string"?v:"",onSave:Te,onCancel:ke,onEnd:J.onEnd,prefixCls:G,className:u,style:o,direction:N,component:T,maxLength:J.maxLength,autoSize:J.autoSize,enterIcon:J.enterIcon});var Ae=function(){var Je=Lt.expandable,Rt=Lt.symbol;if(!Je)return null;var Bt;return Rt?Bt=Rt:Bt=L.expand,E("a",{className:"".concat(G,"-expand"),onClick:ur,"aria-label":L.expand,children:Bt},"expand")},He=function(){if(!!le){var Je=J.icon,Rt=J.tooltip,Bt=lo(Rt)[0]||L.edit,vr=typeof Bt=="string"?Bt:"";return oe.includes("icon")?E(yo,{title:Rt===!1?"":Bt,children:E(KP,{ref:j,className:"".concat(G,"-edit"),onClick:Re,"aria-label":vr,children:Je||E(Xce,{role:"button"})})},"edit"):null}},We=function(){if(!!Ne){var Je=De.tooltips,Rt=De.icon,Bt=V8(Je),vr=V8(Rt),ir=je?Ty(Bt[1],L.copied):Ty(Bt[0],L.copy),gr=je?L.copied:L.copy,$r=typeof ir=="string"?ir:gr;return E(yo,{title:ir,children:E(KP,{className:Ye("".concat(G,"-copy"),je&&"".concat(G,"-copy-success")),onClick:Pt,"aria-label":$r,children:je?Ty(vr[1],E(cN,{}),!0):Ty(vr[0],E(qce,{}),!0)})},"copy")}},Be=function(Je){return[Je&&Ae(),He(),We()]},At=function(Je){return[Je&&E("span",{"aria-hidden":!0,children:_de},"ellipsis"),Lt.suffix,Be(Je)]};return E(Bl,{onResize:xe,disabled:!kr||ot,children:function(bt){var Je;return E(gde,{tooltipProps:be,enabledEllipsis:kr,isEllipsis:ht,children:E(Jz,{className:Ye((Je={},se(Je,"".concat(G,"-").concat(f),f),se(Je,"".concat(G,"-disabled"),p),se(Je,"".concat(G,"-ellipsis"),Er),se(Je,"".concat(G,"-single-line"),kr&&fr===1),se(Je,"".concat(G,"-ellipsis-single-line"),Ot),se(Je,"".concat(G,"-ellipsis-multiple-line"),$t),Je),u),prefixCls:a,style:tt(tt({},o),{WebkitLineClamp:$t?fr:void 0}),component:T,ref:ta(bt,B,t),direction:N,onClick:oe.includes("text")?Re:void 0,"aria-label":Ce==null?void 0:Ce.toString(),title:R,...H,children:E(mde,{enabledMeasure:kr&&!ot,text:v,rows:fr,width:qr,fontSize:ce,onEllipsis:Ee,children:function(Rt,Bt){var vr=Rt;Rt.length&&Bt&&Ce&&(vr=E("span",{"aria-hidden":!0,children:vr},"show-content"));var ir=xde(e,Qe(Fr,{children:[vr,At(Bt)]}));return ir}})})})}})});const Ax=bde;var wde=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=60&&Math.round(e.h)<=240?n=r?Math.round(e.h)-Py*t:Math.round(e.h)+Py*t:n=r?Math.round(e.h)+Py*t:Math.round(e.h)-Py*t,n<0?n+=360:n>=360&&(n-=360),n}function H8(e,t,r){if(e.h===0&&e.s===0)return e.s;var n;return r?n=e.s-j8*t:t===nD?n=e.s+j8:n=e.s+Lde*t,n>1&&(n=1),r&&t===rD&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function W8(e,t,r){var n;return r?n=e.v+Fde*t:n=e.v-$de*t,n>1&&(n=1),Number(n.toFixed(2))}function JC(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[],n=ps(e),i=rD;i>0;i-=1){var a=U8(n),u=My(ps({h:K8(a,i,!0),s:H8(a,i,!0),v:W8(a,i,!0)}));r.push(u)}r.push(My(n));for(var o=1;o<=nD;o+=1){var f=U8(n),p=My(ps({h:K8(f,o),s:H8(f,o),v:W8(f,o)}));r.push(p)}return t.theme==="dark"?Bde.map(function(v){var y=v.index,w=v.opacity,k=My(Vde(ps(t.backgroundColor||"#141414"),ps(r[y]),w*100));return k}):r}var w2={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},C2={},S2={};Object.keys(w2).forEach(function(e){C2[e]=JC(w2[e]),C2[e].primary=C2[e][5],S2[e]=JC(w2[e],{theme:"dark",backgroundColor:"#141414"}),S2[e].primary=S2[e][5]});function jde(e,t){Fn(e,"[@ant-design/icons] ".concat(t))}function q8(e){return ar(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(ar(e.icon)==="object"||typeof e.icon=="function")}function G8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,r){var n=e[r];switch(r){case"class":t.className=n,delete t.class;break;default:t[r]=n}return t},{})}function e4(e,t,r){return r?en.createElement(e.tag,ve(ve({key:t},G8(e.attrs)),r),(e.children||[]).map(function(n,i){return e4(n,"".concat(t,"-").concat(e.tag,"-").concat(i))})):en.createElement(e.tag,ve({key:t},G8(e.attrs)),(e.children||[]).map(function(n,i){return e4(n,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function iD(e){return JC(e)[0]}function oD(e){return e?Array.isArray(e)?e:[e]:[]}var Ude=` .anticon { display: inline-block; color: inherit; font-style: normal; line-height: 0; text-align: center; text-transform: none; vertical-align: -0.125em; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .anticon > * { line-height: 1; } .anticon svg { display: inline-block; } .anticon::before { display: none; } .anticon .anticon-icon { display: block; } .anticon[tabindex] { cursor: pointer; } .anticon-spin::before, .anticon-spin { display: inline-block; -webkit-animation: loadingCircle 1s infinite linear; animation: loadingCircle 1s infinite linear; } @-webkit-keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,Kde=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ude,r=C.exports.useContext(tD),n=r.csp,i=r.prefixCls,a=t;i&&(a=a.replace(/anticon/g,i)),C.exports.useEffect(function(){cv(a,"@ant-design-icons",{prepend:!0,csp:n})},[])},Hde=["icon","className","onClick","style","primaryColor","secondaryColor"],mm={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function Wde(e){var t=e.primaryColor,r=e.secondaryColor;mm.primaryColor=t,mm.secondaryColor=r||iD(t),mm.calculated=!!r}function qde(){return ve({},mm)}var Nx=function(t){var r=t.icon,n=t.className,i=t.onClick,a=t.style,u=t.primaryColor,o=t.secondaryColor,f=Pr(t,Hde),p=mm;if(u&&(p={primaryColor:u,secondaryColor:o||iD(u)}),Kde(),jde(q8(r),"icon should be icon definiton, but got ".concat(r)),!q8(r))return null;var v=r;return v&&typeof v.icon=="function"&&(v=ve(ve({},v),{},{icon:v.icon(p.primaryColor,p.secondaryColor)})),e4(v.icon,"svg-".concat(v.name),ve({className:n,onClick:i,style:a,"data-icon":v.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f))};Nx.displayName="IconReact";Nx.getTwoToneColors=qde;Nx.setTwoToneColors=Wde;const B3=Nx;function aD(e){var t=oD(e),r=Le(t,2),n=r[0],i=r[1];return B3.setTwoToneColors({primaryColor:n,secondaryColor:i})}function Gde(){var e=B3.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var Zde=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];aD("#1890ff");var zx=C.exports.forwardRef(function(e,t){var r,n=e.className,i=e.icon,a=e.spin,u=e.rotate,o=e.tabIndex,f=e.onClick,p=e.twoToneColor,v=Pr(e,Zde),y=C.exports.useContext(tD),w=y.prefixCls,k=w===void 0?"anticon":w,T=y.rootClassName,R=Ye(T,k,(r={},se(r,"".concat(k,"-").concat(i.name),!!i.name),se(r,"".concat(k,"-spin"),!!a||i.name==="loading"),r),n),A=o;A===void 0&&f&&(A=-1);var I=u?{msTransform:"rotate(".concat(u,"deg)"),transform:"rotate(".concat(u,"deg)")}:void 0,O=oD(p),N=Le(O,2),L=N[0],B=N[1];return E("span",{...ve(ve({role:"img","aria-label":i.name},v),{},{ref:t,tabIndex:A,onClick:f,className:R}),children:E(B3,{icon:i,primaryColor:L,secondaryColor:B,style:I})})});zx.displayName="AntdIcon";zx.getTwoToneColor=Gde;zx.setTwoToneColor=aD;const Ul=zx;var sD=function(t,r){return E(Ul,{...ve(ve({},t),{},{ref:r,icon:Bte})})};sD.displayName="ArrowRightOutlined";const lD=C.exports.forwardRef(sD);var uD=function(t,r){return E(Ul,{...ve(ve({},t),{},{ref:r,icon:zde})})};uD.displayName="DownloadOutlined";const Xde=C.exports.forwardRef(uD);var Yde={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"};const Qde=Yde;var cD=function(t,r){return E(Ul,{...ve(ve({},t),{},{ref:r,icon:Qde})})};cD.displayName="FullscreenExitOutlined";const Jde=C.exports.forwardRef(cD);var efe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"};const tfe=efe;var dD=function(t,r){return E(Ul,{...ve(ve({},t),{},{ref:r,icon:tfe})})};dD.displayName="FullscreenOutlined";const rfe=C.exports.forwardRef(dD);var nfe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"};const ife=nfe;var fD=function(t,r){return E(Ul,{...ve(ve({},t),{},{ref:r,icon:ife})})};fD.displayName="LockOutlined";const t4=C.exports.forwardRef(fD);var ofe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 01-112.7 75.9A352.8 352.8 0 01512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 01-112.7-75.9 353.28 353.28 0 01-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z"}}]},name:"logout",theme:"outlined"};const afe=ofe;var hD=function(t,r){return E(Ul,{...ve(ve({},t),{},{ref:r,icon:afe})})};hD.displayName="LogoutOutlined";const sfe=C.exports.forwardRef(hD);var lfe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"};const ufe=lfe;var pD=function(t,r){return E(Ul,{...ve(ve({},t),{},{ref:r,icon:ufe})})};pD.displayName="MailOutlined";const cfe=C.exports.forwardRef(pD);var mD=function(t,r){return E(Ul,{...ve(ve({},t),{},{ref:r,icon:hN})})};mD.displayName="SearchOutlined";const dfe=C.exports.forwardRef(mD);var ffe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"};const hfe=ffe;var vD=function(t,r){return E(Ul,{...ve(ve({},t),{},{ref:r,icon:hfe})})};vD.displayName="UserOutlined";const gD=C.exports.forwardRef(vD);function yD(e,t){return function(){return e.apply(t,arguments)}}const{toString:xD}=Object.prototype,{getPrototypeOf:V3}=Object,j3=(e=>t=>{const r=xD.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Kl=e=>(e=e.toLowerCase(),t=>j3(t)===e),Dx=e=>t=>typeof t===e,{isArray:yh}=Array,Hm=Dx("undefined");function pfe(e){return e!==null&&!Hm(e)&&e.constructor!==null&&!Hm(e.constructor)&&Wu(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _D=Kl("ArrayBuffer");function mfe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_D(e.buffer),t}const vfe=Dx("string"),Wu=Dx("function"),bD=Dx("number"),U3=e=>e!==null&&typeof e=="object",gfe=e=>e===!0||e===!1,o0=e=>{if(j3(e)!=="object")return!1;const t=V3(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},yfe=Kl("Date"),xfe=Kl("File"),_fe=Kl("Blob"),bfe=Kl("FileList"),wfe=e=>U3(e)&&Wu(e.pipe),Cfe=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||xD.call(e)===t||Wu(e.toString)&&e.toString()===t)},Sfe=Kl("URLSearchParams"),Efe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Tv(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),yh(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const CD=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),SD=e=>!Hm(e)&&e!==CD;function r4(){const{caseless:e}=SD(this)&&this||{},t={},r=(n,i)=>{const a=e&&wD(t,i)||i;o0(t[a])&&o0(n)?t[a]=r4(t[a],n):o0(n)?t[a]=r4({},n):yh(n)?t[a]=n.slice():t[a]=n};for(let n=0,i=arguments.length;n(Tv(t,(i,a)=>{r&&Wu(i)?e[a]=yD(i,r):e[a]=i},{allOwnKeys:n}),e),Tfe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Pfe=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Mfe=(e,t,r,n)=>{let i,a,u;const o={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)u=i[a],(!n||n(u,e,t))&&!o[u]&&(t[u]=e[u],o[u]=!0);e=r!==!1&&V3(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Ife=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Rfe=e=>{if(!e)return null;if(yh(e))return e;let t=e.length;if(!bD(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Ofe=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&V3(Uint8Array)),Afe=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},Nfe=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},zfe=Kl("HTMLFormElement"),Dfe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Z8=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Lfe=Kl("RegExp"),ED=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Tv(r,(i,a)=>{t(i,a,e)!==!1&&(n[a]=i)}),Object.defineProperties(e,n)},Ffe=e=>{ED(e,(t,r)=>{if(Wu(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(!!Wu(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},$fe=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return yh(e)?n(e):n(String(e).split(t)),r},Bfe=()=>{},Vfe=(e,t)=>(e=+e,Number.isFinite(e)?e:t),E2="abcdefghijklmnopqrstuvwxyz",X8="0123456789",kD={DIGIT:X8,ALPHA:E2,ALPHA_DIGIT:E2+E2.toUpperCase()+X8},jfe=(e=16,t=kD.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Ufe(e){return!!(e&&Wu(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Kfe=e=>{const t=new Array(10),r=(n,i)=>{if(U3(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const a=yh(n)?[]:{};return Tv(n,(u,o)=>{const f=r(u,i+1);!Hm(f)&&(a[o]=f)}),t[i]=void 0,a}}return n};return r(e,0)},Mt={isArray:yh,isArrayBuffer:_D,isBuffer:pfe,isFormData:Cfe,isArrayBufferView:mfe,isString:vfe,isNumber:bD,isBoolean:gfe,isObject:U3,isPlainObject:o0,isUndefined:Hm,isDate:yfe,isFile:xfe,isBlob:_fe,isRegExp:Lfe,isFunction:Wu,isStream:wfe,isURLSearchParams:Sfe,isTypedArray:Ofe,isFileList:bfe,forEach:Tv,merge:r4,extend:kfe,trim:Efe,stripBOM:Tfe,inherits:Pfe,toFlatObject:Mfe,kindOf:j3,kindOfTest:Kl,endsWith:Ife,toArray:Rfe,forEachEntry:Afe,matchAll:Nfe,isHTMLForm:zfe,hasOwnProperty:Z8,hasOwnProp:Z8,reduceDescriptors:ED,freezeMethods:Ffe,toObjectSet:$fe,toCamelCase:Dfe,noop:Bfe,toFiniteNumber:Vfe,findKey:wD,global:CD,isContextDefined:SD,ALPHABET:kD,generateString:jfe,isSpecCompliantForm:Ufe,toJSONObject:Kfe};function hn(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Mt.inherits(hn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Mt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const TD=hn.prototype,PD={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{PD[e]={value:e}});Object.defineProperties(hn,PD);Object.defineProperty(TD,"isAxiosError",{value:!0});hn.from=(e,t,r,n,i,a)=>{const u=Object.create(TD);return Mt.toFlatObject(e,u,function(f){return f!==Error.prototype},o=>o!=="isAxiosError"),hn.call(u,e.message,t,r,n,i),u.cause=e,u.name=e.name,a&&Object.assign(u,a),u};const Hfe=null;function n4(e){return Mt.isPlainObject(e)||Mt.isArray(e)}function MD(e){return Mt.endsWith(e,"[]")?e.slice(0,-2):e}function Y8(e,t,r){return e?e.concat(t).map(function(i,a){return i=MD(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function Wfe(e){return Mt.isArray(e)&&!e.some(n4)}const qfe=Mt.toFlatObject(Mt,{},null,function(t){return/^is[A-Z]/.test(t)});function Lx(e,t,r){if(!Mt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=Mt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(R,A){return!Mt.isUndefined(A[R])});const n=r.metaTokens,i=r.visitor||v,a=r.dots,u=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&Mt.isSpecCompliantForm(t);if(!Mt.isFunction(i))throw new TypeError("visitor must be a function");function p(T){if(T===null)return"";if(Mt.isDate(T))return T.toISOString();if(!f&&Mt.isBlob(T))throw new hn("Blob is not supported. Use a Buffer instead.");return Mt.isArrayBuffer(T)||Mt.isTypedArray(T)?f&&typeof Blob=="function"?new Blob([T]):Buffer.from(T):T}function v(T,R,A){let I=T;if(T&&!A&&typeof T=="object"){if(Mt.endsWith(R,"{}"))R=n?R:R.slice(0,-2),T=JSON.stringify(T);else if(Mt.isArray(T)&&Wfe(T)||(Mt.isFileList(T)||Mt.endsWith(R,"[]"))&&(I=Mt.toArray(T)))return R=MD(R),I.forEach(function(N,L){!(Mt.isUndefined(N)||N===null)&&t.append(u===!0?Y8([R],L,a):u===null?R:R+"[]",p(N))}),!1}return n4(T)?!0:(t.append(Y8(A,R,a),p(T)),!1)}const y=[],w=Object.assign(qfe,{defaultVisitor:v,convertValue:p,isVisitable:n4});function k(T,R){if(!Mt.isUndefined(T)){if(y.indexOf(T)!==-1)throw Error("Circular reference detected in "+R.join("."));y.push(T),Mt.forEach(T,function(I,O){(!(Mt.isUndefined(I)||I===null)&&i.call(t,I,Mt.isString(O)?O.trim():O,R,w))===!0&&k(I,R?R.concat(O):[O])}),y.pop()}}if(!Mt.isObject(e))throw new TypeError("data must be an object");return k(e),t}function Q8(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function K3(e,t){this._pairs=[],e&&Lx(e,this,t)}const ID=K3.prototype;ID.append=function(t,r){this._pairs.push([t,r])};ID.toString=function(t){const r=t?function(n){return t.call(this,n,Q8)}:Q8;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Gfe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function RD(e,t,r){if(!t)return e;const n=r&&r.encode||Gfe,i=r&&r.serialize;let a;if(i?a=i(t,r):a=Mt.isURLSearchParams(t)?t.toString():new K3(t,r).toString(n),a){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Zfe{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Mt.forEach(this.handlers,function(n){n!==null&&t(n)})}}const J8=Zfe,OD={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xfe=typeof URLSearchParams<"u"?URLSearchParams:K3,Yfe=typeof FormData<"u"?FormData:null,Qfe=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Jfe=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Vs={isBrowser:!0,classes:{URLSearchParams:Xfe,FormData:Yfe,Blob},isStandardBrowserEnv:Qfe,isStandardBrowserWebWorkerEnv:Jfe,protocols:["http","https","file","blob","url","data"]};function ehe(e,t){return Lx(e,new Vs.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Vs.isNode&&Mt.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function the(e){return Mt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function rhe(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n=r.length;return u=!u&&Mt.isArray(i)?i.length:u,f?(Mt.hasOwnProp(i,u)?i[u]=[i[u],n]:i[u]=n,!o):((!i[u]||!Mt.isObject(i[u]))&&(i[u]=[]),t(r,n,i[u],a)&&Mt.isArray(i[u])&&(i[u]=rhe(i[u])),!o)}if(Mt.isFormData(e)&&Mt.isFunction(e.entries)){const r={};return Mt.forEachEntry(e,(n,i)=>{t(the(n),i,r,0)}),r}return null}const nhe={"Content-Type":void 0};function ihe(e,t,r){if(Mt.isString(e))try{return(t||JSON.parse)(e),Mt.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Fx={transitional:OD,adapter:["xhr","http"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=Mt.isObject(t);if(a&&Mt.isHTMLForm(t)&&(t=new FormData(t)),Mt.isFormData(t))return i&&i?JSON.stringify(AD(t)):t;if(Mt.isArrayBuffer(t)||Mt.isBuffer(t)||Mt.isStream(t)||Mt.isFile(t)||Mt.isBlob(t))return t;if(Mt.isArrayBufferView(t))return t.buffer;if(Mt.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return ehe(t,this.formSerializer).toString();if((o=Mt.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Lx(o?{"files[]":t}:t,f&&new f,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),ihe(t)):t}],transformResponse:[function(t){const r=this.transitional||Fx.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(t&&Mt.isString(t)&&(n&&!this.responseType||i)){const u=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(u)throw o.name==="SyntaxError"?hn.from(o,hn.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vs.classes.FormData,Blob:Vs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Mt.forEach(["delete","get","head"],function(t){Fx.headers[t]={}});Mt.forEach(["post","put","patch"],function(t){Fx.headers[t]=Mt.merge(nhe)});const H3=Fx,ohe=Mt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ahe=e=>{const t={};let r,n,i;return e&&e.split(` `).forEach(function(u){i=u.indexOf(":"),r=u.substring(0,i).trim().toLowerCase(),n=u.substring(i+1).trim(),!(!r||t[r]&&ohe[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},eM=Symbol("internals");function Dp(e){return e&&String(e).trim().toLowerCase()}function a0(e){return e===!1||e==null?e:Mt.isArray(e)?e.map(a0):String(e)}function she(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}function lhe(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function k2(e,t,r,n,i){if(Mt.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!Mt.isString(t)){if(Mt.isString(n))return t.indexOf(n)!==-1;if(Mt.isRegExp(n))return n.test(t)}}function uhe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function che(e,t){const r=Mt.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,u){return this[n].call(this,t,i,a,u)},configurable:!0})})}class $x{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(o,f,p){const v=Dp(f);if(!v)throw new Error("header name must be a non-empty string");const y=Mt.findKey(i,v);(!y||i[y]===void 0||p===!0||p===void 0&&i[y]!==!1)&&(i[y||f]=a0(o))}const u=(o,f)=>Mt.forEach(o,(p,v)=>a(p,v,f));return Mt.isPlainObject(t)||t instanceof this.constructor?u(t,r):Mt.isString(t)&&(t=t.trim())&&!lhe(t)?u(ahe(t),r):t!=null&&a(r,t,n),this}get(t,r){if(t=Dp(t),t){const n=Mt.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return she(i);if(Mt.isFunction(r))return r.call(this,i,n);if(Mt.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Dp(t),t){const n=Mt.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||k2(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(u){if(u=Dp(u),u){const o=Mt.findKey(n,u);o&&(!r||k2(n,n[o],o,r))&&(delete n[o],i=!0)}}return Mt.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||k2(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return Mt.forEach(this,(i,a)=>{const u=Mt.findKey(n,a);if(u){r[u]=a0(i),delete r[a];return}const o=t?uhe(a):String(a).trim();o!==a&&delete r[a],r[o]=a0(i),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return Mt.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&Mt.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[eM]=this[eM]={accessors:{}}).accessors,i=this.prototype;function a(u){const o=Dp(u);n[o]||(che(i,u),n[o]=!0)}return Mt.isArray(t)?t.forEach(a):a(t),this}}$x.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Mt.freezeMethods($x.prototype);Mt.freezeMethods($x);const Tl=$x;function T2(e,t){const r=this||H3,n=t||r,i=Tl.from(n.headers);let a=n.data;return Mt.forEach(e,function(o){a=o.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function ND(e){return!!(e&&e.__CANCEL__)}function Pv(e,t,r){hn.call(this,e==null?"canceled":e,hn.ERR_CANCELED,t,r),this.name="CanceledError"}Mt.inherits(Pv,hn,{__CANCEL__:!0});function dhe(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new hn("Request failed with status code "+r.status,[hn.ERR_BAD_REQUEST,hn.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const fhe=Vs.isStandardBrowserEnv?function(){return{write:function(r,n,i,a,u,o){const f=[];f.push(r+"="+encodeURIComponent(n)),Mt.isNumber(i)&&f.push("expires="+new Date(i).toGMTString()),Mt.isString(a)&&f.push("path="+a),Mt.isString(u)&&f.push("domain="+u),o===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function hhe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function phe(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function zD(e,t){return e&&!hhe(t)?phe(e,t):t}const mhe=Vs.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(a){let u=a;return t&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(u){const o=Mt.isString(u)?i(u):u;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function vhe(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ghe(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,u;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),v=n[a];u||(u=p),r[i]=f,n[i]=p;let y=a,w=0;for(;y!==i;)w+=r[y++],y=y%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),p-u{const a=i.loaded,u=i.lengthComputable?i.total:void 0,o=a-r,f=n(o),p=a<=u;r=a;const v={loaded:a,total:u,progress:u?a/u:void 0,bytes:o,rate:f||void 0,estimated:f&&u&&p?(u-a)/f:void 0,event:i};v[t?"download":"upload"]=!0,e(v)}}const yhe=typeof XMLHttpRequest<"u",xhe=yhe&&function(e){return new Promise(function(r,n){let i=e.data;const a=Tl.from(e.headers).normalize(),u=e.responseType;let o;function f(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}Mt.isFormData(i)&&(Vs.isStandardBrowserEnv||Vs.isStandardBrowserWebWorkerEnv)&&a.setContentType(!1);let p=new XMLHttpRequest;if(e.auth){const k=e.auth.username||"",T=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(k+":"+T))}const v=zD(e.baseURL,e.url);p.open(e.method.toUpperCase(),RD(v,e.params,e.paramsSerializer),!0),p.timeout=e.timeout;function y(){if(!p)return;const k=Tl.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),R={data:!u||u==="text"||u==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:k,config:e,request:p};dhe(function(I){r(I),f()},function(I){n(I),f()},R),p=null}if("onloadend"in p?p.onloadend=y:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(y)},p.onabort=function(){!p||(n(new hn("Request aborted",hn.ECONNABORTED,e,p)),p=null)},p.onerror=function(){n(new hn("Network Error",hn.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let T=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const R=e.transitional||OD;e.timeoutErrorMessage&&(T=e.timeoutErrorMessage),n(new hn(T,R.clarifyTimeoutError?hn.ETIMEDOUT:hn.ECONNABORTED,e,p)),p=null},Vs.isStandardBrowserEnv){const k=(e.withCredentials||mhe(v))&&e.xsrfCookieName&&fhe.read(e.xsrfCookieName);k&&a.set(e.xsrfHeaderName,k)}i===void 0&&a.setContentType(null),"setRequestHeader"in p&&Mt.forEach(a.toJSON(),function(T,R){p.setRequestHeader(R,T)}),Mt.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),u&&u!=="json"&&(p.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&p.addEventListener("progress",tM(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",tM(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=k=>{!p||(n(!k||k.type?new Pv(null,e,p):k),p.abort(),p=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const w=vhe(v);if(w&&Vs.protocols.indexOf(w)===-1){n(new hn("Unsupported protocol "+w+":",hn.ERR_BAD_REQUEST,e));return}p.send(i||null)})},s0={http:Hfe,xhr:xhe};Mt.forEach(s0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const _he={getAdapter:e=>{e=Mt.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;ie instanceof Tl?e.toJSON():e;function Kf(e,t){t=t||{};const r={};function n(p,v,y){return Mt.isPlainObject(p)&&Mt.isPlainObject(v)?Mt.merge.call({caseless:y},p,v):Mt.isPlainObject(v)?Mt.merge({},v):Mt.isArray(v)?v.slice():v}function i(p,v,y){if(Mt.isUndefined(v)){if(!Mt.isUndefined(p))return n(void 0,p,y)}else return n(p,v,y)}function a(p,v){if(!Mt.isUndefined(v))return n(void 0,v)}function u(p,v){if(Mt.isUndefined(v)){if(!Mt.isUndefined(p))return n(void 0,p)}else return n(void 0,v)}function o(p,v,y){if(y in t)return n(p,v);if(y in e)return n(void 0,p)}const f={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:o,headers:(p,v)=>i(nM(p),nM(v),!0)};return Mt.forEach(Object.keys(e).concat(Object.keys(t)),function(v){const y=f[v]||i,w=y(e[v],t[v],v);Mt.isUndefined(w)&&y!==o||(r[v]=w)}),r}const DD="1.3.3",W3={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{W3[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const iM={};W3.transitional=function(t,r,n){function i(a,u){return"[Axios v"+DD+"] Transitional option '"+a+"'"+u+(n?". "+n:"")}return(a,u,o)=>{if(t===!1)throw new hn(i(u," has been removed"+(r?" in "+r:"")),hn.ERR_DEPRECATED);return r&&!iM[u]&&(iM[u]=!0,console.warn(i(u," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,u,o):!0}};function bhe(e,t,r){if(typeof e!="object")throw new hn("options must be an object",hn.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],u=t[a];if(u){const o=e[a],f=o===void 0||u(o,a,e);if(f!==!0)throw new hn("option "+a+" must be "+f,hn.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new hn("Unknown option "+a,hn.ERR_BAD_OPTION)}}const i4={assertOptions:bhe,validators:W3},cu=i4.validators;class c1{constructor(t){this.defaults=t,this.interceptors={request:new J8,response:new J8}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Kf(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&i4.assertOptions(n,{silentJSONParsing:cu.transitional(cu.boolean),forcedJSONParsing:cu.transitional(cu.boolean),clarifyTimeoutError:cu.transitional(cu.boolean)},!1),i!==void 0&&i4.assertOptions(i,{encode:cu.function,serialize:cu.function},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let u;u=a&&Mt.merge(a.common,a[r.method]),u&&Mt.forEach(["delete","get","head","post","put","patch","common"],T=>{delete a[T]}),r.headers=Tl.concat(u,a);const o=[];let f=!0;this.interceptors.request.forEach(function(R){typeof R.runWhen=="function"&&R.runWhen(r)===!1||(f=f&&R.synchronous,o.unshift(R.fulfilled,R.rejected))});const p=[];this.interceptors.response.forEach(function(R){p.push(R.fulfilled,R.rejected)});let v,y=0,w;if(!f){const T=[rM.bind(this),void 0];for(T.unshift.apply(T,o),T.push.apply(T,p),w=T.length,v=Promise.resolve(r);y{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const u=new Promise(o=>{n.subscribe(o),a=o}).then(i);return u.cancel=function(){n.unsubscribe(a)},u},t(function(a,u,o){n.reason||(n.reason=new Pv(a,u,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new q3(function(i){t=i}),cancel:t}}}const whe=q3;function Che(e){return function(r){return e.apply(null,r)}}function She(e){return Mt.isObject(e)&&e.isAxiosError===!0}const o4={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(o4).forEach(([e,t])=>{o4[t]=e});const Ehe=o4;function LD(e){const t=new l0(e),r=yD(l0.prototype.request,t);return Mt.extend(r,l0.prototype,t,{allOwnKeys:!0}),Mt.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return LD(Kf(e,i))},r}const ji=LD(H3);ji.Axios=l0;ji.CanceledError=Pv;ji.CancelToken=whe;ji.isCancel=ND;ji.VERSION=DD;ji.toFormData=Lx;ji.AxiosError=hn;ji.Cancel=ji.CanceledError;ji.all=function(t){return Promise.all(t)};ji.spread=Che;ji.isAxiosError=She;ji.mergeConfig=Kf;ji.AxiosHeaders=Tl;ji.formToJSON=e=>AD(Mt.isHTMLForm(e)?new FormData(e):e);ji.HttpStatusCode=Ehe;ji.default=ji;const khe=ji;class xh{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.push(t),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(r=>r!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const Wm=typeof window>"u"||"Deno"in window;function za(){}function The(e,t){return typeof e=="function"?e(t):e}function a4(e){return typeof e=="number"&&e>=0&&e!==1/0}function FD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Gp(e,t,r){return Mv(e)?typeof t=="function"?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Phe(e,t,r){return Mv(e)?typeof t=="function"?{...r,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function vu(e,t,r){return Mv(e)?[{...t,queryKey:e},r]:[e||{},t]}function oM(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:u,stale:o}=e;if(Mv(u)){if(n){if(t.queryHash!==G3(u,t.options))return!1}else if(!d1(t.queryKey,u))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||typeof i<"u"&&i!==t.state.fetchStatus||a&&!a(t))}function aM(e,t){const{exact:r,fetching:n,predicate:i,mutationKey:a}=e;if(Mv(a)){if(!t.options.mutationKey)return!1;if(r){if(qc(t.options.mutationKey)!==qc(a))return!1}else if(!d1(t.options.mutationKey,a))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||i&&!i(t))}function G3(e,t){return((t==null?void 0:t.queryKeyHashFn)||qc)(e)}function qc(e){return JSON.stringify(e,(t,r)=>l4(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function d1(e,t){return $D(e,t)}function $D(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!$D(e[r],t[r])):!1}function BD(e,t){if(e===t)return e;const r=sM(e)&&sM(t);if(r||l4(e)&&l4(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),a=i.length,u=r?[]:{};let o=0;for(let f=0;f"u")return!0;const r=t.prototype;return!(!lM(r)||!r.hasOwnProperty("isPrototypeOf"))}function lM(e){return Object.prototype.toString.call(e)==="[object Object]"}function Mv(e){return Array.isArray(e)}function VD(e){return new Promise(t=>{setTimeout(t,e)})}function uM(e){VD(0).then(e)}function Mhe(){if(typeof AbortController=="function")return new AbortController}function u4(e,t,r){return r.isDataEqual!=null&&r.isDataEqual(e,t)?e:typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?BD(e,t):t}class Ihe extends xh{constructor(){super(),this.setup=t=>{if(!Wm&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const f1=new Ihe;class Rhe extends xh{constructor(){super(),this.setup=t=>{if(!Wm&&window.addEventListener){const r=()=>t();return window.addEventListener("online",r,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const h1=new Rhe;function Ohe(e){return Math.min(1e3*2**e,3e4)}function Bx(e){return(e!=null?e:"online")==="online"?h1.isOnline():!0}class jD{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function u0(e){return e instanceof jD}function UD(e){let t=!1,r=0,n=!1,i,a,u;const o=new Promise((A,I)=>{a=A,u=I}),f=A=>{n||(k(new jD(A)),e.abort==null||e.abort())},p=()=>{t=!0},v=()=>{t=!1},y=()=>!f1.isFocused()||e.networkMode!=="always"&&!h1.isOnline(),w=A=>{n||(n=!0,e.onSuccess==null||e.onSuccess(A),i==null||i(),a(A))},k=A=>{n||(n=!0,e.onError==null||e.onError(A),i==null||i(),u(A))},T=()=>new Promise(A=>{i=I=>{const O=n||!y();return O&&A(I),O},e.onPause==null||e.onPause()}).then(()=>{i=void 0,n||e.onContinue==null||e.onContinue()}),R=()=>{if(n)return;let A;try{A=e.fn()}catch(I){A=Promise.reject(I)}Promise.resolve(A).then(w).catch(I=>{var O,N;if(n)return;const L=(O=e.retry)!=null?O:3,B=(N=e.retryDelay)!=null?N:Ohe,j=typeof B=="function"?B(r,I):B,G=L===!0||typeof L=="number"&&r{if(y())return T()}).then(()=>{t?k(I):R()})})};return Bx(e.networkMode)?R():T().then(R),{promise:o,cancel:f,continue:()=>(i==null?void 0:i())?o:Promise.resolve(),cancelRetry:p,continueRetry:v}}const Z3=console;function Ahe(){let e=[],t=0,r=v=>{v()},n=v=>{v()};const i=v=>{let y;t++;try{y=v()}finally{t--,t||o()}return y},a=v=>{t?e.push(v):uM(()=>{r(v)})},u=v=>(...y)=>{a(()=>{v(...y)})},o=()=>{const v=e;e=[],v.length&&uM(()=>{n(()=>{v.forEach(y=>{r(y)})})})};return{batch:i,batchCalls:u,schedule:a,setNotifyFunction:v=>{r=v},setBatchNotifyFunction:v=>{n=v}}}const pi=Ahe();class KD{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),a4(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t!=null?t:Wm?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Nhe extends KD{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Z3,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||zhe(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,r){const n=u4(this.state.data,t,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){this.dispatch({type:"setState",state:t,setStateOptions:r})}cancel(t){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(t),n?n.then(za).catch(za):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!FD(this.state.dataUpdatedAt,t)}onFocus(){var t;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.indexOf(t)!==-1&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var a;return(a=this.retryer)==null||a.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(T=>T.options.queryFn);k&&this.setOptions(k.options)}Array.isArray(this.options.queryKey);const u=Mhe(),o={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},f=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>{if(u)return this.abortSignalConsumed=!0,u.signal}})};f(o);const p=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(o)):Promise.reject("Missing queryFn"),v={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:p};if(f(v),(n=this.options.behavior)==null||n.onFetch(v),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=v.fetchOptions)==null?void 0:i.meta)){var y;this.dispatch({type:"fetch",meta:(y=v.fetchOptions)==null?void 0:y.meta})}const w=k=>{if(u0(k)&&k.silent||this.dispatch({type:"error",error:k}),!u0(k)){var T,R;(T=(R=this.cache.config).onError)==null||T.call(R,k,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=UD({fn:v.fetchFn,abort:u==null?void 0:u.abort.bind(u),onSuccess:k=>{var T,R;if(typeof k>"u"){w(new Error("undefined"));return}this.setData(k),(T=(R=this.cache.config).onSuccess)==null||T.call(R,k,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:w,onFail:(k,T)=>{this.dispatch({type:"failed",failureCount:k,error:T})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:v.options.retry,retryDelay:v.options.retryDelay,networkMode:v.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const r=n=>{var i,a;switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Bx(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(a=t.dataUpdatedAt)!=null?a:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const u=t.error;return u0(u)&&u.revert&&this.revertState?{...this.revertState}:{...n,error:u,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),pi.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function zhe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n!=null?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class Dhe extends xh{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,r,n){var i;const a=r.queryKey,u=(i=r.queryHash)!=null?i:G3(a,r);let o=this.get(u);return o||(o=new Nhe({cache:this,logger:t.getLogger(),queryKey:a,queryHash:u,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const r=this.queriesMap[t.queryHash];r&&(t.destroy(),this.queries=this.queries.filter(n=>n!==t),r===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){pi.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,r){const[n]=vu(t,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>oM(n,i))}findAll(t,r){const[n]=vu(t,r);return Object.keys(n).length>0?this.queries.filter(i=>oM(n,i)):this.queries}notify(t){pi.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){pi.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){pi.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class Lhe extends KD{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Z3,this.observers=[],this.state=t.state||HD(),this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(r=>r!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,r;return(t=(r=this.retryer)==null?void 0:r.continue())!=null?t:this.execute()}async execute(){const t=()=>{var N;return this.retryer=UD({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(L,B)=>{this.dispatch({type:"failed",failureCount:L,error:B})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(N=this.options.retry)!=null?N:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,a,u,o,f;if(!r){var p,v,y,w;this.dispatch({type:"loading",variables:this.options.variables}),await((p=(v=this.mutationCache.config).onMutate)==null?void 0:p.call(v,this.state.variables,this));const L=await((y=(w=this.options).onMutate)==null?void 0:y.call(w,this.state.variables));L!==this.state.context&&this.dispatch({type:"loading",context:L,variables:this.state.variables})}const N=await t();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,N,this.state.variables,this.state.context,this)),await((a=(u=this.options).onSuccess)==null?void 0:a.call(u,N,this.state.variables,this.state.context)),await((o=(f=this.options).onSettled)==null?void 0:o.call(f,N,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:N}),N}catch(N){try{var k,T,R,A,I,O;throw await((k=(T=this.mutationCache.config).onError)==null?void 0:k.call(T,N,this.state.variables,this.state.context,this)),await((R=(A=this.options).onError)==null?void 0:R.call(A,N,this.state.variables,this.state.context)),await((I=(O=this.options).onSettled)==null?void 0:I.call(O,void 0,N,this.state.variables,this.state.context)),N}finally{this.dispatch({type:"error",error:N})}}}dispatch(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Bx(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...n,...t.state}}};this.state=r(this.state),pi.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function HD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Fhe extends xh{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,r,n){const i=new Lhe({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?t.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(r=>r!==t),this.notify({type:"removed",mutation:t})}clear(){pi.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(r=>aM(t,r))}findAll(t){return this.mutations.filter(r=>aM(t,r))}notify(t){pi.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return pi.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(za)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function $he(){return{onFetch:e=>{e.fetchFn=()=>{var t,r,n,i,a,u;const o=(t=e.fetchOptions)==null||(r=t.meta)==null?void 0:r.refetchPage,f=(n=e.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,p=f==null?void 0:f.pageParam,v=(f==null?void 0:f.direction)==="forward",y=(f==null?void 0:f.direction)==="backward",w=((a=e.state.data)==null?void 0:a.pages)||[],k=((u=e.state.data)==null?void 0:u.pageParams)||[];let T=k,R=!1;const A=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>{var G;if((G=e.signal)!=null&&G.aborted)R=!0;else{var H;(H=e.signal)==null||H.addEventListener("abort",()=>{R=!0})}return e.signal}})},I=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),O=(j,G,H,te)=>(T=te?[G,...T]:[...T,G],te?[H,...j]:[...j,H]),N=(j,G,H,te)=>{if(R)return Promise.reject("Cancelled");if(typeof H>"u"&&!G&&j.length)return Promise.resolve(j);const Y={queryKey:e.queryKey,pageParam:H,meta:e.options.meta};A(Y);const le=I(Y);return Promise.resolve(le).then(Z=>O(j,H,Z,te))};let L;if(!w.length)L=N([]);else if(v){const j=typeof p<"u",G=j?p:cM(e.options,w);L=N(w,j,G)}else if(y){const j=typeof p<"u",G=j?p:Bhe(e.options,w);L=N(w,j,G,!0)}else{T=[];const j=typeof e.options.getNextPageParam>"u";L=(o&&w[0]?o(w[0],0,w):!0)?N([],j,k[0]):Promise.resolve(O([],k[0],w[0]));for(let H=1;H{if(o&&w[H]?o(w[H],H,w):!0){const le=j?k[H]:cM(e.options,te);return N(te,j,le)}return Promise.resolve(O(te,k[H],w[H]))})}return L.then(j=>({pages:j,pageParams:T}))}}}}function cM(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function Bhe(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class Vhe{constructor(t={}){this.queryCache=t.queryCache||new Dhe,this.mutationCache=t.mutationCache||new Fhe,this.logger=t.logger||Z3,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=f1.subscribe(()=>{f1.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=h1.subscribe(()=>{h1.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,r;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(t,r){const[n]=vu(t,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state.data}ensureQueryData(t,r,n){const i=Gp(t,r,n),a=this.getQueryData(i.queryKey);return a?Promise.resolve(a):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(t,r,n){const i=this.queryCache.find(t),a=i==null?void 0:i.state.data,u=The(r,a);if(typeof u>"u")return;const o=Gp(t),f=this.defaultQueryOptions(o);return this.queryCache.build(this,f).setData(u,{...n,manual:!0})}setQueriesData(t,r,n){return pi.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state}removeQueries(t,r){const[n]=vu(t,r),i=this.queryCache;pi.batch(()=>{i.findAll(n).forEach(a=>{i.remove(a)})})}resetQueries(t,r,n){const[i,a]=vu(t,r,n),u=this.queryCache,o={type:"active",...i};return pi.batch(()=>(u.findAll(i).forEach(f=>{f.reset()}),this.refetchQueries(o,a)))}cancelQueries(t,r,n){const[i,a={}]=vu(t,r,n);typeof a.revert>"u"&&(a.revert=!0);const u=pi.batch(()=>this.queryCache.findAll(i).map(o=>o.cancel(a)));return Promise.all(u).then(za).catch(za)}invalidateQueries(t,r,n){const[i,a]=vu(t,r,n);return pi.batch(()=>{var u,o;if(this.queryCache.findAll(i).forEach(p=>{p.invalidate()}),i.refetchType==="none")return Promise.resolve();const f={...i,type:(u=(o=i.refetchType)!=null?o:i.type)!=null?u:"active"};return this.refetchQueries(f,a)})}refetchQueries(t,r,n){const[i,a]=vu(t,r,n),u=pi.batch(()=>this.queryCache.findAll(i).filter(f=>!f.isDisabled()).map(f=>{var p;return f.fetch(void 0,{...a,cancelRefetch:(p=a==null?void 0:a.cancelRefetch)!=null?p:!0,meta:{refetchPage:i.refetchPage}})}));let o=Promise.all(u).then(za);return a!=null&&a.throwOnError||(o=o.catch(za)),o}fetchQuery(t,r,n){const i=Gp(t,r,n),a=this.defaultQueryOptions(i);typeof a.retry>"u"&&(a.retry=!1);const u=this.queryCache.build(this,a);return u.isStaleByTime(a.staleTime)?u.fetch(a):Promise.resolve(u.state.data)}prefetchQuery(t,r,n){return this.fetchQuery(t,r,n).then(za).catch(za)}fetchInfiniteQuery(t,r,n){const i=Gp(t,r,n);return i.behavior=$he(),this.fetchQuery(i)}prefetchInfiniteQuery(t,r,n){return this.fetchInfiniteQuery(t,r,n).then(za).catch(za)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,r){const n=this.queryDefaults.find(i=>qc(t)===qc(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:t,defaultOptions:r})}getQueryDefaults(t){if(!t)return;const r=this.queryDefaults.find(n=>d1(t,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(t,r){const n=this.mutationDefaults.find(i=>qc(t)===qc(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:t,defaultOptions:r})}getMutationDefaults(t){if(!t)return;const r=this.mutationDefaults.find(n=>d1(t,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const r={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=G3(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class jhe extends xh{constructor(t,r){super(),this.client=t,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),dM(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return c4(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c4(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),s4(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const a=this.hasListeners();a&&fM(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),a&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const u=this.computeRefetchInterval();a&&(this.currentQuery!==i||this.options.enabled!==n.enabled||u!==this.currentRefetchInterval)&&this.updateRefetchInterval(u)}getOptimisticResult(t){const r=this.client.getQueryCache().build(this.client,t);return this.createResult(r,t)}getCurrentResult(){return this.currentResult}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),t[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...r}={}){return this.fetch({...r,meta:{refetchPage:t}})}fetchOptimistic(t){const r=this.client.defaultQueryOptions(t),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){var r;return this.executeFetch({...t,cancelRefetch:(r=t.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let r=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(za)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),Wm||this.currentResult.isStale||!a4(this.options.staleTime))return;const r=FD(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(Wm||this.options.enabled===!1||!a4(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||f1.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,r){const n=this.currentQuery,i=this.options,a=this.currentResult,u=this.currentResultState,o=this.currentResultOptions,f=t!==n,p=f?t.state:this.currentQueryInitialState,v=f?this.currentResult:this.previousQueryResult,{state:y}=t;let{dataUpdatedAt:w,error:k,errorUpdatedAt:T,fetchStatus:R,status:A}=y,I=!1,O=!1,N;if(r._optimisticResults){const H=this.hasListeners(),te=!H&&dM(t,r),Y=H&&fM(t,n,r,i);(te||Y)&&(R=Bx(t.options.networkMode)?"fetching":"paused",w||(A="loading")),r._optimisticResults==="isRestoring"&&(R="idle")}if(r.keepPreviousData&&!y.dataUpdatedAt&&v!=null&&v.isSuccess&&A!=="error")N=v.data,w=v.dataUpdatedAt,A=v.status,I=!0;else if(r.select&&typeof y.data<"u")if(a&&y.data===(u==null?void 0:u.data)&&r.select===this.selectFn)N=this.selectResult;else try{this.selectFn=r.select,N=r.select(y.data),N=u4(a==null?void 0:a.data,N,r),this.selectResult=N,this.selectError=null}catch(H){this.selectError=H}else N=y.data;if(typeof r.placeholderData<"u"&&typeof N>"u"&&A==="loading"){let H;if(a!=null&&a.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData))H=a.data;else if(H=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof H<"u")try{H=r.select(H),this.selectError=null}catch(te){this.selectError=te}typeof H<"u"&&(A="success",N=u4(a==null?void 0:a.data,H,r),O=!0)}this.selectError&&(k=this.selectError,N=this.selectResult,T=Date.now(),A="error");const L=R==="fetching",B=A==="loading",j=A==="error";return{status:A,fetchStatus:R,isLoading:B,isSuccess:A==="success",isError:j,isInitialLoading:B&&L,data:N,dataUpdatedAt:w,error:k,errorUpdatedAt:T,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>p.dataUpdateCount||y.errorUpdateCount>p.errorUpdateCount,isFetching:L,isRefetching:L&&!B,isLoadingError:j&&y.dataUpdatedAt===0,isPaused:R==="paused",isPlaceholderData:O,isPreviousData:I,isRefetchError:j&&y.dataUpdatedAt!==0,isStale:X3(t,r),refetch:this.refetch,remove:this.remove}}updateResult(t){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,s4(n,r))return;this.currentResult=n;const i={cache:!0},a=()=>{if(!r)return!0;const{notifyOnChangeProps:u}=this.options;if(u==="all"||!u&&!this.trackedProps.size)return!0;const o=new Set(u!=null?u:this.trackedProps);return this.options.useErrorBoundary&&o.add("error"),Object.keys(this.currentResult).some(f=>{const p=f;return this.currentResult[p]!==r[p]&&o.has(p)})};(t==null?void 0:t.listeners)!==!1&&a()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const r={};t.type==="success"?r.onSuccess=!t.manual:t.type==="error"&&!u0(t.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(t){pi.batch(()=>{if(t.onSuccess){var r,n,i,a;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(a=this.options).onSettled)==null||i.call(a,this.currentResult.data,null)}else if(t.onError){var u,o,f,p;(u=(o=this.options).onError)==null||u.call(o,this.currentResult.error),(f=(p=this.options).onSettled)==null||f.call(p,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(v=>{v(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function Uhe(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function dM(e,t){return Uhe(e,t)||e.state.dataUpdatedAt>0&&c4(e,t,t.refetchOnMount)}function c4(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&X3(e,t)}return!1}function fM(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&X3(e,r)}function X3(e,t){return e.isStaleByTime(t.staleTime)}class Khe extends xh{constructor(t,r){super(),this.client=t,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.client.defaultMutationOptions(t),s4(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this})}onUnsubscribe(){if(!this.listeners.length){var t;(t=this.currentMutation)==null||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();const r={listeners:!0};t.type==="success"?r.onSuccess=!0:t.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof t<"u"?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const t=this.currentMutation?this.currentMutation.state:HD(),r={...t,isLoading:t.status==="loading",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(t){pi.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(t.onSuccess){var r,n,i,a;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(a=this.mutateOptions).onSettled)==null||i.call(a,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var u,o,f,p;(u=(o=this.mutateOptions).onError)==null||u.call(o,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(f=(p=this.mutateOptions).onSettled)==null||f.call(p,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(v=>{v(this.currentResult)})})}}const WD=j1.exports.useSyncExternalStore,hM=C.exports.createContext(void 0),qD=C.exports.createContext(!1);function GD(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=hM),window.ReactQueryClientContext):hM)}const Iv=({context:e}={})=>{const t=C.exports.useContext(GD(e,C.exports.useContext(qD)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Hhe=({client:e,children:t,context:r,contextSharing:n=!1})=>{C.exports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=GD(r,n);return E(qD.Provider,{value:!r&&n,children:E(i.Provider,{value:e,children:t})})},ZD=C.exports.createContext(!1),Whe=()=>C.exports.useContext(ZD);ZD.Provider;function qhe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Ghe=C.exports.createContext(qhe()),Zhe=()=>C.exports.useContext(Ghe);function XD(e,t){return typeof e=="function"?e(...t):!!e}const Xhe=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},Yhe=e=>{C.exports.useEffect(()=>{e.clearReset()},[e])},Qhe=({result:e,errorResetBoundary:t,useErrorBoundary:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&XD(r,[e.error,n]),Jhe=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},epe=(e,t)=>e.isLoading&&e.isFetching&&!t,tpe=(e,t,r)=>(e==null?void 0:e.suspense)&&epe(t,r),rpe=(e,t,r)=>t.fetchOptimistic(e).then(({data:n})=>{e.onSuccess==null||e.onSuccess(n),e.onSettled==null||e.onSettled(n,null)}).catch(n=>{r.clearReset(),e.onError==null||e.onError(n),e.onSettled==null||e.onSettled(void 0,n)});function npe(e,t){const r=Iv({context:e.context}),n=Whe(),i=Zhe(),a=r.defaultQueryOptions(e);a._optimisticResults=n?"isRestoring":"optimistic",a.onError&&(a.onError=pi.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=pi.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=pi.batchCalls(a.onSettled)),Jhe(a),Xhe(a,i),Yhe(i);const[u]=C.exports.useState(()=>new t(r,a)),o=u.getOptimisticResult(a);if(WD(C.exports.useCallback(f=>n?()=>{}:u.subscribe(pi.batchCalls(f)),[u,n]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),C.exports.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),tpe(a,o,n))throw rpe(a,u,i);if(Qhe({result:o,errorResetBoundary:i,useErrorBoundary:a.useErrorBoundary,query:u.getCurrentQuery()}))throw o.error;return a.notifyOnChangeProps?o:u.trackResult(o)}function Za(e,t,r){const n=Gp(e,t,r);return npe(n,jhe)}function ipe(e,t,r){const n=Phe(e,t,r),i=Iv({context:n.context}),[a]=C.exports.useState(()=>new Khe(i,n));C.exports.useEffect(()=>{a.setOptions(n)},[a,n]);const u=WD(C.exports.useCallback(f=>a.subscribe(pi.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=C.exports.useCallback((f,p)=>{a.mutate(f,p).catch(ope)},[a]);if(u.error&&XD(a.options.useErrorBoundary,[u.error]))throw u.error;return{...u,mutate:o,mutateAsync:u.mutate}}function ope(){}const vn={initial:"initial","initial-match":"initial-match-points","initial-unmatch":"initial-unmatch-points",approve:"approve-points",working:"working-points",cancelled:"cancelled-points",atd:"atd"},jn={initial:"\u041A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E",approve:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",working:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442",cancelled:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043E"},YD={kiosk:"\u0413\u043E\u0440\u043E\u0434\u0441\u043A\u043E\u0439 \u043A\u0438\u043E\u0441\u043A",mfc:"\u041C\u0424\u0426",library:"\u0411\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430",sport:"\u0421\u043F\u043E\u0440\u0442\u0438\u0432\u043D\u044B\u0439 \u043E\u0431\u044A\u0435\u043A\u0442",retail:"\u0420\u0438\u0442\u0435\u0439\u043B",residential:"\u041F\u043E\u0434\u044A\u0435\u0437\u0434 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430",dk:"\u0414\u043E\u043C \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u044B/\u041A\u043B\u0443\u0431"},ape="\u0424\u0438\u043B\u044C\u0442\u0440 \u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D - \u0431\u044B\u043B\u043E \u0440\u0443\u0447\u043D\u043E\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435",ii={INITIAL:"INITIAL",APPROVE_WORKING:"APPROVE_WORKING",WORKING:"WORKING"},spe={[ii.INITIAL]:[jn.initial],[ii.APPROVE_WORKING]:[jn.approve,jn.working],[ii.WORKING]:[jn.working]},lpe={[ii.INITIAL]:{visible:[vn.initial],invisible:[vn.approve,vn.working]},[ii.APPROVE_WORKING]:{visible:[vn.approve,vn.working],invisible:[vn.initial]},[ii.WORKING]:{visible:[vn.working],invisible:[vn.initial,vn.approve]}},pM=e=>{let t;const r=new Set,n=(f,p)=>{const v=typeof f=="function"?f(t):f;if(!Object.is(v,t)){const y=t;t=(p!=null?p:typeof v!="object")?v:Object.assign({},t,v),r.forEach(w=>w(t,y))}},i=()=>t,o={setState:n,getState:i,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{var f;((f={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:f.MODE)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(n,i,o),o},upe=e=>e?pM(e):pM;var QD={exports:{}},JD={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Vx=C.exports,cpe=j1.exports;function dpe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fpe=typeof Object.is=="function"?Object.is:dpe,hpe=cpe.useSyncExternalStore,ppe=Vx.useRef,mpe=Vx.useEffect,vpe=Vx.useMemo,gpe=Vx.useDebugValue;JD.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=ppe(null);if(a.current===null){var u={hasValue:!1,value:null};a.current=u}else u=a.current;a=vpe(function(){function f(k){if(!p){if(p=!0,v=k,k=n(k),i!==void 0&&u.hasValue){var T=u.value;if(i(T,k))return y=T}return y=k}if(T=y,fpe(v,k))return T;var R=n(k);return i!==void 0&&i(T,R)?T:(v=k,y=R)}var p=!1,v,y,w=r===void 0?null:r;return[function(){return f(t())},w===null?void 0:function(){return f(w())}]},[t,r,n,i]);var o=hpe(e,a[0],a[1]);return mpe(function(){u.hasValue=!0,u.value=o},[o]),gpe(o),o};(function(e){e.exports=JD})(QD);const ype=I4(QD.exports),{useSyncExternalStoreWithSelector:xpe}=ype;function _pe(e,t=e.getState,r){const n=xpe(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return C.exports.useDebugValue(n),n}const mM=e=>{var t;((t={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:t.MODE)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const r=typeof e=="function"?upe(e):e,n=(i,a)=>_pe(r,i,a);return Object.assign(n,r),n},tc=e=>e?mM(e):mM;function Fa(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:Y3(e)?2:Q3(e)?3:0}function d4(e,t){return _h(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function bpe(e,t){return _h(e)===2?e.get(t):e[t]}function eL(e,t,r){var n=_h(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function wpe(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Y3(e){return Ppe&&e instanceof Map}function Q3(e){return Mpe&&e instanceof Set}function Gi(e){return e.o||e.t}function J3(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Rpe(e);delete t[wn];for(var r=nE(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=Cpe),Object.freeze(e),t&&Wf(e,function(r,n){return eE(n,!0)},!0)),e}function Cpe(){Fa(2)}function tE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ws(e){var t=h4[e];return t||Fa(18,e),t}function Spe(e,t){h4[e]||(h4[e]=t)}function p1(){return Gm}function M2(e,t){t&&(Ws("Patches"),e.u=[],e.s=[],e.v=t)}function m1(e){f4(e),e.p.forEach(Epe),e.p=null}function f4(e){e===Gm&&(Gm=e.l)}function vM(e){return Gm={p:[],l:Gm,h:e,m:!0,_:0}}function Epe(e){var t=e[wn];t.i===0||t.i===1?t.j():t.O=!0}function I2(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.g||Ws("ES5").S(t,e,n),n?(r[wn].P&&(m1(t),Fa(4)),zl(e)&&(e=v1(t,e),t.l||g1(t,e)),t.u&&Ws("Patches").M(r[wn].t,e,t.u,t.s)):e=v1(t,r,[]),m1(t),t.u&&t.v(t.u,t.s),e!==tL?e:void 0}function v1(e,t,r){if(tE(t))return t;var n=t[wn];if(!n)return Wf(t,function(o,f){return gM(e,n,t,o,f,r)},!0),t;if(n.A!==e)return t;if(!n.P)return g1(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=J3(n.k):n.o,a=i,u=!1;n.i===3&&(a=new Set(i),i.clear(),u=!0),Wf(a,function(o,f){return gM(e,n,i,o,f,r,u)}),g1(e,i,!1),r&&e.u&&Ws("Patches").N(n,r,e.u,e.s)}return n.o}function gM(e,t,r,n,i,a,u){if(Hf(i)){var o=v1(e,i,a&&t&&t.i!==3&&!d4(t.R,n)?a.concat(n):void 0);if(eL(r,n,o),!Hf(o))return;e.m=!1}else u&&r.add(i);if(zl(i)&&!tE(i)){if(!e.h.D&&e._<1)return;v1(e,i),t&&t.A.l||g1(e,i)}}function g1(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&eE(t,r)}function R2(e,t){var r=e[wn];return(r?Gi(r):e)[t]}function yM(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function xl(e){e.P||(e.P=!0,e.l&&xl(e.l))}function O2(e){e.o||(e.o=J3(e.t))}function qm(e,t,r){var n=Y3(t)?Ws("MapSet").F(t,r):Q3(t)?Ws("MapSet").T(t,r):e.g?function(i,a){var u=Array.isArray(i),o={i:u?1:0,A:a?a.A:p1(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},f=o,p=p4;u&&(f=[o],p=Zp);var v=Proxy.revocable(f,p),y=v.revoke,w=v.proxy;return o.k=w,o.j=y,w}(t,r):Ws("ES5").J(t,r);return(r?r.A:p1()).p.push(n),n}function kpe(e){return Hf(e)||Fa(22,e),function t(r){if(!zl(r))return r;var n,i=r[wn],a=_h(r);if(i){if(!i.P&&(i.i<4||!Ws("ES5").K(i)))return i.t;i.I=!0,n=xM(r,a),i.I=!1}else n=xM(r,a);return Wf(n,function(u,o){i&&bpe(i.t,u)===o||eL(n,u,t(o))}),a===3?new Set(n):n}(e)}function xM(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return J3(e)}function Tpe(){function e(o,f){function p(){this.constructor=o}i(o,f),o.prototype=(p.prototype=f.prototype,new p)}function t(o){o.o||(o.R=new Map,o.o=new Map(o.t))}function r(o){o.o||(o.o=new Set,o.t.forEach(function(f){if(zl(f)){var p=qm(o.A.h,f,o);o.p.set(f,p),o.o.add(p)}else o.o.add(f)}))}function n(o){o.O&&Fa(3,JSON.stringify(Gi(o)))}var i=function(o,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var y in v)v.hasOwnProperty(y)&&(p[y]=v[y])})(o,f)},a=function(){function o(p,v){return this[wn]={i:2,l:v,A:v?v.A:p1(),P:!1,I:!1,o:void 0,R:void 0,t:p,k:this,C:!1,O:!1},this}e(o,Map);var f=o.prototype;return Object.defineProperty(f,"size",{get:function(){return Gi(this[wn]).size}}),f.has=function(p){return Gi(this[wn]).has(p)},f.set=function(p,v){var y=this[wn];return n(y),Gi(y).has(p)&&Gi(y).get(p)===v||(t(y),xl(y),y.R.set(p,!0),y.o.set(p,v),y.R.set(p,!0)),this},f.delete=function(p){if(!this.has(p))return!1;var v=this[wn];return n(v),t(v),xl(v),v.t.has(p)?v.R.set(p,!1):v.R.delete(p),v.o.delete(p),!0},f.clear=function(){var p=this[wn];n(p),Gi(p).size&&(t(p),xl(p),p.R=new Map,Wf(p.t,function(v){p.R.set(v,!1)}),p.o.clear())},f.forEach=function(p,v){var y=this;Gi(this[wn]).forEach(function(w,k){p.call(v,y.get(k),k,y)})},f.get=function(p){var v=this[wn];n(v);var y=Gi(v).get(p);if(v.I||!zl(y)||y!==v.t.get(p))return y;var w=qm(v.A.h,y,v);return t(v),v.o.set(p,w),w},f.keys=function(){return Gi(this[wn]).keys()},f.values=function(){var p,v=this,y=this.keys();return(p={})[Iy]=function(){return v.values()},p.next=function(){var w=y.next();return w.done?w:{done:!1,value:v.get(w.value)}},p},f.entries=function(){var p,v=this,y=this.keys();return(p={})[Iy]=function(){return v.entries()},p.next=function(){var w=y.next();if(w.done)return w;var k=v.get(w.value);return{done:!1,value:[w.value,k]}},p},f[Iy]=function(){return this.entries()},o}(),u=function(){function o(p,v){return this[wn]={i:3,l:v,A:v?v.A:p1(),P:!1,I:!1,o:void 0,t:p,k:this,p:new Map,O:!1,C:!1},this}e(o,Set);var f=o.prototype;return Object.defineProperty(f,"size",{get:function(){return Gi(this[wn]).size}}),f.has=function(p){var v=this[wn];return n(v),v.o?!!v.o.has(p)||!(!v.p.has(p)||!v.o.has(v.p.get(p))):v.t.has(p)},f.add=function(p){var v=this[wn];return n(v),this.has(p)||(r(v),xl(v),v.o.add(p)),this},f.delete=function(p){if(!this.has(p))return!1;var v=this[wn];return n(v),r(v),xl(v),v.o.delete(p)||!!v.p.has(p)&&v.o.delete(v.p.get(p))},f.clear=function(){var p=this[wn];n(p),Gi(p).size&&(r(p),xl(p),p.o.clear())},f.values=function(){var p=this[wn];return n(p),r(p),p.o.values()},f.entries=function(){var p=this[wn];return n(p),r(p),p.o.entries()},f.keys=function(){return this.values()},f[Iy]=function(){return this.values()},f.forEach=function(p,v){for(var y=this.values(),w=y.next();!w.done;)p.call(v,w.value,w.value,this),w=y.next()},o}();Spe("MapSet",{F:function(o,f){return new a(o,f)},T:function(o,f){return new u(o,f)}})}var _M,Gm,rE=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Ppe=typeof Map<"u",Mpe=typeof Set<"u",bM=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",tL=rE?Symbol.for("immer-nothing"):((_M={})["immer-nothing"]=!0,_M),wM=rE?Symbol.for("immer-draftable"):"__$immer_draftable",wn=rE?Symbol.for("immer-state"):"__$immer_state",Iy=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",Ipe=""+Object.prototype.constructor,nE=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Rpe=Object.getOwnPropertyDescriptors||function(e){var t={};return nE(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},h4={},p4={get:function(e,t){if(t===wn)return e;var r=Gi(e);if(!d4(r,t))return function(i,a,u){var o,f=yM(a,u);return f?"value"in f?f.value:(o=f.get)===null||o===void 0?void 0:o.call(i.k):void 0}(e,r,t);var n=r[t];return e.I||!zl(n)?n:n===R2(e.t,t)?(O2(e),e.o[t]=qm(e.A.h,n,e)):n},has:function(e,t){return t in Gi(e)},ownKeys:function(e){return Reflect.ownKeys(Gi(e))},set:function(e,t,r){var n=yM(Gi(e),t);if(n!=null&&n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=R2(Gi(e),t),a=i==null?void 0:i[wn];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(wpe(r,i)&&(r!==void 0||d4(e.t,t)))return!0;O2(e),xl(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return R2(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,O2(e),xl(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Gi(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){Fa(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Fa(12)}},Zp={};Wf(p4,function(e,t){Zp[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Zp.deleteProperty=function(e,t){return Zp.set.call(this,e,t,void 0)},Zp.set=function(e,t,r){return p4.set.call(this,e[0],t,r,e[0])};var Ope=function(){function e(r){var n=this;this.g=bM,this.D=!0,this.produce=function(i,a,u){if(typeof i=="function"&&typeof a!="function"){var o=a;a=i;var f=n;return function(R){var A=this;R===void 0&&(R=o);for(var I=arguments.length,O=Array(I>1?I-1:0),N=1;N1?v-1:0),w=1;w=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}i>-1&&(n=n.slice(i+1));var u=Ws("Patches").$;return Hf(r)?u(r,n):this.produce(r,function(o){return u(o,n)})},e}(),xa=new Ope,Ape=xa.produce;xa.produceWithPatches.bind(xa);xa.setAutoFreeze.bind(xa);xa.setUseProxies.bind(xa);xa.applyPatches.bind(xa);xa.createDraft.bind(xa);xa.finishDraft.bind(xa);const Npe=e=>(t,r,n)=>(n.setState=(i,a,...u)=>{const o=typeof i=="function"?Ape(i):i;return t(o,a,...u)},e(n.setState,r,n)),rc=Npe,Dl={prediction:[0,0],categories:[],region:null,status:[jn.initial],deltaTraffic:[-1e3,1e3],factTraffic:[0,0],age:[0,0]},zpe=e=>({filters:Dl,setPrediction:t=>{e(r=>{r.filters.prediction=t})},setDeltaTraffic:t=>{e(r=>{r.filters.deltaTraffic=t})},setFactTraffic:t=>{e(r=>{r.filters.factTraffic=t})},setAge:t=>{e(r=>{r.filters.age=t})},setCategories:t=>e(r=>{r.filters.categories=t}),setRegion:t=>e(r=>{r.filters.region=t}),setStatus:t=>e(r=>{r.filters.status=t})}),Ui=tc(rc(zpe)),Dpe={included:new Set([]),excluded:new Set([])},Lpe=e=>({selection:Dpe,include:t=>{e(r=>{const{excluded:n}=r.selection;n.has(t)?r.selection.excluded.delete(t):r.selection.included.add(t)})},exclude:t=>{e(r=>{const{included:n}=r.selection;n.has(t)?r.selection.included.delete(t):r.selection.excluded.add(t)})},reset:()=>e(t=>{t.selection.included.clear(),t.selection.excluded.clear()})}),Ys=tc(rc(Lpe)),Fpe=()=>{const{selection:e}=Ys();return C.exports.useMemo(()=>e.included.size||e.excluded.size,[e])},y1="https://postnet-dev.selftech.ru",_a=khe.create({baseURL:`${y1}/`,withCredentials:!0,xsrfHeaderName:"X-CSRFToken",xsrfCookieName:"csrftoken"}),rL=(e,t)=>{const r=e||new URLSearchParams;return t&&(t.type==="ao"&&r.append("ao[]",t.id),t.type==="rayon"&&r.append("rayon[]",t.id)),r},Rv=async(e,t)=>{const r=rL(e,t),{data:n}=await _a.get(`/api/placement_points?${r.toString()}`);return n},iE=async(e,t)=>{const r=rL(e,t),{data:n}=await _a.get(`/api/placement_points/to_excel?${r.toString()}`,{responseType:"arraybuffer"});return n},$pe=()=>Za(["all-initial-count"],async()=>{const e=new URLSearchParams({page:1,page_size:1,"status[]":[jn.initial]});return await Rv(e)},{select:e=>e.count}),Bpe=()=>{const{filters:e}=Ui(),{prediction:t,categories:r,region:n}=e,{selection:{included:i}}=Ys(),a=[...i];return Za(["filtered-points",e,a],async()=>{const u=new URLSearchParams({page:1,page_size:1,"prediction_current[]":t,"status[]":[jn.initial],"categories[]":r,"included[]":a});return await Rv(u,n)},{select:u=>u.count,keepPreviousData:!0})},nL=sh(!0),jx=sh(!1),oE=BU(jx,"setAuth",(e,t)=>{e.set(t)});async function Vpe(){try{await _a.get("/accounts/profile/"),oE(!0)}catch{console.log("Not authorized")}finally{nL.set(!1)}}Vpe();class iL extends Error{constructor(r){super("");v6(this,"errors");this.name="DjangoValidationError";const n=[];for(const i in r)n.push({name:i,errors:r[i]});this.errors=n}}const m4=sh(!1),v4=sh(""),jpe="\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0439\u0442\u0438 \u0441 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u043C\u0438 \u0443\u0447\u0435\u0442\u043D\u044B\u043C\u0438 \u0434\u0430\u043D\u043D\u044B\u043C\u0438.";async function Upe(e){var r,n,i,a;m4.set(!0),v4.set("");try{const{data:u}=await _a.post("accounts/login/",e);return oE(!0),u}catch(u){var t=jpe;throw(n=(r=u.response)==null?void 0:r.data)!=null&&n.detail&&(t=(a=(i=u.response)==null?void 0:i.data)==null?void 0:a.detail,v4.set(t)),new iL(u.response.data)}finally{m4.set(!1)}}const g4=sh(!1),oL=sh("");async function Kpe(e){var t;g4.set(!0);try{const{data:r}=await _a.post("accounts/register/",e);return r}catch(r){throw(t=r.response.data)!=null&&t.non_field_errors&&oL.set(r.response.data.non_field_errors.join(" ")),new iL(r.response.data)}finally{g4.set(!1)}}function Hpe(){const e=Uu(v4),t=Uu(m4),r=n=>{Upe(n)};return Qe(b3,{direction:"vertical",style:{width:"320px"},children:[e.length>0?E(ux,{type:"error",showIcon:!0,closable:!0,description:e}):null,E($3.Title,{level:4,children:"\u0412\u0445\u043E\u0434"}),Qe(fs,{disabled:t,name:"basic",layout:"vertical",onFinish:r,autoComplete:"off",children:[E(fs.Item,{label:"\u041B\u043E\u0433\u0438\u043D",name:"login",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:E(Tu,{prefix:E(gD,{className:"site-form-item-icon"}),placeholder:"\u043B\u043E\u0433\u0438\u043D"})}),E(fs.Item,{label:"\u041F\u0430\u0440\u043E\u043B\u044C",name:"password",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:E(Tu,{prefix:E(t4,{className:"site-form-item-icon"}),type:"password",placeholder:"\u043F\u0430\u0440\u043E\u043B\u044C"})}),E(fs.Item,{children:E(In,{block:!0,type:"primary",htmlType:"submit",children:"\u0412\u043E\u0439\u0442\u0438"})}),E("div",{style:{textAlign:"center"},children:E($w,{to:"/register",children:"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F"})})]})]})}function Wpe(){return Uu(jx)?E(V1,{to:"/",replace:!0}):E("main",{className:"w-screen h-screen flex items-center justify-center",children:E(Hpe,{})})}const qpe=e=>{const t=C.exports.useRef(e),r=C.exports.useRef(),n=C.exports.useRef(!1),i=C.exports.useRef(!1),[,a]=C.exports.useState(0);n.current&&(i.current=!0),C.exports.useEffect(()=>(n.current||(r.current=t.current(),n.current=!0),a(u=>u+1),()=>{!i.current||r.current&&r.current()}),[])};function Gpe(){const[e]=LU(),[t,r]=C.exports.useState(!1);return qpe(()=>{async function n(){try{await _a.post("accounts/verify-registration/",{user_id:e.get("user_id"),timestamp:e.get("timestamp"),signature:e.get("signature")})}finally{r(!0)}}n()}),t?E(V1,{to:"/"}):E("div",{children:"Verifying..."})}function Zpe(e){var t=typeof e;return t==="function"||t==="object"&&!!e}function Xpe(){const[e]=fs.useForm(),[t,r]=C.exports.useState(""),n=Uu(oL),i=Uu(g4),a=u=>{Kpe(u).then(()=>{r(`\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043F\u043E\u0447\u0442\u0443 ${u.email} \u0434\u043B\u044F \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430.`)}).catch(o=>{Zpe(o.errors)&&e.setFields(o.errors)})};return t?E(nre,{title:t,status:"success",extra:E($w,{to:"/",children:"\u041D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E"})}):Qe(b3,{direction:"vertical",style:{width:"320px"},children:[n.length>0?E(ux,{type:"error",showIcon:!0,closable:!0,description:n}):null,E($3.Title,{level:4,children:"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F"}),Qe(fs,{form:e,disabled:i,name:"basic",layout:"vertical",onFinish:a,children:[E(fs.Item,{name:"username",label:"\u041B\u043E\u0433\u0438\u043D",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:E(Tu,{prefix:E(gD,{className:"site-form-item-icon"}),placeholder:""})}),E(fs.Item,{name:"email",label:"Email",rules:[{required:!0,type:"email",message:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 email"}],children:E(Tu,{type:"email",autoComplete:"email",prefix:E(cfe,{className:"site-form-item-icon"}),placeholder:""})}),E(fs.Item,{name:"password",label:"\u041F\u0430\u0440\u043E\u043B\u044C",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:E(Tu,{prefix:E(t4,{className:"site-form-item-icon"}),type:"password",autoComplete:"new-password",placeholder:""})}),E(fs.Item,{name:"password_confirm",label:"\u041F\u0430\u0440\u043E\u043B\u044C \u0435\u0449\u0435 \u0440\u0430\u0437",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"},({getFieldValue:u})=>({validator(o,f){return!f||u("password")===f?Promise.resolve():Promise.reject(new Error("\u041F\u0430\u0440\u043E\u043B\u0438 \u043D\u0435 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u044E\u0442"))}})],children:E(Tu,{autoComplete:"re-password",prefix:E(t4,{className:"site-form-item-icon"}),type:"password",placeholder:""})}),E(fs.Item,{children:E(In,{block:!0,type:"primary",htmlType:"submit",children:"\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F"})}),E("div",{style:{textAlign:"center"},children:E($w,{to:"/",children:"\u0423\u0436\u0435 \u0435\u0441\u0442\u044C \u0430\u043A\u043A\u0430\u0443\u043D\u0442"})})]})]})}function Ype(){return Uu(jx)?E(V1,{to:"/",replace:!0}):E("main",{className:"h-screen w-screen flex items-center justify-center",children:E(Xpe,{})})}function Qpe(e){const t=Uu(jx);return Uu(nL)?E(I3,{className:"user-info-loader"}):t?E(Fr,{children:e.children}):E(V1,{to:"/signin",replace:!0})}var aL={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(bl,function(){var r,n,i;function a(o,f){if(!r)r=f;else if(!n)n=f;else{var p="var sharedChunk = {}; ("+r+")(sharedChunk); ("+n+")(sharedChunk);",v={};r(v),i=f(v),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([p],{type:"text/javascript"})))}}a(["exports"],function(o){var f=p;function p(c,s,d,m){this.cx=3*c,this.bx=3*(d-c)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(m-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=c,this.p1y=s,this.p2x=d,this.p2y=m}function v(c,s,d,m){const _=new f(c,s,d,m);return function(S){return _.solve(S)}}p.prototype={sampleCurveX:function(c){return((this.ax*c+this.bx)*c+this.cx)*c},sampleCurveY:function(c){return((this.ay*c+this.by)*c+this.cy)*c},sampleCurveDerivativeX:function(c){return(3*this.ax*c+2*this.bx)*c+this.cx},solveCurveX:function(c,s){if(s===void 0&&(s=1e-6),c<0)return 0;if(c>1)return 1;for(var d=c,m=0;m<8;m++){var _=this.sampleCurveX(d)-c;if(Math.abs(_)_?M=d:D=d,d=.5*(D-M)+M;return d},solve:function(c,s){return this.sampleCurveY(this.solveCurveX(c,s))}};const y=v(.25,.1,.25,1);function w(c,s,d){return Math.min(d,Math.max(s,c))}function k(c,s,d){const m=d-s,_=((c-s)%m+m)%m+s;return _===s?d:_}function T(c,...s){for(const d of s)for(const m in d)c[m]=d[m];return c}let R=1;function A(c,s){c.forEach(d=>{s[d]&&(s[d]=s[d].bind(s))})}function I(c,s,d){const m={};for(const _ in c)m[_]=s.call(d||this,c[_],_,c);return m}function O(c,s,d){const m={};for(const _ in c)s.call(d||this,c[_],_,c)&&(m[_]=c[_]);return m}function N(c){return Array.isArray(c)?c.map(N):typeof c=="object"&&c?I(c,N):c}const L={};function B(c){L[c]||(typeof console<"u"&&console.warn(c),L[c]=!0)}function j(c,s,d){return(d.y-c.y)*(s.x-c.x)>(s.y-c.y)*(d.x-c.x)}function G(c){let s=0;for(let d,m,_=0,S=c.length,M=S-1;_@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(d,m,_,S)=>{const M=_||S;return s[m]=!M||M.toLowerCase(),""}),s["max-age"]){const d=parseInt(s["max-age"],10);isNaN(d)?delete s["max-age"]:s["max-age"]=d}return s}let Y,le,J=null;function Z(c){if(J==null){const s=c.navigator?c.navigator.userAgent:null;J=!!c.safari||!(!s||!(/\b(iPad|iPhone|iPod)\b/.test(s)||s.match("Safari")&&!s.match("Chrome")))}return J}function Q(c){return typeof ImageBitmap<"u"&&c instanceof ImageBitmap}const ge={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(c){const s=requestAnimationFrame(c);return{cancel:()=>cancelAnimationFrame(s)}},getImageData(c,s=0){const d=window.document.createElement("canvas"),m=d.getContext("2d");if(!m)throw new Error("failed to create canvas 2d context");return d.width=c.width,d.height=c.height,m.drawImage(c,0,0,c.width,c.height),m.getImageData(-s,-s,c.width+2*s,c.height+2*s)},resolveURL:c=>(Y||(Y=document.createElement("a")),Y.href=c,Y.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(le==null&&(le=matchMedia("(prefers-reduced-motion: reduce)")),le.matches)}};var ne=de;function de(c,s){this.x=c,this.y=s}de.prototype={clone:function(){return new de(this.x,this.y)},add:function(c){return this.clone()._add(c)},sub:function(c){return this.clone()._sub(c)},multByPoint:function(c){return this.clone()._multByPoint(c)},divByPoint:function(c){return this.clone()._divByPoint(c)},mult:function(c){return this.clone()._mult(c)},div:function(c){return this.clone()._div(c)},rotate:function(c){return this.clone()._rotate(c)},rotateAround:function(c,s){return this.clone()._rotateAround(c,s)},matMult:function(c){return this.clone()._matMult(c)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(c){return this.x===c.x&&this.y===c.y},dist:function(c){return Math.sqrt(this.distSqr(c))},distSqr:function(c){var s=c.x-this.x,d=c.y-this.y;return s*s+d*d},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(c){return Math.atan2(this.y-c.y,this.x-c.x)},angleWith:function(c){return this.angleWithSep(c.x,c.y)},angleWithSep:function(c,s){return Math.atan2(this.x*s-this.y*c,this.x*c+this.y*s)},_matMult:function(c){var s=c[2]*this.x+c[3]*this.y;return this.x=c[0]*this.x+c[1]*this.y,this.y=s,this},_add:function(c){return this.x+=c.x,this.y+=c.y,this},_sub:function(c){return this.x-=c.x,this.y-=c.y,this},_mult:function(c){return this.x*=c,this.y*=c,this},_div:function(c){return this.x/=c,this.y/=c,this},_multByPoint:function(c){return this.x*=c.x,this.y*=c.y,this},_divByPoint:function(c){return this.x/=c.x,this.y/=c.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var c=this.y;return this.y=this.x,this.x=-c,this},_rotate:function(c){var s=Math.cos(c),d=Math.sin(c),m=d*this.x+s*this.y;return this.x=s*this.x-d*this.y,this.y=m,this},_rotateAround:function(c,s){var d=Math.cos(c),m=Math.sin(c),_=s.y+m*(this.x-s.x)+d*(this.y-s.y);return this.x=s.x+d*(this.x-s.x)-m*(this.y-s.y),this.y=_,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},de.convert=function(c){return c instanceof de?c:Array.isArray(c)?new de(c[0],c[1]):c};const oe={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},ye="mapbox-tiles";let Re,Te,ke=500,ze=50;function Ie(){typeof caches>"u"||Re||(Re=caches.open(ye))}let Ne=1/0;const De={supported:!1,testSupport:function(c){!je&&Ge&&(ct?pt(c):Ve=c)}};let Ve,Ge,je=!1,ct=!1;function pt(c){const s=c.createTexture();c.bindTexture(c.TEXTURE_2D,s);try{if(c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,Ge),c.isContextLost())return;De.supported=!0}catch{}c.deleteTexture(s),je=!0}typeof document<"u"&&(Ge=document.createElement("img"),Ge.onload=function(){Ve&&pt(Ve),Ve=null,ct=!0},Ge.onerror=function(){je=!0,Ve=null},Ge.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Tt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Tt);class Xe extends Error{constructor(s,d,m,_){super(`AJAXError: ${d} (${s}): ${m}`),this.status=s,this.statusText=d,this.url=m,this.body=_}}const Pt=H()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function mt(c,s){const d=new AbortController,m=new Request(c.url,{method:c.method||"GET",body:c.body,credentials:c.credentials,headers:c.headers,referrer:Pt(),signal:d.signal});let _=!1,S=!1;return c.type==="json"&&m.headers.set("Accept","application/json"),((M,D,F)=>{if(S)return;const U=Date.now();fetch(m).then(X=>X.ok?((re,ue,he)=>{(c.type==="arrayBuffer"?re.arrayBuffer():c.type==="json"?re.json():re.text()).then(pe=>{S||(ue&&he&&function(Oe,Me,Ze){if(Ie(),!Re)return;const st={status:Me.status,statusText:Me.statusText,headers:new Headers};Me.headers.forEach((nt,kt)=>st.headers.set(kt,nt));const Ke=te(Me.headers.get("Cache-Control")||"");Ke["no-store"]||(Ke["max-age"]&&st.headers.set("Expires",new Date(Ze+1e3*Ke["max-age"]).toUTCString()),new Date(st.headers.get("Expires")).getTime()-Ze<42e4||function(nt,kt){if(Te===void 0)try{new Response(new ReadableStream),Te=!0}catch{Te=!1}Te?kt(nt.body):nt.blob().then(kt)}(Me,nt=>{const kt=new Response(nt,st);Ie(),Re&&Re.then(St=>St.put(function(lr){const hr=lr.indexOf("?");return hr<0?lr:lr.slice(0,hr)}(Oe.url),kt)).catch(St=>B(St.message))}))}(m,ue,he),_=!0,s(null,pe,re.headers.get("Cache-Control"),re.headers.get("Expires")))}).catch(pe=>{S||s(new Error(pe.message))})})(X,null,U):X.blob().then(re=>s(new Xe(X.status,X.statusText,c.url,re)))).catch(X=>{X.code!==20&&s(new Error(X.message))})})(),{cancel:()=>{S=!0,_||d.abort()}}}const It=function(c,s){if(/:\/\//.test(c.url)&&!/^https?:|^file:/.test(c.url)){if(H()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,s);if(!H()){const m=c.url.substring(0,c.url.indexOf("://"));return(oe.REGISTERED_PROTOCOLS[m]||mt)(c,s)}}if(!(/^file:/.test(d=c.url)||/^file:/.test(Pt())&&!/^\w+:/.test(d))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return mt(c,s);if(H()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,s,void 0,!0)}var d;return function(m,_){const S=new XMLHttpRequest;S.open(m.method||"GET",m.url,!0),m.type==="arrayBuffer"&&(S.responseType="arraybuffer");for(const M in m.headers)S.setRequestHeader(M,m.headers[M]);return m.type==="json"&&(S.responseType="text",S.setRequestHeader("Accept","application/json")),S.withCredentials=m.credentials==="include",S.onerror=()=>{_(new Error(S.statusText))},S.onload=()=>{if((S.status>=200&&S.status<300||S.status===0)&&S.response!==null){let M=S.response;if(m.type==="json")try{M=JSON.parse(S.response)}catch(D){return _(D)}_(null,M,S.getResponseHeader("Cache-Control"),S.getResponseHeader("Expires"))}else{const M=new Blob([S.response],{type:S.getResponseHeader("Content-Type")});_(new Xe(S.status,S.statusText,m.url,M))}},S.send(m.body),{cancel:()=>S.abort()}}(c,s)},Ct=function(c,s){return It(T(c,{type:"arrayBuffer"}),s)};function Dt(c){const s=window.document.createElement("a");return s.href=c,s.protocol===window.document.location.protocol&&s.host===window.document.location.host}const lt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let dt,ut;dt=[],ut=0;const it=function(c,s){if(De.supported&&(c.headers||(c.headers={}),c.headers.accept="image/webp,*/*"),ut>=oe.MAX_PARALLEL_IMAGE_REQUESTS){const S={requestParameters:c,callback:s,cancelled:!1,cancel(){this.cancelled=!0}};return dt.push(S),S}ut++;let d=!1;const m=()=>{if(!d)for(d=!0,ut--;dt.length&&ut{m(),S?s(S):M&&function(U,X){typeof createImageBitmap=="function"?function(re,ue){const he=new Blob([new Uint8Array(re)],{type:"image/png"});createImageBitmap(he).then(pe=>{ue(null,pe)}).catch(pe=>{ue(new Error(`Could not load image because of ${pe.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(U,X):function(re,ue){const he=new Image;he.onload=()=>{ue(null,he),URL.revokeObjectURL(he.src),he.onload=null,window.requestAnimationFrame(()=>{he.src=lt})},he.onerror=()=>ue(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const pe=new Blob([new Uint8Array(re)],{type:"image/png"});he.src=re.byteLength?URL.createObjectURL(pe):lt}(U,X)}(M,(U,X)=>{U!=null?s(U):X!=null&&s(null,X,{cacheControl:D,expires:F})})});return{cancel:()=>{_.cancel(),m()}}};function ft(c,s,d){d[c]&&d[c].indexOf(s)!==-1||(d[c]=d[c]||[],d[c].push(s))}function xt(c,s,d){if(d&&d[c]){const m=d[c].indexOf(s);m!==-1&&d[c].splice(m,1)}}class Wt{constructor(s,d={}){T(this,d),this.type=s}}class jt extends Wt{constructor(s,d={}){super("error",T({error:s},d))}}class Qt{on(s,d){return this._listeners=this._listeners||{},ft(s,d,this._listeners),this}off(s,d){return xt(s,d,this._listeners),xt(s,d,this._oneTimeListeners),this}once(s,d){return this._oneTimeListeners=this._oneTimeListeners||{},ft(s,d,this._oneTimeListeners),this}fire(s,d){typeof s=="string"&&(s=new Wt(s,d||{}));const m=s.type;if(this.listens(m)){s.target=this;const _=this._listeners&&this._listeners[m]?this._listeners[m].slice():[];for(const D of _)D.call(this,s);const S=this._oneTimeListeners&&this._oneTimeListeners[m]?this._oneTimeListeners[m].slice():[];for(const D of S)xt(m,D,this._oneTimeListeners),D.call(this,s);const M=this._eventedParent;M&&(T(s,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),M.fire(s))}else s instanceof jt&&console.error(s.error);return this}listens(s){return this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s)}setEventedParent(s,d){return this._eventedParent=s,this._eventedParentData=d,this}}var Fe={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1},elevationOffset:{type:"number",default:450}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class qe{constructor(s,d,m,_){this.message=(s?`${s}: `:"")+m,_&&(this.identifier=_),d!=null&&d.__line__&&(this.line=d.__line__)}}function Xt(c){const s=c.value;return s?[new qe(c.key,s,"constants have been deprecated as of v8")]:[]}function cr(c,...s){for(const d of s)for(const m in d)c[m]=d[m];return c}function Vt(c){return c instanceof Number||c instanceof String||c instanceof Boolean?c.valueOf():c}function Ut(c){if(Array.isArray(c))return c.map(Ut);if(c instanceof Object&&!(c instanceof Number||c instanceof String||c instanceof Boolean)){const s={};for(const d in c)s[d]=Ut(c[d]);return s}return Vt(c)}class rr extends Error{constructor(s,d){super(d),this.message=d,this.key=s}}class xr{constructor(s,d=[]){this.parent=s,this.bindings={};for(const[m,_]of d)this.bindings[m]=_}concat(s){return new xr(this,s)}get(s){if(this.bindings[s])return this.bindings[s];if(this.parent)return this.parent.get(s);throw new Error(`${s} not found in scope.`)}has(s){return!!this.bindings[s]||!!this.parent&&this.parent.has(s)}}const Rr={kind:"null"},_t={kind:"number"},qt={kind:"string"},or={kind:"boolean"},Lr={kind:"color"},Er={kind:"object"},Lt={kind:"value"},kr={kind:"collator"},wr={kind:"formatted"},fr={kind:"padding"},Nt={kind:"resolvedImage"};function ot(c,s){return{kind:"array",itemType:c,N:s}}function ht(c){if(c.kind==="array"){const s=ht(c.itemType);return typeof c.N=="number"?`array<${s}, ${c.N}>`:c.itemType.kind==="value"?"array":`array<${s}>`}return c.kind}const Ot=[Rr,_t,qt,or,Lr,wr,Er,ot(Lt),fr,Nt];function $t(c,s){if(s.kind==="error")return null;if(c.kind==="array"){if(s.kind==="array"&&(s.N===0&&s.itemType.kind==="value"||!$t(c.itemType,s.itemType))&&(typeof c.N!="number"||c.N===s.N))return null}else{if(c.kind===s.kind)return null;if(c.kind==="value"){for(const d of Ot)if(!$t(d,s))return null}}return`Expected ${ht(c)} but found ${ht(s)} instead.`}function ur(c,s){return s.some(d=>d.kind===c.kind)}function Mr(c,s){return s.some(d=>d==="null"?c===null:d==="array"?Array.isArray(c):d==="object"?c&&!Array.isArray(c)&&typeof c=="object":d===typeof c)}var Wr,qr={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function me(c){return(c=Math.round(c))<0?0:c>255?255:c}function K(c){return me(c[c.length-1]==="%"?parseFloat(c)/100*255:parseInt(c))}function q(c){return(s=c[c.length-1]==="%"?parseFloat(c)/100:parseFloat(c))<0?0:s>1?1:s;var s}function ce(c,s,d){return d<0?d+=1:d>1&&(d-=1),6*d<1?c+(s-c)*d*6:2*d<1?s:3*d<2?c+(s-c)*(2/3-d)*6:c}try{Wr={}.parseCSSColor=function(c){var s,d=c.replace(/ /g,"").toLowerCase();if(d in qr)return qr[d].slice();if(d[0]==="#")return d.length===4?(s=parseInt(d.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:d.length===7&&(s=parseInt(d.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var m=d.indexOf("("),_=d.indexOf(")");if(m!==-1&&_+1===d.length){var S=d.substr(0,m),M=d.substr(m+1,_-(m+1)).split(","),D=1;switch(S){case"rgba":if(M.length!==4)return null;D=q(M.pop());case"rgb":return M.length!==3?null:[K(M[0]),K(M[1]),K(M[2]),D];case"hsla":if(M.length!==4)return null;D=q(M.pop());case"hsl":if(M.length!==3)return null;var F=(parseFloat(M[0])%360+360)%360/360,U=q(M[1]),X=q(M[2]),re=X<=.5?X*(U+1):X+U-X*U,ue=2*X-re;return[me(255*ce(ue,re,F+1/3)),me(255*ce(ue,re,F)),me(255*ce(ue,re,F-1/3)),D];default:return null}}return null}}catch{}class ae{constructor(s,d,m,_=1){this.r=s,this.g=d,this.b=m,this.a=_}static parse(s){if(!s)return;if(s instanceof ae)return s;if(typeof s!="string")return;const d=Wr(s);return d?new ae(d[0]/255*d[3],d[1]/255*d[3],d[2]/255*d[3],d[3]):void 0}toString(){const[s,d,m,_]=this.toArray();return`rgba(${Math.round(s)},${Math.round(d)},${Math.round(m)},${_})`}toArray(){const{r:s,g:d,b:m,a:_}=this;return _===0?[0,0,0,0]:[255*s/_,255*d/_,255*m/_,_]}}ae.black=new ae(0,0,0,1),ae.white=new ae(1,1,1,1),ae.transparent=new ae(0,0,0,0),ae.red=new ae(1,0,0,1);class xe{constructor(s,d,m){this.sensitivity=s?d?"variant":"case":d?"accent":"base",this.locale=m,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(s,d){return this.collator.compare(s,d)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ee{constructor(s,d,m,_,S){this.text=s,this.image=d,this.scale=m,this.fontStack=_,this.textColor=S}}class be{constructor(s){this.sections=s}static fromString(s){return new be([new Ee(s,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(s=>s.text.length!==0||s.image&&s.image.name.length!==0)}static factory(s){return s instanceof be?s:be.fromString(s)}toString(){return this.sections.length===0?"":this.sections.map(s=>s.text).join("")}}class Ce{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof Ce)return s;if(typeof s=="number")return new Ce([s,s,s,s]);if(Array.isArray(s)&&!(s.length<1||s.length>4)){for(const d of s)if(typeof d!="number")return;switch(s.length){case 1:s=[s[0],s[0],s[0],s[0]];break;case 2:s=[s[0],s[1],s[0],s[1]];break;case 3:s=[s[0],s[1],s[2],s[1]]}return new Ce(s)}}toString(){return JSON.stringify(this.values)}}class Ae{constructor(s){this.name=s.name,this.available=s.available}toString(){return this.name}static fromString(s){return s?new Ae({name:s,available:!1}):null}}function He(c,s,d,m){return typeof c=="number"&&c>=0&&c<=255&&typeof s=="number"&&s>=0&&s<=255&&typeof d=="number"&&d>=0&&d<=255?m===void 0||typeof m=="number"&&m>=0&&m<=1?null:`Invalid rgba value [${[c,s,d,m].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof m=="number"?[c,s,d,m]:[c,s,d]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function We(c){if(c===null||typeof c=="string"||typeof c=="boolean"||typeof c=="number"||c instanceof ae||c instanceof xe||c instanceof be||c instanceof Ce||c instanceof Ae)return!0;if(Array.isArray(c)){for(const s of c)if(!We(s))return!1;return!0}if(typeof c=="object"){for(const s in c)if(!We(c[s]))return!1;return!0}return!1}function Be(c){if(c===null)return Rr;if(typeof c=="string")return qt;if(typeof c=="boolean")return or;if(typeof c=="number")return _t;if(c instanceof ae)return Lr;if(c instanceof xe)return kr;if(c instanceof be)return wr;if(c instanceof Ce)return fr;if(c instanceof Ae)return Nt;if(Array.isArray(c)){const s=c.length;let d;for(const m of c){const _=Be(m);if(d){if(d===_)continue;d=Lt;break}d=_}return ot(d||Lt,s)}return Er}function At(c){const s=typeof c;return c===null?"":s==="string"||s==="number"||s==="boolean"?String(c):c instanceof ae||c instanceof be||c instanceof Ce||c instanceof Ae?c.toString():JSON.stringify(c)}class bt{constructor(s,d){this.type=s,this.value=d}static parse(s,d){if(s.length!==2)return d.error(`'literal' expression requires exactly one argument, but found ${s.length-1} instead.`);if(!We(s[1]))return d.error("invalid value");const m=s[1];let _=Be(m);const S=d.expectedType;return _.kind!=="array"||_.N!==0||!S||S.kind!=="array"||typeof S.N=="number"&&S.N!==0||(_=S),new bt(_,m)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Je{constructor(s){this.name="ExpressionEvaluationError",this.message=s}toJSON(){return this.message}}const Rt={string:qt,number:_t,boolean:or,object:Er};class Bt{constructor(s,d){this.type=s,this.args=d}static parse(s,d){if(s.length<2)return d.error("Expected at least one argument.");let m,_=1;const S=s[0];if(S==="array"){let D,F;if(s.length>2){const U=s[1];if(typeof U!="string"||!(U in Rt)||U==="object")return d.error('The item type argument of "array" must be one of string, number, boolean',1);D=Rt[U],_++}else D=Lt;if(s.length>3){if(s[2]!==null&&(typeof s[2]!="number"||s[2]<0||s[2]!==Math.floor(s[2])))return d.error('The length argument to "array" must be a positive integer literal',2);F=s[2],_++}m=ot(D,F)}else{if(!Rt[S])throw new Error(`Types doesn't contain name = ${S}`);m=Rt[S]}const M=[];for(;_s.outputDefined())}}const vr={"to-boolean":or,"to-color":Lr,"to-number":_t,"to-string":qt};class ir{constructor(s,d){this.type=s,this.args=d}static parse(s,d){if(s.length<2)return d.error("Expected at least one argument.");const m=s[0];if(!vr[m])throw new Error(`Can't parse ${m} as it is not part of the known types`);if((m==="to-boolean"||m==="to-string")&&s.length!==2)return d.error("Expected one argument.");const _=vr[m],S=[];for(let M=1;M4?`Invalid rbga value ${JSON.stringify(d)}: expected an array containing either three or four numeric values.`:He(d[0],d[1],d[2],d[3]),!m))return new ae(d[0]/255,d[1]/255,d[2]/255,d[3])}throw new Je(m||`Could not parse color from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}if(this.type.kind==="padding"){let d;for(const m of this.args){d=m.evaluate(s);const _=Ce.parse(d);if(_)return _}throw new Je(`Could not parse padding from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}if(this.type.kind==="number"){let d=null;for(const m of this.args){if(d=m.evaluate(s),d===null)return 0;const _=Number(d);if(!isNaN(_))return _}throw new Je(`Could not convert ${JSON.stringify(d)} to number.`)}return this.type.kind==="formatted"?be.fromString(At(this.args[0].evaluate(s))):this.type.kind==="resolvedImage"?Ae.fromString(At(this.args[0].evaluate(s))):At(this.args[0].evaluate(s))}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const gr=["Unknown","Point","LineString","Polygon"];class $r{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?gr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(s){let d=this._parseColorCache[s];return d||(d=this._parseColorCache[s]=ae.parse(s)),d}}class Qr{constructor(s,d,m,_){this.name=s,this.type=d,this._evaluate=m,this.args=_}evaluate(s){return this._evaluate(s,this.args)}eachChild(s){this.args.forEach(s)}outputDefined(){return!1}static parse(s,d){const m=s[0],_=Qr.definitions[m];if(!_)return d.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`,0);const S=Array.isArray(_)?_[0]:_.type,M=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,D=M.filter(([U])=>!Array.isArray(U)||U.length===s.length-1);let F=null;for(const[U,X]of D){F=new Ss(d.registry,d.path,null,d.scope);const re=[];let ue=!1;for(let he=1;he{return ue=re,Array.isArray(ue)?`(${ue.map(ht).join(", ")})`:`(${ht(ue.type)}...)`;var ue}).join(" | "),X=[];for(let re=1;re=s[2]||c[1]<=s[1]||c[3]>=s[3])}function Cr(c,s){const d=(180+c[0])/360,m=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c[1]*Math.PI/360)))/360,_=Math.pow(2,s.z);return[Math.round(d*_*on),Math.round(m*_*on)]}function Ir(c,s,d){const m=c[0]-s[0],_=c[1]-s[1],S=c[0]-d[0],M=c[1]-d[1];return m*M-S*_==0&&m*S<=0&&_*M<=0}function Jn(c,s){let d=!1;for(let M=0,D=s.length;M(m=c)[1]!=(S=F[U+1])[1]>m[1]&&m[0]<(S[0]-_[0])*(m[1]-_[1])/(S[1]-_[1])+_[0]&&(d=!d)}}var m,_,S;return d}function gn(c,s){for(let d=0;d0&&D<0||M<0&&D>0}function zr(c,s,d){for(const U of d)for(let X=0;Xd[2]){const _=.5*m;let S=c[0]-d[0]>_?-m:d[0]-c[0]>_?m:0;S===0&&(S=c[0]-d[2]>_?-m:d[2]-c[0]>_?m:0),c[0]+=S}Rn(s,c)}function Wl(c,s,d,m){const _=Math.pow(2,m.z)*on,S=[m.x*on,m.y*on],M=[];for(const D of c)for(const F of D){const U=[F.x+S[0],F.y+S[1]];bo(U,s,d,_),M.push(U)}return M}function Cd(c,s,d,m){const _=Math.pow(2,m.z)*on,S=[m.x*on,m.y*on],M=[];for(const F of c){const U=[];for(const X of F){const re=[X.x+S[0],X.y+S[1]];Rn(s,re),U.push(re)}M.push(U)}if(s[2]-s[0]<=_/2){(D=s)[0]=D[1]=1/0,D[2]=D[3]=-1/0;for(const F of M)for(const U of F)bo(U,s,d,_)}var D;return M}class Ya{constructor(s,d){this.type=or,this.geojson=s,this.geometries=d}static parse(s,d){if(s.length!==2)return d.error(`'within' expression requires exactly one argument, but found ${s.length-1} instead.`);if(We(s[1])){const m=s[1];if(m.type==="FeatureCollection")for(let _=0;_{s&&!Dr(d)&&(s=!1)}),s}function Gr(c){if(c instanceof Qr&&c.name==="feature-state")return!1;let s=!0;return c.eachChild(d=>{s&&!Gr(d)&&(s=!1)}),s}function On(c,s){if(c instanceof Qr&&s.indexOf(c.name)>=0)return!1;let d=!0;return c.eachChild(m=>{d&&!On(m,s)&&(d=!1)}),d}class Di{constructor(s,d){this.type=d.type,this.name=s,this.boundExpression=d}static parse(s,d){if(s.length!==2||typeof s[1]!="string")return d.error("'var' expression requires exactly one string literal argument.");const m=s[1];return d.scope.has(m)?new Di(m,d.scope.get(m)):d.error(`Unknown variable "${m}". Make sure "${m}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(s){return this.boundExpression.evaluate(s)}eachChild(){}outputDefined(){return!1}}class Ss{constructor(s,d=[],m,_=new xr,S=[]){this.registry=s,this.path=d,this.key=d.map(M=>`[${M}]`).join(""),this.scope=_,this.errors=S,this.expectedType=m}parse(s,d,m,_,S={}){return d?this.concat(d,m,_)._parse(s,S):this._parse(s,S)}_parse(s,d){function m(_,S,M){return M==="assert"?new Bt(S,[_]):M==="coerce"?new ir(S,[_]):_}if(s!==null&&typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"||(s=["literal",s]),Array.isArray(s)){if(s.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const _=s[0];if(typeof _!="string")return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const S=this.registry[_];if(S){let M=S.parse(s,this);if(!M)return null;if(this.expectedType){const D=this.expectedType,F=M.type;if(D.kind!=="string"&&D.kind!=="number"&&D.kind!=="boolean"&&D.kind!=="object"&&D.kind!=="array"||F.kind!=="value")if(D.kind!=="color"&&D.kind!=="formatted"&&D.kind!=="resolvedImage"||F.kind!=="value"&&F.kind!=="string")if(D.kind!=="padding"||F.kind!=="value"&&F.kind!=="number"&&F.kind!=="array"){if(this.checkSubtype(D,F))return null}else M=m(M,D,d.typeAnnotation||"coerce");else M=m(M,D,d.typeAnnotation||"coerce");else M=m(M,D,d.typeAnnotation||"assert")}if(!(M instanceof bt)&&M.type.kind!=="resolvedImage"&&Vo(M)){const D=new $r;try{M=new bt(M.type,M.evaluate(D))}catch(F){return this.error(F.message),null}}return M}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(s===void 0?"'undefined' value invalid. Use null instead.":typeof s=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof s} instead.`)}concat(s,d,m){const _=typeof s=="number"?this.path.concat(s):this.path,S=m?this.scope.concat(m):this.scope;return new Ss(this.registry,_,d||null,S,this.errors)}error(s,...d){const m=`${this.key}${d.map(_=>`[${_}]`).join("")}`;this.errors.push(new rr(m,s))}checkSubtype(s,d){const m=$t(s,d);return m&&this.error(m),m}}function Vo(c){if(c instanceof Di)return Vo(c.boundExpression);if(c instanceof Qr&&c.name==="error"||c instanceof $n||c instanceof Ya)return!1;const s=c instanceof ir||c instanceof Bt;let d=!0;return c.eachChild(m=>{d=s?d&&Vo(m):d&&m instanceof bt}),!!d&&Dr(c)&&On(c,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Js(c,s){const d=c.length-1;let m,_,S=0,M=d,D=0;for(;S<=M;)if(D=Math.floor((S+M)/2),m=c[D],_=c[D+1],m<=s){if(D===d||s<_)return D;S=D+1}else{if(!(m>s))throw new Je("Input is not a number.");M=D-1}return 0}class Qa{constructor(s,d,m){this.type=s,this.input=d,this.labels=[],this.outputs=[];for(const[_,S]of m)this.labels.push(_),this.outputs.push(S)}static parse(s,d){if(s.length-1<4)return d.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return d.error("Expected an even number of arguments.");const m=d.parse(s[1],1,_t);if(!m)return null;const _=[];let S=null;d.expectedType&&d.expectedType.kind!=="value"&&(S=d.expectedType);for(let M=1;M=D)return d.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',U);const re=d.parse(F,X,S);if(!re)return null;S=S||re.type,_.push([D,re])}return new Qa(S,m,_)}evaluate(s){const d=this.labels,m=this.outputs;if(d.length===1)return m[0].evaluate(s);const _=this.input.evaluate(s);if(_<=d[0])return m[0].evaluate(s);const S=d.length;return _>=d[S-1]?m[S-1].evaluate(s):m[Js(d,_)].evaluate(s)}eachChild(s){s(this.input);for(const d of this.outputs)s(d)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function yn(c,s,d){return c*(1-d)+s*d}var Ja=Object.freeze({__proto__:null,number:yn,color:function(c,s,d){return new ae(yn(c.r,s.r,d),yn(c.g,s.g,d),yn(c.b,s.b,d),yn(c.a,s.a,d))},array:function(c,s,d){return c.map((m,_)=>yn(m,s[_],d))},padding:function(c,s,d){const m=c.values,_=s.values;return new Ce([yn(m[0],_[0],d),yn(m[1],_[1],d),yn(m[2],_[2],d),yn(m[3],_[3],d)])}});const Vv=.95047,jv=1.08883,Rh=4/29,Sd=6/29,Uv=3*Sd*Sd,t_=Math.PI/180,r_=180/Math.PI;function Oh(c){return c>.008856451679035631?Math.pow(c,1/3):c/Uv+Rh}function Ah(c){return c>Sd?c*c*c:Uv*(c-Rh)}function Nh(c){return 255*(c<=.0031308?12.92*c:1.055*Math.pow(c,1/2.4)-.055)}function zh(c){return(c/=255)<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}function an(c){const s=zh(c.r),d=zh(c.g),m=zh(c.b),_=Oh((.4124564*s+.3575761*d+.1804375*m)/Vv),S=Oh((.2126729*s+.7151522*d+.072175*m)/1);return{l:116*S-16,a:500*(_-S),b:200*(S-Oh((.0193339*s+.119192*d+.9503041*m)/jv)),alpha:c.a}}function Kv(c){let s=(c.l+16)/116,d=isNaN(c.a)?s:s+c.a/500,m=isNaN(c.b)?s:s-c.b/200;return s=1*Ah(s),d=Vv*Ah(d),m=jv*Ah(m),new ae(Nh(3.2404542*d-1.5371385*s-.4985314*m),Nh(-.969266*d+1.8760108*s+.041556*m),Nh(.0556434*d-.2040259*s+1.0572252*m),c.alpha)}function n_(c,s,d){const m=s-c;return c+d*(m>180||m<-180?m-360*Math.round(m/360):m)}const ac={forward:an,reverse:Kv,interpolate:function(c,s,d){return{l:yn(c.l,s.l,d),a:yn(c.a,s.a,d),b:yn(c.b,s.b,d),alpha:yn(c.alpha,s.alpha,d)}}},sc={forward:function(c){const{l:s,a:d,b:m}=an(c),_=Math.atan2(m,d)*r_;return{h:_<0?_+360:_,c:Math.sqrt(d*d+m*m),l:s,alpha:c.a}},reverse:function(c){const s=c.h*t_,d=c.c;return Kv({l:c.l,a:Math.cos(s)*d,b:Math.sin(s)*d,alpha:c.alpha})},interpolate:function(c,s,d){return{h:n_(c.h,s.h,d),c:yn(c.c,s.c,d),l:yn(c.l,s.l,d),alpha:yn(c.alpha,s.alpha,d)}}};var Hv=Object.freeze({__proto__:null,lab:ac,hcl:sc});class wo{constructor(s,d,m,_,S){this.type=s,this.operator=d,this.interpolation=m,this.input=_,this.labels=[],this.outputs=[];for(const[M,D]of S)this.labels.push(M),this.outputs.push(D)}static interpolationFactor(s,d,m,_){let S=0;if(s.name==="exponential")S=Dh(d,s.base,m,_);else if(s.name==="linear")S=Dh(d,1,m,_);else if(s.name==="cubic-bezier"){const M=s.controlPoints;S=new f(M[0],M[1],M[2],M[3]).solve(Dh(d,1,m,_))}return S}static parse(s,d){let[m,_,S,...M]=s;if(!Array.isArray(_)||_.length===0)return d.error("Expected an interpolation type expression.",1);if(_[0]==="linear")_={name:"linear"};else if(_[0]==="exponential"){const U=_[1];if(typeof U!="number")return d.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:U}}else{if(_[0]!=="cubic-bezier")return d.error(`Unknown interpolation type ${String(_[0])}`,1,0);{const U=_.slice(1);if(U.length!==4||U.some(X=>typeof X!="number"||X<0||X>1))return d.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:U}}}if(s.length-1<4)return d.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return d.error("Expected an even number of arguments.");if(S=d.parse(S,2,_t),!S)return null;const D=[];let F=null;m==="interpolate-hcl"||m==="interpolate-lab"?F=Lr:d.expectedType&&d.expectedType.kind!=="value"&&(F=d.expectedType);for(let U=0;U=X)return d.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ue);const pe=d.parse(re,he,F);if(!pe)return null;F=F||pe.type,D.push([X,pe])}return F.kind==="number"||F.kind==="color"||F.kind==="padding"||F.kind==="array"&&F.itemType.kind==="number"&&typeof F.N=="number"?new wo(F,m,_,S,D):d.error(`Type ${ht(F)} is not interpolatable.`)}evaluate(s){const d=this.labels,m=this.outputs;if(d.length===1)return m[0].evaluate(s);const _=this.input.evaluate(s);if(_<=d[0])return m[0].evaluate(s);const S=d.length;if(_>=d[S-1])return m[S-1].evaluate(s);const M=Js(d,_),D=wo.interpolationFactor(this.interpolation,_,d[M],d[M+1]),F=m[M].evaluate(s),U=m[M+1].evaluate(s);return this.operator==="interpolate"?Ja[this.type.kind.toLowerCase()](F,U,D):this.operator==="interpolate-hcl"?sc.reverse(sc.interpolate(sc.forward(F),sc.forward(U),D)):ac.reverse(ac.interpolate(ac.forward(F),ac.forward(U),D))}eachChild(s){s(this.input);for(const d of this.outputs)s(d)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function Dh(c,s,d,m){const _=m-d,S=c-d;return _===0?0:s===1?S/_:(Math.pow(s,S)-1)/(Math.pow(s,_)-1)}class Ed{constructor(s,d){this.type=s,this.args=d}static parse(s,d){if(s.length<2)return d.error("Expectected at least one argument.");let m=null;const _=d.expectedType;_&&_.kind!=="value"&&(m=_);const S=[];for(const D of s.slice(1)){const F=d.parse(D,1+S.length,m,void 0,{typeAnnotation:"omit"});if(!F)return null;m=m||F.type,S.push(F)}if(!m)throw new Error("No output type");const M=_&&S.some(D=>$t(_,D.type));return new Ed(M?Lt:m,S)}evaluate(s){let d,m=null,_=0;for(const S of this.args)if(_++,m=S.evaluate(s),m&&m instanceof Ae&&!m.available&&(d||(d=m.name),m=null,_===this.args.length&&(m=d)),m!==null)break;return m}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}class kd{constructor(s,d){this.type=d.type,this.bindings=[].concat(s),this.result=d}evaluate(s){return this.result.evaluate(s)}eachChild(s){for(const d of this.bindings)s(d[1]);s(this.result)}static parse(s,d){if(s.length<4)return d.error(`Expected at least 3 arguments, but found ${s.length-1} instead.`);const m=[];for(let S=1;S=m.length)throw new Je(`Array index out of bounds: ${d} > ${m.length-1}.`);if(d!==Math.floor(d))throw new Je(`Array index must be an integer, but found ${d} instead.`);return m[d]}eachChild(s){s(this.index),s(this.input)}outputDefined(){return!1}}class Fh{constructor(s,d){this.type=or,this.needle=s,this.haystack=d}static parse(s,d){if(s.length!==3)return d.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const m=d.parse(s[1],1,Lt),_=d.parse(s[2],2,Lt);return m&&_?ur(m.type,[or,qt,_t,Rr,Lt])?new Fh(m,_):d.error(`Expected first argument to be of type boolean, string, number or null, but found ${ht(m.type)} instead`):null}evaluate(s){const d=this.needle.evaluate(s),m=this.haystack.evaluate(s);if(!m)return!1;if(!Mr(d,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${ht(Be(d))} instead.`);if(!Mr(m,["string","array"]))throw new Je(`Expected second argument to be of type array or string, but found ${ht(Be(m))} instead.`);return m.indexOf(d)>=0}eachChild(s){s(this.needle),s(this.haystack)}outputDefined(){return!0}}class Td{constructor(s,d,m){this.type=_t,this.needle=s,this.haystack=d,this.fromIndex=m}static parse(s,d){if(s.length<=2||s.length>=5)return d.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const m=d.parse(s[1],1,Lt),_=d.parse(s[2],2,Lt);if(!m||!_)return null;if(!ur(m.type,[or,qt,_t,Rr,Lt]))return d.error(`Expected first argument to be of type boolean, string, number or null, but found ${ht(m.type)} instead`);if(s.length===4){const S=d.parse(s[3],3,_t);return S?new Td(m,_,S):null}return new Td(m,_)}evaluate(s){const d=this.needle.evaluate(s),m=this.haystack.evaluate(s);if(!Mr(d,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${ht(Be(d))} instead.`);if(!Mr(m,["string","array"]))throw new Je(`Expected second argument to be of type array or string, but found ${ht(Be(m))} instead.`);if(this.fromIndex){const _=this.fromIndex.evaluate(s);return m.indexOf(d,_)}return m.indexOf(d)}eachChild(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)}outputDefined(){return!1}}class $h{constructor(s,d,m,_,S,M){this.inputType=s,this.type=d,this.input=m,this.cases=_,this.outputs=S,this.otherwise=M}static parse(s,d){if(s.length<5)return d.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if(s.length%2!=1)return d.error("Expected an even number of arguments.");let m,_;d.expectedType&&d.expectedType.kind!=="value"&&(_=d.expectedType);const S={},M=[];for(let U=2;UNumber.MAX_SAFE_INTEGER)return ue.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof pe=="number"&&Math.floor(pe)!==pe)return ue.error("Numeric branch labels must be integer values.");if(m){if(ue.checkSubtype(m,Be(pe)))return null}else m=Be(pe);if(S[String(pe)]!==void 0)return ue.error("Branch labels must be unique.");S[String(pe)]=M.length}const he=d.parse(re,U,_);if(!he)return null;_=_||he.type,M.push(he)}const D=d.parse(s[1],1,Lt);if(!D)return null;const F=d.parse(s[s.length-1],s.length-1,_);return F?D.type.kind!=="value"&&d.concat(1).checkSubtype(m,D.type)?null:new $h(m,_,D,S,M,F):null}evaluate(s){const d=this.input.evaluate(s);return(Be(d)===this.inputType&&this.outputs[this.cases[d]]||this.otherwise).evaluate(s)}eachChild(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)}outputDefined(){return this.outputs.every(s=>s.outputDefined())&&this.otherwise.outputDefined()}}class Bh{constructor(s,d,m){this.type=s,this.branches=d,this.otherwise=m}static parse(s,d){if(s.length<4)return d.error(`Expected at least 3 arguments, but found only ${s.length-1}.`);if(s.length%2!=0)return d.error("Expected an odd number of arguments.");let m;d.expectedType&&d.expectedType.kind!=="value"&&(m=d.expectedType);const _=[];for(let M=1;Md.outputDefined())&&this.otherwise.outputDefined()}}class Pd{constructor(s,d,m,_){this.type=s,this.input=d,this.beginIndex=m,this.endIndex=_}static parse(s,d){if(s.length<=2||s.length>=5)return d.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const m=d.parse(s[1],1,Lt),_=d.parse(s[2],2,_t);if(!m||!_)return null;if(!ur(m.type,[ot(Lt),qt,Lt]))return d.error(`Expected first argument to be of type array or string, but found ${ht(m.type)} instead`);if(s.length===4){const S=d.parse(s[3],3,_t);return S?new Pd(m.type,m,_,S):null}return new Pd(m.type,m,_)}evaluate(s){const d=this.input.evaluate(s),m=this.beginIndex.evaluate(s);if(!Mr(d,["string","array"]))throw new Je(`Expected first argument to be of type array or string, but found ${ht(Be(d))} instead.`);if(this.endIndex){const _=this.endIndex.evaluate(s);return d.slice(m,_)}return d.slice(m)}eachChild(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)}outputDefined(){return!1}}function Wv(c,s){return c==="=="||c==="!="?s.kind==="boolean"||s.kind==="string"||s.kind==="number"||s.kind==="null"||s.kind==="value":s.kind==="string"||s.kind==="number"||s.kind==="value"}function qv(c,s,d,m){return m.compare(s,d)===0}function ql(c,s,d){const m=c!=="=="&&c!=="!=";return class sL{constructor(S,M,D){this.type=or,this.lhs=S,this.rhs=M,this.collator=D,this.hasUntypedArgument=S.type.kind==="value"||M.type.kind==="value"}static parse(S,M){if(S.length!==3&&S.length!==4)return M.error("Expected two or three arguments.");const D=S[0];let F=M.parse(S[1],1,Lt);if(!F)return null;if(!Wv(D,F.type))return M.concat(1).error(`"${D}" comparisons are not supported for type '${ht(F.type)}'.`);let U=M.parse(S[2],2,Lt);if(!U)return null;if(!Wv(D,U.type))return M.concat(2).error(`"${D}" comparisons are not supported for type '${ht(U.type)}'.`);if(F.type.kind!==U.type.kind&&F.type.kind!=="value"&&U.type.kind!=="value")return M.error(`Cannot compare types '${ht(F.type)}' and '${ht(U.type)}'.`);m&&(F.type.kind==="value"&&U.type.kind!=="value"?F=new Bt(U.type,[F]):F.type.kind!=="value"&&U.type.kind==="value"&&(U=new Bt(F.type,[U])));let X=null;if(S.length===4){if(F.type.kind!=="string"&&U.type.kind!=="string"&&F.type.kind!=="value"&&U.type.kind!=="value")return M.error("Cannot use collator to compare non-string types.");if(X=M.parse(S[3],3,kr),!X)return null}return new sL(F,U,X)}evaluate(S){const M=this.lhs.evaluate(S),D=this.rhs.evaluate(S);if(m&&this.hasUntypedArgument){const F=Be(M),U=Be(D);if(F.kind!==U.kind||F.kind!=="string"&&F.kind!=="number")throw new Je(`Expected arguments for "${c}" to be (string, string) or (number, number), but found (${F.kind}, ${U.kind}) instead.`)}if(this.collator&&!m&&this.hasUntypedArgument){const F=Be(M),U=Be(D);if(F.kind!=="string"||U.kind!=="string")return s(S,M,D)}return this.collator?d(S,M,D,this.collator.evaluate(S)):s(S,M,D)}eachChild(S){S(this.lhs),S(this.rhs),this.collator&&S(this.collator)}outputDefined(){return!0}}}const i_=ql("==",function(c,s,d){return s===d},qv),o_=ql("!=",function(c,s,d){return s!==d},function(c,s,d,m){return!qv(0,s,d,m)}),a_=ql("<",function(c,s,d){return s",function(c,s,d){return s>d},function(c,s,d,m){return m.compare(s,d)>0}),l_=ql("<=",function(c,s,d){return s<=d},function(c,s,d,m){return m.compare(s,d)<=0}),u_=ql(">=",function(c,s,d){return s>=d},function(c,s,d,m){return m.compare(s,d)>=0});class Vh{constructor(s,d,m,_,S){this.type=qt,this.number=s,this.locale=d,this.currency=m,this.minFractionDigits=_,this.maxFractionDigits=S}static parse(s,d){if(s.length!==3)return d.error("Expected two arguments.");const m=d.parse(s[1],1,_t);if(!m)return null;const _=s[2];if(typeof _!="object"||Array.isArray(_))return d.error("NumberFormat options argument must be an object.");let S=null;if(_.locale&&(S=d.parse(_.locale,1,qt),!S))return null;let M=null;if(_.currency&&(M=d.parse(_.currency,1,qt),!M))return null;let D=null;if(_["min-fraction-digits"]&&(D=d.parse(_["min-fraction-digits"],1,_t),!D))return null;let F=null;return _["max-fraction-digits"]&&(F=d.parse(_["max-fraction-digits"],1,_t),!F)?null:new Vh(m,S,M,D,F)}evaluate(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))}eachChild(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)}outputDefined(){return!1}}class Md{constructor(s){this.type=wr,this.sections=s}static parse(s,d){if(s.length<2)return d.error("Expected at least one argument.");const m=s[1];if(!Array.isArray(m)&&typeof m=="object")return d.error("First argument must be an image or text section.");const _=[];let S=!1;for(let M=1;M<=s.length-1;++M){const D=s[M];if(S&&typeof D=="object"&&!Array.isArray(D)){S=!1;let F=null;if(D["font-scale"]&&(F=d.parse(D["font-scale"],1,_t),!F))return null;let U=null;if(D["text-font"]&&(U=d.parse(D["text-font"],1,ot(qt)),!U))return null;let X=null;if(D["text-color"]&&(X=d.parse(D["text-color"],1,Lr),!X))return null;const re=_[_.length-1];re.scale=F,re.font=U,re.textColor=X}else{const F=d.parse(s[M],1,Lt);if(!F)return null;const U=F.type.kind;if(U!=="string"&&U!=="value"&&U!=="null"&&U!=="resolvedImage")return d.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");S=!0,_.push({content:F,scale:null,font:null,textColor:null})}}return new Md(_)}evaluate(s){return new be(this.sections.map(d=>{const m=d.content.evaluate(s);return Be(m)===Nt?new Ee("",m,null,null,null):new Ee(At(m),null,d.scale?d.scale.evaluate(s):null,d.font?d.font.evaluate(s).join(","):null,d.textColor?d.textColor.evaluate(s):null)}))}eachChild(s){for(const d of this.sections)s(d.content),d.scale&&s(d.scale),d.font&&s(d.font),d.textColor&&s(d.textColor)}outputDefined(){return!1}}class jh{constructor(s){this.type=Nt,this.input=s}static parse(s,d){if(s.length!==2)return d.error("Expected two arguments.");const m=d.parse(s[1],1,qt);return m?new jh(m):d.error("No image name provided.")}evaluate(s){const d=this.input.evaluate(s),m=Ae.fromString(d);return m&&s.availableImages&&(m.available=s.availableImages.indexOf(d)>-1),m}eachChild(s){s(this.input)}outputDefined(){return!1}}class Uh{constructor(s){this.type=_t,this.input=s}static parse(s,d){if(s.length!==2)return d.error(`Expected 1 argument, but found ${s.length-1} instead.`);const m=d.parse(s[1],1);return m?m.type.kind!=="array"&&m.type.kind!=="string"&&m.type.kind!=="value"?d.error(`Expected argument of type string or array, but found ${ht(m.type)} instead.`):new Uh(m):null}evaluate(s){const d=this.input.evaluate(s);if(typeof d=="string"||Array.isArray(d))return d.length;throw new Je(`Expected value to be of type string or array, but found ${ht(Be(d))} instead.`)}eachChild(s){s(this.input)}outputDefined(){return!1}}const Gl={"==":i_,"!=":o_,">":s_,"<":a_,">=":u_,"<=":l_,array:Bt,at:Lh,boolean:Bt,case:Bh,coalesce:Ed,collator:$n,format:Md,image:jh,in:Fh,"index-of":Td,interpolate:wo,"interpolate-hcl":wo,"interpolate-lab":wo,length:Uh,let:kd,literal:bt,match:$h,number:Bt,"number-format":Vh,object:Bt,slice:Pd,step:Qa,string:Bt,"to-boolean":ir,"to-color":ir,"to-number":ir,"to-string":ir,var:Di,within:Ya};function Gv(c,[s,d,m,_]){s=s.evaluate(c),d=d.evaluate(c),m=m.evaluate(c);const S=_?_.evaluate(c):1,M=He(s,d,m,S);if(M)throw new Je(M);return new ae(s/255*S,d/255*S,m/255*S,S)}function Zv(c,s){return c in s}function Id(c,s){const d=s[c];return d===void 0?null:d}function el(c){return{type:c}}function Xv(c){return{result:"success",value:c}}function Zl(c){return{result:"error",value:c}}function Tn(c){return c["property-type"]==="data-driven"||c["property-type"]==="cross-faded-data-driven"}function Yv(c){return!!c.expression&&c.expression.parameters.indexOf("zoom")>-1}function Zr(c){return!!c.expression&&c.expression.interpolated}function sn(c){return c instanceof Number?"number":c instanceof String?"string":c instanceof Boolean?"boolean":Array.isArray(c)?"array":c===null?"null":typeof c}function Sn(c){return typeof c=="object"&&c!==null&&!Array.isArray(c)}function An(c){return c}function lc(c,s){const d=s.type==="color",m=c.stops&&typeof c.stops[0][0]=="object",_=m||!(m||c.property!==void 0),S=c.type||(Zr(s)?"exponential":"interval");if(d||s.type==="padding"){const U=d?ae.parse:Ce.parse;(c=cr({},c)).stops&&(c.stops=c.stops.map(X=>[X[0],U(X[1])])),c.default=U(c.default?c.default:s.default)}if(c.colorSpace&&c.colorSpace!=="rgb"&&!Hv[c.colorSpace])throw new Error(`Unknown color space: ${c.colorSpace}`);let M,D,F;if(S==="exponential")M=Qv;else if(S==="interval")M=d_;else if(S==="categorical"){M=c_,D=Object.create(null);for(const U of c.stops)D[U[0]]=U[1];F=typeof c.stops[0][0]}else{if(S!=="identity")throw new Error(`Unknown function type "${S}"`);M=f_}if(m){const U={},X=[];for(let he=0;hehe[0]),evaluate:({zoom:he},pe)=>Qv({stops:re,base:c.base},s,he).evaluate(he,pe)}}if(_){const U=S==="exponential"?{name:"exponential",base:c.base!==void 0?c.base:1}:null;return{kind:"camera",interpolationType:U,interpolationFactor:wo.interpolationFactor.bind(void 0,U),zoomStops:c.stops.map(X=>X[0]),evaluate:({zoom:X})=>M(c,s,X,D,F)}}return{kind:"source",evaluate(U,X){const re=X&&X.properties?X.properties[c.property]:void 0;return re===void 0?Xl(c.default,s.default):M(c,s,re,D,F)}}}function Xl(c,s,d){return c!==void 0?c:s!==void 0?s:d!==void 0?d:void 0}function c_(c,s,d,m,_){return Xl(typeof d===_?m[d]:void 0,c.default,s.default)}function d_(c,s,d){if(sn(d)!=="number")return Xl(c.default,s.default);const m=c.stops.length;if(m===1||d<=c.stops[0][0])return c.stops[0][1];if(d>=c.stops[m-1][0])return c.stops[m-1][1];const _=Js(c.stops.map(S=>S[0]),d);return c.stops[_][1]}function Qv(c,s,d){const m=c.base!==void 0?c.base:1;if(sn(d)!=="number")return Xl(c.default,s.default);const _=c.stops.length;if(_===1||d<=c.stops[0][0])return c.stops[0][1];if(d>=c.stops[_-1][0])return c.stops[_-1][1];const S=Js(c.stops.map(X=>X[0]),d),M=function(X,re,ue,he){const pe=he-ue,Oe=X-ue;return pe===0?0:re===1?Oe/pe:(Math.pow(re,Oe)-1)/(Math.pow(re,pe)-1)}(d,m,c.stops[S][0],c.stops[S+1][0]),D=c.stops[S][1],F=c.stops[S+1][1];let U=Ja[s.type]||An;if(c.colorSpace&&c.colorSpace!=="rgb"){const X=Hv[c.colorSpace];U=(re,ue)=>X.reverse(X.interpolate(X.forward(re),X.forward(ue),M))}return typeof D.evaluate=="function"?{evaluate(...X){const re=D.evaluate.apply(void 0,X),ue=F.evaluate.apply(void 0,X);if(re!==void 0&&ue!==void 0)return U(re,ue,M)}}:U(D,F,M)}function f_(c,s,d){switch(s.type){case"color":d=ae.parse(d);break;case"formatted":d=be.fromString(d.toString());break;case"resolvedImage":d=Ae.fromString(d.toString());break;case"padding":d=Ce.parse(d);break;default:sn(d)===s.type||s.type==="enum"&&s.values[d]||(d=void 0)}return Xl(d,c.default,s.default)}Qr.register(Gl,{error:[{kind:"error"},[qt],(c,[s])=>{throw new Je(s.evaluate(c))}],typeof:[qt,[Lt],(c,[s])=>ht(Be(s.evaluate(c)))],"to-rgba":[ot(_t,4),[Lr],(c,[s])=>s.evaluate(c).toArray()],rgb:[Lr,[_t,_t,_t],Gv],rgba:[Lr,[_t,_t,_t,_t],Gv],has:{type:or,overloads:[[[qt],(c,[s])=>Zv(s.evaluate(c),c.properties())],[[qt,Er],(c,[s,d])=>Zv(s.evaluate(c),d.evaluate(c))]]},get:{type:Lt,overloads:[[[qt],(c,[s])=>Id(s.evaluate(c),c.properties())],[[qt,Er],(c,[s,d])=>Id(s.evaluate(c),d.evaluate(c))]]},"feature-state":[Lt,[qt],(c,[s])=>Id(s.evaluate(c),c.featureState||{})],properties:[Er,[],c=>c.properties()],"geometry-type":[qt,[],c=>c.geometryType()],id:[Lt,[],c=>c.id()],zoom:[_t,[],c=>c.globals.zoom],"heatmap-density":[_t,[],c=>c.globals.heatmapDensity||0],"line-progress":[_t,[],c=>c.globals.lineProgress||0],accumulated:[Lt,[],c=>c.globals.accumulated===void 0?null:c.globals.accumulated],"+":[_t,el(_t),(c,s)=>{let d=0;for(const m of s)d+=m.evaluate(c);return d}],"*":[_t,el(_t),(c,s)=>{let d=1;for(const m of s)d*=m.evaluate(c);return d}],"-":{type:_t,overloads:[[[_t,_t],(c,[s,d])=>s.evaluate(c)-d.evaluate(c)],[[_t],(c,[s])=>-s.evaluate(c)]]},"/":[_t,[_t,_t],(c,[s,d])=>s.evaluate(c)/d.evaluate(c)],"%":[_t,[_t,_t],(c,[s,d])=>s.evaluate(c)%d.evaluate(c)],ln2:[_t,[],()=>Math.LN2],pi:[_t,[],()=>Math.PI],e:[_t,[],()=>Math.E],"^":[_t,[_t,_t],(c,[s,d])=>Math.pow(s.evaluate(c),d.evaluate(c))],sqrt:[_t,[_t],(c,[s])=>Math.sqrt(s.evaluate(c))],log10:[_t,[_t],(c,[s])=>Math.log(s.evaluate(c))/Math.LN10],ln:[_t,[_t],(c,[s])=>Math.log(s.evaluate(c))],log2:[_t,[_t],(c,[s])=>Math.log(s.evaluate(c))/Math.LN2],sin:[_t,[_t],(c,[s])=>Math.sin(s.evaluate(c))],cos:[_t,[_t],(c,[s])=>Math.cos(s.evaluate(c))],tan:[_t,[_t],(c,[s])=>Math.tan(s.evaluate(c))],asin:[_t,[_t],(c,[s])=>Math.asin(s.evaluate(c))],acos:[_t,[_t],(c,[s])=>Math.acos(s.evaluate(c))],atan:[_t,[_t],(c,[s])=>Math.atan(s.evaluate(c))],min:[_t,el(_t),(c,s)=>Math.min(...s.map(d=>d.evaluate(c)))],max:[_t,el(_t),(c,s)=>Math.max(...s.map(d=>d.evaluate(c)))],abs:[_t,[_t],(c,[s])=>Math.abs(s.evaluate(c))],round:[_t,[_t],(c,[s])=>{const d=s.evaluate(c);return d<0?-Math.round(-d):Math.round(d)}],floor:[_t,[_t],(c,[s])=>Math.floor(s.evaluate(c))],ceil:[_t,[_t],(c,[s])=>Math.ceil(s.evaluate(c))],"filter-==":[or,[qt,Lt],(c,[s,d])=>c.properties()[s.value]===d.value],"filter-id-==":[or,[Lt],(c,[s])=>c.id()===s.value],"filter-type-==":[or,[qt],(c,[s])=>c.geometryType()===s.value],"filter-<":[or,[qt,Lt],(c,[s,d])=>{const m=c.properties()[s.value],_=d.value;return typeof m==typeof _&&m<_}],"filter-id-<":[or,[Lt],(c,[s])=>{const d=c.id(),m=s.value;return typeof d==typeof m&&d":[or,[qt,Lt],(c,[s,d])=>{const m=c.properties()[s.value],_=d.value;return typeof m==typeof _&&m>_}],"filter-id->":[or,[Lt],(c,[s])=>{const d=c.id(),m=s.value;return typeof d==typeof m&&d>m}],"filter-<=":[or,[qt,Lt],(c,[s,d])=>{const m=c.properties()[s.value],_=d.value;return typeof m==typeof _&&m<=_}],"filter-id-<=":[or,[Lt],(c,[s])=>{const d=c.id(),m=s.value;return typeof d==typeof m&&d<=m}],"filter->=":[or,[qt,Lt],(c,[s,d])=>{const m=c.properties()[s.value],_=d.value;return typeof m==typeof _&&m>=_}],"filter-id->=":[or,[Lt],(c,[s])=>{const d=c.id(),m=s.value;return typeof d==typeof m&&d>=m}],"filter-has":[or,[Lt],(c,[s])=>s.value in c.properties()],"filter-has-id":[or,[],c=>c.id()!==null&&c.id()!==void 0],"filter-type-in":[or,[ot(qt)],(c,[s])=>s.value.indexOf(c.geometryType())>=0],"filter-id-in":[or,[ot(Lt)],(c,[s])=>s.value.indexOf(c.id())>=0],"filter-in-small":[or,[qt,ot(Lt)],(c,[s,d])=>d.value.indexOf(c.properties()[s.value])>=0],"filter-in-large":[or,[qt,ot(Lt)],(c,[s,d])=>function(m,_,S,M){for(;S<=M;){const D=S+M>>1;if(_[D]===m)return!0;_[D]>m?M=D-1:S=D+1}return!1}(c.properties()[s.value],d.value,0,d.value.length-1)],all:{type:or,overloads:[[[or,or],(c,[s,d])=>s.evaluate(c)&&d.evaluate(c)],[el(or),(c,s)=>{for(const d of s)if(!d.evaluate(c))return!1;return!0}]]},any:{type:or,overloads:[[[or,or],(c,[s,d])=>s.evaluate(c)||d.evaluate(c)],[el(or),(c,s)=>{for(const d of s)if(d.evaluate(c))return!0;return!1}]]},"!":[or,[or],(c,[s])=>!s.evaluate(c)],"is-supported-script":[or,[qt],(c,[s])=>{const d=c.globals&&c.globals.isSupportedScript;return!d||d(s.evaluate(c))}],upcase:[qt,[qt],(c,[s])=>s.evaluate(c).toUpperCase()],downcase:[qt,[qt],(c,[s])=>s.evaluate(c).toLowerCase()],concat:[qt,el(Lt),(c,s)=>s.map(d=>At(d.evaluate(c))).join("")],"resolved-locale":[qt,[kr],(c,[s])=>s.evaluate(c).resolvedLocale()]});class Rd{constructor(s,d){this.expression=s,this._warningHistory={},this._evaluator=new $r,this._defaultValue=d?function(m){return m.type==="color"&&Sn(m.default)?new ae(0,0,0,0):m.type==="color"?ae.parse(m.default)||null:m.type==="padding"?Ce.parse(m.default)||null:m.default===void 0?null:m.default}(d):null,this._enumValues=d&&d.type==="enum"?d.values:null}evaluateWithoutErrorHandling(s,d,m,_,S,M){return this._evaluator.globals=s,this._evaluator.feature=d,this._evaluator.featureState=m,this._evaluator.canonical=_,this._evaluator.availableImages=S||null,this._evaluator.formattedSection=M,this.expression.evaluate(this._evaluator)}evaluate(s,d,m,_,S,M){this._evaluator.globals=s,this._evaluator.feature=d||null,this._evaluator.featureState=m||null,this._evaluator.canonical=_,this._evaluator.availableImages=S||null,this._evaluator.formattedSection=M||null;try{const D=this.expression.evaluate(this._evaluator);if(D==null||typeof D=="number"&&D!=D)return this._defaultValue;if(this._enumValues&&!(D in this._enumValues))throw new Je(`Expected value to be one of ${Object.keys(this._enumValues).map(F=>JSON.stringify(F)).join(", ")}, but found ${JSON.stringify(D)} instead.`);return D}catch(D){return this._warningHistory[D.message]||(this._warningHistory[D.message]=!0,typeof console<"u"&&console.warn(D.message)),this._defaultValue}}}function uc(c){return Array.isArray(c)&&c.length>0&&typeof c[0]=="string"&&c[0]in Gl}function cc(c,s){const d=new Ss(Gl,[],s?function(_){const S={color:Lr,string:qt,number:_t,enum:qt,boolean:or,formatted:wr,padding:fr,resolvedImage:Nt};return _.type==="array"?ot(S[_.value]||Lt,_.length):S[_.type]}(s):void 0),m=d.parse(c,void 0,void 0,void 0,s&&s.type==="string"?{typeAnnotation:"coerce"}:void 0);return m?Xv(new Rd(m,s)):Zl(d.errors)}class dc{constructor(s,d){this.kind=s,this._styleExpression=d,this.isStateDependent=s!=="constant"&&!Gr(d.expression)}evaluateWithoutErrorHandling(s,d,m,_,S,M){return this._styleExpression.evaluateWithoutErrorHandling(s,d,m,_,S,M)}evaluate(s,d,m,_,S,M){return this._styleExpression.evaluate(s,d,m,_,S,M)}}class Kh{constructor(s,d,m,_){this.kind=s,this.zoomStops=m,this._styleExpression=d,this.isStateDependent=s!=="camera"&&!Gr(d.expression),this.interpolationType=_}evaluateWithoutErrorHandling(s,d,m,_,S,M){return this._styleExpression.evaluateWithoutErrorHandling(s,d,m,_,S,M)}evaluate(s,d,m,_,S,M){return this._styleExpression.evaluate(s,d,m,_,S,M)}interpolationFactor(s,d,m){return this.interpolationType?wo.interpolationFactor(this.interpolationType,s,d,m):0}}function Jv(c,s){const d=cc(c,s);if(d.result==="error")return d;const m=d.value.expression,_=Dr(m);if(!_&&!Tn(s))return Zl([new rr("","data expressions not supported")]);const S=On(m,["zoom"]);if(!S&&!Yv(s))return Zl([new rr("","zoom expressions not supported")]);const M=Ad(m);return M||S?M instanceof rr?Zl([M]):M instanceof wo&&!Zr(s)?Zl([new rr("",'"interpolate" expressions cannot be used with this property')]):Xv(M?new Kh(_?"camera":"composite",d.value,M.labels,M instanceof wo?M.interpolation:void 0):new dc(_?"constant":"source",d.value)):Zl([new rr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Od{constructor(s,d){this._parameters=s,this._specification=d,cr(this,lc(this._parameters,this._specification))}static deserialize(s){return new Od(s._parameters,s._specification)}static serialize(s){return{_parameters:s._parameters,_specification:s._specification}}}function Ad(c){let s=null;if(c instanceof kd)s=Ad(c.result);else if(c instanceof Ed){for(const d of c.args)if(s=Ad(d),s)break}else(c instanceof Qa||c instanceof wo)&&c.input instanceof Qr&&c.input.name==="zoom"&&(s=c);return s instanceof rr||c.eachChild(d=>{const m=Ad(d);m instanceof rr?s=m:!s&&m?s=new rr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&m&&s!==m&&(s=new rr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}function ra(c){const s=c.key,d=c.value,m=c.valueSpec||{},_=c.objectElementValidators||{},S=c.style,M=c.styleSpec;let D=[];const F=sn(d);if(F!=="object")return[new qe(s,d,`object expected, ${F} found`)];for(const U in d){const X=U.split(".")[0],re=m[X]||m["*"];let ue;if(_[X])ue=_[X];else if(m[X])ue=So;else if(_["*"])ue=_["*"];else{if(!m["*"]){D.push(new qe(s,d[U],`unknown property "${U}"`));continue}ue=So}D=D.concat(ue({key:(s&&`${s}.`)+U,value:d[U],valueSpec:re,style:S,styleSpec:M,object:d,objectKey:U},d))}for(const U in m)_[U]||m[U].required&&m[U].default===void 0&&d[U]===void 0&&D.push(new qe(s,d,`missing required property "${U}"`));return D}function eg(c){const s=c.value,d=c.valueSpec,m=c.style,_=c.styleSpec,S=c.key,M=c.arrayElementValidator||So;if(sn(s)!=="array")return[new qe(S,s,`array expected, ${sn(s)} found`)];if(d.length&&s.length!==d.length)return[new qe(S,s,`array length ${d.length} expected, length ${s.length} found`)];if(d["min-length"]&&s.lengthm.maximum?[new qe(s,d,`${d} is greater than the maximum value ${m.maximum}`)]:[]}function tg(c){const s=c.valueSpec,d=Vt(c.value.type);let m,_,S,M={};const D=d!=="categorical"&&c.value.property===void 0,F=!D,U=sn(c.value.stops)==="array"&&sn(c.value.stops[0])==="array"&&sn(c.value.stops[0][0])==="object",X=ra({key:c.key,value:c.value,valueSpec:c.styleSpec.function,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{stops:function(he){if(d==="identity")return[new qe(he.key,he.value,'identity function may not have a "stops" property')];let pe=[];const Oe=he.value;return pe=pe.concat(eg({key:he.key,value:Oe,valueSpec:he.valueSpec,style:he.style,styleSpec:he.styleSpec,arrayElementValidator:re})),sn(Oe)==="array"&&Oe.length===0&&pe.push(new qe(he.key,Oe,"array must have at least one stop")),pe},default:function(he){return So({key:he.key,value:he.value,valueSpec:s,style:he.style,styleSpec:he.styleSpec})}}});return d==="identity"&&D&&X.push(new qe(c.key,c.value,'missing required property "property"')),d==="identity"||c.value.stops||X.push(new qe(c.key,c.value,'missing required property "stops"')),d==="exponential"&&c.valueSpec.expression&&!Zr(c.valueSpec)&&X.push(new qe(c.key,c.value,"exponential functions not supported")),c.styleSpec.$version>=8&&(F&&!Tn(c.valueSpec)?X.push(new qe(c.key,c.value,"property functions not supported")):D&&!Yv(c.valueSpec)&&X.push(new qe(c.key,c.value,"zoom functions not supported"))),d!=="categorical"&&!U||c.value.property!==void 0||X.push(new qe(c.key,c.value,'"property" property is required')),X;function re(he){let pe=[];const Oe=he.value,Me=he.key;if(sn(Oe)!=="array")return[new qe(Me,Oe,`array expected, ${sn(Oe)} found`)];if(Oe.length!==2)return[new qe(Me,Oe,`array length 2 expected, length ${Oe.length} found`)];if(U){if(sn(Oe[0])!=="object")return[new qe(Me,Oe,`object expected, ${sn(Oe[0])} found`)];if(Oe[0].zoom===void 0)return[new qe(Me,Oe,"object stop key must have zoom")];if(Oe[0].value===void 0)return[new qe(Me,Oe,"object stop key must have value")];if(S&&S>Vt(Oe[0].zoom))return[new qe(Me,Oe[0].zoom,"stop zoom values must appear in ascending order")];Vt(Oe[0].zoom)!==S&&(S=Vt(Oe[0].zoom),_=void 0,M={}),pe=pe.concat(ra({key:`${Me}[0]`,value:Oe[0],valueSpec:{zoom:{}},style:he.style,styleSpec:he.styleSpec,objectElementValidators:{zoom:Hh,value:ue}}))}else pe=pe.concat(ue({key:`${Me}[0]`,value:Oe[0],valueSpec:{},style:he.style,styleSpec:he.styleSpec},Oe));return uc(Ut(Oe[1]))?pe.concat([new qe(`${Me}[1]`,Oe[1],"expressions are not allowed in function stops.")]):pe.concat(So({key:`${Me}[1]`,value:Oe[1],valueSpec:s,style:he.style,styleSpec:he.styleSpec}))}function ue(he,pe){const Oe=sn(he.value),Me=Vt(he.value),Ze=he.value!==null?he.value:pe;if(m){if(Oe!==m)return[new qe(he.key,Ze,`${Oe} stop domain type must match previous stop domain type ${m}`)]}else m=Oe;if(Oe!=="number"&&Oe!=="string"&&Oe!=="boolean")return[new qe(he.key,Ze,"stop domain value must be a number, string, or boolean")];if(Oe!=="number"&&d!=="categorical"){let st=`number expected, ${Oe} found`;return Tn(s)&&d===void 0&&(st+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new qe(he.key,Ze,st)]}return d!=="categorical"||Oe!=="number"||isFinite(Me)&&Math.floor(Me)===Me?d!=="categorical"&&Oe==="number"&&_!==void 0&&Me<_?[new qe(he.key,Ze,"stop domain values must appear in ascending order")]:(_=Me,d==="categorical"&&Me in M?[new qe(he.key,Ze,"stop domain values must be unique")]:(M[Me]=!0,[])):[new qe(he.key,Ze,`integer expected, found ${Me}`)]}}function tl(c){const s=(c.expressionContext==="property"?Jv:cc)(Ut(c.value),c.valueSpec);if(s.result==="error")return s.value.map(m=>new qe(`${c.key}${m.key}`,c.value,m.message));const d=s.value.expression||s.value._styleExpression.expression;if(c.expressionContext==="property"&&c.propertyKey==="text-font"&&!d.outputDefined())return[new qe(c.key,c.value,`Invalid data expression for "${c.propertyKey}". Output values must be contained as literals within the expression.`)];if(c.expressionContext==="property"&&c.propertyType==="layout"&&!Gr(d))return[new qe(c.key,c.value,'"feature-state" data expressions are not supported with layout properties.')];if(c.expressionContext==="filter"&&!Gr(d))return[new qe(c.key,c.value,'"feature-state" data expressions are not supported with filters.')];if(c.expressionContext&&c.expressionContext.indexOf("cluster")===0){if(!On(d,["zoom","feature-state"]))return[new qe(c.key,c.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(c.expressionContext==="cluster-initial"&&!Dr(d))return[new qe(c.key,c.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function fc(c){const s=c.key,d=c.value,m=c.valueSpec,_=[];return Array.isArray(m.values)?m.values.indexOf(Vt(d))===-1&&_.push(new qe(s,d,`expected one of [${m.values.join(", ")}], ${JSON.stringify(d)} found`)):Object.keys(m.values).indexOf(Vt(d))===-1&&_.push(new qe(s,d,`expected one of [${Object.keys(m.values).join(", ")}], ${JSON.stringify(d)} found`)),_}function Yl(c){if(c===!0||c===!1)return!0;if(!Array.isArray(c)||c.length===0)return!1;switch(c[0]){case"has":return c.length>=2&&c[1]!=="$id"&&c[1]!=="$type";case"in":return c.length>=3&&(typeof c[1]!="string"||Array.isArray(c[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return c.length!==3||Array.isArray(c[1])||Array.isArray(c[2]);case"any":case"all":for(const s of c.slice(1))if(!Yl(s)&&typeof s!="boolean")return!1;return!0;default:return!0}}const h_={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Nd(c){if(c==null)return{filter:()=>!0,needGeometry:!1};Yl(c)||(c=hc(c));const s=cc(c,h_);if(s.result==="error")throw new Error(s.value.map(d=>`${d.key}: ${d.message}`).join(", "));return{filter:(d,m,_)=>s.value.evaluate(d,m,{},_),needGeometry:ng(c)}}function rg(c,s){return cs?1:0}function ng(c){if(!Array.isArray(c))return!1;if(c[0]==="within")return!0;for(let s=1;s"||s==="<="||s===">="?Wh(c[1],c[2],s):s==="any"?(d=c.slice(1),["any"].concat(d.map(hc))):s==="all"?["all"].concat(c.slice(1).map(hc)):s==="none"?["all"].concat(c.slice(1).map(hc).map(Ql)):s==="in"?zd(c[1],c.slice(2)):s==="!in"?Ql(zd(c[1],c.slice(2))):s==="has"?pc(c[1]):s==="!has"?Ql(pc(c[1])):s!=="within"||c;var d}function Wh(c,s,d){switch(c){case"$type":return[`filter-type-${d}`,s];case"$id":return[`filter-id-${d}`,s];default:return[`filter-${d}`,c,s]}}function zd(c,s){if(s.length===0)return!1;switch(c){case"$type":return["filter-type-in",["literal",s]];case"$id":return["filter-id-in",["literal",s]];default:return s.length>200&&!s.some(d=>typeof d!=typeof s[0])?["filter-in-large",c,["literal",s.sort(rg)]]:["filter-in-small",c,["literal",s]]}}function pc(c){switch(c){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",c]}}function Ql(c){return["!",c]}function mc(c){return Yl(Ut(c.value))?tl(cr({},c,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ig(c)}function ig(c){const s=c.value,d=c.key;if(sn(s)!=="array")return[new qe(d,s,`array expected, ${sn(s)} found`)];const m=c.styleSpec;let _,S=[];if(s.length<1)return[new qe(d,s,"filter array must have at least 1 element")];switch(S=S.concat(fc({key:`${d}[0]`,value:s[0],valueSpec:m.filter_operator,style:c.style,styleSpec:c.styleSpec})),Vt(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&Vt(s[1])==="$type"&&S.push(new qe(d,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":s.length!==3&&S.push(new qe(d,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>=2&&(_=sn(s[1]),_!=="string"&&S.push(new qe(`${d}[1]`,s[1],`string expected, ${_} found`)));for(let M=2;M{U in d&&s.push(new qe(m,d[U],`"${U}" is prohibited for ref layers`))}),_.layers.forEach(U=>{Vt(U.id)===D&&(F=U)}),F?F.ref?s.push(new qe(m,d.ref,"ref cannot reference another ref layer")):M=Vt(F.type):s.push(new qe(m,d.ref,`ref layer "${D}" not found`))}else if(M!=="background")if(d.source){const F=_.sources&&_.sources[d.source],U=F&&Vt(F.type);F?U==="vector"&&M==="raster"?s.push(new qe(m,d.source,`layer "${d.id}" requires a raster source`)):U==="raster"&&M!=="raster"?s.push(new qe(m,d.source,`layer "${d.id}" requires a vector source`)):U!=="vector"||d["source-layer"]?U==="raster-dem"&&M!=="hillshade"?s.push(new qe(m,d.source,"raster-dem source can only be used with layer type 'hillshade'.")):M!=="line"||!d.paint||!d.paint["line-gradient"]||U==="geojson"&&F.lineMetrics||s.push(new qe(m,d,`layer "${d.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):s.push(new qe(m,d,`layer "${d.id}" must specify a "source-layer"`)):s.push(new qe(m,d.source,`source "${d.source}" not found`))}else s.push(new qe(m,d,'missing required property "source"'));return s=s.concat(ra({key:m,value:d,valueSpec:S.layer,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{"*":()=>[],type:()=>So({key:`${m}.type`,value:d.type,valueSpec:S.layer.type,style:c.style,styleSpec:c.styleSpec,object:d,objectKey:"type"}),filter:mc,layout:F=>ra({layer:d,key:F.key,value:F.value,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{"*":U=>ag(cr({layerType:M},U))}}),paint:F=>ra({layer:d,key:F.key,value:F.value,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{"*":U=>og(cr({layerType:M},U))}})}})),s}function Jl(c){const s=c.value,d=c.key,m=sn(s);return m!=="string"?[new qe(d,s,`string expected, ${m} found`)]:[]}const lg={promoteId:function({key:c,value:s}){if(sn(s)==="string")return Jl({key:c,value:s});{const d=[];for(const m in s)d.push(...Jl({key:`${c}.${m}`,value:s[m]}));return d}}};function gc(c){const s=c.value,d=c.key,m=c.styleSpec,_=c.style;if(!s.type)return[new qe(d,s,'"type" is required')];const S=Vt(s.type);let M;switch(S){case"vector":case"raster":case"raster-dem":return M=ra({key:d,value:s,valueSpec:m[`source_${S.replace("-","_")}`],style:c.style,styleSpec:m,objectElementValidators:lg}),M;case"geojson":if(M=ra({key:d,value:s,valueSpec:m.source_geojson,style:_,styleSpec:m,objectElementValidators:lg}),s.cluster)for(const D in s.clusterProperties){const[F,U]=s.clusterProperties[D],X=typeof F=="string"?[F,["accumulated"],["get",D]]:F;M.push(...tl({key:`${d}.${D}.map`,value:U,expressionContext:"cluster-map"})),M.push(...tl({key:`${d}.${D}.reduce`,value:X,expressionContext:"cluster-reduce"}))}return M;case"video":return ra({key:d,value:s,valueSpec:m.source_video,style:_,styleSpec:m});case"image":return ra({key:d,value:s,valueSpec:m.source_image,style:_,styleSpec:m});case"canvas":return[new qe(d,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return fc({key:`${d}.type`,value:s.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:_,styleSpec:m})}}function yc(c){const s=c.value,d=c.styleSpec,m=d.light,_=c.style;let S=[];const M=sn(s);if(s===void 0)return S;if(M!=="object")return S=S.concat([new qe("light",s,`object expected, ${M} found`)]),S;for(const D in s){const F=D.match(/^(.*)-transition$/);S=S.concat(F&&m[F[1]]&&m[F[1]].transition?So({key:D,value:s[D],valueSpec:d.transition,style:_,styleSpec:d}):m[D]?So({key:D,value:s[D],valueSpec:m[D],style:_,styleSpec:d}):[new qe(D,s[D],`unknown property "${D}"`)])}return S}function Co(c){const s=c.value,d=c.styleSpec,m=d.terrain,_=c.style;let S=[];const M=sn(s);if(s===void 0)return S;if(M!=="object")return S=S.concat([new qe("terrain",s,`object expected, ${M} found`)]),S;for(const D in s)S=S.concat(m[D]?So({key:D,value:s[D],valueSpec:m[D],style:_,styleSpec:d}):[new qe(D,s[D],`unknown property "${D}"`)]);return S}const xc={"*":()=>[],array:eg,boolean:function(c){const s=c.value,d=c.key,m=sn(s);return m!=="boolean"?[new qe(d,s,`boolean expected, ${m} found`)]:[]},number:Hh,color:function(c){const s=c.key,d=c.value,m=sn(d);return m!=="string"?[new qe(s,d,`color expected, ${m} found`)]:Wr(d)===null?[new qe(s,d,`color expected, "${d}" found`)]:[]},constants:Xt,enum:fc,filter:mc,function:tg,layer:sg,object:ra,source:gc,light:yc,terrain:Co,string:Jl,formatted:function(c){return Jl(c).length===0?[]:tl(c)},resolvedImage:function(c){return Jl(c).length===0?[]:tl(c)},padding:function(c){const s=c.key,d=c.value;if(sn(d)==="array"){if(d.length<1||d.length>4)return[new qe(s,d,`padding requires 1 to 4 values; ${d.length} values found`)];const m={type:"number"};let _=[];for(let S=0;S[]}})),c.constants&&(d=d.concat(Xt({key:"constants",value:c.constants,style:c,styleSpec:s}))),ug(d)}function ug(c){return[].concat(c).sort((s,d)=>s.line-d.line)}function es(c){return function(...s){return ug(c.apply(this,s))}}Es.source=es(gc),Es.light=es(yc),Es.terrain=es(Co),Es.layer=es(sg),Es.filter=es(mc),Es.paintProperty=es(og),Es.layoutProperty=es(ag);const _c=Es,qh=_c.light,m_=_c.paintProperty,v_=_c.layoutProperty;function Dd(c,s){let d=!1;if(s&&s.length)for(const m of s)c.fire(new jt(new Error(m.message))),d=!0;return d}class bc{constructor(s,d,m){const _=this.cells=[];if(s instanceof ArrayBuffer){this.arrayBuffer=s;const M=new Int32Array(this.arrayBuffer);s=M[0],this.d=(d=M[1])+2*(m=M[2]);for(let F=0;F=re[pe+0]&&_>=re[pe+1])?(D[he]=!0,M.push(X[he])):D[he]=!1}}}}_forEachCell(s,d,m,_,S,M,D,F){const U=this._convertToCellCoord(s),X=this._convertToCellCoord(d),re=this._convertToCellCoord(m),ue=this._convertToCellCoord(_);for(let he=U;he<=re;he++)for(let pe=X;pe<=ue;pe++){const Oe=this.d*pe+he;if((!F||F(this._convertFromCellCoord(he),this._convertFromCellCoord(pe),this._convertFromCellCoord(he+1),this._convertFromCellCoord(pe+1)))&&S.call(this,s,d,m,_,Oe,M,D,F))return}}_convertFromCellCoord(s){return(s-this.padding)/this.scale}_convertToCellCoord(s){return Math.max(0,Math.min(this.d-1,Math.floor(s*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const s=this.cells,d=3+this.cells.length+1+1;let m=0;for(let M=0;M=0)continue;const M=c[S];_[S]=ts[m].shallow.indexOf(S)>=0?M:rl(M,s)}c instanceof Error&&(_.message=c.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(_.$name=m),_}throw new Error("can't serialize object of type "+typeof c)}function ks(c){if(c==null||typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c instanceof Boolean||c instanceof Number||c instanceof String||c instanceof Date||c instanceof RegExp||c instanceof Blob||cg(c)||Q(c)||ArrayBuffer.isView(c)||c instanceof ImageData)return c;if(Array.isArray(c))return c.map(ks);if(typeof c=="object"){const s=c.$name||"Object";if(!ts[s])throw new Error(`can't deserialize unregistered class ${s}`);const{klass:d}=ts[s];if(!d)throw new Error(`can't deserialize unregistered class ${s}`);if(d.deserialize)return d.deserialize(c);const m=Object.create(d.prototype);for(const _ of Object.keys(c)){if(_==="$name")continue;const S=c[_];m[_]=ts[s].shallow.indexOf(_)>=0?S:ks(S)}return m}throw new Error("can't deserialize object of type "+typeof c)}class Gh{constructor(){this.first=!0}update(s,d){const m=Math.floor(s);return this.first?(this.first=!1,this.lastIntegerZoom=m,this.lastIntegerZoomTime=0,this.lastZoom=s,this.lastFloorZoom=m,!0):(this.lastFloorZoom>m?(this.lastIntegerZoom=m+1,this.lastIntegerZoomTime=d):this.lastFloorZoomc>=128&&c<=255,Arabic:c=>c>=1536&&c<=1791,"Arabic Supplement":c=>c>=1872&&c<=1919,"Arabic Extended-A":c=>c>=2208&&c<=2303,"Hangul Jamo":c=>c>=4352&&c<=4607,"Unified Canadian Aboriginal Syllabics":c=>c>=5120&&c<=5759,Khmer:c=>c>=6016&&c<=6143,"Unified Canadian Aboriginal Syllabics Extended":c=>c>=6320&&c<=6399,"General Punctuation":c=>c>=8192&&c<=8303,"Letterlike Symbols":c=>c>=8448&&c<=8527,"Number Forms":c=>c>=8528&&c<=8591,"Miscellaneous Technical":c=>c>=8960&&c<=9215,"Control Pictures":c=>c>=9216&&c<=9279,"Optical Character Recognition":c=>c>=9280&&c<=9311,"Enclosed Alphanumerics":c=>c>=9312&&c<=9471,"Geometric Shapes":c=>c>=9632&&c<=9727,"Miscellaneous Symbols":c=>c>=9728&&c<=9983,"Miscellaneous Symbols and Arrows":c=>c>=11008&&c<=11263,"CJK Radicals Supplement":c=>c>=11904&&c<=12031,"Kangxi Radicals":c=>c>=12032&&c<=12255,"Ideographic Description Characters":c=>c>=12272&&c<=12287,"CJK Symbols and Punctuation":c=>c>=12288&&c<=12351,Hiragana:c=>c>=12352&&c<=12447,Katakana:c=>c>=12448&&c<=12543,Bopomofo:c=>c>=12544&&c<=12591,"Hangul Compatibility Jamo":c=>c>=12592&&c<=12687,Kanbun:c=>c>=12688&&c<=12703,"Bopomofo Extended":c=>c>=12704&&c<=12735,"CJK Strokes":c=>c>=12736&&c<=12783,"Katakana Phonetic Extensions":c=>c>=12784&&c<=12799,"Enclosed CJK Letters and Months":c=>c>=12800&&c<=13055,"CJK Compatibility":c=>c>=13056&&c<=13311,"CJK Unified Ideographs Extension A":c=>c>=13312&&c<=19903,"Yijing Hexagram Symbols":c=>c>=19904&&c<=19967,"CJK Unified Ideographs":c=>c>=19968&&c<=40959,"Yi Syllables":c=>c>=40960&&c<=42127,"Yi Radicals":c=>c>=42128&&c<=42191,"Hangul Jamo Extended-A":c=>c>=43360&&c<=43391,"Hangul Syllables":c=>c>=44032&&c<=55215,"Hangul Jamo Extended-B":c=>c>=55216&&c<=55295,"Private Use Area":c=>c>=57344&&c<=63743,"CJK Compatibility Ideographs":c=>c>=63744&&c<=64255,"Arabic Presentation Forms-A":c=>c>=64336&&c<=65023,"Vertical Forms":c=>c>=65040&&c<=65055,"CJK Compatibility Forms":c=>c>=65072&&c<=65103,"Small Form Variants":c=>c>=65104&&c<=65135,"Arabic Presentation Forms-B":c=>c>=65136&&c<=65279,"Halfwidth and Fullwidth Forms":c=>c>=65280&&c<=65519};function Ld(c){for(const s of c)if(Xh(s.charCodeAt(0)))return!0;return!1}function g_(c){for(const s of c)if(!Zh(s.charCodeAt(0)))return!1;return!0}function Zh(c){return!(Jt.Arabic(c)||Jt["Arabic Supplement"](c)||Jt["Arabic Extended-A"](c)||Jt["Arabic Presentation Forms-A"](c)||Jt["Arabic Presentation Forms-B"](c))}function Xh(c){return!(c!==746&&c!==747&&(c<4352||!(Jt["Bopomofo Extended"](c)||Jt.Bopomofo(c)||Jt["CJK Compatibility Forms"](c)&&!(c>=65097&&c<=65103)||Jt["CJK Compatibility Ideographs"](c)||Jt["CJK Compatibility"](c)||Jt["CJK Radicals Supplement"](c)||Jt["CJK Strokes"](c)||!(!Jt["CJK Symbols and Punctuation"](c)||c>=12296&&c<=12305||c>=12308&&c<=12319||c===12336)||Jt["CJK Unified Ideographs Extension A"](c)||Jt["CJK Unified Ideographs"](c)||Jt["Enclosed CJK Letters and Months"](c)||Jt["Hangul Compatibility Jamo"](c)||Jt["Hangul Jamo Extended-A"](c)||Jt["Hangul Jamo Extended-B"](c)||Jt["Hangul Jamo"](c)||Jt["Hangul Syllables"](c)||Jt.Hiragana(c)||Jt["Ideographic Description Characters"](c)||Jt.Kanbun(c)||Jt["Kangxi Radicals"](c)||Jt["Katakana Phonetic Extensions"](c)||Jt.Katakana(c)&&c!==12540||!(!Jt["Halfwidth and Fullwidth Forms"](c)||c===65288||c===65289||c===65293||c>=65306&&c<=65310||c===65339||c===65341||c===65343||c>=65371&&c<=65503||c===65507||c>=65512&&c<=65519)||!(!Jt["Small Form Variants"](c)||c>=65112&&c<=65118||c>=65123&&c<=65126)||Jt["Unified Canadian Aboriginal Syllabics"](c)||Jt["Unified Canadian Aboriginal Syllabics Extended"](c)||Jt["Vertical Forms"](c)||Jt["Yijing Hexagram Symbols"](c)||Jt["Yi Syllables"](c)||Jt["Yi Radicals"](c))))}function dg(c){return!(Xh(c)||function(s){return!!(Jt["Latin-1 Supplement"](s)&&(s===167||s===169||s===174||s===177||s===188||s===189||s===190||s===215||s===247)||Jt["General Punctuation"](s)&&(s===8214||s===8224||s===8225||s===8240||s===8241||s===8251||s===8252||s===8258||s===8263||s===8264||s===8265||s===8273)||Jt["Letterlike Symbols"](s)||Jt["Number Forms"](s)||Jt["Miscellaneous Technical"](s)&&(s>=8960&&s<=8967||s>=8972&&s<=8991||s>=8996&&s<=9e3||s===9003||s>=9085&&s<=9114||s>=9150&&s<=9165||s===9167||s>=9169&&s<=9179||s>=9186&&s<=9215)||Jt["Control Pictures"](s)&&s!==9251||Jt["Optical Character Recognition"](s)||Jt["Enclosed Alphanumerics"](s)||Jt["Geometric Shapes"](s)||Jt["Miscellaneous Symbols"](s)&&!(s>=9754&&s<=9759)||Jt["Miscellaneous Symbols and Arrows"](s)&&(s>=11026&&s<=11055||s>=11088&&s<=11097||s>=11192&&s<=11243)||Jt["CJK Symbols and Punctuation"](s)||Jt.Katakana(s)||Jt["Private Use Area"](s)||Jt["CJK Compatibility Forms"](s)||Jt["Small Form Variants"](s)||Jt["Halfwidth and Fullwidth Forms"](s)||s===8734||s===8756||s===8757||s>=9984&&s<=10087||s>=10102&&s<=10131||s===65532||s===65533)}(c))}function fg(c){return c>=1424&&c<=2303||Jt["Arabic Presentation Forms-A"](c)||Jt["Arabic Presentation Forms-B"](c)}function y_(c,s){return!(!s&&fg(c)||c>=2304&&c<=3583||c>=3840&&c<=4255||Jt.Khmer(c))}function hg(c){for(const s of c)if(fg(s.charCodeAt(0)))return!0;return!1}const Yh="deferred",Qh="loading",Jh="loaded";let ep=null,uo="unavailable",Ts=null;const pg=function(c){c&&typeof c=="string"&&c.indexOf("NetworkError")>-1&&(uo="error"),ep&&ep(c)};function eu(){tp.fire(new Wt("pluginStateChange",{pluginStatus:uo,pluginURL:Ts}))}const tp=new Qt,wc=function(){return uo},mg=function(){if(uo!==Yh||!Ts)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");uo=Qh,eu(),Ts&&Ct({url:Ts},c=>{c?pg(c):(uo=Jh,eu())})},jo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>uo===Jh||jo.applyArabicShaping!=null,isLoading:()=>uo===Qh,setState(c){if(!H())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");uo=c.pluginStatus,Ts=c.pluginURL},isParsed(){if(!H())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return jo.applyArabicShaping!=null&&jo.processBidirectionalText!=null&&jo.processStyledBidirectionalText!=null},getPluginURL(){if(!H())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Ts}};class Nn{constructor(s,d){this.zoom=s,d?(this.now=d.now,this.fadeDuration=d.fadeDuration,this.zoomHistory=d.zoomHistory,this.transition=d.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Gh,this.transition={})}isSupportedScript(s){return function(d,m){for(const _ of d)if(!y_(_.charCodeAt(0),m))return!1;return!0}(s,jo.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const s=this.zoom,d=s-Math.floor(s),m=this.crossFadingFactor();return s>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:d+(1-d)*m}:{fromScale:.5,toScale:1,t:1-(1-m)*d}}}class Cc{constructor(s,d){this.property=s,this.value=d,this.expression=function(m,_){if(Sn(m))return new Od(m,_);if(uc(m)){const S=Jv(m,_);if(S.result==="error")throw new Error(S.value.map(M=>`${M.key}: ${M.message}`).join(", "));return S.value}{let S=m;return _.type==="color"&&typeof m=="string"?S=ae.parse(m):_.type!=="padding"||typeof m!="number"&&!Array.isArray(m)||(S=Ce.parse(m)),{kind:"constant",evaluate:()=>S}}}(d===void 0?s.specification.default:d,s.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(s,d,m){return this.property.possiblyEvaluate(this,s,d,m)}}class Fd{constructor(s){this.property=s,this.value=new Cc(s,void 0)}transitioned(s,d){return new gg(this.property,this.value,d,T({},s.transition,this.transition),s.now)}untransitioned(){return new gg(this.property,this.value,null,{},0)}}class vg{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitionablePropertyValues)}getValue(s){return N(this._values[s].value.value)}setValue(s,d){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new Fd(this._values[s].property)),this._values[s].value=new Cc(this._values[s].property,d===null?void 0:N(d))}getTransition(s){return N(this._values[s].transition)}setTransition(s,d){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new Fd(this._values[s].property)),this._values[s].transition=N(d)||void 0}serialize(){const s={};for(const d of Object.keys(this._values)){const m=this.getValue(d);m!==void 0&&(s[d]=m);const _=this.getTransition(d);_!==void 0&&(s[`${d}-transition`]=_)}return s}transitioned(s,d){const m=new yg(this._properties);for(const _ of Object.keys(this._values))m._values[_]=this._values[_].transitioned(s,d._values[_]);return m}untransitioned(){const s=new yg(this._properties);for(const d of Object.keys(this._values))s._values[d]=this._values[d].untransitioned();return s}}class gg{constructor(s,d,m,_,S){this.property=s,this.value=d,this.begin=S+_.delay||0,this.end=this.begin+_.duration||0,s.specification.transition&&(_.delay||_.duration)&&(this.prior=m)}possiblyEvaluate(s,d,m){const _=s.now||0,S=this.value.possiblyEvaluate(s,d,m),M=this.prior;if(M){if(_>this.end)return this.prior=null,S;if(this.value.isDataDriven())return this.prior=null,S;if(_=1)return 1;const U=F*F,X=U*F;return 4*(F<.5?X:3*(F-U)+X-.75)}(D))}}return S}}class yg{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitioningPropertyValues)}possiblyEvaluate(s,d,m){const _=new Sc(this._properties);for(const S of Object.keys(this._values))_._values[S]=this._values[S].possiblyEvaluate(s,d,m);return _}hasTransition(){for(const s of Object.keys(this._values))if(this._values[s].prior)return!0;return!1}}class x_{constructor(s){this._properties=s,this._values=Object.create(s.defaultPropertyValues)}getValue(s){return N(this._values[s].value)}setValue(s,d){this._values[s]=new Cc(this._values[s].property,d===null?void 0:N(d))}serialize(){const s={};for(const d of Object.keys(this._values)){const m=this.getValue(d);m!==void 0&&(s[d]=m)}return s}possiblyEvaluate(s,d,m){const _=new Sc(this._properties);for(const S of Object.keys(this._values))_._values[S]=this._values[S].possiblyEvaluate(s,d,m);return _}}class Ea{constructor(s,d,m){this.property=s,this.value=d,this.parameters=m}isConstant(){return this.value.kind==="constant"}constantOr(s){return this.value.kind==="constant"?this.value.value:s}evaluate(s,d,m,_){return this.property.evaluate(this.value,this.parameters,s,d,m,_)}}class Sc{constructor(s){this._properties=s,this._values=Object.create(s.defaultPossiblyEvaluatedValues)}get(s){return this._values[s]}}class pr{constructor(s){this.specification=s}possiblyEvaluate(s,d){if(s.isDataDriven())throw new Error("Value should not be data driven");return s.expression.evaluate(d)}interpolate(s,d,m){const _=Ja[this.specification.type];return _?_(s,d,m):s}}class Sr{constructor(s,d){this.specification=s,this.overrides=d}possiblyEvaluate(s,d,m,_){return new Ea(this,s.expression.kind==="constant"||s.expression.kind==="camera"?{kind:"constant",value:s.expression.evaluate(d,null,{},m,_)}:s.expression,d)}interpolate(s,d,m){if(s.value.kind!=="constant"||d.value.kind!=="constant")return s;if(s.value.value===void 0||d.value.value===void 0)return new Ea(this,{kind:"constant",value:void 0},s.parameters);const _=Ja[this.specification.type];return _?new Ea(this,{kind:"constant",value:_(s.value.value,d.value.value,m)},s.parameters):s}evaluate(s,d,m,_,S,M){return s.kind==="constant"?s.value:s.evaluate(d,m,_,S,M)}}class tu extends Sr{possiblyEvaluate(s,d,m,_){if(s.value===void 0)return new Ea(this,{kind:"constant",value:void 0},d);if(s.expression.kind==="constant"){const S=s.expression.evaluate(d,null,{},m,_),M=s.property.specification.type==="resolvedImage"&&typeof S!="string"?S.name:S,D=this._calculate(M,M,M,d);return new Ea(this,{kind:"constant",value:D},d)}if(s.expression.kind==="camera"){const S=this._calculate(s.expression.evaluate({zoom:d.zoom-1}),s.expression.evaluate({zoom:d.zoom}),s.expression.evaluate({zoom:d.zoom+1}),d);return new Ea(this,{kind:"constant",value:S},d)}return new Ea(this,s.expression,d)}evaluate(s,d,m,_,S,M){if(s.kind==="source"){const D=s.evaluate(d,m,_,S,M);return this._calculate(D,D,D,d)}return s.kind==="composite"?this._calculate(s.evaluate({zoom:Math.floor(d.zoom)-1},m,_),s.evaluate({zoom:Math.floor(d.zoom)},m,_),s.evaluate({zoom:Math.floor(d.zoom)+1},m,_),d):s.value}_calculate(s,d,m,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:d}:{from:m,to:d}}interpolate(s){return s}}class rp{constructor(s){this.specification=s}possiblyEvaluate(s,d,m,_){if(s.value!==void 0){if(s.expression.kind==="constant"){const S=s.expression.evaluate(d,null,{},m,_);return this._calculate(S,S,S,d)}return this._calculate(s.expression.evaluate(new Nn(Math.floor(d.zoom-1),d)),s.expression.evaluate(new Nn(Math.floor(d.zoom),d)),s.expression.evaluate(new Nn(Math.floor(d.zoom+1),d)),d)}}_calculate(s,d,m,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:d}:{from:m,to:d}}interpolate(s){return s}}class Ps{constructor(s){this.specification=s}possiblyEvaluate(s,d,m,_){return!!s.expression.evaluate(d,null,{},m,_)}interpolate(){return!1}}class Li{constructor(s){this.properties=s,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const d in s){const m=s[d];m.specification.overridable&&this.overridableProperties.push(d);const _=this.defaultPropertyValues[d]=new Cc(m,void 0),S=this.defaultTransitionablePropertyValues[d]=new Fd(m);this.defaultTransitioningPropertyValues[d]=S.untransitioned(),this.defaultPossiblyEvaluatedValues[d]=_.possiblyEvaluate({})}}}dr("DataDrivenProperty",Sr),dr("DataConstantProperty",pr),dr("CrossFadedDataDrivenProperty",tu),dr("CrossFadedProperty",rp),dr("ColorRampProperty",Ps);const Ms="-transition";class ka extends Qt{constructor(s,d){if(super(),this.id=s.id,this.type=s.type,this._featureFilter={filter:()=>!0,needGeometry:!1},s.type!=="custom"&&(this.metadata=s.metadata,this.minzoom=s.minzoom,this.maxzoom=s.maxzoom,s.type!=="background"&&(this.source=s.source,this.sourceLayer=s["source-layer"],this.filter=s.filter),d.layout&&(this._unevaluatedLayout=new x_(d.layout)),d.paint)){this._transitionablePaint=new vg(d.paint);for(const m in s.paint)this.setPaintProperty(m,s.paint[m],{validate:!1});for(const m in s.layout)this.setLayoutProperty(m,s.layout[m],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Sc(d.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(s){return s==="visibility"?this.visibility:this._unevaluatedLayout.getValue(s)}setLayoutProperty(s,d,m={}){d!=null&&this._validate(v_,`layers.${this.id}.layout.${s}`,s,d,m)||(s!=="visibility"?this._unevaluatedLayout.setValue(s,d):this.visibility=d)}getPaintProperty(s){return s.endsWith(Ms)?this._transitionablePaint.getTransition(s.slice(0,-Ms.length)):this._transitionablePaint.getValue(s)}setPaintProperty(s,d,m={}){if(d!=null&&this._validate(m_,`layers.${this.id}.paint.${s}`,s,d,m))return!1;if(s.endsWith(Ms))return this._transitionablePaint.setTransition(s.slice(0,-Ms.length),d||void 0),!1;{const _=this._transitionablePaint._values[s],S=_.property.specification["property-type"]==="cross-faded-data-driven",M=_.value.isDataDriven(),D=_.value;this._transitionablePaint.setValue(s,d),this._handleSpecialPaintPropertyUpdate(s);const F=this._transitionablePaint._values[s].value;return F.isDataDriven()||M||S||this._handleOverridablePaintPropertyUpdate(s,D,F)}}_handleSpecialPaintPropertyUpdate(s){}_handleOverridablePaintPropertyUpdate(s,d,m){return!1}isHidden(s){return!!(this.minzoom&&s=this.maxzoom)||this.visibility==="none"}updateTransitions(s){this._transitioningPaint=this._transitionablePaint.transitioned(s,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(s,d){s.getCrossfadeParameters&&(this._crossfadeParameters=s.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(s,void 0,d)),this.paint=this._transitioningPaint.possiblyEvaluate(s,void 0,d)}serialize(){const s={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(s.layout=s.layout||{},s.layout.visibility=this.visibility),O(s,(d,m)=>!(d===void 0||m==="layout"&&!Object.keys(d).length||m==="paint"&&!Object.keys(d).length))}_validate(s,d,m,_,S={}){return(!S||S.validate!==!1)&&Dd(this,s.call(_c,{key:d,layerType:this.type,objectKey:m,value:_,styleSpec:Fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const s in this.paint._values){const d=this.paint.get(s);if(d instanceof Ea&&Tn(d.property.specification)&&(d.value.kind==="source"||d.value.kind==="composite")&&d.value.isStateDependent)return!0}return!1}}const xg={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Is{constructor(s,d){this._structArray=s,this._pos1=d*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ei{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(s,d){return s._trim(),d&&(s.isTransferred=!0,d.push(s.arrayBuffer)),{length:s.length,arrayBuffer:s.arrayBuffer}}static deserialize(s){const d=Object.create(this.prototype);return d.arrayBuffer=s.arrayBuffer,d.length=s.length,d.capacity=s.arrayBuffer.byteLength/d.bytesPerElement,d._refreshViews(),d}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(s){this.reserve(s),this.length=s}reserve(s){if(s>this.capacity){this.capacity=Math.max(s,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const d=this.uint8;this._refreshViews(),d&&this.uint8.set(d)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ci(c,s=1){let d=0,m=0;return{members:c.map(_=>{const S=xg[_.type].BYTES_PER_ELEMENT,M=d=np(d,Math.max(s,S)),D=_.components||1;return m=Math.max(m,S),d+=S*D,{name:_.name,type:_.type,components:D,offset:M}}),size:np(d,Math.max(m,s)),alignment:s}}function np(c,s){return Math.ceil(c/s)*s}class nl extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d){const m=this.length;return this.resize(m+1),this.emplace(m,s,d)}emplace(s,d,m){const _=2*s;return this.int16[_+0]=d,this.int16[_+1]=m,s}}nl.prototype.bytesPerElement=4,dr("StructArrayLayout2i4",nl);class x extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_){const S=this.length;return this.resize(S+1),this.emplace(S,s,d,m,_)}emplace(s,d,m,_,S){const M=4*s;return this.int16[M+0]=d,this.int16[M+1]=m,this.int16[M+2]=_,this.int16[M+3]=S,s}}x.prototype.bytesPerElement=8,dr("StructArrayLayout4i8",x);class l extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,S,M){const D=this.length;return this.resize(D+1),this.emplace(D,s,d,m,_,S,M)}emplace(s,d,m,_,S,M,D){const F=6*s;return this.int16[F+0]=d,this.int16[F+1]=m,this.int16[F+2]=_,this.int16[F+3]=S,this.int16[F+4]=M,this.int16[F+5]=D,s}}l.prototype.bytesPerElement=12,dr("StructArrayLayout2i4i12",l);class h extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,S,M){const D=this.length;return this.resize(D+1),this.emplace(D,s,d,m,_,S,M)}emplace(s,d,m,_,S,M,D){const F=4*s,U=8*s;return this.int16[F+0]=d,this.int16[F+1]=m,this.uint8[U+4]=_,this.uint8[U+5]=S,this.uint8[U+6]=M,this.uint8[U+7]=D,s}}h.prototype.bytesPerElement=8,dr("StructArrayLayout2i4ub8",h);class g extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d){const m=this.length;return this.resize(m+1),this.emplace(m,s,d)}emplace(s,d,m){const _=2*s;return this.float32[_+0]=d,this.float32[_+1]=m,s}}g.prototype.bytesPerElement=8,dr("StructArrayLayout2f8",g);class b extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,S,M,D,F,U,X){const re=this.length;return this.resize(re+1),this.emplace(re,s,d,m,_,S,M,D,F,U,X)}emplace(s,d,m,_,S,M,D,F,U,X,re){const ue=10*s;return this.uint16[ue+0]=d,this.uint16[ue+1]=m,this.uint16[ue+2]=_,this.uint16[ue+3]=S,this.uint16[ue+4]=M,this.uint16[ue+5]=D,this.uint16[ue+6]=F,this.uint16[ue+7]=U,this.uint16[ue+8]=X,this.uint16[ue+9]=re,s}}b.prototype.bytesPerElement=20,dr("StructArrayLayout10ui20",b);class P extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,S,M,D,F,U,X,re,ue){const he=this.length;return this.resize(he+1),this.emplace(he,s,d,m,_,S,M,D,F,U,X,re,ue)}emplace(s,d,m,_,S,M,D,F,U,X,re,ue,he){const pe=12*s;return this.int16[pe+0]=d,this.int16[pe+1]=m,this.int16[pe+2]=_,this.int16[pe+3]=S,this.uint16[pe+4]=M,this.uint16[pe+5]=D,this.uint16[pe+6]=F,this.uint16[pe+7]=U,this.int16[pe+8]=X,this.int16[pe+9]=re,this.int16[pe+10]=ue,this.int16[pe+11]=he,s}}P.prototype.bytesPerElement=24,dr("StructArrayLayout4i4ui4i24",P);class z extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,s,d,m)}emplace(s,d,m,_){const S=3*s;return this.float32[S+0]=d,this.float32[S+1]=m,this.float32[S+2]=_,s}}z.prototype.bytesPerElement=12,dr("StructArrayLayout3f12",z);class $ extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(s){const d=this.length;return this.resize(d+1),this.emplace(d,s)}emplace(s,d){return this.uint32[1*s+0]=d,s}}$.prototype.bytesPerElement=4,dr("StructArrayLayout1ul4",$);class V extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,S,M,D,F,U){const X=this.length;return this.resize(X+1),this.emplace(X,s,d,m,_,S,M,D,F,U)}emplace(s,d,m,_,S,M,D,F,U,X){const re=10*s,ue=5*s;return this.int16[re+0]=d,this.int16[re+1]=m,this.int16[re+2]=_,this.int16[re+3]=S,this.int16[re+4]=M,this.int16[re+5]=D,this.uint32[ue+3]=F,this.uint16[re+8]=U,this.uint16[re+9]=X,s}}V.prototype.bytesPerElement=20,dr("StructArrayLayout6i1ul2ui20",V);class W extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,S,M){const D=this.length;return this.resize(D+1),this.emplace(D,s,d,m,_,S,M)}emplace(s,d,m,_,S,M,D){const F=6*s;return this.int16[F+0]=d,this.int16[F+1]=m,this.int16[F+2]=_,this.int16[F+3]=S,this.int16[F+4]=M,this.int16[F+5]=D,s}}W.prototype.bytesPerElement=12,dr("StructArrayLayout2i2i2i12",W);class ee extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m,_,S){const M=this.length;return this.resize(M+1),this.emplace(M,s,d,m,_,S)}emplace(s,d,m,_,S,M){const D=4*s,F=8*s;return this.float32[D+0]=d,this.float32[D+1]=m,this.float32[D+2]=_,this.int16[F+6]=S,this.int16[F+7]=M,s}}ee.prototype.bytesPerElement=16,dr("StructArrayLayout2f1f2i16",ee);class ie extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d,m,_){const S=this.length;return this.resize(S+1),this.emplace(S,s,d,m,_)}emplace(s,d,m,_,S){const M=12*s,D=3*s;return this.uint8[M+0]=d,this.uint8[M+1]=m,this.float32[D+1]=_,this.float32[D+2]=S,s}}ie.prototype.bytesPerElement=12,dr("StructArrayLayout2ub2f12",ie);class fe extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,s,d,m)}emplace(s,d,m,_){const S=3*s;return this.uint16[S+0]=d,this.uint16[S+1]=m,this.uint16[S+2]=_,s}}fe.prototype.bytesPerElement=6,dr("StructArrayLayout3ui6",fe);class Se extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d,m,_,S,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze){const st=this.length;return this.resize(st+1),this.emplace(st,s,d,m,_,S,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze)}emplace(s,d,m,_,S,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze,st){const Ke=24*s,nt=12*s,kt=48*s;return this.int16[Ke+0]=d,this.int16[Ke+1]=m,this.uint16[Ke+2]=_,this.uint16[Ke+3]=S,this.uint32[nt+2]=M,this.uint32[nt+3]=D,this.uint32[nt+4]=F,this.uint16[Ke+10]=U,this.uint16[Ke+11]=X,this.uint16[Ke+12]=re,this.float32[nt+7]=ue,this.float32[nt+8]=he,this.uint8[kt+36]=pe,this.uint8[kt+37]=Oe,this.uint8[kt+38]=Me,this.uint32[nt+10]=Ze,this.int16[Ke+22]=st,s}}Se.prototype.bytesPerElement=48,dr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Se);class _e extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d,m,_,S,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze,st,Ke,nt,kt,St,lr,hr,er,Zt,Ht,tr){const Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,s,d,m,_,S,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze,st,Ke,nt,kt,St,lr,hr,er,Zt,Ht,tr)}emplace(s,d,m,_,S,M,D,F,U,X,re,ue,he,pe,Oe,Me,Ze,st,Ke,nt,kt,St,lr,hr,er,Zt,Ht,tr,Yt){const Ft=34*s,br=17*s;return this.int16[Ft+0]=d,this.int16[Ft+1]=m,this.int16[Ft+2]=_,this.int16[Ft+3]=S,this.int16[Ft+4]=M,this.int16[Ft+5]=D,this.int16[Ft+6]=F,this.int16[Ft+7]=U,this.uint16[Ft+8]=X,this.uint16[Ft+9]=re,this.uint16[Ft+10]=ue,this.uint16[Ft+11]=he,this.uint16[Ft+12]=pe,this.uint16[Ft+13]=Oe,this.uint16[Ft+14]=Me,this.uint16[Ft+15]=Ze,this.uint16[Ft+16]=st,this.uint16[Ft+17]=Ke,this.uint16[Ft+18]=nt,this.uint16[Ft+19]=kt,this.uint16[Ft+20]=St,this.uint16[Ft+21]=lr,this.uint16[Ft+22]=hr,this.uint32[br+12]=er,this.float32[br+13]=Zt,this.float32[br+14]=Ht,this.float32[br+15]=tr,this.float32[br+16]=Yt,s}}_e.prototype.bytesPerElement=68,dr("StructArrayLayout8i15ui1ul4f68",_e);class we extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s){const d=this.length;return this.resize(d+1),this.emplace(d,s)}emplace(s,d){return this.float32[1*s+0]=d,s}}we.prototype.bytesPerElement=4,dr("StructArrayLayout1f4",we);class $e extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,s,d,m)}emplace(s,d,m,_){const S=3*s;return this.int16[S+0]=d,this.int16[S+1]=m,this.int16[S+2]=_,s}}$e.prototype.bytesPerElement=6,dr("StructArrayLayout3i6",$e);class Ue extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,s,d,m)}emplace(s,d,m,_){const S=4*s;return this.uint32[2*s+0]=d,this.uint16[S+2]=m,this.uint16[S+3]=_,s}}Ue.prototype.bytesPerElement=8,dr("StructArrayLayout1ul2ui8",Ue);class et extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,d){const m=this.length;return this.resize(m+1),this.emplace(m,s,d)}emplace(s,d,m){const _=2*s;return this.uint16[_+0]=d,this.uint16[_+1]=m,s}}et.prototype.bytesPerElement=4,dr("StructArrayLayout2ui4",et);class Pe extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s){const d=this.length;return this.resize(d+1),this.emplace(d,s)}emplace(s,d){return this.uint16[1*s+0]=d,s}}Pe.prototype.bytesPerElement=2,dr("StructArrayLayout1ui2",Pe);class at extends ei{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,d,m,_){const S=this.length;return this.resize(S+1),this.emplace(S,s,d,m,_)}emplace(s,d,m,_,S){const M=4*s;return this.float32[M+0]=d,this.float32[M+1]=m,this.float32[M+2]=_,this.float32[M+3]=S,s}}at.prototype.bytesPerElement=16,dr("StructArrayLayout4f16",at);class rt extends Is{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new ne(this.anchorPointX,this.anchorPointY)}}rt.prototype.size=20;class gt extends V{get(s){return new rt(this,s)}}dr("CollisionBoxArray",gt);class yt extends Is{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(s){this._structArray.uint8[this._pos1+37]=s}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(s){this._structArray.uint8[this._pos1+38]=s}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(s){this._structArray.uint32[this._pos4+10]=s}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}yt.prototype.size=48;class zt extends Se{get(s){return new yt(this,s)}}dr("PlacedSymbolArray",zt);class vt extends Is{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(s){this._structArray.uint32[this._pos4+12]=s}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}vt.prototype.size=68;class nr extends _e{get(s){return new vt(this,s)}}dr("SymbolInstanceArray",nr);class Gt extends we{getoffsetX(s){return this.float32[1*s+0]}}dr("GlyphOffsetArray",Gt);class sr extends $e{getx(s){return this.int16[3*s+0]}gety(s){return this.int16[3*s+1]}gettileUnitDistanceFromAnchor(s){return this.int16[3*s+2]}}dr("SymbolLineVertexArray",sr);class Nr extends Is{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Nr.prototype.size=8;class Br extends Ue{get(s){return new Nr(this,s)}}dr("FeatureIndexArray",Br);class _r extends nl{}class dn extends nl{}class fn extends nl{}class Yr extends l{}class Jr extends h{}class mn extends g{}class Ei extends b{}class Ta extends P{}class na extends z{}class Pa extends ${}class Rs extends W{}class Uo extends ie{}class co extends fe{}class rs extends et{}const $d=ci([{name:"a_pos",components:2,type:"Int16"}],4),{members:yi}=$d;class Kr{constructor(s=[]){this.segments=s}prepareSegment(s,d,m,_){let S=this.segments[this.segments.length-1];return s>Kr.MAX_VERTEX_ARRAY_LENGTH&&B(`Max vertices per segment is ${Kr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${s}`),(!S||S.vertexLength+s>Kr.MAX_VERTEX_ARRAY_LENGTH||S.sortKey!==_)&&(S={vertexOffset:d.length,primitiveOffset:m.length,vertexLength:0,primitiveLength:0},_!==void 0&&(S.sortKey=_),this.segments.push(S)),S}get(){return this.segments}destroy(){for(const s of this.segments)for(const d in s.vaos)s.vaos[d].destroy()}static simpleSegment(s,d,m,_){return new Kr([{vertexOffset:s,primitiveOffset:d,vertexLength:m,primitiveLength:_,vaos:{},sortKey:0}])}}function cn(c,s){return 256*(c=w(Math.floor(c),0,255))+w(Math.floor(s),0,255)}Kr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dr("SegmentVector",Kr);const ki=ci([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Ti={exports:{}},zn={exports:{}};zn.exports=function(c,s){var d,m,_,S,M,D,F,U;for(m=c.length-(d=3&c.length),_=s,M=3432918353,D=461845907,U=0;U>>16)*M&65535)<<16)&4294967295)<<15|F>>>17))*D+(((F>>>16)*D&65535)<<16)&4294967295)<<13|_>>>19))+((5*(_>>>16)&65535)<<16)&4294967295))+((58964+(S>>>16)&65535)<<16);switch(F=0,d){case 3:F^=(255&c.charCodeAt(U+2))<<16;case 2:F^=(255&c.charCodeAt(U+1))<<8;case 1:_^=F=(65535&(F=(F=(65535&(F^=255&c.charCodeAt(U)))*M+(((F>>>16)*M&65535)<<16)&4294967295)<<15|F>>>17))*D+(((F>>>16)*D&65535)<<16)&4294967295}return _^=c.length,_=2246822507*(65535&(_^=_>>>16))+((2246822507*(_>>>16)&65535)<<16)&4294967295,_=3266489909*(65535&(_^=_>>>13))+((3266489909*(_>>>16)&65535)<<16)&4294967295,(_^=_>>>16)>>>0};var Ko={exports:{}};Ko.exports=function(c,s){for(var d,m=c.length,_=s^m,S=0;m>=4;)d=1540483477*(65535&(d=255&c.charCodeAt(S)|(255&c.charCodeAt(++S))<<8|(255&c.charCodeAt(++S))<<16|(255&c.charCodeAt(++S))<<24))+((1540483477*(d>>>16)&65535)<<16),_=1540483477*(65535&_)+((1540483477*(_>>>16)&65535)<<16)^(d=1540483477*(65535&(d^=d>>>24))+((1540483477*(d>>>16)&65535)<<16)),m-=4,++S;switch(m){case 3:_^=(255&c.charCodeAt(S+2))<<16;case 2:_^=(255&c.charCodeAt(S+1))<<8;case 1:_=1540483477*(65535&(_^=255&c.charCodeAt(S)))+((1540483477*(_>>>16)&65535)<<16)}return _=1540483477*(65535&(_^=_>>>13))+((1540483477*(_>>>16)&65535)<<16),(_^=_>>>15)>>>0};var il=zn.exports,ip=Ko.exports;Ti.exports=il,Ti.exports.murmur3=il,Ti.exports.murmur2=ip;class ru{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(s,d,m,_){this.ids.push(_g(s)),this.positions.push(d,m,_)}getPositions(s){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const d=_g(s);let m=0,_=this.ids.length-1;for(;m<_;){const M=m+_>>1;this.ids[M]>=d?_=M:m=M+1}const S=[];for(;this.ids[m]===d;)S.push({index:this.positions[3*m],start:this.positions[3*m+1],end:this.positions[3*m+2]}),m++;return S}static serialize(s,d){const m=new Float64Array(s.ids),_=new Uint32Array(s.positions);return op(m,_,0,m.length-1),d&&d.push(m.buffer,_.buffer),{ids:m,positions:_}}static deserialize(s){const d=new ru;return d.ids=s.ids,d.positions=s.positions,d.indexed=!0,d}}function _g(c){const s=+c;return!isNaN(s)&&s<=Number.MAX_SAFE_INTEGER?s:Ti.exports(String(c))}function op(c,s,d,m){for(;d>1];let S=d-1,M=m+1;for(;;){do S++;while(c[S]<_);do M--;while(c[M]>_);if(S>=M)break;Os(c,S,M),Os(s,3*S,3*M),Os(s,3*S+1,3*M+1),Os(s,3*S+2,3*M+2)}M-d`u_${_}`),this.type=m}setUniform(s,d,m){s.set(m.constantOr(this.value))}getBinding(s,d,m){return this.type==="color"?new GE(s,d):new al(s,d)}}class Vd{constructor(s,d){this.uniformNames=d.map(m=>`u_${m}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(s,d){this.pixelRatioFrom=d.pixelRatio,this.pixelRatioTo=s.pixelRatio,this.patternFrom=d.tlbr,this.patternTo=s.tlbr}setUniform(s,d,m,_){const S=_==="u_pattern_to"?this.patternTo:_==="u_pattern_from"?this.patternFrom:_==="u_pixel_ratio_to"?this.pixelRatioTo:_==="u_pixel_ratio_from"?this.pixelRatioFrom:null;S&&s.set(S)}getBinding(s,d,m){return m.substr(0,9)==="u_pattern"?new Bd(s,d):new al(s,d)}}class sl{constructor(s,d,m,_){this.expression=s,this.type=m,this.maxValue=0,this.paintVertexAttributes=d.map(S=>({name:`a_${S}`,type:"Float32",components:m==="color"?2:1,offset:0})),this.paintVertexArray=new _}populatePaintArray(s,d,m,_,S){const M=this.paintVertexArray.length,D=this.expression.evaluate(new Nn(0),d,{},_,[],S);this.paintVertexArray.resize(s),this._setPaintValue(M,s,D)}updatePaintArray(s,d,m,_){const S=this.expression.evaluate({zoom:0},m,_);this._setPaintValue(s,d,S)}_setPaintValue(s,d,m){if(this.type==="color"){const _=__(m);for(let S=s;S`u_${D}_t`),this.type=m,this.useIntegerZoom=_,this.zoom=S,this.maxValue=0,this.paintVertexAttributes=d.map(D=>({name:`a_${D}`,type:"Float32",components:m==="color"?4:2,offset:0})),this.paintVertexArray=new M}populatePaintArray(s,d,m,_,S){const M=this.expression.evaluate(new Nn(this.zoom),d,{},_,[],S),D=this.expression.evaluate(new Nn(this.zoom+1),d,{},_,[],S),F=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValue(F,s,M,D)}updatePaintArray(s,d,m,_){const S=this.expression.evaluate({zoom:this.zoom},m,_),M=this.expression.evaluate({zoom:this.zoom+1},m,_);this._setPaintValue(s,d,S,M)}_setPaintValue(s,d,m,_){if(this.type==="color"){const S=__(m),M=__(_);for(let D=s;D`#define HAS_UNIFORM_${_}`))}return s}getBinderAttributes(){const s=[];for(const d in this.binders){const m=this.binders[d];if(m instanceof sl||m instanceof ns)for(let _=0;_!0){this.programConfigurations={};for(const _ of s)this.programConfigurations[_.id]=new ZE(_,d,m);this.needsUpload=!1,this._featureMap=new ru,this._bufferOffset=0}populatePaintArrays(s,d,m,_,S,M){for(const D in this.programConfigurations)this.programConfigurations[D].populatePaintArrays(s,d,_,S,M);d.id!==void 0&&this._featureMap.add(d.id,m,this._bufferOffset,s),this._bufferOffset=s,this.needsUpload=!0}updatePaintArrays(s,d,m,_){for(const S of m)this.needsUpload=this.programConfigurations[S.id].updatePaintArrays(s,this._featureMap,d,S,_)||this.needsUpload}get(s){return this.programConfigurations[s]}upload(s){if(this.needsUpload){for(const d in this.programConfigurations)this.programConfigurations[d].upload(s);this.needsUpload=!1}}destroy(){for(const s in this.programConfigurations)this.programConfigurations[s].destroy()}}function wF(c,s){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[c]||[c.replace(`${s}-`,"").replace(/-/g,"_")]}function XE(c,s,d){const m={color:{source:g,composite:at},number:{source:we,composite:g}},_=function(S){return{"line-pattern":{source:Ei,composite:Ei},"fill-pattern":{source:Ei,composite:Ei},"fill-extrusion-pattern":{source:Ei,composite:Ei}}[S]}(c);return _&&_[d]||m[s][d]}dr("ConstantBinder",ap),dr("CrossFadedConstantBinder",Vd),dr("SourceExpressionBinder",sl),dr("CrossFadedCompositeBinder",nu),dr("CompositeExpressionBinder",ns),dr("ProgramConfiguration",ZE,{omit:["_buffers"]}),dr("ProgramConfigurationSet",Ec);var xi=8192;const b_=Math.pow(2,14)-1,YE=-b_-1;function kc(c){const s=xi/c.extent,d=c.loadGeometry();for(let m=0;mM.x+1||FM.y+1)&&B("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return d}function Tc(c,s){return{type:c.type,id:c.id,properties:c.properties,geometry:s?kc(c):[]}}function bg(c,s,d,m,_){c.emplaceBack(2*s+(m+1)/2,2*d+(_+1)/2)}class w_{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(d=>d.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new dn,this.indexArray=new co,this.segments=new Kr,this.programConfigurations=new Ec(s.layers,s.zoom),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(s,d,m){const _=this.layers[0],S=[];let M=null,D=!1;_.type==="circle"&&(M=_.layout.get("circle-sort-key"),D=!M.isConstant());for(const{feature:F,id:U,index:X,sourceLayerIndex:re}of s){const ue=this.layers[0]._featureFilter.needGeometry,he=Tc(F,ue);if(!this.layers[0]._featureFilter.filter(new Nn(this.zoom),he,m))continue;const pe=D?M.evaluate(he,{},m):void 0,Oe={id:U,properties:F.properties,type:F.type,sourceLayerIndex:re,index:X,geometry:ue?he.geometry:kc(F),patterns:{},sortKey:pe};S.push(Oe)}D&&S.sort((F,U)=>F.sortKey-U.sortKey);for(const F of S){const{geometry:U,index:X,sourceLayerIndex:re}=F,ue=s[X].feature;this.addFeature(F,U,X,m),d.featureIndex.insert(ue,U,X,re,this.index)}}update(s,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,d,this.stateDependentLayers,m)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,yi),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(s,d,m,_){for(const S of d)for(const M of S){const D=M.x,F=M.y;if(D<0||D>=xi||F<0||F>=xi)continue;const U=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,s.sortKey),X=U.vertexLength;bg(this.layoutVertexArray,D,F,-1,-1),bg(this.layoutVertexArray,D,F,1,-1),bg(this.layoutVertexArray,D,F,1,1),bg(this.layoutVertexArray,D,F,-1,1),this.indexArray.emplaceBack(X,X+1,X+2),this.indexArray.emplaceBack(X,X+3,X+2),U.vertexLength+=4,U.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,m,{},_)}}function QE(c,s){for(let d=0;d1){if(C_(c,s))return!0;for(let m=0;m1?d:d.sub(s)._mult(_)._add(s))}function t5(c,s){let d,m,_,S=!1;for(let M=0;Ms.y!=_.y>s.y&&s.x<(_.x-m.x)*(s.y-m.y)/(_.y-m.y)+m.x&&(S=!S)}return S}function jd(c,s){let d=!1;for(let m=0,_=c.length-1;ms.y!=M.y>s.y&&s.x<(M.x-S.x)*(s.y-S.y)/(M.y-S.y)+S.x&&(d=!d)}return d}function kF(c,s,d){const m=d[0],_=d[2];if(c.x_.x&&s.x>_.x||c.y_.y&&s.y>_.y)return!1;const S=j(c,s,d[0]);return S!==j(c,s,d[1])||S!==j(c,s,d[2])||S!==j(c,s,d[3])}function sp(c,s,d){const m=s.paint.get(c).value;return m.kind==="constant"?m.value:d.programConfigurations.get(s.id).getMaxValue(c)}function wg(c){return Math.sqrt(c[0]*c[0]+c[1]*c[1])}function Cg(c,s,d,m,_){if(!s[0]&&!s[1])return c;const S=ne.convert(s)._mult(_);d==="viewport"&&S._rotate(-m);const M=[];for(let D=0;Dc.width||_.height>c.height||d.x>c.width-_.width||d.y>c.height-_.height)throw new RangeError("out of range source coordinates for image copy");if(_.width>s.width||_.height>s.height||m.x>s.width-_.width||m.y>s.height-_.height)throw new RangeError("out of range destination coordinates for image copy");const M=c.data,D=s.data;if(M===D)throw new Error("srcData equals dstData, so image is already copied");for(let F=0;F<_.height;F++){const U=((d.y+F)*c.width+d.x)*S,X=((m.y+F)*s.width+m.x)*S;for(let re=0;re<_.width*S;re++)D[X+re]=M[U+re]}return s}class up{constructor(s,d){k_(this,s,1,d)}resize(s){u5(this,s,1)}clone(){return new up({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,d,m,_,S){T_(s,d,m,_,S,1)}}class ia{constructor(s,d){k_(this,s,4,d)}resize(s){u5(this,s,4)}replace(s,d){d?this.data.set(s):this.data=s instanceof Uint8ClampedArray?new Uint8Array(s.buffer):s}clone(){return new ia({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,d,m,_,S){T_(s,d,m,_,S,4)}}function c5(c){const s={},d=c.resolution||256,m=c.clips?c.clips.length:1,_=c.image||new ia({width:d,height:m});if(Math.log(d)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${d}`);const S=(M,D,F)=>{s[c.evaluationKey]=F;const U=c.expression.evaluate(s);_.data[M+D+0]=Math.floor(255*U.r/U.a),_.data[M+D+1]=Math.floor(255*U.g/U.a),_.data[M+D+2]=Math.floor(255*U.b/U.a),_.data[M+D+3]=Math.floor(255*U.a)};if(c.clips)for(let M=0,D=0;M80*d){m=S=c[0],_=M=c[1];for(var pe=d;peS&&(S=D),F>M&&(M=F);U=(U=Math.max(S-m,M-_))!==0?32767/U:0}return cp(ue,he,d,m,_,U,0),he}function d5(c,s,d,m,_){var S,M;if(_===I_(c,s,d,m)>0)for(S=s;S=s;S-=m)M=p5(S,c[S],c[S+1],M);return M&&Tg(M,M.next)&&(fp(M),M=M.next),M}function Pc(c,s){if(!c)return c;s||(s=c);var d,m=c;do if(d=!1,m.steiner||!Tg(m,m.next)&&ai(m.prev,m,m.next)!==0)m=m.next;else{if(fp(m),(m=s=m.prev)===m.next)break;d=!0}while(d||m!==s);return s}function cp(c,s,d,m,_,S,M){if(c){!M&&S&&function(X,re,ue,he){var pe=X;do pe.z===0&&(pe.z=P_(pe.x,pe.y,re,ue,he)),pe.prevZ=pe.prev,pe.nextZ=pe.next,pe=pe.next;while(pe!==X);pe.prevZ.nextZ=null,pe.prevZ=null,function(Oe){var Me,Ze,st,Ke,nt,kt,St,lr,hr=1;do{for(Ze=Oe,Oe=null,nt=null,kt=0;Ze;){for(kt++,st=Ze,St=0,Me=0;Me0||lr>0&&st;)St!==0&&(lr===0||!st||Ze.z<=st.z)?(Ke=Ze,Ze=Ze.nextZ,St--):(Ke=st,st=st.nextZ,lr--),nt?nt.nextZ=Ke:Oe=Ke,Ke.prevZ=nt,nt=Ke;Ze=st}nt.nextZ=null,hr*=2}while(kt>1)}(pe)}(c,m,_,S);for(var D,F,U=c;c.prev!==c.next;)if(D=c.prev,F=c.next,S?zF(c,m,_,S):NF(c))s.push(D.i/d|0),s.push(c.i/d|0),s.push(F.i/d|0),fp(c),c=F.next,U=F.next;else if((c=F)===U){M?M===1?cp(c=DF(Pc(c),s,d),s,d,m,_,S,2):M===2&&LF(c,s,d,m,_,S):cp(Pc(c),s,d,m,_,S,1);break}}}function NF(c){var s=c.prev,d=c,m=c.next;if(ai(s,d,m)>=0)return!1;for(var _=s.x,S=d.x,M=m.x,D=s.y,F=d.y,U=m.y,X=_S?_>M?_:M:S>M?S:M,he=D>F?D>U?D:U:F>U?F:U,pe=m.next;pe!==s;){if(pe.x>=X&&pe.x<=ue&&pe.y>=re&&pe.y<=he&&Ud(_,D,S,F,M,U,pe.x,pe.y)&&ai(pe.prev,pe,pe.next)>=0)return!1;pe=pe.next}return!0}function zF(c,s,d,m){var _=c.prev,S=c,M=c.next;if(ai(_,S,M)>=0)return!1;for(var D=_.x,F=S.x,U=M.x,X=_.y,re=S.y,ue=M.y,he=DF?D>U?D:U:F>U?F:U,Me=X>re?X>ue?X:ue:re>ue?re:ue,Ze=P_(he,pe,s,d,m),st=P_(Oe,Me,s,d,m),Ke=c.prevZ,nt=c.nextZ;Ke&&Ke.z>=Ze&&nt&&nt.z<=st;){if(Ke.x>=he&&Ke.x<=Oe&&Ke.y>=pe&&Ke.y<=Me&&Ke!==_&&Ke!==M&&Ud(D,X,F,re,U,ue,Ke.x,Ke.y)&&ai(Ke.prev,Ke,Ke.next)>=0||(Ke=Ke.prevZ,nt.x>=he&&nt.x<=Oe&&nt.y>=pe&&nt.y<=Me&&nt!==_&&nt!==M&&Ud(D,X,F,re,U,ue,nt.x,nt.y)&&ai(nt.prev,nt,nt.next)>=0))return!1;nt=nt.nextZ}for(;Ke&&Ke.z>=Ze;){if(Ke.x>=he&&Ke.x<=Oe&&Ke.y>=pe&&Ke.y<=Me&&Ke!==_&&Ke!==M&&Ud(D,X,F,re,U,ue,Ke.x,Ke.y)&&ai(Ke.prev,Ke,Ke.next)>=0)return!1;Ke=Ke.prevZ}for(;nt&&nt.z<=st;){if(nt.x>=he&&nt.x<=Oe&&nt.y>=pe&&nt.y<=Me&&nt!==_&&nt!==M&&Ud(D,X,F,re,U,ue,nt.x,nt.y)&&ai(nt.prev,nt,nt.next)>=0)return!1;nt=nt.nextZ}return!0}function DF(c,s,d){var m=c;do{var _=m.prev,S=m.next.next;!Tg(_,S)&&f5(_,m,m.next,S)&&dp(_,S)&&dp(S,_)&&(s.push(_.i/d|0),s.push(m.i/d|0),s.push(S.i/d|0),fp(m),fp(m.next),m=c=S),m=m.next}while(m!==c);return Pc(m)}function LF(c,s,d,m,_,S){var M=c;do{for(var D=M.next.next;D!==M.prev;){if(M.i!==D.i&&jF(M,D)){var F=h5(M,D);return M=Pc(M,M.next),F=Pc(F,F.next),cp(M,s,d,m,_,S,0),void cp(F,s,d,m,_,S,0)}D=D.next}M=M.next}while(M!==c)}function FF(c,s){return c.x-s.x}function $F(c,s){var d=function(_,S){var M,D=S,F=_.x,U=_.y,X=-1/0;do{if(U<=D.y&&U>=D.next.y&&D.next.y!==D.y){var re=D.x+(U-D.y)*(D.next.x-D.x)/(D.next.y-D.y);if(re<=F&&re>X&&(X=re,M=D.x=D.x&&D.x>=pe&&F!==D.x&&Ud(UM.x||D.x===M.x&&BF(M,D)))&&(M=D,Me=ue)),D=D.next;while(D!==he);return M}(c,s);if(!d)return s;var m=h5(d,c);return Pc(m,m.next),Pc(d,d.next)}function BF(c,s){return ai(c.prev,c,s.prev)<0&&ai(s.next,c,c.next)<0}function P_(c,s,d,m,_){return(c=1431655765&((c=858993459&((c=252645135&((c=16711935&((c=(c-d)*_|0)|c<<8))|c<<4))|c<<2))|c<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-m)*_|0)|s<<8))|s<<4))|s<<2))|s<<1))<<1}function VF(c){var s=c,d=c;do(s.x=(c-M)*(S-D)&&(c-M)*(m-D)>=(d-M)*(s-D)&&(d-M)*(S-D)>=(_-M)*(m-D)}function jF(c,s){return c.next.i!==s.i&&c.prev.i!==s.i&&!function(d,m){var _=d;do{if(_.i!==d.i&&_.next.i!==d.i&&_.i!==m.i&&_.next.i!==m.i&&f5(_,_.next,d,m))return!0;_=_.next}while(_!==d);return!1}(c,s)&&(dp(c,s)&&dp(s,c)&&function(d,m){var _=d,S=!1,M=(d.x+m.x)/2,D=(d.y+m.y)/2;do _.y>D!=_.next.y>D&&_.next.y!==_.y&&M<(_.next.x-_.x)*(D-_.y)/(_.next.y-_.y)+_.x&&(S=!S),_=_.next;while(_!==d);return S}(c,s)&&(ai(c.prev,c,s.prev)||ai(c,s.prev,s))||Tg(c,s)&&ai(c.prev,c,c.next)>0&&ai(s.prev,s,s.next)>0)}function ai(c,s,d){return(s.y-c.y)*(d.x-s.x)-(s.x-c.x)*(d.y-s.y)}function Tg(c,s){return c.x===s.x&&c.y===s.y}function f5(c,s,d,m){var _=Mg(ai(c,s,d)),S=Mg(ai(c,s,m)),M=Mg(ai(d,m,c)),D=Mg(ai(d,m,s));return _!==S&&M!==D||!(_!==0||!Pg(c,d,s))||!(S!==0||!Pg(c,m,s))||!(M!==0||!Pg(d,c,m))||!(D!==0||!Pg(d,s,m))}function Pg(c,s,d){return s.x<=Math.max(c.x,d.x)&&s.x>=Math.min(c.x,d.x)&&s.y<=Math.max(c.y,d.y)&&s.y>=Math.min(c.y,d.y)}function Mg(c){return c>0?1:c<0?-1:0}function dp(c,s){return ai(c.prev,c,c.next)<0?ai(c,s,c.next)>=0&&ai(c,c.prev,s)>=0:ai(c,s,c.prev)<0||ai(c,c.next,s)<0}function h5(c,s){var d=new M_(c.i,c.x,c.y),m=new M_(s.i,s.x,s.y),_=c.next,S=s.prev;return c.next=s,s.prev=c,d.next=_,_.prev=d,m.next=d,d.prev=m,S.next=m,m.prev=S,m}function p5(c,s,d,m){var _=new M_(c,s,d);return m?(_.next=m.next,_.prev=m,m.next.prev=_,m.next=_):(_.prev=_,_.next=_),_}function fp(c){c.next.prev=c.prev,c.prev.next=c.next,c.prevZ&&(c.prevZ.nextZ=c.nextZ),c.nextZ&&(c.nextZ.prevZ=c.prevZ)}function M_(c,s,d){this.i=c,this.x=s,this.y=d,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I_(c,s,d,m){for(var _=0,S=s,M=d-m;Sd;){if(m-d>600){var S=m-d+1,M=s-d+1,D=Math.log(S),F=.5*Math.exp(2*D/3),U=.5*Math.sqrt(D*F*(S-F)/S)*(M-S/2<0?-1:1);m5(c,s,Math.max(d,Math.floor(s-M*F/S+U)),Math.min(m,Math.floor(s+(S-M)*F/S+U)),_)}var X=c[s],re=d,ue=m;for(hp(c,d,s),_(c[m],X)>0&&hp(c,d,m);re0;)ue--}_(c[d],X)===0?hp(c,d,ue):hp(c,++ue,m),ue<=s&&(d=ue+1),s<=ue&&(m=ue-1)}}function hp(c,s,d){var m=c[s];c[s]=c[d],c[d]=m}function KF(c,s){return cs?1:0}function R_(c,s){const d=c.length;if(d<=1)return[c];const m=[];let _,S;for(let M=0;M1)for(let M=0;M0&&d.holes.push(m+=c[_-1].length)}return d};class N_{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(d=>d.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new fn,this.indexArray=new co,this.indexArray2=new rs,this.programConfigurations=new Ec(s.layers,s.zoom),this.segments=new Kr,this.segments2=new Kr,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(s,d,m){this.hasPattern=O_("fill",this.layers,d);const _=this.layers[0].layout.get("fill-sort-key"),S=!_.isConstant(),M=[];for(const{feature:D,id:F,index:U,sourceLayerIndex:X}of s){const re=this.layers[0]._featureFilter.needGeometry,ue=Tc(D,re);if(!this.layers[0]._featureFilter.filter(new Nn(this.zoom),ue,m))continue;const he=S?_.evaluate(ue,{},m,d.availableImages):void 0,pe={id:F,properties:D.properties,type:D.type,sourceLayerIndex:X,index:U,geometry:re?ue.geometry:kc(D),patterns:{},sortKey:he};M.push(pe)}S&&M.sort((D,F)=>D.sortKey-F.sortKey);for(const D of M){const{geometry:F,index:U,sourceLayerIndex:X}=D;if(this.hasPattern){const re=A_("fill",this.layers,D,this.zoom,d);this.patternFeatures.push(re)}else this.addFeature(D,F,U,m,{});d.featureIndex.insert(s[U].feature,F,U,X,this.index)}}update(s,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,d,this.stateDependentLayers,m)}addFeatures(s,d,m){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,d,m)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,AF),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.indexBuffer2=s.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(s,d,m,_,S){for(const M of R_(d,500)){let D=0;for(const he of M)D+=he.length;const F=this.segments.prepareSegment(D,this.layoutVertexArray,this.indexArray),U=F.vertexLength,X=[],re=[];for(const he of M){if(he.length===0)continue;he!==M[0]&&re.push(X.length/2);const pe=this.segments2.prepareSegment(he.length,this.layoutVertexArray,this.indexArray2),Oe=pe.vertexLength;this.layoutVertexArray.emplaceBack(he[0].x,he[0].y),this.indexArray2.emplaceBack(Oe+he.length-1,Oe),X.push(he[0].x),X.push(he[0].y);for(let Me=1;Me>3}if(_--,m===1||m===2)S+=c.readSVarint(),M+=c.readSVarint(),m===1&&(s&&D.push(s),s=[]),s.push(new YF(S,M));else{if(m!==7)throw new Error("unknown command "+m);s&&s.push(s[0].clone())}}return s&&D.push(s),D},Kd.prototype.bbox=function(){var c=this._pbf;c.pos=this._geometry;for(var s=c.readVarint()+c.pos,d=1,m=0,_=0,S=0,M=1/0,D=-1/0,F=1/0,U=-1/0;c.pos>3}if(m--,d===1||d===2)(_+=c.readSVarint())D&&(D=_),(S+=c.readSVarint())U&&(U=S);else if(d!==7)throw new Error("unknown command "+d)}return[M,F,D,U]},Kd.prototype.toGeoJSON=function(c,s,d){var m,_,S=this.extent*Math.pow(2,d),M=this.extent*c,D=this.extent*s,F=this.loadGeometry(),U=Kd.types[this.type];function X(he){for(var pe=0;pe>3;_=M===1?m.readString():M===2?m.readFloat():M===3?m.readDouble():M===4?m.readVarint64():M===5?m.readVarint():M===6?m.readSVarint():M===7?m.readBoolean():null}return _}(d))}y5.prototype.feature=function(c){if(c<0||c>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[c];var s=this._pbf.readVarint()+this._pbf.pos;return new e$(this._pbf,s,this.extent,this._keys,this._values)};var r$=g5;function n$(c,s,d){if(c===3){var m=new r$(d,d.readVarint()+d.pos);m.length&&(s[m.name]=m)}}iu.VectorTile=function(c,s){this.layers=c.readFields(n$,{},s)},iu.VectorTileFeature=v5,iu.VectorTileLayer=g5;const i$=iu.VectorTileFeature.types,z_=Math.pow(2,13);function pp(c,s,d,m,_,S,M,D){c.emplaceBack(s,d,2*Math.floor(m*z_)+M,_*z_*2,S*z_*2,Math.round(D))}class D_{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(d=>d.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new Yr,this.centroidVertexArray=new _r,this.indexArray=new co,this.programConfigurations=new Ec(s.layers,s.zoom),this.segments=new Kr,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(s,d,m){this.features=[],this.hasPattern=O_("fill-extrusion",this.layers,d);for(const{feature:_,id:S,index:M,sourceLayerIndex:D}of s){const F=this.layers[0]._featureFilter.needGeometry,U=Tc(_,F);if(!this.layers[0]._featureFilter.filter(new Nn(this.zoom),U,m))continue;const X={id:S,sourceLayerIndex:D,index:M,geometry:F?U.geometry:kc(_),properties:_.properties,type:_.type,patterns:{}};this.hasPattern?this.features.push(A_("fill-extrusion",this.layers,X,this.zoom,d)):this.addFeature(X,X.geometry,M,m,{}),d.featureIndex.insert(_,X.geometry,M,D,this.index,!0)}}addFeatures(s,d,m){for(const _ of this.features){const{geometry:S}=_;this.addFeature(_,S,_.index,d,m)}}update(s,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,d,this.stateDependentLayers,m)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,XF),this.centroidVertexBuffer=s.createVertexBuffer(this.centroidVertexArray,ZF.members,!0),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(s,d,m,_,S){const M={x:0,y:0,vertexCount:0};for(const D of R_(d,500)){let F=0;for(const pe of D)F+=pe.length;let U=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const pe of D){if(pe.length===0||a$(pe))continue;let Oe=0;for(let Me=0;Me=1){const st=pe[Me-1];if(!o$(Ze,st)){U.vertexLength+4>Kr.MAX_VERTEX_ARRAY_LENGTH&&(U=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ke=Ze.sub(st)._perp()._unit(),nt=st.dist(Ze);Oe+nt>32768&&(Oe=0),pp(this.layoutVertexArray,Ze.x,Ze.y,Ke.x,Ke.y,0,0,Oe),pp(this.layoutVertexArray,Ze.x,Ze.y,Ke.x,Ke.y,0,1,Oe),M.x+=2*Ze.x,M.y+=2*Ze.y,M.vertexCount+=2,Oe+=nt,pp(this.layoutVertexArray,st.x,st.y,Ke.x,Ke.y,0,0,Oe),pp(this.layoutVertexArray,st.x,st.y,Ke.x,Ke.y,0,1,Oe),M.x+=2*st.x,M.y+=2*st.y,M.vertexCount+=2;const kt=U.vertexLength;this.indexArray.emplaceBack(kt,kt+2,kt+1),this.indexArray.emplaceBack(kt+1,kt+2,kt+3),U.vertexLength+=4,U.primitiveLength+=2}}}}if(U.vertexLength+F>Kr.MAX_VERTEX_ARRAY_LENGTH&&(U=this.segments.prepareSegment(F,this.layoutVertexArray,this.indexArray)),i$[s.type]!=="Polygon")continue;const X=[],re=[],ue=U.vertexLength;for(const pe of D)if(pe.length!==0){pe!==D[0]&&re.push(X.length/2);for(let Oe=0;Oexi)||c.y===s.y&&(c.y<0||c.y>xi)}function a$(c){return c.every(s=>s.x<0)||c.every(s=>s.x>xi)||c.every(s=>s.y<0)||c.every(s=>s.y>xi)}dr("FillExtrusionBucket",D_,{omit:["layers","features"]});var s$={paint:new Li({"fill-extrusion-opacity":new pr(Fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Sr(Fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new pr(Fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new pr(Fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new tu(Fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Sr(Fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Sr(Fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new pr(Fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function mp(c,s){return c.x*s.x+c.y*s.y}function x5(c,s){if(c.length===1){let d=0;const m=s[d++];let _;for(;!_||m.equals(_);)if(_=s[d++],!_)return 1/0;for(;dd.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(d=>{this.gradients[d.id]={}}),this.layoutVertexArray=new Jr,this.layoutVertexArray2=new mn,this.indexArray=new co,this.programConfigurations=new Ec(s.layers,s.zoom),this.segments=new Kr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(s,d,m){this.hasPattern=O_("line",this.layers,d);const _=this.layers[0].layout.get("line-sort-key"),S=!_.isConstant(),M=[];for(const{feature:D,id:F,index:U,sourceLayerIndex:X}of s){const re=this.layers[0]._featureFilter.needGeometry,ue=Tc(D,re);if(!this.layers[0]._featureFilter.filter(new Nn(this.zoom),ue,m))continue;const he=S?_.evaluate(ue,{},m):void 0,pe={id:F,properties:D.properties,type:D.type,sourceLayerIndex:X,index:U,geometry:re?ue.geometry:kc(D),patterns:{},sortKey:he};M.push(pe)}S&&M.sort((D,F)=>D.sortKey-F.sortKey);for(const D of M){const{geometry:F,index:U,sourceLayerIndex:X}=D;if(this.hasPattern){const re=A_("line",this.layers,D,this.zoom,d);this.patternFeatures.push(re)}else this.addFeature(D,F,U,m,{});d.featureIndex.insert(s[U].feature,F,U,X,this.index)}}update(s,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,d,this.stateDependentLayers,m)}addFeatures(s,d,m){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,d,m)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=s.createVertexBuffer(this.layoutVertexArray2,d$)),this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,u$),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(s){if(s.properties&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_end"))return{start:+s.properties.mapbox_clip_start,end:+s.properties.mapbox_clip_end}}addFeature(s,d,m,_,S){const M=this.layers[0].layout,D=M.get("line-join").evaluate(s,{}),F=M.get("line-cap"),U=M.get("line-miter-limit"),X=M.get("line-round-limit");this.lineClips=this.lineFeatureClips(s);for(const re of d)this.addLine(re,s,D,F,U,X);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,m,S,_)}addLine(s,d,m,_,S,M){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Ze=0;Ze=2&&s[F-1].equals(s[F-2]);)F--;let U=0;for(;U0;if(lr&&Ze>U){const Ht=ue.dist(he);if(Ht>2*X){const tr=ue.sub(ue.sub(he)._mult(X/Ht)._round());this.updateDistance(he,tr),this.addCurrentVertex(tr,Oe,0,0,re),he=tr}}const er=he&&pe;let Zt=er?m:D?"butt":_;if(er&&Zt==="round"&&(ktS&&(Zt="bevel"),Zt==="bevel"&&(kt>2&&(Zt="flipbevel"),kt100)st=Me.mult(-1);else{const Ht=kt*Oe.add(Me).mag()/Oe.sub(Me).mag();st._perp()._mult(Ht*(hr?-1:1))}this.addCurrentVertex(ue,st,0,0,re),this.addCurrentVertex(ue,st.mult(-1),0,0,re)}else if(Zt==="bevel"||Zt==="fakeround"){const Ht=-Math.sqrt(kt*kt-1),tr=hr?Ht:0,Yt=hr?0:Ht;if(he&&this.addCurrentVertex(ue,Oe,tr,Yt,re),Zt==="fakeround"){const Ft=Math.round(180*St/Math.PI/20);for(let br=1;br2*X){const tr=ue.add(pe.sub(ue)._mult(X/Ht)._round());this.updateDistance(ue,tr),this.addCurrentVertex(tr,Me,0,0,re),ue=tr}}}}addCurrentVertex(s,d,m,_,S,M=!1){const D=d.y*_-d.x,F=-d.y-d.x*_;this.addHalfVertex(s,d.x+d.y*m,d.y-d.x*m,M,!1,m,S),this.addHalfVertex(s,D,F,M,!0,-_,S),this.distance>_5/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(s,d,m,_,S,M))}addHalfVertex({x:s,y:d},m,_,S,M,D,F){const U=.5*(this.lineClips?this.scaledDistance*(_5-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(S?1:0),(d<<1)+(M?1:0),Math.round(63*m)+128,Math.round(63*_)+128,1+(D===0?0:D<0?-1:1)|(63&U)<<2,U>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const X=F.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,X),F.primitiveLength++),M?this.e2=X:this.e1=X}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(s,d){this.distance+=s.dist(d),this.updateScaledDistance()}}dr("LineBucket",L_,{omit:["layers","patternFeatures"]});const p$=new Li({"line-cap":new pr(Fe.layout_line["line-cap"]),"line-join":new Sr(Fe.layout_line["line-join"]),"line-miter-limit":new pr(Fe.layout_line["line-miter-limit"]),"line-round-limit":new pr(Fe.layout_line["line-round-limit"]),"line-sort-key":new Sr(Fe.layout_line["line-sort-key"])});var b5={paint:new Li({"line-opacity":new Sr(Fe.paint_line["line-opacity"]),"line-color":new Sr(Fe.paint_line["line-color"]),"line-translate":new pr(Fe.paint_line["line-translate"]),"line-translate-anchor":new pr(Fe.paint_line["line-translate-anchor"]),"line-width":new Sr(Fe.paint_line["line-width"]),"line-gap-width":new Sr(Fe.paint_line["line-gap-width"]),"line-offset":new Sr(Fe.paint_line["line-offset"]),"line-blur":new Sr(Fe.paint_line["line-blur"]),"line-dasharray":new rp(Fe.paint_line["line-dasharray"]),"line-pattern":new tu(Fe.paint_line["line-pattern"]),"line-gradient":new Ps(Fe.paint_line["line-gradient"])}),layout:p$};const w5=new class extends Sr{possiblyEvaluate(c,s){return s=new Nn(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,zoomHistory:s.zoomHistory,transition:s.transition}),super.possiblyEvaluate(c,s)}evaluate(c,s,d,m){return s=T({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(c,s,d,m)}}(b5.paint.properties["line-width"].specification);function C5(c,s){return s>0?s+2*c:c}w5.useIntegerZoom=!0;const m$=ci([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),v$=ci([{name:"a_projected_pos",components:3,type:"Float32"}],4);ci([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const g$=ci([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);ci([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const S5=ci([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),y$=ci([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function x$(c,s,d){return c.sections.forEach(m=>{m.text=function(_,S,M){const D=S.layout.get("text-transform").evaluate(M,{});return D==="uppercase"?_=_.toLocaleUpperCase():D==="lowercase"&&(_=_.toLocaleLowerCase()),jo.applyArabicShaping&&(_=jo.applyArabicShaping(_)),_}(m.text,s,d)}),c}ci([{name:"triangle",components:3,type:"Uint16"}]),ci([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),ci([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ci([{type:"Float32",name:"offsetX"}]),ci([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const vp={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var Fi=24,F_=xn,E5=function(c,s,d,m,_){var S,M,D=8*_-m-1,F=(1<>1,X=-7,re=d?_-1:0,ue=d?-1:1,he=c[s+re];for(re+=ue,S=he&(1<<-X)-1,he>>=-X,X+=D;X>0;S=256*S+c[s+re],re+=ue,X-=8);for(M=S&(1<<-X)-1,S>>=-X,X+=m;X>0;M=256*M+c[s+re],re+=ue,X-=8);if(S===0)S=1-U;else{if(S===F)return M?NaN:1/0*(he?-1:1);M+=Math.pow(2,m),S-=U}return(he?-1:1)*M*Math.pow(2,S-m)},k5=function(c,s,d,m,_,S){var M,D,F,U=8*S-_-1,X=(1<>1,ue=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,he=m?0:S-1,pe=m?1:-1,Oe=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(D=isNaN(s)?1:0,M=X):(M=Math.floor(Math.log(s)/Math.LN2),s*(F=Math.pow(2,-M))<1&&(M--,F*=2),(s+=M+re>=1?ue/F:ue*Math.pow(2,1-re))*F>=2&&(M++,F/=2),M+re>=X?(D=0,M=X):M+re>=1?(D=(s*F-1)*Math.pow(2,_),M+=re):(D=s*Math.pow(2,re-1)*Math.pow(2,_),M=0));_>=8;c[d+he]=255&D,he+=pe,D/=256,_-=8);for(M=M<<_|D,U+=_;U>0;c[d+he]=255&M,he+=pe,M/=256,U-=8);c[d+he-pe]|=128*Oe};function xn(c){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(c)?c:new Uint8Array(c||0),this.pos=0,this.type=0,this.length=this.buf.length}xn.Varint=0,xn.Fixed64=1,xn.Bytes=2,xn.Fixed32=5;var ou,$_=4294967296,T5=1/$_,P5=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ll(c){return c.type===xn.Bytes?c.readVarint()+c.pos:c.pos+1}function Hd(c,s,d){return d?4294967296*s+(c>>>0):4294967296*(s>>>0)+(c>>>0)}function M5(c,s,d){var m=s<=16383?1:s<=2097151?2:s<=268435455?3:Math.floor(Math.log(s)/(7*Math.LN2));d.realloc(m);for(var _=d.pos-1;_>=c;_--)d.buf[_+m]=d.buf[_]}function _$(c,s){for(var d=0;d>>8,c[d+2]=s>>>16,c[d+3]=s>>>24}function I5(c,s){return(c[s]|c[s+1]<<8|c[s+2]<<16)+(c[s+3]<<24)}function M$(c,s,d){c===1&&d.readMessage(I$,s)}function I$(c,s,d){if(c===3){const{id:m,bitmap:_,width:S,height:M,left:D,top:F,advance:U}=d.readMessage(R$,{});s.push({id:m,bitmap:new up({width:S+6,height:M+6},_),metrics:{width:S,height:M,left:D,top:F,advance:U}})}}function R$(c,s,d){c===1?s.id=d.readVarint():c===2?s.bitmap=d.readBytes():c===3?s.width=d.readVarint():c===4?s.height=d.readVarint():c===5?s.left=d.readSVarint():c===6?s.top=d.readSVarint():c===7&&(s.advance=d.readVarint())}function R5(c){let s=0,d=0;for(const M of c)s+=M.w*M.h,d=Math.max(d,M.w);c.sort((M,D)=>D.h-M.h);const m=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(s/.95)),d),h:1/0}];let _=0,S=0;for(const M of c)for(let D=m.length-1;D>=0;D--){const F=m[D];if(!(M.w>F.w||M.h>F.h)){if(M.x=F.x,M.y=F.y,S=Math.max(S,M.y+M.h),_=Math.max(_,M.x+M.w),M.w===F.w&&M.h===F.h){const U=m.pop();D>3,S=this.pos;this.type=7&m,c(_,s,this),this.pos===S&&this.skip(m)}return s},readMessage:function(c,s){return this.readFields(c,s,this.readVarint()+this.pos)},readFixed32:function(){var c=Ig(this.buf,this.pos);return this.pos+=4,c},readSFixed32:function(){var c=I5(this.buf,this.pos);return this.pos+=4,c},readFixed64:function(){var c=Ig(this.buf,this.pos)+Ig(this.buf,this.pos+4)*$_;return this.pos+=8,c},readSFixed64:function(){var c=Ig(this.buf,this.pos)+I5(this.buf,this.pos+4)*$_;return this.pos+=8,c},readFloat:function(){var c=E5(this.buf,this.pos,!0,23,4);return this.pos+=4,c},readDouble:function(){var c=E5(this.buf,this.pos,!0,52,8);return this.pos+=8,c},readVarint:function(c){var s,d,m=this.buf;return s=127&(d=m[this.pos++]),d<128?s:(s|=(127&(d=m[this.pos++]))<<7,d<128?s:(s|=(127&(d=m[this.pos++]))<<14,d<128?s:(s|=(127&(d=m[this.pos++]))<<21,d<128?s:function(_,S,M){var D,F,U=M.buf;if(D=(112&(F=U[M.pos++]))>>4,F<128||(D|=(127&(F=U[M.pos++]))<<3,F<128)||(D|=(127&(F=U[M.pos++]))<<10,F<128)||(D|=(127&(F=U[M.pos++]))<<17,F<128)||(D|=(127&(F=U[M.pos++]))<<24,F<128)||(D|=(1&(F=U[M.pos++]))<<31,F<128))return Hd(_,D,S);throw new Error("Expected varint not more than 10 bytes")}(s|=(15&(d=m[this.pos]))<<28,c,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var c=this.readVarint();return c%2==1?(c+1)/-2:c/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var c=this.readVarint()+this.pos,s=this.pos;return this.pos=c,c-s>=12&&P5?function(d,m,_){return P5.decode(d.subarray(m,_))}(this.buf,s,c):function(d,m,_){for(var S="",M=m;M<_;){var D,F,U,X=d[M],re=null,ue=X>239?4:X>223?3:X>191?2:1;if(M+ue>_)break;ue===1?X<128&&(re=X):ue===2?(192&(D=d[M+1]))==128&&(re=(31&X)<<6|63&D)<=127&&(re=null):ue===3?(F=d[M+2],(192&(D=d[M+1]))==128&&(192&F)==128&&((re=(15&X)<<12|(63&D)<<6|63&F)<=2047||re>=55296&&re<=57343)&&(re=null)):ue===4&&(F=d[M+2],U=d[M+3],(192&(D=d[M+1]))==128&&(192&F)==128&&(192&U)==128&&((re=(15&X)<<18|(63&D)<<12|(63&F)<<6|63&U)<=65535||re>=1114112)&&(re=null)),re===null?(re=65533,ue=1):re>65535&&(re-=65536,S+=String.fromCharCode(re>>>10&1023|55296),re=56320|1023&re),S+=String.fromCharCode(re),M+=ue}return S}(this.buf,s,c)},readBytes:function(){var c=this.readVarint()+this.pos,s=this.buf.subarray(this.pos,c);return this.pos=c,s},readPackedVarint:function(c,s){if(this.type!==xn.Bytes)return c.push(this.readVarint(s));var d=ll(this);for(c=c||[];this.pos127;);else if(s===xn.Bytes)this.pos=this.readVarint()+this.pos;else if(s===xn.Fixed32)this.pos+=4;else{if(s!==xn.Fixed64)throw new Error("Unimplemented type: "+s);this.pos+=8}},writeTag:function(c,s){this.writeVarint(c<<3|s)},realloc:function(c){for(var s=this.length||16;s268435455||c<0?function(s,d){var m,_;if(s>=0?(m=s%4294967296|0,_=s/4294967296|0):(_=~(-s/4294967296),4294967295^(m=~(-s%4294967296))?m=m+1|0:(m=0,_=_+1|0)),s>=18446744073709552e3||s<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");d.realloc(10),function(S,M,D){D.buf[D.pos++]=127&S|128,S>>>=7,D.buf[D.pos++]=127&S|128,S>>>=7,D.buf[D.pos++]=127&S|128,S>>>=7,D.buf[D.pos++]=127&S|128,D.buf[D.pos]=127&(S>>>=7)}(m,0,d),function(S,M){var D=(7&S)<<4;M.buf[M.pos++]|=D|((S>>>=3)?128:0),S&&(M.buf[M.pos++]=127&S|((S>>>=7)?128:0),S&&(M.buf[M.pos++]=127&S|((S>>>=7)?128:0),S&&(M.buf[M.pos++]=127&S|((S>>>=7)?128:0),S&&(M.buf[M.pos++]=127&S|((S>>>=7)?128:0),S&&(M.buf[M.pos++]=127&S)))))}(_,d)}(c,this):(this.realloc(4),this.buf[this.pos++]=127&c|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=c>>>7&127))))},writeSVarint:function(c){this.writeVarint(c<0?2*-c-1:2*c)},writeBoolean:function(c){this.writeVarint(Boolean(c))},writeString:function(c){c=String(c),this.realloc(4*c.length),this.pos++;var s=this.pos;this.pos=function(m,_,S){for(var M,D,F=0;F<_.length;F++){if((M=_.charCodeAt(F))>55295&&M<57344){if(!D){M>56319||F+1===_.length?(m[S++]=239,m[S++]=191,m[S++]=189):D=M;continue}if(M<56320){m[S++]=239,m[S++]=191,m[S++]=189,D=M;continue}M=D-55296<<10|M-56320|65536,D=null}else D&&(m[S++]=239,m[S++]=191,m[S++]=189,D=null);M<128?m[S++]=M:(M<2048?m[S++]=M>>6|192:(M<65536?m[S++]=M>>12|224:(m[S++]=M>>18|240,m[S++]=M>>12&63|128),m[S++]=M>>6&63|128),m[S++]=63&M|128)}return S}(this.buf,c,this.pos);var d=this.pos-s;d>=128&&M5(s,d,this),this.pos=s-1,this.writeVarint(d),this.pos+=d},writeFloat:function(c){this.realloc(4),k5(this.buf,c,this.pos,!0,23,4),this.pos+=4},writeDouble:function(c){this.realloc(8),k5(this.buf,c,this.pos,!0,52,8),this.pos+=8},writeBytes:function(c){var s=c.length;this.writeVarint(s),this.realloc(s);for(var d=0;d=128&&M5(d,m,this),this.pos=d-1,this.writeVarint(m),this.pos+=m},writeMessage:function(c,s,d){this.writeTag(c,xn.Bytes),this.writeRawMessage(s,d)},writePackedVarint:function(c,s){s.length&&this.writeMessage(c,_$,s)},writePackedSVarint:function(c,s){s.length&&this.writeMessage(c,b$,s)},writePackedBoolean:function(c,s){s.length&&this.writeMessage(c,S$,s)},writePackedFloat:function(c,s){s.length&&this.writeMessage(c,w$,s)},writePackedDouble:function(c,s){s.length&&this.writeMessage(c,C$,s)},writePackedFixed32:function(c,s){s.length&&this.writeMessage(c,E$,s)},writePackedSFixed32:function(c,s){s.length&&this.writeMessage(c,k$,s)},writePackedFixed64:function(c,s){s.length&&this.writeMessage(c,T$,s)},writePackedSFixed64:function(c,s){s.length&&this.writeMessage(c,P$,s)},writeBytesField:function(c,s){this.writeTag(c,xn.Bytes),this.writeBytes(s)},writeFixed32Field:function(c,s){this.writeTag(c,xn.Fixed32),this.writeFixed32(s)},writeSFixed32Field:function(c,s){this.writeTag(c,xn.Fixed32),this.writeSFixed32(s)},writeFixed64Field:function(c,s){this.writeTag(c,xn.Fixed64),this.writeFixed64(s)},writeSFixed64Field:function(c,s){this.writeTag(c,xn.Fixed64),this.writeSFixed64(s)},writeVarintField:function(c,s){this.writeTag(c,xn.Varint),this.writeVarint(s)},writeSVarintField:function(c,s){this.writeTag(c,xn.Varint),this.writeSVarint(s)},writeStringField:function(c,s){this.writeTag(c,xn.Bytes),this.writeString(s)},writeFloatField:function(c,s){this.writeTag(c,xn.Fixed32),this.writeFloat(s)},writeDoubleField:function(c,s){this.writeTag(c,xn.Fixed64),this.writeDouble(s)},writeBooleanField:function(c,s){this.writeVarintField(c,Boolean(s))}};class B_{constructor(s,{pixelRatio:d,version:m,stretchX:_,stretchY:S,content:M}){this.paddedRect=s,this.pixelRatio=d,this.stretchX=_,this.stretchY=S,this.content=M,this.version=m}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class O5{constructor(s,d){const m={},_={};this.haveRenderCallbacks=[];const S=[];this.addImages(s,m,S),this.addImages(d,_,S);const{w:M,h:D}=R5(S),F=new ia({width:M||1,height:D||1});for(const U in s){const X=s[U],re=m[U].paddedRect;ia.copy(X.data,F,{x:0,y:0},{x:re.x+1,y:re.y+1},X.data)}for(const U in d){const X=d[U],re=_[U].paddedRect,ue=re.x+1,he=re.y+1,pe=X.data.width,Oe=X.data.height;ia.copy(X.data,F,{x:0,y:0},{x:ue,y:he},X.data),ia.copy(X.data,F,{x:0,y:Oe-1},{x:ue,y:he-1},{width:pe,height:1}),ia.copy(X.data,F,{x:0,y:0},{x:ue,y:he+Oe},{width:pe,height:1}),ia.copy(X.data,F,{x:pe-1,y:0},{x:ue-1,y:he},{width:1,height:Oe}),ia.copy(X.data,F,{x:0,y:0},{x:ue+pe,y:he},{width:1,height:Oe})}this.image=F,this.iconPositions=m,this.patternPositions=_}addImages(s,d,m){for(const _ in s){const S=s[_],M={x:0,y:0,w:S.data.width+2,h:S.data.height+2};m.push(M),d[_]=new B_(M,S),S.hasRenderCallback&&this.haveRenderCallbacks.push(_)}}patchUpdatedImages(s,d){s.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const m in s.updatedImages)this.patchUpdatedImage(this.iconPositions[m],s.getImage(m),d),this.patchUpdatedImage(this.patternPositions[m],s.getImage(m),d)}patchUpdatedImage(s,d,m){if(!s||!d||s.version===d.version)return;s.version=d.version;const[_,S]=s.tl;m.update(d.data,void 0,{x:_,y:S})}}dr("ImagePosition",B_),dr("ImageAtlas",O5),o.WritingMode=void 0,(ou=o.WritingMode||(o.WritingMode={}))[ou.none=0]="none",ou[ou.horizontal=1]="horizontal",ou[ou.vertical=2]="vertical",ou[ou.horizontalOnly=3]="horizontalOnly";const Rg=-17;class gp{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(s,d){const m=new gp;return m.scale=s||1,m.fontStack=d,m}static forImage(s){const d=new gp;return d.imageName=s,d}}class qd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(s,d){const m=new qd;for(let _=0;_=0&&m>=s&&Ag[this.text.charCodeAt(m)];m--)d--;this.text=this.text.substring(s,d),this.sectionIndex=this.sectionIndex.slice(s,d)}substring(s,d){const m=new qd;return m.text=this.text.substring(s,d),m.sectionIndex=this.sectionIndex.slice(s,d),m.sections=this.sections,m}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((s,d)=>Math.max(s,this.sections[d].scale),0)}addTextSection(s,d){this.text+=s.text,this.sections.push(gp.forText(s.scale,s.fontStack||d));const m=this.sections.length-1;for(let _=0;_=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Og(c,s,d,m,_,S,M,D,F,U,X,re,ue,he,pe,Oe){const Me=qd.fromFeature(c,_);let Ze;re===o.WritingMode.vertical&&Me.verticalizePunctuation();const{processBidirectionalText:st,processStyledBidirectionalText:Ke}=jo;if(st&&Me.sections.length===1){Ze=[];const St=st(Me.toString(),V_(Me,U,S,s,m,he,pe));for(const lr of St){const hr=new qd;hr.text=lr,hr.sections=Me.sections;for(let er=0;er0&&dl>To&&(To=dl)}else{const sa=hr[Hr.fontStack],Po=sa&&sa[qi];if(Po&&Po.rect)is=Po.rect,Ma=Po.metrics;else{const dl=lr[Hr.fontStack],_p=dl&&dl[qi];if(!_p)continue;Ma=_p.metrics}ro=(Wi-Hr.scale)*Fi}Ia?(St.verticalizable=!0,ko.push({glyph:qi,imageName:os,x:Pn,y:Dn+ro,vertical:Ia,scale:Hr.scale,fontStack:Hr.fontStack,sectionIndex:Ho,metrics:Ma,rect:is}),Pn+=cl*Hr.scale+br):(ko.push({glyph:qi,imageName:os,x:Pn,y:Dn+ro,vertical:Ia,scale:Hr.scale,fontStack:Hr.fontStack,sectionIndex:Ho,metrics:Ma,rect:is}),Pn+=Ma.advance*Hr.scale+br)}ko.length!==0&&(_i=Math.max(Pn-br,_i),N$(ko,0,ko.length-1,Ki,To)),Pn=0;const Vn=Ht*Wi+To;po.lineOffset=Math.max(To,to),Dn+=Vn,aa=Math.max(Vn,aa),++di}var Pi;const Hi=Dn-Rg,{horizontalAlign:eo,verticalAlign:Eo}=j_(tr);(function(fi,Wi,to,po,ko,To,Vn,Mi,Hr){const Ho=(Wi-to)*ko;let qi=0;qi=To!==Vn?-Mi*po-Rg:(-po*Hr+.5)*Vn;for(const ro of fi)for(const Ma of ro.positionedGlyphs)Ma.x+=Ho,Ma.y+=qi})(St.positionedLines,Ki,eo,Eo,_i,aa,Ht,Hi,Zt.length),St.top+=-Eo*Hi,St.bottom=St.top+Hi,St.left+=-eo*_i,St.right=St.left+_i}(kt,s,d,m,Ze,M,D,F,re,U,ue,Oe),!function(St){for(const lr of St)if(lr.positionedGlyphs.length!==0)return!1;return!0}(nt)&&kt}const Ag={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},O$={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function A5(c,s,d,m,_,S){if(s.imageName){const M=m[s.imageName];return M?M.displaySize[0]*s.scale*Fi/S+_:0}{const M=d[s.fontStack],D=M&&M[c];return D?D.metrics.advance*s.scale+_:0}}function N5(c,s,d,m){const _=Math.pow(c-s,2);return m?c=0;let X=0;for(let ue=0;ue-d/2;){if(M--,M<0)return!1;D-=c[M].dist(S),S=c[M]}D+=c[M].dist(c[M+1]),M++;const F=[];let U=0;for(;Dm;)U-=F.shift().angleDelta;if(U>_)return!1;M++,D+=X.dist(re)}return!0}function B5(c){let s=0;for(let d=0;dU){const pe=(U-F)/he,Oe=yn(re.x,ue.x,pe),Me=yn(re.y,ue.y,pe),Ze=new au(Oe,Me,ue.angleTo(re),X);return Ze._round(),!M||$5(c,Ze,D,M,s)?Ze:void 0}F+=he}}function L$(c,s,d,m,_,S,M,D,F){const U=V5(m,S,M),X=j5(m,_),re=X*M,ue=c[0].x===0||c[0].x===F||c[0].y===0||c[0].y===F;return s-re=0&&nt=0&&kt=0&&ue+U<=X){const St=new au(nt,kt,st,pe);St._round(),m&&!$5(c,St,S,m,_)||he.push(St)}}re+=Ze}return D||he.length||M||(he=U5(c,re/2,d,m,_,S,M,!0,F)),he}function K5(c,s,d,m,_){const S=[];for(let M=0;M=m&&re.x>=m||(X.x>=m?X=new ne(m,X.y+(m-X.x)/(re.x-X.x)*(re.y-X.y))._round():re.x>=m&&(re=new ne(m,X.y+(m-X.x)/(re.x-X.x)*(re.y-X.y))._round()),X.y>=_&&re.y>=_||(X.y>=_?X=new ne(X.x+(_-X.y)/(re.y-X.y)*(re.x-X.x),_)._round():re.y>=_&&(re=new ne(X.x+(_-X.y)/(re.y-X.y)*(re.x-X.x),_)._round()),F&&X.equals(F[F.length-1])||(F=[X],S.push(F)),F.push(re)))))}}return S}function H5(c,s,d,m){const _=[],S=c.image,M=S.pixelRatio,D=S.paddedRect.w-2,F=S.paddedRect.h-2,U=c.right-c.left,X=c.bottom-c.top,re=S.stretchX||[[0,D]],ue=S.stretchY||[[0,F]],he=(Ht,tr)=>Ht+tr[1]-tr[0],pe=re.reduce(he,0),Oe=ue.reduce(he,0),Me=D-pe,Ze=F-Oe;let st=0,Ke=pe,nt=0,kt=Oe,St=0,lr=Me,hr=0,er=Ze;if(S.content&&m){const Ht=S.content;st=Ng(re,0,Ht[0]),nt=Ng(ue,0,Ht[1]),Ke=Ng(re,Ht[0],Ht[2]),kt=Ng(ue,Ht[1],Ht[3]),St=Ht[0]-st,hr=Ht[1]-nt,lr=Ht[2]-Ht[0]-Ke,er=Ht[3]-Ht[1]-kt}const Zt=(Ht,tr,Yt,Ft)=>{const br=zg(Ht.stretch-st,Ke,U,c.left),mr=Dg(Ht.fixed-St,lr,Ht.stretch,pe),Vr=zg(tr.stretch-nt,kt,X,c.top),Pn=Dg(tr.fixed-hr,er,tr.stretch,Oe),Dn=zg(Yt.stretch-st,Ke,U,c.left),_i=Dg(Yt.fixed-St,lr,Yt.stretch,pe),aa=zg(Ft.stretch-nt,kt,X,c.top),Ki=Dg(Ft.fixed-hr,er,Ft.stretch,Oe),di=new ne(br,Vr),Pi=new ne(Dn,Vr),Hi=new ne(Dn,aa),eo=new ne(br,aa),Eo=new ne(mr/M,Pn/M),fi=new ne(_i/M,Ki/M),Wi=s*Math.PI/180;if(Wi){const ko=Math.sin(Wi),To=Math.cos(Wi),Vn=[To,-ko,ko,To];di._matMult(Vn),Pi._matMult(Vn),eo._matMult(Vn),Hi._matMult(Vn)}const to=Ht.stretch+Ht.fixed,po=tr.stretch+tr.fixed;return{tl:di,tr:Pi,bl:eo,br:Hi,tex:{x:S.paddedRect.x+1+to,y:S.paddedRect.y+1+po,w:Yt.stretch+Yt.fixed-to,h:Ft.stretch+Ft.fixed-po},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Eo,pixelOffsetBR:fi,minFontScaleX:lr/M/U,minFontScaleY:er/M/X,isSDF:d}};if(m&&(S.stretchX||S.stretchY)){const Ht=W5(re,Me,pe),tr=W5(ue,Ze,Oe);for(let Yt=0;Yt0&&(pe=Math.max(10,pe),this.circleDiameter=pe)}else{let re=M.top*D-F[0],ue=M.bottom*D+F[2],he=M.left*D-F[3],pe=M.right*D+F[1];const Oe=M.collisionPadding;if(Oe&&(he-=Oe[0]*D,re-=Oe[1]*D,pe+=Oe[2]*D,ue+=Oe[3]*D),X){const Me=new ne(he,re),Ze=new ne(pe,re),st=new ne(he,ue),Ke=new ne(pe,ue),nt=X*Math.PI/180;Me._rotate(nt),Ze._rotate(nt),st._rotate(nt),Ke._rotate(nt),he=Math.min(Me.x,Ze.x,st.x,Ke.x),pe=Math.max(Me.x,Ze.x,st.x,Ke.x),re=Math.min(Me.y,Ze.y,st.y,Ke.y),ue=Math.max(Me.y,Ze.y,st.y,Ke.y)}s.emplaceBack(d.x,d.y,he,re,pe,ue,m,_,S)}this.boxEndIndex=s.length}}class F${constructor(s=[],d=$$){if(this.data=s,this.length=this.data.length,this.compare=d,this.length>0)for(let m=(this.length>>1)-1;m>=0;m--)this._down(m)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const s=this.data[0],d=this.data.pop();return this.length--,this.length>0&&(this.data[0]=d,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:d,compare:m}=this,_=d[s];for(;s>0;){const S=s-1>>1,M=d[S];if(m(_,M)>=0)break;d[s]=M,s=S}d[s]=_}_down(s){const{data:d,compare:m}=this,_=this.length>>1,S=d[s];for(;s<_;){let M=1+(s<<1),D=d[M];const F=M+1;if(F=0)break;d[s]=D,s=M}d[s]=S}}function $$(c,s){return cs?1:0}function B$(c,s=1,d=!1){let m=1/0,_=1/0,S=-1/0,M=-1/0;const D=c[0];for(let he=0;heS)&&(S=pe.x),(!he||pe.y>M)&&(M=pe.y)}const F=Math.min(S-m,M-_);let U=F/2;const X=new F$([],V$);if(F===0)return new ne(m,_);for(let he=m;here.d||!re.d)&&(re=he,d&&console.log("found best %d after %d probes",Math.round(1e4*he.d)/1e4,ue)),he.max-re.d<=s||(U=he.h/2,X.push(new Gd(he.p.x-U,he.p.y-U,U,c)),X.push(new Gd(he.p.x+U,he.p.y-U,U,c)),X.push(new Gd(he.p.x-U,he.p.y+U,U,c)),X.push(new Gd(he.p.x+U,he.p.y+U,U,c)),ue+=4)}return d&&(console.log(`num probes: ${ue}`),console.log(`best distance: ${re.d}`)),re.p}function V$(c,s){return s.max-c.max}function Gd(c,s,d,m){this.p=new ne(c,s),this.h=d,this.d=function(_,S){let M=!1,D=1/0;for(let F=0;F_.y!=pe.y>_.y&&_.x<(pe.x-he.x)*(_.y-he.y)/(pe.y-he.y)+he.x&&(M=!M),D=Math.min(D,e5(_,he,pe))}}return(M?1:-1)*Math.sqrt(D)}(this.p,m),this.max=this.d+this.h*Math.SQRT2}const U_=Number.POSITIVE_INFINITY;function q5(c,s){return s[1]!==U_?function(d,m,_){let S=0,M=0;switch(m=Math.abs(m),_=Math.abs(_),d){case"top-right":case"top-left":case"top":M=_-7;break;case"bottom-right":case"bottom-left":case"bottom":M=7-_}switch(d){case"top-right":case"bottom-right":case"right":S=-m;break;case"top-left":case"bottom-left":case"left":S=m}return[S,M]}(c,s[0],s[1]):function(d,m){let _=0,S=0;m<0&&(m=0);const M=m/Math.sqrt(2);switch(d){case"top-right":case"top-left":S=M-7;break;case"bottom-right":case"bottom-left":S=7-M;break;case"bottom":S=7-m;break;case"top":S=m-7}switch(d){case"top-right":case"bottom-right":_=-M;break;case"top-left":case"bottom-left":_=M;break;case"left":_=m;break;case"right":_=-m}return[_,S]}(c,s[0])}function K_(c){switch(c){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function j$(c,s,d,m,_,S,M,D,F,U,X){let re=S.textMaxSize.evaluate(s,{});re===void 0&&(re=M);const ue=c.layers[0].layout,he=ue.get("icon-offset").evaluate(s,{},X),pe=Z5(d.horizontal),Oe=M/24,Me=c.tilePixelRatio*Oe,Ze=c.tilePixelRatio*re/24,st=c.tilePixelRatio*D,Ke=c.tilePixelRatio*ue.get("symbol-spacing"),nt=ue.get("text-padding")*c.tilePixelRatio,kt=function(Ft,br,mr,Vr=1){const Pn=Ft.get("icon-padding").evaluate(br,{},mr),Dn=Pn&&Pn.values;return[Dn[0]*Vr,Dn[1]*Vr,Dn[2]*Vr,Dn[3]*Vr]}(ue,s,X,c.tilePixelRatio),St=ue.get("text-max-angle")/180*Math.PI,lr=ue.get("text-rotation-alignment")!=="viewport"&&ue.get("symbol-placement")!=="point",hr=ue.get("icon-rotation-alignment")==="map"&&ue.get("symbol-placement")!=="point",er=ue.get("symbol-placement"),Zt=Ke/2,Ht=ue.get("icon-text-fit");let tr;m&&Ht!=="none"&&(c.allowVerticalPlacement&&d.vertical&&(tr=L5(m,d.vertical,Ht,ue.get("icon-text-fit-padding"),he,Oe)),pe&&(m=L5(m,pe,Ht,ue.get("icon-text-fit-padding"),he,Oe)));const Yt=(Ft,br)=>{br.x<0||br.x>=xi||br.y<0||br.y>=xi||function(mr,Vr,Pn,Dn,_i,aa,Ki,di,Pi,Hi,eo,Eo,fi,Wi,to,po,ko,To,Vn,Mi,Hr,Ho,qi,ro,Ma){const is=mr.addToLineVertexArray(Vr,Pn);let os,cl,Ia,sa,Po=0,dl=0,_p=0,d6=0,eb=-1,tb=-1;const fl={};let f6=Ti.exports(""),rb=0,nb=0;if(di._unevaluatedLayout.getValue("text-radial-offset")===void 0?[rb,nb]=di.layout.get("text-offset").evaluate(Hr,{},ro).map(Mo=>Mo*Fi):(rb=di.layout.get("text-radial-offset").evaluate(Hr,{},ro)*Fi,nb=U_),mr.allowVerticalPlacement&&Dn.vertical){const Mo=di.layout.get("text-rotate").evaluate(Hr,{},ro)+90;Ia=new Lg(Pi,Vr,Hi,eo,Eo,Dn.vertical,fi,Wi,to,Mo),Ki&&(sa=new Lg(Pi,Vr,Hi,eo,Eo,Ki,ko,To,to,Mo))}if(_i){const Mo=di.layout.get("icon-rotate").evaluate(Hr,{}),As=di.layout.get("icon-text-fit")!=="none",bp=H5(_i,Mo,qi,As),wp=Ki?H5(Ki,Mo,qi,As):void 0;cl=new Lg(Pi,Vr,Hi,eo,Eo,_i,ko,To,!1,Mo),Po=4*bp.length;const m6=mr.iconSizeData;let Ic=null;m6.kind==="source"?(Ic=[ul*di.layout.get("icon-size").evaluate(Hr,{})],Ic[0]>su&&B(`${mr.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):m6.kind==="composite"&&(Ic=[ul*Ho.compositeIconSizes[0].evaluate(Hr,{},ro),ul*Ho.compositeIconSizes[1].evaluate(Hr,{},ro)],(Ic[0]>su||Ic[1]>su)&&B(`${mr.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),mr.addSymbols(mr.icon,bp,Ic,Mi,Vn,Hr,o.WritingMode.none,Vr,is.lineStartIndex,is.lineLength,-1,ro),eb=mr.icon.placedSymbolArray.length-1,wp&&(dl=4*wp.length,mr.addSymbols(mr.icon,wp,Ic,Mi,Vn,Hr,o.WritingMode.vertical,Vr,is.lineStartIndex,is.lineLength,-1,ro),tb=mr.icon.placedSymbolArray.length-1)}const h6=Object.keys(Dn.horizontal);for(const Mo of h6){const As=Dn.horizontal[Mo];if(!os){f6=Ti.exports(As.text);const wp=di.layout.get("text-rotate").evaluate(Hr,{},ro);os=new Lg(Pi,Vr,Hi,eo,Eo,As,fi,Wi,to,wp)}const bp=As.positionedLines.length===1;if(_p+=G5(mr,Vr,As,aa,di,to,Hr,po,is,Dn.vertical?o.WritingMode.horizontal:o.WritingMode.horizontalOnly,bp?h6:[Mo],fl,eb,Ho,ro),bp)break}Dn.vertical&&(d6+=G5(mr,Vr,Dn.vertical,aa,di,to,Hr,po,is,o.WritingMode.vertical,["vertical"],fl,tb,Ho,ro));const tB=os?os.boxStartIndex:mr.collisionBoxArray.length,rB=os?os.boxEndIndex:mr.collisionBoxArray.length,nB=Ia?Ia.boxStartIndex:mr.collisionBoxArray.length,iB=Ia?Ia.boxEndIndex:mr.collisionBoxArray.length,oB=cl?cl.boxStartIndex:mr.collisionBoxArray.length,aB=cl?cl.boxEndIndex:mr.collisionBoxArray.length,sB=sa?sa.boxStartIndex:mr.collisionBoxArray.length,lB=sa?sa.boxEndIndex:mr.collisionBoxArray.length;let as=-1;const jg=(Mo,As)=>Mo&&Mo.circleDiameter?Math.max(Mo.circleDiameter,As):As;as=jg(os,as),as=jg(Ia,as),as=jg(cl,as),as=jg(sa,as);const p6=as>-1?1:0;p6&&(as*=Ma/Fi),mr.glyphOffsetArray.length>=Zd.MAX_GLYPHS&&B("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Hr.sortKey!==void 0&&mr.addToSortKeyRanges(mr.symbolInstances.length,Hr.sortKey),mr.symbolInstances.emplaceBack(Vr.x,Vr.y,fl.right>=0?fl.right:-1,fl.center>=0?fl.center:-1,fl.left>=0?fl.left:-1,fl.vertical||-1,eb,tb,f6,tB,rB,nB,iB,oB,aB,sB,lB,Hi,_p,d6,Po,dl,p6,0,fi,rb,nb,as)}(c,br,Ft,d,m,_,tr,c.layers[0],c.collisionBoxArray,s.index,s.sourceLayerIndex,c.index,Me,[nt,nt,nt,nt],lr,F,st,kt,hr,he,s,S,U,X,M)};if(er==="line")for(const Ft of K5(s.geometry,0,0,xi,xi)){const br=L$(Ft,Ke,St,d.vertical||pe,m,24,Ze,c.overscaling,xi);for(const mr of br){const Vr=pe;Vr&&U$(c,Vr.text,Zt,mr)||Yt(Ft,mr)}}else if(er==="line-center"){for(const Ft of s.geometry)if(Ft.length>1){const br=D$(Ft,St,d.vertical||pe,m,24,Ze);br&&Yt(Ft,br)}}else if(s.type==="Polygon")for(const Ft of R_(s.geometry,0)){const br=B$(Ft,16);Yt(Ft[0],new au(br.x,br.y,0))}else if(s.type==="LineString")for(const Ft of s.geometry)Yt(Ft,new au(Ft[0].x,Ft[0].y,0));else if(s.type==="Point")for(const Ft of s.geometry)for(const br of Ft)Yt([br],new au(br.x,br.y,0))}const su=32640;function G5(c,s,d,m,_,S,M,D,F,U,X,re,ue,he,pe){const Oe=function(st,Ke,nt,kt,St,lr,hr,er){const Zt=kt.layout.get("text-rotate").evaluate(lr,{})*Math.PI/180,Ht=[];for(const tr of Ke.positionedLines)for(const Yt of tr.positionedGlyphs){if(!Yt.rect)continue;const Ft=Yt.rect||{};let br=4,mr=!0,Vr=1,Pn=0;const Dn=(St||er)&&Yt.vertical,_i=Yt.metrics.advance*Yt.scale/2;if(er&&Ke.verticalizable){const Vn=(Yt.scale-1)*Fi,Mi=(Fi-Yt.metrics.width*Yt.scale)/2;Pn=tr.lineOffset/2-(Yt.imageName?-Mi:Vn)}if(Yt.imageName){const Vn=hr[Yt.imageName];mr=Vn.sdf,Vr=Vn.pixelRatio,br=1/Vr}const aa=St?[Yt.x+_i,Yt.y]:[0,0];let Ki=St?[0,0]:[Yt.x+_i+nt[0],Yt.y+nt[1]-Pn],di=[0,0];Dn&&(di=Ki,Ki=[0,0]);const Pi=(Yt.metrics.left-br)*Yt.scale-_i+Ki[0],Hi=(-Yt.metrics.top-br)*Yt.scale+Ki[1],eo=Pi+Ft.w*Yt.scale/Vr,Eo=Hi+Ft.h*Yt.scale/Vr,fi=new ne(Pi,Hi),Wi=new ne(eo,Hi),to=new ne(Pi,Eo),po=new ne(eo,Eo);if(Dn){const Vn=new ne(-_i,_i-Rg),Mi=-Math.PI/2,Hr=12-_i,Ho=new ne(22-Hr,-(Yt.imageName?Hr:0)),qi=new ne(...di);fi._rotateAround(Mi,Vn)._add(Ho)._add(qi),Wi._rotateAround(Mi,Vn)._add(Ho)._add(qi),to._rotateAround(Mi,Vn)._add(Ho)._add(qi),po._rotateAround(Mi,Vn)._add(Ho)._add(qi)}if(Zt){const Vn=Math.sin(Zt),Mi=Math.cos(Zt),Hr=[Mi,-Vn,Vn,Mi];fi._matMult(Hr),Wi._matMult(Hr),to._matMult(Hr),po._matMult(Hr)}const ko=new ne(0,0),To=new ne(0,0);Ht.push({tl:fi,tr:Wi,bl:to,br:po,tex:Ft,writingMode:Ke.writingMode,glyphOffset:aa,sectionIndex:Yt.sectionIndex,isSDF:mr,pixelOffsetTL:ko,pixelOffsetBR:To,minFontScaleX:0,minFontScaleY:0})}return Ht}(0,d,D,_,S,M,m,c.allowVerticalPlacement),Me=c.textSizeData;let Ze=null;Me.kind==="source"?(Ze=[ul*_.layout.get("text-size").evaluate(M,{})],Ze[0]>su&&B(`${c.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):Me.kind==="composite"&&(Ze=[ul*he.compositeTextSizes[0].evaluate(M,{},pe),ul*he.compositeTextSizes[1].evaluate(M,{},pe)],(Ze[0]>su||Ze[1]>su)&&B(`${c.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),c.addSymbols(c.text,Oe,Ze,D,S,M,U,s,F.lineStartIndex,F.lineLength,ue,pe);for(const st of X)re[st]=c.text.placedSymbolArray.length-1;return 4*Oe.length}function Z5(c){for(const s in c)return c[s];return null}function U$(c,s,d,m){const _=c.compareText;if(s in _){const S=_[s];for(let M=S.length-1;M>=0;M--)if(m.dist(S[M])M.id),this.index=s.index,this.pixelRatio=s.pixelRatio,this.sourceLayerIndex=s.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=E_([]),this.placementViewportMatrix=E_([]);const d=this.layers[0]._unevaluatedLayout._values;this.textSizeData=F5(this.zoom,d["text-size"]),this.iconSizeData=F5(this.zoom,d["icon-size"]);const m=this.layers[0].layout,_=m.get("symbol-sort-key"),S=m.get("symbol-z-order");this.canOverlap=Z_(m,"text-overlap","text-allow-overlap")!=="never"||Z_(m,"icon-overlap","icon-allow-overlap")!=="never"||m.get("text-ignore-placement")||m.get("icon-ignore-placement"),this.sortFeaturesByKey=S!=="viewport-y"&&!_.isConstant(),this.sortFeaturesByY=(S==="viewport-y"||S==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,m.get("symbol-placement")==="point"&&(this.writingModes=m.get("text-writing-mode").map(M=>o.WritingMode[M])),this.stateDependentLayerIds=this.layers.filter(M=>M.isStateDependent()).map(M=>M.id),this.sourceID=s.sourceID}createArrays(){this.text=new W_(new Ec(this.layers,this.zoom,s=>/^text/.test(s))),this.icon=new W_(new Ec(this.layers,this.zoom,s=>/^icon/.test(s))),this.glyphOffsetArray=new Gt,this.lineVertexArray=new sr,this.symbolInstances=new nr}calculateGlyphDependencies(s,d,m,_,S){for(let M=0;M0)&&(M.value.kind!=="constant"||M.value.value.length>0),X=F.value.kind!=="constant"||!!F.value.value||Object.keys(F.parameters).length>0,re=S.get("symbol-sort-key");if(this.features=[],!U&&!X)return;const ue=d.iconDependencies,he=d.glyphDependencies,pe=d.availableImages,Oe=new Nn(this.zoom);for(const{feature:Me,id:Ze,index:st,sourceLayerIndex:Ke}of s){const nt=_._featureFilter.needGeometry,kt=Tc(Me,nt);if(!_._featureFilter.filter(Oe,kt,m))continue;let St,lr;if(nt||(kt.geometry=kc(Me)),U){const er=_.getValueAndResolveTokens("text-field",kt,m,pe),Zt=be.factory(er);W$(Zt)&&(this.hasRTLText=!0),(!this.hasRTLText||wc()==="unavailable"||this.hasRTLText&&jo.isParsed())&&(St=x$(Zt,_,kt))}if(X){const er=_.getValueAndResolveTokens("icon-image",kt,m,pe);lr=er instanceof Ae?er:Ae.fromString(er)}if(!St&&!lr)continue;const hr=this.sortFeaturesByKey?re.evaluate(kt,{},m):void 0;if(this.features.push({id:Ze,text:St,icon:lr,index:st,sourceLayerIndex:Ke,geometry:kt.geometry,properties:Me.properties,type:K$[Me.type],sortKey:hr}),lr&&(ue[lr.name]=!0),St){const er=M.evaluate(kt,{},m).join(","),Zt=S.get("text-rotation-alignment")!=="viewport"&&S.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.WritingMode.vertical)>=0;for(const Ht of St.sections)if(Ht.image)ue[Ht.image.name]=!0;else{const tr=Ld(St.toString()),Yt=Ht.fontStack||er,Ft=he[Yt]=he[Yt]||{};this.calculateGlyphDependencies(Ht.text,Ft,Zt,this.allowVerticalPlacement,tr)}}}S.get("symbol-placement")==="line"&&(this.features=function(Me){const Ze={},st={},Ke=[];let nt=0;function kt(er){Ke.push(Me[er]),nt++}function St(er,Zt,Ht){const tr=st[er];return delete st[er],st[Zt]=tr,Ke[tr].geometry[0].pop(),Ke[tr].geometry[0]=Ke[tr].geometry[0].concat(Ht[0]),tr}function lr(er,Zt,Ht){const tr=Ze[Zt];return delete Ze[Zt],Ze[er]=tr,Ke[tr].geometry[0].shift(),Ke[tr].geometry[0]=Ht[0].concat(Ke[tr].geometry[0]),tr}function hr(er,Zt,Ht){const tr=Ht?Zt[0][Zt[0].length-1]:Zt[0][0];return`${er}:${tr.x}:${tr.y}`}for(let er=0;erer.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Me,Ze)=>Me.sortKey-Ze.sortKey)}update(s,d,m){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(s,d,this.layers,m),this.icon.programConfigurations.updatePaintArrays(s,d,this.layers,m))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(s){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(s),this.iconCollisionBox.upload(s)),this.text.upload(s,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(s,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(s,d){const m=this.lineVertexArray.length;if(s.segment!==void 0){let _=s.dist(d[s.segment+1]),S=s.dist(d[s.segment]);const M={};for(let D=s.segment+1;D=0;D--)M[D]={x:d[D].x,y:d[D].y,tileUnitDistanceFromAnchor:S},D>0&&(S+=d[D-1].dist(d[D]));for(let D=0;D0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(s,d){const m=s.placedSymbolArray.get(d),_=m.vertexStartIndex+4*m.numGlyphs;for(let S=m.vertexStartIndex;S<_;S+=4)s.indexArray.emplaceBack(S,S+1,S+2),s.indexArray.emplaceBack(S+1,S+2,S+3)}getSortedSymbolIndexes(s){if(this.sortedAngle===s&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const d=Math.sin(s),m=Math.cos(s),_=[],S=[],M=[];for(let D=0;D_[D]-_[F]||S[F]-S[D]),M}addToSortKeyRanges(s,d){const m=this.sortKeyRanges[this.sortKeyRanges.length-1];m&&m.sortKey===d?m.symbolInstanceEnd=s+1:this.sortKeyRanges.push({sortKey:d,symbolInstanceStart:s,symbolInstanceEnd:s+1})}sortFeatures(s){if(this.sortFeaturesByY&&this.sortedAngle!==s&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(s),this.sortedAngle=s,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const d of this.symbolInstanceIndexes){const m=this.symbolInstances.get(d);this.featureSortOrder.push(m.featureIndex),[m.rightJustifiedTextSymbolIndex,m.centerJustifiedTextSymbolIndex,m.leftJustifiedTextSymbolIndex].forEach((_,S,M)=>{_>=0&&M.indexOf(_)===S&&this.addIndicesForPlacedSymbol(this.text,_)}),m.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,m.verticalPlacedTextSymbolIndex),m.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,m.placedIconSymbolIndex),m.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,m.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}dr("SymbolBucket",Zd,{omit:["layers","collisionBoxArray","features","compareText"]}),Zd.MAX_GLYPHS=65535,Zd.addDynamicAttributes=H_;const q$=new Li({"symbol-placement":new pr(Fe.layout_symbol["symbol-placement"]),"symbol-spacing":new pr(Fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new pr(Fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Sr(Fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new pr(Fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new pr(Fe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new pr(Fe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new pr(Fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new pr(Fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new pr(Fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new Sr(Fe.layout_symbol["icon-size"]),"icon-text-fit":new pr(Fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new pr(Fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new Sr(Fe.layout_symbol["icon-image"]),"icon-rotate":new Sr(Fe.layout_symbol["icon-rotate"]),"icon-padding":new Sr(Fe.layout_symbol["icon-padding"]),"icon-keep-upright":new pr(Fe.layout_symbol["icon-keep-upright"]),"icon-offset":new Sr(Fe.layout_symbol["icon-offset"]),"icon-anchor":new Sr(Fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new pr(Fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new pr(Fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new pr(Fe.layout_symbol["text-rotation-alignment"]),"text-field":new Sr(Fe.layout_symbol["text-field"]),"text-font":new Sr(Fe.layout_symbol["text-font"]),"text-size":new Sr(Fe.layout_symbol["text-size"]),"text-max-width":new Sr(Fe.layout_symbol["text-max-width"]),"text-line-height":new pr(Fe.layout_symbol["text-line-height"]),"text-letter-spacing":new Sr(Fe.layout_symbol["text-letter-spacing"]),"text-justify":new Sr(Fe.layout_symbol["text-justify"]),"text-radial-offset":new Sr(Fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new pr(Fe.layout_symbol["text-variable-anchor"]),"text-anchor":new Sr(Fe.layout_symbol["text-anchor"]),"text-max-angle":new pr(Fe.layout_symbol["text-max-angle"]),"text-writing-mode":new pr(Fe.layout_symbol["text-writing-mode"]),"text-rotate":new Sr(Fe.layout_symbol["text-rotate"]),"text-padding":new pr(Fe.layout_symbol["text-padding"]),"text-keep-upright":new pr(Fe.layout_symbol["text-keep-upright"]),"text-transform":new Sr(Fe.layout_symbol["text-transform"]),"text-offset":new Sr(Fe.layout_symbol["text-offset"]),"text-allow-overlap":new pr(Fe.layout_symbol["text-allow-overlap"]),"text-overlap":new pr(Fe.layout_symbol["text-overlap"]),"text-ignore-placement":new pr(Fe.layout_symbol["text-ignore-placement"]),"text-optional":new pr(Fe.layout_symbol["text-optional"])});var G_={paint:new Li({"icon-opacity":new Sr(Fe.paint_symbol["icon-opacity"]),"icon-color":new Sr(Fe.paint_symbol["icon-color"]),"icon-halo-color":new Sr(Fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new Sr(Fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Sr(Fe.paint_symbol["icon-halo-blur"]),"icon-translate":new pr(Fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new pr(Fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new Sr(Fe.paint_symbol["text-opacity"]),"text-color":new Sr(Fe.paint_symbol["text-color"],{runtimeType:Lr,getOverride:c=>c.textColor,hasOverride:c=>!!c.textColor}),"text-halo-color":new Sr(Fe.paint_symbol["text-halo-color"]),"text-halo-width":new Sr(Fe.paint_symbol["text-halo-width"]),"text-halo-blur":new Sr(Fe.paint_symbol["text-halo-blur"]),"text-translate":new pr(Fe.paint_symbol["text-translate"]),"text-translate-anchor":new pr(Fe.paint_symbol["text-translate-anchor"])}),layout:q$};class X5{constructor(s){if(s.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=s.property.overrides?s.property.overrides.runtimeType:Rr,this.defaultValue=s}evaluate(s){if(s.formattedSection){const d=this.defaultValue.property.overrides;if(d&&d.hasOverride(s.formattedSection))return d.getOverride(s.formattedSection)}return s.feature&&s.featureState?this.defaultValue.evaluate(s.feature,s.featureState):this.defaultValue.property.specification.default}eachChild(s){this.defaultValue.isConstant()||s(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}dr("FormatSectionOverride",X5,{omit:["defaultValue"]});class $g extends ka{constructor(s){super(s,G_)}recalculate(s,d){if(super.recalculate(s,d),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const m=this.layout.get("text-writing-mode");if(m){const _=[];for(const S of m)_.indexOf(S)<0&&_.push(S);this.layout._values["text-writing-mode"]=_}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(s,d,m,_){const S=this.layout.get(s).evaluate(d,{},m,_),M=this._unevaluatedLayout._values[s];return M.isDataDriven()||uc(M.value)||!S?S:function(D,F){return F.replace(/{([^{}]+)}/g,(U,X)=>X in D?String(D[X]):"")}(d.properties,S)}createBucket(s){return new Zd(s)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const s of G_.paint.overridableProperties){if(!$g.hasPaintOverride(this.layout,s))continue;const d=this.paint.get(s),m=new X5(d),_=new Rd(m,d.property.specification);let S=null;S=d.value.kind==="constant"||d.value.kind==="source"?new dc("source",_):new Kh("composite",_,d.value.zoomStops),this.paint._values[s]=new Ea(d.property,S,d.parameters)}}_handleOverridablePaintPropertyUpdate(s,d,m){return!(!this.layout||d.isDataDriven()||m.isDataDriven())&&$g.hasPaintOverride(this.layout,s)}static hasPaintOverride(s,d){const m=s.get("text-field"),_=G_.paint.properties[d];let S=!1;const M=D=>{for(const F of D)if(_.overrides&&_.overrides.hasOverride(F))return void(S=!0)};if(m.value.kind==="constant"&&m.value.value instanceof be)M(m.value.value.sections);else if(m.value.kind==="source"){const D=U=>{S||(U instanceof bt&&Be(U.value)===wr?M(U.value.sections):U instanceof Md?M(U.sections):U.eachChild(D))},F=m.value;F._styleExpression&&D(F._styleExpression.expression)}return S}}function Z_(c,s,d){let m="never";const _=c.get(s);return _?m=_:c.get(d)&&(m="always"),m}var G$={paint:new Li({"background-color":new pr(Fe.paint_background["background-color"]),"background-pattern":new rp(Fe.paint_background["background-pattern"]),"background-opacity":new pr(Fe.paint_background["background-opacity"])})},Z$={paint:new Li({"raster-opacity":new pr(Fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new pr(Fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new pr(Fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new pr(Fe.paint_raster["raster-brightness-max"]),"raster-saturation":new pr(Fe.paint_raster["raster-saturation"]),"raster-contrast":new pr(Fe.paint_raster["raster-contrast"]),"raster-resampling":new pr(Fe.paint_raster["raster-resampling"]),"raster-fade-duration":new pr(Fe.paint_raster["raster-fade-duration"])})};class X$ extends ka{constructor(s){super(s,{}),this.onAdd=d=>{this.implementation.onAdd&&this.implementation.onAdd(d,d.painter.context.gl)},this.onRemove=d=>{this.implementation.onRemove&&this.implementation.onRemove(d,d.painter.context.gl)},this.implementation=s}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const Y$={circle:class extends ka{constructor(c){super(c,PF)}createBucket(c){return new w_(c)}queryRadius(c){const s=c;return sp("circle-radius",this,s)+sp("circle-stroke-width",this,s)+wg(this.paint.get("circle-translate"))}queryIntersectsFeature(c,s,d,m,_,S,M,D){const F=Cg(c,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),S.angle,M),U=this.paint.get("circle-radius").evaluate(s,d)+this.paint.get("circle-stroke-width").evaluate(s,d),X=this.paint.get("circle-pitch-alignment")==="map",re=X?F:function(he,pe){return he.map(Oe=>s5(Oe,pe))}(F,D),ue=X?U*M:U;for(const he of m)for(const pe of he){const Oe=X?pe:s5(pe,D);let Me=ue;const Ze=Sg([],[pe.x,pe.y,0,1],D);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Me*=Ze[3]/S.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Me*=S.cameraToCenterDistance/Ze[3]),CF(re,Oe,Me))return!0}return!1}},heatmap:class extends ka{constructor(c){super(c,IF),this._updateColorRamp()}createBucket(c){return new l5(c)}_handleSpecialPaintPropertyUpdate(c){c==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=c5({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends ka{constructor(c){super(c,RF)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends ka{constructor(c){super(c,qF)}recalculate(c,s){super.recalculate(c,s);const d=this.paint._values["fill-outline-color"];d.value.kind==="constant"&&d.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(c){return new N_(c)}queryRadius(){return wg(this.paint.get("fill-translate"))}queryIntersectsFeature(c,s,d,m,_,S,M){return JE(Cg(c,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),S.angle,M),m)}isTileClipped(){return!0}},"fill-extrusion":class extends ka{constructor(c){super(c,s$)}createBucket(c){return new D_(c)}queryRadius(){return wg(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(c,s,d,m,_,S,M,D){const F=Cg(c,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),S.angle,M),U=this.paint.get("fill-extrusion-height").evaluate(s,d),X=this.paint.get("fill-extrusion-base").evaluate(s,d),re=function(he,pe,Oe,Me){const Ze=[];for(const st of he){const Ke=[st.x,st.y,0,1];Sg(Ke,Ke,pe),Ze.push(new ne(Ke[0]/Ke[3],Ke[1]/Ke[3]))}return Ze}(F,D),ue=function(he,pe,Oe,Me){const Ze=[],st=[],Ke=Me[8]*pe,nt=Me[9]*pe,kt=Me[10]*pe,St=Me[11]*pe,lr=Me[8]*Oe,hr=Me[9]*Oe,er=Me[10]*Oe,Zt=Me[11]*Oe;for(const Ht of he){const tr=[],Yt=[];for(const Ft of Ht){const br=Ft.x,mr=Ft.y,Vr=Me[0]*br+Me[4]*mr+Me[12],Pn=Me[1]*br+Me[5]*mr+Me[13],Dn=Me[2]*br+Me[6]*mr+Me[14],_i=Me[3]*br+Me[7]*mr+Me[15],aa=Dn+kt,Ki=_i+St,di=Vr+lr,Pi=Pn+hr,Hi=Dn+er,eo=_i+Zt,Eo=new ne((Vr+Ke)/Ki,(Pn+nt)/Ki);Eo.z=aa/Ki,tr.push(Eo);const fi=new ne(di/eo,Pi/eo);fi.z=Hi/eo,Yt.push(fi)}Ze.push(tr),st.push(Yt)}return[Ze,st]}(m,X,U,D);return function(he,pe,Oe){let Me=1/0;JE(Oe,pe)&&(Me=x5(Oe,pe[0]));for(let Ze=0;Ze=3){for(let Oe=0;Oe{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const Y5=63710088e-1;class ti{constructor(s,d){if(isNaN(s)||isNaN(d))throw new Error(`Invalid LngLat object: (${s}, ${d})`);if(this.lng=+s,this.lat=+d,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ti(k(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(s){const d=Math.PI/180,m=this.lat*d,_=s.lat*d,S=Math.sin(m)*Math.sin(_)+Math.cos(m)*Math.cos(_)*Math.cos((s.lng-this.lng)*d);return Y5*Math.acos(Math.min(S,1))}toBounds(s=0){const d=360*s/40075017,m=d/Math.cos(Math.PI/180*this.lat);return new Mc(new ti(this.lng-m,this.lat-d),new ti(this.lng+m,this.lat+d))}static convert(s){if(s instanceof ti)return s;if(Array.isArray(s)&&(s.length===2||s.length===3))return new ti(Number(s[0]),Number(s[1]));if(!Array.isArray(s)&&typeof s=="object"&&s!==null)return new ti(Number("lng"in s?s.lng:s.lon),Number(s.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class Mc{constructor(s,d){s&&(d?this.setSouthWest(s).setNorthEast(d):s.length===4?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1]))}setNorthEast(s){return this._ne=s instanceof ti?new ti(s.lng,s.lat):ti.convert(s),this}setSouthWest(s){return this._sw=s instanceof ti?new ti(s.lng,s.lat):ti.convert(s),this}extend(s){const d=this._sw,m=this._ne;let _,S;if(s instanceof ti)_=s,S=s;else{if(!(s instanceof Mc))return Array.isArray(s)?s.length===4||s.every(Array.isArray)?this.extend(Mc.convert(s)):this.extend(ti.convert(s)):this;if(_=s._sw,S=s._ne,!_||!S)return this}return d||m?(d.lng=Math.min(_.lng,d.lng),d.lat=Math.min(_.lat,d.lat),m.lng=Math.max(S.lng,m.lng),m.lat=Math.max(S.lat,m.lat)):(this._sw=new ti(_.lng,_.lat),this._ne=new ti(S.lng,S.lat)),this}getCenter(){return new ti((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new ti(this.getWest(),this.getNorth())}getSouthEast(){return new ti(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(s){const{lng:d,lat:m}=ti.convert(s);let _=this._sw.lng<=d&&d<=this._ne.lng;return this._sw.lng>this._ne.lng&&(_=this._sw.lng>=d&&d>=this._ne.lng),this._sw.lat<=m&&m<=this._ne.lat&&_}static convert(s){return s instanceof Mc?s:s&&new Mc(s)}}const Q5=2*Math.PI*Y5;function J5(c){return Q5*Math.cos(c*Math.PI/180)}function e6(c){return(180+c)/360}function t6(c){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360}function r6(c,s){return c/J5(s)}function X_(c){return 360/Math.PI*Math.atan(Math.exp((180-360*c)*Math.PI/180))-90}class Bg{constructor(s,d,m=0){this.x=+s,this.y=+d,this.z=+m}static fromLngLat(s,d=0){const m=ti.convert(s);return new Bg(e6(m.lng),t6(m.lat),r6(d,m.lat))}toLngLat(){return new ti(360*this.x-180,X_(this.y))}toAltitude(){return this.z*J5(X_(this.y))}meterInMercatorCoordinateUnits(){return 1/Q5*(s=X_(this.y),1/Math.cos(s*Math.PI/180));var s}}function n6(c,s,d){var m=2*Math.PI*6378137/256/Math.pow(2,d);return[c*m-2*Math.PI*6378137/2,s*m-2*Math.PI*6378137/2]}class Y_{constructor(s,d,m){if(s<0||s>25||m<0||m>=Math.pow(2,s)||d<0||d>=Math.pow(2,s))throw new Error(`x=${d}, y=${m}, z=${s} outside of bounds. 0<=x<${Math.pow(2,s)}, 0<=y<${Math.pow(2,s)} 0<=z<=25 `);this.z=s,this.x=d,this.y=m,this.key=yp(0,s,s,d,m)}equals(s){return this.z===s.z&&this.x===s.x&&this.y===s.y}url(s,d,m){const _=(M=this.y,D=this.z,F=n6(256*(S=this.x),256*(M=Math.pow(2,D)-M-1),D),U=n6(256*(S+1),256*(M+1),D),F[0]+","+F[1]+","+U[0]+","+U[1]);var S,M,D,F,U;const X=function(re,ue,he){let pe,Oe="";for(let Me=re;Me>0;Me--)pe=1<1?"@2x":"").replace(/{quadkey}/g,X).replace(/{bbox-epsg-3857}/g,_)}isChildOf(s){const d=this.z-s.z;return d>0&&s.x===this.x>>d&&s.y===this.y>>d}getTilePoint(s){const d=Math.pow(2,this.z);return new ne((s.x*d-this.x)*xi,(s.y*d-this.y)*xi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class i6{constructor(s,d){this.wrap=s,this.canonical=d,this.key=yp(s,d.z,d.z,d.x,d.y)}}class oa{constructor(s,d,m,_,S){if(s= z; overscaledZ = ${s}; z = ${m}`);this.overscaledZ=s,this.wrap=d,this.canonical=new Y_(m,+_,+S),this.key=yp(d,s,m,_,S)}clone(){return new oa(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(s){return this.overscaledZ===s.overscaledZ&&this.wrap===s.wrap&&this.canonical.equals(s.canonical)}scaledTo(s){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const d=this.canonical.z-s;return s>this.canonical.z?new oa(s,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new oa(s,this.wrap,s,this.canonical.x>>d,this.canonical.y>>d)}calculateScaledKey(s,d){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const m=this.canonical.z-s;return s>this.canonical.z?yp(this.wrap*+d,s,this.canonical.z,this.canonical.x,this.canonical.y):yp(this.wrap*+d,s,s,this.canonical.x>>m,this.canonical.y>>m)}isChildOf(s){if(s.wrap!==this.wrap)return!1;const d=this.canonical.z-s.canonical.z;return s.overscaledZ===0||s.overscaledZ>d&&s.canonical.y===this.canonical.y>>d}children(s){if(this.overscaledZ>=s)return[new oa(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const d=this.canonical.z+1,m=2*this.canonical.x,_=2*this.canonical.y;return[new oa(d,this.wrap,d,m,_),new oa(d,this.wrap,d,m+1,_),new oa(d,this.wrap,d,m,_+1),new oa(d,this.wrap,d,m+1,_+1)]}isLessThan(s){return this.wraps.wrap)&&(this.overscaledZs.overscaledZ)&&(this.canonical.xs.canonical.x)&&this.canonical.ythis.max&&(this.max=D),D=this.dim+1||d<-1||d>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(d+1)*this.stride+(s+1)}_unpackMapbox(s,d,m){return(256*s*256+256*d+m)/10-1e4}_unpackTerrarium(s,d,m){return 256*s+d+m/256-32768}getPixels(){return new ia({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(s,d,m){if(this.dim!==s.dim)throw new Error("dem dimension mismatch");let _=d*this.dim,S=d*this.dim+this.dim,M=m*this.dim,D=m*this.dim+this.dim;switch(d){case-1:_=S-1;break;case 1:S=_+1}switch(m){case-1:M=D-1;break;case 1:D=M+1}const F=-d*this.dim,U=-m*this.dim;for(let X=M;X=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${s} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[s]}}class s6{constructor(s,d,m,_,S){this.type="Feature",this._vectorTileFeature=s,s._z=d,s._x=m,s._y=_,this.properties=s.properties,this.id=S}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(s){this._geometry=s}toJSON(){const s={geometry:this.geometry};for(const d in this)d!=="_geometry"&&d!=="_vectorTileFeature"&&(s[d]=this[d]);return s}}class l6{constructor(s,d){this.tileID=s,this.x=s.canonical.x,this.y=s.canonical.y,this.z=s.canonical.z,this.grid=new bc(xi,16,0),this.grid3D=new bc(xi,16,0),this.featureIndexArray=new Br,this.promoteId=d}insert(s,d,m,_,S,M){const D=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(m,_,S);const F=M?this.grid3D:this.grid;for(let U=0;U=0&&re[3]>=0&&F.insert(D,re[0],re[1],re[2],re[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new iu.VectorTile(new F_(this.rawTileData)).layers,this.sourceLayerCoder=new a6(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(s,d,m,_){this.loadVTLayers();const S=s.params||{},M=xi/s.tileSize/s.scale,D=Nd(S.filter),F=s.queryGeometry,U=s.queryPadding*M,X=c6(F),re=this.grid.query(X.minX-U,X.minY-U,X.maxX+U,X.maxY+U),ue=c6(s.cameraQueryGeometry),he=this.grid3D.query(ue.minX-U,ue.minY-U,ue.maxX+U,ue.maxY+U,(Me,Ze,st,Ke)=>function(nt,kt,St,lr,hr){for(const Zt of nt)if(kt<=Zt.x&&St<=Zt.y&&lr>=Zt.x&&hr>=Zt.y)return!0;const er=[new ne(kt,St),new ne(kt,hr),new ne(lr,hr),new ne(lr,St)];if(nt.length>2){for(const Zt of er)if(jd(nt,Zt))return!0}for(let Zt=0;Zt(Ke||(Ke=kc(nt)),kt.queryIntersectsFeature(F,nt,St,Ke,this.z,s.transform,M,s.pixelPosMatrix)))}return pe}loadMatchingFeature(s,d,m,_,S,M,D,F,U,X,re){const ue=this.bucketLayerIDs[d];if(M&&!function(Me,Ze){for(let st=0;st=0)return!0;return!1}(M,ue))return;const he=this.sourceLayerCoder.decode(m),pe=this.vtLayers[he].feature(_);if(S.needGeometry){const Me=Tc(pe,!0);if(!S.filter(new Nn(this.tileID.overscaledZ),Me,this.tileID.canonical))return}else if(!S.filter(new Nn(this.tileID.overscaledZ),pe))return;const Oe=this.getId(pe,he);for(let Me=0;Me{const D=s instanceof Sc?s.get(M):null;return D&&D.evaluate?D.evaluate(d,m,_):D})}function c6(c){let s=1/0,d=1/0,m=-1/0,_=-1/0;for(const S of c)s=Math.min(s,S.x),d=Math.min(d,S.y),m=Math.max(m,S.x),_=Math.max(_,S.y);return{minX:s,minY:d,maxX:m,maxY:_}}function J$(c,s){return s-c}var Q_;dr("FeatureIndex",l6,{omit:["rawTileData","sourceLayerCoder"]}),o.PerformanceMarkers=void 0,(Q_=o.PerformanceMarkers||(o.PerformanceMarkers={})).create="create",Q_.load="load",Q_.fullLoad="fullLoad";let Vg=null,xp=[];const J_=1e3/30,eB={mark(c){performance.mark(c)},frame(c){const s=c;Vg!=null&&xp.push(s-Vg),Vg=s},clearMetrics(){Vg=null,xp=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const c in o.PerformanceMarkers)performance.clearMarks(o.PerformanceMarkers[c])},getPerformanceMetrics(){performance.measure("loadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.load),performance.measure("fullLoadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.fullLoad);const c=performance.getEntriesByName("loadTime")[0].duration,s=performance.getEntriesByName("fullLoadTime")[0].duration,d=xp.length,m=1/(xp.reduce((S,M)=>S+M,0)/d/1e3),_=xp.filter(S=>S>J_).reduce((S,M)=>S+(M-J_)/J_,0);return{loadTime:c,fullLoadTime:s,fps:m,percentDroppedFrames:_/(d+_)*100}}};o.AJAXError=Xe,o.ARRAY_TYPE=ho,o.Actor=class{constructor(c,s,d){this.target=c,this.parent=s,this.mapId=d,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},A(["receive","process"],this),this.invoker=new Q$(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=H()?c:window}send(c,s,d,m,_=!1){const S=Math.round(1e18*Math.random()).toString(36).substring(0,10);d&&(this.callbacks[S]=d);const M=Z(this.globalScope)?void 0:[];return this.target.postMessage({id:S,type:c,hasCallback:!!d,targetMapId:m,mustQueue:_,sourceMapId:this.mapId,data:rl(s,M)},M),{cancel:()=>{d&&delete this.callbacks[S],this.target.postMessage({id:S,type:"",targetMapId:m,sourceMapId:this.mapId})}}}receive(c){const s=c.data,d=s.id;if(d&&(!s.targetMapId||this.mapId===s.targetMapId))if(s.type===""){delete this.tasks[d];const m=this.cancelCallbacks[d];delete this.cancelCallbacks[d],m&&m()}else H()||s.mustQueue?(this.tasks[d]=s,this.taskQueue.push(d),this.invoker.trigger()):this.processTask(d,s)}process(){if(!this.taskQueue.length)return;const c=this.taskQueue.shift(),s=this.tasks[c];delete this.tasks[c],this.taskQueue.length&&this.invoker.trigger(),s&&this.processTask(c,s)}processTask(c,s){if(s.type===""){const d=this.callbacks[c];delete this.callbacks[c],d&&(s.error?d(ks(s.error)):d(null,ks(s.data)))}else{let d=!1;const m=Z(this.globalScope)?void 0:[],_=s.hasCallback?(D,F)=>{d=!0,delete this.cancelCallbacks[c],this.target.postMessage({id:c,type:"",sourceMapId:this.mapId,error:D?rl(D):null,data:rl(F,m)},m)}:D=>{d=!0};let S=null;const M=ks(s.data);if(this.parent[s.type])S=this.parent[s.type](s.sourceMapId,M,_);else if(this.parent.getWorkerSource){const D=s.type.split(".");S=this.parent.getWorkerSource(s.sourceMapId,D[0],M.source)[D[1]](M,_)}else _(new Error(`Could not find function ${s.type}`));!d&&S&&S.cancel&&(this.cancelCallbacks[c]=S.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},o.AlphaImage=up,o.CanonicalTileID=Y_,o.CollisionBoxArray=gt,o.CollisionCircleLayoutArray=class extends ee{},o.Color=ae,o.DEMData=o6,o.DataConstantProperty=pr,o.DictionaryCoder=a6,o.EXTENT=xi,o.ErrorEvent=jt,o.EvaluationParameters=Nn,o.Event=Wt,o.Evented=Qt,o.FeatureIndex=l6,o.FillBucket=N_,o.FillExtrusionBucket=D_,o.GeoJSONFeature=s6,o.ImageAtlas=O5,o.ImagePosition=B_,o.LineBucket=L_,o.LineStripIndexArray=class extends Pe{},o.LngLat=ti,o.LngLatBounds=Mc,o.MercatorCoordinate=Bg,o.ONE_EM=Fi,o.OverscaledTileID=oa,o.PerformanceUtils=eB,o.PosArray=_r,o.Properties=Li,o.QuadTriangleArray=class extends fe{},o.RGBAImage=ia,o.RasterBoundsArray=class extends x{},o.RequestPerformance=class{constructor(c){this._marks={start:[c.url,"start"].join("#"),end:[c.url,"end"].join("#"),measure:c.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let c=performance.getEntriesByName(this._marks.measure);return c.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),c=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),c}},o.ResourceType=Tt,o.SegmentVector=Kr,o.SymbolBucket=Zd,o.Transitionable=vg,o.TriangleIndexArray=co,o.Uniform1f=al,o.Uniform1i=class extends ol{constructor(c,s){super(c,s),this.current=0}set(c){this.current!==c&&(this.current=c,this.gl.uniform1i(this.location,c))}},o.Uniform2f=class extends ol{constructor(c,s){super(c,s),this.current=[0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]||(this.current=c,this.gl.uniform2f(this.location,c[0],c[1]))}},o.Uniform3f=class extends ol{constructor(c,s){super(c,s),this.current=[0,0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]&&c[2]===this.current[2]||(this.current=c,this.gl.uniform3f(this.location,c[0],c[1],c[2]))}},o.Uniform4f=Bd,o.UniformColor=GE,o.UniformMatrix4f=class extends ol{constructor(c,s){super(c,s),this.current=bF}set(c){if(c[12]!==this.current[12]||c[0]!==this.current[0])return this.current=c,void this.gl.uniformMatrix4fv(this.location,!1,c);for(let s=1;s<16;s++)if(c[s]!==this.current[s]){this.current=c,this.gl.uniformMatrix4fv(this.location,!1,c);break}}},o.UnwrappedTileID=i6,o.ValidationError=qe,o.ZoomHistory=Gh,o.add=function(c,s,d){return c[0]=s[0]+d[0],c[1]=s[1]+d[1],c[2]=s[2]+d[2],c},o.addDynamicAttributes=H_,o.asyncAll=function(c,s,d){if(!c.length)return d(null,[]);let m=c.length;const _=new Array(c.length);let S=null;c.forEach((M,D)=>{s(M,(F,U)=>{F&&(S=F),_[D]=U,--m==0&&d(S,_)})})},o.bezier=v,o.bindAll=A,o.cacheEntryPossiblyAdded=function(c){Ne++,Ne>ze&&(c.getActor().send("enforceCacheSizeLimit",ke),Ne=0)},o.clamp=w,o.clearTileCache=function(c){const s=caches.delete(ye);c&&s.catch(c).then(()=>c())},o.clipLine=K5,o.clone=function(c){var s=new ho(16);return s[0]=c[0],s[1]=c[1],s[2]=c[2],s[3]=c[3],s[4]=c[4],s[5]=c[5],s[6]=c[6],s[7]=c[7],s[8]=c[8],s[9]=c[9],s[10]=c[10],s[11]=c[11],s[12]=c[12],s[13]=c[13],s[14]=c[14],s[15]=c[15],s},o.clone$1=N,o.clone$2=function(c){var s=new ho(3);return s[0]=c[0],s[1]=c[1],s[2]=c[2],s},o.collisionCircleLayout=y$,o.config=oe,o.copy=function(c,s){return c[0]=s[0],c[1]=s[1],c[2]=s[2],c[3]=s[3],c[4]=s[4],c[5]=s[5],c[6]=s[6],c[7]=s[7],c[8]=s[8],c[9]=s[9],c[10]=s[10],c[11]=s[11],c[12]=s[12],c[13]=s[13],c[14]=s[14],c[15]=s[15],c},o.create=function(){var c=new ho(16);return ho!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=0,c[12]=0,c[13]=0,c[14]=0),c[0]=1,c[5]=1,c[10]=1,c[15]=1,c},o.create$1=r5,o.createExpression=cc,o.createFilter=Nd,o.createLayout=ci,o.createStyleLayer=function(c){return c.type==="custom"?new X$(c):new Y$[c.type](c)},o.cross=function(c,s,d){var m=s[0],_=s[1],S=s[2],M=d[0],D=d[1],F=d[2];return c[0]=_*F-S*D,c[1]=S*M-m*F,c[2]=m*D-_*M,c},o.dot=function(c,s){return c[0]*s[0]+c[1]*s[1]+c[2]*s[2]},o.dot$1=function(c,s){return c[0]*s[0]+c[1]*s[1]+c[2]*s[2]+c[3]*s[3]},o.ease=y,o.emitValidationErrors=Dd,o.enforceCacheSizeLimit=function(c){Ie(),Re&&Re.then(s=>{s.keys().then(d=>{for(let m=0;m{}}},o.identity=E_,o.invert=function(c,s){var d=s[0],m=s[1],_=s[2],S=s[3],M=s[4],D=s[5],F=s[6],U=s[7],X=s[8],re=s[9],ue=s[10],he=s[11],pe=s[12],Oe=s[13],Me=s[14],Ze=s[15],st=d*D-m*M,Ke=d*F-_*M,nt=d*U-S*M,kt=m*F-_*D,St=m*U-S*D,lr=_*U-S*F,hr=X*Oe-re*pe,er=X*Me-ue*pe,Zt=X*Ze-he*pe,Ht=re*Me-ue*Oe,tr=re*Ze-he*Oe,Yt=ue*Ze-he*Me,Ft=st*Yt-Ke*tr+nt*Ht+kt*Zt-St*er+lr*hr;return Ft?(c[0]=(D*Yt-F*tr+U*Ht)*(Ft=1/Ft),c[1]=(_*tr-m*Yt-S*Ht)*Ft,c[2]=(Oe*lr-Me*St+Ze*kt)*Ft,c[3]=(ue*St-re*lr-he*kt)*Ft,c[4]=(F*Zt-M*Yt-U*er)*Ft,c[5]=(d*Yt-_*Zt+S*er)*Ft,c[6]=(Me*nt-pe*lr-Ze*Ke)*Ft,c[7]=(X*lr-ue*nt+he*Ke)*Ft,c[8]=(M*tr-D*Zt+U*hr)*Ft,c[9]=(m*Zt-d*tr-S*hr)*Ft,c[10]=(pe*St-Oe*nt+Ze*st)*Ft,c[11]=(re*nt-X*St-he*st)*Ft,c[12]=(D*er-M*Ht-F*hr)*Ft,c[13]=(d*Ht-m*er+_*hr)*Ft,c[14]=(Oe*Ke-pe*kt-Me*st)*Ft,c[15]=(X*kt-re*Ke+ue*st)*Ft,c):null},o.isImageBitmap=Q,o.isSafari=Z,o.isWorker=H,o.keysDifference=function(c,s){const d=[];for(const m in c)m in s||d.push(m);return d},o.lazyLoadRTLTextPlugin=function(){jo.isLoading()||jo.isLoaded()||wc()!=="deferred"||mg()},o.makeRequest=It,o.mapObject=I,o.mercatorXfromLng=e6,o.mercatorYfromLat=t6,o.mercatorZfromAltitude=r6,o.mul=MF,o.mul$1=function(c,s,d){return c[0]=s[0]*d[0],c[1]=s[1]*d[1],c[2]=s[2]*d[2],c[3]=s[3]*d[3],c},o.multiply=n5,o.nextPowerOfTwo=function(c){return c<=1?1:Math.pow(2,Math.ceil(Math.log(c)/Math.LN2))},o.normalize=function(c,s){var d=s[0],m=s[1],_=s[2],S=d*d+m*m+_*_;return S>0&&(S=1/Math.sqrt(S)),c[0]=s[0]*S,c[1]=s[1]*S,c[2]=s[2]*S,c},o.number=yn,o.ortho=function(c,s,d,m,_,S,M){var D=1/(s-d),F=1/(m-_),U=1/(S-M);return c[0]=-2*D,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=-2*F,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=2*U,c[11]=0,c[12]=(s+d)*D,c[13]=(_+m)*F,c[14]=(M+S)*U,c[15]=1,c},o.parseCacheControl=te,o.parseGlyphPbf=function(c){return new F_(c).readFields(M$,[])},o.pbf=F_,o.performSymbolLayout=function(c){c.bucket.createArrays(),c.bucket.tilePixelRatio=xi/(512*c.bucket.overscaling),c.bucket.compareText={},c.bucket.iconsNeedLinear=!1;const s=c.bucket.layers[0].layout,d=c.bucket.layers[0]._unevaluatedLayout._values,m={layoutIconSize:d["icon-size"].possiblyEvaluate(new Nn(c.bucket.zoom+1),c.canonical),layoutTextSize:d["text-size"].possiblyEvaluate(new Nn(c.bucket.zoom+1),c.canonical),textMaxSize:d["text-size"].possiblyEvaluate(new Nn(18))};if(c.bucket.textSizeData.kind==="composite"){const{minZoom:F,maxZoom:U}=c.bucket.textSizeData;m.compositeTextSizes=[d["text-size"].possiblyEvaluate(new Nn(F),c.canonical),d["text-size"].possiblyEvaluate(new Nn(U),c.canonical)]}if(c.bucket.iconSizeData.kind==="composite"){const{minZoom:F,maxZoom:U}=c.bucket.iconSizeData;m.compositeIconSizes=[d["icon-size"].possiblyEvaluate(new Nn(F),c.canonical),d["icon-size"].possiblyEvaluate(new Nn(U),c.canonical)]}const _=s.get("text-line-height")*Fi,S=s.get("text-rotation-alignment")!=="viewport"&&s.get("symbol-placement")!=="point",M=s.get("text-keep-upright"),D=s.get("text-size");for(const F of c.bucket.features){const U=s.get("text-font").evaluate(F,{},c.canonical).join(","),X=D.evaluate(F,{},c.canonical),re=m.layoutTextSize.evaluate(F,{},c.canonical),ue=m.layoutIconSize.evaluate(F,{},c.canonical),he={horizontal:{},vertical:void 0},pe=F.text;let Oe,Me=[0,0];if(pe){const Ke=pe.toString(),nt=s.get("text-letter-spacing").evaluate(F,{},c.canonical)*Fi,kt=g_(Ke)?nt:0,St=s.get("text-anchor").evaluate(F,{},c.canonical),lr=s.get("text-variable-anchor");if(!lr){const tr=s.get("text-radial-offset").evaluate(F,{},c.canonical);Me=tr?q5(St,[tr*Fi,U_]):s.get("text-offset").evaluate(F,{},c.canonical).map(Yt=>Yt*Fi)}let hr=S?"center":s.get("text-justify").evaluate(F,{},c.canonical);const er=s.get("symbol-placement"),Zt=er==="point"?s.get("text-max-width").evaluate(F,{},c.canonical)*Fi:0,Ht=()=>{c.bucket.allowVerticalPlacement&&Ld(Ke)&&(he.vertical=Og(pe,c.glyphMap,c.glyphPositions,c.imagePositions,U,Zt,_,St,"left",kt,Me,o.WritingMode.vertical,!0,er,re,X))};if(!S&&lr){const tr=hr==="auto"?lr.map(Ft=>K_(Ft)):[hr];let Yt=!1;for(let Ft=0;Ftthis._layers[We.id]),Ee=xe[0];if(Ee.visibility==="none")continue;const be=Ee.source||"";let Ce=this.familiesBySource[be];Ce||(Ce=this.familiesBySource[be]={});const Ae=Ee.sourceLayer||"_geojsonTileLayer";let He=Ce[Ae];He||(He=Ce[Ae]=[]),He.push(xe)}}}class y{constructor(K){const q={},ce=[];for(const be in K){const Ce=K[be],Ae=q[be]={};for(const He in Ce){const We=Ce[+He];if(!We||We.bitmap.width===0||We.bitmap.height===0)continue;const Be={x:0,y:0,w:We.bitmap.width+2,h:We.bitmap.height+2};ce.push(Be),Ae[He]={rect:Be,metrics:We.metrics}}}const{w:ae,h:xe}=o.potpack(ce),Ee=new o.AlphaImage({width:ae||1,height:xe||1});for(const be in K){const Ce=K[be];for(const Ae in Ce){const He=Ce[+Ae];if(!He||He.bitmap.width===0||He.bitmap.height===0)continue;const We=q[be][Ae].rect;o.AlphaImage.copy(He.bitmap,Ee,{x:0,y:0},{x:We.x+1,y:We.y+1},He.bitmap)}}this.image=Ee,this.positions=q}}o.register("GlyphAtlas",y);class w{constructor(K){this.tileID=new o.OverscaledTileID(K.tileID.overscaledZ,K.tileID.wrap,K.tileID.canonical.z,K.tileID.canonical.x,K.tileID.canonical.y),this.uid=K.uid,this.zoom=K.zoom,this.pixelRatio=K.pixelRatio,this.tileSize=K.tileSize,this.source=K.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=K.showCollisionBoxes,this.collectResourceTiming=!!K.collectResourceTiming,this.returnDependencies=!!K.returnDependencies,this.promoteId=K.promoteId}parse(K,q,ce,ae,xe){this.status="parsing",this.data=K,this.collisionBoxArray=new o.CollisionBoxArray;const Ee=new o.DictionaryCoder(Object.keys(K.layers).sort()),be=new o.FeatureIndex(this.tileID,this.promoteId);be.bucketLayerIDs=[];const Ce={},Ae={featureIndex:be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:ce},He=q.familiesBySource[this.source];for(const ir in He){const gr=K.layers[ir];if(!gr)continue;gr.version===1&&o.warnOnce(`Vector tile source "${this.source}" layer "${ir}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const $r=Ee.encode(ir),Qr=[];for(let $n=0;$n=on.maxzoom||on.visibility!=="none"&&(k($n,this.zoom,ce),(Ce[on.id]=on.createBucket({index:be.bucketLayerIDs.length,layers:$n,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:$r,sourceID:this.source})).populate(Qr,Ae,this.tileID.canonical),be.bucketLayerIDs.push($n.map(Rn=>Rn.id)))}}let We,Be,At,bt;const Je=o.mapObject(Ae.glyphDependencies,ir=>Object.keys(ir).map(Number));Object.keys(Je).length?ae.send("getGlyphs",{uid:this.uid,stacks:Je},(ir,gr)=>{We||(We=ir,Be=gr,vr.call(this))}):Be={};const Rt=Object.keys(Ae.iconDependencies);Rt.length?ae.send("getImages",{icons:Rt,source:this.source,tileID:this.tileID,type:"icons"},(ir,gr)=>{We||(We=ir,At=gr,vr.call(this))}):At={};const Bt=Object.keys(Ae.patternDependencies);function vr(){if(We)return xe(We);if(Be&&At&&bt){const ir=new y(Be),gr=new o.ImageAtlas(At,bt);for(const $r in Ce){const Qr=Ce[$r];Qr instanceof o.SymbolBucket?(k(Qr.layers,this.zoom,ce),o.performSymbolLayout({bucket:Qr,glyphMap:Be,glyphPositions:ir.positions,imageMap:At,imagePositions:gr.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Qr.hasPattern&&(Qr instanceof o.LineBucket||Qr instanceof o.FillBucket||Qr instanceof o.FillExtrusionBucket)&&(k(Qr.layers,this.zoom,ce),Qr.addFeatures(Ae,this.tileID.canonical,gr.patternPositions))}this.status="done",xe(null,{buckets:Object.values(Ce).filter($r=>!$r.isEmpty()),featureIndex:be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ir.image,imageAtlas:gr,glyphMap:this.returnDependencies?Be:null,iconMap:this.returnDependencies?At:null,glyphPositions:this.returnDependencies?ir.positions:null})}}Bt.length?ae.send("getImages",{icons:Bt,source:this.source,tileID:this.tileID,type:"patterns"},(ir,gr)=>{We||(We=ir,bt=gr,vr.call(this))}):bt={},vr.call(this)}}function k(me,K,q){const ce=new o.EvaluationParameters(K);for(const ae of me)ae.recalculate(ce,q)}function T(me,K){const q=o.getArrayBuffer(me.request,(ce,ae,xe,Ee)=>{ce?K(ce):ae&&K(null,{vectorTile:new o.vectorTile.VectorTile(new o.pbf(ae)),rawData:ae,cacheControl:xe,expires:Ee})});return()=>{q.cancel(),K()}}class R{constructor(K,q,ce,ae){this.actor=K,this.layerIndex=q,this.availableImages=ce,this.loadVectorData=ae||T,this.loading={},this.loaded={}}loadTile(K,q){const ce=K.uid;this.loading||(this.loading={});const ae=!!(K&&K.request&&K.request.collectResourceTiming)&&new o.RequestPerformance(K.request),xe=this.loading[ce]=new w(K);xe.abort=this.loadVectorData(K,(Ee,be)=>{if(delete this.loading[ce],Ee||!be)return xe.status="done",this.loaded[ce]=xe,q(Ee);const Ce=be.rawData,Ae={};be.expires&&(Ae.expires=be.expires),be.cacheControl&&(Ae.cacheControl=be.cacheControl);const He={};if(ae){const We=ae.finish();We&&(He.resourceTiming=JSON.parse(JSON.stringify(We)))}xe.vectorTile=be.vectorTile,xe.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor,(We,Be)=>{if(We||!Be)return q(We);q(null,o.extend({rawTileData:Ce.slice(0)},Be,Ae,He))}),this.loaded=this.loaded||{},this.loaded[ce]=xe})}reloadTile(K,q){const ce=this.loaded,ae=K.uid,xe=this;if(ce&&ce[ae]){const Ee=ce[ae];Ee.showCollisionBoxes=K.showCollisionBoxes;const be=(Ce,Ae)=>{const He=Ee.reloadCallback;He&&(delete Ee.reloadCallback,Ee.parse(Ee.vectorTile,xe.layerIndex,this.availableImages,xe.actor,He)),q(Ce,Ae)};Ee.status==="parsing"?Ee.reloadCallback=be:Ee.status==="done"&&(Ee.vectorTile?Ee.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor,be):be())}}abortTile(K,q){const ce=this.loading,ae=K.uid;ce&&ce[ae]&&ce[ae].abort&&(ce[ae].abort(),delete ce[ae]),q()}removeTile(K,q){const ce=this.loaded,ae=K.uid;ce&&ce[ae]&&delete ce[ae],q()}}class A{constructor(){this.loaded={}}loadTile(K,q){const{uid:ce,encoding:ae,rawImageData:xe}=K,Ee=o.isImageBitmap(xe)?this.getImageData(xe):xe,be=new o.DEMData(ce,Ee,ae);this.loaded=this.loaded||{},this.loaded[ce]=be,q(null,be)}getImageData(K){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(K.width,K.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=K.width,this.offscreenCanvas.height=K.height,this.offscreenCanvasContext.drawImage(K,0,0,K.width,K.height);const q=this.offscreenCanvasContext.getImageData(-1,-1,K.width+2,K.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new o.RGBAImage({width:q.width,height:q.height},q.data)}removeTile(K){const q=this.loaded,ce=K.uid;q&&q[ce]&&delete q[ce]}}var I=function me(K,q){var ce,ae=K&&K.type;if(ae==="FeatureCollection")for(ce=0;ce=Math.abs(be)?q-Ce+be:be-Ce+q,q=Ce}q+ce>=0!=!!K&&me.reverse()}const L=o.vectorTile.VectorTileFeature.prototype.toGeoJSON;class B{constructor(K){this._feature=K,this.extent=o.EXTENT,this.type=K.type,this.properties=K.tags,"id"in K&&!isNaN(K.id)&&(this.id=parseInt(K.id,10))}loadGeometry(){if(this._feature.type===1){const K=[];for(const q of this._feature.geometry)K.push([new o.pointGeometry(q[0],q[1])]);return K}{const K=[];for(const q of this._feature.geometry){const ce=[];for(const ae of q)ce.push(new o.pointGeometry(ae[0],ae[1]));K.push(ce)}return K}}toGeoJSON(K,q,ce){return L.call(this,K,q,ce)}}class j{constructor(K){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.EXTENT,this.length=K.length,this._features=K}feature(K){return new B(this._features[K])}}var G={exports:{}},H=o.pointGeometry,te=o.vectorTile.VectorTileFeature,Y=le;function le(me,K){this.options=K||{},this.features=me,this.length=me.length}function J(me,K){this.id=typeof me.id=="number"?me.id:void 0,this.type=me.type,this.rawGeometry=me.type===1?[me.geometry]:me.geometry,this.properties=me.tags,this.extent=K||4096}le.prototype.feature=function(me){return new J(this.features[me],this.options.extent)},J.prototype.loadGeometry=function(){var me=this.rawGeometry;this.geometry=[];for(var K=0;K>31}function Te(me,K){for(var q=me.loadGeometry(),ce=me.type,ae=0,xe=0,Ee=q.length,be=0;be>1;Ie(me,K,Ee,ce,ae,xe%2),ze(me,K,q,ce,Ee-1,xe+1),ze(me,K,q,Ee+1,ae,xe+1)}function Ie(me,K,q,ce,ae,xe){for(;ae>ce;){if(ae-ce>600){const Ae=ae-ce+1,He=q-ce+1,We=Math.log(Ae),Be=.5*Math.exp(2*We/3),At=.5*Math.sqrt(We*Be*(Ae-Be)/Ae)*(He-Ae/2<0?-1:1);Ie(me,K,q,Math.max(ce,Math.floor(q-He*Be/Ae+At)),Math.min(ae,Math.floor(q+(Ae-He)*Be/Ae+At)),xe)}const Ee=K[2*q+xe];let be=ce,Ce=ae;for(Ne(me,K,ce,q),K[2*ae+xe]>Ee&&Ne(me,K,ce,ae);beEe;)Ce--}K[2*ce+xe]===Ee?Ne(me,K,ce,Ce):(Ce++,Ne(me,K,Ce,ae)),Ce<=q&&(ce=Ce+1),q<=Ce&&(ae=Ce-1)}}function Ne(me,K,q,ce){De(me,q,ce),De(K,2*q,2*ce),De(K,2*q+1,2*ce+1)}function De(me,K,q){const ce=me[K];me[K]=me[q],me[q]=ce}function Ve(me,K,q,ce){const ae=me-q,xe=K-ce;return ae*ae+xe*xe}G.exports=ge,G.exports.fromVectorTileJs=ge,G.exports.fromGeojsonVt=function(me,K){K=K||{};var q={};for(var ce in me)q[ce]=new Q(me[ce].features,K),q[ce].name=ce,q[ce].version=K.version,q[ce].extent=K.extent;return ge({layers:q})},G.exports.GeoJSONWrapper=Q;const Ge=me=>me[0],je=me=>me[1];class ct{constructor(K,q=Ge,ce=je,ae=64,xe=Float64Array){this.nodeSize=ae,this.points=K;const Ee=K.length<65536?Uint16Array:Uint32Array,be=this.ids=new Ee(K.length),Ce=this.coords=new xe(2*K.length);for(let Ae=0;Ae=be&&bt<=Ae&&Je>=Ce&&Je<=He&&At.push(xe[$r]);continue}const ir=Math.floor((vr+Bt)/2);bt=Ee[2*ir],Je=Ee[2*ir+1],bt>=be&&bt<=Ae&&Je>=Ce&&Je<=He&&At.push(xe[ir]);const gr=(Rt+1)%2;(Rt===0?be<=bt:Ce<=Je)&&(Be.push(vr),Be.push(ir-1),Be.push(gr)),(Rt===0?Ae>=bt:He>=Je)&&(Be.push(ir+1),Be.push(Bt),Be.push(gr))}return At}(this.ids,this.coords,K,q,ce,ae,this.nodeSize)}within(K,q,ce){return function(ae,xe,Ee,be,Ce,Ae){const He=[0,ae.length-1,0],We=[],Be=Ce*Ce;for(;He.length;){const At=He.pop(),bt=He.pop(),Je=He.pop();if(bt-Je<=Ae){for(let gr=Je;gr<=bt;gr++)Ve(xe[2*gr],xe[2*gr+1],Ee,be)<=Be&&We.push(ae[gr]);continue}const Rt=Math.floor((Je+bt)/2),Bt=xe[2*Rt],vr=xe[2*Rt+1];Ve(Bt,vr,Ee,be)<=Be&&We.push(ae[Rt]);const ir=(At+1)%2;(At===0?Ee-Ce<=Bt:be-Ce<=vr)&&(He.push(Je),He.push(Rt-1),He.push(ir)),(At===0?Ee+Ce>=Bt:be+Ce>=vr)&&(He.push(Rt+1),He.push(bt),He.push(ir))}return We}(this.ids,this.coords,K,q,ce,this.nodeSize)}}const pt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:me=>me},Tt=Math.fround||(Xe=new Float32Array(1),me=>(Xe[0]=+me,Xe[0]));var Xe;class Pt{constructor(K){this.options=it(Object.create(pt),K),this.trees=new Array(this.options.maxZoom+1)}load(K){const{log:q,minZoom:ce,maxZoom:ae,nodeSize:xe}=this.options;q&&console.time("total time");const Ee=`prepare ${K.length} points`;q&&console.time(Ee),this.points=K;let be=[];for(let Ce=0;Ce=ce;Ce--){const Ae=+Date.now();be=this._cluster(be,Ce),this.trees[Ce]=new ct(be,ft,xt,xe,Float32Array),q&&console.log("z%d: %d clusters in %dms",Ce,be.length,+Date.now()-Ae)}return q&&console.timeEnd("total time"),this}getClusters(K,q){let ce=((K[0]+180)%360+360)%360-180;const ae=Math.max(-90,Math.min(90,K[1]));let xe=K[2]===180?180:((K[2]+180)%360+360)%360-180;const Ee=Math.max(-90,Math.min(90,K[3]));if(K[2]-K[0]>=360)ce=-180,xe=180;else if(ce>xe){const He=this.getClusters([ce,ae,180,Ee],q),We=this.getClusters([-180,ae,xe,Ee],q);return He.concat(We)}const be=this.trees[this._limitZoom(q)],Ce=be.range(lt(ce),dt(Ee),lt(xe),dt(ae)),Ae=[];for(const He of Ce){const We=be.points[He];Ae.push(We.numPoints?Ct(We):this.points[We.index])}return Ae}getChildren(K){const q=this._getOriginId(K),ce=this._getOriginZoom(K),ae="No cluster with the specified id.",xe=this.trees[ce];if(!xe)throw new Error(ae);const Ee=xe.points[q];if(!Ee)throw new Error(ae);const be=this.options.radius/(this.options.extent*Math.pow(2,ce-1)),Ce=xe.within(Ee.x,Ee.y,be),Ae=[];for(const He of Ce){const We=xe.points[He];We.parentId===K&&Ae.push(We.numPoints?Ct(We):this.points[We.index])}if(Ae.length===0)throw new Error(ae);return Ae}getLeaves(K,q,ce){const ae=[];return this._appendLeaves(ae,K,q=q||10,ce=ce||0,0),ae}getTile(K,q,ce){const ae=this.trees[this._limitZoom(K)],xe=Math.pow(2,K),{extent:Ee,radius:be}=this.options,Ce=be/Ee,Ae=(ce-Ce)/xe,He=(ce+1+Ce)/xe,We={features:[]};return this._addTileFeatures(ae.range((q-Ce)/xe,Ae,(q+1+Ce)/xe,He),ae.points,q,ce,xe,We),q===0&&this._addTileFeatures(ae.range(1-Ce/xe,Ae,1,He),ae.points,xe,ce,xe,We),q===xe-1&&this._addTileFeatures(ae.range(0,Ae,Ce/xe,He),ae.points,-1,ce,xe,We),We.features.length?We:null}getClusterExpansionZoom(K){let q=this._getOriginZoom(K)-1;for(;q<=this.options.maxZoom;){const ce=this.getChildren(K);if(q++,ce.length!==1)break;K=ce[0].properties.cluster_id}return q}_appendLeaves(K,q,ce,ae,xe){const Ee=this.getChildren(q);for(const be of Ee){const Ce=be.properties;if(Ce&&Ce.cluster?xe+Ce.point_count<=ae?xe+=Ce.point_count:xe=this._appendLeaves(K,Ce.cluster_id,ce,ae,xe):xeq&&(bt+=Rt.numPoints||1)}if(bt>At&&bt>=be){let Je=He.x*At,Rt=He.y*At,Bt=Ee&&At>1?this._map(He,!0):null;const vr=(Ae<<5)+(q+1)+this.points.length;for(const ir of Be){const gr=We.points[ir];if(gr.zoom<=q)continue;gr.zoom=q;const $r=gr.numPoints||1;Je+=gr.x*$r,Rt+=gr.y*$r,gr.parentId=vr,Ee&&(Bt||(Bt=this._map(He,!0)),Ee(Bt,this._map(gr)))}He.parentId=vr,ce.push(mt(Je/bt,Rt/bt,vr,bt,Bt))}else if(ce.push(He),bt>1)for(const Je of Be){const Rt=We.points[Je];Rt.zoom<=q||(Rt.zoom=q,ce.push(Rt))}}return ce}_getOriginId(K){return K-this.points.length>>5}_getOriginZoom(K){return(K-this.points.length)%32}_map(K,q){if(K.numPoints)return q?it({},K.properties):K.properties;const ce=this.points[K.index].properties,ae=this.options.map(ce);return q&&ae===ce?it({},ae):ae}}function mt(me,K,q,ce,ae){return{x:Tt(me),y:Tt(K),zoom:1/0,id:q,parentId:-1,numPoints:ce,properties:ae}}function It(me,K){const[q,ce]=me.geometry.coordinates;return{x:Tt(lt(q)),y:Tt(dt(ce)),zoom:1/0,index:K,parentId:-1}}function Ct(me){return{type:"Feature",id:me.id,properties:Dt(me),geometry:{type:"Point",coordinates:[(K=me.x,360*(K-.5)),ut(me.y)]}};var K}function Dt(me){const K=me.numPoints,q=K>=1e4?`${Math.round(K/1e3)}k`:K>=1e3?Math.round(K/100)/10+"k":K;return it(it({},me.properties),{cluster:!0,cluster_id:me.id,point_count:K,point_count_abbreviated:q})}function lt(me){return me/360+.5}function dt(me){const K=Math.sin(me*Math.PI/180),q=.5-.25*Math.log((1+K)/(1-K))/Math.PI;return q<0?0:q>1?1:q}function ut(me){const K=(180-360*me)*Math.PI/180;return 360*Math.atan(Math.exp(K))/Math.PI-90}function it(me,K){for(const q in K)me[q]=K[q];return me}function ft(me){return me.x}function xt(me){return me.y}function Wt(me,K,q,ce){for(var ae,xe=ce,Ee=q-K>>1,be=q-K,Ce=me[K],Ae=me[K+1],He=me[q],We=me[q+1],Be=K+3;Bexe)ae=Be,xe=At;else if(At===xe){var bt=Math.abs(Be-Ee);btce&&(ae-K>3&&Wt(me,K,ae,ce),me[ae+2]=xe,q-ae>3&&Wt(me,ae,q,ce))}function jt(me,K,q,ce,ae,xe){var Ee=ae-q,be=xe-ce;if(Ee!==0||be!==0){var Ce=((me-q)*Ee+(K-ce)*be)/(Ee*Ee+be*be);Ce>1?(q=ae,ce=xe):Ce>0&&(q+=Ee*Ce,ce+=be*Ce)}return(Ee=me-q)*Ee+(be=K-ce)*be}function Qt(me,K,q,ce){var ae={id:me===void 0?null:me,type:K,geometry:q,tags:ce,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(xe){var Ee=xe.geometry,be=xe.type;if(be==="Point"||be==="MultiPoint"||be==="LineString")Fe(xe,Ee);else if(be==="Polygon"||be==="MultiLineString")for(var Ce=0;Ce0&&(Ee+=ce?(ae*Ae-Ce*xe)/2:Math.sqrt(Math.pow(Ce-ae,2)+Math.pow(Ae-xe,2))),ae=Ce,xe=Ae}var He=K.length-3;K[2]=1,Wt(K,0,He,q),K[He+2]=1,K.size=Math.abs(Ee),K.start=0,K.end=K.size}function Vt(me,K,q,ce){for(var ae=0;ae1?1:q}function xr(me,K,q,ce,ae,xe,Ee,be){if(ce/=K,xe>=(q/=K)&&Ee=ce)return null;for(var Ce=[],Ae=0;Ae=q&&bt=ce)){var Je=[];if(Be==="Point"||Be==="MultiPoint")Rr(We,Je,q,ce,ae);else if(Be==="LineString")_t(We,Je,q,ce,ae,!1,be.lineMetrics);else if(Be==="MultiLineString")or(We,Je,q,ce,ae,!1);else if(Be==="Polygon")or(We,Je,q,ce,ae,!0);else if(Be==="MultiPolygon")for(var Rt=0;Rt=q&&Ee<=ce&&(K.push(me[xe]),K.push(me[xe+1]),K.push(me[xe+2]))}}function _t(me,K,q,ce,ae,xe,Ee){for(var be,Ce,Ae=qt(me),He=ae===0?Er:Lt,We=me.start,Be=0;Beq&&(Ce=He(Ae,At,bt,Rt,Bt,q),Ee&&(Ae.start=We+be*Ce)):vr>ce?ir=q&&(Ce=He(Ae,At,bt,Rt,Bt,q),gr=!0),ir>ce&&vr<=ce&&(Ce=He(Ae,At,bt,Rt,Bt,ce),gr=!0),!xe&&gr&&(Ee&&(Ae.end=We+be*Ce),K.push(Ae),Ae=qt(me)),Ee&&(We+=be)}var $r=me.length-3;At=me[$r],bt=me[$r+1],Je=me[$r+2],(vr=ae===0?At:bt)>=q&&vr<=ce&&Lr(Ae,At,bt,Je),$r=Ae.length-3,xe&&$r>=3&&(Ae[$r]!==Ae[0]||Ae[$r+1]!==Ae[1])&&Lr(Ae,Ae[0],Ae[1],Ae[2]),Ae.length&&K.push(Ae)}function qt(me){var K=[];return K.size=me.size,K.start=me.start,K.end=me.end,K}function or(me,K,q,ce,ae,xe){for(var Ee=0;EeEe.maxX&&(Ee.maxX=He),We>Ee.maxY&&(Ee.maxY=We)}return Ee}function ht(me,K,q,ce){var ae=K.geometry,xe=K.type,Ee=[];if(xe==="Point"||xe==="MultiPoint")for(var be=0;be0&&K.size<(ae?Ee:ce))q.numPoints+=K.length/3;else{for(var be=[],Ce=0;CeEe)&&(q.numSimplified++,be.push(K[Ce]),be.push(K[Ce+1])),q.numPoints++;ae&&function(Ae,He){for(var We=0,Be=0,At=Ae.length,bt=At-2;Be0===He)for(Be=0,At=Ae.length;Be24)throw new Error("maxZoom should be in the 0-24 range");if(K.promoteId&&K.generateId)throw new Error("promoteId and generateId cannot be used together.");var ce=function(ae,xe){var Ee=[];if(ae.type==="FeatureCollection")for(var be=0;be1&&console.time("creation"),Be=this.tiles[We]=ot(me,K,q,ce,Ce),this.tileCoords.push({z:K,x:q,y:ce}),Ae)){Ae>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",K,q,ce,Be.numFeatures,Be.numPoints,Be.numSimplified),console.timeEnd("creation"));var At="z"+K;this.stats[At]=(this.stats[At]||0)+1,this.total++}if(Be.source=me,ae){if(K===Ce.maxZoom||K===ae)continue;var bt=1<1&&console.time("clipping");var Je,Rt,Bt,vr,ir,gr,$r=.5*Ce.buffer/Ce.extent,Qr=.5-$r,$n=.5+$r,on=1+$r;Je=Rt=Bt=vr=null,ir=xr(me,He,q-$r,q+$n,0,Be.minX,Be.maxX,Ce),gr=xr(me,He,q+Qr,q+on,0,Be.minX,Be.maxX,Ce),me=null,ir&&(Je=xr(ir,He,ce-$r,ce+$n,1,Be.minY,Be.maxY,Ce),Rt=xr(ir,He,ce+Qr,ce+on,1,Be.minY,Be.maxY,Ce),ir=null),gr&&(Bt=xr(gr,He,ce-$r,ce+$n,1,Be.minY,Be.maxY,Ce),vr=xr(gr,He,ce+Qr,ce+on,1,Be.minY,Be.maxY,Ce),gr=null),Ae>1&&console.timeEnd("clipping"),be.push(Je||[],K+1,2*q,2*ce),be.push(Rt||[],K+1,2*q,2*ce+1),be.push(Bt||[],K+1,2*q+1,2*ce),be.push(vr||[],K+1,2*q+1,2*ce+1)}}},$t.prototype.getTile=function(me,K,q){var ce=this.options,ae=ce.extent,xe=ce.debug;if(me<0||me>24)return null;var Ee=1<1&&console.log("drilling down to z%d-%d-%d",me,K,q);for(var Ce,Ae=me,He=K,We=q;!Ce&&Ae>0;)Ae--,He=Math.floor(He/2),We=Math.floor(We/2),Ce=this.tiles[ur(Ae,He,We)];return Ce&&Ce.source?(xe>1&&console.log("found parent tile z%d-%d-%d",Ae,He,We),xe>1&&console.time("drilling down"),this.splitTile(Ce.source,Ae,He,We,me,K,q),xe>1&&console.timeEnd("drilling down"),this.tiles[be]?fr(this.tiles[be],ae):null):null};class Wr extends R{constructor(K,q,ce,ae){super(K,q,ce,Mr),ae&&(this.loadGeoJSON=ae)}loadData(K,q){var ce;(ce=this._pendingRequest)===null||ce===void 0||ce.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const ae=!!(K&&K.request&&K.request.collectResourceTiming)&&new o.RequestPerformance(K.request);this._pendingCallback=q,this._pendingRequest=this.loadGeoJSON(K,(xe,Ee)=>{if(delete this._pendingCallback,delete this._pendingRequest,xe||!Ee)return q(xe);if(typeof Ee!="object")return q(new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`));{I(Ee,!0);try{if(K.filter){const Ce=o.createExpression(K.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ce.result==="error")throw new Error(Ce.value.map(He=>`${He.key}: ${He.message}`).join(", "));Ee={type:"FeatureCollection",features:Ee.features.filter(He=>Ce.value.evaluate({zoom:0},He))}}this._geoJSONIndex=K.cluster?new Pt(function({superclusterOptions:Ce,clusterProperties:Ae}){if(!Ae||!Ce)return Ce;const He={},We={},Be={accumulated:null,zoom:0},At={properties:null},bt=Object.keys(Ae);for(const Je of bt){const[Rt,Bt]=Ae[Je],vr=o.createExpression(Bt),ir=o.createExpression(typeof Rt=="string"?[Rt,["accumulated"],["get",Je]]:Rt);He[Je]=vr.value,We[Je]=ir.value}return Ce.map=Je=>{At.properties=Je;const Rt={};for(const Bt of bt)Rt[Bt]=He[Bt].evaluate(Be,At);return Rt},Ce.reduce=(Je,Rt)=>{At.properties=Rt;for(const Bt of bt)Be.accumulated=Je[Bt],Je[Bt]=We[Bt].evaluate(Be,At)},Ce}(K)).load(Ee.features):function(Ce,Ae){return new $t(Ce,Ae)}(Ee,K.geojsonVtOptions)}catch(Ce){return q(Ce)}this.loaded={};const be={};if(ae){const Ce=ae.finish();Ce&&(be.resourceTiming={},be.resourceTiming[K.source]=JSON.parse(JSON.stringify(Ce)))}q(null,be)}})}reloadTile(K,q){const ce=this.loaded;return ce&&ce[K.uid]?super.reloadTile(K,q):this.loadTile(K,q)}loadGeoJSON(K,q){if(K.request)return o.getJSON(K.request,q);if(typeof K.data=="string")try{q(null,JSON.parse(K.data))}catch{q(new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`))}else q(new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(K,q){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),q()}getClusterExpansionZoom(K,q){try{q(null,this._geoJSONIndex.getClusterExpansionZoom(K.clusterId))}catch(ce){q(ce)}}getClusterChildren(K,q){try{q(null,this._geoJSONIndex.getChildren(K.clusterId))}catch(ce){q(ce)}}getClusterLeaves(K,q){try{q(null,this._geoJSONIndex.getLeaves(K.clusterId,K.limit,K.offset))}catch(ce){q(ce)}}}class qr{constructor(K){this.self=K,this.actor=new o.Actor(K,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:R,geojson:Wr},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(q,ce)=>{if(this.workerSourceTypes[q])throw new Error(`Worker source with name "${q}" already registered.`);this.workerSourceTypes[q]=ce},this.self.registerRTLTextPlugin=q=>{if(o.plugin.isParsed())throw new Error("RTL text plugin already registered.");o.plugin.applyArabicShaping=q.applyArabicShaping,o.plugin.processBidirectionalText=q.processBidirectionalText,o.plugin.processStyledBidirectionalText=q.processStyledBidirectionalText}}setReferrer(K,q){this.referrer=q}setImages(K,q,ce){this.availableImages[K]=q;for(const ae in this.workerSources[K]){const xe=this.workerSources[K][ae];for(const Ee in xe)xe[Ee].availableImages=q}ce()}setLayers(K,q,ce){this.getLayerIndex(K).replace(q),ce()}updateLayers(K,q,ce){this.getLayerIndex(K).update(q.layers,q.removedIds),ce()}loadTile(K,q,ce){this.getWorkerSource(K,q.type,q.source).loadTile(q,ce)}loadDEMTile(K,q,ce){this.getDEMWorkerSource(K,q.source).loadTile(q,ce)}reloadTile(K,q,ce){this.getWorkerSource(K,q.type,q.source).reloadTile(q,ce)}abortTile(K,q,ce){this.getWorkerSource(K,q.type,q.source).abortTile(q,ce)}removeTile(K,q,ce){this.getWorkerSource(K,q.type,q.source).removeTile(q,ce)}removeDEMTile(K,q){this.getDEMWorkerSource(K,q.source).removeTile(q)}removeSource(K,q,ce){if(!this.workerSources[K]||!this.workerSources[K][q.type]||!this.workerSources[K][q.type][q.source])return;const ae=this.workerSources[K][q.type][q.source];delete this.workerSources[K][q.type][q.source],ae.removeSource!==void 0?ae.removeSource(q,ce):ce()}loadWorkerSource(K,q,ce){try{this.self.importScripts(q.url),ce()}catch(ae){ce(ae.toString())}}syncRTLPluginState(K,q,ce){try{o.plugin.setState(q);const ae=o.plugin.getPluginURL();if(o.plugin.isLoaded()&&!o.plugin.isParsed()&&ae!=null){this.self.importScripts(ae);const xe=o.plugin.isParsed();ce(xe?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ae}`),xe)}}catch(ae){ce(ae.toString())}}getAvailableImages(K){let q=this.availableImages[K];return q||(q=[]),q}getLayerIndex(K){let q=this.layerIndexes[K];return q||(q=this.layerIndexes[K]=new v),q}getWorkerSource(K,q,ce){if(this.workerSources[K]||(this.workerSources[K]={}),this.workerSources[K][q]||(this.workerSources[K][q]={}),!this.workerSources[K][q][ce]){const ae={send:(xe,Ee,be)=>{this.actor.send(xe,Ee,be,K)}};this.workerSources[K][q][ce]=new this.workerSourceTypes[q](ae,this.getLayerIndex(K),this.getAvailableImages(K))}return this.workerSources[K][q][ce]}getDEMWorkerSource(K,q){return this.demWorkerSources[K]||(this.demWorkerSources[K]={}),this.demWorkerSources[K][q]||(this.demWorkerSources[K][q]=new A),this.demWorkerSources[K][q]}enforceCacheSizeLimit(K,q){o.enforceCacheSizeLimit(q)}}return o.isWorker()&&(self.worker=new qr(self)),qr}),a(["./shared"],function(o){var f=p;function p(x){return!function(l){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var g,b,P=new Blob([""],{type:"text/javascript"}),z=URL.createObjectURL(P);try{b=new Worker(z),g=!0}catch{g=!1}return b&&b.terminate(),URL.revokeObjectURL(z),g}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var g=document.createElement("canvas");g.width=g.height=1;var b=g.getContext("2d");if(!b)return!1;var P=b.getImageData(0,0,1,1);return P&&P.width===g.width}()?(v[h=l&&l.failIfMajorPerformanceCaveat]===void 0&&(v[h]=function(g){var b,P=function(z){var $=document.createElement("canvas"),V=Object.create(p.webGLContextAttributes);return V.failIfMajorPerformanceCaveat=z,$.getContext("webgl",V)||$.getContext("experimental-webgl",V)}(g);if(!P)return!1;try{b=P.createShader(P.VERTEX_SHADER)}catch{return!1}return!(!b||P.isContextLost())&&(P.shaderSource(b,"void main() {}"),P.compileShader(b),P.getShaderParameter(b,P.COMPILE_STATUS)===!0)}(h)),v[h]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var h}(x)}var v={};function y(x,l){if(Array.isArray(x)){if(!Array.isArray(l)||x.length!==l.length)return!1;for(let h=0;h{window.removeEventListener("click",w.suppressClickInternal,!0)},0)}static mousePos(l,h){const g=l.getBoundingClientRect();return new o.pointGeometry(h.clientX-g.left-l.clientLeft,h.clientY-g.top-l.clientTop)}static touchPos(l,h){const g=l.getBoundingClientRect(),b=[];for(let P=0;P-1);V++,P[V]=$,z[V]=W,z[V+1]=O}for(let $=0,V=0;${let $=this.entries[b];$||($=this.entries[b]={glyphs:{},requests:{},ranges:{}});let V=$.glyphs[P];if(V!==void 0)return void z(null,{stack:b,id:P,glyph:V});if(V=this._tinySDF($,b,P),V)return $.glyphs[P]=V,void z(null,{stack:b,id:P,glyph:V});const W=Math.floor(P/256);if(256*W>65535)return void z(new Error("glyphs > 65535 not supported"));if($.ranges[W])return void z(null,{stack:b,id:P,glyph:V});let ee=$.requests[W];ee||(ee=$.requests[W]=[],B.loadGlyphRange(b,W,this.url,this.requestManager,(ie,fe)=>{if(fe){for(const Se in fe)this._doesCharSupportLocalGlyph(+Se)||($.glyphs[+Se]=fe[+Se]);$.ranges[W]=!0}for(const Se of ee)Se(ie,fe);delete $.requests[W]})),ee.push((ie,fe)=>{ie?z(ie):fe&&z(null,{stack:b,id:P,glyph:fe[P]||null})})},(b,P)=>{if(b)h(b);else if(P){const z={};for(const{stack:$,id:V,glyph:W}of P)(z[$]||(z[$]={}))[V]=W&&{id:W.id,bitmap:W.bitmap.clone(),metrics:W.metrics};h(null,z)}})}_doesCharSupportLocalGlyph(l){return!!this.localIdeographFontFamily&&(o.unicodeBlockLookup["CJK Unified Ideographs"](l)||o.unicodeBlockLookup["Hangul Syllables"](l)||o.unicodeBlockLookup.Hiragana(l)||o.unicodeBlockLookup.Katakana(l))}_tinySDF(l,h,g){const b=this.localIdeographFontFamily;if(!b||!this._doesCharSupportLocalGlyph(g))return;let P=l.tinySDF;if(!P){let $="400";/bold/i.test(h)?$="900":/medium/i.test(h)?$="500":/light/i.test(h)&&($="200"),P=l.tinySDF=new B.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:b,fontWeight:$})}const z=P.draw(String.fromCharCode(g));return{id:g,bitmap:new o.AlphaImage({width:z.width||30,height:z.height||30},z.data),metrics:{width:z.glyphWidth||24,height:z.glyphHeight||24,left:z.glyphLeft||0,top:z.glyphTop-27||-8,advance:z.glyphAdvance||24}}}}B.loadGlyphRange=function(x,l,h,g,b){const P=256*l,z=P+255,$=g.transformRequest(h.replace("{fontstack}",x).replace("{range}",`${P}-${z}`),o.ResourceType.Glyphs);o.getArrayBuffer($,(V,W)=>{if(V)b(V);else if(W){const ee={};for(const ie of o.parseGlyphPbf(W))ee[ie.id]=ie;b(null,ee)}})},B.TinySDF=class{constructor({fontSize:x=24,buffer:l=3,radius:h=8,cutoff:g=.25,fontFamily:b="sans-serif",fontWeight:P="normal",fontStyle:z="normal"}={}){this.buffer=l,this.cutoff=g,this.radius=h;const $=this.size=x+4*l,V=this._createCanvas($),W=this.ctx=V.getContext("2d",{willReadFrequently:!0});W.font=`${z} ${P} ${x}px ${b}`,W.textBaseline="alphabetic",W.textAlign="left",W.fillStyle="black",this.gridOuter=new Float64Array($*$),this.gridInner=new Float64Array($*$),this.f=new Float64Array($),this.z=new Float64Array($+1),this.v=new Uint16Array($)}_createCanvas(x){const l=document.createElement("canvas");return l.width=l.height=x,l}draw(x){const{width:l,actualBoundingBoxAscent:h,actualBoundingBoxDescent:g,actualBoundingBoxLeft:b,actualBoundingBoxRight:P}=this.ctx.measureText(x),z=Math.ceil(h),$=Math.min(this.size-this.buffer,Math.ceil(P-b)),V=Math.min(this.size-this.buffer,z+Math.ceil(g)),W=$+2*this.buffer,ee=V+2*this.buffer,ie=Math.max(W*ee,0),fe=new Uint8ClampedArray(ie),Se={data:fe,width:W,height:ee,glyphWidth:$,glyphHeight:V,glyphTop:z,glyphLeft:0,glyphAdvance:l};if($===0||V===0)return Se;const{ctx:_e,buffer:we,gridInner:$e,gridOuter:Ue}=this;_e.clearRect(we,we,$,V),_e.fillText(x,we,we+z);const et=_e.getImageData(we,we,$,V);Ue.fill(O,0,ie),$e.fill(0,0,ie);for(let Pe=0;Pe0?yt*yt:0,$e[gt]=yt<0?yt*yt:0}}N(Ue,0,0,W,ee,W,this.f,this.v,this.z),N($e,we,we,$,V,W,this.f,this.v,this.z);for(let Pe=0;Pe1&&(V=l[++$]);const ee=Math.abs(W-V.left),ie=Math.abs(W-V.right),fe=Math.min(ee,ie);let Se;const _e=P/g*(b+1);if(V.isDash){const we=b-Math.abs(_e);Se=Math.sqrt(fe*fe+we*we)}else Se=b-Math.sqrt(fe*fe+_e*_e);this.data[z+W]=Math.max(0,Math.min(255,Se+128))}}}addRegularDash(l){for(let $=l.length-1;$>=0;--$){const V=l[$],W=l[$+1];V.zeroLength?l.splice($,1):W&&W.isDash===V.isDash&&(W.left=V.left,l.splice($,1))}const h=l[0],g=l[l.length-1];h.isDash===g.isDash&&(h.left=g.left-this.width,g.right=h.right+this.width);const b=this.width*this.nextRow;let P=0,z=l[P];for(let $=0;$1&&(z=l[++P]);const V=Math.abs($-z.left),W=Math.abs($-z.right),ee=Math.min(V,W);this.data[b+$]=Math.max(0,Math.min(255,(z.isDash?ee:-ee)+128))}}addDash(l,h){const g=h?7:0,b=2*g+1;if(this.nextRow+b>this.height)return o.warnOnce("LineAtlas out of space"),null;let P=0;for(let $=0;${b.send(l,h,P)},g=g||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(l=>{l.remove()}),this.actors=[],this.workerPool.release(this.id)}}function le(x,l,h){const g=function(b,P){if(b)return h(b);if(P){const z=o.pick(o.extend(P,x),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);P.vector_layers&&(z.vectorLayers=P.vector_layers,z.vectorLayerIds=z.vectorLayers.map($=>$.id)),h(null,z)}};return x.url?o.getJSON(l.transformRequest(x.url,o.ResourceType.Source),g):o.exported.frame(()=>g(null,x))}Y.Actor=o.Actor;class J{constructor(l,h,g){this.bounds=o.LngLatBounds.convert(this.validateBounds(l)),this.minzoom=h||0,this.maxzoom=g||24}validateBounds(l){return Array.isArray(l)&&l.length===4?[Math.max(-180,l[0]),Math.max(-90,l[1]),Math.min(180,l[2]),Math.min(90,l[3])]:[-180,-90,180,90]}contains(l){const h=Math.pow(2,l.z),g=Math.floor(o.mercatorXfromLng(this.bounds.getWest())*h),b=Math.floor(o.mercatorYfromLat(this.bounds.getNorth())*h),P=Math.ceil(o.mercatorXfromLng(this.bounds.getEast())*h),z=Math.ceil(o.mercatorYfromLat(this.bounds.getSouth())*h);return l.x>=g&&l.x=b&&l.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),l?this.fire(new o.ErrorEvent(l)):h&&(o.extend(this,h),h.bounds&&(this.tileBounds=new J(h.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(l){return!this.tileBounds||this.tileBounds.contains(l.canonical)}onAdd(l){this.map=l,this.load()}setSourceProperty(l){this._tileJSONRequest&&this._tileJSONRequest.cancel(),l(),this.load()}setTiles(l){return this.setSourceProperty(()=>{this._options.tiles=l}),this}setUrl(l){return this.setSourceProperty(()=>{this.url=l,this._options.url=l}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}loadTile(l,h){const g=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),b={request:this.map._requestManager.transformRequest(g,o.ResourceType.Tile),uid:l.uid,tileID:l.tileID,zoom:l.tileID.overscaledZ,tileSize:this.tileSize*l.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function P(z,$){return delete l.request,l.aborted?h(null):z&&z.status!==404?h(z):($&&$.resourceTiming&&(l.resourceTiming=$.resourceTiming),this.map._refreshExpiredTiles&&$&&l.setExpiryData($),l.loadVectorData($,this.map.painter),o.cacheEntryPossiblyAdded(this.dispatcher),h(null),void(l.reloadCallback&&(this.loadTile(l,l.reloadCallback),l.reloadCallback=null)))}b.request.collectResourceTiming=this._collectResourceTiming,l.actor&&l.state!=="expired"?l.state==="loading"?l.reloadCallback=h:l.request=l.actor.send("reloadTile",b,P.bind(this)):(l.actor=this.dispatcher.getActor(),l.request=l.actor.send("loadTile",b,P.bind(this)))}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.actor&&l.actor.send("abortTile",{uid:l.uid,type:this.type,source:this.id},void 0)}unloadTile(l){l.unloadVectorData(),l.actor&&l.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Q extends o.Evented{constructor(l,h,g,b){super(),this.id=l,this.dispatcher=g,this.setEventedParent(b),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.extend({type:"raster"},h),o.extend(this,o.pick(h,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=le(this._options,this.map._requestManager,(l,h)=>{this._tileJSONRequest=null,this._loaded=!0,l?this.fire(new o.ErrorEvent(l)):h&&(o.extend(this,h),h.bounds&&(this.tileBounds=new J(h.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(l){this.map=l,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}hasTile(l){return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,h){const g=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);l.request=o.getImage(this.map._requestManager.transformRequest(g,o.ResourceType.Tile),(b,P,z)=>{if(delete l.request,l.aborted)l.state="unloaded",h(null);else if(b)l.state="errored",h(b);else if(P){this.map._refreshExpiredTiles&&l.setExpiryData(z);const $=this.map.painter.context,V=$.gl;l.texture=this.map.painter.getTileTexture(P.width),l.texture?l.texture.update(P,{useMipmap:!0}):(l.texture=new R($,P,V.RGBA,{useMipmap:!0}),l.texture.bind(V.LINEAR,V.CLAMP_TO_EDGE,V.LINEAR_MIPMAP_NEAREST),$.extTextureFilterAnisotropic&&V.texParameterf(V.TEXTURE_2D,$.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,$.extTextureFilterAnisotropicMax)),l.state="loaded",o.cacheEntryPossiblyAdded(this.dispatcher),h(null)}})}abortTile(l,h){l.request&&(l.request.cancel(),delete l.request),h()}unloadTile(l,h){l.texture&&this.map.painter.saveTileTexture(l.texture),h()}hasTransition(){return!1}}let ge;class ne extends Q{constructor(l,h,g,b){super(l,h,g,b),this.type="raster-dem",this.maxzoom=22,this._options=o.extend({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(l,h){const g=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function b(P,z){P&&(l.state="errored",h(P)),z&&(l.dem=z,l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0,l.state="loaded",h(null))}l.request=o.getImage(this.map._requestManager.transformRequest(g,o.ResourceType.Tile),function(P,z){if(delete l.request,l.aborted)l.state="unloaded",h(null);else if(P)l.state="errored",h(P);else if(z){this.map._refreshExpiredTiles&&l.setExpiryData(z),delete z.cacheControl,delete z.expires;const $=o.isImageBitmap(z)&&(ge==null&&(ge=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ge)?z:o.exported.getImageData(z,1),V={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:$,encoding:this.encoding};l.actor&&l.state!=="expired"||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",V,b.bind(this)))}}.bind(this)),l.neighboringTiles=this._getNeighboringTiles(l.tileID)}_getNeighboringTiles(l){const h=l.canonical,g=Math.pow(2,h.z),b=(h.x-1+g)%g,P=h.x===0?l.wrap-1:l.wrap,z=(h.x+1+g)%g,$=h.x+1===g?l.wrap+1:l.wrap,V={};return V[new o.OverscaledTileID(l.overscaledZ,P,h.z,b,h.y).key]={backfilled:!1},V[new o.OverscaledTileID(l.overscaledZ,$,h.z,z,h.y).key]={backfilled:!1},h.y>0&&(V[new o.OverscaledTileID(l.overscaledZ,P,h.z,b,h.y-1).key]={backfilled:!1},V[new o.OverscaledTileID(l.overscaledZ,l.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},V[new o.OverscaledTileID(l.overscaledZ,$,h.z,z,h.y-1).key]={backfilled:!1}),h.y+1{if(this._pendingLoads--,this._removed||P&&P.abandoned)return void this.fire(new o.Event("dataabort",{dataType:"source",sourceDataType:l}));let z=null;if(P&&P.resourceTiming&&P.resourceTiming[this.id]&&(z=P.resourceTiming[this.id].slice(0)),b)return void this.fire(new o.ErrorEvent(b));const $={dataType:"source",sourceDataType:l};this._collectResourceTiming&&z&&z.length>0&&o.extend($,{resourceTiming:z}),this.fire(new o.Event("data",$))})}loaded(){return this._pendingLoads===0}loadTile(l,h){const g=l.actor?"reloadTile":"loadTile";l.actor=this.actor;const b={type:this.type,uid:l.uid,tileID:l.tileID,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};l.request=this.actor.send(g,b,(P,z)=>(delete l.request,l.unloadVectorData(),l.aborted?h(null):P?h(P):(l.loadVectorData(z,this.map.painter,g==="reloadTile"),h(null))))}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return o.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var oe=o.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class ye extends o.Evented{constructor(l,h,g,b){super(),this.id=l,this.dispatcher=g,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(b),this.options=h}load(l,h){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this.url=this.options.url,o.getImage(this.map._requestManager.transformRequest(this.url,o.ResourceType.Image),(g,b)=>{this._loaded=!0,g?this.fire(new o.ErrorEvent(g)):b&&(this.image=b,l&&(this.coordinates=l),h&&h(),this._finishLoading())})}loaded(){return this._loaded}updateImage(l){return this.image&&l.url?(this.options.url=l.url,this.load(l.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(l){this.map=l,this.load()}setCoordinates(l){this.coordinates=l;const h=l.map(o.MercatorCoordinate.fromLngLat);this.tileID=function(b){let P=1/0,z=1/0,$=-1/0,V=-1/0;for(const fe of b)P=Math.min(P,fe.x),z=Math.min(z,fe.y),$=Math.max($,fe.x),V=Math.max(V,fe.y);const W=Math.max($-P,V-z),ee=Math.max(0,Math.floor(-Math.log(W)/Math.LN2)),ie=Math.pow(2,ee);return new o.CanonicalTileID(ee,Math.floor((P+$)/2*ie),Math.floor((z+V)/2*ie))}(h),this.minzoom=this.maxzoom=this.tileID.z;const g=h.map(b=>this.tileID.getTilePoint(b)._round());return this._boundsArray=new o.RasterBoundsArray,this._boundsArray.emplaceBack(g[0].x,g[0].y,0,0),this._boundsArray.emplaceBack(g[1].x,g[1].y,o.EXTENT,0),this._boundsArray.emplaceBack(g[3].x,g[3].y,0,o.EXTENT),this._boundsArray.emplaceBack(g[2].x,g[2].y,o.EXTENT,o.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const l=this.map.painter.context,h=l.gl;this.boundsBuffer||(this.boundsBuffer=l.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new R(l,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture)}}loadTile(l,h){this.tileID&&this.tileID.equals(l.tileID.canonical)?(this.tiles[String(l.tileID.wrap)]=l,l.buckets={},h(null)):(l.state="errored",h(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Re extends ye{constructor(l,h,g,b){super(l,h,g,b),this.roundZoom=!0,this.type="video",this.options=h}load(){this._loaded=!1;const l=this.options;this.urls=[];for(const h of l.urls)this.urls.push(this.map._requestManager.transformRequest(h,o.ResourceType.Source).url);o.getVideo(this.urls,(h,g)=>{this._loaded=!0,h?this.fire(new o.ErrorEvent(h)):g&&(this.video=g,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){const h=this.video.seekable;lh.end(0)?this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const l=this.map.painter.context,h=l.gl;this.boundsBuffer||(this.boundsBuffer=l.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new R(l,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Te extends ye{constructor(l,h,g,b){super(l,h,g,b),h.coordinates?Array.isArray(h.coordinates)&&h.coordinates.length===4&&!h.coordinates.some(P=>!Array.isArray(P)||P.length!==2||P.some(z=>typeof z!="number"))||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'missing required property "coordinates"'))),h.animate&&typeof h.animate!="boolean"&&this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),h.canvas?typeof h.canvas=="string"||h.canvas instanceof HTMLCanvasElement||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`,null,'missing required property "canvas"'))),this.options=h,this.animate=h.animate===void 0||h.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new o.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const h=this.map.painter.context,g=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new R(h,this.canvas,g.RGBA,{premultiply:!0});for(const b in this.tiles){const P=this.tiles[b];P.state!=="loaded"&&(P.state="loaded",P.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}}const ke={vector:Z,raster:Q,"raster-dem":ne,geojson:de,video:Re,image:ye,canvas:Te};function ze(x,l){const h=o.create();return o.translate(h,h,[1,1,0]),o.scale(h,h,[.5*x.width,.5*x.height,1]),o.multiply(h,h,x.calculatePosMatrix(l.toUnwrapped()))}function Ie(x,l,h,g,b,P){const z=function(ie,fe,Se){if(ie)for(const _e of ie){const we=fe[_e];if(we&&we.source===Se&&we.type==="fill-extrusion")return!0}else for(const _e in fe){const we=fe[_e];if(we.source===Se&&we.type==="fill-extrusion")return!0}return!1}(b&&b.layers,l,x.id),$=P.maxPitchScaleFactor(),V=x.tilesIn(g,$,z);V.sort(Ne);const W=[];for(const ie of V)W.push({wrappedTileID:ie.tileID.wrapped().key,queryResults:ie.tile.queryRenderedFeatures(l,h,x._state,ie.queryGeometry,ie.cameraQueryGeometry,ie.scale,b,P,$,ze(x.transform,ie.tileID))});const ee=function(ie){const fe={},Se={};for(const _e of ie){const we=_e.queryResults,$e=_e.wrappedTileID,Ue=Se[$e]=Se[$e]||{};for(const et in we){const Pe=we[et],at=Ue[et]=Ue[et]||{},rt=fe[et]=fe[et]||[];for(const gt of Pe)at[gt.featureIndex]||(at[gt.featureIndex]=!0,rt.push(gt))}}return fe}(W);for(const ie in ee)ee[ie].forEach(fe=>{const Se=fe.feature,_e=x.getFeatureState(Se.layer["source-layer"],Se.id);Se.source=Se.layer.source,Se.layer["source-layer"]&&(Se.sourceLayer=Se.layer["source-layer"]),Se.state=_e});return ee}function Ne(x,l){const h=x.tileID,g=l.tileID;return h.overscaledZ-g.overscaledZ||h.canonical.y-g.canonical.y||h.wrap-g.wrap||h.canonical.x-g.canonical.x}class De{constructor(l,h){this.tileID=l,this.uid=o.uniqueId(),this.uses=0,this.tileSize=h,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.textures=[],this.textureCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(l){const h=l+this.timeAdded;hl.saveTileTexture(h)),this.demTexture=null,this.textures=[],this.textureCoords={}}loadVectorData(l,h,g){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",l){l.featureIndex&&(this.latestFeatureIndex=l.featureIndex,l.rawTileData?(this.latestRawTileData=l.rawTileData,this.latestFeatureIndex.rawTileData=l.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=l.collisionBoxArray,this.buckets=function(b,P){const z={};if(!P)return z;for(const $ of b){const V=$.layerIds.map(W=>P.getLayer(W)).filter(Boolean);if(V.length!==0){$.layers=V,$.stateDependentLayerIds&&($.stateDependentLayers=$.stateDependentLayerIds.map(W=>V.filter(ee=>ee.id===W)[0]));for(const W of V)z[W.id]=$}}return z}(l.buckets,h.style),this.hasSymbolBuckets=!1;for(const b in this.buckets){const P=this.buckets[b];if(P instanceof o.SymbolBucket){if(this.hasSymbolBuckets=!0,!g)break;P.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const b in this.buckets){const P=this.buckets[b];if(P instanceof o.SymbolBucket&&P.hasRTLText){this.hasRTLText=!0,o.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const b in this.buckets){const P=this.buckets[b];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(b).queryRadius(P))}l.imageAtlas&&(this.imageAtlas=l.imageAtlas),l.glyphAtlasImage&&(this.glyphAtlasImage=l.glyphAtlasImage)}else this.collisionBoxArray=new o.CollisionBoxArray}unloadVectorData(){for(const l in this.buckets)this.buckets[l].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(l){return this.buckets[l.id]}upload(l){for(const g in this.buckets){const b=this.buckets[g];b.uploadPending()&&b.upload(l)}const h=l.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new R(l,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new R(l,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(l){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(l,this.imageAtlasTexture)}queryRenderedFeatures(l,h,g,b,P,z,$,V,W,ee){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:b,cameraQueryGeometry:P,scale:z,tileSize:this.tileSize,pixelPosMatrix:ee,transform:V,params:$,queryPadding:this.queryPadding*W},l,h,g):{}}querySourceFeatures(l,h){const g=this.latestFeatureIndex;if(!g||!g.rawTileData)return;const b=g.loadVTLayers(),P=h?h.sourceLayer:"",z=b._geojsonTileLayer||b[P];if(!z)return;const $=o.createFilter(h&&h.filter),{z:V,x:W,y:ee}=this.tileID.canonical,ie={z:V,x:W,y:ee};for(let fe=0;feg)b=!1;else if(h)if(this.expirationTime{this.remove(l,P)},g)),this.data[b].push(P),this.order.push(b),this.order.length>this.max){const z=this._getAndRemoveByKey(this.order[0]);z&&this.onRemove(z)}return this}has(l){return l.wrapped().key in this.data}getAndRemove(l){return this.has(l)?this._getAndRemoveByKey(l.wrapped().key):null}_getAndRemoveByKey(l){const h=this.data[l].shift();return h.timeout&&clearTimeout(h.timeout),this.data[l].length===0&&delete this.data[l],this.order.splice(this.order.indexOf(l),1),h.value}getByKey(l){const h=this.data[l];return h?h[0].value:null}get(l){return this.has(l)?this.data[l.wrapped().key][0].value:null}remove(l,h){if(!this.has(l))return this;const g=l.wrapped().key,b=h===void 0?0:this.data[g].indexOf(h),P=this.data[g][b];return this.data[g].splice(b,1),P.timeout&&clearTimeout(P.timeout),this.data[g].length===0&&delete this.data[g],this.onRemove(P.value),this.order.splice(this.order.indexOf(g),1),this}setMaxSize(l){for(this.max=l;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(l){const h=[];for(const g in this.data)for(const b of this.data[g])l(b.value)||h.push(b);for(const g of h)this.remove(g.value.tileID,g)}}class Ge{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(l,h,g){const b=String(h);if(this.stateChanges[l]=this.stateChanges[l]||{},this.stateChanges[l][b]=this.stateChanges[l][b]||{},o.extend(this.stateChanges[l][b],g),this.deletedStates[l]===null){this.deletedStates[l]={};for(const P in this.state[l])P!==b&&(this.deletedStates[l][P]=null)}else if(this.deletedStates[l]&&this.deletedStates[l][b]===null){this.deletedStates[l][b]={};for(const P in this.state[l][b])g[P]||(this.deletedStates[l][b][P]=null)}else for(const P in g)this.deletedStates[l]&&this.deletedStates[l][b]&&this.deletedStates[l][b][P]===null&&delete this.deletedStates[l][b][P]}removeFeatureState(l,h,g){if(this.deletedStates[l]===null)return;const b=String(h);if(this.deletedStates[l]=this.deletedStates[l]||{},g&&h!==void 0)this.deletedStates[l][b]!==null&&(this.deletedStates[l][b]=this.deletedStates[l][b]||{},this.deletedStates[l][b][g]=null);else if(h!==void 0)if(this.stateChanges[l]&&this.stateChanges[l][b])for(g in this.deletedStates[l][b]={},this.stateChanges[l][b])this.deletedStates[l][b][g]=null;else this.deletedStates[l][b]=null;else this.deletedStates[l]=null}getState(l,h){const g=String(h),b=o.extend({},(this.state[l]||{})[g],(this.stateChanges[l]||{})[g]);if(this.deletedStates[l]===null)return{};if(this.deletedStates[l]){const P=this.deletedStates[l][h];if(P===null)return{};for(const z in P)delete b[z]}return b}initializeTileState(l,h){l.setFeatureState(this.state,h)}coalesceChanges(l,h){const g={};for(const b in this.stateChanges){this.state[b]=this.state[b]||{};const P={};for(const z in this.stateChanges[b])this.state[b][z]||(this.state[b][z]={}),o.extend(this.state[b][z],this.stateChanges[b][z]),P[z]=this.state[b][z];g[b]=P}for(const b in this.deletedStates){this.state[b]=this.state[b]||{};const P={};if(this.deletedStates[b]===null)for(const z in this.state[b])P[z]={},this.state[b][z]={};else for(const z in this.deletedStates[b]){if(this.deletedStates[b][z]===null)this.state[b][z]={};else for(const $ of Object.keys(this.deletedStates[b][z]))delete this.state[b][z][$];P[z]=this.state[b][z]}g[b]=g[b]||{},o.extend(g[b],P)}if(this.stateChanges={},this.deletedStates={},Object.keys(g).length!==0)for(const b in l)l[b].setFeatureState(g,h)}}class je extends o.Evented{constructor(l,h,g){super(),this.id=l,this.dispatcher=g,this.on("data",b=>{b.dataType==="source"&&b.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&b.dataType==="source"&&b.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(b,P,z,$){const V=new ke[P.type](b,P,z,$);if(V.id!==b)throw new Error(`Expected Source id to be ${b} instead of ${V.id}`);return o.bindAll(["load","abort","unload","serialize","prepare"],V),V}(l,h,g,this),this._tiles={},this._cache=new Ve(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ge}onAdd(l){this.map=l,this._maxTileCacheSize=l?l._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(l)}onRemove(l){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(l)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const l in this._tiles){const h=this._tiles[l];if(h.state!=="loaded"&&h.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const l=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,l&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(l,h){return this._source.loadTile(l,h)}_unloadTile(l){if(this._source.unloadTile)return this._source.unloadTile(l,()=>{})}_abortTile(l){this._source.abortTile&&this._source.abortTile(l,()=>{}),this._source.fire(new o.Event("dataabort",{tile:l,coord:l.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(l){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const g=this._tiles[h];g.upload(l),g.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(l=>l.tileID).sort(ct).map(l=>l.key)}getRenderableIds(l){const h=[];for(const g in this._tiles)this._isIdRenderable(g,l)&&h.push(this._tiles[g]);return l?h.sort((g,b)=>{const P=g.tileID,z=b.tileID,$=new o.pointGeometry(P.canonical.x,P.canonical.y)._rotate(this.transform.angle),V=new o.pointGeometry(z.canonical.x,z.canonical.y)._rotate(this.transform.angle);return P.overscaledZ-z.overscaledZ||V.y-$.y||V.x-$.x}).map(g=>g.tileID.key):h.map(g=>g.tileID).sort(ct).map(g=>g.key)}hasRenderableParent(l){const h=this.findLoadedParent(l,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(l,h){return this._tiles[l]&&this._tiles[l].hasData()&&!this._coveredTiles[l]&&(h||!this._tiles[l].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const l in this._tiles)this._tiles[l].state!=="errored"&&this._reloadTile(l,"reloading")}}_reloadTile(l,h){const g=this._tiles[l];g&&(g.state!=="loading"&&(g.state=h),this._loadTile(g,this._tileLoaded.bind(this,g,l,h)))}_tileLoaded(l,h,g,b){if(b)return l.state="errored",void(b.status!==404?this._source.fire(new o.ErrorEvent(b,{tile:l})):this.update(this.transform,this.terrain));l.timeAdded=o.exported.now(),g==="expired"&&(l.refreshedUponExpiration=!0),this._setTileReloadTimer(h,l),this.getSource().type==="raster-dem"&&l.dem&&this._backfillDEM(l),this._state.initializeTileState(l,this.map?this.map.painter:null),l.aborted||this._source.fire(new o.Event("data",{dataType:"source",tile:l,coord:l.tileID}))}_backfillDEM(l){const h=this.getRenderableIds();for(let b=0;b1||(Math.abs(z)>1&&(Math.abs(z+V)===1?z+=V:Math.abs(z-V)===1&&(z-=V)),P.dem&&b.dem&&(b.dem.backfillBorder(P.dem,z,$),b.neighboringTiles&&b.neighboringTiles[W]&&(b.neighboringTiles[W].backfilled=!0)))}}getTile(l){return this.getTileByID(l.key)}getTileByID(l){return this._tiles[l]}_retainLoadedChildren(l,h,g,b){for(const P in this._tiles){let z=this._tiles[P];if(b[P]||!z.hasData()||z.tileID.overscaledZ<=h||z.tileID.overscaledZ>g)continue;let $=z.tileID;for(;z&&z.tileID.overscaledZ>h+1;){const W=z.tileID.scaledTo(z.tileID.overscaledZ-1);z=this._tiles[W.key],z&&z.hasData()&&($=W)}let V=$;for(;V.overscaledZ>h;)if(V=V.scaledTo(V.overscaledZ-1),l[V.key]){b[$.key]=$;break}}}findLoadedParent(l,h){if(l.key in this._loadedParentTiles){const g=this._loadedParentTiles[l.key];return g&&g.tileID.overscaledZ>=h?g:null}for(let g=l.overscaledZ-1;g>=h;g--){const b=l.scaledTo(g),P=this._getLoadedTile(b);if(P)return P}}_getLoadedTile(l){const h=this._tiles[l.key];return h&&h.hasData()?h:this._cache.getByKey(l.wrapped().key)}updateCacheSize(l){const h=Math.ceil(l.width/this._source.tileSize)+1,g=Math.ceil(l.height/this._source.tileSize)+1,b=Math.floor(h*g*5),P=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,b):b;this._cache.setMaxSize(P)}handleWrapJump(l){const h=Math.round((l-(this._prevLng===void 0?l:this._prevLng))/360);if(this._prevLng=l,h){const g={};for(const b in this._tiles){const P=this._tiles[b];P.tileID=P.tileID.unwrapTo(P.tileID.wrap+h),g[P.tileID.key]=P}this._tiles=g;for(const b in this._timers)clearTimeout(this._timers[b]),delete this._timers[b];for(const b in this._tiles)this._setTileReloadTimer(b,this._tiles[b])}}update(l,h){if(this.transform=l,this.terrain=h,!this._sourceLoaded||this._paused)return;let g;this.updateCacheSize(l),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?g=l.getVisibleUnwrappedCoordinates(this._source.tileID).map(W=>new o.OverscaledTileID(W.canonical.z,W.wrap,W.canonical.z,W.canonical.x,W.canonical.y)):(g=l.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:h}),this._source.hasTile&&(g=g.filter(W=>this._source.hasTile(W)))):g=[];const b=l.coveringZoomLevel(this._source),P=Math.max(b-je.maxOverzooming,this._source.minzoom),z=Math.max(b+je.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const W={};for(const ee of g)if(ee.canonical.z>this._source.minzoom){const ie=ee.scaledTo(ee.canonical.z-1);W[ie.key]=ie;const fe=ee.scaledTo(Math.max(this._source.minzoom,Math.min(ee.canonical.z,5)));W[fe.key]=fe}g=g.concat(Object.values(W))}const $=this._updateRetainedTiles(g,b);if(pt(this._source.type)){const W={},ee={},ie=Object.keys($);for(const fe of ie){const Se=$[fe],_e=this._tiles[fe];if(!_e||_e.fadeEndTime&&_e.fadeEndTime<=o.exported.now())continue;const we=this.findLoadedParent(Se,P);we&&(this._addTile(we.tileID),W[we.tileID.key]=we.tileID),ee[fe]=Se}this._retainLoadedChildren(ee,b,z,$);for(const fe in W)$[fe]||(this._coveredTiles[fe]=!0,$[fe]=W[fe]);if(h){const fe={},Se={};for(const _e of g)this._tiles[_e.key].hasData()?fe[_e.key]=_e:Se[_e.key]=_e;for(const _e in Se){const we=Se[_e].children(this._source.maxzoom);this._tiles[we[0].key]&&this._tiles[we[1].key]&&this._tiles[we[2].key]&&this._tiles[we[3].key]&&(fe[we[0].key]=$[we[0].key]=we[0],fe[we[1].key]=$[we[1].key]=we[1],fe[we[2].key]=$[we[2].key]=we[2],fe[we[3].key]=$[we[3].key]=we[3],delete Se[_e])}for(const _e in Se){const we=this.findLoadedParent(Se[_e],this._source.minzoom);if(we){fe[we.tileID.key]=$[we.tileID.key]=we.tileID;for(const $e in fe)fe[$e].isChildOf(we.tileID)&&delete fe[$e]}}for(const _e in this._tiles)fe[_e]||(this._coveredTiles[_e]=!0)}}for(const W in $)this._tiles[W].clearFadeHold();const V=o.keysDifference(this._tiles,$);for(const W of V){const ee=this._tiles[W];ee.hasSymbolBuckets&&!ee.holdingForFade()?ee.setHoldDuration(this.map._fadeDuration):ee.hasSymbolBuckets&&!ee.symbolFadeFinished()||this._removeTile(W)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const l in this._tiles)this._tiles[l].holdingForFade()&&this._removeTile(l)}_updateRetainedTiles(l,h){const g={},b={},P=Math.max(h-je.maxOverzooming,this._source.minzoom),z=Math.max(h+je.maxUnderzooming,this._source.minzoom),$={};for(const V of l){const W=this._addTile(V);g[V.key]=V,W.hasData()||hthis._source.maxzoom){const ie=V.children(this._source.maxzoom)[0],fe=this.getTile(ie);if(fe&&fe.hasData()){g[ie.key]=ie;continue}}else{const ie=V.children(this._source.maxzoom);if(g[ie[0].key]&&g[ie[1].key]&&g[ie[2].key]&&g[ie[3].key])continue}let ee=W.wasRequested();for(let ie=V.overscaledZ-1;ie>=P;--ie){const fe=V.scaledTo(ie);if(b[fe.key]||(b[fe.key]=!0,W=this.getTile(fe),!W&&ee&&(W=this._addTile(fe)),W&&(g[fe.key]=fe,ee=W.wasRequested(),W.hasData())))break}}return g}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const l in this._tiles){const h=[];let g,b=this._tiles[l].tileID;for(;b.overscaledZ>0;){if(b.key in this._loadedParentTiles){g=this._loadedParentTiles[b.key];break}h.push(b.key);const P=b.scaledTo(b.overscaledZ-1);if(g=this._getLoadedTile(P),g)break;b=P}for(const P of h)this._loadedParentTiles[P]=g}}_addTile(l){let h=this._tiles[l.key];if(h)return h;h=this._cache.getAndRemove(l),h&&(this._setTileReloadTimer(l.key,h),h.tileID=l,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[l.key]&&(clearTimeout(this._cacheTimers[l.key]),delete this._cacheTimers[l.key],this._setTileReloadTimer(l.key,h)));const g=h;return h||(h=new De(l,this._source.tileSize*l.overscaleFactor()),this._loadTile(h,this._tileLoaded.bind(this,h,l.key,h.state))),h.uses++,this._tiles[l.key]=h,g||this._source.fire(new o.Event("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(l,h){l in this._timers&&(clearTimeout(this._timers[l]),delete this._timers[l]);const g=h.getExpiryTimeout();g&&(this._timers[l]=setTimeout(()=>{this._reloadTile(l,"expired"),delete this._timers[l]},g))}_removeTile(l){const h=this._tiles[l];h&&(h.uses--,delete this._tiles[l],this._timers[l]&&(clearTimeout(this._timers[l]),delete this._timers[l]),h.uses>0||(h.hasData()&&h.state!=="reloading"?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const l in this._tiles)this._removeTile(l);this._cache.reset()}tilesIn(l,h,g){const b=[],P=this.transform;if(!P)return b;const z=g?P.getCameraQueryGeometry(l):l,$=l.map(_e=>P.pointCoordinate(_e,this.terrain)),V=z.map(_e=>P.pointCoordinate(_e,this.terrain)),W=this.getIds();let ee=1/0,ie=1/0,fe=-1/0,Se=-1/0;for(const _e of V)ee=Math.min(ee,_e.x),ie=Math.min(ie,_e.y),fe=Math.max(fe,_e.x),Se=Math.max(Se,_e.y);for(let _e=0;_e=0&&Pe[1].y+et>=0){const at=$.map(gt=>$e.getTilePoint(gt)),rt=V.map(gt=>$e.getTilePoint(gt));b.push({tile:we,tileID:$e,queryGeometry:at,cameraQueryGeometry:rt,scale:Ue})}}return b}getVisibleCoordinates(l){const h=this.getRenderableIds(l).map(g=>this._tiles[g].tileID);for(const g of h)g.posMatrix=this.transform.calculatePosMatrix(g.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(pt(this._source.type))for(const l in this._tiles){const h=this._tiles[l];if(h.fadeEndTime!==void 0&&h.fadeEndTime>=o.exported.now())return!0}return!1}setFeatureState(l,h,g){this._state.updateState(l=l||"_geojsonTileLayer",h,g)}removeFeatureState(l,h,g){this._state.removeFeatureState(l=l||"_geojsonTileLayer",h,g)}getFeatureState(l,h){return this._state.getState(l=l||"_geojsonTileLayer",h)}setDependencies(l,h,g){const b=this._tiles[l];b&&b.setDependencies(h,g)}reloadTilesForDependencies(l,h){for(const g in this._tiles)this._tiles[g].hasDependency(l,h)&&this._reloadTile(g,"reloading");this._cache.filter(g=>!g.hasDependency(l,h))}}function ct(x,l){const h=Math.abs(2*x.wrap)-+(x.wrap<0),g=Math.abs(2*l.wrap)-+(l.wrap<0);return x.overscaledZ-l.overscaledZ||g-h||l.canonical.y-x.canonical.y||l.canonical.x-x.canonical.x}function pt(x){return x==="raster"||x==="image"||x==="video"}je.maxOverzooming=10,je.maxUnderzooming=3;const Tt="mapboxgl_preloaded_worker_pool";class Xe{constructor(){this.active={}}acquire(l){if(!this.workers)for(this.workers=[];this.workers.length{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Tt]}numActive(){return Object.keys(this.active).length}}const Pt=Math.floor(o.exported.hardwareConcurrency/2);let mt;function It(){return mt||(mt=new Xe),mt}function Ct(x,l){const h={};for(const g in x)g!=="ref"&&(h[g]=x[g]);return o.refProperties.forEach(g=>{g in l&&(h[g]=l[g])}),h}function Dt(x){x=x.slice();const l=Object.create(null);for(let h=0;h0?(b-z)/$:0;return this.points[P].mult(1-V).add(this.points[h].mult(V))}}function Fe(x,l){let h=!0;return x==="always"||x!=="never"&&l!=="never"||(h=!1),h}class qe{constructor(l,h,g){const b=this.boxCells=[],P=this.circleCells=[];this.xCellCount=Math.ceil(l/g),this.yCellCount=Math.ceil(h/g);for(let z=0;zthis.width||b<0||h>this.height)return[];const V=[];if(l<=0&&h<=0&&this.width<=g&&this.height<=b){if(P)return[{key:null,x1:l,y1:h,x2:g,y2:b}];for(let W=0;W0}hitTestCircle(l,h,g,b,P){const z=l-g,$=l+g,V=h-g,W=h+g;if($<0||z>this.width||W<0||V>this.height)return!1;const ee=[];return this._forEachCell(z,V,$,W,this._queryCellCircle,ee,{hitTest:!0,overlapMode:b,circle:{x:l,y:h,radius:g},seenUids:{box:{},circle:{}}},P),ee.length>0}_queryCell(l,h,g,b,P,z,$,V){const{seenUids:W,hitTest:ee,overlapMode:ie}=$,fe=this.boxCells[P];if(fe!==null){const _e=this.bboxes;for(const we of fe)if(!W.box[we]){W.box[we]=!0;const $e=4*we,Ue=this.boxKeys[we];if(l<=_e[$e+2]&&h<=_e[$e+3]&&g>=_e[$e+0]&&b>=_e[$e+1]&&(!V||V(Ue))&&(!ee||!Fe(ie,Ue.overlapMode))&&(z.push({key:Ue,x1:_e[$e],y1:_e[$e+1],x2:_e[$e+2],y2:_e[$e+3]}),ee))return!0}}const Se=this.circleCells[P];if(Se!==null){const _e=this.circles;for(const we of Se)if(!W.circle[we]){W.circle[we]=!0;const $e=3*we,Ue=this.circleKeys[we];if(this._circleAndRectCollide(_e[$e],_e[$e+1],_e[$e+2],l,h,g,b)&&(!V||V(Ue))&&(!ee||!Fe(ie,Ue.overlapMode))){const et=_e[$e],Pe=_e[$e+1],at=_e[$e+2];if(z.push({key:Ue,x1:et-at,y1:Pe-at,x2:et+at,y2:Pe+at}),ee)return!0}}}return!1}_queryCellCircle(l,h,g,b,P,z,$,V){const{circle:W,seenUids:ee,overlapMode:ie}=$,fe=this.boxCells[P];if(fe!==null){const _e=this.bboxes;for(const we of fe)if(!ee.box[we]){ee.box[we]=!0;const $e=4*we,Ue=this.boxKeys[we];if(this._circleAndRectCollide(W.x,W.y,W.radius,_e[$e+0],_e[$e+1],_e[$e+2],_e[$e+3])&&(!V||V(Ue))&&!Fe(ie,Ue.overlapMode))return z.push(!0),!0}}const Se=this.circleCells[P];if(Se!==null){const _e=this.circles;for(const we of Se)if(!ee.circle[we]){ee.circle[we]=!0;const $e=3*we,Ue=this.circleKeys[we];if(this._circlesCollide(_e[$e],_e[$e+1],_e[$e+2],W.x,W.y,W.radius)&&(!V||V(Ue))&&!Fe(ie,Ue.overlapMode))return z.push(!0),!0}}}_forEachCell(l,h,g,b,P,z,$,V){const W=this._convertToXCellCoord(l),ee=this._convertToYCellCoord(h),ie=this._convertToXCellCoord(g),fe=this._convertToYCellCoord(b);for(let Se=W;Se<=ie;Se++)for(let _e=ee;_e<=fe;_e++)if(P.call(this,l,h,g,b,this.xCellCount*_e+Se,z,$,V))return}_convertToXCellCoord(l){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(l*this.xScale)))}_convertToYCellCoord(l){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(l*this.yScale)))}_circlesCollide(l,h,g,b,P,z){const $=b-l,V=P-h,W=g+z;return W*W>$*$+V*V}_circleAndRectCollide(l,h,g,b,P,z,$){const V=(z-b)/2,W=Math.abs(l-(b+V));if(W>V+g)return!1;const ee=($-P)/2,ie=Math.abs(h-(P+ee));if(ie>ee+g)return!1;if(W<=V||ie<=ee)return!0;const fe=W-V,Se=ie-ee;return fe*fe+Se*Se<=g*g}}function Xt(x,l,h,g,b){const P=o.create();return l?(o.scale(P,P,[1/b,1/b,1]),h||o.rotateZ(P,P,g.angle)):o.multiply(P,g.labelPlaneMatrix,x),P}function cr(x,l,h,g,b){if(l){const P=o.clone(x);return o.scale(P,P,[b,b,1]),h||o.rotateZ(P,P,-g.angle),P}return g.glCoordMatrix}function Vt(x,l,h){let g;h?(g=[x.x,x.y,h(x.x,x.y),1],o.transformMat4(g,g,l)):(g=[x.x,x.y,0,1],kr(g,g,l));const b=g[3];return{point:new o.pointGeometry(g[0]/b,g[1]/b),signedDistanceFromCamera:b}}function Ut(x,l){return .5+x/l*.5}function rr(x,l){const h=x[0]/x[3],g=x[1]/x[3];return h>=-l[0]&&h<=l[0]&&g>=-l[1]&&g<=l[1]}function xr(x,l,h,g,b,P,z,$,V,W){const ee=g?x.textSizeData:x.iconSizeData,ie=o.evaluateSizeForZoom(ee,h.transform.zoom),fe=[256/h.width*2+1,256/h.height*2+1],Se=g?x.text.dynamicLayoutVertexArray:x.icon.dynamicLayoutVertexArray;Se.clear();const _e=x.lineVertexArray,we=g?x.text.placedSymbolArray:x.icon.placedSymbolArray,$e=h.transform.width/h.transform.height;let Ue=!1;for(let et=0;etMath.abs(h.x-l.x)*g?{useVertical:!0}:(x===o.WritingMode.vertical?l.yh.x)?{needsFlipping:!0}:null}function qt(x,l,h,g,b,P,z,$,V,W,ee,ie,fe,Se,_e,we){const $e=l/24,Ue=x.lineOffsetX*$e,et=x.lineOffsetY*$e;let Pe;if(x.numGlyphs>1){const at=x.glyphStartIndex+x.numGlyphs,rt=x.lineStartIndex,gt=x.lineStartIndex+x.lineLength,yt=Rr($e,$,Ue,et,h,ee,ie,x,V,P,fe,_e,we);if(!yt)return{notEnoughRoom:!0};const zt=Vt(yt.first.point,z,we).point,vt=Vt(yt.last.point,z,we).point;if(g&&!h){const nr=_t(x.writingMode,zt,vt,Se);if(nr)return nr}Pe=[yt.first];for(let nr=x.glyphStartIndex+1;nr0?zt.point:or(ie,yt,rt,1,b,we),nr=_t(x.writingMode,rt,vt,Se);if(nr)return nr}const at=Lr($e*$.getoffsetX(x.glyphStartIndex),Ue,et,h,ee,ie,x.segment,x.lineStartIndex,x.lineStartIndex+x.lineLength,V,P,fe,_e,we);if(!at)return{notEnoughRoom:!0};Pe=[at]}for(const at of Pe)o.addDynamicAttributes(W,at.point,at.angle);return{}}function or(x,l,h,g,b,P){const z=Vt(x.add(x.sub(l)._unit()),b,P).point,$=h.sub(z);return h.add($._mult(g/$.mag()))}function Lr(x,l,h,g,b,P,z,$,V,W,ee,ie,fe,Se){const _e=g?x-l:x+l;let we=_e>0?1:-1,$e=0;g&&(we*=-1,$e=Math.PI),we<0&&($e+=Math.PI);let Ue=we>0?$+z:$+z+1,et=b,Pe=b,at=0,rt=0;const gt=Math.abs(_e),yt=[];for(;at+rt<=gt;){if(Ue+=we,Ue<$||Ue>=V)return null;if(Pe=et,yt.push(et),et=ie[Ue],et===void 0){const sr=new o.pointGeometry(W.getx(Ue),W.gety(Ue)),Nr=Vt(sr,ee,Se);if(Nr.signedDistanceFromCamera>0)et=ie[Ue]=Nr.point;else{const Br=Ue-we;et=or(at===0?P:new o.pointGeometry(W.getx(Br),W.gety(Br)),sr,Pe,gt-at+1,ee,Se)}}at+=rt,rt=Pe.dist(et)}const zt=(gt-at)/rt,vt=et.sub(Pe),nr=vt.mult(zt)._add(Pe);nr._add(vt._unit()._perp()._mult(h*we));const Gt=$e+Math.atan2(et.y-Pe.y,et.x-Pe.x);return yt.push(nr),{point:nr,angle:fe?Gt:0,path:yt}}const Er=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Lt(x,l){for(let h=0;h=1;Yr--)_r.push(Nr.path[Yr]);for(let Yr=1;YrVt(Jr,V,_e));_r=Yr.some(Jr=>Jr.signedDistanceFromCamera<=0)?[]:Yr.map(Jr=>Jr.point)}let fn=[];if(_r.length>0){const Yr=_r[0].clone(),Jr=_r[0].clone();for(let mn=1;mn<_r.length;mn++)Yr.x=Math.min(Yr.x,_r[mn].x),Yr.y=Math.min(Yr.y,_r[mn].y),Jr.x=Math.max(Jr.x,_r[mn].x),Jr.y=Math.max(Jr.y,_r[mn].y);fn=Yr.x>=nr.x&&Jr.x<=Gt.x&&Yr.y>=nr.y&&Jr.y<=Gt.y?[_r]:Jr.xGt.x||Jr.yGt.y?[]:o.clipLine([_r],nr.x,nr.y,Gt.x,Gt.y)}for(const Yr of fn){sr.reset(Yr,.25*vt);let Jr=0;Jr=sr.length<=.5*vt?1:Math.ceil(sr.paddedLength/dn)+1;for(let mn=0;mn=this.screenRightBoundary||bthis.screenBottomBoundary}isInsideGrid(l,h,g,b){return g>=0&&l=0&&hg.collisionGroupID===h}}return this.collisionGroups[l]}}function Wr(x,l,h,g,b){const{horizontalAlign:P,verticalAlign:z}=o.getAnchorAlignment(x),$=-(P-.5)*l,V=-(z-.5)*h,W=o.evaluateVariableOffset(x,g);return new o.pointGeometry($+W[0]*b,V+W[1]*b)}function qr(x,l,h,g,b,P){const{x1:z,x2:$,y1:V,y2:W,anchorPointX:ee,anchorPointY:ie}=x,fe=new o.pointGeometry(l,h);return g&&fe._rotate(b?P:-P),{x1:z+fe.x,y1:V+fe.y,x2:$+fe.x,y2:W+fe.y,anchorPointX:ee,anchorPointY:ie}}class me{constructor(l,h,g,b,P){this.transform=l.clone(),this.terrain=h,this.collisionIndex=new fr(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=g,this.retainedQueryData={},this.collisionGroups=new Mr(b),this.collisionCircleArrays={},this.prevPlacement=P,P&&(P.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(l,h,g,b){const P=g.getBucket(h),z=g.latestFeatureIndex;if(!P||!z||h.id!==P.layerIds[0])return;const $=g.collisionBoxArray,V=P.layers[0].layout,W=Math.pow(2,this.transform.zoom-g.tileID.overscaledZ),ee=g.tileSize/o.EXTENT,ie=this.transform.calculatePosMatrix(g.tileID.toUnwrapped()),fe=V.get("text-pitch-alignment")==="map",Se=V.get("text-rotation-alignment")==="map",_e=Nt(g,1,this.transform.zoom),we=Xt(ie,fe,Se,this.transform,_e);let $e=null;if(fe){const et=cr(ie,fe,Se,this.transform,_e);$e=o.multiply([],this.transform.labelPlaneMatrix,et)}this.retainedQueryData[P.bucketInstanceId]=new ur(P.bucketInstanceId,z,P.sourceLayerIndex,P.index,g.tileID);const Ue={bucket:P,layout:V,posMatrix:ie,textLabelPlaneMatrix:we,labelToScreenMatrix:$e,scale:W,textPixelRatio:ee,holdingForFade:g.holdingForFade(),collisionBoxArray:$,partiallyEvaluatedTextSize:o.evaluateSizeForZoom(P.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(P.sourceID)};if(b)for(const et of P.sortKeyRanges){const{sortKey:Pe,symbolInstanceStart:at,symbolInstanceEnd:rt}=et;l.push({sortKey:Pe,symbolInstanceStart:at,symbolInstanceEnd:rt,parameters:Ue})}else l.push({symbolInstanceStart:0,symbolInstanceEnd:P.symbolInstances.length,parameters:Ue})}attemptAnchorPlacement(l,h,g,b,P,z,$,V,W,ee,ie,fe,Se,_e,we,$e){const Ue=[fe.textOffset0,fe.textOffset1],et=Wr(l,g,b,Ue,P),Pe=this.collisionIndex.placeCollisionBox(qr(h,et.x,et.y,z,$,this.transform.angle),ie,V,W,ee.predicate,$e);if((!we||this.collisionIndex.placeCollisionBox(qr(we,et.x,et.y,z,$,this.transform.angle),ie,V,W,ee.predicate,$e).box.length!==0)&&Pe.box.length>0){let at;if(this.prevPlacement&&this.prevPlacement.variableOffsets[fe.crossTileID]&&this.prevPlacement.placements[fe.crossTileID]&&this.prevPlacement.placements[fe.crossTileID].text&&(at=this.prevPlacement.variableOffsets[fe.crossTileID].anchor),fe.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[fe.crossTileID]={textOffset:Ue,width:g,height:b,anchor:l,textBoxScale:P,prevAnchor:at},this.markUsedJustification(Se,l,fe,_e),Se.allowVerticalPlacement&&(this.markUsedOrientation(Se,_e,fe),this.placedOrientations[fe.crossTileID]=_e),{shift:et,placedGlyphBoxes:Pe}}}placeLayerBucketPart(l,h,g){const{bucket:b,layout:P,posMatrix:z,textLabelPlaneMatrix:$,labelToScreenMatrix:V,textPixelRatio:W,holdingForFade:ee,collisionBoxArray:ie,partiallyEvaluatedTextSize:fe,collisionGroup:Se}=l.parameters,_e=P.get("text-optional"),we=P.get("icon-optional"),$e=o.getOverlapMode(P,"text-overlap","text-allow-overlap"),Ue=$e==="always",et=o.getOverlapMode(P,"icon-overlap","icon-allow-overlap"),Pe=et==="always",at=P.get("text-rotation-alignment")==="map",rt=P.get("text-pitch-alignment")==="map",gt=P.get("icon-text-fit")!=="none",yt=P.get("symbol-z-order")==="viewport-y",zt=Ue&&(Pe||!b.hasIconData()||we),vt=Pe&&(Ue||!b.hasTextData()||_e);!b.collisionArrays&&ie&&b.deserializeCollisionBoxes(ie);const nr=(Gt,sr)=>{if(h[Gt.crossTileID])return;if(ee)return void(this.placements[Gt.crossTileID]=new Ot(!1,!1,!1));let Nr=!1,Br=!1,_r=!0,dn=null,fn={box:null,offscreen:null},Yr={box:null,offscreen:null},Jr=null,mn=null,Ei=null,Ta=0,na=0,Pa=0;sr.textFeatureIndex?Ta=sr.textFeatureIndex:Gt.useRuntimeCollisionCircles&&(Ta=Gt.featureIndex),sr.verticalTextFeatureIndex&&(na=sr.verticalTextFeatureIndex);const Rs=this.retainedQueryData[b.bucketInstanceId].tileID,Uo=this.terrain?(yi,Kr)=>this.terrain.getElevation(Rs,yi,Kr):null;for(const yi of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const Kr=sr[yi];Kr&&(Kr.elevation=Uo?Uo(Kr.anchorPointX,Kr.anchorPointY):0)}const co=sr.textBox;if(co){const yi=cn=>{let ki=o.WritingMode.horizontal;if(b.allowVerticalPlacement&&!cn&&this.prevPlacement){const Ti=this.prevPlacement.placedOrientations[Gt.crossTileID];Ti&&(this.placedOrientations[Gt.crossTileID]=Ti,ki=Ti,this.markUsedOrientation(b,ki,Gt))}return ki},Kr=(cn,ki)=>{if(b.allowVerticalPlacement&&Gt.numVerticalGlyphVertices>0&&sr.verticalTextBox){for(const Ti of b.writingModes)if(Ti===o.WritingMode.vertical?(fn=ki(),Yr=fn):fn=cn(),fn&&fn.box&&fn.box.length)break}else fn=cn()};if(P.get("text-variable-anchor")){let cn=P.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Gt.crossTileID]){const zn=this.prevPlacement.variableOffsets[Gt.crossTileID];cn.indexOf(zn.anchor)>0&&(cn=cn.filter(Ko=>Ko!==zn.anchor),cn.unshift(zn.anchor))}const ki=(zn,Ko,il)=>{const ip=zn.x2-zn.x1,ru=zn.y2-zn.y1,_g=Gt.textBoxScale,op=gt&&et==="never"?Ko:null;let Os={box:[],offscreen:!1};const ol=$e!=="never"?2*cn.length:cn.length;for(let al=0;al=cn.length?$e:"never",Gt,b,il,op,Uo);if(Bd&&(Os=Bd.placedGlyphBoxes,Os&&Os.box&&Os.box.length)){Nr=!0,dn=Bd.shift;break}}return Os};Kr(()=>ki(co,sr.iconBox,o.WritingMode.horizontal),()=>{const zn=sr.verticalTextBox;return b.allowVerticalPlacement&&!(fn&&fn.box&&fn.box.length)&&Gt.numVerticalGlyphVertices>0&&zn?ki(zn,sr.verticalIconBox,o.WritingMode.vertical):{box:null,offscreen:null}}),fn&&(Nr=fn.box,_r=fn.offscreen);const Ti=yi(fn&&fn.box);if(!Nr&&this.prevPlacement){const zn=this.prevPlacement.variableOffsets[Gt.crossTileID];zn&&(this.variableOffsets[Gt.crossTileID]=zn,this.markUsedJustification(b,zn.anchor,Gt,Ti))}}else{const cn=(ki,Ti)=>{const zn=this.collisionIndex.placeCollisionBox(ki,$e,W,z,Se.predicate,Uo);return zn&&zn.box&&zn.box.length&&(this.markUsedOrientation(b,Ti,Gt),this.placedOrientations[Gt.crossTileID]=Ti),zn};Kr(()=>cn(co,o.WritingMode.horizontal),()=>{const ki=sr.verticalTextBox;return b.allowVerticalPlacement&&Gt.numVerticalGlyphVertices>0&&ki?cn(ki,o.WritingMode.vertical):{box:null,offscreen:null}}),yi(fn&&fn.box&&fn.box.length)}}if(Jr=fn,Nr=Jr&&Jr.box&&Jr.box.length>0,_r=Jr&&Jr.offscreen,Gt.useRuntimeCollisionCircles){const yi=b.text.placedSymbolArray.get(Gt.centerJustifiedTextSymbolIndex),Kr=o.evaluateSizeForFeature(b.textSizeData,fe,yi),cn=P.get("text-padding");mn=this.collisionIndex.placeCollisionCircles($e,yi,b.lineVertexArray,b.glyphOffsetArray,Kr,z,$,V,g,rt,Se.predicate,Gt.collisionCircleDiameter,cn,Uo),mn.circles.length&&mn.collisionDetected&&!g&&o.warnOnce("Collisions detected, but collision boxes are not shown"),Nr=Ue||mn.circles.length>0&&!mn.collisionDetected,_r=_r&&mn.offscreen}if(sr.iconFeatureIndex&&(Pa=sr.iconFeatureIndex),sr.iconBox){const yi=Kr=>{const cn=gt&&dn?qr(Kr,dn.x,dn.y,at,rt,this.transform.angle):Kr;return this.collisionIndex.placeCollisionBox(cn,et,W,z,Se.predicate,Uo)};Yr&&Yr.box&&Yr.box.length&&sr.verticalIconBox?(Ei=yi(sr.verticalIconBox),Br=Ei.box.length>0):(Ei=yi(sr.iconBox),Br=Ei.box.length>0),_r=_r&&Ei.offscreen}const rs=_e||Gt.numHorizontalGlyphVertices===0&&Gt.numVerticalGlyphVertices===0,$d=we||Gt.numIconVertices===0;if(rs||$d?$d?rs||(Br=Br&&Nr):Nr=Br&&Nr:Br=Nr=Br&&Nr,Nr&&Jr&&Jr.box&&this.collisionIndex.insertCollisionBox(Jr.box,$e,P.get("text-ignore-placement"),b.bucketInstanceId,Yr&&Yr.box&&na?na:Ta,Se.ID),Br&&Ei&&this.collisionIndex.insertCollisionBox(Ei.box,et,P.get("icon-ignore-placement"),b.bucketInstanceId,Pa,Se.ID),mn&&(Nr&&this.collisionIndex.insertCollisionCircles(mn.circles,$e,P.get("text-ignore-placement"),b.bucketInstanceId,Ta,Se.ID),g)){const yi=b.bucketInstanceId;let Kr=this.collisionCircleArrays[yi];Kr===void 0&&(Kr=this.collisionCircleArrays[yi]=new $t);for(let cn=0;cn=0;--sr){const Nr=Gt[sr];nr(b.symbolInstances.get(Nr),b.collisionArrays[Nr])}}else for(let Gt=l.symbolInstanceStart;Gt=0&&(l.text.placedSymbolArray.get($).crossTileID=P>=0&&$!==P?0:g.crossTileID)}markUsedOrientation(l,h,g){const b=h===o.WritingMode.horizontal||h===o.WritingMode.horizontalOnly?h:0,P=h===o.WritingMode.vertical?h:0,z=[g.leftJustifiedTextSymbolIndex,g.centerJustifiedTextSymbolIndex,g.rightJustifiedTextSymbolIndex];for(const $ of z)l.text.placedSymbolArray.get($).placedOrientation=b;g.verticalPlacedTextSymbolIndex&&(l.text.placedSymbolArray.get(g.verticalPlacedTextSymbolIndex).placedOrientation=P)}commit(l){this.commitTime=l,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let g=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const b=h?h.symbolFadeChange(l):1,P=h?h.opacities:{},z=h?h.variableOffsets:{},$=h?h.placedOrientations:{};for(const V in this.placements){const W=this.placements[V],ee=P[V];ee?(this.opacities[V]=new ht(ee,b,W.text,W.icon),g=g||W.text!==ee.text.placed||W.icon!==ee.icon.placed):(this.opacities[V]=new ht(null,b,W.text,W.icon,W.skipFade),g=g||W.text||W.icon)}for(const V in P){const W=P[V];if(!this.opacities[V]){const ee=new ht(W,b,!1,!1);ee.isHidden()||(this.opacities[V]=ee,g=g||W.text.placed||W.icon.placed)}}for(const V in z)this.variableOffsets[V]||!this.opacities[V]||this.opacities[V].isHidden()||(this.variableOffsets[V]=z[V]);for(const V in $)this.placedOrientations[V]||!this.opacities[V]||this.opacities[V].isHidden()||(this.placedOrientations[V]=$[V]);if(h&&h.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");g?this.lastPlacementChangeTime=l:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:l)}updateLayerOpacities(l,h){const g={};for(const b of h){const P=b.getBucket(l);P&&b.latestFeatureIndex&&l.id===P.layerIds[0]&&this.updateBucketOpacities(P,g,b.collisionBoxArray)}}updateBucketOpacities(l,h,g){l.hasTextData()&&l.text.opacityVertexArray.clear(),l.hasIconData()&&l.icon.opacityVertexArray.clear(),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexArray.clear(),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexArray.clear();const b=l.layers[0].layout,P=new ht(null,0,!1,!1,!0),z=b.get("text-allow-overlap"),$=b.get("icon-allow-overlap"),V=b.get("text-variable-anchor"),W=b.get("text-rotation-alignment")==="map",ee=b.get("text-pitch-alignment")==="map",ie=b.get("icon-text-fit")!=="none",fe=new ht(null,0,z&&($||!l.hasIconData()||b.get("icon-optional")),$&&(z||!l.hasTextData()||b.get("text-optional")),!0);!l.collisionArrays&&g&&(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData())&&l.deserializeCollisionBoxes(g);const Se=(_e,we,$e)=>{for(let Ue=0;Ue0,rt=this.placedOrientations[we.crossTileID],gt=rt===o.WritingMode.vertical,yt=rt===o.WritingMode.horizontal||rt===o.WritingMode.horizontalOnly;if($e>0||Ue>0){const zt=Ae(Pe.text);Se(l.text,$e,gt?He:zt),Se(l.text,Ue,yt?He:zt);const vt=Pe.text.isHidden();[we.rightJustifiedTextSymbolIndex,we.centerJustifiedTextSymbolIndex,we.leftJustifiedTextSymbolIndex].forEach(sr=>{sr>=0&&(l.text.placedSymbolArray.get(sr).hidden=vt||gt?1:0)}),we.verticalPlacedTextSymbolIndex>=0&&(l.text.placedSymbolArray.get(we.verticalPlacedTextSymbolIndex).hidden=vt||yt?1:0);const nr=this.variableOffsets[we.crossTileID];nr&&this.markUsedJustification(l,nr.anchor,we,rt);const Gt=this.placedOrientations[we.crossTileID];Gt&&(this.markUsedJustification(l,"left",we,Gt),this.markUsedOrientation(l,Gt,we))}if(at){const zt=Ae(Pe.icon),vt=!(ie&&we.verticalPlacedIconSymbolIndex&>);we.placedIconSymbolIndex>=0&&(Se(l.icon,we.numIconVertices,vt?zt:He),l.icon.placedSymbolArray.get(we.placedIconSymbolIndex).hidden=Pe.icon.isHidden()),we.verticalPlacedIconSymbolIndex>=0&&(Se(l.icon,we.numVerticalIconVertices,vt?He:zt),l.icon.placedSymbolArray.get(we.verticalPlacedIconSymbolIndex).hidden=Pe.icon.isHidden())}if(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData()){const zt=l.collisionArrays[_e];if(zt){let vt=new o.pointGeometry(0,0);if(zt.textBox||zt.verticalTextBox){let Gt=!0;if(V){const sr=this.variableOffsets[et];sr?(vt=Wr(sr.anchor,sr.width,sr.height,sr.textOffset,sr.textBoxScale),W&&vt._rotate(ee?this.transform.angle:-this.transform.angle)):Gt=!1}zt.textBox&&K(l.textCollisionBox.collisionVertexArray,Pe.text.placed,!Gt||gt,vt.x,vt.y),zt.verticalTextBox&&K(l.textCollisionBox.collisionVertexArray,Pe.text.placed,!Gt||yt,vt.x,vt.y)}const nr=Boolean(!yt&&zt.verticalIconBox);zt.iconBox&&K(l.iconCollisionBox.collisionVertexArray,Pe.icon.placed,nr,ie?vt.x:0,ie?vt.y:0),zt.verticalIconBox&&K(l.iconCollisionBox.collisionVertexArray,Pe.icon.placed,!nr,ie?vt.x:0,ie?vt.y:0)}}}if(l.sortFeatures(this.transform.angle),this.retainedQueryData[l.bucketInstanceId]&&(this.retainedQueryData[l.bucketInstanceId].featureSortOrder=l.featureSortOrder),l.hasTextData()&&l.text.opacityVertexBuffer&&l.text.opacityVertexBuffer.updateData(l.text.opacityVertexArray),l.hasIconData()&&l.icon.opacityVertexBuffer&&l.icon.opacityVertexBuffer.updateData(l.icon.opacityVertexArray),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexBuffer&&l.iconCollisionBox.collisionVertexBuffer.updateData(l.iconCollisionBox.collisionVertexArray),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexBuffer&&l.textCollisionBox.collisionVertexBuffer.updateData(l.textCollisionBox.collisionVertexArray),l.text.opacityVertexArray.length!==l.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${l.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${l.text.layoutVertexArray.length}) / 4`);if(l.icon.opacityVertexArray.length!==l.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${l.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${l.icon.layoutVertexArray.length}) / 4`);if(l.bucketInstanceId in this.collisionCircleArrays){const _e=this.collisionCircleArrays[l.bucketInstanceId];l.placementInvProjMatrix=_e.invProjMatrix,l.placementViewportMatrix=_e.viewportMatrix,l.collisionCircleArray=_e.circles,delete this.collisionCircleArrays[l.bucketInstanceId]}}symbolFadeChange(l){return this.fadeDuration===0?1:(l-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(l){return Math.max(0,(this.transform.zoom-l)/1.5)}hasTransitions(l){return this.stale||l-this.lastPlacementChangeTimel}setStale(){this.stale=!0}}function K(x,l,h,g,b){x.emplaceBack(l?1:0,h?1:0,g||0,b||0),x.emplaceBack(l?1:0,h?1:0,g||0,b||0),x.emplaceBack(l?1:0,h?1:0,g||0,b||0),x.emplaceBack(l?1:0,h?1:0,g||0,b||0)}const q=Math.pow(2,25),ce=Math.pow(2,24),ae=Math.pow(2,17),xe=Math.pow(2,16),Ee=Math.pow(2,9),be=Math.pow(2,8),Ce=Math.pow(2,1);function Ae(x){if(x.opacity===0&&!x.placed)return 0;if(x.opacity===1&&x.placed)return 4294967295;const l=x.placed?1:0,h=Math.floor(127*x.opacity);return h*q+l*ce+h*ae+l*xe+h*Ee+l*be+h*Ce+l}const He=0;class We{constructor(l){this._sortAcrossTiles=l.layout.get("symbol-z-order")!=="viewport-y"&&!l.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(l,h,g,b,P){const z=this._bucketParts;for(;this._currentTileIndex$.sortKey-V.sortKey));this._currentPartIndex{const z=o.exported.now()-b;return!this._forceFullPlacement&&z>2};for(;this._currentPlacementIndex>=0;){const z=h[l[this._currentPlacementIndex]],$=this.placement.collisionIndex.transform.zoom;if(z.type==="symbol"&&(!z.minzoom||z.minzoom<=$)&&(!z.maxzoom||z.maxzoom>$)){if(this._inProgressLayer||(this._inProgressLayer=new We(z)),this._inProgressLayer.continuePlacement(g[z.source],this.placement,this._showCollisionBoxes,z,P))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(l){return this.placement.commit(l),this.placement}}const At=512/o.EXTENT/2;class bt{constructor(l,h,g){this.tileID=l,this.indexedSymbolInstances={},this.bucketInstanceId=g;for(let b=0;bl.overscaledZ)for(const $ in z){const V=z[$];V.tileID.isChildOf(l)&&V.findMatches(h.symbolInstances,l,b)}else{const $=z[l.scaledTo(Number(P)).key];$&&$.findMatches(h.symbolInstances,l,b)}}for(let P=0;P{h[g]=!0});for(const g in this.layerIndexes)h[g]||delete this.layerIndexes[g]}}var vr=o.createLayout([{name:"a_pos",type:"Int16",components:2}]);class ir extends o.Evented{constructor(l){super(),this.sourceCache=l,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.renderHistory=[],this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,this.renderHistorySize=l._cache.max,l.usedForTerrain=!0,l.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null;for(const l in this._tiles){const h=this._tiles[l];h.textures.forEach(g=>g.destroy()),h.textures=[]}}update(l,h){this.sourceCache.update(l,h),this._renderableTilesKeys=[];for(const g of l.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))this._renderableTilesKeys.push(g.key),this._tiles[g.key]||(g.posMatrix=new Float64Array(16),o.ortho(g.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),this._tiles[g.key]=new De(g,this.tileSize))}removeOutdated(l){const h={};this.renderHistory=this.renderHistory.filter((g,b)=>this.renderHistory.indexOf(g)===b).slice(0,this.renderHistorySize);for(const g of this._renderableTilesKeys)h[g]=!0;for(const g of this.renderHistory)h[g]=!0;for(const g in this._tiles)h[g]||(this._tiles[g].clearTextures(l),delete this._tiles[g])}getRenderableTiles(){return this._renderableTilesKeys.map(l=>this.getTileByID(l))}getTileByID(l){return this._tiles[l]}getTerrainCoords(l){const h={};for(const g of this._renderableTilesKeys){const b=this._tiles[g].tileID;if(b.canonical.equals(l.canonical)){const P=l.clone();P.posMatrix=new Float64Array(16),o.ortho(P.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),h[g]=P}else if(b.canonical.isChildOf(l.canonical)){const P=l.clone();P.posMatrix=new Float64Array(16);const z=b.canonical.z-l.canonical.z,$=b.canonical.x-(b.canonical.x>>z<>z<>z;o.ortho(P.posMatrix,0,W,0,W,0,1),o.translate(P.posMatrix,P.posMatrix,[-$*W,-V*W,0]),h[g]=P}else if(l.canonical.isChildOf(b.canonical)){const P=l.clone();P.posMatrix=new Float64Array(16);const z=l.canonical.z-b.canonical.z,$=l.canonical.x-(l.canonical.x>>z<>z<>z;o.ortho(P.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),o.translate(P.posMatrix,P.posMatrix,[$*W,V*W,0]),o.scale(P.posMatrix,P.posMatrix,[1/2**z,1/2**z,0]),h[g]=P}}return h}getSourceTile(l,h){const g=this.sourceCache._source;let b=l.overscaledZ-this.deltaZoom;if(b>g.maxzoom&&(b=g.maxzoom),b=g.minzoom&&(!P||!P.dem);)P=this.sourceCache.getTileByID(l.scaledTo(b--).key);return P}tilesAfterTime(l=Date.now()){return Object.values(this._tiles).filter(h=>h.timeLoaded>=l)}}class gr{constructor(l,h,g){this.style=l,this.sourceCache=new ir(h),this.options=g,this.exaggeration=typeof g.exaggeration=="number"?g.exaggeration:1,this.elevationOffset=typeof g.elevationOffset=="number"?g.elevationOffset:450,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}getDEMElevation(l,h,g,b=o.EXTENT){if(!(h>=0&&h=0&&gl.canonical.z&&(l.canonical.z>=b?P=l.canonical.z-b:o.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const z=l.canonical.x-(l.canonical.x>>P<>P<>8<<4|P>>8,h[z+3]=0;const g=new o.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),b=new R(l,g,l.gl.RGBA,{premultiply:!1});return b.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._coordsTexture=b,b}pointCoordinate(l){const h=new Uint8Array(4),g=this.style.map.painter,b=g.context,P=b.gl;b.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),P.readPixels(l.x,g.height/devicePixelRatio-l.y-1,1,1,P.RGBA,P.UNSIGNED_BYTE,h),b.bindFramebuffer.set(null);const z=h[0]+(h[2]>>4<<8),$=h[1]+((15&h[2])<<8),V=this.coordsIndex[255-h[3]],W=V&&this.sourceCache.getTileByID(V);if(!W)return null;const ee=this._coordsTextureSize,ie=(1<o.emitValidationErrors(x,l&&l.filter(h=>h.identifier!=="source.canvas")),Qr=o.pick(lt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),$n=o.pick(lt,["setCenter","setZoom","setBearing","setPitch"]),on=function(){const x={},l=o.spec.$version;for(const h in o.spec.$root){const g=o.spec.$root[h];if(g.required){let b=null;b=h==="version"?l:g.type==="array"?[]:{},b!=null&&(x[h]=b)}}return x}();class Rn extends o.Evented{constructor(l,h={}){super(),this.map=l,this.dispatcher=new Y(It(),this),this.imageManager=new I,this.imageManager.setEventedParent(this),this.glyphManager=new B(l._requestManager,h.localIdeographFontFamily),this.lineAtlas=new te(256,512),this.crossTileSymbolIndex=new Bt,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new o.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",o.getReferrer());const g=this;this._rtlTextPluginCallback=Rn.registerForPluginStateChange(b=>{g.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:b.pluginStatus,pluginURL:b.pluginURL},(P,z)=>{if(o.triggerPluginCompletionEvent(P),z&&z.every($=>$))for(const $ in g.sourceCaches)g.sourceCaches[$].reload()})}),this.on("data",b=>{if(b.dataType!=="source"||b.sourceDataType!=="metadata")return;const P=this.sourceCaches[b.sourceId];if(!P)return;const z=P.getSource();if(z&&z.vectorLayerIds)for(const $ in this._layers){const V=this._layers[$];V.source===z.id&&this._validateLayer(V)}})}loadURL(l,h={}){this.fire(new o.Event("dataloading",{dataType:"style"}));const g=typeof h.validate!="boolean"||h.validate,b=this.map._requestManager.transformRequest(l,o.ResourceType.Style);this._request=o.getJSON(b,(P,z)=>{this._request=null,P?this.fire(new o.ErrorEvent(P)):z&&this._load(z,g)})}loadJSON(l,h={}){this.fire(new o.Event("dataloading",{dataType:"style"})),this._request=o.exported.frame(()=>{this._request=null,this._load(l,h.validate!==!1)})}loadEmpty(){this.fire(new o.Event("dataloading",{dataType:"style"})),this._load(on,!1)}_load(l,h){if(h&&$r(this,o.validateStyle(l)))return;this._loaded=!0,this.stylesheet=l;for(const b in l.sources)this.addSource(b,l.sources[b],{validate:!1});l.sprite?this._loadSprite(l.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(l.glyphs);const g=Dt(this.stylesheet.layers);this._order=g.map(b=>b.id),this._layers={},this._serializedLayers={};for(let b of g)b=o.createStyleLayer(b),b.setEventedParent(this,{layer:{id:b.id}}),this._layers[b.id]=b,this._serializedLayers[b.id]=b.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new H(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new o.Event("data",{dataType:"style"})),this.fire(new o.Event("style.load"))}_loadSprite(l){this._spriteRequest=function(h,g,b,P){let z,$,V;const W=b>1?"@2x":"";let ee=o.getJSON(g.transformRequest(g.normalizeSpriteURL(h,W,".json"),o.ResourceType.SpriteJSON),(Se,_e)=>{ee=null,V||(V=Se,z=_e,fe())}),ie=o.getImage(g.transformRequest(g.normalizeSpriteURL(h,W,".png"),o.ResourceType.SpriteImage),(Se,_e)=>{ie=null,V||(V=Se,$=_e,fe())});function fe(){if(V)P(V);else if(z&&$){const Se=o.exported.getImageData($),_e={};for(const we in z){const{width:$e,height:Ue,x:et,y:Pe,sdf:at,pixelRatio:rt,stretchX:gt,stretchY:yt,content:zt}=z[we],vt=new o.RGBAImage({width:$e,height:Ue});o.RGBAImage.copy(Se,vt,{x:et,y:Pe},{x:0,y:0},{width:$e,height:Ue}),_e[we]={data:vt,pixelRatio:rt,sdf:at,stretchX:gt,stretchY:yt,content:zt}}P(null,_e)}}return{cancel(){ee&&(ee.cancel(),ee=null),ie&&(ie.cancel(),ie=null)}}}(l,this.map._requestManager,this.map.getPixelRatio(),(h,g)=>{if(this._spriteRequest=null,h)this.fire(new o.ErrorEvent(h));else if(g)for(const b in g)this.imageManager.addImage(b,g[b]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))})}_validateLayer(l){const h=this.sourceCaches[l.source];if(!h)return;const g=l.sourceLayer;if(!g)return;const b=h.getSource();(b.type==="geojson"||b.vectorLayerIds&&b.vectorLayerIds.indexOf(g)===-1)&&this.fire(new o.ErrorEvent(new Error(`Source layer "${g}" does not exist on source "${b.id}" as specified by style layer "${l.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const l in this.sourceCaches)if(!this.sourceCaches[l].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(l){const h=[];for(const g of l){const b=this._layers[g];b.type!=="custom"&&h.push(b.serialize())}return h}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const l in this.sourceCaches)if(this.sourceCaches[l].hasTransition())return!0;for(const l in this._layers)if(this._layers[l].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(l){if(!this._loaded)return;const h=this._changed;if(this._changed){const b=Object.keys(this._updatedLayers),P=Object.keys(this._removedLayers);(b.length||P.length)&&this._updateWorkerLayers(b,P);for(const z in this._updatedSources){const $=this._updatedSources[z];if($==="reload")this._reloadSource(z);else{if($!=="clear")throw new Error(`Invalid action ${$}`);this._clearSource(z)}}this._updateTilesForChangedImages();for(const z in this._updatedPaintProps)this._layers[z].updateTransitions(l);this.light.updateTransitions(l),this._resetUpdates()}const g={};for(const b in this.sourceCaches){const P=this.sourceCaches[b];g[b]=P.used,P.used=!1}for(const b of this._order){const P=this._layers[b];P.recalculate(l,this._availableImages),!P.isHidden(l.zoom)&&P.source&&(this.sourceCaches[P.source].used=!0)}for(const b in g){const P=this.sourceCaches[b];g[b]!==P.used&&P.fire(new o.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:b}))}this.light.recalculate(l),this.z=l.zoom,h&&this.fire(new o.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const l=Object.keys(this._changedImages);if(l.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],l);this._changedImages={}}}_updateWorkerLayers(l,h){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(l),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setTerrain(l){if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),l){const h=this.sourceCaches[l.source];if(!h)throw new Error(`cannot load terrain, because there exists no source with ID: ${l.source}`);this.terrain=new gr(this,h,l),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=g=>{g.freeze?this.map.transform.freezeElevation=!0:(this.map.transform.freezeElevation=!1,this.map.transform.recalculateZoom(this.terrain))},this._terrainDataCallback=g=>{g.tile&&(g.sourceId===l.source?(this.map.transform.updateElevation(this.terrain),this.terrain.rememberForRerender(g.sourceId,g.tile.tileID)):g.source.type==="geojson"&&this.terrain.rememberForRerender(g.sourceId,g.tile.tileID))},this.on("data",this._terrainDataCallback),this.map.on("freezeElevation",this._terrainfreezeElevationCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.map.transform.updateElevation(this.terrain);this.map.fire(new o.Event("terrain",{terrain:l}))}setState(l){if(this._checkLoaded(),$r(this,o.validateStyle(l)))return!1;(l=o.clone$1(l)).layers=Dt(l.layers);const h=function(b,P){if(!b)return[{command:lt.setStyle,args:[P]}];let z=[];try{if(!y(b.version,P.version))return[{command:lt.setStyle,args:[P]}];y(b.center,P.center)||z.push({command:lt.setCenter,args:[P.center]}),y(b.zoom,P.zoom)||z.push({command:lt.setZoom,args:[P.zoom]}),y(b.bearing,P.bearing)||z.push({command:lt.setBearing,args:[P.bearing]}),y(b.pitch,P.pitch)||z.push({command:lt.setPitch,args:[P.pitch]}),y(b.sprite,P.sprite)||z.push({command:lt.setSprite,args:[P.sprite]}),y(b.glyphs,P.glyphs)||z.push({command:lt.setGlyphs,args:[P.glyphs]}),y(b.transition,P.transition)||z.push({command:lt.setTransition,args:[P.transition]}),y(b.light,P.light)||z.push({command:lt.setLight,args:[P.light]});const $={},V=[];(function(ee,ie,fe,Se){let _e;for(_e in ie=ie||{},ee=ee||{})Object.prototype.hasOwnProperty.call(ee,_e)&&(Object.prototype.hasOwnProperty.call(ie,_e)||ut(_e,fe,Se));for(_e in ie)Object.prototype.hasOwnProperty.call(ie,_e)&&(Object.prototype.hasOwnProperty.call(ee,_e)?y(ee[_e],ie[_e])||(ee[_e].type==="geojson"&&ie[_e].type==="geojson"&&ft(ee,ie,_e)?fe.push({command:lt.setGeoJSONSourceData,args:[_e,ie[_e].data]}):it(_e,ie,fe,Se)):dt(_e,ie,fe))})(b.sources,P.sources,V,$);const W=[];b.layers&&b.layers.forEach(ee=>{$[ee.source]?z.push({command:lt.removeLayer,args:[ee.id]}):W.push(ee)}),z=z.concat(V),function(ee,ie,fe){ie=ie||[];const Se=(ee=ee||[]).map(Wt),_e=ie.map(Wt),we=ee.reduce(jt,{}),$e=ie.reduce(jt,{}),Ue=Se.slice(),et=Object.create(null);let Pe,at,rt,gt,yt,zt,vt;for(Pe=0,at=0;Pe!(b.command in $n));if(h.length===0)return!1;const g=h.filter(b=>!(b.command in Qr));if(g.length>0)throw new Error(`Unimplemented: ${g.map(b=>b.command).join(", ")}.`);return h.forEach(b=>{b.command!=="setTransition"&&this[b.command].apply(this,b.args)}),this.stylesheet=l,!0}addImage(l,h){if(this.getImage(l))return this.fire(new o.ErrorEvent(new Error(`An image named "${l}" already exists.`)));this.imageManager.addImage(l,h),this._afterImageUpdated(l)}updateImage(l,h){this.imageManager.updateImage(l,h)}getImage(l){return this.imageManager.getImage(l)}removeImage(l){if(!this.getImage(l))return this.fire(new o.ErrorEvent(new Error(`An image named "${l}" does not exist.`)));this.imageManager.removeImage(l),this._afterImageUpdated(l)}_afterImageUpdated(l){this._availableImages=this.imageManager.listImages(),this._changedImages[l]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(l,h,g={}){if(this._checkLoaded(),this.sourceCaches[l]!==void 0)throw new Error(`Source "${l}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(o.validateStyle.source,`sources.${l}`,h,null,g))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const b=this.sourceCaches[l]=new je(l,h,this.dispatcher);b.style=this,b.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:b.serialize(),sourceId:l})),b.onAdd(this.map),this._changed=!0}removeSource(l){if(this._checkLoaded(),this.sourceCaches[l]===void 0)throw new Error("There is no source with this ID");for(const g in this._layers)if(this._layers[g].source===l)return this.fire(new o.ErrorEvent(new Error(`Source "${l}" cannot be removed while layer "${g}" is using it.`)));const h=this.sourceCaches[l];delete this.sourceCaches[l],delete this._updatedSources[l],h.fire(new o.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:l})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(l,h){if(this._checkLoaded(),this.sourceCaches[l]===void 0)throw new Error(`There is no source with this ID=${l}`);const g=this.sourceCaches[l].getSource();if(g.type!=="geojson")throw new Error(`geojsonSource.type is ${g.type}, which is !== 'geojson`);g.setData(h),this._changed=!0}getSource(l){return this.sourceCaches[l]&&this.sourceCaches[l].getSource()}addLayer(l,h,g={}){this._checkLoaded();const b=l.id;if(this.getLayer(b))return void this.fire(new o.ErrorEvent(new Error(`Layer "${b}" already exists on this map.`)));let P;if(l.type==="custom"){if($r(this,o.validateCustomStyleLayer(l)))return;P=o.createStyleLayer(l)}else{if(typeof l.source=="object"&&(this.addSource(b,l.source),l=o.clone$1(l),l=o.extend(l,{source:b})),this._validate(o.validateStyle.layer,`layers.${b}`,l,{arrayIndex:-1},g))return;P=o.createStyleLayer(l),this._validateLayer(P),P.setEventedParent(this,{layer:{id:b}}),this._serializedLayers[P.id]=P.serialize()}const z=h?this._order.indexOf(h):this._order.length;if(h&&z===-1)this.fire(new o.ErrorEvent(new Error(`Cannot add layer "${b}" before non-existing layer "${h}".`)));else{if(this._order.splice(z,0,b),this._layerOrderChanged=!0,this._layers[b]=P,this._removedLayers[b]&&P.source&&P.type!=="custom"){const $=this._removedLayers[b];delete this._removedLayers[b],$.type!==P.type?this._updatedSources[P.source]="clear":(this._updatedSources[P.source]="reload",this.sourceCaches[P.source].pause())}this._updateLayer(P),P.onAdd&&P.onAdd(this.map)}}moveLayer(l,h){if(this._checkLoaded(),this._changed=!0,!this._layers[l])return void this.fire(new o.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style and cannot be moved.`)));if(l===h)return;const g=this._order.indexOf(l);this._order.splice(g,1);const b=h?this._order.indexOf(h):this._order.length;h&&b===-1?this.fire(new o.ErrorEvent(new Error(`Cannot move layer "${l}" before non-existing layer "${h}".`))):(this._order.splice(b,0,l),this._layerOrderChanged=!0)}removeLayer(l){this._checkLoaded();const h=this._layers[l];if(!h)return void this.fire(new o.ErrorEvent(new Error(`Cannot remove non-existing layer "${l}".`)));h.setEventedParent(null);const g=this._order.indexOf(l);this._order.splice(g,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[l]=h,delete this._layers[l],delete this._serializedLayers[l],delete this._updatedLayers[l],delete this._updatedPaintProps[l],h.onRemove&&h.onRemove(this.map)}getLayer(l){return this._layers[l]}hasLayer(l){return l in this._layers}setLayerZoomRange(l,h,g){this._checkLoaded();const b=this.getLayer(l);b?b.minzoom===h&&b.maxzoom===g||(h!=null&&(b.minzoom=h),g!=null&&(b.maxzoom=g),this._updateLayer(b)):this.fire(new o.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${l}".`)))}setFilter(l,h,g={}){this._checkLoaded();const b=this.getLayer(l);if(b){if(!y(b.filter,h))return h==null?(b.filter=void 0,void this._updateLayer(b)):void(this._validate(o.validateStyle.filter,`layers.${b.id}.filter`,h,null,g)||(b.filter=o.clone$1(h),this._updateLayer(b)))}else this.fire(new o.ErrorEvent(new Error(`Cannot filter non-existing layer "${l}".`)))}getFilter(l){return o.clone$1(this.getLayer(l).filter)}setLayoutProperty(l,h,g,b={}){this._checkLoaded();const P=this.getLayer(l);P?y(P.getLayoutProperty(h),g)||(P.setLayoutProperty(h,g,b),this._updateLayer(P)):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${l}".`)))}getLayoutProperty(l,h){const g=this.getLayer(l);if(g)return g.getLayoutProperty(h);this.fire(new o.ErrorEvent(new Error(`Cannot get style of non-existing layer "${l}".`)))}setPaintProperty(l,h,g,b={}){this._checkLoaded();const P=this.getLayer(l);P?y(P.getPaintProperty(h),g)||(P.setPaintProperty(h,g,b)&&this._updateLayer(P),this._changed=!0,this._updatedPaintProps[l]=!0):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${l}".`)))}getPaintProperty(l,h){return this.getLayer(l).getPaintProperty(h)}setFeatureState(l,h){this._checkLoaded();const g=l.source,b=l.sourceLayer,P=this.sourceCaches[g];if(P===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`)));const z=P.getSource().type;z==="geojson"&&b?this.fire(new o.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):z!=="vector"||b?(l.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),P.setFeatureState(b,l.id,h)):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(l,h){this._checkLoaded();const g=l.source,b=this.sourceCaches[g];if(b===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`)));const P=b.getSource().type,z=P==="vector"?l.sourceLayer:void 0;P!=="vector"||z?h&&typeof l.id!="string"&&typeof l.id!="number"?this.fire(new o.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):b.removeFeatureState(z,l.id,h):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(l){this._checkLoaded();const h=l.source,g=l.sourceLayer,b=this.sourceCaches[h];if(b!==void 0)return b.getSource().type!=="vector"||g?(l.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),b.getFeatureState(g,l.id)):void this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new o.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return o.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return o.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:o.mapObject(this.sourceCaches,l=>l.serialize()),layers:this._serializeLayers(this._order)},l=>l!==void 0)}_updateLayer(l){this._updatedLayers[l.id]=!0,l.source&&!this._updatedSources[l.source]&&this.sourceCaches[l.source].getSource().type!=="raster"&&(this._updatedSources[l.source]="reload",this.sourceCaches[l.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(l){const h=z=>this._layers[z].type==="fill-extrusion",g={},b=[];for(let z=this._order.length-1;z>=0;z--){const $=this._order[z];if(h($)){g[$]=z;for(const V of l){const W=V[$];if(W)for(const ee of W)b.push(ee)}}}b.sort((z,$)=>$.intersectionZ-z.intersectionZ);const P=[];for(let z=this._order.length-1;z>=0;z--){const $=this._order[z];if(h($))for(let V=b.length-1;V>=0;V--){const W=b[V].feature;if(g[W.layer.id]{const yt=$e.featureSortOrder;if(yt){const zt=yt.indexOf(rt.featureIndex);return yt.indexOf(gt.featureIndex)-zt}return gt.featureIndex-rt.featureIndex});for(const rt of at)Pe.push(rt)}}for(const $e in Se)Se[$e].forEach(Ue=>{const et=Ue.feature,Pe=V[z[$e].source].getFeatureState(et.layer["source-layer"],et.id);et.source=et.layer.source,et.layer["source-layer"]&&(et.sourceLayer=et.layer["source-layer"]),et.state=Pe});return Se}(this._layers,this._serializedLayers,this.sourceCaches,l,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(P)}querySourceFeatures(l,h){h&&h.filter&&this._validate(o.validateStyle.filter,"querySourceFeatures.filter",h.filter,null,h);const g=this.sourceCaches[l];return g?function(b,P){const z=b.getRenderableIds().map(W=>b.getTileByID(W)),$=[],V={};for(let W=0;Wfe.getTileByID(Se)).sort((Se,_e)=>_e.tileID.overscaledZ-Se.tileID.overscaledZ||(Se.tileID.isLessThan(_e.tileID)?-1:1))}const ie=this.crossTileSymbolIndex.addLayer(ee,V[ee.source],l.center.lng);z=z||ie}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((P=P||this._layerOrderChanged||g===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.exported.now(),l.zoom))&&(this.pauseablePlacement=new Be(l,this.terrain,this._order,P,h,g,b,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,V),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.exported.now()),$=!0),z&&this.pauseablePlacement.placement.setStale()),$||z)for(const W of this._order){const ee=this._layers[W];ee.type==="symbol"&&this.placement.updateLayerOpacities(ee,V[ee.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.exported.now())}_releaseSymbolFadeTiles(){for(const l in this.sourceCaches)this.sourceCaches[l].releaseSymbolFadeTiles()}getImages(l,h,g){this.imageManager.getImages(h.icons,g),this._updateTilesForChangedImages();const b=this.sourceCaches[h.source];b&&b.setDependencies(h.tileID.key,h.type,h.icons)}getGlyphs(l,h,g){this.glyphManager.getGlyphs(h.stacks,g)}getResource(l,h,g){return o.makeRequest(h,g)}}Rn.getSourceType=function(x){return ke[x]},Rn.setSourceType=function(x,l){ke[x]=l},Rn.registerForPluginStateChange=o.registerForPluginStateChange;var Tr="attribute vec2 a_pos;uniform mat4 u_matrix;varying vec2 v_texture_pos;varying float v_depth;void main() {v_texture_pos=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);v_depth=gl_Position.z/gl_Position.w;}";const Cr={prelude:Ir(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif`,`#ifdef GL_ES precision highp float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 );}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} #ifdef TERRAIN3D uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_offset;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; #endif const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { #ifdef TERRAIN3D highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); #else return 1.0; #endif }float calculate_visibility(vec4 pos) { #ifdef TERRAIN3D vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; #else return 1.0; #endif }float ele(vec2 pos) { #ifdef TERRAIN3D vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; #else return 0.0; #endif }float get_elevation(vec2 pos) { #ifdef TERRAIN3D vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return (elevation+u_terrain_offset)*u_terrain_exaggeration; #else return 0.0; #endif }`),background:Ir(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Ir(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Ir(`varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main(void) { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Ir("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Ir(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { #pragma mapbox: initialize highp float weight float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; #pragma mapbox: define highp float weight #pragma mapbox: define mediump float radius const highp float ZERO=1.0/255.0/16.0; #define GAUSS_COEF 0.3989422804014327 void main(void) { #pragma mapbox: initialize highp float weight #pragma mapbox: initialize mediump float radius vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Ir(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(0.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Ir("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ir("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Ir("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Ir(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_FragColor=color*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Ir(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Ir(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Ir(`#ifdef GL_ES precision highp float; #endif uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Ir(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec4 v_color; #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp vec4 color void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp vec4 color vec3 normal=a_normal_ed.xyz; #ifdef TERRAIN3D float baseDelta=10.0;float ele=get_elevation(a_centroid); #else float baseDelta=0.0;float ele=0.0; #endif base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Ir(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; #ifdef TERRAIN3D float baseDelta=10.0;float ele=get_elevation(a_centroid); #else float baseDelta=0.0;float ele=0.0; #endif base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Ir(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Ir(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Ir(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),lineGradient:Ir(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),linePattern:Ir(`#ifdef GL_ES precision highp float; #endif uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float gapwidth #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ir(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Ir(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Ir(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Ir(`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Ir(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Ir("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Tr),terrainDepth:Ir("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Tr),terrainCoords:Ir("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Tr)};function Ir(x,l){const h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,g=l.match(/attribute ([\w]+) ([\w]+)/g),b=x.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),P=l.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),z=P?P.concat(b):b,$={};return{fragmentSource:x=x.replace(h,(V,W,ee,ie,fe)=>($[fe]=!0,W==="define"?` #ifndef HAS_UNIFORM_u_${fe} varying ${ee} ${ie} ${fe}; #else uniform ${ee} ${ie} u_${fe}; #endif `:` #ifdef HAS_UNIFORM_u_${fe} ${ee} ${ie} ${fe} = u_${fe}; #endif `)),vertexSource:l=l.replace(h,(V,W,ee,ie,fe)=>{const Se=ie==="float"?"vec2":"vec4",_e=fe.match(/color/)?"color":Se;return $[fe]?W==="define"?` #ifndef HAS_UNIFORM_u_${fe} uniform lowp float u_${fe}_t; attribute ${ee} ${Se} a_${fe}; varying ${ee} ${ie} ${fe}; #else uniform ${ee} ${ie} u_${fe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${fe} ${fe} = a_${fe}; #else ${ee} ${ie} ${fe} = u_${fe}; #endif `:` #ifndef HAS_UNIFORM_u_${fe} ${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t); #else ${ee} ${ie} ${fe} = u_${fe}; #endif `:W==="define"?` #ifndef HAS_UNIFORM_u_${fe} uniform lowp float u_${fe}_t; attribute ${ee} ${Se} a_${fe}; #else uniform ${ee} ${ie} u_${fe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${fe} ${ee} ${ie} ${fe} = a_${fe}; #else ${ee} ${ie} ${fe} = u_${fe}; #endif `:` #ifndef HAS_UNIFORM_u_${fe} ${ee} ${ie} ${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t); #else ${ee} ${ie} ${fe} = u_${fe}; #endif `}),staticAttributes:g,staticUniforms:z}}class Jn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(l,h,g,b,P,z,$,V,W){this.context=l;let ee=this.boundPaintVertexBuffers.length!==b.length;for(let ie=0;!ee&&ie({u_depth:new o.Uniform1i(yt,zt.u_depth),u_terrain:new o.Uniform1i(yt,zt.u_terrain),u_terrain_dim:new o.Uniform1f(yt,zt.u_terrain_dim),u_terrain_matrix:new o.UniformMatrix4f(yt,zt.u_terrain_matrix),u_terrain_unpack:new o.Uniform4f(yt,zt.u_terrain_unpack),u_terrain_offset:new o.Uniform1f(yt,zt.u_terrain_offset),u_terrain_exaggeration:new o.Uniform1f(yt,zt.u_terrain_exaggeration)}))(l,gt),this.binderUniforms=b?b.getUniforms(l,gt):[]}draw(l,h,g,b,P,z,$,V,W,ee,ie,fe,Se,_e,we,$e,Ue,et){const Pe=l.gl;if(this.failedToCreate)return;if(l.program.set(this.program),l.setDepthMode(g),l.setStencilMode(b),l.setColorMode(P),l.setCullFace(z),V){l.activeTexture.set(Pe.TEXTURE2),Pe.bindTexture(Pe.TEXTURE_2D,V.depthTexture),l.activeTexture.set(Pe.TEXTURE3),Pe.bindTexture(Pe.TEXTURE_2D,V.texture);for(const rt in this.terrainUniforms)this.terrainUniforms[rt].set(V[rt])}for(const rt in this.fixedUniforms)this.fixedUniforms[rt].set($[rt]);we&&we.setUniforms(l,this.binderUniforms,Se,{zoom:_e});let at=0;switch(h){case Pe.LINES:at=2;break;case Pe.TRIANGLES:at=3;break;case Pe.LINE_STRIP:at=1}for(const rt of fe.get()){const gt=rt.vaos||(rt.vaos={});(gt[W]||(gt[W]=new Jn)).bind(l,this,ee,we?we.getPaintVertexBuffers():[],ie,rt.vertexOffset,$e,Ue,et),Pe.drawElements(h,rt.primitiveLength*at,Pe.UNSIGNED_SHORT,rt.primitiveOffset*at*2)}}}function zr(x,l,h){const g=1/Nt(h,1,l.transform.tileZoom),b=Math.pow(2,h.tileID.overscaledZ),P=h.tileSize*Math.pow(2,l.transform.tileZoom)/b,z=P*(h.tileID.canonical.x+h.tileID.wrap*b),$=P*h.tileID.canonical.y;return{u_image:0,u_texsize:h.imageAtlasTexture.size,u_scale:[g,x.fromScale,x.toScale],u_fade:x.t,u_pixel_coord_upper:[z>>16,$>>16],u_pixel_coord_lower:[65535&z,65535&$]}}const Xr=(x,l,h,g)=>{const b=l.style.light,P=b.properties.get("position"),z=[P.x,P.y,P.z],$=o.create$1();b.properties.get("anchor")==="viewport"&&o.fromRotation($,-l.transform.angle),o.transformMat3(z,z,$);const V=b.properties.get("color");return{u_matrix:x,u_lightpos:z,u_lightintensity:b.properties.get("intensity"),u_lightcolor:[V.r,V.g,V.b],u_vertical_gradient:+h,u_opacity:g}},bn=(x,l,h,g,b,P,z)=>o.extend(Xr(x,l,h,g),zr(P,l,z),{u_height_factor:-Math.pow(2,b.overscaledZ)/z.tileSize/8}),Cn=x=>({u_matrix:x}),Bn=(x,l,h,g)=>o.extend(Cn(x),zr(h,l,g)),bo=(x,l)=>({u_matrix:x,u_world:l}),Wl=(x,l,h,g,b)=>o.extend(Bn(x,l,h,g),{u_world:b}),Cd=(x,l,h,g)=>{const b=x.transform;let P,z;if(g.paint.get("circle-pitch-alignment")==="map"){const $=Nt(h,1,b.zoom);P=!0,z=[$,$]}else P=!1,z=b.pixelsToGLUnits;return{u_camera_to_center_distance:b.cameraToCenterDistance,u_scale_with_map:+(g.paint.get("circle-pitch-scale")==="map"),u_matrix:x.translatePosMatrix(l.posMatrix,h,g.paint.get("circle-translate"),g.paint.get("circle-translate-anchor")),u_pitch_with_map:+P,u_device_pixel_ratio:x.pixelRatio,u_extrude_scale:z}},Ya=(x,l,h)=>{const g=Nt(h,1,l.zoom),b=Math.pow(2,l.zoom-h.tileID.overscaledZ),P=h.tileID.overscaleFactor();return{u_matrix:x,u_camera_to_center_distance:l.cameraToCenterDistance,u_pixels_to_tile_units:g,u_extrude_scale:[l.pixelsToGLUnits[0]/(g*b),l.pixelsToGLUnits[1]/(g*b)],u_overscale_factor:P}},Dr=(x,l,h=1)=>({u_matrix:x,u_color:l,u_overlay:0,u_overlay_scale:h}),Gr=x=>({u_matrix:x}),On=(x,l,h,g)=>({u_matrix:x,u_extrude_scale:Nt(l,1,h),u_intensity:g});function Di(x,l){const h=Math.pow(2,l.canonical.z),g=l.canonical.y;return[new o.MercatorCoordinate(0,g/h).toLngLat().lat,new o.MercatorCoordinate(0,(g+1)/h).toLngLat().lat]}const Ss=(x,l,h,g)=>{const b=x.transform;return{u_matrix:Ja(x,l,h,g),u_ratio:1/Nt(l,1,b.zoom),u_device_pixel_ratio:x.pixelRatio,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},Vo=(x,l,h,g,b)=>o.extend(Ss(x,l,h,b),{u_image:0,u_image_height:g}),Js=(x,l,h,g,b)=>{const P=x.transform,z=yn(l,P);return{u_matrix:Ja(x,l,h,b),u_texsize:l.imageAtlasTexture.size,u_ratio:1/Nt(l,1,P.zoom),u_device_pixel_ratio:x.pixelRatio,u_image:0,u_scale:[z,g.fromScale,g.toScale],u_fade:g.t,u_units_to_pixels:[1/P.pixelsToGLUnits[0],1/P.pixelsToGLUnits[1]]}},Qa=(x,l,h,g,b,P)=>{const z=x.lineAtlas,$=yn(l,x.transform),V=h.layout.get("line-cap")==="round",W=z.getDash(g.from,V),ee=z.getDash(g.to,V),ie=W.width*b.fromScale,fe=ee.width*b.toScale;return o.extend(Ss(x,l,h,P),{u_patternscale_a:[$/ie,-W.height/2],u_patternscale_b:[$/fe,-ee.height/2],u_sdfgamma:z.width/(256*Math.min(ie,fe)*x.pixelRatio)/2,u_image:0,u_tex_y_a:W.y,u_tex_y_b:ee.y,u_mix:b.t})};function yn(x,l){return 1/Nt(x,1,l.tileZoom)}function Ja(x,l,h,g){return x.translatePosMatrix(g?g.posMatrix:l.tileID.posMatrix,l,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const Vv=(x,l,h,g,b)=>{return{u_matrix:x,u_tl_parent:l,u_scale_parent:h,u_buffer_scale:1,u_fade_t:g.mix,u_opacity:g.opacity*b.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:b.paint.get("raster-brightness-min"),u_brightness_high:b.paint.get("raster-brightness-max"),u_saturation_factor:(z=b.paint.get("raster-saturation"),z>0?1-1/(1.001-z):-z),u_contrast_factor:(P=b.paint.get("raster-contrast"),P>0?1/(1-P):1+P),u_spin_weights:jv(b.paint.get("raster-hue-rotate"))};var P,z};function jv(x){x*=Math.PI/180;const l=Math.sin(x),h=Math.cos(x);return[(2*h+1)/3,(-Math.sqrt(3)*l-h+1)/3,(Math.sqrt(3)*l-h+1)/3]}const Rh=(x,l,h,g,b,P,z,$,V,W)=>{const ee=b.transform;return{u_is_size_zoom_constant:+(x==="constant"||x==="source"),u_is_size_feature_constant:+(x==="constant"||x==="camera"),u_size_t:l?l.uSizeT:0,u_size:l?l.uSize:0,u_camera_to_center_distance:ee.cameraToCenterDistance,u_pitch:ee.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:ee.width/ee.height,u_fade_change:b.options.fadeDuration?b.symbolFadeChange:1,u_matrix:P,u_label_plane_matrix:z,u_coord_matrix:$,u_is_text:+V,u_pitch_with_map:+g,u_texsize:W,u_texture:0}},Sd=(x,l,h,g,b,P,z,$,V,W,ee)=>{const ie=b.transform;return o.extend(Rh(x,l,h,g,b,P,z,$,V,W),{u_gamma_scale:g?Math.cos(ie._pitch)*ie.cameraToCenterDistance:1,u_device_pixel_ratio:b.pixelRatio,u_is_halo:+ee})},Uv=(x,l,h,g,b,P,z,$,V,W)=>o.extend(Sd(x,l,h,g,b,P,z,$,!0,V,!0),{u_texsize_icon:W,u_texture_icon:1}),t_=(x,l,h)=>({u_matrix:x,u_opacity:l,u_color:h}),r_=(x,l,h,g,b,P)=>o.extend(function(z,$,V,W){const ee=V.imageManager.getPattern(z.from.toString()),ie=V.imageManager.getPattern(z.to.toString()),{width:fe,height:Se}=V.imageManager.getPixelSize(),_e=Math.pow(2,W.tileID.overscaledZ),we=W.tileSize*Math.pow(2,V.transform.tileZoom)/_e,$e=we*(W.tileID.canonical.x+W.tileID.wrap*_e),Ue=we*W.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ee.tl,u_pattern_br_a:ee.br,u_pattern_tl_b:ie.tl,u_pattern_br_b:ie.br,u_texsize:[fe,Se],u_mix:$.t,u_pattern_size_a:ee.displaySize,u_pattern_size_b:ie.displaySize,u_scale_a:$.fromScale,u_scale_b:$.toScale,u_tile_units_to_pixels:1/Nt(W,1,V.transform.tileZoom),u_pixel_coord_upper:[$e>>16,Ue>>16],u_pixel_coord_lower:[65535&$e,65535&Ue]}}(g,P,h,b),{u_matrix:x,u_opacity:l}),Oh={fillExtrusion:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_lightpos:new o.Uniform3f(x,l.u_lightpos),u_lightintensity:new o.Uniform1f(x,l.u_lightintensity),u_lightcolor:new o.Uniform3f(x,l.u_lightcolor),u_vertical_gradient:new o.Uniform1f(x,l.u_vertical_gradient),u_opacity:new o.Uniform1f(x,l.u_opacity)}),fillExtrusionPattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_lightpos:new o.Uniform3f(x,l.u_lightpos),u_lightintensity:new o.Uniform1f(x,l.u_lightintensity),u_lightcolor:new o.Uniform3f(x,l.u_lightcolor),u_vertical_gradient:new o.Uniform1f(x,l.u_vertical_gradient),u_height_factor:new o.Uniform1f(x,l.u_height_factor),u_image:new o.Uniform1i(x,l.u_image),u_texsize:new o.Uniform2f(x,l.u_texsize),u_pixel_coord_upper:new o.Uniform2f(x,l.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(x,l.u_pixel_coord_lower),u_scale:new o.Uniform3f(x,l.u_scale),u_fade:new o.Uniform1f(x,l.u_fade),u_opacity:new o.Uniform1f(x,l.u_opacity)}),fill:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),fillPattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_image:new o.Uniform1i(x,l.u_image),u_texsize:new o.Uniform2f(x,l.u_texsize),u_pixel_coord_upper:new o.Uniform2f(x,l.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(x,l.u_pixel_coord_lower),u_scale:new o.Uniform3f(x,l.u_scale),u_fade:new o.Uniform1f(x,l.u_fade)}),fillOutline:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_world:new o.Uniform2f(x,l.u_world)}),fillOutlinePattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_world:new o.Uniform2f(x,l.u_world),u_image:new o.Uniform1i(x,l.u_image),u_texsize:new o.Uniform2f(x,l.u_texsize),u_pixel_coord_upper:new o.Uniform2f(x,l.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(x,l.u_pixel_coord_lower),u_scale:new o.Uniform3f(x,l.u_scale),u_fade:new o.Uniform1f(x,l.u_fade)}),circle:(x,l)=>({u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_scale_with_map:new o.Uniform1i(x,l.u_scale_with_map),u_pitch_with_map:new o.Uniform1i(x,l.u_pitch_with_map),u_extrude_scale:new o.Uniform2f(x,l.u_extrude_scale),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),collisionBox:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_pixels_to_tile_units:new o.Uniform1f(x,l.u_pixels_to_tile_units),u_extrude_scale:new o.Uniform2f(x,l.u_extrude_scale),u_overscale_factor:new o.Uniform1f(x,l.u_overscale_factor)}),collisionCircle:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_inv_matrix:new o.UniformMatrix4f(x,l.u_inv_matrix),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_viewport_size:new o.Uniform2f(x,l.u_viewport_size)}),debug:(x,l)=>({u_color:new o.UniformColor(x,l.u_color),u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_overlay:new o.Uniform1i(x,l.u_overlay),u_overlay_scale:new o.Uniform1f(x,l.u_overlay_scale)}),clippingMask:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),heatmap:(x,l)=>({u_extrude_scale:new o.Uniform1f(x,l.u_extrude_scale),u_intensity:new o.Uniform1f(x,l.u_intensity),u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),heatmapTexture:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_world:new o.Uniform2f(x,l.u_world),u_image:new o.Uniform1i(x,l.u_image),u_color_ramp:new o.Uniform1i(x,l.u_color_ramp),u_opacity:new o.Uniform1f(x,l.u_opacity)}),hillshade:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_image:new o.Uniform1i(x,l.u_image),u_latrange:new o.Uniform2f(x,l.u_latrange),u_light:new o.Uniform2f(x,l.u_light),u_shadow:new o.UniformColor(x,l.u_shadow),u_highlight:new o.UniformColor(x,l.u_highlight),u_accent:new o.UniformColor(x,l.u_accent)}),hillshadePrepare:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_image:new o.Uniform1i(x,l.u_image),u_dimension:new o.Uniform2f(x,l.u_dimension),u_zoom:new o.Uniform1f(x,l.u_zoom),u_unpack:new o.Uniform4f(x,l.u_unpack)}),line:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_ratio:new o.Uniform1f(x,l.u_ratio),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(x,l.u_units_to_pixels)}),lineGradient:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_ratio:new o.Uniform1f(x,l.u_ratio),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(x,l.u_units_to_pixels),u_image:new o.Uniform1i(x,l.u_image),u_image_height:new o.Uniform1f(x,l.u_image_height)}),linePattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_texsize:new o.Uniform2f(x,l.u_texsize),u_ratio:new o.Uniform1f(x,l.u_ratio),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_image:new o.Uniform1i(x,l.u_image),u_units_to_pixels:new o.Uniform2f(x,l.u_units_to_pixels),u_scale:new o.Uniform3f(x,l.u_scale),u_fade:new o.Uniform1f(x,l.u_fade)}),lineSDF:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_ratio:new o.Uniform1f(x,l.u_ratio),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(x,l.u_units_to_pixels),u_patternscale_a:new o.Uniform2f(x,l.u_patternscale_a),u_patternscale_b:new o.Uniform2f(x,l.u_patternscale_b),u_sdfgamma:new o.Uniform1f(x,l.u_sdfgamma),u_image:new o.Uniform1i(x,l.u_image),u_tex_y_a:new o.Uniform1f(x,l.u_tex_y_a),u_tex_y_b:new o.Uniform1f(x,l.u_tex_y_b),u_mix:new o.Uniform1f(x,l.u_mix)}),raster:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_tl_parent:new o.Uniform2f(x,l.u_tl_parent),u_scale_parent:new o.Uniform1f(x,l.u_scale_parent),u_buffer_scale:new o.Uniform1f(x,l.u_buffer_scale),u_fade_t:new o.Uniform1f(x,l.u_fade_t),u_opacity:new o.Uniform1f(x,l.u_opacity),u_image0:new o.Uniform1i(x,l.u_image0),u_image1:new o.Uniform1i(x,l.u_image1),u_brightness_low:new o.Uniform1f(x,l.u_brightness_low),u_brightness_high:new o.Uniform1f(x,l.u_brightness_high),u_saturation_factor:new o.Uniform1f(x,l.u_saturation_factor),u_contrast_factor:new o.Uniform1f(x,l.u_contrast_factor),u_spin_weights:new o.Uniform3f(x,l.u_spin_weights)}),symbolIcon:(x,l)=>({u_is_size_zoom_constant:new o.Uniform1i(x,l.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(x,l.u_is_size_feature_constant),u_size_t:new o.Uniform1f(x,l.u_size_t),u_size:new o.Uniform1f(x,l.u_size),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_pitch:new o.Uniform1f(x,l.u_pitch),u_rotate_symbol:new o.Uniform1i(x,l.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(x,l.u_aspect_ratio),u_fade_change:new o.Uniform1f(x,l.u_fade_change),u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(x,l.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(x,l.u_coord_matrix),u_is_text:new o.Uniform1i(x,l.u_is_text),u_pitch_with_map:new o.Uniform1i(x,l.u_pitch_with_map),u_texsize:new o.Uniform2f(x,l.u_texsize),u_texture:new o.Uniform1i(x,l.u_texture)}),symbolSDF:(x,l)=>({u_is_size_zoom_constant:new o.Uniform1i(x,l.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(x,l.u_is_size_feature_constant),u_size_t:new o.Uniform1f(x,l.u_size_t),u_size:new o.Uniform1f(x,l.u_size),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_pitch:new o.Uniform1f(x,l.u_pitch),u_rotate_symbol:new o.Uniform1i(x,l.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(x,l.u_aspect_ratio),u_fade_change:new o.Uniform1f(x,l.u_fade_change),u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(x,l.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(x,l.u_coord_matrix),u_is_text:new o.Uniform1i(x,l.u_is_text),u_pitch_with_map:new o.Uniform1i(x,l.u_pitch_with_map),u_texsize:new o.Uniform2f(x,l.u_texsize),u_texture:new o.Uniform1i(x,l.u_texture),u_gamma_scale:new o.Uniform1f(x,l.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(x,l.u_is_halo)}),symbolTextAndIcon:(x,l)=>({u_is_size_zoom_constant:new o.Uniform1i(x,l.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(x,l.u_is_size_feature_constant),u_size_t:new o.Uniform1f(x,l.u_size_t),u_size:new o.Uniform1f(x,l.u_size),u_camera_to_center_distance:new o.Uniform1f(x,l.u_camera_to_center_distance),u_pitch:new o.Uniform1f(x,l.u_pitch),u_rotate_symbol:new o.Uniform1i(x,l.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(x,l.u_aspect_ratio),u_fade_change:new o.Uniform1f(x,l.u_fade_change),u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(x,l.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(x,l.u_coord_matrix),u_is_text:new o.Uniform1i(x,l.u_is_text),u_pitch_with_map:new o.Uniform1i(x,l.u_pitch_with_map),u_texsize:new o.Uniform2f(x,l.u_texsize),u_texsize_icon:new o.Uniform2f(x,l.u_texsize_icon),u_texture:new o.Uniform1i(x,l.u_texture),u_texture_icon:new o.Uniform1i(x,l.u_texture_icon),u_gamma_scale:new o.Uniform1f(x,l.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(x,l.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(x,l.u_is_halo)}),background:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_opacity:new o.Uniform1f(x,l.u_opacity),u_color:new o.UniformColor(x,l.u_color)}),backgroundPattern:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_opacity:new o.Uniform1f(x,l.u_opacity),u_image:new o.Uniform1i(x,l.u_image),u_pattern_tl_a:new o.Uniform2f(x,l.u_pattern_tl_a),u_pattern_br_a:new o.Uniform2f(x,l.u_pattern_br_a),u_pattern_tl_b:new o.Uniform2f(x,l.u_pattern_tl_b),u_pattern_br_b:new o.Uniform2f(x,l.u_pattern_br_b),u_texsize:new o.Uniform2f(x,l.u_texsize),u_mix:new o.Uniform1f(x,l.u_mix),u_pattern_size_a:new o.Uniform2f(x,l.u_pattern_size_a),u_pattern_size_b:new o.Uniform2f(x,l.u_pattern_size_b),u_scale_a:new o.Uniform1f(x,l.u_scale_a),u_scale_b:new o.Uniform1f(x,l.u_scale_b),u_pixel_coord_upper:new o.Uniform2f(x,l.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(x,l.u_pixel_coord_lower),u_tile_units_to_pixels:new o.Uniform1f(x,l.u_tile_units_to_pixels)}),terrain:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_texture:new o.Uniform1i(x,l.u_texture)}),terrainDepth:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix)}),terrainCoords:(x,l)=>({u_matrix:new o.UniformMatrix4f(x,l.u_matrix),u_texture:new o.Uniform1i(x,l.u_texture),u_terrain_coords_id:new o.Uniform1f(x,l.u_terrain_coords_id)})};class Ah{constructor(l,h,g){this.context=l;const b=l.gl;this.buffer=b.createBuffer(),this.dynamicDraw=Boolean(g),this.context.unbindVAO(),l.bindElementBuffer.set(this.buffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(l){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,l.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Nh={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class zh{constructor(l,h,g,b){this.length=h.length,this.attributes=g,this.itemSize=h.bytesPerElement,this.dynamicDraw=b,this.context=l;const P=l.gl;this.buffer=P.createBuffer(),l.bindVertexBuffer.set(this.buffer),P.bufferData(P.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?P.DYNAMIC_DRAW:P.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(l){if(l.length!==this.length)throw new Error(`Length of new data is ${l.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,l.arrayBuffer)}enableAttributes(l,h){for(let g=0;g0){const nr=o.create(),Gt=yt;o.mul(nr,gt.placementInvProjMatrix,x.transform.glCoordMatrix),o.mul(nr,nr,gt.placementViewportMatrix),ee.push({circleArray:vt,circleOffset:fe,transform:Gt,invTransform:nr,coord:at}),ie+=vt.length/4,fe=ie}zt&&W.draw($,V.LINES,Zr.disabled,Sn.disabled,x.colorModeForRenderPass(),An.disabled,Ya(yt,x.transform,rt),x.style.terrain&&x.style.terrain.getTerrainData(at),h.id,zt.layoutVertexBuffer,zt.indexBuffer,zt.segments,null,x.transform.zoom,null,null,zt.collisionVertexBuffer)}if(!z||!ee.length)return;const Se=x.useProgram("collisionCircle"),_e=new o.CollisionCircleLayoutArray;_e.resize(4*ie),_e._trim();let we=0;for(const Pe of ee)for(let at=0;at=0&&(_e[$e.associatedIconIndex]={shiftedAnchor:Nr,angle:Br})}else Lt($e.numGlyphs,fe)}if(W){Se.clear();const we=x.icon.placedSymbolArray;for(let $e=0;$ex.style.terrain.getElevation(zt,ip,ru):null,il=h.layout.get("text-rotation-alignment")==="map";xr(nr,zt.posMatrix,x,b,Uo,co,$e,W,il,Ko)}const yi=x.translatePosMatrix(zt.posMatrix,vt,P,z),Kr=Ue||b&>||$d?c_:Uo,cn=x.translatePosMatrix(co,vt,P,z,!0),ki=Nr&&h.paint.get(b?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Ti;Ti=Nr?nr.iconsInText?Uv(Br.kind,fn,et,$e,x,yi,Kr,cn,Jr,na):Sd(Br.kind,fn,et,$e,x,yi,Kr,cn,b,Jr,!0):Rh(Br.kind,fn,et,$e,x,yi,Kr,cn,b,Jr);const zn={program:dn,buffers:Gt,uniformValues:Ti,atlasTexture:mn,atlasTextureIcon:Pa,atlasInterpolation:Ei,atlasInterpolationIcon:Ta,isSDF:Nr,hasHalo:ki};if(Pe&&nr.canOverlap){at=!0;const Ko=Gt.segments.get();for(const il of Ko)yt.push({segments:new o.SegmentVector([il]),sortKey:il.sortKey,state:zn,terrainData:Yr})}else yt.push({segments:Gt.segments,sortKey:0,state:zn,terrainData:Yr})}at&&yt.sort((zt,vt)=>zt.sortKey-vt.sortKey);for(const zt of yt){const vt=zt.state;if(fe.activeTexture.set(Se.TEXTURE0),vt.atlasTexture.bind(vt.atlasInterpolation,Se.CLAMP_TO_EDGE),vt.atlasTextureIcon&&(fe.activeTexture.set(Se.TEXTURE1),vt.atlasTextureIcon&&vt.atlasTextureIcon.bind(vt.atlasInterpolationIcon,Se.CLAMP_TO_EDGE)),vt.isSDF){const nr=vt.uniformValues;vt.hasHalo&&(nr.u_is_halo=1,uc(vt.buffers,zt.segments,h,x,vt.program,rt,ee,ie,nr,zt.terrainData)),nr.u_is_halo=0}uc(vt.buffers,zt.segments,h,x,vt.program,rt,ee,ie,vt.uniformValues,zt.terrainData)}}function uc(x,l,h,g,b,P,z,$,V,W){const ee=g.context;b.draw(ee,ee.gl.TRIANGLES,P,z,$,An.disabled,V,W,h.id,x.layoutVertexBuffer,x.indexBuffer,l,h.paint,g.transform.zoom,x.programConfigurations.get(h.id),x.dynamicLayoutVertexBuffer,x.opacityVertexBuffer)}function cc(x,l,h,g,b,P,z){const $=x.context.gl,V=h.paint.get("fill-pattern"),W=V&&V.constantOr(1),ee=h.getCrossfadeParameters();let ie,fe,Se,_e,we;z?(fe=W&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ie=$.LINES):(fe=W?"fillPattern":"fill",ie=$.TRIANGLES);for(const $e of g){const Ue=l.getTile($e);if(W&&!Ue.patternsLoaded())continue;const et=Ue.getBucket(h);if(!et)continue;const Pe=et.programConfigurations.get(h.id),at=x.useProgram(fe,Pe),rt=x.style.terrain&&x.style.terrain.getTerrainData($e);W&&(x.context.activeTexture.set($.TEXTURE0),Ue.imageAtlasTexture.bind($.LINEAR,$.CLAMP_TO_EDGE),Pe.updatePaintBuffers(ee));const gt=V.constantOr(null);if(gt&&Ue.imageAtlas){const vt=Ue.imageAtlas,nr=vt.patternPositions[gt.to.toString()],Gt=vt.patternPositions[gt.from.toString()];nr&&Gt&&Pe.setConstantPatternPositions(nr,Gt)}const yt=rt?$e:null,zt=x.translatePosMatrix(yt?yt.posMatrix:$e.posMatrix,Ue,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(z){_e=et.indexBuffer2,we=et.segments2;const vt=[$.drawingBufferWidth,$.drawingBufferHeight];Se=fe==="fillOutlinePattern"&&W?Wl(zt,x,ee,Ue,vt):bo(zt,vt)}else _e=et.indexBuffer,we=et.segments,Se=W?Bn(zt,x,ee,Ue):Cn(zt);at.draw(x.context,ie,b,x.stencilModeForClipping($e),P,An.disabled,Se,rt,h.id,et.layoutVertexBuffer,_e,we,h.paint,x.transform.zoom,Pe)}}function dc(x,l,h,g,b,P,z){const $=x.context,V=$.gl,W=h.paint.get("fill-extrusion-pattern"),ee=W.constantOr(1),ie=h.getCrossfadeParameters(),fe=h.paint.get("fill-extrusion-opacity");for(const Se of g){const _e=l.getTile(Se),we=_e.getBucket(h);if(!we)continue;const $e=x.style.terrain&&x.style.terrain.getTerrainData(Se),Ue=we.programConfigurations.get(h.id),et=x.useProgram(ee?"fillExtrusionPattern":"fillExtrusion",Ue);ee&&(x.context.activeTexture.set(V.TEXTURE0),_e.imageAtlasTexture.bind(V.LINEAR,V.CLAMP_TO_EDGE),Ue.updatePaintBuffers(ie));const Pe=W.constantOr(null);if(Pe&&_e.imageAtlas){const yt=_e.imageAtlas,zt=yt.patternPositions[Pe.to.toString()],vt=yt.patternPositions[Pe.from.toString()];zt&&vt&&Ue.setConstantPatternPositions(zt,vt)}const at=x.translatePosMatrix(Se.posMatrix,_e,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),rt=h.paint.get("fill-extrusion-vertical-gradient"),gt=ee?bn(at,x,rt,fe,Se,ie,_e):Xr(at,x,rt,fe);et.draw($,$.gl.TRIANGLES,b,P,z,An.backCCW,gt,$e,h.id,we.layoutVertexBuffer,we.indexBuffer,we.segments,h.paint,x.transform.zoom,Ue,x.style.terrain&&we.centroidVertexBuffer)}}function Kh(x,l,h,g,b,P,z){const $=x.context,V=$.gl,W=h.fbo;if(!W)return;const ee=x.useProgram("hillshade"),ie=x.style.terrain&&x.style.terrain.getTerrainData(l);$.activeTexture.set(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,W.colorAttachment.get()),ee.draw($,V.TRIANGLES,b,P,z,An.disabled,((fe,Se,_e,we)=>{const $e=_e.paint.get("hillshade-shadow-color"),Ue=_e.paint.get("hillshade-highlight-color"),et=_e.paint.get("hillshade-accent-color");let Pe=_e.paint.get("hillshade-illumination-direction")*(Math.PI/180);_e.paint.get("hillshade-illumination-anchor")==="viewport"&&(Pe-=fe.transform.angle);const at=!fe.options.moving;return{u_matrix:we?we.posMatrix:fe.transform.calculatePosMatrix(Se.tileID.toUnwrapped(),at),u_image:0,u_latrange:Di(0,Se.tileID),u_light:[_e.paint.get("hillshade-exaggeration"),Pe],u_shadow:$e,u_highlight:Ue,u_accent:et}})(x,h,g,ie?l:null),ie,g.id,x.rasterBoundsBuffer,x.quadTriangleIndexBuffer,x.rasterBoundsSegments)}function Jv(x,l,h,g,b,P){const z=x.context,$=z.gl,V=l.dem;if(V&&V.data){const W=V.dim,ee=V.stride,ie=V.getPixels();if(z.activeTexture.set($.TEXTURE1),z.pixelStoreUnpackPremultiplyAlpha.set(!1),l.demTexture=l.demTexture||x.getTileTexture(ee),l.demTexture){const Se=l.demTexture;Se.update(ie,{premultiply:!1}),Se.bind($.NEAREST,$.CLAMP_TO_EDGE)}else l.demTexture=new R(z,ie,$.RGBA,{premultiply:!1}),l.demTexture.bind($.NEAREST,$.CLAMP_TO_EDGE);z.activeTexture.set($.TEXTURE0);let fe=l.fbo;if(!fe){const Se=new R(z,{width:W,height:W,data:null},$.RGBA);Se.bind($.LINEAR,$.CLAMP_TO_EDGE),fe=l.fbo=z.createFramebuffer(W,W,!0),fe.colorAttachment.set(Se.texture)}z.bindFramebuffer.set(fe.framebuffer),z.viewport.set([0,0,W,W]),x.useProgram("hillshadePrepare").draw(z,$.TRIANGLES,g,b,P,An.disabled,((Se,_e)=>{const we=_e.stride,$e=o.create();return o.ortho($e,0,o.EXTENT,-o.EXTENT,0,0,1),o.translate($e,$e,[0,-o.EXTENT,0]),{u_matrix:$e,u_image:1,u_dimension:[we,we],u_zoom:Se.overscaledZ,u_unpack:_e.getUnpackVector()}})(l.tileID,V),null,h.id,x.rasterBoundsBuffer,x.quadTriangleIndexBuffer,x.rasterBoundsSegments),l.needsHillshadePrepare=!1}}function Od(x,l,h,g,b,P){const z=g.paint.get("raster-fade-duration");if(!P&&z>0){const $=o.exported.now(),V=($-x.timeAdded)/z,W=l?($-l.timeAdded)/z:-1,ee=h.getSource(),ie=b.coveringZoomLevel({tileSize:ee.tileSize,roundZoom:ee.roundZoom}),fe=!l||Math.abs(l.tileID.overscaledZ-ie)>Math.abs(x.tileID.overscaledZ-ie),Se=fe&&x.refreshedUponExpiration?1:o.clamp(fe?V:1-W,0,1);return x.refreshedUponExpiration&&V>=1&&(x.refreshedUponExpiration=!1),l?{opacity:1,mix:1-Se}:{opacity:Se,mix:0}}return{opacity:1,mix:0}}const Ad=new o.Color(1,0,0,1),ra=new o.Color(0,1,0,1),eg=new o.Color(0,0,1,1),Hh=new o.Color(1,0,1,1),tg=new o.Color(0,1,1,1);function tl(x,l,h,g){Yl(x,0,l+h/2,x.transform.width,h,g)}function fc(x,l,h,g){Yl(x,l-h/2,0,h,x.transform.height,g)}function Yl(x,l,h,g,b,P){const z=x.context,$=z.gl;$.enable($.SCISSOR_TEST),$.scissor(l*x.pixelRatio,h*x.pixelRatio,g*x.pixelRatio,b*x.pixelRatio),z.clear({color:P}),$.disable($.SCISSOR_TEST)}function h_(x,l,h){const g=x.context,b=g.gl,P=h.posMatrix,z=x.useProgram("debug"),$=Zr.disabled,V=Sn.disabled,W=x.colorModeForRenderPass(),ee="$debug",ie=x.style.terrain&&x.style.terrain.getTerrainData(h);g.activeTexture.set(b.TEXTURE0),x.emptyTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE);const fe=l.getTileByID(h.key).latestRawTileData,Se=Math.floor((fe&&fe.byteLength||0)/1024),_e=l.getTile(h).tileSize,we=512/Math.min(_e,512)*(h.overscaledZ/x.transform.zoom)*.5;let $e=h.canonical.toString();h.overscaledZ!==h.canonical.z&&($e+=` => ${h.overscaledZ}`),function(Ue,et){Ue.initDebugOverlayCanvas();const Pe=Ue.debugOverlayCanvas,at=Ue.context.gl,rt=Ue.debugOverlayCanvas.getContext("2d");rt.clearRect(0,0,Pe.width,Pe.height),rt.shadowColor="white",rt.shadowBlur=2,rt.lineWidth=1.5,rt.strokeStyle="white",rt.textBaseline="top",rt.font="bold 36px Open Sans, sans-serif",rt.fillText(et,5,5),rt.strokeText(et,5,5),Ue.debugOverlayTexture.update(Pe),Ue.debugOverlayTexture.bind(at.LINEAR,at.CLAMP_TO_EDGE)}(x,`${$e} ${Se}kB`),z.draw(g,b.TRIANGLES,$,V,Tn.alphaBlended,An.disabled,Dr(P,o.Color.transparent,we),null,ee,x.debugBuffer,x.quadTriangleIndexBuffer,x.debugSegments),z.draw(g,b.LINE_STRIP,$,V,W,An.disabled,Dr(P,o.Color.red),ie,ee,x.debugBuffer,x.tileBorderIndexBuffer,x.debugSegments)}function Nd(x,l,h){const g=x.context,b=g.gl,P=x.colorModeForRenderPass(),z=new Zr(b.LEQUAL,Zr.ReadWrite,x.depthRangeFor3D),$=x.useProgram("terrain"),V=l.getTerrainMesh(),W=l.getTerrainData(h.tileID);g.bindFramebuffer.set(null),g.viewport.set([0,0,x.width,x.height]),g.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l.getRTTFramebuffer().colorAttachment.get());const ee=x.transform.calculatePosMatrix(h.tileID.toUnwrapped());$.draw(g,b.TRIANGLES,z,Sn.disabled,P,An.backCCW,{u_matrix:ee,u_texture:0},W,"terrain",V.vertexBuffer,V.indexBuffer,V.segments)}function rg(x,l,h,g){const b=x.context,P=h.tileSize*l.qualityFactor;h.textures[g]||(h.textures[g]=x.getTileTexture(P)||new R(b,{width:P,height:P,data:null},b.gl.RGBA),h.textures[g].bind(b.gl.LINEAR,b.gl.CLAMP_TO_EDGE),g===0&&l.sourceCache.renderHistory.unshift(h.tileID.key));const z=l.getRTTFramebuffer();z.colorAttachment.set(h.textures[g].texture),b.bindFramebuffer.set(z.framebuffer),b.viewport.set([0,0,P,P])}class ng{constructor(l){this._coordsDescendingInv={},this._coordsDescendingInvStr={},this.painter=l,this._renderToTexture={background:!0,fill:!0,line:!0,raster:!0},this._coordsDescendingInv={},this._coordsDescendingInvStr={},this._stacks=[],this._prevType=null,this._rerender={},this._renderableTiles=l.style.terrain.sourceCache.getRenderableTiles(),this._init()}_init(){const l=this.painter.style,h=l.terrain;for(const g in l.sourceCaches){this._coordsDescendingInv[g]={};const b=l.sourceCaches[g].getVisibleCoordinates();for(const P of b){const z=h.sourceCache.getTerrainCoords(P);for(const $ in z)this._coordsDescendingInv[g][$]||(this._coordsDescendingInv[g][$]=[]),this._coordsDescendingInv[g][$].push(z[$])}}for(const g of l._order){const b=l._layers[g],P=b.source;if(this._renderToTexture[b.type]&&!this._coordsDescendingInvStr[P]){this._coordsDescendingInvStr[P]={};for(const z in this._coordsDescendingInv[P])this._coordsDescendingInvStr[P][z]=this._coordsDescendingInv[P][z].map($=>$.key).sort().join()}}return this._renderableTiles.forEach(g=>{for(const b in this._coordsDescendingInvStr){const P=this._coordsDescendingInvStr[b][g.tileID.key];P&&P!==g.textureCoords[b]&&g.clearTextures(this.painter),h.needsRerender(b,g.tileID)&&g.clearTextures(this.painter)}this._rerender[g.tileID.key]=!g.textures.length}),h.clearRerenderCache(),h.sourceCache.removeOutdated(this.painter),this}renderLayer(l){const h=l.type,g=this.painter,b=g.style._order,P=g.currentLayer,z=P+1===b.length;if(this._renderToTexture[h]&&(this._prevType&&this._renderToTexture[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(b[P]),!z))return!0;if(this._renderToTexture[this._prevType]||h==="hillshade"||this._renderToTexture[h]&&z){this._prevType=h;const $=this._stacks.length-1,V=this._stacks[$]||[];for(const W of this._renderableTiles){if(rg(g,g.style.terrain,W,$),this._rerender[W.tileID.key]){g.context.clear({color:o.Color.transparent});for(let ee=0;eeV.style.terrain.getElevation(Ue,vt,nr):null)}}}(g,x,h,l,h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),b),h.paint.get("icon-opacity").constantOr(1)!==0&&Rd(x,l,h,g,!1,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),h.layout.get("icon-rotation-alignment"),h.layout.get("icon-pitch-alignment"),h.layout.get("icon-keep-upright"),P,z),h.paint.get("text-opacity").constantOr(1)!==0&&Rd(x,l,h,g,!0,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),h.layout.get("text-keep-upright"),P,z),l.map.showCollisionBoxes&&(Xl(x,l,h,g,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),!0),Xl(x,l,h,g,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),!1))},circle:function(x,l,h,g){if(x.renderPass!=="translucent")return;const b=h.paint.get("circle-opacity"),P=h.paint.get("circle-stroke-width"),z=h.paint.get("circle-stroke-opacity"),$=!h.layout.get("circle-sort-key").isConstant();if(b.constantOr(1)===0&&(P.constantOr(1)===0||z.constantOr(1)===0))return;const V=x.context,W=V.gl,ee=x.depthModeForSublayer(0,Zr.ReadOnly),ie=Sn.disabled,fe=x.colorModeForRenderPass(),Se=[];for(let _e=0;_e_e.sortKey-we.sortKey);for(const _e of Se){const{programConfiguration:we,program:$e,layoutVertexBuffer:Ue,indexBuffer:et,uniformValues:Pe,terrainData:at}=_e.state;$e.draw(V,W.TRIANGLES,ee,ie,fe,An.disabled,Pe,at,h.id,Ue,et,_e.segments,h.paint,x.transform.zoom,we)}},heatmap:function(x,l,h,g){if(h.paint.get("heatmap-opacity")!==0)if(x.renderPass==="offscreen"){const b=x.context,P=b.gl,z=Sn.disabled,$=new Tn([P.ONE,P.ONE],o.Color.transparent,[!0,!0,!0,!0]);(function(V,W,ee){const ie=V.gl;V.activeTexture.set(ie.TEXTURE1),V.viewport.set([0,0,W.width/4,W.height/4]);let fe=ee.heatmapFbo;if(fe)ie.bindTexture(ie.TEXTURE_2D,fe.colorAttachment.get()),V.bindFramebuffer.set(fe.framebuffer);else{const Se=ie.createTexture();ie.bindTexture(ie.TEXTURE_2D,Se),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_WRAP_S,ie.CLAMP_TO_EDGE),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_WRAP_T,ie.CLAMP_TO_EDGE),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_MIN_FILTER,ie.LINEAR),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_MAG_FILTER,ie.LINEAR),fe=ee.heatmapFbo=V.createFramebuffer(W.width/4,W.height/4,!1),function(_e,we,$e,Ue){const et=_e.gl;et.texImage2D(et.TEXTURE_2D,0,et.RGBA,we.width/4,we.height/4,0,et.RGBA,_e.extRenderToTextureHalfFloat?_e.extTextureHalfFloat.HALF_FLOAT_OES:et.UNSIGNED_BYTE,null),Ue.colorAttachment.set($e)}(V,W,Se,fe)}})(b,x,h),b.clear({color:o.Color.transparent});for(let V=0;V{const _e=o.create();o.ortho(_e,0,ee.width,ee.height,0,0,1);const we=ee.context.gl;return{u_matrix:_e,u_world:[we.drawingBufferWidth,we.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ie.paint.get("heatmap-opacity")}})(b,P),null,P.id,b.viewportBuffer,b.quadTriangleIndexBuffer,b.viewportSegments,P.paint,b.transform.zoom)}(x,h))},line:function(x,l,h,g){if(x.renderPass!=="translucent")return;const b=h.paint.get("line-opacity"),P=h.paint.get("line-width");if(b.constantOr(1)===0||P.constantOr(1)===0)return;const z=x.depthModeForSublayer(0,Zr.ReadOnly),$=x.colorModeForRenderPass(),V=h.paint.get("line-dasharray"),W=h.paint.get("line-pattern"),ee=W.constantOr(1),ie=h.paint.get("line-gradient"),fe=h.getCrossfadeParameters(),Se=ee?"linePattern":V?"lineSDF":ie?"lineGradient":"line",_e=x.context,we=_e.gl;let $e=!0;for(const Ue of g){const et=l.getTile(Ue);if(ee&&!et.patternsLoaded())continue;const Pe=et.getBucket(h);if(!Pe)continue;const at=Pe.programConfigurations.get(h.id),rt=x.context.program.get(),gt=x.useProgram(Se,at),yt=$e||gt.program!==rt,zt=x.style.terrain&&x.style.terrain.getTerrainData(Ue),vt=W.constantOr(null);if(vt&&et.imageAtlas){const sr=et.imageAtlas,Nr=sr.patternPositions[vt.to.toString()],Br=sr.patternPositions[vt.from.toString()];Nr&&Br&&at.setConstantPatternPositions(Nr,Br)}const nr=zt?Ue:null,Gt=ee?Js(x,et,h,fe,nr):V?Qa(x,et,h,V,fe,nr):ie?Vo(x,et,h,Pe.lineClipsArray.length,nr):Ss(x,et,h,nr);if(ee)_e.activeTexture.set(we.TEXTURE0),et.imageAtlasTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE),at.updatePaintBuffers(fe);else if(V&&(yt||x.lineAtlas.dirty))_e.activeTexture.set(we.TEXTURE0),x.lineAtlas.bind(_e);else if(ie){const sr=Pe.gradients[h.id];let Nr=sr.texture;if(h.gradientVersion!==sr.version){let Br=256;if(h.stepInterpolant){const _r=l.getSource().maxzoom,dn=Ue.canonical.z===_r?Math.ceil(1<256&&this.clearStencil(),g.setColorMode(Tn.disabled),g.setDepthMode(Zr.disabled);const P=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const z of h){const $=this._tileClippingMaskIDs[z.key]=this.nextStencilID++,V=this.style.terrain&&this.style.terrain.getTerrainData(z);P.draw(g,b.TRIANGLES,Zr.disabled,new Sn({func:b.ALWAYS,mask:0},$,255,b.KEEP,b.KEEP,b.REPLACE),Tn.disabled,An.disabled,Gr(z.posMatrix),V,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const l=this.nextStencilID++,h=this.context.gl;return new Sn({func:h.NOTEQUAL,mask:255},l,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(l){const h=this.context.gl;return new Sn({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[l.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(l){const h=this.context.gl,g=l.sort((z,$)=>$.overscaledZ-z.overscaledZ),b=g[g.length-1].overscaledZ,P=g[0].overscaledZ-b+1;if(P>1){this.currentStencilSource=void 0,this.nextStencilID+P>256&&this.clearStencil();const z={};for(let $=0;$=0;this.currentLayer--){const W=this.style._layers[g[this.currentLayer]],ee=b[W.source],ie=z[W.source];this._renderTileClippingMasks(W,ie),this.renderLayer(this,ee,W,ie)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer{ie.source&&!ie.isHidden(this.transform.zoom)&&(ie.source!==(ee&&ee.id)&&(ee=this.style.sourceCaches[ie.source]),(!W||W.getSource().maxzoom0?h.pop():null}isPatternMissing(l){if(!l)return!1;if(!l.from||!l.to)return!0;const h=this.imageManager.getPattern(l.from.toString()),g=this.imageManager.getPattern(l.to.toString());return!h||!g}useProgram(l,h){this.cache=this.cache||{};const g=l+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.terrain?"/terrain":"");return this.cache[g]||(this.cache[g]=new jr(this.context,l,Cr[l],h,Oh[l],this._showOverdrawInspector,this.style.terrain)),this.cache[g]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const l=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(l.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new R(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class zd{constructor(l,h){this.points=l,this.planes=h}static fromInvProjectionMatrix(l,h,g){const b=Math.pow(2,g),P=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map($=>{const V=1/($=o.transformMat4([],$,l))[3]/h*b;return o.mul$1($,$,[V,V,1/$[3],V])}),z=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map($=>{const V=o.sub([],P[$[0]],P[$[1]]),W=o.sub([],P[$[2]],P[$[1]]),ee=o.normalize([],o.cross([],V,W)),ie=-o.dot(ee,P[$[1]]);return ee.concat(ie)});return new zd(P,z)}}class pc{constructor(l,h){this.min=l,this.max=h,this.center=o.scale$1([],o.add([],this.min,this.max),.5)}quadrant(l){const h=[l%2==0,l<2],g=o.clone$2(this.min),b=o.clone$2(this.max);for(let P=0;P=0&&z++;if(z===0)return 0;z!==h.length&&(g=!1)}if(g)return 2;for(let b=0;b<3;b++){let P=Number.MAX_VALUE,z=-Number.MAX_VALUE;for(let $=0;$this.max[b]-this.min[b])return 0}return 1}}class Ql{constructor(l=0,h=0,g=0,b=0){if(isNaN(l)||l<0||isNaN(h)||h<0||isNaN(g)||g<0||isNaN(b)||b<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=l,this.bottom=h,this.left=g,this.right=b}interpolate(l,h,g){return h.top!=null&&l.top!=null&&(this.top=o.number(l.top,h.top,g)),h.bottom!=null&&l.bottom!=null&&(this.bottom=o.number(l.bottom,h.bottom,g)),h.left!=null&&l.left!=null&&(this.left=o.number(l.left,h.left,g)),h.right!=null&&l.right!=null&&(this.right=o.number(l.right,h.right,g)),this}getCenter(l,h){const g=o.clamp((this.left+l-this.right)/2,0,l),b=o.clamp((this.top+h-this.bottom)/2,0,h);return new o.pointGeometry(g,b)}equals(l){return this.top===l.top&&this.bottom===l.bottom&&this.left===l.left&&this.right===l.right}clone(){return new Ql(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class mc{constructor(l,h,g,b,P){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=P===void 0||!!P,this._minZoom=l||0,this._maxZoom=h||22,this._minPitch=g==null?0:g,this._maxPitch=b==null?60:b,this.setMaxBounds(),this.width=0,this.height=0,this._center=new o.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Ql,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const l=new mc(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return l.tileSize=this.tileSize,l.latRange=this.latRange,l.width=this.width,l.height=this.height,l._center=this._center,l._elevation=this._elevation,l.zoom=this.zoom,l.angle=this.angle,l._fov=this._fov,l._pitch=this._pitch,l._unmodified=this._unmodified,l._edgeInsets=this._edgeInsets.clone(),l._calcMatrices(),l}get minZoom(){return this._minZoom}set minZoom(l){this._minZoom!==l&&(this._minZoom=l,this.zoom=Math.max(this.zoom,l))}get maxZoom(){return this._maxZoom}set maxZoom(l){this._maxZoom!==l&&(this._maxZoom=l,this.zoom=Math.min(this.zoom,l))}get minPitch(){return this._minPitch}set minPitch(l){this._minPitch!==l&&(this._minPitch=l,this.pitch=Math.max(this.pitch,l))}get maxPitch(){return this._maxPitch}set maxPitch(l){this._maxPitch!==l&&(this._maxPitch=l,this.pitch=Math.min(this.pitch,l))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(l){l===void 0?l=!0:l===null&&(l=!1),this._renderWorldCopies=l}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(l){const h=-o.wrap(l,-180,180)*Math.PI/180;var g;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(g=new o.ARRAY_TYPE(4),o.ARRAY_TYPE!=Float32Array&&(g[1]=0,g[2]=0),g[0]=1,g[3]=1,g),function(b,P,z){var $=P[0],V=P[1],W=P[2],ee=P[3],ie=Math.sin(z),fe=Math.cos(z);b[0]=$*fe+W*ie,b[1]=V*fe+ee*ie,b[2]=$*-ie+W*fe,b[3]=V*-ie+ee*fe}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(l){const h=o.clamp(l,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(l){l=Math.max(.01,Math.min(60,l)),this._fov!==l&&(this._unmodified=!1,this._fov=l/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(l){const h=Math.min(Math.max(l,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.scale=this.zoomScale(h),this.tileZoom=Math.floor(h),this.zoomFraction=h-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(l){l.lat===this._center.lat&&l.lng===this._center.lng||(this._unmodified=!1,this._center=l,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(l){l!==this._elevation&&(this._elevation=l,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(l){this._edgeInsets.equals(l)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,l,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(l){return this._edgeInsets.equals(l)}interpolatePadding(l,h,g){this._unmodified=!1,this._edgeInsets.interpolate(l,h,g),this._constrain(),this._calcMatrices()}coveringZoomLevel(l){const h=(l.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/l.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(l){const h=[new o.UnwrappedTileID(0,l)];if(this._renderWorldCopies){const g=this.pointCoordinate(new o.pointGeometry(0,0)),b=this.pointCoordinate(new o.pointGeometry(this.width,0)),P=this.pointCoordinate(new o.pointGeometry(this.width,this.height)),z=this.pointCoordinate(new o.pointGeometry(0,this.height)),$=Math.floor(Math.min(g.x,b.x,P.x,z.x)),V=Math.floor(Math.max(g.x,b.x,P.x,z.x)),W=1;for(let ee=$-W;ee<=V+W;ee++)ee!==0&&h.push(new o.UnwrappedTileID(ee,l))}return h}coveringTiles(l){var h,g;let b=this.coveringZoomLevel(l);const P=b;if(l.minzoom!==void 0&&bl.maxzoom&&(b=l.maxzoom);const z=this.pointCoordinate(this.getCameraPoint()),$=o.MercatorCoordinate.fromLngLat(this.center),V=Math.pow(2,b),W=[V*z.x,V*z.y,0],ee=[V*$.x,V*$.y,0],ie=zd.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,b);let fe=l.minzoom||0;!l.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(fe=b);const Se=l.terrain?2/Math.min(this.tileSize,l.tileSize)*this.tileSize:3,_e=Pe=>({aabb:new pc([Pe*V,0,0],[(Pe+1)*V,V,0]),zoom:0,x:0,y:0,wrap:Pe,fullyVisible:!1}),we=[],$e=[],Ue=b,et=l.reparseOverscaled?P:b;if(this._renderWorldCopies)for(let Pe=1;Pe<=3;Pe++)we.push(_e(-Pe)),we.push(_e(Pe));for(we.push(_e(0));we.length>0;){const Pe=we.pop(),at=Pe.x,rt=Pe.y;let gt=Pe.fullyVisible;if(!gt){const sr=Pe.aabb.intersects(ie);if(sr===0)continue;gt=sr===2}const yt=l.terrain?W:ee,zt=Pe.aabb.distanceX(yt),vt=Pe.aabb.distanceY(yt),nr=Math.max(Math.abs(zt),Math.abs(vt)),Gt=Se+(1<Gt&&Pe.zoom>=fe){const sr=Ue-Pe.zoom,Nr=W[0]-.5-(at<>1),_r=Pe.zoom+1;let dn=Pe.aabb.quadrant(sr);if(l.terrain){const fn=new o.OverscaledTileID(_r,Pe.wrap,_r,Nr,Br),Yr=l.terrain.getMinMaxElevation(fn),Jr=(h=Yr.minElevation)!==null&&h!==void 0?h:this.elevation,mn=(g=Yr.maxElevation)!==null&&g!==void 0?g:this.elevation;dn=new pc([dn.min[0],dn.min[1],Jr],[dn.max[0],dn.max[1],mn])}we.push({aabb:dn,zoom:_r,x:Nr,y:Br,wrap:Pe.wrap,fullyVisible:gt})}}return $e.sort((Pe,at)=>Pe.distanceSq-at.distanceSq).map(Pe=>Pe.tileID)}resize(l,h){this.width=l,this.height=h,this.pixelsToGLUnits=[2/l,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(l){return Math.pow(2,l)}scaleZoom(l){return Math.log(l)/Math.LN2}project(l){const h=o.clamp(l.lat,-this.maxValidLatitude,this.maxValidLatitude);return new o.pointGeometry(o.mercatorXfromLng(l.lng)*this.worldSize,o.mercatorYfromLat(h)*this.worldSize)}unproject(l){return new o.MercatorCoordinate(l.x/this.worldSize,l.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(l){this.freezeElevation||(this.elevation=l?this.getElevation(this._center,l):0)}getElevation(l,h){const g=o.MercatorCoordinate.fromLngLat(l),b=(1<z&&(b=z-_e)}if(this.lngRange){const Se=($+V)/2,_e=o.wrap(ie.x,Se-this.worldSize/2,Se+this.worldSize/2),we=W.x/2;_e-we<$&&(g=$+we),_e+we>V&&(g=V-we)}g===void 0&&b===void 0||(this.center=this.unproject(new o.pointGeometry(g!==void 0?g:ie.x,b!==void 0?b:ie.y)).wrap()),this._unmodified=ee,this._constraining=!1}_calcMatrices(){if(!this.height)return;const l=this.centerOffset,h=this.point.x,g=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=o.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let b=o.identity(new Float64Array(16));o.scale(b,b,[this.width/2,-this.height/2,1]),o.translate(b,b,[1,-1,0]),this.labelPlaneMatrix=b,b=o.identity(new Float64Array(16)),o.scale(b,b,[1,-1,1]),o.translate(b,b,[-1,-1,0]),o.scale(b,b,[2/this.width,2/this.height,1]),this.glCoordMatrix=b,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const P=Math.PI/2+this._pitch,z=this._fov*(.5+l.y/this.height),$=Math.sin(z)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-P-z,.01,Math.PI-.01)),V=this.getHorizon(),W=2*Math.atan(V/this.cameraToCenterDistance)*(.5+l.y/(2*V)),ee=Math.sin(W)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-P-W,.01,Math.PI-.01)),ie=Math.cos(Math.PI/2-this._pitch)*$+this.cameraToSeaLevelDistance,fe=Math.cos(Math.PI/2-this._pitch)*ee+this.cameraToSeaLevelDistance,Se=1.01*Math.min(ie,fe),_e=this.height/50;b=new Float64Array(16),o.perspective(b,this._fov,this.width/this.height,_e,Se),b[8]=2*-l.x/this.width,b[9]=2*l.y/this.height,o.scale(b,b,[1,-1,1]),o.translate(b,b,[0,0,-this.cameraToCenterDistance]),o.rotateX(b,b,this._pitch),o.rotateZ(b,b,this.angle),o.translate(b,b,[-h,-g,0]),this.mercatorMatrix=o.scale([],b,[this.worldSize,this.worldSize,this.worldSize]),o.scale(b,b,[1,1,this._pixelPerMeter]),this.pixelMatrix=o.multiply(new Float64Array(16),this.labelPlaneMatrix,b),o.translate(b,b,[0,0,-this.elevation]),this.projMatrix=b,this.invProjMatrix=o.invert([],b),this.pixelMatrix3D=o.multiply(new Float64Array(16),this.labelPlaneMatrix,b);const we=this.width%2/2,$e=this.height%2/2,Ue=Math.cos(this.angle),et=Math.sin(this.angle),Pe=h-Math.round(h)+Ue*we+et*$e,at=g-Math.round(g)+Ue*$e+et*we,rt=new Float64Array(b);if(o.translate(rt,rt,[Pe>.5?Pe-1:Pe,at>.5?at-1:at,0]),this.alignedProjMatrix=rt,b=o.invert(new Float64Array(16),this.pixelMatrix),!b)throw new Error("failed to invert matrix");this.pixelMatrixInverse=b,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const l=this.pointCoordinate(new o.pointGeometry(0,0)),h=[l.x*this.worldSize,l.y*this.worldSize,0,1];return o.transformMat4(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const l=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.pointGeometry(0,l))}getCameraQueryGeometry(l){const h=this.getCameraPoint();if(l.length===1)return[l[0],h];{let g=h.x,b=h.y,P=h.x,z=h.y;for(const $ of l)g=Math.min(g,$.x),b=Math.min(b,$.y),P=Math.max(P,$.x),z=Math.max(z,$.y);return[new o.pointGeometry(g,b),new o.pointGeometry(P,b),new o.pointGeometry(P,z),new o.pointGeometry(g,z),new o.pointGeometry(g,b)]}}}class ig{constructor(l){this._hashName=l&&encodeURIComponent(l),o.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(h,g){let b=!1,P=null;const z=()=>{P=null,b&&(h(),P=setTimeout(z,300),b=!1)};return()=>(b=!0,P||z(),P)}(this._updateHashUnthrottled.bind(this))}addTo(l){return this._map=l,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(l){const h=this._map.getCenter(),g=Math.round(100*this._map.getZoom())/100,b=Math.ceil((g*Math.LN2+Math.log(512/360/.5))/Math.LN10),P=Math.pow(10,b),z=Math.round(h.lng*P)/P,$=Math.round(h.lat*P)/P,V=this._map.getBearing(),W=this._map.getPitch();let ee="";if(ee+=l?`/${z}/${$}/${g}`:`${g}/${$}/${z}`,(V||W)&&(ee+="/"+Math.round(10*V)/10),W&&(ee+=`/${Math.round(W)}`),this._hashName){const ie=this._hashName;let fe=!1;const Se=window.location.hash.slice(1).split("&").map(_e=>{const we=_e.split("=")[0];return we===ie?(fe=!0,`${we}=${ee}`):_e}).filter(_e=>_e);return fe||Se.push(`${ie}=${ee}`),`#${Se.join("&")}`}return`#${ee}`}_getCurrentHash(){const l=window.location.hash.replace("#","");if(this._hashName){let h;return l.split("&").map(g=>g.split("=")).forEach(g=>{g[0]===this._hashName&&(h=g)}),(h&&h[1]||"").split("/")}return l.split("/")}_onHashChange(){const l=this._getCurrentHash();if(l.length>=3&&!l.some(h=>isNaN(h))){const h=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(l[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+l[2],+l[1]],zoom:+l[0],bearing:h,pitch:+(l[4]||0)}),!0}return!1}_updateHashUnthrottled(){const l=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,l)}catch{}}}const vc={linearity:.3,easing:o.bezier(0,0,.3,1)},og=o.extend({deceleration:2500,maxSpeed:1400},vc),ag=o.extend({deceleration:20,maxSpeed:1400},vc),sg=o.extend({deceleration:1e3,maxSpeed:360},vc),Jl=o.extend({deceleration:1e3,maxSpeed:90},vc);class lg{constructor(l){this._map=l,this.clear()}clear(){this._inertiaBuffer=[]}record(l){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.exported.now(),settings:l})}_drainInertiaBuffer(){const l=this._inertiaBuffer,h=o.exported.now();for(;l.length>0&&h-l[0].time>160;)l.shift()}_onMoveEnd(l){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new o.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:P}of this._inertiaBuffer)h.zoom+=P.zoomDelta||0,h.bearing+=P.bearingDelta||0,h.pitch+=P.pitchDelta||0,P.panDelta&&h.pan._add(P.panDelta),P.around&&(h.around=P.around),P.pinchAround&&(h.pinchAround=P.pinchAround);const g=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,b={};if(h.pan.mag()){const P=yc(h.pan.mag(),g,o.extend({},og,l||{}));b.offset=h.pan.mult(P.amount/h.pan.mag()),b.center=this._map.transform.center,gc(b,P)}if(h.zoom){const P=yc(h.zoom,g,ag);b.zoom=this._map.transform.zoom+P.amount,gc(b,P)}if(h.bearing){const P=yc(h.bearing,g,sg);b.bearing=this._map.transform.bearing+o.clamp(P.amount,-179,179),gc(b,P)}if(h.pitch){const P=yc(h.pitch,g,Jl);b.pitch=this._map.transform.pitch+P.amount,gc(b,P)}if(b.zoom||b.bearing){const P=h.pinchAround===void 0?h.around:h.pinchAround;b.around=P?this._map.unproject(P):this._map.getCenter()}return this.clear(),o.extend(b,{noMoveStart:!0})}}function gc(x,l){(!x.duration||x.durationh.unproject(V)),$=P.reduce((V,W,ee,ie)=>V.add(W.div(ie.length)),new o.pointGeometry(0,0));super(l,{points:P,point:$,lngLats:z,lngLat:h.unproject($),originalEvent:g}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class So extends o.Event{constructor(l,h,g){super(l,{originalEvent:g}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class p_{constructor(l,h){this._map=l,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(l){return this._firePreventable(new So(l.type,this._map,l))}mousedown(l,h){return this._mousedownPos=h,this._firePreventable(new Co(l.type,this._map,l))}mouseup(l){this._map.fire(new Co(l.type,this._map,l))}click(l,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new Co(l.type,this._map,l))}dblclick(l){return this._firePreventable(new Co(l.type,this._map,l))}mouseover(l){this._map.fire(new Co(l.type,this._map,l))}mouseout(l){this._map.fire(new Co(l.type,this._map,l))}touchstart(l){return this._firePreventable(new xc(l.type,this._map,l))}touchmove(l){this._map.fire(new xc(l.type,this._map,l))}touchend(l){this._map.fire(new xc(l.type,this._map,l))}touchcancel(l){this._map.fire(new xc(l.type,this._map,l))}_firePreventable(l){if(this._map.fire(l),l.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Es{constructor(l){this._map=l}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(l){this._map.fire(new Co(l.type,this._map,l))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Co("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(l){this._delayContextMenu?this._contextMenuEvent=l:this._ignoreContextMenu||this._map.fire(new Co(l.type,this._map,l)),this._map.listens("contextmenu")&&l.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ug{constructor(l,h){this._map=l,this._el=l.getCanvasContainer(),this._container=l.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(l,h){this.isEnabled()&&l.shiftKey&&l.button===0&&(w.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(l,h){if(!this._active)return;const g=h;if(this._lastPos.equals(g)||!this._box&&g.dist(this._startPos)P.fitScreenCoordinates(g,b,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",l)}keydown(l){this._active&&l.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",l))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(w.remove(this._box),this._box=null),w.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(l,h){return this._map.fire(new o.Event(l,{originalEvent:h}))}}function es(x,l){if(x.length!==l.length)throw new Error(`The number of touches and points are not equal - touches ${x.length}, points ${l.length}`);const h={};for(let g=0;gthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=l.timeStamp),g.length===this.numTouches&&(this.centroid=function(b){const P=new o.pointGeometry(0,0);for(const z of b)P._add(z);return P.div(b.length)}(h),this.touches=es(g,h)))}touchmove(l,h,g){if(this.aborted||!this.centroid)return;const b=es(g,h);for(const P in this.touches){const z=this.touches[P],$=b[P];(!$||$.dist(z)>30)&&(this.aborted=!0)}}touchend(l,h,g){if((!this.centroid||l.timeStamp-this.startTime>500)&&(this.aborted=!0),g.length===0){const b=!this.aborted&&this.centroid;if(this.reset(),b)return b}}}class qh{constructor(l){this.singleTap=new _c(l),this.numTaps=l.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(l,h,g){this.singleTap.touchstart(l,h,g)}touchmove(l,h,g){this.singleTap.touchmove(l,h,g)}touchend(l,h,g){const b=this.singleTap.touchend(l,h,g);if(b){const P=l.timeStamp-this.lastTime<500,z=!this.lastTap||this.lastTap.dist(b)<30;if(P&&z||this.reset(),this.count++,this.lastTime=l.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}}}class m_{constructor(){this._zoomIn=new qh({numTouches:1,numTaps:2}),this._zoomOut=new qh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(l,h,g){this._zoomIn.touchstart(l,h,g),this._zoomOut.touchstart(l,h,g)}touchmove(l,h,g){this._zoomIn.touchmove(l,h,g),this._zoomOut.touchmove(l,h,g)}touchend(l,h,g){const b=this._zoomIn.touchend(l,h,g),P=this._zoomOut.touchend(l,h,g);return b?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:z=>z.easeTo({duration:300,zoom:z.getZoom()+1,around:z.unproject(b)},{originalEvent:l})}):P?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:z=>z.easeTo({duration:300,zoom:z.getZoom()-1,around:z.unproject(P)},{originalEvent:l})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const v_={0:1,2:2};class Dd{constructor(l){this.reset(),this._clickTolerance=l.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(l,h){return!1}_move(l,h){return{}}mousedown(l,h){if(this._lastPoint)return;const g=w.mouseButton(l);this._correctButton(l,g)&&(this._lastPoint=h,this._eventButton=g)}mousemoveWindow(l,h){const g=this._lastPoint;if(g){if(l.preventDefault(),function(b,P){const z=v_[P];return b.buttons===void 0||(b.buttons&z)!==z}(l,this._eventButton))this.reset();else if(this._moved||!(h.dist(g){this._cancelCooperativeMessage=!1},200)}touchstart(l,h,g){return this._calculateTransform(l,h,g)}touchmove(l,h,g){if(this._map._cooperativeGestures&&(this._minTouches===2&&g.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(l,!1,g.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(g.length0&&(this._active=!0);const b=es(g,h),P=new o.pointGeometry(0,0),z=new o.pointGeometry(0,0);let $=0;for(const W in b){const ee=b[W],ie=this._touches[W];ie&&(P._add(ee),z._add(ee.sub(ie)),$++,b[W]=ee)}if(this._touches=b,$Math.abs(x.x)}class Xh extends rl{constructor(l){super(),this._map=l}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(l,h,g){super.touchstart(l,h,g),this._currentTouchCount=g.length}_start(l){this._lastPoints=l,Zh(l[0].sub(l[1]))&&(this._valid=!1)}_move(l,h,g){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const b=l[0].sub(this._lastPoints[0]),P=l[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(b,P,g.timeStamp),this._valid?(this._lastPoints=l,this._active=!0,{pitchDelta:(b.y+P.y)/2*-.5}):void 0}gestureBeginsVertically(l,h,g){if(this._valid!==void 0)return this._valid;const b=l.mag()>=2,P=h.mag()>=2;if(!b&&!P)return;if(!b||!P)return this._firstMove===void 0&&(this._firstMove=g),g-this._firstMove<100&&void 0;const z=l.y>0==h.y>0;return Zh(l)&&Zh(h)&&z}}const dg={panStep:100,bearingStep:15,pitchStep:10};class fg{constructor(){const l=dg;this._panStep=l.panStep,this._bearingStep=l.bearingStep,this._pitchStep=l.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(l){if(l.altKey||l.ctrlKey||l.metaKey)return;let h=0,g=0,b=0,P=0,z=0;switch(l.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:l.shiftKey?g=-1:(l.preventDefault(),P=-1);break;case 39:l.shiftKey?g=1:(l.preventDefault(),P=1);break;case 38:l.shiftKey?b=1:(l.preventDefault(),z=-1);break;case 40:l.shiftKey?b=-1:(l.preventDefault(),z=1);break;default:return}return this._rotationDisabled&&(g=0,b=0),{cameraAnimation:$=>{const V=$.getZoom();$.easeTo({duration:300,easeId:"keyboardHandler",easing:y_,zoom:h?Math.round(V)+h*(l.shiftKey?2:1):V,bearing:$.getBearing()+g*this._bearingStep,pitch:$.getPitch()+b*this._pitchStep,offset:[-P*this._panStep,-z*this._panStep],center:$.getCenter()},{originalEvent:l})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function y_(x){return x*(2-x)}const hg=4.000244140625;class Yh{constructor(l,h){this._map=l,this._el=l.getCanvasContainer(),this._handler=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,o.bindAll(["_onTimeout"],this)}setZoomRate(l){this._defaultZoomRate=l}setWheelZoomRate(l){this._wheelZoomRate=l}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(l){this.isEnabled()||(this._enabled=!0,this._aroundCenter=l&&l.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(l){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;l.preventDefault()}let h=l.deltaMode===WheelEvent.DOM_DELTA_LINE?40*l.deltaY:l.deltaY;const g=o.exported.now(),b=g-(this._lastWheelEventTime||0);this._lastWheelEventTime=g,h!==0&&h%hg==0?this._type="wheel":h!==0&&Math.abs(h)<4?this._type="trackpad":b>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,l)):this._type||(this._type=Math.abs(b*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),l.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=l,this._delta-=h,this._active||this._start(l)),l.preventDefault()}_onTimeout(l){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(l)}_start(l){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const h=w.mousePos(this._el,l);this._around=o.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(h)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const l=this._map.transform;if(this._delta!==0){const $=this._type==="wheel"&&Math.abs(this._delta)>hg?this._wheelZoomRate:this._defaultZoomRate;let V=2/(1+Math.exp(-Math.abs(this._delta*$)));this._delta<0&&V!==0&&(V=1/V);const W=typeof this._targetZoom=="number"?l.zoomScale(this._targetZoom):l.scale;this._targetZoom=Math.min(l.maxZoom,Math.max(l.minZoom,l.scaleZoom(W*V))),this._type==="wheel"&&(this._startZoom=l.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:l.zoom,g=this._startZoom,b=this._easing;let P,z=!1;if(this._type==="wheel"&&g&&b){const $=Math.min((o.exported.now()-this._lastWheelEventTime)/200,1),V=b($);P=o.number(g,h,V),$<1?this._frameId||(this._frameId=!0):z=!0}else P=h,z=!0;return this._active=!0,z&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!z,zoomDelta:P-l.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(l){let h=o.ease;if(this._prevEase){const g=this._prevEase,b=(o.exported.now()-g.start)/g.duration,P=g.easing(b+.01)-g.easing(b),z=.27/Math.sqrt(P*P+1e-4)*.01,$=Math.sqrt(.0729-z*z);h=o.bezier(z,$,.25,1)}return this._prevEase={start:o.exported.now(),duration:l,easing:h},h}reset(){this._active=!1}}class Qh{constructor(l,h){this._clickZoom=l,this._tapZoom=h}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Jh{constructor(){this.reset()}reset(){this._active=!1}dblclick(l,h){return l.preventDefault(),{cameraAnimation:g=>{g.easeTo({duration:300,zoom:g.getZoom()+(l.shiftKey?-1:1),around:g.unproject(h)},{originalEvent:l})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ep{constructor(){this._tap=new qh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(l,h,g){this._swipePoint||(this._tapTime&&l.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?g.length>0&&(this._swipePoint=h[0],this._swipeTouch=g[0].identifier):this._tap.touchstart(l,h,g))}touchmove(l,h,g){if(this._tapTime){if(this._swipePoint){if(g[0].identifier!==this._swipeTouch)return;const b=h[0],P=b.y-this._swipePoint.y;return this._swipePoint=b,l.preventDefault(),this._active=!0,{zoomDelta:P/128}}}else this._tap.touchmove(l,h,g)}touchend(l,h,g){this._tapTime?this._swipePoint&&g.length===0&&this.reset():this._tap.touchend(l,h,g)&&(this._tapTime=l.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class uo{constructor(l,h,g){this._el=l,this._mousePan=h,this._touchPan=g}enable(l){this._inertiaOptions=l||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ts{constructor(l,h,g){this._pitchWithRotate=l.pitchWithRotate,this._mouseRotate=h,this._mousePitch=g}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class pg{constructor(l,h,g,b){this._el=l,this._touchZoom=h,this._touchRotate=g,this._tapDragZoom=b,this._rotationDisabled=!1,this._enabled=!0}enable(l){this._touchZoom.enable(l),this._rotationDisabled||this._touchRotate.enable(l),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const eu=x=>x.zoom||x.drag||x.pitch||x.rotate;class tp extends o.Event{}function wc(x){return x.panDelta&&x.panDelta.mag()||x.zoomDelta||x.bearingDelta||x.pitchDelta}class mg{constructor(l,h){this._map=l,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new lg(l),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h),o.bindAll(["handleEvent","handleWindowEvent"],this);const g=this._el;this._listeners=[[g,"touchstart",{passive:!0}],[g,"touchmove",{passive:!1}],[g,"touchend",void 0],[g,"touchcancel",void 0],[g,"mousedown",void 0],[g,"mousemove",void 0],[g,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[g,"mouseover",void 0],[g,"mouseout",void 0],[g,"dblclick",void 0],[g,"click",void 0],[g,"keydown",{capture:!1}],[g,"keyup",void 0],[g,"wheel",{passive:!1}],[g,"contextmenu",void 0],[window,"blur",void 0]];for(const[b,P,z]of this._listeners)w.addEventListener(b,P,b===document?this.handleWindowEvent:this.handleEvent,z)}destroy(){for(const[l,h,g]of this._listeners)w.removeEventListener(l,h,l===document?this.handleWindowEvent:this.handleEvent,g)}_addDefaultHandlers(l){const h=this._map,g=h.getCanvasContainer();this._add("mapEvent",new p_(h,l));const b=h.boxZoom=new ug(h,l);this._add("boxZoom",b);const P=new m_,z=new Jh;h.doubleClickZoom=new Qh(z,P),this._add("tapZoom",P),this._add("clickZoom",z);const $=new ep;this._add("tapDragZoom",$);const V=h.touchPitch=new Xh(h);this._add("touchPitch",V);const W=new ts(l),ee=new dr(l);h.dragRotate=new Ts(l,W,ee),this._add("mouseRotate",W,["mousePitch"]),this._add("mousePitch",ee,["mouseRotate"]);const ie=new bc(l),fe=new cg(l,h);h.dragPan=new uo(g,ie,fe),this._add("mousePan",ie),this._add("touchPan",fe,["touchZoom","touchRotate"]);const Se=new g_,_e=new Jt;h.touchZoomRotate=new pg(g,_e,Se,$),this._add("touchRotate",Se,["touchPan","touchZoom"]),this._add("touchZoom",_e,["touchPan","touchRotate"]);const we=h.scrollZoom=new Yh(h,this);this._add("scrollZoom",we,["mousePan"]);const $e=h.keyboard=new fg;this._add("keyboard",$e),this._add("blockableMapEvent",new Es(h));for(const Ue of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])l.interactive&&l[Ue]&&h[Ue].enable(l[Ue])}_add(l,h,g){this._handlers.push({handlerName:l,handler:h,allowed:g}),this._handlersById[l]=h}stop(l){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},l),this._changes=[]}}isActive(){for(const{handler:l}of this._handlers)if(l.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(eu(this._eventsInProgress))||this.isZooming()}_blockedByActive(l,h,g){for(const b in l)if(b!==g&&(!h||h.indexOf(b)<0))return!0;return!1}handleWindowEvent(l){this.handleEvent(l,`${l.type}Window`)}_getMapTouches(l){const h=[];for(const g of l)this._el.contains(g.target)&&h.push(g);return h}handleEvent(l,h){if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const g=l.type==="renderFrame"?void 0:l,b={needsRenderFrame:!1},P={},z={},$=l.touches,V=$?this._getMapTouches($):void 0,W=V?w.touchPos(this._el,V):w.mousePos(this._el,l);for(const{handlerName:fe,handler:Se,allowed:_e}of this._handlers){if(!Se.isEnabled())continue;let we;this._blockedByActive(z,_e,fe)?Se.reset():Se[h||l.type]&&(we=Se[h||l.type](l,W,V),this.mergeHandlerResult(b,P,we,fe,g),we&&we.needsRenderFrame&&this._triggerRenderFrame()),(we||Se.isActive())&&(z[fe]=Se)}const ee={};for(const fe in this._previousActiveHandlers)z[fe]||(ee[fe]=g);this._previousActiveHandlers=z,(Object.keys(ee).length||wc(b))&&(this._changes.push([b,P,ee]),this._triggerRenderFrame()),(Object.keys(z).length||wc(b))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ie}=b;ie&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ie(this._map))}mergeHandlerResult(l,h,g,b,P){if(!g)return;o.extend(l,g);const z={handlerName:b,originalEvent:g.originalEvent||P};g.zoomDelta!==void 0&&(h.zoom=z),g.panDelta!==void 0&&(h.drag=z),g.pitchDelta!==void 0&&(h.pitch=z),g.bearingDelta!==void 0&&(h.rotate=z)}_applyChanges(){const l={},h={},g={};for(const[b,P,z]of this._changes)b.panDelta&&(l.panDelta=(l.panDelta||new o.pointGeometry(0,0))._add(b.panDelta)),b.zoomDelta&&(l.zoomDelta=(l.zoomDelta||0)+b.zoomDelta),b.bearingDelta&&(l.bearingDelta=(l.bearingDelta||0)+b.bearingDelta),b.pitchDelta&&(l.pitchDelta=(l.pitchDelta||0)+b.pitchDelta),b.around!==void 0&&(l.around=b.around),b.pinchAround!==void 0&&(l.pinchAround=b.pinchAround),b.noInertia&&(l.noInertia=b.noInertia),o.extend(h,P),o.extend(g,z);this._updateMapTransform(l,h,g),this._changes=[]}_updateMapTransform(l,h,g){const b=this._map,P=b.transform,z=b.style&&b.style.terrain;if(!(wc(l)||z&&this._drag))return this._fireEvents(h,g,!0);let{panDelta:$,zoomDelta:V,bearingDelta:W,pitchDelta:ee,around:ie,pinchAround:fe}=l;fe!==void 0&&(ie=fe),b._stop(!0),ie=ie||b.transform.centerPoint;const Se=P.pointLocation($?ie.sub($):ie);W&&(P.bearing+=W),ee&&(P.pitch+=ee),V&&(P.zoom+=V),z?h.drag&&!this._drag?(this._drag={center:P.centerPoint,lngLat:P.pointLocation(ie),point:ie,handlerName:h.drag.handlerName},b.fire(new o.Event("freezeElevation",{freeze:!0}))):this._drag&&g[this._drag.handlerName]?(b.fire(new o.Event("freezeElevation",{freeze:!1})),this._drag=null):h.drag&&this._drag&&(P.center=P.pointLocation(P.centerPoint.sub($))):P.setLocationAtPoint(Se,ie),this._map._update(),l.noInertia||this._inertia.record(l),this._fireEvents(h,g,!0)}_fireEvents(l,h,g){const b=eu(this._eventsInProgress),P=eu(l),z={};for(const ee in l){const{originalEvent:ie}=l[ee];this._eventsInProgress[ee]||(z[`${ee}start`]=ie),this._eventsInProgress[ee]=l[ee]}!b&&P&&this._fireEvent("movestart",P.originalEvent);for(const ee in z)this._fireEvent(ee,z[ee]);P&&this._fireEvent("move",P.originalEvent);for(const ee in l){const{originalEvent:ie}=l[ee];this._fireEvent(ee,ie)}const $={};let V;for(const ee in this._eventsInProgress){const{handlerName:ie,originalEvent:fe}=this._eventsInProgress[ee];this._handlersById[ie].isActive()||(delete this._eventsInProgress[ee],V=h[ie]||fe,$[`${ee}end`]=V)}for(const ee in $)this._fireEvent(ee,$[ee]);const W=eu(this._eventsInProgress);if(g&&(b||P)&&!W){this._updatingCamera=!0;const ee=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ie=fe=>fe!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new tp("renderFrame",{timeStamp:l})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const jo={extend:(x,...l)=>o.extend(x,...l),run(x){x()},logToElement(x,l=!1,h="log"){const g=window.document.getElementById(h);g&&(l&&(g.innerHTML=""),g.innerHTML+=`
${x}`)}};class Nn extends o.Evented{constructor(l,h){super(),this._moving=!1,this._zooming=!1,this.transform=l,this._bearingSnap=h.bearingSnap,o.bindAll(["_renderFrameCallback"],this)}getCenter(){return new o.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(l,h){return this.jumpTo({center:l},h)}panBy(l,h,g){return l=o.pointGeometry.convert(l).mult(-1),this.panTo(this.transform.center,o.extend({offset:l},h),g)}panTo(l,h,g){return this.easeTo(o.extend({center:l},h),g)}getZoom(){return this.transform.zoom}setZoom(l,h){return this.jumpTo({zoom:l},h),this}zoomTo(l,h,g){return this.easeTo(o.extend({zoom:l},h),g)}zoomIn(l,h){return this.zoomTo(this.getZoom()+1,l,h),this}zoomOut(l,h){return this.zoomTo(this.getZoom()-1,l,h),this}getBearing(){return this.transform.bearing}setBearing(l,h){return this.jumpTo({bearing:l},h),this}getPadding(){return this.transform.padding}setPadding(l,h){return this.jumpTo({padding:l},h),this}rotateTo(l,h,g){return this.easeTo(o.extend({bearing:l},h),g)}resetNorth(l,h){return this.rotateTo(0,o.extend({duration:1e3},l),h),this}resetNorthPitch(l,h){return this.easeTo(o.extend({bearing:0,pitch:0,duration:1e3},l),h),this}snapToNorth(l,h){return Math.abs(this.getBearing()){if(this._zooming&&(g.zoom=o.number(b,V,gt)),this._rotating&&(g.bearing=o.number(P,W,gt)),this._pitching&&(g.pitch=o.number(z,ee,gt)),this._padding&&(g.interpolatePadding($,ie,gt),Se=g.centerPoint.add(fe)),Pe)g.setLocationAtPoint(Pe,at);else{const yt=g.zoomScale(g.zoom-b),zt=V>b?Math.min(2,et):Math.max(.5,et),vt=Math.pow(zt,1-gt),nr=g.unproject($e.add(Ue.mult(gt*vt)).mult(yt));g.setLocationAtPoint(g.renderWorldCopies?nr.wrap():nr,Se)}this._fireMoveEvents(h)},gt=>{this._afterEase(h,gt)},l),this}_prepareEase(l,h,g={}){this._moving=!0,this.fire(new o.Event("freezeElevation",{freeze:!0})),h||g.moving||this.fire(new o.Event("movestart",l)),this._zooming&&!g.zooming&&this.fire(new o.Event("zoomstart",l)),this._rotating&&!g.rotating&&this.fire(new o.Event("rotatestart",l)),this._pitching&&!g.pitching&&this.fire(new o.Event("pitchstart",l))}_fireMoveEvents(l){this.fire(new o.Event("move",l)),this._zooming&&this.fire(new o.Event("zoom",l)),this._rotating&&this.fire(new o.Event("rotate",l)),this._pitching&&this.fire(new o.Event("pitch",l))}_afterEase(l,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId,this.fire(new o.Event("freezeElevation",{freeze:!1}));const g=this._zooming,b=this._rotating,P=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,g&&this.fire(new o.Event("zoomend",l)),b&&this.fire(new o.Event("rotateend",l)),P&&this.fire(new o.Event("pitchend",l)),this.fire(new o.Event("moveend",l))}flyTo(l,h){if(!l.essential&&o.exported.prefersReducedMotion){const _r=o.pick(l,["center","zoom","bearing","pitch","around"]);return this.jumpTo(_r,h)}this.stop(),l=o.extend({offset:[0,0],speed:1.2,curve:1.42,easing:o.ease},l);const g=this.transform,b=this.getZoom(),P=this.getBearing(),z=this.getPitch(),$=this.getPadding(),V="zoom"in l?o.clamp(+l.zoom,g.minZoom,g.maxZoom):b,W="bearing"in l?this._normalizeBearing(l.bearing,P):P,ee="pitch"in l?+l.pitch:z,ie="padding"in l?l.padding:g.padding,fe=g.zoomScale(V-b),Se=o.pointGeometry.convert(l.offset);let _e=g.centerPoint.add(Se);const we=g.pointLocation(_e),$e=o.LngLat.convert(l.center||we);this._normalizeCenter($e);const Ue=g.project(we),et=g.project($e).sub(Ue);let Pe=l.curve;const at=Math.max(g.width,g.height),rt=at/fe,gt=et.mag();if("minZoom"in l){const _r=o.clamp(Math.min(l.minZoom,b,V),g.minZoom,g.maxZoom),dn=at/g.zoomScale(_r-b);Pe=Math.sqrt(dn/gt*2)}const yt=Pe*Pe;function zt(_r){const dn=(rt*rt-at*at+(_r?-1:1)*yt*yt*gt*gt)/(2*(_r?rt:at)*yt*gt);return Math.log(Math.sqrt(dn*dn+1)-dn)}function vt(_r){return(Math.exp(_r)-Math.exp(-_r))/2}function nr(_r){return(Math.exp(_r)+Math.exp(-_r))/2}const Gt=zt(0);let sr=function(_r){return nr(Gt)/nr(Gt+Pe*_r)},Nr=function(_r){return at*((nr(Gt)*(vt(dn=Gt+Pe*_r)/nr(dn))-vt(Gt))/yt)/gt;var dn},Br=(zt(1)-Gt)/Pe;if(Math.abs(gt)<1e-6||!isFinite(Br)){if(Math.abs(at-rt)<1e-6)return this.easeTo(l,h);const _r=rtl.maxDuration&&(l.duration=0),this._zooming=!0,this._rotating=P!==W,this._pitching=ee!==z,this._padding=!g.isPaddingEqual(ie),this._prepareEase(h,!1),this._ease(_r=>{const dn=_r*Br,fn=1/sr(dn);g.zoom=_r===1?V:b+g.scaleZoom(fn),this._rotating&&(g.bearing=o.number(P,W,_r)),this._pitching&&(g.pitch=o.number(z,ee,_r)),this._padding&&(g.interpolatePadding($,ie,_r),_e=g.centerPoint.add(Se));const Yr=_r===1?$e:g.unproject(Ue.add(et.mult(Nr(dn))).mult(fn));g.setLocationAtPoint(g.renderWorldCopies?Yr.wrap():Yr,_e),this._fireMoveEvents(h)},()=>this._afterEase(h),l),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(l,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const g=this._onEaseEnd;delete this._onEaseEnd,g.call(this,h)}if(!l){const g=this.handlers;g&&g.stop(!1)}return this}_ease(l,h,g){g.animate===!1||g.duration===0?(l(1),h()):(this._easeStart=o.exported.now(),this._easeOptions=g,this._onEaseFrame=l,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const l=Math.min((o.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(l,h){l=o.wrap(l,-180,180);const g=Math.abs(l-h);return Math.abs(l-360-h)180?-360:g<-180?360:0}}class Cc{constructor(l={}){this.options=l,o.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(l){return this._map=l,this._compact=this.options&&this.options.compact,this._container=w.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=w.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=w.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){w.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(l,h){const g=this._map._getUIString(`AttributionControl.${h}`);l.title=g,l.setAttribute("aria-label",g)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(l){!l||l.sourceDataType!=="metadata"&&l.sourceDataType!=="visibility"&&l.dataType!=="style"&&l.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let l=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?l=l.concat(this.options.customAttribution.map(b=>typeof b!="string"?"":b)):typeof this.options.customAttribution=="string"&&l.push(this.options.customAttribution)),this._map.style.stylesheet){const b=this._map.style.stylesheet;this.styleOwner=b.owner,this.styleId=b.id}const h=this._map.style.sourceCaches;for(const b in h){const P=h[b];if(P.used||P.usedForTerrain){const z=P.getSource();z.attribution&&l.indexOf(z.attribution)<0&&l.push(z.attribution)}}l=l.filter(b=>String(b).trim()),l.sort((b,P)=>b.length-P.length),l=l.filter((b,P)=>{for(let z=P+1;z=0)return!1;return!0});const g=l.join(" | ");g!==this._attribHTML&&(this._attribHTML=g,l.length?(this._innerContainer.innerHTML=g,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class Fd{constructor(l={}){this.options=l,o.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(l){this._map=l,this._compact=this.options&&this.options.compact,this._container=w.create("div","maplibregl-ctrl mapboxgl-ctrl");const h=w.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){w.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const l=this._container.children;if(l.length){const h=l[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&h.classList.add("maplibregl-compact","mapboxgl-compact"):h.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class vg{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(l){const h=++this._id;return this._queue.push({callback:l,id:h,cancelled:!1}),h}remove(l){const h=this._currentlyRunning,g=h?this._queue.concat(h):this._queue;for(const b of g)if(b.id===l)return void(b.cancelled=!0)}run(l=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const g of h)if(!g.cancelled&&(g.callback(l),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const gg={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"},yg={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},x_={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ea{constructor(l,h,g=!1){this._clickTolerance=10,this.element=h,this.mouseRotate=new ts({clickTolerance:l.dragRotate._mouseRotate._clickTolerance}),this.map=l,g&&(this.mousePitch=new dr({clickTolerance:l.dragRotate._mousePitch._clickTolerance})),o.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),w.addEventListener(h,"mousedown",this.mousedown),w.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),w.addEventListener(h,"touchmove",this.touchmove),w.addEventListener(h,"touchend",this.touchend),w.addEventListener(h,"touchcancel",this.reset)}down(l,h){this.mouseRotate.mousedown(l,h),this.mousePitch&&this.mousePitch.mousedown(l,h),w.disableDrag()}move(l,h){const g=this.map,b=this.mouseRotate.mousemoveWindow(l,h);if(b&&b.bearingDelta&&g.setBearing(g.getBearing()+b.bearingDelta),this.mousePitch){const P=this.mousePitch.mousemoveWindow(l,h);P&&P.pitchDelta&&g.setPitch(g.getPitch()+P.pitchDelta)}}off(){const l=this.element;w.removeEventListener(l,"mousedown",this.mousedown),w.removeEventListener(l,"touchstart",this.touchstart,{passive:!1}),w.removeEventListener(l,"touchmove",this.touchmove),w.removeEventListener(l,"touchend",this.touchend),w.removeEventListener(l,"touchcancel",this.reset),this.offTemp()}offTemp(){w.enableDrag(),w.removeEventListener(window,"mousemove",this.mousemove),w.removeEventListener(window,"mouseup",this.mouseup)}mousedown(l){this.down(o.extend({},l,{ctrlKey:!0,preventDefault:()=>l.preventDefault()}),w.mousePos(this.element,l)),w.addEventListener(window,"mousemove",this.mousemove),w.addEventListener(window,"mouseup",this.mouseup)}mousemove(l){this.move(l,w.mousePos(this.element,l))}mouseup(l){this.mouseRotate.mouseupWindow(l),this.mousePitch&&this.mousePitch.mouseupWindow(l),this.offTemp()}touchstart(l){l.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=w.touchPos(this.element,l.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>l.preventDefault()},this._startPos))}touchmove(l){l.targetTouches.length!==1?this.reset():(this._lastPos=w.touchPos(this.element,l.targetTouches)[0],this.move({preventDefault:()=>l.preventDefault()},this._lastPos))}touchend(l){l.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const g=h.locationPoint(x);if(g.x>=0&&g.y>=0&&g.x<=h.width&&g.y<=h.height)break;x.lng>h.center.lng?x.lng-=360:x.lng+=360}return x}const pr={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Sr(x,l,h){const g=x.classList;for(const b in pr)g.remove(`maplibregl-${h}-anchor-${b}`,`mapboxgl-${h}-anchor-${b}`);g.add(`maplibregl-${h}-anchor-${l}`,`mapboxgl-${h}-anchor-${l}`)}class tu extends o.Evented{constructor(l,h){if(super(),(l instanceof HTMLElement||h)&&(l=o.extend({element:l},h)),o.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=l&&l.anchor||"center",this._color=l&&l.color||"#3FB1CE",this._scale=l&&l.scale||1,this._draggable=l&&l.draggable||!1,this._clickTolerance=l&&l.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=l&&l.rotation||0,this._rotationAlignment=l&&l.rotationAlignment||"auto",this._pitchAlignment=l&&l.pitchAlignment&&l.pitchAlignment!=="auto"?l.pitchAlignment:this._rotationAlignment,l&&l.element)this._element=l.element,this._offset=o.pointGeometry.convert(l&&l.offset||[0,0]);else{this._defaultMarker=!0,this._element=w.create("div"),this._element.setAttribute("aria-label","Map marker");const g=w.createNS("http://www.w3.org/2000/svg","svg"),b=41,P=27;g.setAttributeNS(null,"display","block"),g.setAttributeNS(null,"height",`${b}px`),g.setAttributeNS(null,"width",`${P}px`),g.setAttributeNS(null,"viewBox",`0 0 ${P} ${b}`);const z=w.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"stroke","none"),z.setAttributeNS(null,"stroke-width","1"),z.setAttributeNS(null,"fill","none"),z.setAttributeNS(null,"fill-rule","evenodd");const $=w.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"fill-rule","nonzero");const V=w.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(3.0, 29.0)"),V.setAttributeNS(null,"fill","#000000");const W=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const et of W){const Pe=w.createNS("http://www.w3.org/2000/svg","ellipse");Pe.setAttributeNS(null,"opacity","0.04"),Pe.setAttributeNS(null,"cx","10.5"),Pe.setAttributeNS(null,"cy","5.80029008"),Pe.setAttributeNS(null,"rx",et.rx),Pe.setAttributeNS(null,"ry",et.ry),V.appendChild(Pe)}const ee=w.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"fill",this._color);const ie=w.createNS("http://www.w3.org/2000/svg","path");ie.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),ee.appendChild(ie);const fe=w.createNS("http://www.w3.org/2000/svg","g");fe.setAttributeNS(null,"opacity","0.25"),fe.setAttributeNS(null,"fill","#000000");const Se=w.createNS("http://www.w3.org/2000/svg","path");Se.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),fe.appendChild(Se);const _e=w.createNS("http://www.w3.org/2000/svg","g");_e.setAttributeNS(null,"transform","translate(6.0, 7.0)"),_e.setAttributeNS(null,"fill","#FFFFFF");const we=w.createNS("http://www.w3.org/2000/svg","g");we.setAttributeNS(null,"transform","translate(8.0, 8.0)");const $e=w.createNS("http://www.w3.org/2000/svg","circle");$e.setAttributeNS(null,"fill","#000000"),$e.setAttributeNS(null,"opacity","0.25"),$e.setAttributeNS(null,"cx","5.5"),$e.setAttributeNS(null,"cy","5.5"),$e.setAttributeNS(null,"r","5.4999962");const Ue=w.createNS("http://www.w3.org/2000/svg","circle");Ue.setAttributeNS(null,"fill","#FFFFFF"),Ue.setAttributeNS(null,"cx","5.5"),Ue.setAttributeNS(null,"cy","5.5"),Ue.setAttributeNS(null,"r","5.4999962"),we.appendChild($e),we.appendChild(Ue),$.appendChild(V),$.appendChild(ee),$.appendChild(fe),$.appendChild(_e),$.appendChild(we),g.appendChild($),g.setAttributeNS(null,"height",b*this._scale+"px"),g.setAttributeNS(null,"width",P*this._scale+"px"),this._element.appendChild(g),this._offset=o.pointGeometry.convert(l&&l.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",g=>{g.preventDefault()}),this._element.addEventListener("mousedown",g=>{g.preventDefault()}),Sr(this._element,this._anchor,"marker"),this._popup=null}addTo(l){return this.remove(),this._map=l,l.getCanvasContainer().appendChild(this._element),l.on("move",this._update),l.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),w.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(l){return this._lngLat=o.LngLat.convert(l),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(l){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),l){if(!("offset"in l.options)){const b=Math.sqrt(Math.pow(13.5,2)/2);l.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[b,-1*(38.1-13.5+b)],"bottom-right":[-b,-1*(38.1-13.5+b)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=l,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(l){const h=l.code,g=l.charCode||l.keyCode;h!=="Space"&&h!=="Enter"&&g!==32&&g!==13||this.togglePopup()}_onMapClick(l){const h=l.originalEvent.target,g=this._element;this._popup&&(h===g||g.contains(h))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const l=this._popup;return l?(l.isOpen()?l.remove():l.addTo(this._map),this):this}_update(l){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Sc(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let h="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?h=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let g="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?g="rotateX(0deg)":this._pitchAlignment==="map"&&(g=`rotateX(${this._map.getPitch()}deg)`),l&&l.type!=="moveend"||(this._pos=this._pos.round()),w.setTransform(this._element,`${pr[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${g} ${h}`),this._map.style&&this._map.style.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const b=this._map.unproject(this._pos),P=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=b.distanceTo(this._lngLat)>20*P?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(l){return this._offset=o.pointGeometry.convert(l),this._update(),this}_onMove(l){if(!this._isDragging){const h=this._clickTolerance||this._map._clickTolerance;this._isDragging=l.point.dist(this._pointerdownPos)>=h}this._isDragging&&(this._pos=l.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.Event("dragstart"))),this.fire(new o.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new o.Event("dragend")),this._state="inactive"}_addDragHandler(l){this._element.contains(l.originalEvent.target)&&(l.preventDefault(),this._positionDelta=l.point.sub(this._pos).add(this._offset),this._pointerdownPos=l.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(l){return this._draggable=!!l,this._map&&(l?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(l){return this._rotation=l||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(l){return this._rotationAlignment=l||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(l){return this._pitchAlignment=l&&l!=="auto"?l:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const rp={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ps,Li=0,Ms=!1;const ka={maxWidth:100,unit:"metric"};function xg(x,l,h){const g=h&&h.maxWidth||100,b=x._container.clientHeight/2,P=x.unproject([0,b]),z=x.unproject([g,b]),$=P.distanceTo(z);if(h&&h.unit==="imperial"){const V=3.2808*$;V>5280?Is(l,g,V/5280,x._getUIString("ScaleControl.Miles")):Is(l,g,V,x._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?Is(l,g,$/1852,x._getUIString("ScaleControl.NauticalMiles")):$>=1e3?Is(l,g,$/1e3,x._getUIString("ScaleControl.Kilometers")):Is(l,g,$,x._getUIString("ScaleControl.Meters"))}function Is(x,l,h,g){const b=function(P){const z=Math.pow(10,`${Math.floor(P)}`.length-1);let $=P/z;return $=$>=10?10:$>=5?5:$>=3?3:$>=2?2:$>=1?1:function(V){const W=Math.pow(10,Math.ceil(-Math.log(V)/Math.LN10));return Math.round(V*W)/W}($),z*$}(h);x.style.width=l*(b/h)+"px",x.innerHTML=`${b} ${g}`}const ei={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ci=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function np(x){if(x){if(typeof x=="number"){const l=Math.round(Math.sqrt(.5*Math.pow(x,2)));return{center:new o.pointGeometry(0,0),top:new o.pointGeometry(0,x),"top-left":new o.pointGeometry(l,l),"top-right":new o.pointGeometry(-l,l),bottom:new o.pointGeometry(0,-x),"bottom-left":new o.pointGeometry(l,-l),"bottom-right":new o.pointGeometry(-l,-l),left:new o.pointGeometry(x,0),right:new o.pointGeometry(-x,0)}}if(x instanceof o.pointGeometry||Array.isArray(x)){const l=o.pointGeometry.convert(x);return{center:l,top:l,"top-left":l,"top-right":l,bottom:l,"bottom-left":l,"bottom-right":l,left:l,right:l}}return{center:o.pointGeometry.convert(x.center||[0,0]),top:o.pointGeometry.convert(x.top||[0,0]),"top-left":o.pointGeometry.convert(x["top-left"]||[0,0]),"top-right":o.pointGeometry.convert(x["top-right"]||[0,0]),bottom:o.pointGeometry.convert(x.bottom||[0,0]),"bottom-left":o.pointGeometry.convert(x["bottom-left"]||[0,0]),"bottom-right":o.pointGeometry.convert(x["bottom-right"]||[0,0]),left:o.pointGeometry.convert(x.left||[0,0]),right:o.pointGeometry.convert(x.right||[0,0])}}return np(new o.pointGeometry(0,0))}const nl={supported:f,setRTLTextPlugin:o.setRTLTextPlugin,getRTLTextPluginStatus:o.getRTLTextPluginStatus,Map:class extends Nn{constructor(x){var l;if(o.PerformanceUtils.mark(o.PerformanceMarkers.create),(x=o.extend({},yg,x)).minZoom!=null&&x.maxZoom!=null&&x.minZoom>x.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(x.minPitch!=null&&x.maxPitch!=null&&x.minPitch>x.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(x.minPitch!=null&&x.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(x.maxPitch!=null&&x.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new mc(x.minZoom,x.maxZoom,x.minPitch,x.maxPitch,x.renderWorldCopies),{bearingSnap:x.bearingSnap}),this._interactive=x.interactive,this._cooperativeGestures=x.cooperativeGestures,this._maxTileCacheSize=x.maxTileCacheSize,this._failIfMajorPerformanceCaveat=x.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=x.preserveDrawingBuffer,this._antialias=x.antialias,this._trackResize=x.trackResize,this._bearingSnap=x.bearingSnap,this._refreshExpiredTiles=x.refreshExpiredTiles,this._fadeDuration=x.fadeDuration,this._crossSourceCollisions=x.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=x.collectResourceTiming,this._renderTaskQueue=new vg,this._controls=[],this._mapId=o.uniqueId(),this._locale=o.extend({},gg,x.locale),this._clickTolerance=x.clickTolerance,this._pixelRatio=(l=x.pixelRatio)!==null&&l!==void 0?l:devicePixelRatio,this._requestManager=new k(x.transformRequest),typeof x.container=="string"){if(this._container=document.getElementById(x.container),!this._container)throw new Error(`Container '${x.container}' not found.`)}else{if(!(x.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=x.container}if(x.maxBounds&&this.setMaxBounds(x.maxBounds),o.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new mg(this,x),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=x.hash&&new ig(typeof x.hash=="string"&&x.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:x.center,zoom:x.zoom,bearing:x.bearing,pitch:x.pitch}),x.bounds&&(this.resize(),this.fitBounds(x.bounds,o.extend({},x.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=x.localIdeographFontFamily,x.style&&this.setStyle(x.style,{localIdeographFontFamily:x.localIdeographFontFamily}),x.attributionControl&&this.addControl(new Cc({customAttribution:x.customAttribution})),x.maplibreLogo&&this.addControl(new Fd,x.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",h=>{this._update(h.dataType==="style"),this.fire(new o.Event(`${h.dataType}data`,h))}),this.on("dataloading",h=>{this.fire(new o.Event(`${h.dataType}dataloading`,h))}),this.on("dataabort",h=>{this.fire(new o.Event("sourcedataabort",h))})}_getMapId(){return this._mapId}addControl(x,l){if(l===void 0&&(l=x.getDefaultPosition?x.getDefaultPosition():"top-right"),!x||!x.onAdd)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=x.onAdd(this);this._controls.push(x);const g=this._controlPositions[l];return l.indexOf("bottom")!==-1?g.insertBefore(h,g.firstChild):g.appendChild(h),this}removeControl(x){if(!x||!x.onRemove)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const l=this._controls.indexOf(x);return l>-1&&this._controls.splice(l,1),x.onRemove(this),this}hasControl(x){return this._controls.indexOf(x)>-1}calculateCameraOptionsFromTo(x,l,h,g){return g==null&&this.style.terrain&&(g=this.transform.getElevation(h,this.style.terrain)),super.calculateCameraOptionsFromTo(x,l,h,g)}resize(x){const l=this._containerDimensions(),h=l[0],g=l[1];this._resizeCanvas(h,g,this.getPixelRatio()),this.transform.resize(h,g),this.painter.resize(h,g,this.getPixelRatio());const b=!this._moving;return b&&(this.stop(),this.fire(new o.Event("movestart",x)).fire(new o.Event("move",x))),this.fire(new o.Event("resize",x)),b&&this.fire(new o.Event("moveend",x)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(x){const[l,h]=this._containerDimensions();this._pixelRatio=x,this._resizeCanvas(l,h,x),this.painter.resize(l,h,x)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(x){return this.transform.setMaxBounds(o.LngLatBounds.convert(x)),this._update()}setMinZoom(x){if((x=x==null?-2:x)>=-2&&x<=this.transform.maxZoom)return this.transform.minZoom=x,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=x,this._update(),this.getZoom()>x&&this.setZoom(x),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(x){if((x=x==null?0:x)<0)throw new Error("minPitch must be greater than or equal to 0");if(x>=0&&x<=this.transform.maxPitch)return this.transform.minPitch=x,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(x>=this.transform.minPitch)return this.transform.maxPitch=x,this._update(),this.getPitch()>x&&this.setPitch(x),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(x){return this.transform.renderWorldCopies=x,this._update()}project(x){return this.transform.locationPoint(o.LngLat.convert(x),this.style&&this.style.terrain)}unproject(x){return this.transform.pointLocation(o.pointGeometry.convert(x),this.style&&this.style.terrain)}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(x,l,h){if(x==="mouseenter"||x==="mouseover"){let g=!1;return{layer:l,listener:h,delegates:{mousemove:P=>{const z=this.getLayer(l)?this.queryRenderedFeatures(P.point,{layers:[l]}):[];z.length?g||(g=!0,h.call(this,new Co(x,this,P.originalEvent,{features:z}))):g=!1},mouseout:()=>{g=!1}}}}if(x==="mouseleave"||x==="mouseout"){let g=!1;return{layer:l,listener:h,delegates:{mousemove:z=>{(this.getLayer(l)?this.queryRenderedFeatures(z.point,{layers:[l]}):[]).length?g=!0:g&&(g=!1,h.call(this,new Co(x,this,z.originalEvent)))},mouseout:z=>{g&&(g=!1,h.call(this,new Co(x,this,z.originalEvent)))}}}}{const g=b=>{const P=this.getLayer(l)?this.queryRenderedFeatures(b.point,{layers:[l]}):[];P.length&&(b.features=P,h.call(this,b),delete b.features)};return{layer:l,listener:h,delegates:{[x]:g}}}}on(x,l,h){if(h===void 0)return super.on(x,l);const g=this._createDelegatedListener(x,l,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[x]=this._delegatedListeners[x]||[],this._delegatedListeners[x].push(g);for(const b in g.delegates)this.on(b,g.delegates[b]);return this}once(x,l,h){if(h===void 0)return super.once(x,l);const g=this._createDelegatedListener(x,l,h);for(const b in g.delegates)this.once(b,g.delegates[b]);return this}off(x,l,h){return h===void 0?super.off(x,l):(this._delegatedListeners&&this._delegatedListeners[x]&&(g=>{const b=this._delegatedListeners[x];for(let P=0;P{g?this.fire(new o.ErrorEvent(g)):b&&this._updateDiff(b,l)})}else typeof x=="object"&&this._updateDiff(x,l)}_updateDiff(x,l){try{this.style.setState(x)&&this._update(!0)}catch(h){o.warnOnce(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(x,l)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.warnOnce("There is no style added to the map.")}addSource(x,l){return this._lazyInitEmptyStyle(),this.style.addSource(x,l),this._update(!0)}isSourceLoaded(x){const l=this.style&&this.style.sourceCaches[x];if(l!==void 0)return l.loaded();this.fire(new o.ErrorEvent(new Error(`There is no source with ID '${x}'`)))}setTerrain(x){return this.style.setTerrain(x),this}getTerrain(){return this.style.terrain&&this.style.terrain.options}areTilesLoaded(){const x=this.style&&this.style.sourceCaches;for(const l in x){const h=x[l]._tiles;for(const g in h){const b=h[g];if(b.state!=="loaded"&&b.state!=="errored")return!1}}return!0}addSourceType(x,l,h){return this._lazyInitEmptyStyle(),this.style.addSourceType(x,l,h)}removeSource(x){return this.style.removeSource(x),this._update(!0)}getSource(x){return this.style.getSource(x)}addImage(x,l,{pixelRatio:h=1,sdf:g=!1,stretchX:b,stretchY:P,content:z}={}){if(this._lazyInitEmptyStyle(),l instanceof HTMLImageElement||o.isImageBitmap(l)){const{width:$,height:V,data:W}=o.exported.getImageData(l);this.style.addImage(x,{data:new o.RGBAImage({width:$,height:V},W),pixelRatio:h,stretchX:b,stretchY:P,content:z,sdf:g,version:0})}else{if(l.width===void 0||l.height===void 0)return this.fire(new o.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:$,height:V,data:W}=l,ee=l;this.style.addImage(x,{data:new o.RGBAImage({width:$,height:V},new Uint8Array(W)),pixelRatio:h,stretchX:b,stretchY:P,content:z,sdf:g,version:0,userImage:ee}),ee.onAdd&&ee.onAdd(this,x)}}}updateImage(x,l){const h=this.style.getImage(x);if(!h)return this.fire(new o.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const g=l instanceof HTMLImageElement||o.isImageBitmap(l)?o.exported.getImageData(l):l,{width:b,height:P,data:z}=g;if(b===void 0||P===void 0)return this.fire(new o.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(b!==h.data.width||P!==h.data.height)return this.fire(new o.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const $=!(l instanceof HTMLImageElement||o.isImageBitmap(l));h.data.replace(z,$),this.style.updateImage(x,h)}hasImage(x){return x?!!this.style.getImage(x):(this.fire(new o.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(x){this.style.removeImage(x)}loadImage(x,l){o.getImage(this._requestManager.transformRequest(x,o.ResourceType.Image),l)}listImages(){return this.style.listImages()}addLayer(x,l){return this._lazyInitEmptyStyle(),this.style.addLayer(x,l),this._update(!0)}moveLayer(x,l){return this.style.moveLayer(x,l),this._update(!0)}removeLayer(x){return this.style.removeLayer(x),this._update(!0)}getLayer(x){return this.style.getLayer(x)}setLayerZoomRange(x,l,h){return this.style.setLayerZoomRange(x,l,h),this._update(!0)}setFilter(x,l,h={}){return this.style.setFilter(x,l,h),this._update(!0)}getFilter(x){return this.style.getFilter(x)}setPaintProperty(x,l,h,g={}){return this.style.setPaintProperty(x,l,h,g),this._update(!0)}getPaintProperty(x,l){return this.style.getPaintProperty(x,l)}setLayoutProperty(x,l,h,g={}){return this.style.setLayoutProperty(x,l,h,g),this._update(!0)}getLayoutProperty(x,l){return this.style.getLayoutProperty(x,l)}setLight(x,l={}){return this._lazyInitEmptyStyle(),this.style.setLight(x,l),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(x,l){return this.style.setFeatureState(x,l),this._update()}removeFeatureState(x,l){return this.style.removeFeatureState(x,l),this._update()}getFeatureState(x){return this.style.getFeatureState(x)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let x=0,l=0;return this._container&&(x=this._container.clientWidth||400,l=this._container.clientHeight||300),[x,l]}_setupContainer(){const x=this._container;x.classList.add("maplibregl-map","mapboxgl-map");const l=this._canvasContainer=w.create("div","maplibregl-canvas-container mapboxgl-canvas-container",x);this._interactive&&l.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=w.create("canvas","maplibregl-canvas mapboxgl-canvas",l),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const h=this._containerDimensions();this._resizeCanvas(h[0],h[1],this.getPixelRatio());const g=this._controlContainer=w.create("div","maplibregl-control-container mapboxgl-control-container",x),b=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(P=>{b[P]=w.create("div",`maplibregl-ctrl-${P} mapboxgl-ctrl-${P}`,g)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const x=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=w.create("div","maplibregl-cooperative-gesture-screen",x);let l="Control",h=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(h=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",l="Meta"),this._cooperativeGesturesScreen.innerHTML=`
${h}
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
`,document.addEventListener("keydown",g=>{g.key===l&&(this._metaPress=!0)}),document.addEventListener("keyup",g=>{g.key===l&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",g=>{this._onCooperativeGesture(g,this._metaPress,1)},!1),this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan","maplibregl-touch-drag-pan")}_resizeCanvas(x,l,h){this._canvas.width=h*x,this._canvas.height=h*l,this._canvas.style.width=`${x}px`,this._canvas.style.height=`${l}px`}_setupPainter(){const x=o.extend({},f.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),l=this._canvas.getContext("webgl",x)||this._canvas.getContext("experimental-webgl",x);l?(this.painter=new Wh(l,this.transform),o.exported$1.testSupport(l)):this.fire(new o.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(x){x.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.Event("webglcontextlost",{originalEvent:x}))}_contextRestored(x){this._setupPainter(),this.resize(),this._update(),this.fire(new o.Event("webglcontextrestored",{originalEvent:x}))}_onMapScroll(x){if(x.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(x,l,h){return!l&&h<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(x){return this.style?(this._styleDirty=this._styleDirty||x,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(x){return this._update(),this._renderTaskQueue.add(x)}_cancelRenderFrame(x){this._renderTaskQueue.remove(x)}_render(x){let l,h=0;const g=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(l=g.createQueryEXT(),g.beginQueryEXT(g.TIME_ELAPSED_EXT,l),h=o.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(x),this._removed)return;let b=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const z=this.transform.zoom,$=o.exported.now();this.style.zoomHistory.update(z,$);const V=new o.EvaluationParameters(z,{now:$,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),W=V.crossFadingFactor();W===1&&W===this._crossFadingFactor||(b=!0,this._crossFadingFactor=W),this.style.update(V)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.style.terrain&&this.style.terrain.sourceCache.update(this.transform,this.style.terrain),this.transform.updateElevation(this.style.terrain),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new o.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.load),this.fire(new o.Event("load"))),this.style&&(this.style.hasTransitions()||b)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const z=o.exported.now()-h;g.endQueryEXT(g.TIME_ELAPSED_EXT,l),setTimeout(()=>{const $=g.getQueryObjectEXT(l,g.QUERY_RESULT_EXT)/1e6;g.deleteQueryEXT(l),this.fire(new o.Event("gpu-timing-frame",{cpuTime:z,gpuTime:$}))},50)}if(this.listens("gpu-timing-layer")){const z=this.painter.collectGpuTimers();setTimeout(()=>{const $=this.painter.queryGpuTimers(z);this.fire(new o.Event("gpu-timing-layer",{layerTimes:$}))},50)}const P=this._sourcesDirty||this._styleDirty||this._placementDirty;return P||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.Event("idle")),!this._loaded||this._fullyLoaded||P||(this._fullyLoaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const l of this._controls)l.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));const x=this.painter.context.gl.getExtension("WEBGL_lose_context");x&&x.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),w.remove(this._canvasContainer),w.remove(this._controlContainer),this._cooperativeGestures&&w.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map","mapboxgl-map"),o.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new o.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=o.exported.frame(x=>{o.PerformanceUtils.frame(x),this._frame=null,this._render(x)}))}_onWindowOnline(){this._update()}_onWindowResize(x){this._trackResize&&this.resize({originalEvent:x})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(x){this._showTileBoundaries!==x&&(this._showTileBoundaries=x,this._update())}get showPadding(){return!!this._showPadding}set showPadding(x){this._showPadding!==x&&(this._showPadding=x,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(x){this._showCollisionBoxes!==x&&(this._showCollisionBoxes=x,x?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(x){this._showOverdrawInspector!==x&&(this._showOverdrawInspector=x,this._update())}get repaint(){return!!this._repaint}set repaint(x){this._repaint!==x&&(this._repaint=x,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(x){this._vertices=x,this._update()}_setCacheLimits(x,l){o.setCacheLimits(x,l)}get version(){return"2.4.0"}},NavigationControl:class{constructor(x){this.options=o.extend({},x_,x),this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",l=>l.preventDefault()),this.options.showZoom&&(o.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",l=>this._map.zoomIn({},{originalEvent:l})),w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",l=>this._map.zoomOut({},{originalEvent:l})),w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(o.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",l=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:l}):this._map.resetNorth({},{originalEvent:l})}),this._compassIcon=w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const x=this._map.getZoom(),l=x===this._map.getMaxZoom(),h=x===this._map.getMinZoom();this._zoomInButton.disabled=l,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",l.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const x=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=x}onAdd(x){return this._map=x,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ea(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){w.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(x,l){const h=w.create("button",x,this._container);return h.type="button",h.addEventListener("click",l),h}_setButtonTitle(x,l){const h=this._map._getUIString(`NavigationControl.${l}`);x.title=h,x.setAttribute("aria-label",h)}},GeolocateControl:class extends o.Evented{constructor(x){super(),this.options=o.extend({},rp,x),o.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(x){var l;return this._map=x,this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),l=this._setupUI,Ps!==void 0?l(Ps):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(h=>{Ps=h.state!=="denied",l(Ps)}):(Ps=!!window.navigator.geolocation,l(Ps)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),w.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Li=0,Ms=!1}_isOutOfMapMaxBounds(x){const l=this._map.getMaxBounds(),h=x.coords;return l&&(h.longitudel.getEast()||h.latitudel.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(x){if(this._map){if(this._isOutOfMapMaxBounds(x))return this._setErrorState(),this.fire(new o.Event("outofmaxbounds",x)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=x,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(x),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(x),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("geolocate",x)),this._finish()}}_updateCamera(x){const l=new o.LngLat(x.coords.longitude,x.coords.latitude),h=x.coords.accuracy,g=this._map.getBearing(),b=o.extend({bearing:g},this.options.fitBoundsOptions);this._map.fitBounds(l.toBounds(h),b,{geolocateSource:!0})}_updateMarker(x){if(x){const l=new o.LngLat(x.coords.longitude,x.coords.latitude);this._accuracyCircleMarker.setLngLat(l).addTo(this._map),this._userLocationDotMarker.setLngLat(l).addTo(this._map),this._accuracy=x.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const x=this._map._container.clientHeight/2,l=this._map.unproject([0,x]),h=this._map.unproject([1,x]),g=l.distanceTo(h),b=Math.ceil(2*this._accuracy/g);this._circleElement.style.width=`${b}px`,this._circleElement.style.height=`${b}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(x){if(this._map){if(this.options.trackUserLocation)if(x.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const l=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=l,this._geolocateButton.setAttribute("aria-label",l),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(x.code===3&&Ms)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("error",x)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(x){if(this._container.addEventListener("contextmenu",l=>l.preventDefault()),this._geolocateButton=w.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",x===!1){o.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const l=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=l,this._geolocateButton.setAttribute("aria-label",l)}else{const l=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=l,this._geolocateButton.setAttribute("aria-label",l)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=w.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new tu(this._dotElement),this._circleElement=w.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new tu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",l=>{l.geolocateSource||this._watchState!=="ACTIVE_LOCK"||l.originalEvent&&l.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new o.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return o.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new o.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Li--,Ms=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new o.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let x;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Li++,Li>1?(x={maximumAge:6e5,timeout:0},Ms=!0):(x=this.options.positionOptions,Ms=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,x)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Cc,LogoControl:Fd,ScaleControl:class{constructor(x){this.options=o.extend({},ka,x),o.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){xg(this._map,this._container,this.options)}onAdd(x){return this._map=x,this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",x.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){w.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(x){this.options.unit=x,xg(this._map,this._container,this.options)}},FullscreenControl:class{constructor(x){this._fullscreen=!1,x&&x.container&&(x.container instanceof HTMLElement?this._container=x.container:o.warnOnce("Full screen control 'container' must be a DOM element.")),o.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(x){return this._map=x,this._container||(this._container=this._map.getContainer()),this._controlContainer=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",o.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){w.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){const x=this._fullscreenButton=w.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",x).setAttribute("aria-hidden","true"),x.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const x=this._getTitle();this._fullscreenButton.setAttribute("aria-label",x),this._fullscreenButton.title=x}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},TerrainControl:class{constructor(x){this.options=x,o.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(x){return this._map=x,this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._terrainButton=w.create("button","maplibregl-ctrl-terrain mapboxgl-ctrl-terrain",this._container),w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){w.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._map.style.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends o.Evented{constructor(x){super(),this.options=o.extend(Object.create(ei),x),o.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(x){return this._map&&this.remove(),this._map=x,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new o.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&w.remove(this._content),this._container&&(w.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new o.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(x){return this._lngLat=o.LngLat.convert(x),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(x){return this.setDOMContent(document.createTextNode(x))}setHTML(x){const l=document.createDocumentFragment(),h=document.createElement("body");let g;for(h.innerHTML=x;g=h.firstChild,g;)l.appendChild(g);return this.setDOMContent(l)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(x){return this.options.maxWidth=x,this._update(),this}setDOMContent(x){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=w.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(x),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(x){this._container&&this._container.classList.add(x)}removeClassName(x){this._container&&this._container.classList.remove(x)}setOffset(x){return this.options.offset=x,this._update(),this}toggleClassName(x){if(this._container)return this._container.classList.toggle(x)}_createCloseButton(){this.options.closeButton&&(this._closeButton=w.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(x){this._update(x.point)}_onMouseMove(x){this._update(x.point)}_onDrag(x){this._update(x.point)}_update(x){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=w.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=w.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(P=>this._container.classList.add(P)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Sc(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!x))return;const l=this._pos=this._trackPointer&&x?x:this._map.project(this._lngLat);let h=this.options.anchor;const g=np(this.options.offset);if(!h){const P=this._container.offsetWidth,z=this._container.offsetHeight;let $;$=l.y+g.bottom.ythis._map.transform.height-z?["bottom"]:[],l.x

this._map.transform.width-P/2&&$.push("right"),h=$.length===0?"bottom":$.join("-")}const b=l.add(g[h]).round();w.setTransform(this._container,`${pr[h]} translate(${b.x}px,${b.y}px)`),Sr(this._container,h,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const x=this._container.querySelector(ci);x&&x.focus()}_onClose(){this.remove()}},Marker:tu,Style:Rn,LngLat:o.LngLat,LngLatBounds:o.LngLatBounds,Point:o.pointGeometry,MercatorCoordinate:o.MercatorCoordinate,Evented:o.Evented,AJAXError:o.AJAXError,config:o.config,CanvasSource:Te,GeoJSONSource:de,ImageSource:ye,RasterDEMTileSource:ne,RasterTileSource:Q,VectorTileSource:Z,VideoSource:Re,prewarm:function(){It().acquire(Tt)},clearPrewarmedResources:function(){const x=mt;x&&(x.isPreloaded()&&x.numActive()===1?(x.release(Tt),mt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return"2.4.0"},get workerCount(){return Xe.workerCount},set workerCount(x){Xe.workerCount=x},get maxParallelImageRequests(){return o.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(x){o.config.MAX_PARALLEL_IMAGE_REQUESTS=x},clearStorage(x){o.clearTileCache(x)},workerUrl:"",addProtocol(x,l){o.config.REGISTERED_PROTOCOLS[x]=l},removeProtocol(x){delete o.config.REGISTERED_PROTOCOLS[x]}};return jo.extend(nl,{isSafari:o.isSafari,getPerformanceMetrics:o.PerformanceUtils.getPerformanceMetrics}),nl});var u=i;return u})})(aL);const Jpe=aL.exports,eme="modulepreload",tme=function(e){return"/"+e},CM={},rme=function(t,r,n){if(!r||r.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=tme(a),a in CM)return;CM[a]=!0;const u=a.endsWith(".css"),o=u?'[rel="stylesheet"]':"";if(!!n)for(let v=i.length-1;v>=0;v--){const y=i[v];if(y.href===a&&(!u||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${o}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":eme,u||(p.as="script",p.crossOrigin=""),p.href=a,document.head.appendChild(p),u)return new Promise((v,y)=>{p.addEventListener("load",v),p.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())},aE=C.exports.createContext(null),nme=e=>{const[t,r]=C.exports.useState({}),n=C.exports.useCallback((a,u="default")=>{r(o=>{if(u==="current")throw new Error("'current' cannot be used as map id");if(o[u])throw new Error(`Multiple maps with the same id: ${u}`);return{...o,[u]:a}})},[]),i=C.exports.useCallback((a="default")=>{r(u=>{if(u[a]){const o={...u};return delete o[a],o}return u})},[]);return E(aE.Provider,{value:{maps:t,onMapMount:n,onMapUnmount:i},children:e.children})};function sE(){var e;const t=(e=C.exports.useContext(aE))===null||e===void 0?void 0:e.maps,r=C.exports.useContext(gd);return C.exports.useMemo(()=>({...t,current:r==null?void 0:r.map}),[t,r])}function ime(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function SM(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function EM(e,t){const r=t.viewState||t;let n=!1;if("longitude"in r&&"latitude"in r){const i=e.center;e.center=new i.constructor(r.longitude,r.latitude),n=n||i!==e.center}if("zoom"in r){const i=e.zoom;e.zoom=r.zoom,n=n||i!==e.zoom}if("bearing"in r){const i=e.bearing;e.bearing=r.bearing,n=n||i!==e.bearing}if("pitch"in r){const i=e.pitch;e.pitch=r.pitch,n=n||i!==e.pitch}return r.padding&&!e.isPaddingEqual(r.padding)&&(n=!0,e.padding=r.padding),n}const ome=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function kM(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const n of e.layers)t[n.id]=n;const r=e.layers.map(n=>{const i=t[n.ref];let a=null;if("interactive"in n&&(a={...n},delete a.interactive),i){a=a||{...n},delete a.ref;for(const u of ome)u in i&&(a[u]=i[u])}return a||n});return{...e,layers:r}}function ame(e,t){const r=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,a=Array.isArray(t)?t[1]:t?t.y:0;return r===i&&n===a}function $a(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r{const a=this.props[PM[i.type]];a&&a(i)},this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const a=this.props[TM[i.type]];if(a){if(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"){const u=this._hoveredFeatures||this._map.queryRenderedFeatures(i.point,{layers:this.props.interactiveLayerIds});i.features=u}a(i),delete i.features}},this._onCameraEvent=i=>{if(!this._internalUpdate){const a=this.props[A2[i.type]];a&&a(i)}i.type in this._deferredEvents&&(this._deferredEvents[i.type]=!1)},this._MapClass=t,this.props=r,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const r=this.props;this.props=t;const n=this._updateSettings(t,r);n&&this._createShadowTransform(this._map);const i=this._updateSize(t),a=this._updateViewState(t,!0);this._updateStyle(t,r),this._updateStyleComponents(t,r),this._updateHandlers(t,r),(n||i||a&&!this._map.isMoving())&&this.redraw()}static reuse(t,r){const n=qf.savedMaps.pop();if(!n)return null;const i=n.map,a=i.getContainer();for(r.className=a.className;a.childNodes.length>0;)r.appendChild(a.childNodes[0]);i._container=r,n.setProps({...t,styleDiffing:!1}),i.resize();const{initialViewState:u}=t;return u&&(u.bounds?i.fitBounds(u.bounds,{...u.fitBoundsOptions,duration:0}):n._updateViewState(u,!1)),i.isStyleLoaded()?i.fire("load"):i.once("styledata",()=>i.fire("load")),n}_initialize(t){const{props:r}=this,n={...r,...r.initialViewState,accessToken:r.mapboxAccessToken||ume()||null,container:t,style:kM(r.mapStyle)},i=n.initialViewState||n.viewState||n;if(Object.assign(n,{center:[i.longitude||0,i.latitude||0],zoom:i.zoom||0,pitch:i.pitch||0,bearing:i.bearing||0}),r.gl){const p=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=p,r.gl)}const a=new this._MapClass(n);i.padding&&a.setPadding(i.padding),r.cursor&&(a.getCanvas().style.cursor=r.cursor),this._createShadowTransform(a);const u=a._render;a._render=p=>{this._inRender=!0,u.call(a,p),this._inRender=!1};const o=a._renderTaskQueue.run;a._renderTaskQueue.run=p=>{o.call(a._renderTaskQueue,p),this._onBeforeRepaint()},a.on("render",()=>this._onAfterRepaint());const f=a.fire;a.fire=this._fireEvent.bind(this,f),a.on("resize",()=>{this._renderTransform.resize(a.transform.width,a.transform.height)}),a.on("styledata",()=>this._updateStyleComponents(this.props,{})),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const p in TM)a.on(p,this._onPointerEvent);for(const p in A2)a.on(p,this._onCameraEvent);for(const p in PM)a.on(p,this._onEvent);this._map=a}recycle(){const r=this.map.getContainer().querySelector("[mapboxgl-children]");r==null||r.remove(),qf.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const r=ime(t.transform);t.painter.transform=r,this._renderTransform=r}_updateSize(t){const{viewState:r}=t;if(r){const n=this._map;if(r.width!==n.transform.width||r.height!==n.transform.height)return n.resize(),!0}return!1}_updateViewState(t,r){if(this._internalUpdate)return!1;const n=this._map,i=this._renderTransform,{zoom:a,pitch:u,bearing:o}=i,f=n.isMoving();f&&(i.cameraElevationReference="sea");const p=EM(i,{...SM(n.transform),...t});if(f&&(i.cameraElevationReference="ground"),p&&r){const v=this._deferredEvents;v.move=!0,v.zoom||(v.zoom=a!==i.zoom),v.rotate||(v.rotate=o!==i.bearing),v.pitch||(v.pitch=u!==i.pitch)}return f||EM(n.transform,t),p}_updateSettings(t,r){const n=this._map;let i=!1;for(const a of sme)a in t&&!$a(t[a],r[a])&&(i=!0,n[`set${a[0].toUpperCase()}${a.slice(1)}`](t[a]));return i}_updateStyle(t,r){if(t.cursor!==r.cursor&&(this._map.getCanvas().style.cursor=t.cursor),t.mapStyle!==r.mapStyle){const n={diff:t.styleDiffing};return"localIdeographFontFamily"in t&&(n.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(kM(t.mapStyle),n),!0}return!1}_updateStyleComponents(t,r){const n=this._map;let i=!1;return n.style.loaded()&&("light"in t&&!$a(t.light,r.light)&&(i=!0,n.setLight(t.light)),"fog"in t&&!$a(t.fog,r.fog)&&(i=!0,n.setFog(t.fog)),"terrain"in t&&!$a(t.terrain,r.terrain)&&(!t.terrain||n.getSource(t.terrain.source))&&(i=!0,n.setTerrain(t.terrain))),i}_updateHandlers(t,r){const n=this._map;let i=!1;for(const a of lme){const u=t[a];$a(u,r[a])||(i=!0,u?n[a].enable(u):n[a].disable())}return i}_updateHover(t){var r;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const a=t.type,u=((r=this._hoveredFeatures)===null||r===void 0?void 0:r.length)>0;let o;if(a==="mousemove")try{o=this._map.queryRenderedFeatures(t.point,{layers:n.interactiveLayerIds})}catch{o=[]}else o=[];const f=o.length>0;!f&&u&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=o,f&&!u&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=a}else this._hoveredFeatures=null}_fireEvent(t,r,n){const i=this._map,a=i.transform,u=typeof r=="string"?r:r.type;return u==="move"&&this._updateViewState(this.props,!1),u in A2&&(typeof r=="object"&&(r.viewState=SM(a)),this._map.isMoving())?(i.transform=this._renderTransform,t.call(i,r,n),i.transform=a,i):(t.call(i,r,n),i)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const n in this._deferredEvents)this._deferredEvents[n]&&t.fire(n);this._internalUpdate=!1;const r=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=r}}}qf.savedMaps=[];function ume(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||{}.MapboxAccessToken}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const cme=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function dme(e,t){if(!e)return null;const r=e.map,n={getMap:()=>r,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:i=>e.transform.locationPoint(t.LngLat.convert(i)),unproject:i=>e.transform.pointLocation(t.Point.convert(i)),queryTerrainElevation:(i,a)=>{const u=r.transform;r.transform=e.transform;const o=r.queryTerrainElevation(i,a);return r.transform=u,o}};for(const i of fme(r))!(i in n)&&!cme.includes(i)&&(n[i]=r[i].bind(r));return n}function fme(e){const t=new Set;let r=e;for(;r;){for(const n of Object.getOwnPropertyNames(r))n[0]!=="_"&&typeof e[n]=="function"&&n!=="fire"&&n!=="setEventedParent"&&t.add(n);r=Object.getPrototypeOf(r)}return Array.from(t)}const hme=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect,pme=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function mme(e,t){for(const r of pme)r in t&&(e[r]=t[r]);t.RTLTextPlugin&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(t.RTLTextPlugin,r=>{r&&console.error(r)},!1)}const gd=C.exports.createContext(null),vme={minZoom:0,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,mapStyle:{version:8,sources:{},layers:[]},styleDiffing:!0,projection:"mercator",renderWorldCopies:!0,onError:e=>console.error(e.error),RTLTextPlugin:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"},lE=C.exports.forwardRef((e,t)=>{const r=C.exports.useContext(aE),[n,i]=C.exports.useState(null),a=C.exports.useRef(),{current:u}=C.exports.useRef({mapLib:null,map:null});C.exports.useEffect(()=>{const f=e.mapLib;let p=!0,v;return Promise.resolve(f||rme(()=>import("./index.764e1a39.js").then(y=>y.i),[])).then(y=>{if(!!p){if(y.Map||(y=y.default),!y||!y.Map)throw new Error("Invalid mapLib");if(y.supported(e))mme(y,e),e.reuseMaps&&(v=qf.reuse(e,a.current)),v||(v=new qf(y.Map,e,a.current)),u.map=dme(v,y),u.mapLib=y,i(v),r==null||r.onMapMount(u.map,e.id);else throw new Error("Map is not supported by this browser")}}).catch(y=>{e.onError({type:"error",target:null,originalEvent:null,error:y})}),()=>{p=!1,v&&(r==null||r.onMapUnmount(e.id),e.reuseMaps?v.recycle():v.destroy())}},[]),hme(()=>{n&&n.setProps(e)}),C.exports.useImperativeHandle(t,()=>u.map,[n]);const o=C.exports.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]);return E("div",{id:e.id,ref:a,style:o,children:n&&E(gd.Provider,{value:u,children:E("div",{"mapboxgl-children":"",children:e.children})})})});lE.displayName="Map";lE.defaultProps=vme;const gme=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function yd(e,t){if(!e||!t)return;const r=e.style;for(const n in t){const i=t[n];Number.isFinite(i)&&!gme.test(n)?r[n]=`${i}px`:r[n]=i}}const yme={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function lL(e){const{map:t,mapLib:r}=C.exports.useContext(gd),n=C.exports.useRef({props:e});n.current.props=e;const i=C.exports.useMemo(()=>{let a=!1;C.exports.Children.forEach(e.children,f=>{f&&(a=!0)});const u={...e,element:a?document.createElement("div"):null},o=new r.Marker(u).setLngLat([e.longitude,e.latitude]);return o.getElement().addEventListener("click",f=>{var p,v;(v=(p=n.current.props).onClick)===null||v===void 0||v.call(p,{type:"click",target:o,originalEvent:f})}),o.on("dragstart",f=>{var p,v;const y=f;y.lngLat=i.getLngLat(),(v=(p=n.current.props).onDragStart)===null||v===void 0||v.call(p,y)}),o.on("drag",f=>{var p,v;const y=f;y.lngLat=i.getLngLat(),(v=(p=n.current.props).onDrag)===null||v===void 0||v.call(p,y)}),o.on("dragend",f=>{var p,v;const y=f;y.lngLat=i.getLngLat(),(v=(p=n.current.props).onDragEnd)===null||v===void 0||v.call(p,y)}),o},[]);return C.exports.useEffect(()=>(i.addTo(t.getMap()),()=>{i.remove()}),[]),C.exports.useEffect(()=>{yd(i.getElement(),e.style)},[e.style]),(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!ame(i.getOffset(),e.offset)&&i.setOffset(e.offset),i.isDraggable()!==e.draggable&&i.setDraggable(e.draggable),i.getRotation()!==e.rotation&&i.setRotation(e.rotation),i.getRotationAlignment()!==e.rotationAlignment&&i.setRotationAlignment(e.rotationAlignment),i.getPitchAlignment()!==e.pitchAlignment&&i.setPitchAlignment(e.pitchAlignment),i.getPopup()!==e.popup&&i.setPopup(e.popup),Zu.exports.createPortal(e.children,i.getElement())}lL.defaultProps=yme;C.exports.memo(lL);function MM(e){return new Set(e?e.trim().split(/\s+/):[])}function xme(e){const{map:t,mapLib:r}=C.exports.useContext(gd),n=C.exports.useMemo(()=>document.createElement("div"),[]),i=C.exports.useRef({props:e});i.current.props=e;const a=C.exports.useMemo(()=>{const u={...e},o=new r.Popup(u).setLngLat([e.longitude,e.latitude]);return o.once("open",f=>{var p,v;(v=(p=i.current.props).onOpen)===null||v===void 0||v.call(p,f)}),o},[]);if(C.exports.useEffect(()=>{const u=o=>{var f,p;(p=(f=i.current.props).onClose)===null||p===void 0||p.call(f,o)};return a.on("close",u),a.setDOMContent(n).addTo(t.getMap()),()=>{a.off("close",u),a.isOpen()&&a.remove()}},[]),C.exports.useEffect(()=>{yd(a.getElement(),e.style)},[e.style]),a.isOpen()&&((a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!$a(a.options.offset,e.offset)&&a.setOffset(e.offset),(a.options.anchor!==e.anchor||a.options.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth)),a.options.className!==e.className)){const u=MM(a.options.className),o=MM(e.className);for(const f of u)o.has(f)||a.removeClassName(f);for(const f of o)u.has(f)||a.addClassName(f);a.options.className=e.className}return Zu.exports.createPortal(e.children,n)}const _me=C.exports.memo(xme);function Ov(e,t,r,n){const i=C.exports.useContext(gd),a=C.exports.useMemo(()=>e(i),[]);return C.exports.useEffect(()=>{const u=n||r||t,o=typeof t=="function"&&typeof r=="function"?t:null,f=typeof r=="function"?r:typeof t=="function"?t:null,{map:p}=i;return p.hasControl(a)||(p.addControl(a,u==null?void 0:u.position),o&&o(i)),()=>{f&&f(i),p.hasControl(a)&&p.removeControl(a)}},[]),a}function bme(e){const t=Ov(({mapLib:r})=>new r.AttributionControl(e),{position:e.position});return C.exports.useEffect(()=>{yd(t._container,e.style)},[e.style]),null}C.exports.memo(bme);function wme(e){const t=Ov(({mapLib:r})=>new r.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return C.exports.useEffect(()=>{yd(t._controlContainer,e.style)},[e.style]),null}C.exports.memo(wme);const uL=C.exports.forwardRef((e,t)=>{const r=C.exports.useRef({props:e}),n=Ov(({mapLib:i})=>{const a=new i.GeolocateControl(e),u=a._setupUI;return a._setupUI=o=>{a._container.hasChildNodes()||u(o)},a.on("geolocate",o=>{var f,p;(p=(f=r.current.props).onGeolocate)===null||p===void 0||p.call(f,o)}),a.on("error",o=>{var f,p;(p=(f=r.current.props).onError)===null||p===void 0||p.call(f,o)}),a.on("outofmaxbounds",o=>{var f,p;(p=(f=r.current.props).onOutOfMaxBounds)===null||p===void 0||p.call(f,o)}),a.on("trackuserlocationstart",o=>{var f,p;(p=(f=r.current.props).onTrackUserLocationStart)===null||p===void 0||p.call(f,o)}),a.on("trackuserlocationend",o=>{var f,p;(p=(f=r.current.props).onTrackUserLocationEnd)===null||p===void 0||p.call(f,o)}),a},{position:e.position});return r.current.props=e,C.exports.useImperativeHandle(t,()=>({trigger:()=>n.trigger()}),[]),C.exports.useEffect(()=>{yd(n._container,e.style)},[e.style]),null});uL.displayName="GeolocateControl";C.exports.memo(uL);function Cme(e){const t=Ov(({mapLib:r})=>new r.NavigationControl(e),{position:e.position});return C.exports.useEffect(()=>{yd(t._container,e.style)},[e.style]),null}C.exports.memo(Cme);const Sme={unit:"metric",maxWidth:100};function cL(e){const t=Ov(({mapLib:r})=>new r.ScaleControl(e),{position:e.position});return(t.options.unit!==e.unit||t.options.maxWidth!==e.maxWidth)&&(t.options.maxWidth=e.maxWidth,t.setUnit(e.unit)),C.exports.useEffect(()=>{yd(t._container,e.style)},[e.style]),null}cL.defaultProps=Sme;C.exports.memo(cL);function x1(e,t){if(!e)throw new Error(t)}let Eme=0;function kme(e,t,r){if(e.style&&e.style._loaded){const n={...r};return delete n.id,delete n.children,e.addSource(t,n),e.getSource(t)}return null}function Tme(e,t,r){x1(t.id===r.id,"source id changed"),x1(t.type===r.type,"source type changed");let n="",i=0;for(const u in t)u!=="children"&&u!=="id"&&!$a(r[u],t[u])&&(n=u,i++);if(!i)return;const a=t.type;if(a==="geojson")e.setData(t.data);else if(a==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else if((a==="canvas"||a==="video")&&i===1&&n==="coordinates")e.setCoordinates(t.coordinates);else if(a==="vector"&&"setUrl"in e)switch(n){case"url":e.setUrl(t.url);break;case"tiles":e.setTiles(t.tiles);break}else console.warn(`Unable to update prop: ${n}`)}function vm(e){const t=C.exports.useContext(gd).map.getMap(),r=C.exports.useRef(e),[,n]=C.exports.useState(0),i=C.exports.useMemo(()=>e.id||`jsx-source-${Eme++}`,[]);C.exports.useEffect(()=>{if(t){const u=()=>setTimeout(()=>n(o=>o+1),0);return t.on("styledata",u),u(),()=>{var o;if(t.off("styledata",u),t.style&&t.style._loaded&&t.getSource(i)){const f=(o=t.getStyle())===null||o===void 0?void 0:o.layers;if(f)for(const p of f)p.source===i&&t.removeLayer(p.id);t.removeSource(i)}}}},[t]);let a=t&&t.style&&t.getSource(i);return a?Tme(a,e,r.current):a=kme(t,i,e),r.current=e,a&&C.exports.Children.map(e.children,u=>u&&C.exports.cloneElement(u,{source:i}))||null}function Pme(e,t,r,n){if(x1(r.id===n.id,"layer id changed"),x1(r.type===n.type,"layer type changed"),r.type==="custom"||n.type==="custom")return;const{layout:i={},paint:a={},filter:u,minzoom:o,maxzoom:f,beforeId:p}=r;if(p!==n.beforeId&&e.moveLayer(t,p),i!==n.layout){const v=n.layout||{};for(const y in i)$a(i[y],v[y])||e.setLayoutProperty(t,y,i[y]);for(const y in v)i.hasOwnProperty(y)||e.setLayoutProperty(t,y,void 0)}if(a!==n.paint){const v=n.paint||{};for(const y in a)$a(a[y],v[y])||e.setPaintProperty(t,y,a[y]);for(const y in v)a.hasOwnProperty(y)||e.setPaintProperty(t,y,void 0)}$a(u,n.filter)||e.setFilter(t,u),(o!==n.minzoom||f!==n.maxzoom)&&e.setLayerZoomRange(t,o,f)}function Mme(e,t,r){if(e.style&&e.style._loaded&&(!("source"in r)||e.getSource(r.source))){const n={...r,id:t};delete n.beforeId,e.addLayer(n,r.beforeId)}}let Ime=0;function Fu(e){const t=C.exports.useContext(gd).map.getMap(),r=C.exports.useRef(e),[,n]=C.exports.useState(0),i=C.exports.useMemo(()=>e.id||`jsx-layer-${Ime++}`,[]);if(C.exports.useEffect(()=>{if(t){const u=()=>n(o=>o+1);return t.on("styledata",u),u(),()=>{t.off("styledata",u),t.style&&t.style._loaded&&t.getLayer(i)&&t.removeLayer(i)}}},[t]),t&&t.style&&t.getLayer(i))try{Pme(t,i,e,r.current)}catch(u){console.warn(u)}else Mme(t,i,e);return r.current=e,null}const Rme=e=>({updateCounter:-1,toggleUpdateCounter:()=>{e(t=>{t.updateCounter=t.updateCounter===-1?1:-1})}}),dL=tc(rc(Rme)),uE=({onSuccess:e})=>{const{toggleUpdateCounter:t}=dL();return ipe({mutationFn:r=>_a.put(`/api/placement_points/update_status?${r.toString()}`),onSuccess:()=>{t(),e()}})};function Ome(){for(var e=0,t,r,n="";ee&&(t=0,n=r,r=new Map)}return{get:function(u){var o=r.get(u);if(o!==void 0)return o;if((o=n.get(u))!==void 0)return i(u,o),o},set:function(u,o){r.has(u)?r.set(u,o):i(u,o)}}}var pL="!";function $me(e){var t=e.separator||":";return function(n){for(var i=0,a=[],u=0,o=0;oE("div",{className:ld("mb-1",t),children:E(ive,{type:"secondary",className:ld("uppercase text-xs",r),children:e})}),ove=()=>{const{filters:e}=Ui(),{prediction:t,categories:r,region:n}=e,{selection:i}=Ys(),a=Iv(),[u,o]=C.exports.useState(!1),[f,p]=C.exports.useState(!1),{mutate:v}=uE({onSuccess:()=>{a.invalidateQueries(["table",1,e]),o(!1),p(!0)}});return Qe(Fr,{children:[E(d3,{trigger:"click",open:u,onOpenChange:o,content:Qe("div",{className:"p-2",children:[E(Hl,{text:"\u0423\u0432\u0435\u0440\u0435\u043D\u044B, \u0447\u0442\u043E \u0445\u043E\u0442\u0438\u0442\u0435 \u0432\u0437\u044F\u0442\u044C \u043E\u0442\u043E\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438 \u0432 \u0440\u0430\u0431\u043E\u0442\u0443?"}),Qe("div",{className:"flex items-center justify-center gap-x-4",children:[E(In,{onClick:()=>o(!1),children:"\u041E\u0442\u043C\u0435\u043D\u0430"}),E(In,{type:"primary",onClick:()=>{const w=new URLSearchParams({status:jn.approve,"prediction_current[]":t,"categories[]":r,"included[]":[...i.included],"excluded[]":[...i.excluded]});n&&(n.type==="ao"&&w.append("ao[]",n.id),n.type==="rayon"&&w.append("rayon[]",n.id)),v(w)},children:"\u0414\u0430"})]})]}),children:Qe(In,{type:"primary",block:!0,className:"mt-2",children:[E("span",{className:"mr-1",children:"\u0412\u0437\u044F\u0442\u044C \u0432 \u0440\u0430\u0431\u043E\u0442\u0443"}),E(lD,{})]})}),E(Fte,{title:" ",centered:!0,open:f,footer:[E(In,{type:"primary",onClick:()=>p(!1),children:"\u0425\u043E\u0440\u043E\u0448\u043E"},"ok-button")],children:E(ux,{message:"\u0423\u0441\u043F\u0435\u0448\u043D\u043E",description:"\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435. \u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043D\u0430 \u043D\u0438\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E \u0432\u0442\u043E\u0440\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435",type:"success",showIcon:!0})})]})};function ave(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function sve(e,t,r){r===void 0&&(r={});for(var n=0,i=e;nr[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]e?e.reduce((t,r)=>(t[r.id]=r,t[r.id].type="ao",r.rayons&&r.rayons.forEach(n=>{t[n.id]=n,t[n.id].type="rayon"}),t),{}):{},uve=({disabled:e})=>{const{map:t}=sE(),{filters:{region:r},setRegion:n}=Ui(),[i,a]=C.exports.useState([]),u=C.exports.useMemo(()=>lve(i),[i]),[o,f]=C.exports.useState(!1);C.exports.useEffect(()=>{(async()=>{f(!0);try{const w=await _a.get("/api/ao_rayons");a(w.data)}catch(w){console.error(w)}finally{f(!1)}})()},[]);const p=y=>{if(!y)return;const w=u[y],k=bh.exports(w.polygon),T=sve(k.coordinates[0]),R=x4(T);n({id:y,geometry:T,type:w.type}),t.fitBounds([[R[0],R[1]],[R[2],R[3]]],{padding:20})},v=()=>n(null);return Qe("div",{children:[E(Hl,{text:"\u0410\u041E / \u0440\u0430\u0439\u043E\u043D"}),E(Zz,{showSearch:!0,style:{width:"100%"},value:r==null?void 0:r.id,dropdownStyle:{maxHeight:400,overflow:"auto"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0410\u041E \u0438\u043B\u0438 \u0440\u0430\u0439\u043E\u043D",allowClear:!0,treeDefaultExpandAll:!1,onChange:p,loading:o,treeNodeFilterProp:"title",onClear:v,notFoundContent:E(Fs,{image:Fs.PRESENTED_IMAGE_SIMPLE,description:"\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E"}),disabled:e,children:i==null?void 0:i.map(y=>{var w;return E(zM,{value:y.id,title:y.name,children:(w=y.rayons)==null?void 0:w.map(k=>E(zM,{value:k.id,title:k.name},k.id))},y.id)})})]})},cve=Object.entries(YD).map(([e,t])=>({value:t,label:t})),dve=({disabled:e})=>{const{filters:t,setCategories:r}=Ui();return Qe("div",{children:[E(Hl,{text:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438"}),E(Nl,{mode:"tags",style:{width:"100%"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438 \u043B\u043E\u043A\u0430\u0446\u0438\u0439",onChange:r,options:cve,allowClear:!0,value:t.categories,disabled:e})]})},_l=({value:e})=>E("span",{className:"text-grey text-xs",children:e}),DM=(e,t)=>{if(Array.isArray(t)){const[r,n]=t;return{...e,[r]:E(_l,{value:r}),[n]:E(_l,{value:n})}}else return{...e,[t]:E(_l,{value:t})}},Ux=({title:e,value:t,onChange:r,onAfterChange:n,min:i=0,max:a=100,range:u=!1,step:o=1,disabled:f=!1,onMouseEnter:p,onMouseLeave:v,showZeroMark:y=!1})=>{const w={[i]:E(_l,{value:i}),[a]:E(_l,{value:a})},[k,T]=C.exports.useState(t),[R,A]=C.exports.useState(DM(w,t));C.exports.useEffect(()=>{T(t),A(DM(w,t))},[t]);const I=L=>{if(Array.isArray(L)){const[B,j]=L;A({...w,[B]:E(_l,{value:B}),[j]:E(_l,{value:j})})}else A({...w,[L]:E(_l,{value:L})});n==null||n(L)},O=L=>{T(L),r==null||r(L)},N=y?{...R,0:E(_l,{value:0})}:R;return Qe("div",{onMouseEnter:p,onMouseLeave:v,children:[E(Hl,{text:e}),E(bre,{range:u,value:k,marks:N,onChange:O,onAfterChange:I,min:i,max:a,step:o,disabled:f})]})},fve=({disabled:e,fullRange:t})=>{const{filters:{prediction:r},setPrediction:n}=Ui(),i=a=>n(a);return C.exports.useEffect(()=>{if(!t)return;const a=t.prediction_current[0],u=t.prediction_current[1];r[0]===Dl.prediction[0]&&r[1]===Dl.prediction[1]&&n([a,u])},[t]),E(Ux,{title:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:r,onAfterChange:i,min:t==null?void 0:t.prediction_current[0],max:t==null?void 0:t.prediction_current[1],range:!0,disabled:e})},hve=e=>({mode:ii.INITIAL,setMode:t=>{e(r=>{r.mode=t})}}),nc=tc(rc(hve)),pve=({fullRange:e})=>{const{filters:{deltaTraffic:t},setDeltaTraffic:r}=Ui(),n=i=>r(i);return C.exports.useEffect(()=>{if(!e)return;const i=e.delta_current[0],a=e.delta_current[1];t[0]===Dl.deltaTraffic[0]&&t[1]===Dl.deltaTraffic[1]&&r([i,a])},[e,t]),E(Ux,{title:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0444\u0430\u043A\u0442\u0430 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C, %",value:t,onAfterChange:n,min:e==null?void 0:e.delta_current[0],max:e==null?void 0:e.delta_current[1],range:!0,showZeroMark:!0})},mve=({fullRange:e})=>{const{filters:{factTraffic:t},setFactTraffic:r}=Ui(),n=i=>r(i);return C.exports.useEffect(()=>{if(!e)return;const i=e.fact[0],a=e.fact[1];t[0]===Dl.factTraffic[0]&&t[1]===Dl.factTraffic[1]&&r([i,a])},[e,t]),E(Ux,{title:"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:t,onAfterChange:n,min:e==null?void 0:e.fact[0],max:e==null?void 0:e.fact[1],range:!0})},vve=({fullRange:e})=>{const{filters:{age:t},setAge:r}=Ui(),n=i=>r(i);return C.exports.useEffect(()=>{if(!e)return;const i=e.age_day[0],a=e.age_day[1];t[0]===Dl.age[0]&&t[1]===Dl.age[1]&&r([i,a])},[e,t]),E(Ux,{title:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430, \u0434\u043D\u0435\u0439",value:t,onAfterChange:n,min:e==null?void 0:e.age_day[0],max:e==null?void 0:e.age_day[1],range:!0})},gve=({disabled:e})=>{const[t,r]=C.exports.useState(!1),{mode:n}=nc();C.exports.useEffect(()=>{const o=setTimeout(()=>r(!1),1500);return()=>clearTimeout(o)},[t]);const{data:i}=Za(["max-min"],async()=>{const{data:o}=await _a.get("/api/placement_points/filters/");return o});return E(yo,{title:ape,placement:"right",open:e&&t,onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},children:Qe("div",{className:"space-y-5",children:[E(uve,{disabled:e}),n===ii.INITIAL&&Qe(Fr,{children:[E(dve,{disabled:e}),E(fve,{disabled:e,fullRange:i})]}),n===ii.WORKING&&Qe("div",{className:"space-y-12",children:[E(pve,{fullRange:i}),E(mve,{fullRange:i}),E(vve,{fullRange:i})]})]})})},yve=()=>{const{data:e,isInitialLoading:t}=$pe(),{data:r,isInitialLoading:n}=Bpe(),i=t||n,{selection:{excluded:a}}=Ys();return Qe("div",{className:"flex items-center justify-between",children:[E("span",{children:"\u041E\u0442\u043E\u0431\u0440\u0430\u043D\u043E \u043B\u043E\u043A\u0430\u0446\u0438\u0439"}),i?E(I3,{}):E("span",{children:`${r-a.size} / ${e}`})]})},xve={[vn.initial]:!0,[vn.approve]:!1,[vn.working]:!1},_ve=e=>({isVisible:xve,toggleVisibility:t=>e(r=>{r.isVisible[t]=!r.isVisible[t]}),setLayersVisibility:t=>e(r=>{t.visible.forEach(n=>{r.isVisible[n]=!0}),t.invisible.forEach(n=>{r.isVisible[n]=!1})})}),wh=tc(rc(_ve)),bve=C.exports.forwardRef(({isCollapsed:e},t)=>{const r=Fpe(),{mode:n}=nc(),{reset:i}=Ys(),{isVisible:a,toggleVisibility:u}=wh();return E("div",{className:ld("h-screen p-3 overflow-y-auto shrink-0 border-solid border-border border-0 border-r-[1px] flex flex-col transition-all pt-20",e?"basis-0 px-0 -translate-x-[320px]":"basis-[320px]"),ref:t,children:Qe("div",{className:"space-y-5 flex flex-col justify-between flex-1",children:[Qe("div",{children:[E(gve,{disabled:r}),n===ii.APPROVE_WORKING&&Qe("div",{className:"mt-4",children:[E(Hl,{text:"\u0421\u0442\u0430\u0442\u0443\u0441\u044B"}),Qe("div",{className:"flex flex-col space-y-2",children:[E(ad,{onChange:()=>u(vn.approve),checked:a[vn.approve],children:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430"}),E(ad,{className:"!ml-0",onChange:()=>u(vn.working),checked:a[vn.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442"})]})]}),n===ii.INITIAL&&r?E(In,{block:!0,className:"mt-2",onClick:i,children:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0440\u0443\u0447\u043D\u043E\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435"}):null]}),E("div",{children:n===ii.INITIAL&&Qe(Fr,{children:[E(yve,{}),E(ove,{})]})})]})})}),wve=5,Cve=3,Sve="#CC2222",Eve="#CC2222",_L="#ff7d00",bL="#006e01",kve="#b4b4b4",LM={type:"circle",paint:{"circle-stroke-width":.4,"circle-stroke-color":"#fff","circle-opacity":.8}},Av=(e=Sve,t=wve)=>({...LM,paint:{...LM.paint,"circle-color":e,"circle-radius":t}}),$p=Av(),Tve=Av(kve,Cve),Pve=Av(_L),Mve=Av(bL);Av(Eve);const wL="#676767",FM={id:"ao",type:"line",source:"ao","source-layer":"public.service_ao",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":wL,"line-width":1.5,"line-opacity":.8}},$M={id:"rayon",type:"line",source:"rayon","source-layer":"public.service_rayon",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":wL,"line-width":.5,"line-opacity":.8}},BM={id:"selected-region",type:"line",source:"selected-region",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#CC2222","line-width":4}},Ive={ao:"okrug_id",rayon:"rayon_id"},dE=()=>{const{filters:{region:e}}=Ui();return C.exports.useMemo(()=>e?["==",["get",Ive[e.type]],e.id]:null,[e])},VM=["==",["get","status"],jn.initial],Rve=()=>{const{filters:e}=Ui(),{prediction:t,categories:r,region:n}=e,{selection:i}=Ys(),a=[...i.included],u=[...i.excluded],o=dE(),f=["in",["get","id"],["literal",a]],p=["in",["get","id"],["literal",u]],v=[[">=",["get","prediction_current"],t[0]],["<=",["get","prediction_current"],t[1]]],y=r.length>0?["in",["get","category"],["literal",r]]:!0,w=["all",VM,["!",p],["any",n?["all",...v,y,o]:["all",...v,y],f]],k=["all",VM,["!",f],["any",["!",n?["all",...v,y,o]:["all",...v,y]],p]];return{match:w,unmatch:k}},Ove=()=>{const{isVisible:e}=wh(),{match:t,unmatch:r}=Rve();return Qe(Fr,{children:[E(Fu,{...$p,id:vn["initial-unmatch"],source:"points","source-layer":"public.service_placementpoint",layout:{...$p.layout,visibility:e[vn.initial]?"visible":"none"},filter:r,paint:Tve.paint}),E(Fu,{...$p,id:vn["initial-match"],source:"points","source-layer":"public.service_placementpoint",layout:{...$p.layout,visibility:e[vn.initial]?"visible":"none"},filter:t,paint:$p.paint})]})},jM=["==",["get","status"],jn.approve],Ave=()=>{const{isVisible:e}=wh(),t=dE(),r=t?["all",jM,t]:jM;return E(Fr,{children:E(Fu,{...Pve,id:vn.approve,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[vn.approve]?"visible":"none"},filter:r})})},UM=["==",["get","status"],jn.working],Nve=()=>{const{isVisible:e}=wh(),t=dE(),{filters:{deltaTraffic:r,factTraffic:n,age:i}}=Ui(),a=[[">=",["get","delta_current"],r[0]],["<=",["get","delta_current"],r[1]]],u=[[">=",["get","fact"],n[0]],["<=",["get","fact"],n[1]]],o=[[">=",["get","age_day"],i[0]],["<=",["get","age_day"],i[1]]],f=t?["all",UM,...a,...u,...o,t]:["all",UM,...a,...u,...o];return E(Fr,{children:E(Fu,{...Mve,id:vn.working,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[vn.working]?"visible":"none"},filter:f})})},zve=()=>{const{updateCounter:e}=dL();return E(Fr,{children:Qe(vm,{id:"points",type:"vector",tiles:[`${y1}/martin/public.service_placementpoint/{z}/{x}/{y}.pbf`],children:[E(Ove,{}),E(Ave,{}),E(Nve,{})]},`points-${e}`)})},Dve=()=>{const{filters:{prediction:e,region:t}}=Ui();return Qe(Fr,{children:[E(vm,{id:"ao",type:"vector",tiles:[`${y1}/martin/public.service_ao/{z}/{x}/{y}.pbf`],children:E(Fu,{...FM,layout:{...FM.layout}})}),E(vm,{id:"rayon",type:"vector",tiles:[`${y1}/martin/public.service_rayon/{z}/{x}/{y}.pbf`],children:E(Fu,{...$M,layout:{...$M.layout}})}),t&&t.geometry&&E(vm,{id:"selected-region",type:"geojson",data:t.geometry,children:E(Fu,{...BM,layout:{...BM.layout,visibility:t?"visible":"none"}})}),E(zve,{prediction:e})]})},Lve=({lat:e,lng:t,onClose:r,children:n})=>E(_me,{longitude:t,latitude:e,onClose:r,closeOnClick:!1,style:{minWidth:"300px"},children:n}),Fve=e=>({clickedPointConfig:null,setClickedPointConfig:(t,r=!0)=>{e(n=>{if(t===null)return n.clickedPointConfig=null,n;n.clickedPointConfig={id:t,shouldSelect:r}})}}),ic=tc(rc(Fve)),$ve=[{name:"Id",field:"id"},{name:"\u0410\u0434\u0440\u0435\u0441",field:"address"},{name:"\u0420\u0430\u0439\u043E\u043D",field:"rayon_id"},{name:"\u041E\u043A\u0440\u0443\u0433",field:"okrug_id"},{name:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",field:"name"},{name:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",field:"category"},{name:"\u0421\u0442\u0430\u0442\u0443\u0441",field:"status"},{name:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",field:"prediction_current"}],Bve=[{name:"Id",field:"id"},{name:"\u0410\u0434\u0440\u0435\u0441",field:"address"},{name:"\u0420\u0430\u0439\u043E\u043D",field:"rayon_id"},{name:"\u041E\u043A\u0440\u0443\u0433",field:"okrug_id"},{name:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",field:"name"},{name:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",field:"category"},{name:"\u0421\u0442\u0430\u0442\u0443\u0441",field:"status"},{name:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",field:"prediction_current"},{name:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440",field:"flat_cnt"},{name:"\u0413\u043E\u0434 \u043F\u043E\u0441\u0442\u0440\u043E\u0439\u043A\u0438",field:"year_bld"},{name:"\u041A\u043E\u043B-\u0432\u043E \u044D\u0442\u0430\u0436\u0435\u0439",field:"levels"},{name:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0441\u0442\u0435\u043D",field:"mat_nes"}],Vve=[{name:"\u0424\u0430\u043A\u0442",field:"fact"},{name:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C",field:"delta_current"},{name:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C",field:"age_day"}],fE=({feature:e,dynamicStatus:t})=>{const r=e.properties.category===YD.residential,n=e.properties.status===jn.working,i=r?Bve:$ve,a=n?[...i,...Vve]:i;return E("div",{children:a.map(({field:u,name:o})=>{const f=t&&u==="status"?t:e.properties[u];return Qe(d9,{className:ld("p-1"),children:[E(i1,{className:"font-semibold",span:12,children:o}),E(i1,{span:12,children:f})]},u)})})},jve=({feature:e})=>{const{include:t,selection:r,exclude:n}=Ys(),{setClickedPointConfig:i}=ic(),a=e.layer.id===vn["initial-match"],u=e.properties.id;C.exports.useEffect(()=>i(u,a),[e]);const o=(a||r.included.has(u))&&!r.excluded.has(u);return Qe(Fr,{children:[E(fE,{feature:e}),E(In,{type:"primary",className:"mt-2 mx-auto",block:!0,onClick:()=>{o?n(u):t(u)},children:o?"\u0418\u0441\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0438\u0437 \u0432\u044B\u0431\u043E\u0440\u043A\u0438":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0432\u044B\u0431\u043E\u0440\u043A\u0443"})]})};let KM=e=>typeof e=="object"&&e!=null&&e.nodeType===1,HM=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",z2=(e,t)=>{if(e.clientHeight{let i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!i&&(i.clientHeightat||a>e&&u=t&&o>=r?a-e-n:u>t&&or?u-t+i:0,Uve=e=>{let t=e.parentElement;return t==null?e.getRootNode().host||null:t},WM=(e,t)=>{var r,n,i,a;if(typeof document>"u")return[];let{scrollMode:u,block:o,inline:f,boundary:p,skipOverflowHiddenElements:v}=t,y=typeof p=="function"?p:J=>J!==p;if(!KM(e))throw new TypeError("Invalid target");let w=document.scrollingElement||document.documentElement,k=[],T=e;for(;KM(T)&&y(T);){if(T=Uve(T),T===w){k.push(T);break}T!=null&&T===document.body&&z2(T)&&!z2(document.documentElement)||T!=null&&z2(T,v)&&k.push(T)}let R=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,A=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,{scrollX:I,scrollY:O}=window,{height:N,width:L,top:B,right:j,bottom:G,left:H}=e.getBoundingClientRect(),te=o==="start"||o==="nearest"?B:o==="end"?G:B+N/2,Y=f==="center"?H+L/2:f==="end"?j:H,le=[];for(let J=0;J=0&&H>=0&&G<=A&&j<=R&&B>=ne&&G<=oe&&H>=ye&&j<=de)return le;let Re=getComputedStyle(Z),Te=parseInt(Re.borderLeftWidth,10),ke=parseInt(Re.borderTopWidth,10),ze=parseInt(Re.borderRightWidth,10),Ie=parseInt(Re.borderBottomWidth,10),Ne=0,De=0,Ve="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-Te-ze:0,Ge="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-ke-Ie:0,je="offsetWidth"in Z?Z.offsetWidth===0?0:ge/Z.offsetWidth:0,ct="offsetHeight"in Z?Z.offsetHeight===0?0:Q/Z.offsetHeight:0;if(w===Z)Ne=o==="start"?te:o==="end"?te-A:o==="nearest"?Ry(O,O+A,A,ke,Ie,O+te,O+te+N,N):te-A/2,De=f==="start"?Y:f==="center"?Y-R/2:f==="end"?Y-R:Ry(I,I+R,R,Te,ze,I+Y,I+Y+L,L),Ne=Math.max(0,Ne+O),De=Math.max(0,De+I);else{Ne=o==="start"?te-ne-ke:o==="end"?te-oe+Ie+Ge:o==="nearest"?Ry(ne,oe,Q,ke,Ie+Ge,te,te+N,N):te-(ne+Q/2)+Ge/2,De=f==="start"?Y-ye-Te:f==="center"?Y-(ye+ge/2)+Ve/2:f==="end"?Y-de+ze+Ve:Ry(ye,de,ge,Te,ze+Ve,Y,Y+L,L);let{scrollLeft:pt,scrollTop:Tt}=Z;Ne=Math.max(0,Math.min(Tt+Ne/ct,Z.scrollHeight-Q/ct+Ge)),De=Math.max(0,Math.min(pt+De/je,Z.scrollWidth-ge/je+Ve)),te+=Tt-Ne,Y+=pt-De}le.push({el:Z,top:Ne,left:De})}return le},Kve=e=>typeof e=="object"&&typeof e.behavior=="function",Hve=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function Wve(e,t){if(!e.isConnected||!e.ownerDocument.documentElement.contains(e))return;if(Kve(t))return t.behavior(WM(e,t));let r=typeof t=="boolean"||t==null?void 0:t.behavior;for(let{el:n,top:i,left:a}of WM(e,Hve(t)))n.scroll({top:i,left:a,behavior:r})}function qve(e,t){const r=window.document.createElement("a");r.href=window.URL.createObjectURL(new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}const hE=e=>{qve("postamates.xlsx",e)},Gve=({provider:e})=>{const[t,r]=C.exports.useState(!1);return e(t,()=>r(!1)),E(yo,{title:"\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",children:E(In,{onClick:i=>{i.stopPropagation(),r(!0)},loading:t,disabled:t,children:E(Xde,{})})})},Zve={isOpened:!1,fullScreen:!1},Xve=e=>({tableState:Zve,toggleOpened:t=>{e(r=>{r.tableState.isOpened=t[0]==="opened"})},toggleFullScreen:()=>{e(t=>{t.tableState.fullScreen=!t.tableState.fullScreen})},openTable:()=>{e(t=>{t.tableState.isOpened=!0})}}),pE=tc(rc(Xve)),Yve=()=>{const{tableState:{fullScreen:e},toggleFullScreen:t}=pE(),[r,n]=C.exports.useState(!1);return C.exports.useEffect(()=>{const o=setTimeout(()=>n(!1),1500);return()=>clearTimeout(o)},[r]),E(yo,{title:e?"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C":"\u0420\u0430\u0441\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043F\u043E\u043B\u043D\u044B\u0439 \u044D\u043A\u0440\u0430\u043D",placement:"topRight",open:r,children:E(In,{onClick:o=>{o.stopPropagation(),t()},onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},children:e?E(Jde,{}):E(rfe,{})})})},Kx=({leftColumn:e,rightColumn:t,exportProvider:r,classes:n})=>Qe("div",{className:"flex items-center w-full justify-between",children:[Qe("div",{className:n==null?void 0:n.leftColumn,children:[E("span",{className:"py-[5px]",children:"\u0422\u0430\u0431\u043B\u0438\u0446\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u0432"}),e]}),Qe("div",{className:n==null?void 0:n.rightColumn,children:[t,Qe("div",{className:"flex items-center gap-x-1",children:[r&&E(Gve,{provider:r}),E(Yve,{})]})]})]}),mE=en.memo(({rowSelection:e,data:t,pageSize:r,isClickedPointLoading:n,page:i,onPageChange:a,columns:u,header:o,fullWidth:f,loading:p})=>{const{clickedPointConfig:v}=ic(),{map:y}=sE(),{tableState:w,toggleOpened:k}=pE(),T={y:w.fullScreen?"calc(100vh - 136px)":"200px",x:"max-content"};return C.exports.useEffect(()=>{if(v===null||n)return;const R=document.querySelector(".scroll-row");R&&Wve(R,{behavior:"smooth"})},[v,t]),E(xP,{bordered:!1,onChange:k,activeKey:w.isOpened?"opened":null,children:E(xP.Panel,{header:o||E(Kx,{}),collapsible:w.fullScreen?"disabled":void 0,children:E(Ece,{size:"small",locale:{emptyText:E(Fs,{description:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"})},pagination:{pageSize:r,current:i,onChange:a,total:t==null?void 0:t.count,showSizeChanger:!1,position:"bottomCenter"},dataSource:t==null?void 0:t.results,columns:u,rowKey:"id",scroll:T,sticky:!0,onRow:R=>({onClick:()=>{const A=bh.exports(R.geometry);y.flyTo({center:[A.coordinates[0],A.coordinates[1]],zoom:13,essential:!0})}}),rowSelection:e,rowClassName:R=>ld("cursor-pointer",R.id===(v==null?void 0:v.id)&&"scroll-row"),"data-fullwidth":f,loading:p})},"opened")})}),CL=[{title:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"rayon",key:"rayon",width:"120px",ellipsis:!0},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"okrug",key:"okrug",width:"120px",ellipsis:!0},{title:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",dataIndex:"name",key:"name",width:"120px",ellipsis:!0},{title:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",dataIndex:"category",key:"category",width:"120px",ellipsis:!0},{title:"\u0421\u0442\u0430\u0442\u0443\u0441",dataIndex:"status",key:"status",width:"120px",ellipsis:!0},{title:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",dataIndex:"prediction_current",key:"prediction_current",width:"120px",ellipsis:!0}],Hx=30,Qve=(e,t)=>{const{clickedPointConfig:r}=ic(),{data:n,isInitialLoading:i,isFetching:a}=Za(["clicked-point",r==null?void 0:r.id],async()=>{const u=new URLSearchParams({"location_ids[]":[r.id]}),{data:o}=await _a.get(`/api/placement_points?${u.toString()}`);return o},{enabled:e,onSuccess:t});return{data:n,isLoading:i||a}},vE=(e,t)=>{const[r,n]=C.exports.useState(),[i,a]=C.exports.useState(!1),{data:u,isLoading:o}=Qve(i,()=>a(!1)),{clickedPointConfig:f}=ic();return C.exports.useEffect(()=>{!e||n(e)},[e]),C.exports.useEffect(()=>{!e||f===null||e.results.find(v=>v.id===f.id)||a(!0)},[e,f]),C.exports.useEffect(()=>{!u||(t(p=>p+1),n(p=>{if(p)return{...p,count:p.count+1,results:[u.results[0],...p.results]}}))},[u]),C.exports.useEffect(()=>{f===null&&(t(Hx),n(e))},[f,e]),{data:r,isClickedPointLoading:o}},Jve=(e,t)=>{const{filters:{region:r}}=Ui();return Za(["export-approve-working",r],async()=>{const n=new URLSearchParams({"status[]":[jn.approve,jn.working]});return await iE(n,r)},{enabled:e,onSuccess:hE,onSettled:t})},ege=e=>({popup:null,setPopup:t=>{e(r=>{if(!t)return r.popup=null,r;r.popup=t})}}),SL=tc(rc(ege)),tge=[{label:jn.approve,value:jn.approve},{label:jn.working,value:jn.working},{label:jn.initial,value:jn.initial}],EL=({value:e,onChange:t,disabled:r})=>E(Nl,{style:{width:250},value:e,onChange:a=>{t(a)},options:tge,disabled:r,placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u0443\u0441",onClick:a=>a.stopPropagation()}),rge=({selectedIds:e,selectedStatus:t})=>{const r=Iv(),{setPopup:n}=SL(),{mutate:i}=uE({onSuccess:()=>{r.invalidateQueries(["approve-working-points"]),n(null)}});return E(In,{type:"primary",onClick:u=>{u.stopPropagation();const o=new URLSearchParams({status:t,"location_ids[]":e});i(o)},children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"})},nge=({selectedIds:e,onClearSelected:t})=>{const[r,n]=C.exports.useState(jn.approve),i=a=>{a.stopPropagation(),t()};return E(Kx,{leftColumn:e.length>0&&Qe(Fr,{children:[E(EL,{value:r,onChange:n}),E(rge,{selectedIds:e,selectedStatus:r})]}),rightColumn:e.length>0&&E(In,{onClick:i,children:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435"}),classes:{leftColumn:"flex items-center gap-x-4",rightColumn:"flex item-center gap-x-4"},exportProvider:Jve})},ige=({fullWidth:e})=>{const[t,r]=C.exports.useState(Hx),[n,i]=C.exports.useState(1),[a,u]=C.exports.useState([]),{filters:{region:o}}=Ui(),f=()=>u([]),{data:p,isInitialLoading:v}=Za(["approve-working-points",n,o],async()=>{const R=new URLSearchParams({page:n,page_size:t,"status[]":[jn.approve,jn.working]});return await Rv(R,o)},{keepPreviousData:!0}),{data:y,isClickedPointLoading:w}=vE(p,r),k=C.exports.useCallback(R=>i(R),[]);return E(mE,{header:E(nge,{selectedIds:a,onClearSelected:f}),rowSelection:{selectedRowKeys:a,onChange:R=>u(R),hideSelectAll:!0},data:y,onPageChange:k,page:n,pageSize:t,isClickedPointLoading:w,columns:CL,fullWidth:e,loading:v})},oge=({feature:e})=>{const t=e.properties.id,{setClickedPointConfig:r}=ic(),[n,i]=C.exports.useState(e.properties.status);C.exports.useEffect(()=>r(t,!1),[e]);const a=Iv(),{mutate:u}=uE({onSuccess:()=>{a.invalidateQueries(["approve-working-points"])}});return Qe(Fr,{children:[E(fE,{feature:e,dynamicStatus:n}),E("div",{className:"flex justify-center mt-4",children:Qe("div",{className:"flex flex-col items-center",children:[E(Hl,{text:"\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"}),E(EL,{value:n,onChange:f=>{i(f);const p=new URLSearchParams({status:f,"location_ids[]":[t]});u(p)}})]})})]})},age=({feature:e})=>{const t=e.properties.id,{setClickedPointConfig:r}=ic();return C.exports.useEffect(()=>r(t,!1),[e]),E(fE,{feature:e,dynamicStatus:status})},qM=({feature:e})=>{const{mode:t}=nc();return t===ii.APPROVE_WORKING?E(oge,{feature:e}):t===ii.WORKING?E(age,{feature:e}):E(jve,{feature:e})},sge=({features:e,onSelect:t})=>E("div",{className:"space-y-2 p-1",children:e.map(r=>Qe(In,{type:r.layer.id===vn["initial-match"]?"primary":"",className:"flex items-center gap-x-1",block:!0,onClick:()=>t(r),children:[E("span",{children:r.properties.id}),E("span",{children:r.properties.category})]},r.properties.id))}),lge=({features:e,lat:t,lng:r,onClose:n})=>{const[i,a]=C.exports.useState(null);return E(Lve,{lat:t,lng:r,onClose:n,children:(()=>e.length===1?E(qM,{feature:e[0]}):i?E(qM,{feature:i}):E(sge,{features:e,onSelect:a}))()})},uge="https://api.mapbox.com/styles/v1/ghermant/cla2nwk5f00el14nxvtjlsi6z/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoiZ2hlcm1hbnQiLCJhIjoiY2xhMm5zZ3ZrMDF4MDN2bzc5Yjd0ZjZ1dCJ9.fqnvrEqKKBoguR7R6DR7Yw",cge=()=>E(vm,{type:"raster",id:"basemap",tiles:[uge],tileSize:256,children:E(Fu,{type:"raster",source:"basemap",id:"basemap-layer",paint:{}})});function dge(){const e=async()=>{await _a.post("accounts/logout/"),oE(!1)},{data:t}=Za(["profile"],async()=>{const{data:r}=await _a.get("/accounts/profile");return r});return E("div",{className:"absolute top-[20px] right-[20px]",children:E(d3,{content:Qe(Fr,{children:[E(Hl,{text:t==null?void 0:t.email,classNameText:"lowercase"}),Qe(In,{type:"primary",block:!0,onClick:e,children:[E("span",{className:"mr-1",children:"\u0412\u044B\u0439\u0442\u0438"}),E(lD,{})]})]}),trigger:"click",placement:"bottomRight",children:E(yo,{title:"\u0412\u044B\u0439\u0442\u0438",placement:"left",children:E(In,{icon:E(sfe,{}),type:"primary",size:"large"})})})})}var fge="Expected a function",GM=0/0,hge="[object Symbol]",pge=/^\s+|\s+$/g,mge=/^[-+]0x[0-9a-f]+$/i,vge=/^0b[01]+$/i,gge=/^0o[0-7]+$/i,yge=parseInt,xge=typeof bl=="object"&&bl&&bl.Object===Object&&bl,_ge=typeof self=="object"&&self&&self.Object===Object&&self,bge=xge||_ge||Function("return this")(),wge=Object.prototype,Cge=wge.toString,Sge=Math.max,Ege=Math.min,D2=function(){return bge.Date.now()};function kge(e,t,r){var n,i,a,u,o,f,p=0,v=!1,y=!1,w=!0;if(typeof e!="function")throw new TypeError(fge);t=ZM(t)||0,_4(r)&&(v=!!r.leading,y="maxWait"in r,a=y?Sge(ZM(r.maxWait)||0,t):a,w="trailing"in r?!!r.trailing:w);function k(j){var G=n,H=i;return n=i=void 0,p=j,u=e.apply(H,G),u}function T(j){return p=j,o=setTimeout(I,t),v?k(j):u}function R(j){var G=j-f,H=j-p,te=t-G;return y?Ege(te,a-H):te}function A(j){var G=j-f,H=j-p;return f===void 0||G>=t||G<0||y&&H>=a}function I(){var j=D2();if(A(j))return O(j);o=setTimeout(I,R(j))}function O(j){return o=void 0,w&&n?k(j):(n=i=void 0,u)}function N(){o!==void 0&&clearTimeout(o),p=0,n=f=i=o=void 0}function L(){return o===void 0?u:O(D2())}function B(){var j=D2(),G=A(j);if(n=arguments,i=this,f=j,G){if(o===void 0)return T(f);if(y)return o=setTimeout(I,t),k(f)}return o===void 0&&(o=setTimeout(I,t)),u}return B.cancel=N,B.flush=L,B}function _4(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Tge(e){return!!e&&typeof e=="object"}function Pge(e){return typeof e=="symbol"||Tge(e)&&Cge.call(e)==hge}function ZM(e){if(typeof e=="number")return e;if(Pge(e))return GM;if(_4(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=_4(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(pge,"");var r=vge.test(e);return r||gge.test(e)?yge(e.slice(2),r?2:8):mge.test(e)?GM:+e}var Mge=kge;const XM=({color:e,name:t})=>Qe("div",{className:"flex gap-2 items-center",children:[E("span",{className:"rounded-xl w-3 h-3 inline-block",style:{backgroundColor:e}}),E("span",{children:t})]});function Ige(){const{mode:e}=nc();return E("div",{className:"absolute bottom-[20px] left-[20px] text-xs text-grey z-10 bg-white-background rounded-xl p-3",children:(()=>e===ii.APPROVE_WORKING?Qe(Fr,{children:[E(Hl,{text:"\u0421\u0442\u0430\u0442\u0443\u0441 \u043B\u043E\u043A\u0430\u0446\u0438\u0438",className:"text-center"}),Qe("div",{className:"space-y-2",children:[E(XM,{name:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",color:_L}),E(XM,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442",color:bL})]})]}):null)()})}const Rge=(e,t)=>{const[r,n]=C.exports.useState(Hx),{filters:i}=Ui(),{prediction:a,categories:u,region:o}=i,{selection:{included:f}}=Ys(),p=[...f],{data:v,isInitialLoading:y}=Za(["table",e,i,p],async()=>{const T=new URLSearchParams({page:e,page_size:r,"prediction_current[]":a,"status[]":[jn.initial],"categories[]":u,"included[]":p});return await Rv(T,o)},{keepPreviousData:!0,onError:T=>{T.response.data.detail==="\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430"&&t()}}),{data:w,isClickedPointLoading:k}=vE(v,n);return{data:w,pageSize:r,isClickedPointLoading:k,isDataLoading:y}},Oge=(e,t)=>{const{filters:r}=Ui(),{prediction:n,status:i,categories:a,region:u}=r,{selection:o}=Ys();return Za(["export-initial",r,o],async()=>{const f=new URLSearchParams({"prediction_current[]":n,"status[]":i,"categories[]":a,"included[]":[...o.included],"excluded[]":[...o.excluded]});return await iE(f,u)},{enabled:e,onSuccess:hE,onSettled:t})},Age=({fullWidth:e})=>{const{selection:t,include:r,exclude:n}=Ys(),{clickedPointConfig:i}=ic(),[a,u]=C.exports.useState(1),{data:o,pageSize:f,isClickedPointLoading:p,isDataLoading:v}=Rge(a,()=>u(1)),w={selectedRowKeys:C.exports.useCallback(()=>{var O;const T=(O=o==null?void 0:o.results.map(N=>N.id))!=null?O:[],R=o==null?void 0:o.results.find(N=>N.id===(i==null?void 0:i.id)),A=N=>t.excluded.has(N),I=N=>N===(R==null?void 0:R.id)&&(i==null?void 0:i.shouldSelect)===!1;return[...T.filter(N=>!A(N)&&!I(N)),...t.included]},[o,i,t])(),onSelect:(T,R)=>{const{id:A}=T;R?r(A):n(A)},hideSelectAll:!0},k=C.exports.useCallback(T=>u(T),[]);return E(mE,{rowSelection:w,data:o,onPageChange:k,page:a,pageSize:f,isClickedPointLoading:p,columns:CL,fullWidth:e,header:E(Kx,{exportProvider:Oge}),loading:v})},Nge=(e,t)=>{const{filters:{region:r,deltaTraffic:n,factTraffic:i,age:a}}=Ui();return Za(["export-working",r,n,i,a],async()=>{const u=new URLSearchParams({"status[]":[jn.working],"delta_current[]":n,"fact[]":i,"age_day[]":a});return await iE(u,r)},{enabled:e,onSuccess:hE,onSettled:t})},zge=[{title:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"rayon",key:"rayon",width:"120px",ellipsis:!0},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"okrug",key:"okrug",width:"120px",ellipsis:!0},{title:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",dataIndex:"name",key:"name",width:"120px",ellipsis:!0},{title:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",dataIndex:"category",key:"category",width:"120px",ellipsis:!0},{title:"\u0424\u0430\u043A\u0442",dataIndex:"fact",key:"fact",width:"120px",ellipsis:!0},{title:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C",dataIndex:"delta_current",key:"delta_current",width:"120px",ellipsis:!0},{title:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C",dataIndex:"age_day",key:"age_day",width:"120px",ellipsis:!0}],Dge=({fullWidth:e})=>{const[t,r]=C.exports.useState(Hx),[n,i]=C.exports.useState(1),{filters:{region:a,deltaTraffic:u,factTraffic:o,age:f}}=Ui(),{data:p,isInitialLoading:v}=Za(["working-points",n,a,u,o,f],async()=>{const T=new URLSearchParams({page:n,page_size:t,"status[]":[jn.working],"delta_current[]":u,"fact[]":o,"age_day[]":f});return await Rv(T,a)},{keepPreviousData:!0}),{data:y,isClickedPointLoading:w}=vE(p,r),k=C.exports.useCallback(T=>i(T),[]);return E(mE,{data:y,onPageChange:k,page:n,pageSize:t,isClickedPointLoading:w,columns:zge,fullWidth:e,header:E(Kx,{exportProvider:Nge}),loading:v})},Lge=({fullWidth:e})=>{const{mode:t}=nc();return t===ii.APPROVE_WORKING?E(ige,{fullWidth:e}):t===ii.WORKING?E(Dge,{fullWidth:e}):E(Age,{fullWidth:e})},Fge=({width:e=24,height:t=24})=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:t,children:[E("polygon",{points:"23.7,4.1 23.7,6.1 0.1,6.2 0.1,4.1 "}),Qe("g",{children:[E("circle",{cx:"6.3",cy:"5.2",r:"3.1"}),E("circle",{fill:"#fff",cx:"6.3",cy:"5.2",r:"1.4"})]}),E("polygon",{points:"23.6,11.1 23.7,13.1 0,13.1 0,11 "}),Qe("g",{children:[E("circle",{cx:"18.6",cy:"12.1",r:"3.1"}),E("circle",{fill:"#fff",cx:"18.6",cy:"12.1",r:"1.4"})]}),E("polygon",{points:"23.8,18.2 23.9,20.1 0.2,20.2 0.2,18.2 "}),Qe("g",{children:[E("circle",{cx:"10.2",cy:"19.1",r:"3.1"}),E("circle",{fill:"#fff",cx:"10.2",cy:"19.1",r:"1.4"})]})]}),$ge=({toggleCollapse:e})=>E(In,{icon:E(Fge,{width:16,height:16}),onClick:e,className:"border-l-0 rounded-bl-none rounded-tl-none absolute top-[100px] flex items-center justify-center"});var kL={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},YM=en.createContext&&en.createContext(kL),$u=globalThis&&globalThis.__assign||function(){return $u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{const{toggleVisibility:e,isVisible:t}=wh(),{mode:r}=nc();return Qe("div",{children:[E(Hl,{text:"\u0421\u043B\u043E\u0438",className:"mb-1"}),E("div",{className:"space-y-1 flex flex-col",children:r===ii.WORKING&&E(Fr,{children:E(ad,{className:"!ml-0",onChange:()=>e(vn.working),checked:t[vn.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442"})})})]})},Hge=()=>E(d3,{content:E(Kge,{}),trigger:"click",placement:"leftBottom",children:E(yo,{title:"\u0421\u043B\u043E\u0438",children:E(In,{className:"absolute bottom-[20px] right-[20px] flex items-center justify-center p-3",children:E(Uge,{className:"w-4 h-4"})})})}),Wge=({width:e=40,height:t=40})=>E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:t,children:Qe("g",{children:[E("polygon",{style:{fill:"#3B555E"},points:"19.6,24 21.4,24 22.5,23.9 23,23.8 23.5,23.4 23.8,22.9 24,22.3 24,20.4 24,1.9 23.9,1.4 23.6,0.8 23.3,0.4 22.9,0.1 22.3,0 14.2,0 8.9,0 11.2,4.6 19.5,4.5 19.6,4.5 "}),E("polygon",{style:{fill:"#E63941"},points:"13.6,6.4 17.7,6.4 16.2,9.4 14.1,14.2 12.3,18.4 11.7,18.4 9.8,14.5 6.8,8.8 4.5,4.5 4.7,23.9 1.7,24 1,23.8 0.5,23.2 0.2,22.7 0,22.1 0,1.8 0.1,1.3 0.4,0.8 0.8,0.4 1.1,0.2 1.4,0.1 2,0.1 7,0.1 11.9,10.6 "})]})});function qge(e,t){const[r,n]=C.exports.useState(e);return C.exports.useEffect(()=>{const i=setTimeout(()=>n(e),t||500);return()=>{clearTimeout(i)}},[e,t]),r}const Gge=()=>{const{map:e}=sE(),[t,r]=C.exports.useState(""),n=qge(t),{data:i}=Za(["address",n],async()=>(await _a.get(`/api/placement_points/search_address?page_size=100&address=${n}`)).data),a=C.exports.useMemo(()=>i?i.results.map(f=>({label:f.address,value:`${f.address}$${f.id}`,item:f})):[],[i]);return E("div",{children:E(aX,{options:a,style:{width:300},value:t,onChange:f=>{r(f&&f.split("$")[0])},onSelect:(f,p)=>{const v=bh.exports(p.item.geometry);e.flyTo({center:[v.coordinates[0],v.coordinates[1]],zoom:15,speed:5})},allowClear:!0,onClear:()=>r(""),children:E(Tu,{prefix:E(dfe,{}),placeholder:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0442\u043E\u0447\u043A\u0438",className:"text-ellipsis"})})})},Zge=({width:e=24,height:t=24})=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:t,children:[E("polygon",{className:"ai-st0",points:"11.4,3.1 11.4,4.6 11.4,17.8 11.1,18.6 10.9,19.2 10.4,19.8 9.9,20.1 9.2,20.3 8.6,20.3 8.2,20.3 7.6,20.3 7,19.8 6.6,19.3 6.2,18.7 5.4,18.7 4.9,18.4 4.4,18 4.1,17.6 3.9,17.1 3.9,16 3.4,15.4 3,14.9 2,13.4 1.8,12.6 1.4,11.8 1.4,9.9 1.4,9 1.9,8.3 2.5,7.7 3,7.3 2.9,6.5 2.8,5.7 3,5.1 3.4,4.7 4.1,4.3 5,4.1 5.6,4 5.6,3.3 5.8,2.7 6.4,1.9 7,1.3 7.6,1.1 8.4,0.9 8.9,0.9 9.4,1.1 10.1,1.5 10.8,2.1 "}),E("polyline",{className:"ai-st0",points:"17.4,3 16.1,4.7 11.5,4.6 "}),E("polyline",{className:"ai-st0",points:"11.2,8.7 16,8.6 19.8,12.3 "}),E("line",{className:"ai-st0",x1:"11.2",y1:"12.2",x2:"13.4",y2:"12.2"}),E("polyline",{className:"ai-st0",points:"11.4,16.6 14.8,16.6 16.4,18.2 "}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"18.1",cy:"2",r:"1.9"}),E("circle",{className:"ai-st2",cx:"18.1",cy:"1.9",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"18.5",cy:"6.5",r:"1.9"}),E("circle",{className:"ai-st2",cx:"18.5",cy:"6.4",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"20.8",cy:"13.3",r:"1.9"}),E("circle",{className:"ai-st2",cx:"20.9",cy:"13.3",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"15",cy:"12.2",r:"1.9"}),E("circle",{className:"ai-st2",cx:"15",cy:"12.1",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"17.4",cy:"19.2",r:"1.9"}),E("circle",{className:"ai-st2",cx:"17.4",cy:"19.2",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"13",cy:"22",r:"1.9"}),E("circle",{className:"ai-st2",cx:"13.1",cy:"22",r:"1.1"})]}),E("polyline",{className:"ai-st0",points:"5.9,8.1 4.5,9.5 4.4,11.2 4.8,12.4 6.5,14.8 "})]});const Xge=({width:e=24,height:t=24})=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-293 385 24 24",width:e,height:t,className:"ml-[2px] mt-[2px]",children:[E("polyline",{className:"approve-st0",points:"-273.7,390.2 -273.7,388.3 -274,387.5 -274.7,387 -275.8,387 -290.4,387 -291.1,387.2 -291.8,387.6 -292.2,388.3 -292.3,403.6 -292.2,404.4 -291.9,404.9 -291.3,405.2 -290.8,405.3 -275.9,405.3 -275.1,405.2 -274.3,404.9 -273.8,404.3 -273.8,402.3 "}),E("path",{className:"approve-st1",d:"M-287.2,397h-1.2c-0.4,0-0.7-0.3-0.7-0.7v-1.2c0-0.4,0.3-0.7,0.7-0.7h1.2c0.4,0,0.7,0.3,0.7,0.7v1.2 C-286.6,396.7-286.9,397-287.2,397z"}),E("path",{className:"approve-st1",d:"M-287.2,400.5h-1.2c-0.4,0-0.7-0.3-0.7-0.7v-1.2c0-0.4,0.3-0.7,0.7-0.7h1.2c0.4,0,0.7,0.3,0.7,0.7v1.2 C-286.5,400.2-286.8,400.5-287.2,400.5z"}),E("polygon",{className:"approve-st2",points:"-288.7,390.7 -288.3,391.2 -288.2,391.3 -288,391.3 -287.6,391.2 -287.2,390.7 -286.7,390.3 -286.5,390.3 -286.2,390.3 -286,390.5 -285.9,390.9 -286,391.1 -286.4,391.6 -287.9,392.9 -288.1,392.9 -288.3,392.9 -288.6,392.6 -289.6,391.6 -289.8,391.4 -289.8,391 -289.6,390.7 -289.4,390.6 -289.1,390.5 -288.9,390.5 "}),E("polygon",{className:"approve-st3",points:"-283.9,390.9 -279.1,390.9 -278.8,391.1 -278.7,391.3 -278.6,391.8 -278.7,392 -279,392.4 -279.2,392.5 -279.6,392.5 -284,392.5 -284.2,392.5 -284.5,392.3 -284.7,391.9 -284.7,391.7 -284.6,391.5 -284.3,391.1 -284.1,390.9 "}),E("polygon",{className:"approve-st3",points:"-284,394.4 -280,394.4 -279.8,394.6 -279.7,394.8 -279.6,395.2 -279.7,395.5 -279.9,395.9 -280.1,396 -280.4,396 -284.1,396 -284.3,395.9 -284.5,395.7 -284.7,395.4 -284.7,395.2 -284.6,394.9 -284.4,394.6 -284.2,394.4 "}),E("polygon",{className:"approve-st3",points:"-284.1,397.9 -280.9,397.9 -280.7,398.1 -280.6,398.3 -280.6,398.7 -280.6,399 -280.8,399.4 -280.9,399.5 -281.2,399.5 -284.2,399.5 -284.3,399.4 -284.5,399.2 -284.7,398.9 -284.7,398.7 -284.6,398.4 -284.4,398.1 -284.3,397.9 "}),E("polygon",{className:"approve-st2",points:"-274.2,391.7 -273.4,391.6 -273.1,391.7 -273,392.7 -272.6,392.8 -272.1,393 -271.6,393.2 -271.1,392.6 -270.7,392.8 -270.4,393.1 -270.1,393.5 -270,393.7 -270.6,394.2 -270.5,394.6 -270.4,394.9 -270.3,395.4 -269.5,395.4 -269.4,395.7 -269.4,396.2 -269.4,396.4 -269.6,396.7 -269.6,396.9 -270.4,396.8 -270.5,397.3 -270.6,397.7 -270.8,397.9 -270.1,398.6 -270.3,398.9 -270.6,399.2 -271.1,399.5 -271.2,399.6 -271.7,399 -271.7,398.9 -272.1,399 -272.4,399.1 -272.8,399.2 -273,399.3 -273,400 -273.2,400.2 -274.2,400.2 -274.4,400 -274.4,399.3 -274.4,399.1 -275,398.9 -275.5,398.7 -275.9,399.4 -276.2,399.5 -276.5,399.3 -277.1,398.8 -277,398.5 -276.4,397.9 -276.8,397.5 -276.9,397.2 -277.1,396.8 -277.9,396.8 -278,396.3 -278,395.6 -277.8,395.3 -277,395.3 -276.7,394.6 -276.6,394.2 -276.9,393.9 -277.1,393.6 -277.2,393.5 -277.1,393.2 -276.7,392.7 -276.5,392.6 -276.2,392.7 -275.4,393.2 -275.1,392.9 -274.7,392.8 -274.5,392.7 -274.5,391.8 "}),E("circle",{className:"approve-st4",cx:"-273.8",cy:"396",r:"1.8"})]}),Yge=({width:e=24,height:t=24})=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-293 385 24 24",width:e,height:t,children:[E("path",{className:"working-st0",d:"M-279.1,402.7"}),E("polyline",{className:"working-st1",points:"-275,391.8 -275,390.5 -275.3,389.9 -276,389.6 -277,389.5 -290.8,389.6 -291.4,389.7 -292.1,390 -292.5,390.4 -292.5,401.4 -292.5,401.9 -292.1,402.3 -291.6,402.5 -291.1,402.6 -280,402.5 "}),E("polyline",{className:"working-st2",points:"-290.8,396 -289.3,396 -288.7,398.4 -287.6,394.3 -286.1,399.7 -285.1,392 -284.2,397 -283.2,395.9 -281.8,396 "}),E("circle",{className:"working-st3",cx:"-277",cy:"397.6",r:"4.6"}),E("circle",{className:"working-st4",cx:"-277.1",cy:"397.5",r:"2.9"}),E("polygon",{className:"working-st3",points:"-270.9,405.7 -269,403.8 -273.5,399.6 -275.4,401 "})]}),Qge=()=>{const{mode:e,setMode:t}=nc(),r=i=>{t(i)},n=i=>i===e?"primary":"default";return Qe(Fr,{children:[E(yo,{title:"\u041E\u0442\u0431\u043E\u0440 \u043B\u043E\u043A\u0430\u0446\u0438\u0439 \u0434\u043B\u044F \u0440\u0430\u0431\u043E\u0442\u044B",children:E(In,{icon:E(Zge,{}),type:n(ii.INITIAL),onClick:()=>r(ii.INITIAL),className:"flex items-center justify-center",size:"large"})}),E(yo,{title:"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u0430\u043C\u0438 \u043B\u043E\u043A\u0430\u0446\u0438\u0439",children:E(In,{icon:E(Xge,{}),type:n(ii.APPROVE_WORKING),onClick:()=>r(ii.APPROVE_WORKING),className:"flex items-center justify-center",size:"large"})}),E(yo,{title:"\u041C\u043E\u043D\u0438\u0442\u043E\u0440\u0438\u043D\u0433 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0445 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432",className:"text-center",children:E(In,{icon:E(Yge,{}),type:n(ii.WORKING),onClick:()=>r(ii.WORKING),className:"flex items-center justify-center",size:"large"})})]})},Jge=()=>Qe("div",{className:"absolute top-[20px] left-[19px] flex items-center z-10",children:[Qe("div",{className:ld("flex items-center gap-x-20"),children:[E(Wge,{}),E("div",{className:"flex items-center gap-x-3",children:E(Qge,{})})]}),E("div",{className:"ml-[71px]",children:E(Gge,{})})]}),eye=8,tye="Voyager",rye={},nye={carto:{type:"vector",url:"https://tiles.basemaps.cartocdn.com/vector/carto.streets/v1/tiles.json"}},iye="https://tiles.basemaps.cartocdn.com/gl/voyager-gl-style/sprite",oye="https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf",aye=[{id:"background",type:"background",layout:{visibility:"visible"},paint:{"background-color":"#fbf8f3","background-opacity":1}},{id:"landcover",type:"fill",source:"carto","source-layer":"landcover",filter:["any",["==","class","wood"],["==","class","grass"],["==","subclass","recreation_ground"]],paint:{"fill-color":{stops:[[8,"rgba(197, 225, 178, 0.2)"],[9,"rgba(197, 225, 178, 0.25)"],[11,"rgba(197, 225, 178, 0.35)"],[13,"rgba(197, 225, 178, 0.4)"],[15,"#e0ecd3"]]},"fill-opacity":1}},{id:"park_national_park",type:"fill",source:"carto","source-layer":"park",minzoom:9,filter:["all",["==","class","national_park"]],layout:{visibility:"visible"},paint:{"fill-color":{stops:[[8,"rgba(197, 225, 178, 0.2)"],[9,"rgba(197, 225, 178, 0.25)"],[11,"rgba(197, 225, 178, 0.35)"],[13,"rgba(197, 225, 178, 0.4)"],[15,"#e0ecd3"]]},"fill-opacity":1,"fill-translate-anchor":"map"}},{id:"park_nature_reserve",type:"fill",source:"carto","source-layer":"park",minzoom:0,filter:["all",["==","class","nature_reserve"]],layout:{visibility:"visible"},paint:{"fill-color":{stops:[[8,"rgba(197, 225, 178, 0.2)"],[9,"rgba(197, 225, 178, 0.25)"],[11,"rgba(197, 225, 178, 0.35)"],[13,"rgba(197, 225, 178, 0.4)"],[15,"#e0ecd3"]]},"fill-antialias":!0,"fill-opacity":{stops:[[6,.7],[9,.9]]}}},{id:"landuse_residential",type:"fill",source:"carto","source-layer":"landuse",minzoom:6,filter:["any",["==","class","residential"]],paint:{"fill-color":{stops:[[5,"rgba(243, 234, 220, 0.5)"],[8,"rgba(243, 234, 220, 0.45)"],[9,"rgba(243, 234, 220, 0.4)"],[11,"rgba(243, 234, 220, 0.35)"],[13,"rgba(243, 234, 220, 0.3)"],[15,"rgba(243, 234, 220, 0.25)"],[16,"rgba(243, 234, 220, 0.15)"]]},"fill-opacity":{stops:[[6,.6],[9,1]]}}},{id:"landuse",type:"fill",source:"carto","source-layer":"landuse",filter:["any",["==","class","cemetery"],["==","class","stadium"]],paint:{"fill-color":{stops:[[8,"rgba(197, 225, 178, 0.2)"],[9,"rgba(197, 225, 178, 0.25)"],[11,"rgba(197, 225, 178, 0.35)"],[13,"rgba(197, 225, 178, 0.4)"],[15,"#e0ecd3"]]}}},{id:"waterway",type:"line",source:"carto","source-layer":"waterway",paint:{"line-color":"#cce7ea","line-width":{stops:[[8,.5],[9,1],[15,2],[16,3]]}}},{id:"boundary_county",type:"line",source:"carto","source-layer":"boundary",minzoom:9,maxzoom:24,filter:["all",["==","admin_level",6],["==","maritime",0]],paint:{"line-color":{stops:[[4,"#d4d5d6"],[5,"#d4d5d6"],[6,"#e1c5c7"]]},"line-width":{stops:[[4,.5],[7,1]]},"line-dasharray":{stops:[[6,[1]],[7,[2,2]]]}},layout:{visibility:"none"}},{id:"boundary_state",type:"line",source:"carto","source-layer":"boundary",minzoom:4,filter:["all",["==","admin_level",4],["==","maritime",0]],paint:{"line-color":{stops:[[4,"#d4d5d6"],[5,"#d4d5d6"],[6,"#e1c5c7"]]},"line-width":{stops:[[4,.5],[7,1],[8,1],[9,1.2]]},"line-dasharray":{stops:[[6,[1]],[7,[2,2]]]}},layout:{visibility:"none"}},{id:"water",type:"fill",source:"carto","source-layer":"water",minzoom:0,maxzoom:24,filter:["all",["==","$type","Polygon"]],layout:{visibility:"visible"},paint:{"fill-color":"#b0d0d6","fill-antialias":!0,"fill-translate-anchor":"map","fill-opacity":1}},{id:"water_shadow",type:"fill",source:"carto","source-layer":"water",minzoom:0,filter:["all",["==","$type","Polygon"]],layout:{visibility:"visible"},paint:{"fill-color":"rgba(203, 225, 228, 1)","fill-antialias":!0,"fill-translate-anchor":"map","fill-opacity":1,"fill-translate":{stops:[[0,[0,2]],[6,[0,1]],[14,[0,1]],[17,[0,2]]]}}},{id:"aeroway-runway",type:"line",source:"carto","source-layer":"aeroway",minzoom:12,filter:["all",["==","class","runway"]],layout:{"line-cap":"square"},paint:{"line-width":{stops:[[11,1],[13,4],[14,6],[15,8],[16,10]]},"line-color":"#e8e8e8"}},{id:"aeroway-taxiway",type:"line",source:"carto","source-layer":"aeroway",minzoom:13,filter:["all",["==","class","taxiway"]],paint:{"line-color":"#e8e8e8","line-width":{stops:[[13,.5],[14,1],[15,2],[16,4]]}}},{id:"waterway_label",type:"symbol",source:"carto","source-layer":"waterway",filter:["all",["has","name"],["==","class","river"]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Regular Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"symbol-placement":"line","symbol-spacing":300,"symbol-avoid-edges":!1,"text-size":{stops:[[9,8],[10,9]]},"text-padding":2,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-offset":{stops:[[6,[0,-.2]],[11,[0,-.4]],[12,[0,-.6]]]},"text-letter-spacing":0,"text-keep-upright":!0},paint:{"text-color":"#51909c","text-halo-color":"#e2eef0","text-halo-width":1}},{id:"tunnel_service_case",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,1],[16,3],[17,6],[18,8]]},"line-opacity":1,"line-color":"#e6dfcb"}},{id:"tunnel_minor_case",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["==","class","minor"],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-width":{stops:[[11,.5],[12,.5],[14,2],[15,4],[16,6],[17,10],[18,14]]},"line-opacity":1,"line-color":"#e6dfcb"}},{id:"tunnel_sec_case",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,.5],[12,1],[13,2],[14,5],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#e6dfcb"}},{id:"tunnel_pri_case",type:"line",source:"carto","source-layer":"transportation",minzoom:8,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":"#e6dfcb"}},{id:"tunnel_trunk_case",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":"#fbdb98"}},{id:"tunnel_mot_case",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[12,4],[13,5],[14,7],[15,9],[16,11],[17,13],[18,22]]},"line-opacity":{stops:[[6,.5],[7,1]]},"line-color":"#fbdb98"}},{id:"tunnel_path",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","path"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,.5],[16,1],[18,3]]},"line-opacity":1,"line-color":"#d7d7d7","line-dasharray":{stops:[[15,[2,2]],[18,[3,3]]]}}},{id:"tunnel_service_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,2],[16,2],[17,4],[18,6]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_minor_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","minor"],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[15,3],[16,4],[17,8],[18,12]]},"line-opacity":1,"line-color":"rgba(238, 238, 238, 1)"}},{id:"tunnel_sec_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,2],[13,2],[14,3],[15,4],[16,6],[17,10],[18,14]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_pri_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_trunk_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_mot_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["==","brunnel","tunnel"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[10,1],[12,2],[13,3],[14,5],[15,7],[16,9],[17,11],[18,20]]},"line-opacity":1,"line-color":"#f0eee7"}},{id:"tunnel_rail",type:"line",source:"carto","source-layer":"transportation",minzoom:13,filter:["all",["==","class","rail"],["==","brunnel","tunnel"]],layout:{visibility:"visible","line-join":"round"},paint:{"line-color":"#dddddd","line-width":{base:1.3,stops:[[13,.5],[14,1],[15,1],[16,3],[21,7]]},"line-opacity":.5}},{id:"tunnel_rail_dash",type:"line",source:"carto","source-layer":"transportation",minzoom:15,filter:["all",["==","class","rail"],["==","brunnel","tunnel"]],layout:{visibility:"visible","line-join":"round"},paint:{"line-color":"#ffffff","line-width":{base:1.3,stops:[[15,.5],[16,1],[20,5]]},"line-dasharray":{stops:[[15,[5,5]],[16,[6,6]]]},"line-opacity":.5}},{id:"road_service_case",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,1],[16,3],[17,6],[18,8]]},"line-opacity":1,"line-color":"#fdebce"}},{id:"road_minor_case",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["==","class","minor"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,.5],[12,.5],[14,2],[15,3],[16,4.3],[17,10],[18,14]]},"line-opacity":1,"line-color":{stops:[[13,"#ffffff"],[15.7,"#ffffff"],[16,"#fdebce"]]}}},{id:"road_pri_case_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","primary"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,2],[13,3],[14,4],[15,5],[16,8],[17,10]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":"#ffeabb"}},{id:"road_trunk_case_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","trunk"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,2],[13,3],[14,4],[15,5],[16,8],[17,10]]},"line-opacity":1,"line-color":{stops:[[12,"#fbdb98"],[14,"#fbdb98"]]}}},{id:"road_mot_case_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","motorway"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,2],[13,3],[14,4],[15,5],[16,8],[17,10]]},"line-opacity":1,"line-color":{stops:[[12,"#fbdb98"],[14,"#fbdb98"]]}}},{id:"road_sec_case_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,.5],[12,1.5],[13,3],[14,5],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":{stops:[[11,"#fffef9"],[12.99,"#fffef9"],[13,"#ffedc0"]]}}},{id:"road_pri_case_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:7,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":{stops:[[7,"#ffe7b7"],[12,"#ffeabb"]]}}},{id:"road_trunk_case_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":{stops:[[5,"#ffe7b7"],[12,"#fbdb98"]]}}},{id:"road_mot_case_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.7],[8,.8],[11,3],[12,4],[13,5],[14,7],[15,9],[16,11],[17,13],[18,22]]},"line-opacity":{stops:[[6,.5],[7,1]]},"line-color":{stops:[[5,"#fbdb98"],[12,"#fbdb98"]]}}},{id:"road_path",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["in","class","path","track"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,.5],[16,1],[18,3]]},"line-opacity":1,"line-color":"#d7d7d7","line-dasharray":{stops:[[15,[2,2]],[18,[3,3]]]}}},{id:"road_service_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,2],[16,2],[17,4],[18,6]]},"line-opacity":1,"line-color":"#ffffff"}},{id:"road_minor_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","minor"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,3],[16,4],[17,8],[18,12]]},"line-opacity":1,"line-color":"#ffffff"}},{id:"road_pri_fill_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","primary"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,1],[13,1.5],[14,2],[15,3],[16,6],[17,8]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"road_trunk_fill_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","trunk"],["==","ramp",1]],layout:{"line-cap":"square","line-join":"round"},paint:{"line-width":{stops:[[12,1],[13,1.5],[14,2],[15,3],[16,6],[17,8]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"road_mot_fill_ramp",type:"line",source:"carto","source-layer":"transportation",minzoom:12,maxzoom:24,filter:["all",["==","class","motorway"],["==","ramp",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[12,1],[13,1.5],[14,2],[15,3],[16,6],[17,8]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"road_sec_fill_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,2],[13,2],[14,3],[15,4],[16,6],[17,10],[18,14]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"road_pri_fill_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[10,.3],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"road_trunk_fill_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"road_mot_fill_noramp",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["!has","brunnel"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[10,1],[12,2],[13,3],[14,5],[15,7],[16,9],[17,11],[18,20]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"rail",type:"line",source:"carto","source-layer":"transportation",minzoom:13,filter:["all",["==","class","rail"],["!=","brunnel","tunnel"]],layout:{visibility:"visible","line-join":"round"},paint:{"line-color":"#dddddd","line-width":{base:1.3,stops:[[13,.5],[14,1],[15,1],[16,3],[21,7]]}}},{id:"rail_dash",type:"line",source:"carto","source-layer":"transportation",minzoom:15,filter:["all",["==","class","rail"],["!=","brunnel","tunnel"]],layout:{visibility:"visible","line-join":"round"},paint:{"line-color":"#ffffff","line-width":{base:1.3,stops:[[15,.5],[16,1],[20,5]]},"line-dasharray":{stops:[[15,[5,5]],[16,[6,6]]]}}},{id:"bridge_service_case",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[15,1],[16,3],[17,6],[18,8]]},"line-opacity":1,"line-color":"#fdebce"}},{id:"bridge_minor_case",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["==","class","minor"],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-width":{stops:[[11,.5],[12,.5],[14,2],[15,3],[16,4.3],[17,10],[18,14]]},"line-opacity":1,"line-color":{stops:[[13,"#ffffff"],[15.7,"#ffffff"],[16,"#fdebce"]]}}},{id:"bridge_sec_case",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-width":{stops:[[11,.5],[12,1.5],[13,3],[14,5],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":{stops:[[11,"#fffef9"],[12.99,"#fffef9"],[13,"#ffedc0"]]}}},{id:"bridge_pri_case",type:"line",source:"carto","source-layer":"transportation",minzoom:8,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":{stops:[[8,"#ffe7b7"],[12,"#ffeabb"]]}}},{id:"bridge_trunk_case",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[13,4],[14,6],[15,8],[16,10],[17,14],[18,18]]},"line-opacity":{stops:[[5,.5],[7,1]]},"line-color":{stops:[[5,"#fbdb98"],[12,"#fbdb98"]]}}},{id:"bridge_mot_case",type:"line",source:"carto","source-layer":"transportation",minzoom:5,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[6,.5],[7,.8],[8,1],[11,3],[12,4],[13,5],[14,7],[15,9],[16,11],[17,13],[18,22]]},"line-opacity":{stops:[[6,.5],[7,1]]},"line-color":{stops:[[5,"#fbdb98"],[10,"#fbdb98"]]}}},{id:"bridge_path",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","path"],["==","brunnel","bridge"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,.5],[16,1],[18,3]]},"line-opacity":1,"line-color":"#d7d7d7","line-dasharray":{stops:[[15,[2,2]],[18,[3,3]]]}}},{id:"bridge_service_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","service"],["==","brunnel","bridge"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[15,2],[16,2],[17,4],[18,6]]},"line-opacity":1,"line-color":"#ffffff"}},{id:"bridge_minor_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:15,maxzoom:24,filter:["all",["==","class","minor"],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[15,3],[16,4],[17,8],[18,12]]},"line-opacity":1,"line-color":"#ffffff"}},{id:"bridge_sec_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:13,maxzoom:24,filter:["all",["in","class","secondary","tertiary"],["==","brunnel","bridge"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":{stops:[[11,2],[13,2],[14,3],[15,4],[16,6],[17,10],[18,14]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"bridge_pri_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["==","class","primary"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#fefdd7"}},{id:"bridge_trunk_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:11,maxzoom:24,filter:["all",["==","class","trunk"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-width":{stops:[[11,1],[13,2],[14,4],[15,6],[16,8],[17,12],[18,16]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"bridge_mot_fill",type:"line",source:"carto","source-layer":"transportation",minzoom:10,maxzoom:24,filter:["all",["==","class","motorway"],["!=","ramp",1],["==","brunnel","bridge"]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-width":{stops:[[10,1],[12,2],[13,3],[14,5],[15,7],[16,9],[17,11],[18,20]]},"line-opacity":1,"line-color":"#FFE9A5"}},{id:"building",type:"fill",source:"carto","source-layer":"building",layout:{visibility:"visible"},paint:{"fill-color":{base:1,stops:[[15.5,"#e4dcd0"],[16,"#e4dcd0"]]},"fill-antialias":!0}},{id:"building-top",type:"fill",source:"carto","source-layer":"building",layout:{visibility:"visible"},paint:{"fill-translate":{base:1,stops:[[14,[0,0]],[16,[-2,-2]]]},"fill-outline-color":"#e9d8be","fill-color":"#f3eadc","fill-opacity":{base:1,stops:[[13,0],[16,1]]}}},{id:"boundary_country_outline",type:"line",source:"carto","source-layer":"boundary",minzoom:6,maxzoom:24,filter:["all",["==","admin_level",2],["==","maritime",0]],layout:{"line-cap":"round","line-join":"round",visibility:"none"},paint:{"line-color":"#f3efed","line-opacity":.5,"line-width":8,"line-offset":0}},{id:"boundary_country_inner",type:"line",source:"carto","source-layer":"boundary",minzoom:0,filter:["all",["==","admin_level",2],["==","maritime",0]],layout:{"line-cap":"round","line-join":"round",visibility:"none"},paint:{"line-color":{stops:[[4,"#ead5d7"],[5,"#ebd6d8"],[6,"#ebd6d8"]]},"line-opacity":1,"line-width":{stops:[[3,1],[6,1.5]]},"line-offset":0}},{id:"watername_ocean",type:"symbol",source:"carto","source-layer":"water_name",minzoom:0,maxzoom:5,filter:["all",["has","name"],["==","$type","Point"],["==","class","ocean"]],layout:{"text-field":"{name}","symbol-placement":"point","text-size":{stops:[[0,13],[2,14],[4,18]]},"text-font":["Montserrat Medium Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-line-height":1.2,"text-padding":2,"text-allow-overlap":!1,"text-ignore-placement":!1,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-max-width":6,"text-letter-spacing":.1},paint:{"text-color":"#ffffff","text-halo-color":"#98c2ca","text-halo-width":1,"text-halo-blur":0}},{id:"watername_sea",type:"symbol",source:"carto","source-layer":"water_name",minzoom:5,filter:["all",["has","name"],["==","$type","Point"],["==","class","sea"]],layout:{"text-field":"{name}","symbol-placement":"point","text-size":12,"text-font":["Montserrat Medium Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-line-height":1.2,"text-padding":2,"text-allow-overlap":!1,"text-ignore-placement":!1,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-max-width":6,"text-letter-spacing":.1},paint:{"text-color":"#ffffff","text-halo-color":"#98c2ca","text-halo-width":1,"text-halo-blur":0}},{id:"watername_lake",type:"symbol",source:"carto","source-layer":"water_name",minzoom:4,filter:["all",["has","name"],["==","$type","Point"],["==","class","lake"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"symbol-placement":"point","text-size":{stops:[[13,9],[14,10],[15,11],[16,12],[17,13]]},"text-font":["Montserrat Regular Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-line-height":1.2,"text-padding":2,"text-allow-overlap":!1,"text-ignore-placement":!1,"text-pitch-alignment":"auto","text-rotation-alignment":"auto"},paint:{"text-color":"#51909c","text-halo-color":"#e2eef0","text-halo-width":1,"text-halo-blur":1}},{id:"watername_lake_line",type:"symbol",source:"carto","source-layer":"water_name",filter:["all",["has","name"],["==","$type","LineString"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"symbol-placement":"line","text-size":{stops:[[13,9],[14,10],[15,11],[16,12],[17,13]]},"text-font":["Montserrat Regular Italic","Open Sans Italic","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"symbol-spacing":350,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-line-height":1.2},paint:{"text-color":"#51909c","text-halo-color":"#e2eef0","text-halo-width":1,"text-halo-blur":1}},{id:"place_hamlet",type:"symbol",source:"carto","source-layer":"place",minzoom:12,maxzoom:16,filter:["any",["==","class","neighbourhood"],["==","class","hamlet"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[14,"{name}"]]},"text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[13,8],[14,10],[16,11]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":{stops:[[12,"none"],[14,"uppercase"]]}},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_suburbs",type:"symbol",source:"carto","source-layer":"place",minzoom:12,maxzoom:16,filter:["all",["==","class","suburb"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[12,9],[13,10],[14,11],[15,12],[16,13]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":{stops:[[8,"none"],[12,"uppercase"]]}},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_villages",type:"symbol",source:"carto","source-layer":"place",minzoom:10,maxzoom:16,filter:["all",["==","class","village"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[10,9],[12,10],[13,11],[14,12],[16,13]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"none"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_town",type:"symbol",source:"carto","source-layer":"place",minzoom:8,maxzoom:14,filter:["all",["==","class","town"]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[8,10],[9,10],[10,11],[13,14],[14,15]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"none"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_country_2",type:"symbol",source:"carto","source-layer":"place",minzoom:3,maxzoom:10,filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[3,10],[5,11],[6,12],[7,13],[8,14]]},"text-transform":"uppercase"},paint:{"text-color":{stops:[[3,"#6b7d91"],[5,"#8894a3"],[6,"#a3abb5"]]},"text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"place_country_1",type:"symbol",source:"carto","source-layer":"place",minzoom:2,maxzoom:7,filter:["all",["==","class","country"],["<=","rank",2]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[3,11],[4,12],[5,13],[6,14]]},"text-transform":"uppercase","text-max-width":{stops:[[2,6],[3,6],[4,9],[5,12]]}},paint:{"text-color":{stops:[[3,"#6b7d91"],[5,"#8894a3"],[6,"#a3abb5"]]},"text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"place_state",type:"symbol",source:"carto","source-layer":"place",minzoom:5,maxzoom:10,filter:["all",["==","class","state"],["<=","rank",4]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[5,12],[7,14]]},"text-transform":"uppercase","text-max-width":9},paint:{"text-color":"#7c8a9b","text-halo-color":"#fbf8f3","text-halo-width":0}},{id:"place_continent",type:"symbol",source:"carto","source-layer":"place",minzoom:0,maxzoom:2,filter:["all",["==","class","continent"]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-transform":"uppercase","text-size":14,"text-letter-spacing":.1,"text-max-width":9,"text-justify":"center","text-keep-upright":!1},paint:{"text-color":"#405c78","text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"place_city_r6",type:"symbol",source:"carto","source-layer":"place",minzoom:8,maxzoom:15,filter:["all",["==","class","city"],[">=","rank",6]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[8,12],[9,13],[10,14],[13,17],[14,20]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"uppercase"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_r5",type:"symbol",source:"carto","source-layer":"place",minzoom:8,maxzoom:15,filter:["all",["==","class","city"],[">=","rank",0],["<=","rank",5]],layout:{"text-field":{stops:[[8,"{name:ru}"],[13,"{name}"]]},"text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[8,14],[10,16],[13,19],[14,22]]},"icon-image":"","icon-offset":[16,0],"text-anchor":"center","icon-size":1,"text-max-width":10,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"uppercase"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_dot_r7",type:"symbol",source:"carto","source-layer":"place",minzoom:6,maxzoom:7,filter:["all",["==","class","city"],["<=","rank",7]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2]},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_dot_r4",type:"symbol",source:"carto","source-layer":"place",minzoom:5,maxzoom:7,filter:["all",["==","class","city"],["<=","rank",4]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2]},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_dot_r2",type:"symbol",source:"carto","source-layer":"place",minzoom:4,maxzoom:7,filter:["all",["==","class","city"],["<=","rank",2]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2]},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_city_dot_z7",type:"symbol",source:"carto","source-layer":"place",minzoom:7,maxzoom:8,filter:["all",["!has","capital"],["!in","class","country","state"]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2]},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"place_capital_dot_z7",type:"symbol",source:"carto","source-layer":"place",minzoom:7,maxzoom:8,filter:["all",[">","capital",0]],layout:{"text-field":"{name:ru}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":12,"icon-image":"circle-11","icon-offset":[16,5],"text-anchor":"right","icon-size":.4,"text-max-width":8,"text-keep-upright":!0,"text-offset":[.2,.2],"text-transform":"uppercase"},paint:{"text-color":"#405c78","icon-color":"#405c78","icon-translate-anchor":"map","text-halo-color":"#f2f5f8","text-halo-width":1}},{id:"poi_stadium",type:"symbol",source:"carto","source-layer":"poi",minzoom:15,filter:["all",["in","class","stadium","cemetery","attraction"],["<=","rank",3]],layout:{"text-field":"{name}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[15,8],[17,9],[18,10]]},"text-transform":"uppercase"},paint:{"text-color":"#666666","text-halo-color":"rgba(255,255,255,0.15)","text-halo-width":1}},{id:"poi_park",type:"symbol",source:"carto","source-layer":"poi",minzoom:15,filter:["all",["==","class","park"]],layout:{"text-field":"{name}","text-font":["Montserrat Medium","Open Sans Bold","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[15,8],[17,9],[18,10]]},"text-transform":"uppercase"},paint:{"text-color":"#666666","text-halo-color":"rgba(255,255,255,0.15)","text-halo-width":1}},{id:"roadname_minor",type:"symbol",source:"carto","source-layer":"transportation_name",minzoom:16,filter:["all",["in","class","minor","service"]],layout:{"symbol-placement":"line","text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":9,"text-field":"{name}","symbol-avoid-edges":!1,"symbol-spacing":200,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-justify":"center"},paint:{"text-color":"#87919e","text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"roadname_sec",type:"symbol",source:"carto","source-layer":"transportation_name",minzoom:15,filter:["all",["in","class","secondary","tertiary"]],layout:{"symbol-placement":"line","text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[15,9],[16,11],[18,12]]},"text-field":"{name}","symbol-avoid-edges":!1,"symbol-spacing":200,"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-justify":"center"},paint:{"text-color":"#87919e","text-halo-color":"#fbf8f3","text-halo-width":1}},{id:"roadname_pri",type:"symbol",source:"carto","source-layer":"transportation_name",minzoom:14,filter:["all",["in","class","primary"]],layout:{"symbol-placement":"line","text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[14,10],[15,10],[16,11],[18,12]]},"text-field":"{name}","symbol-avoid-edges":!1,"symbol-spacing":{stops:[[6,200],[16,250]]},"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-justify":"center","text-letter-spacing":{stops:[[14,0],[16,.2]]}},paint:{"text-color":"#798493","text-halo-color":"#fefde1","text-halo-width":1}},{id:"roadname_major",type:"symbol",source:"carto","source-layer":"transportation_name",minzoom:13,filter:["all",["in","class","trunk","motorway"]],layout:{"symbol-placement":"line","text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"],"text-size":{stops:[[14,10],[15,10],[16,11],[18,12]]},"text-field":"{name}","symbol-avoid-edges":!1,"symbol-spacing":{stops:[[6,200],[16,250]]},"text-pitch-alignment":"auto","text-rotation-alignment":"auto","text-justify":"center","text-letter-spacing":{stops:[[13,0],[16,.2]]}},paint:{"text-color":"#798493","text-halo-color":"#fff0c4","text-halo-width":1}},{id:"housenumber",type:"symbol",source:"carto","source-layer":"housenumber",minzoom:17,maxzoom:24,layout:{"text-field":"{housenumber}","text-size":{stops:[[17,9],[18,11]]},"text-font":["Montserrat Regular","Open Sans Regular","Noto Sans Regular","HanWangHeiLight Regular","NanumBarunGothic Regular"]},paint:{"text-halo-color":"rgba(255,255,255,0.15)","text-color":"#d2b17d","text-halo-width":.75}}],sye="voyager",lye="Carto",uye={version:eye,name:tye,metadata:rye,sources:nye,sprite:iye,glyphs:oye,layers:aye,id:sye,owner:lye};var Nv="delete",qn=5,Va=1<>>0;if(""+r!==t||r===4294967295)return NaN;t=r}return t<0?Gf(e)+t:t}function PL(){return!0}function Wx(e,t,r){return(e===0&&!IL(e)||r!==void 0&&e<=-r)&&(t===void 0||r!==void 0&&t>=r)}function zv(e,t){return ML(e,t,0)}function qx(e,t){return ML(e,t,t)}function ML(e,t,r){return e===void 0?r:IL(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function IL(e){return e<0||e===0&&1/e===-1/0}var RL="@@__IMMUTABLE_ITERABLE__@@";function Qo(e){return Boolean(e&&e[RL])}var OL="@@__IMMUTABLE_KEYED__@@";function Gn(e){return Boolean(e&&e[OL])}var AL="@@__IMMUTABLE_INDEXED__@@";function zo(e){return Boolean(e&&e[AL])}function Gx(e){return Gn(e)||zo(e)}var Ci=function(t){return Qo(t)?t:ea(t)},Xa=function(e){function t(r){return Gn(r)?r:oc(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ci),_d=function(e){function t(r){return zo(r)?r:Cs(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ci),Ch=function(e){function t(r){return Qo(r)&&!Gx(r)?r:Th(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ci);Ci.Keyed=Xa;Ci.Indexed=_d;Ci.Set=Ch;var NL="@@__IMMUTABLE_SEQ__@@";function yE(e){return Boolean(e&&e[NL])}var zL="@@__IMMUTABLE_RECORD__@@";function Sh(e){return Boolean(e&&e[zL])}function ws(e){return Qo(e)||Sh(e)}var Eh="@@__IMMUTABLE_ORDERED__@@";function ys(e){return Boolean(e&&e[Eh])}var Dv=0,bs=1,qa=2,w4=typeof Symbol=="function"&&Symbol.iterator,DL="@@iterator",Zx=w4||DL,_n=function(t){this.next=t};_n.prototype.toString=function(){return"[Iterator]"};_n.KEYS=Dv;_n.VALUES=bs;_n.ENTRIES=qa;_n.prototype.inspect=_n.prototype.toSource=function(){return this.toString()};_n.prototype[Zx]=function(){return this};function oi(e,t,r,n){var i=e===0?t:e===1?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function Jo(){return{value:void 0,done:!0}}function xE(e){return Array.isArray(e)?!0:!!Xx(e)}function QM(e){return e&&typeof e.next=="function"}function C4(e){var t=Xx(e);return t&&t.call(e)}function Xx(e){var t=e&&(w4&&e[w4]||e[DL]);if(typeof t=="function")return t}function cye(e){var t=Xx(e);return t&&t===e.entries}function dye(e){var t=Xx(e);return t&&t===e.keys}var kh=Object.prototype.hasOwnProperty;function _E(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var ea=function(e){function t(r){return r==null?wE():ws(r)?r.toSeq():hye(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,i){var a=this._cache;if(a){for(var u=a.length,o=0;o!==u;){var f=a[i?u-++o:o++];if(n(f[1],f[0],this)===!1)break}return o}return this.__iterateUncached(n,i)},t.prototype.__iterator=function(n,i){var a=this._cache;if(a){var u=a.length,o=0;return new _n(function(){if(o===u)return Jo();var f=a[i?u-++o:o++];return oi(n,f[0],f[1])})}return this.__iteratorUncached(n,i)},t}(Ci),oc=function(e){function t(r){return r==null?wE().toKeyedSeq():Qo(r)?Gn(r)?r.toSeq():r.fromEntrySeq():Sh(r)?r.toSeq():CE(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(ea),Cs=function(e){function t(r){return r==null?wE():Qo(r)?Gn(r)?r.entrySeq():r.toIndexedSeq():Sh(r)?r.toSeq().entrySeq():LL(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(ea),Th=function(e){function t(r){return(Qo(r)&&!Gx(r)?r:Cs(r)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(ea);ea.isSeq=yE;ea.Keyed=oc;ea.Set=Th;ea.Indexed=Cs;ea.prototype[NL]=!0;var ud=function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this.has(n)?this._array[qu(this,n)]:i},t.prototype.__iterate=function(n,i){for(var a=this._array,u=a.length,o=0;o!==u;){var f=i?u-++o:o++;if(n(a[f],f,this)===!1)break}return o},t.prototype.__iterator=function(n,i){var a=this._array,u=a.length,o=0;return new _n(function(){if(o===u)return Jo();var f=i?u-++o:o++;return oi(n,f,a[f])})},t}(Cs),bE=function(e){function t(r){var n=Object.keys(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[]);this._object=r,this._keys=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return i!==void 0&&!this.has(n)?i:this._object[n]},t.prototype.has=function(n){return kh.call(this._object,n)},t.prototype.__iterate=function(n,i){for(var a=this._object,u=this._keys,o=u.length,f=0;f!==o;){var p=u[i?o-++f:f++];if(n(a[p],p,this)===!1)break}return f},t.prototype.__iterator=function(n,i){var a=this._object,u=this._keys,o=u.length,f=0;return new _n(function(){if(f===o)return Jo();var p=u[i?o-++f:f++];return oi(n,p,a[p])})},t}(oc);bE.prototype[Eh]=!0;var fye=function(e){function t(r){this._collection=r,this.size=r.length||r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(i)return this.cacheResult().__iterate(n,i);var a=this._collection,u=C4(a),o=0;if(QM(u))for(var f;!(f=u.next()).done&&n(f.value,o++,this)!==!1;);return o},t.prototype.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var a=this._collection,u=C4(a);if(!QM(u))return new _n(Jo);var o=0;return new _n(function(){var f=u.next();return f.done?f:oi(n,o++,f.value)})},t}(Cs),JM;function wE(){return JM||(JM=new ud([]))}function CE(e){var t=SE(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new bE(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function LL(e){var t=SE(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function hye(e){var t=SE(e);if(t)return cye(e)?t.fromEntrySeq():dye(e)?t.toSetSeq():t;if(typeof e=="object")return new bE(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function SE(e){return _E(e)?new ud(e):xE(e)?new fye(e):void 0}var FL="@@__IMMUTABLE_MAP__@@";function EE(e){return Boolean(e&&e[FL])}function $L(e){return EE(e)&&ys(e)}function eI(e){return Boolean(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function ma(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(eI(e)&&eI(t)&&e.equals(t))}var Bp=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,r){t|=0,r|=0;var n=t&65535,i=r&65535;return n*i+((t>>>16)*i+n*(r>>>16)<<16>>>0)|0};function Yx(e){return e>>>1&1073741824|e&3221225471}var pye=Object.prototype.valueOf;function fa(e){if(e==null)return tI(e);if(typeof e.hashCode=="function")return Yx(e.hashCode(e));var t=_ye(e);if(t==null)return tI(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return mye(t);case"string":return t.length>bye?vye(t):S4(t);case"object":case"function":return yye(t);case"symbol":return gye(t);default:if(typeof t.toString=="function")return S4(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function tI(e){return e===null?1108378658:1108378659}function mye(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return Yx(t)}function vye(e){var t=$2[e];return t===void 0&&(t=S4(e),F2===wye&&(F2=0,$2={}),F2++,$2[e]=t),t}function S4(e){for(var t=0,r=0;r0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function _ye(e){return e.valueOf!==pye&&typeof e.valueOf=="function"?e.valueOf(e):e}function BL(){var e=++L2;return L2&1073741824&&(L2=0),e}var E4=typeof WeakMap=="function",k4;E4&&(k4=new WeakMap);var iI=Object.create(null),L2=0,Bc="__immutablehash__";typeof Symbol=="function"&&(Bc=Symbol(Bc));var bye=16,wye=255,F2=0,$2={},Qx=function(e){function t(r,n){this._iter=r,this._useKeys=n,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this._iter.get(n,i)},t.prototype.has=function(n){return this._iter.has(n)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var n=this,i=kE(this,!0);return this._useKeys||(i.valueSeq=function(){return n._iter.toSeq().reverse()}),i},t.prototype.map=function(n,i){var a=this,u=HL(this,n,i);return this._useKeys||(u.valueSeq=function(){return a._iter.toSeq().map(n,i)}),u},t.prototype.__iterate=function(n,i){var a=this;return this._iter.__iterate(function(u,o){return n(u,o,a)},i)},t.prototype.__iterator=function(n,i){return this._iter.__iterator(n,i)},t}(oc);Qx.prototype[Eh]=!0;var VL=function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var a=this,u=0;return i&&Gf(this),this._iter.__iterate(function(o){return n(o,i?a.size-++u:u++,a)},i)},t.prototype.__iterator=function(n,i){var a=this,u=this._iter.__iterator(bs,i),o=0;return i&&Gf(this),new _n(function(){var f=u.next();return f.done?f:oi(n,i?a.size-++o:o++,f.value,f)})},t}(Cs),jL=function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var a=this;return this._iter.__iterate(function(u){return n(u,u,a)},i)},t.prototype.__iterator=function(n,i){var a=this._iter.__iterator(bs,i);return new _n(function(){var u=a.next();return u.done?u:oi(n,u.value,u.value,u)})},t}(Th),UL=function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(n,i){var a=this;return this._iter.__iterate(function(u){if(u){aI(u);var o=Qo(u);return n(o?u.get(1):u[1],o?u.get(0):u[0],a)}},i)},t.prototype.__iterator=function(n,i){var a=this._iter.__iterator(bs,i);return new _n(function(){for(;;){var u=a.next();if(u.done)return u;var o=u.value;if(o){aI(o);var f=Qo(o);return oi(n,f?o.get(0):o[0],f?o.get(1):o[1],u)}}})},t}(oc);VL.prototype.cacheResult=Qx.prototype.cacheResult=jL.prototype.cacheResult=UL.prototype.cacheResult=ME;function KL(e){var t=Qs(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var r=e.reverse.apply(this);return r.flip=function(){return e.reverse()},r},t.has=function(r){return e.includes(r)},t.includes=function(r){return e.has(r)},t.cacheResult=ME,t.__iterateUncached=function(r,n){var i=this;return e.__iterate(function(a,u){return r(u,a,i)!==!1},n)},t.__iteratorUncached=function(r,n){if(r===qa){var i=e.__iterator(r,n);return new _n(function(){var a=i.next();if(!a.done){var u=a.value[0];a.value[0]=a.value[1],a.value[1]=u}return a})}return e.__iterator(r===bs?Dv:bs,n)},t}function HL(e,t,r){var n=Qs(e);return n.size=e.size,n.has=function(i){return e.has(i)},n.get=function(i,a){var u=e.get(i,ln);return u===ln?a:t.call(r,u,i,e)},n.__iterateUncached=function(i,a){var u=this;return e.__iterate(function(o,f,p){return i(t.call(r,o,f,p),f,u)!==!1},a)},n.__iteratorUncached=function(i,a){var u=e.__iterator(qa,a);return new _n(function(){var o=u.next();if(o.done)return o;var f=o.value,p=f[0];return oi(i,p,t.call(r,f[1],p,e),o)})},n}function kE(e,t){var r=this,n=Qs(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var i=KL(e);return i.reverse=function(){return e.flip()},i}),n.get=function(i,a){return e.get(t?i:-1-i,a)},n.has=function(i){return e.has(t?i:-1-i)},n.includes=function(i){return e.includes(i)},n.cacheResult=ME,n.__iterate=function(i,a){var u=this,o=0;return a&&Gf(e),e.__iterate(function(f,p){return i(f,t?p:a?u.size-++o:o++,u)},!a)},n.__iterator=function(i,a){var u=0;a&&Gf(e);var o=e.__iterator(qa,!a);return new _n(function(){var f=o.next();if(f.done)return f;var p=f.value;return oi(i,t?p[0]:a?r.size-++u:u++,p[1],f)})},n}function WL(e,t,r,n){var i=Qs(e);return n&&(i.has=function(a){var u=e.get(a,ln);return u!==ln&&!!t.call(r,u,a,e)},i.get=function(a,u){var o=e.get(a,ln);return o!==ln&&t.call(r,o,a,e)?o:u}),i.__iterateUncached=function(a,u){var o=this,f=0;return e.__iterate(function(p,v,y){if(t.call(r,p,v,y))return f++,a(p,n?v:f-1,o)},u),f},i.__iteratorUncached=function(a,u){var o=e.__iterator(qa,u),f=0;return new _n(function(){for(;;){var p=o.next();if(p.done)return p;var v=p.value,y=v[0],w=v[1];if(t.call(r,w,y,e))return oi(a,n?y:f++,w,p)}})},i}function Cye(e,t,r){var n=Mh().asMutable();return e.__iterate(function(i,a){n.update(t.call(r,i,a,e),0,function(u){return u+1})}),n.asImmutable()}function Sye(e,t,r){var n=Gn(e),i=(ys(e)?Fl():Mh()).asMutable();e.__iterate(function(u,o){i.update(t.call(r,u,o,e),function(f){return f=f||[],f.push(n?[o,u]:u),f})});var a=PE(e);return i.map(function(u){return Ln(e,a(u))}).asImmutable()}function Eye(e,t,r){var n=Gn(e),i=[[],[]];e.__iterate(function(u,o){i[t.call(r,u,o,e)?1:0].push(n?[o,u]:u)});var a=PE(e);return i.map(function(u){return Ln(e,a(u))})}function TE(e,t,r,n){var i=e.size;if(Wx(t,r,i))return e;var a=zv(t,i),u=qx(r,i);if(a!==a||u!==u)return TE(e.toSeq().cacheResult(),t,r,n);var o=u-a,f;o===o&&(f=o<0?0:o);var p=Qs(e);return p.size=f===0?f:e.size&&f||void 0,!n&&yE(e)&&f>=0&&(p.get=function(v,y){return v=qu(this,v),v>=0&&vf)return Jo();var R=w.next();return n||v===bs||R.done?R:v===Dv?oi(v,T-1,void 0,R):oi(v,T-1,R.value[1],R)})},p}function kye(e,t,r){var n=Qs(e);return n.__iterateUncached=function(i,a){var u=this;if(a)return this.cacheResult().__iterate(i,a);var o=0;return e.__iterate(function(f,p,v){return t.call(r,f,p,v)&&++o&&i(f,p,u)}),o},n.__iteratorUncached=function(i,a){var u=this;if(a)return this.cacheResult().__iterator(i,a);var o=e.__iterator(qa,a),f=!0;return new _n(function(){if(!f)return Jo();var p=o.next();if(p.done)return p;var v=p.value,y=v[0],w=v[1];return t.call(r,w,y,u)?i===qa?p:oi(i,y,w,p):(f=!1,Jo())})},n}function qL(e,t,r,n){var i=Qs(e);return i.__iterateUncached=function(a,u){var o=this;if(u)return this.cacheResult().__iterate(a,u);var f=!0,p=0;return e.__iterate(function(v,y,w){if(!(f&&(f=t.call(r,v,y,w))))return p++,a(v,n?y:p-1,o)}),p},i.__iteratorUncached=function(a,u){var o=this;if(u)return this.cacheResult().__iterator(a,u);var f=e.__iterator(qa,u),p=!0,v=0;return new _n(function(){var y,w,k;do{if(y=f.next(),y.done)return n||a===bs?y:a===Dv?oi(a,v++,void 0,y):oi(a,v++,y.value[1],y);var T=y.value;w=T[0],k=T[1],p&&(p=t.call(r,k,w,o))}while(p);return a===qa?y:oi(a,w,k,y)})},i}function Tye(e,t){var r=Gn(e),n=[e].concat(t).map(function(u){return Qo(u)?r&&(u=Xa(u)):u=r?CE(u):LL(Array.isArray(u)?u:[u]),u}).filter(function(u){return u.size!==0});if(n.length===0)return e;if(n.length===1){var i=n[0];if(i===e||r&&Gn(i)||zo(e)&&zo(i))return i}var a=new ud(n);return r?a=a.toKeyedSeq():zo(e)||(a=a.toSetSeq()),a=a.flatten(!0),a.size=n.reduce(function(u,o){if(u!==void 0){var f=o.size;if(f!==void 0)return u+f}},0),a}function GL(e,t,r){var n=Qs(e);return n.__iterateUncached=function(i,a){if(a)return this.cacheResult().__iterate(i,a);var u=0,o=!1;function f(p,v){p.__iterate(function(y,w){return(!t||v0}function Ay(e,t,r,n){var i=Qs(e),a=new ud(r).map(function(u){return u.size});return i.size=n?a.max():a.min(),i.__iterate=function(u,o){for(var f=this.__iterator(bs,o),p,v=0;!(p=f.next()).done&&u(p.value,v++,this)!==!1;);return v},i.__iteratorUncached=function(u,o){var f=r.map(function(y){return y=Ci(y),C4(o?y.reverse():y)}),p=0,v=!1;return new _n(function(){var y;return v||(y=f.map(function(w){return w.next()}),v=n?y.every(function(w){return w.done}):y.some(function(w){return w.done})),v?Jo():oi(u,p++,t.apply(null,y.map(function(w){return w.value})))})},i}function Ln(e,t){return e===t?e:yE(e)?t:e.constructor(t)}function aI(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function PE(e){return Gn(e)?Xa:zo(e)?_d:Ch}function Qs(e){return Object.create((Gn(e)?oc:zo(e)?Cs:Th).prototype)}function ME(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):ea.prototype.cacheResult.call(this)}function ZL(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e0;)t[r]=arguments[r+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return nF(this,t,e)}function nF(e,t,r){for(var n=[],i=0;i0;)t[r]=arguments[r+1];return zE(this,t,e)}function LE(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Ph(this,e,ms(),function(n){return DE(n,t)})}function FE(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Ph(this,e,ms(),function(n){return zE(n,t)})}function Lv(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Fv(){return this.__ownerID?this:this.__ensureOwner(new gE)}function $v(){return this.__ensureOwner()}function $E(){return this.__altered}var Mh=function(e){function t(r){return r==null?ms():EE(r)&&!ys(r)?r:ms().withMutations(function(n){var i=e(r);Ua(i.size),i.forEach(function(a,u){return n.set(u,a)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return ms().withMutations(function(a){for(var u=0;u=n.length)throw new Error("Missing value for key: "+n[u]);a.set(n[u],n[u+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,i){return this._root?this._root.get(0,void 0,n,i):i},t.prototype.set=function(n,i){return uI(this,n,i)},t.prototype.remove=function(n){return uI(this,n,ln)},t.prototype.deleteAll=function(n){var i=Ci(n);return i.size===0?this:this.withMutations(function(a){i.forEach(function(u){return a.remove(u)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ms()},t.prototype.sort=function(n){return Fl(Zf(this,n))},t.prototype.sortBy=function(n,i){return Fl(Zf(this,i,n))},t.prototype.map=function(n,i){var a=this;return this.withMutations(function(u){u.forEach(function(o,f){u.set(f,n.call(i,o,f,a))})})},t.prototype.__iterator=function(n,i){return new Fye(this,n,i)},t.prototype.__iterate=function(n,i){var a=this,u=0;return this._root&&this._root.iterate(function(o){return u++,n(o[1],o[0],a)},i),u},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?BE(this.size,this._root,n,this.__hash):this.size===0?ms():(this.__ownerID=n,this.__altered=!1,this)},t}(Xa);Mh.isMap=EE;var Xn=Mh.prototype;Xn[FL]=!0;Xn[Nv]=Xn.remove;Xn.removeAll=Xn.deleteAll;Xn.setIn=RE;Xn.removeIn=Xn.deleteIn=OE;Xn.update=AE;Xn.updateIn=NE;Xn.merge=Xn.concat=tF;Xn.mergeWith=rF;Xn.mergeDeep=iF;Xn.mergeDeepWith=oF;Xn.mergeIn=LE;Xn.mergeDeepIn=FE;Xn.withMutations=Lv;Xn.wasAltered=$E;Xn.asImmutable=$v;Xn["@@transducer/init"]=Xn.asMutable=Fv;Xn["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};Xn["@@transducer/result"]=function(e){return e.asImmutable()};var Xm=function(t,r){this.ownerID=t,this.entries=r};Xm.prototype.get=function(t,r,n,i){for(var a=this.entries,u=0,o=a.length;u=Kye)return $ye(t,p,i,a);var k=t&&t===this.ownerID,T=k?p:$s(p);return w?f?v===y-1?T.pop():T[v]=T.pop():T[v]=[i,a]:T.push([i,a]),k?(this.entries=T,this):new Xm(t,T)}};var Xf=function(t,r,n){this.ownerID=t,this.bitmap=r,this.nodes=n};Xf.prototype.get=function(t,r,n,i){r===void 0&&(r=fa(n));var a=1<<((t===0?r:r>>>t)&Ao),u=this.bitmap;return(u&a)===0?i:this.nodes[aF(u&a-1)].get(t+qn,r,n,i)};Xf.prototype.update=function(t,r,n,i,a,u,o){n===void 0&&(n=fa(i));var f=(r===0?n:n>>>r)&Ao,p=1<=Hye)return Vye(t,k,v,f,R);if(y&&!R&&k.length===2&&cI(k[w^1]))return k[w^1];if(y&&R&&k.length===1&&cI(R))return R;var A=t&&t===this.ownerID,I=y?R?v:v^p:v|p,O=y?R?sF(k,w,R,A):Uye(k,w,A):jye(k,w,R,A);return A?(this.bitmap=I,this.nodes=O,this):new Xf(t,I,O)};var Ym=function(t,r,n){this.ownerID=t,this.count=r,this.nodes=n};Ym.prototype.get=function(t,r,n,i){r===void 0&&(r=fa(n));var a=(t===0?r:r>>>t)&Ao,u=this.nodes[a];return u?u.get(t+qn,r,n,i):i};Ym.prototype.update=function(t,r,n,i,a,u,o){n===void 0&&(n=fa(i));var f=(r===0?n:n>>>r)&Ao,p=a===ln,v=this.nodes,y=v[f];if(p&&!y)return this;var w=VE(y,t,r+qn,n,i,a,u,o);if(w===y)return this;var k=this.count;if(!y)k++;else if(!w&&(k--,k>>r)&Ao,u=(r===0?n:n>>>r)&Ao,o,f=a===u?[jE(e,t,r+qn,n,i)]:(o=new Ll(t,n,i),a>>=1)u[o]=r&1?t[a++]:void 0;return u[n]=i,new Ym(e,a+1,u)}function aF(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function sF(e,t,r,n){var i=n?e:$s(e);return i[t]=r,i}function jye(e,t,r,n){var i=e.length+1;if(n&&t+1===i)return e[t]=r,e;for(var a=new Array(i),u=0,o=0;o0&&a=0&&n>>r&Ao;if(i>=this.array.length)return new Bu([],t);var a=i===0,u;if(r>0){var o=this.array[i];if(u=o&&o.removeBefore(t,r-qn,n),u===o&&a)return this}if(a&&!u)return this;var f=Qf(this,t);if(!a)for(var p=0;p>>r&Ao;if(i>=this.array.length)return this;var a;if(r>0){var u=this.array[i];if(a=u&&u.removeAfter(t,r-qn,n),a===u&&i===this.array.length-1)return this}var o=Qf(this,t);return o.array.splice(i+1),a&&(o.array[i]=a),o};var ym={};function dI(e,t){var r=e._origin,n=e._capacity,i=Jm(n),a=e._tail;return u(e._root,e._level,0);function u(p,v,y){return v===0?o(p,y):f(p,v,y)}function o(p,v){var y=v===i?a&&a.array:p&&p.array,w=v>r?0:r-v,k=n-v;return k>Va&&(k=Va),function(){if(w===k)return ym;var T=t?--k:w++;return y&&y[T]}}function f(p,v,y){var w,k=p&&p.array,T=y>r?0:r-y>>v,R=(n-y>>v)+1;return R>Va&&(R=Va),function(){for(;;){if(w){var A=w();if(A!==ym)return A;w=null}if(T===R)return ym;var I=t?--R:T++;w=u(k&&k[I],v-qn,y+(I<=e.size||t<0)return e.withMutations(function(u){t<0?gu(u,t).set(0,r):gu(u,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,i=e._root,a=b4();return t>=Jm(e._capacity)?n=T4(n,e.__ownerID,0,t,r,a):i=T4(i,e.__ownerID,e._level,t,r,a),a.value?e.__ownerID?(e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e):Qm(e._origin,e._capacity,e._level,i,n):e}function T4(e,t,r,n,i,a){var u=n>>>r&Ao,o=e&&u0){var p=e&&e.array[u],v=T4(p,t,r-qn,n,i,a);return v===p?e:(f=Qf(e,t),f.array[u]=v,f)}return o&&e.array[u]===i?e:(a&&ja(a),f=Qf(e,t),i===void 0&&u===f.array.length-1?f.array.pop():f.array[u]=i,f)}function Qf(e,t){return t&&e&&t===e.ownerID?e:new Bu(e?e.array.slice():[],t)}function cF(e,t){if(t>=Jm(e._capacity))return e._tail;if(t<1<0;)r=r.array[t>>>n&Ao],n-=qn;return r}}function gu(e,t,r){t!==void 0&&(t|=0),r!==void 0&&(r|=0);var n=e.__ownerID||new gE,i=e._origin,a=e._capacity,u=i+t,o=r===void 0?a:r<0?a+r:i+r;if(u===i&&o===a)return e;if(u>=o)return e.clear();for(var f=e._level,p=e._root,v=0;u+v<0;)p=new Bu(p&&p.array.length?[void 0,p]:[],n),f+=qn,v+=1<=1<y?new Bu([],n):k;if(k&&w>y&&uqn;A-=qn){var I=y>>>A&Ao;R=R.array[I]=Qf(R.array[I],n)}R.array[y>>>qn&Ao]=k}if(o=w)u-=w,o-=w,f=qn,p=null,T=T&&T.removeBefore(n,0,u);else if(u>i||w>>f&Ao;if(O!==w>>>f&Ao)break;O&&(v+=(1<i&&(p=p.removeBefore(n,f,u-v)),p&&w>>qn<=Va&&i.size>=n.size*2?(f=i.filter(function(p,v){return p!==void 0&&a!==v}),o=f.toKeyedSeq().map(function(p){return p[0]}).flip().toMap(),e.__ownerID&&(o.__ownerID=f.__ownerID=e.__ownerID)):(o=n.remove(t),f=a===i.size-1?i.pop():i.set(a,void 0))}else if(u){if(r===i.get(a)[1])return e;o=n,f=i.set(a,[t,r])}else o=n.set(t,i.size),f=i.set(i.size,[t,r]);return e.__ownerID?(e.size=o.size,e._map=o,e._list=f,e.__hash=void 0,e.__altered=!0,e):UE(o,f)}var dF="@@__IMMUTABLE_STACK__@@";function P4(e){return Boolean(e&&e[dF])}var KE=function(e){function t(r){return r==null?Ny():P4(r)?r:Ny().pushAll(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,i){var a=this._head;for(n=qu(this,n);a&&n--;)a=a.next;return a?a.value:i},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(arguments.length===0)return this;for(var i=this.size+arguments.length,a=this._head,u=arguments.length-1;u>=0;u--)a={value:n[u],next:a};return this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):Yp(i,a)},t.prototype.pushAll=function(n){if(n=e(n),n.size===0)return this;if(this.size===0&&P4(n))return n;Ua(n.size);var i=this.size,a=this._head;return n.__iterate(function(u){i++,a={value:u,next:a}},!0),this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):Yp(i,a)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Ny()},t.prototype.slice=function(n,i){if(Wx(n,i,this.size))return this;var a=zv(n,this.size),u=qx(i,this.size);if(u!==this.size)return e.prototype.slice.call(this,n,i);for(var o=this.size-a,f=this._head;a--;)f=f.next;return this.__ownerID?(this.size=o,this._head=f,this.__hash=void 0,this.__altered=!0,this):Yp(o,f)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?Yp(this.size,this._head,n,this.__hash):this.size===0?Ny():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,i){var a=this;if(i)return new ud(this.toArray()).__iterate(function(f,p){return n(f,p,a)},i);for(var u=0,o=this._head;o&&n(o.value,u++,this)!==!1;)o=o.next;return u},t.prototype.__iterator=function(n,i){if(i)return new ud(this.toArray()).__iterator(n,i);var a=0,u=this._head;return new _n(function(){if(u){var o=u.value;return u=u.next,oi(n,a++,o)}return Jo()})},t}(_d);KE.isStack=P4;var Fo=KE.prototype;Fo[dF]=!0;Fo.shift=Fo.pop;Fo.unshift=Fo.push;Fo.unshiftAll=Fo.pushAll;Fo.withMutations=Lv;Fo.wasAltered=$E;Fo.asImmutable=$v;Fo["@@transducer/init"]=Fo.asMutable=Fv;Fo["@@transducer/step"]=function(e,t){return e.unshift(t)};Fo["@@transducer/result"]=function(e){return e.asImmutable()};function Yp(e,t,r,n){var i=Object.create(Fo);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var mI;function Ny(){return mI||(mI=Yp(0))}var fF="@@__IMMUTABLE_SET__@@";function HE(e){return Boolean(e&&e[fF])}function hF(e){return HE(e)&&ys(e)}function pF(e,t){if(e===t)return!0;if(!Qo(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||Gn(e)!==Gn(t)||zo(e)!==zo(t)||ys(e)!==ys(t))return!1;if(e.size===0&&t.size===0)return!0;var r=!Gx(e);if(ys(e)){var n=e.entries();return t.every(function(f,p){var v=n.next().value;return v&&ma(v[1],f)&&(r||ma(v[0],p))})&&n.next().done}var i=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{i=!0;var a=e;e=t,t=a}var u=!0,o=t.__iterate(function(f,p){if(r?!e.has(f):i?!ma(f,e.get(p,ln)):!ma(e.get(p,ln),f))return u=!1,!1});return u&&e.size===o}function bd(e,t){var r=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function b1(e){if(!e||typeof e!="object")return e;if(!Qo(e)){if(!Gu(e))return e;e=ea(e)}if(Gn(e)){var t={};return e.__iterate(function(n,i){t[i]=b1(n)}),t}var r=[];return e.__iterate(function(n){r.push(b1(n))}),r}var e_=function(e){function t(r){return r==null?Qp():HE(r)&&!ys(r)?r:Qp().withMutations(function(n){var i=e(r);Ua(i.size),i.forEach(function(a){return n.add(a)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Xa(n).keySeq())},t.intersect=function(n){return n=Ci(n).toArray(),n.length?ao.intersect.apply(t(n.pop()),n):Qp()},t.union=function(n){return n=Ci(n).toArray(),n.length?ao.union.apply(t(n.pop()),n):Qp()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return zy(this,this._map.set(n,n))},t.prototype.remove=function(n){return zy(this,this._map.remove(n))},t.prototype.clear=function(){return zy(this,this._map.clear())},t.prototype.map=function(n,i){var a=this,u=!1,o=zy(this,this._map.mapEntries(function(f){var p=f[1],v=n.call(i,p,p,a);return v!==p&&(u=!0),[v,v]},i));return u?o:this},t.prototype.union=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return n=n.filter(function(a){return a.size!==0}),n.length===0?this:this.size===0&&!this.__ownerID&&n.length===1?this.constructor(n[0]):this.withMutations(function(a){for(var u=0;u=0&&i=0&&athis.size?r:this.find(function(n,i){return i===t},void 0,r)},has:function(t){return t=qu(this,t),t>=0&&(this.size!==void 0?this.size===1/0||tt?-1:0}function Jye(e){if(e.size===1/0)return 0;var t=ys(e),r=Gn(e),n=t?1:0,i=e.__iterate(r?t?function(a,u){n=31*n+bI(fa(a),fa(u))|0}:function(a,u){n=n+bI(fa(a),fa(u))|0}:t?function(a){n=31*n+fa(a)|0}:function(a){n=n+fa(a)|0});return e0e(i,n)}function e0e(e,t){return t=Bp(t,3432918353),t=Bp(t<<15|t>>>-15,461845907),t=Bp(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Bp(t^t>>>16,2246822507),t=Bp(t^t>>>13,3266489909),t=Yx(t^t>>>16),t}function bI(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var ev=function(e){function t(r){return r==null?M4():hF(r)?r:M4().withMutations(function(n){var i=Ch(r);Ua(i.size),i.forEach(function(a){return n.add(a)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Xa(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(e_);ev.isOrderedSet=hF;var wd=ev.prototype;wd[Eh]=!0;wd.zip=Ih.zip;wd.zipWith=Ih.zipWith;wd.zipAll=Ih.zipAll;wd.__empty=M4;wd.__make=xF;function xF(e,t){var r=Object.create(wd);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}var wI;function M4(){return wI||(wI=xF(Xp()))}function t0e(e){if(Sh(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(ws(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Ji=function(t,r){var n;t0e(t);var i=function(o){var f=this;if(o instanceof i)return o;if(!(this instanceof i))return new i(o);if(!n){n=!0;var p=Object.keys(t),v=a._indices={};a._name=r,a._keys=p,a._defaultValues=t;for(var y=0;y2?[]:void 0,{"":e})}function _F(e,t,r,n,i,a){if(typeof r!="string"&&!ws(r)&&(_E(r)||xE(r)||YL(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&n!==""&&i.push(n);var u=t.call(a,n,ea(r).map(function(o,f){return _F(e,t,o,f,i,r)}),i&&i.slice());return e.pop(),i&&i.pop(),u}return r}function i0e(e,t){return zo(t)?t.toList():Gn(t)?t.toMap():t.toSet()}n0e(uye);const o0e=()=>{const e=C.exports.useRef(null),t=C.exports.useRef(null),r=C.exports.useRef(null),{popup:n,setPopup:i}=SL(),{setClickedPointConfig:a}=ic(),{setLayersVisibility:u}=wh(),{setStatus:o}=Ui(),{mode:f}=nc(),{tableState:p,openTable:v}=pE();C.exports.useEffect(()=>{o(spe[f]),u(lpe[f]),i(null),a(null)},[f]);const y=I=>{if(!I.features){i(null),a(null);return}const O=I.features[0];if(!O){i(null),a(null);return}const{lng:N}=I.lngLat;if(O.geometry.type==="Point"){const L=O.geometry.coordinates.slice();for(;Math.abs(N-L[0])>180;)L[0]+=N>L[0]?360:-360;i({features:I.features,coordinates:L})}},w=I=>{!I.features[0]||(e.current.getCanvas().style.cursor="pointer")},k=I=>{!I.features[0]||(e.current.getCanvas().style.cursor="")};C.exports.useEffect(()=>{const I=new ResizeObserver(Mge(()=>{var O;(O=e==null?void 0:e.current)==null||O.resize()},16));return t.current&&I.observe(t.current),()=>{I.disconnect()}},[t.current]),C.exports.useEffect(()=>{p.fullScreen&&!p.isOpened&&v()},[p.fullScreen]);const[T,R]=C.exports.useState(!1),A=()=>R(I=>!I);return E(nme,{children:Qe("div",{className:"w-screen h-screen relative flex overflow-hidden",children:[E(Jge,{}),E(bve,{isCollapsed:T,ref:r}),Qe("div",{className:"flex-1 h-screen flex flex-col ",children:[E("div",{ref:t,className:ld(p.fullScreen?"":"flex-1"),children:Qe(lE,{mapLib:Jpe,initialViewState:{latitude:55.7558,longitude:37.6173,zoom:9},dragRotate:!1,ref:e,interactiveLayerIds:[vn["initial-match"],vn["initial-unmatch"],vn.approve,vn.working],onClick:y,onMouseEnter:w,onMouseLeave:k,id:"map",children:[n&&E(lge,{lat:n.coordinates[1],lng:n.coordinates[0],features:n.features,onClose:()=>{i(null),a(null)}}),E($ge,{toggleCollapse:A}),E(cge,{}),E(Dve,{}),E(Ige,{}),E(dge,{}),E(Hge,{})]})}),E("div",{className:"w-full border-solid border-border border-0 border-t-[1px] z-20",children:E(Lge,{fullWidth:T})})]})]})})};function a0e(){return E(Qpe,{children:E(o0e,{})})}const s0e=new Vhe;Tpe();function l0e(){return E(Hhe,{client:s0e,children:E(NU,{basename:"/",children:Qe(PU,{children:[E(Hp,{path:"/",element:E(a0e,{})}),E(Hp,{path:"/signin",element:E(Wpe,{})}),E(Hp,{path:"/verify-user",element:E(Gpe,{})}),E(Hp,{path:"/register",element:E(Ype,{})})]})})})}j2.createRoot(document.getElementById("root")).render(E(en.StrictMode,{children:E(l0e,{})}));