@metoceanapi/wxtiles-leaflet 2.0.0 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ (()=>{var es=Object.create;var io=Object.defineProperty;var is=Object.getOwnPropertyDescriptor;var ns=Object.getOwnPropertyNames;var os=Object.getPrototypeOf,rs=Object.prototype.hasOwnProperty;var ss=(a,r)=>()=>(r||a((r={exports:{}}).exports,r),r.exports);var as=(a,r,s,h)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of ns(r))!rs.call(a,u)&&u!==s&&io(a,u,{get:()=>r[u],enumerable:!(h=is(r,u))||h.enumerable});return a};var no=(a,r,s)=>(s=a!=null?es(os(a)):{},as(r||!a||!a.__esModule?io(s,"default",{value:a,enumerable:!0}):s,a));var Oi=ss((ze,oo)=>{(function(a,r){typeof ze=="object"&&typeof oo<"u"?r(ze):typeof define=="function"&&define.amd?define(["exports"],r):(a=typeof globalThis<"u"?globalThis:a||self,r(a.leaflet={}))})(ze,function(a){"use strict";var r="1.9.2";function s(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++){o=arguments[i];for(e in o)t[e]=o[e]}return t}var h=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function u(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var c=0;function f(t){return"_leaflet_id"in t||(t._leaflet_id=++c),t._leaflet_id}function p(t,e,i){var n,o,l,d;return d=function(){n=!1,o&&(l.apply(i,o),o=!1)},l=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(d,e),n=!0)},l}function v(t,e,i){var n=e[1],o=e[0],l=n-o;return t===n&&i?t:((t-o)%l+l)%l+o}function g(){return!1}function b(t,e){if(e===!1)return t;var i=Math.pow(10,e===void 0?6:e);return Math.round(t*i)/i}function C(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function T(t){return C(t).split(/\s+/)}function w(t,e){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?h(t.options):{});for(var i in e)t.options[i]=e[i];return t.options}function S(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(!e||e.indexOf("?")===-1?"?":"&")+n.join("&")}var x=/\{ *([\w_ -]+) *\}/g;function M(t,e){return t.replace(x,function(i,n){var o=e[n];if(o===void 0)throw new Error("No value provided for variable "+i);return typeof o=="function"&&(o=o(e)),o})}var Z=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function F(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var N="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Q(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var H=0;function G(t){var e=+new Date,i=Math.max(0,16-(e-H));return H=e+i,window.setTimeout(t,i)}var tt=window.requestAnimationFrame||Q("RequestAnimationFrame")||G,ft=window.cancelAnimationFrame||Q("CancelAnimationFrame")||Q("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function Y(t,e,i){if(i&&tt===G)t.call(e);else return tt.call(window,u(t,e))}function et(t){t&&ft.call(window,t)}var Io={__proto__:null,extend:s,create:h,bind:u,get lastId(){return c},stamp:f,throttle:p,wrapNum:v,falseFn:g,formatNum:b,trim:C,splitWords:T,setOptions:w,getParamString:S,template:M,isArray:Z,indexOf:F,emptyImageUrl:N,requestFn:tt,cancelFn:ft,requestAnimFrame:Y,cancelAnimFrame:et};function yt(){}yt.extend=function(t){var e=function(){w(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,n=h(i);n.constructor=e,e.prototype=n;for(var o in this)Object.prototype.hasOwnProperty.call(this,o)&&o!=="prototype"&&o!=="__super__"&&(e[o]=this[o]);return t.statics&&s(e,t.statics),t.includes&&(ko(t.includes),s.apply(null,[n].concat(t.includes))),s(n,t),delete n.statics,delete n.includes,n.options&&(n.options=i.options?h(i.options):{},s(n.options,t.options)),n._initHooks=[],n.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var l=0,d=n._initHooks.length;l<d;l++)n._initHooks[l].call(this)}},e},yt.include=function(t){var e=this.prototype.options;return s(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},yt.mergeOptions=function(t){return s(this.prototype.options,t),this},yt.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i=typeof t=="function"?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};function ko(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=Z(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var st={on:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e);else{t=T(t);for(var o=0,l=t.length;o<l;o++)this._on(t[o],e,i)}return this},off:function(t,e,i){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var n in t)this._off(n,t[n],e);else{t=T(t);for(var o=arguments.length===1,l=0,d=t.length;l<d;l++)o?this._off(t[l]):this._off(t[l],e,i)}return this},_on:function(t,e,i,n){if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}if(this._listens(t,e,i)===!1){i===this&&(i=void 0);var o={fn:e,ctx:i};n&&(o.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(o)}},_off:function(t,e,i){var n,o,l;if(!!this._events&&(n=this._events[t],!!n)){if(arguments.length===1){if(this._firingCount)for(o=0,l=n.length;o<l;o++)n[o].fn=g;delete this._events[t];return}if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}var d=this._listens(t,e,i);if(d!==!1){var m=n[d];this._firingCount&&(m.fn=g,this._events[t]=n=n.slice()),n.splice(d,1)}}},fire:function(t,e,i){if(!this.listens(t,i))return this;var n=s({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var l=0,d=o.length;l<d;l++){var m=o[l],_=m.fn;m.once&&this.off(t,_,m.ctx),_.call(m.ctx||this,n)}this._firingCount--}}return i&&this._propagateEvent(n),this},listens:function(t,e,i,n){typeof t!="string"&&console.warn('"string" type argument expected');var o=e;typeof e!="function"&&(n=!!e,o=void 0,i=void 0);var l=this._events&&this._events[t];if(l&&l.length&&this._listens(t,o,i)!==!1)return!0;if(n){for(var d in this._eventParents)if(this._eventParents[d].listens(t,e,i,n))return!0}return!1},_listens:function(t,e,i){if(!this._events)return!1;var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,l=n.length;o<l;o++)if(n[o].fn===e&&n[o].ctx===i)return o;return!1},once:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e,!0);else{t=T(t);for(var o=0,l=t.length;o<l;o++)this._on(t[o],e,i,!0)}return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[f(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[f(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,s({layer:t.target,propagatedFrom:t.target},t),!0)}};st.addEventListener=st.on,st.removeEventListener=st.clearAllEventListeners=st.off,st.addOneTimeEventListener=st.once,st.fireEvent=st.fire,st.hasEventListeners=st.listens;var jt=yt.extend(st);function W(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var Vi=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};W.prototype={clone:function(){return new W(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new W(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new W(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Vi(this.x),this.y=Vi(this.y),this},distanceTo:function(t){t=D(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=D(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+b(this.x)+", "+b(this.y)+")"}};function D(t,e,i){return t instanceof W?t:Z(t)?new W(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new W(t.x,t.y):new W(t,e,i)}function j(t,e){if(!!t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}j.prototype={extend:function(t){var e,i;if(!t)return this;if(t instanceof W||typeof t[0]=="number"||"x"in t)e=i=D(t);else if(t=ot(t),e=t.min,i=t.max,!e||!i)return this;return!this.min&&!this.max?(this.min=e.clone(),this.max=i.clone()):(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)),this},getCenter:function(t){return D((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return D(this.min.x,this.max.y)},getTopRight:function(){return D(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return typeof t[0]=="number"||t instanceof W?t=D(t):t=ot(t),t instanceof j?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=ot(t);var e=this.min,i=this.max,n=t.min,o=t.max,l=o.x>=e.x&&n.x<=i.x,d=o.y>=e.y&&n.y<=i.y;return l&&d},overlaps:function(t){t=ot(t);var e=this.min,i=this.max,n=t.min,o=t.max,l=o.x>e.x&&n.x<i.x,d=o.y>e.y&&n.y<i.y;return l&&d},isValid:function(){return!!(this.min&&this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,o=Math.abs(e.y-i.y)*t;return ot(D(e.x-n,e.y-o),D(i.x+n,i.y+o))},equals:function(t){return t?(t=ot(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function ot(t,e){return!t||t instanceof j?t:new j(t,e)}function rt(t,e){if(!!t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}rt.prototype={extend:function(t){var e=this._southWest,i=this._northEast,n,o;if(t instanceof U)n=t,o=t;else if(t instanceof rt){if(n=t._southWest,o=t._northEast,!n||!o)return this}else return t?this.extend(V(t)||it(t)):this;return!e&&!i?(this._southWest=new U(n.lat,n.lng),this._northEast=new U(o.lat,o.lng)):(e.lat=Math.min(n.lat,e.lat),e.lng=Math.min(n.lng,e.lng),i.lat=Math.max(o.lat,i.lat),i.lng=Math.max(o.lng,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new rt(new U(e.lat-n,e.lng-o),new U(i.lat+n,i.lng+o))},getCenter:function(){return new U((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new U(this.getNorth(),this.getWest())},getSouthEast:function(){return new U(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){typeof t[0]=="number"||t instanceof U||"lat"in t?t=V(t):t=it(t);var e=this._southWest,i=this._northEast,n,o;return t instanceof rt?(n=t.getSouthWest(),o=t.getNorthEast()):n=o=t,n.lat>=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},intersects:function(t){t=it(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),l=o.lat>=e.lat&&n.lat<=i.lat,d=o.lng>=e.lng&&n.lng<=i.lng;return l&&d},overlaps:function(t){t=it(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),l=o.lat>e.lat&&n.lat<i.lat,d=o.lng>e.lng&&n.lng<i.lng;return l&&d},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return t?(t=it(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function it(t,e){return t instanceof rt?t:new rt(t,e)}function U(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,i!==void 0&&(this.alt=+i)}U.prototype={equals:function(t,e){if(!t)return!1;t=V(t);var i=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return i<=(e===void 0?1e-9:e)},toString:function(t){return"LatLng("+b(this.lat,t)+", "+b(this.lng,t)+")"},distanceTo:function(t){return Pt.distance(this,V(t))},wrap:function(){return Pt.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return it([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new U(this.lat,this.lng,this.alt)}};function V(t,e,i){return t instanceof U?t:Z(t)&&typeof t[0]!="object"?t.length===3?new U(t[0],t[1],t[2]):t.length===2?new U(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new U(t.lat,"lng"in t?t.lng:t.lon,t.alt):e===void 0?null:new U(t,e,i)}var xt={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t),n=this.transformation.transform(e.min,i),o=this.transformation.transform(e.max,i);return new j(n,o)},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?v(t.lng,this.wrapLng,!0):t.lng,i=this.wrapLat?v(t.lat,this.wrapLat,!0):t.lat,n=t.alt;return new U(i,e,n)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(n===0&&o===0)return t;var l=t.getSouthWest(),d=t.getNorthEast(),m=new U(l.lat-n,l.lng-o),_=new U(d.lat-n,d.lng-o);return new rt(m,_)}},Pt=s({},xt,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,l=Math.sin((e.lat-t.lat)*i/2),d=Math.sin((e.lng-t.lng)*i/2),m=l*l+Math.cos(n)*Math.cos(o)*d*d,_=2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m));return this.R*_}}),qi=6378137,ei={R:qi,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new W(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new U((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=qi*Math.PI;return new j([-t,-t],[t,t])}()};function ii(t,e,i,n){if(Z(t)){this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3];return}this._a=t,this._b=e,this._c=i,this._d=n}ii.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new W((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};function $t(t,e,i,n){return new ii(t,e,i,n)}var ni=s({},Pt,{code:"EPSG:3857",projection:ei,transformation:function(){var t=.5/(Math.PI*ei.R);return $t(t,.5,-t,.5)}()}),Do=s({},ni,{code:"EPSG:900913"});function Gi(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ji(t,e){var i="",n,o,l,d,m,_;for(n=0,l=t.length;n<l;n++){for(m=t[n],o=0,d=m.length;o<d;o++)_=m[o],i+=(o?"L":"M")+_.x+" "+_.y;i+=e?I.svg?"z":"x":""}return i||"M0 0"}var oi=document.documentElement.style,_e="ActiveXObject"in window,Eo=_e&&!document.addEventListener,$i="msLaunchUri"in navigator&&!("documentMode"in document),ri=mt("webkit"),Xi=mt("android"),Yi=mt("android 2")||mt("android 3"),Wo=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Ao=Xi&&mt("Google")&&Wo<537&&!("AudioNode"in window),si=!!window.opera,Ki=!$i&&mt("chrome"),Ji=mt("gecko")&&!ri&&!si&&!_e,Oo=!Ki&&mt("safari"),Qi=mt("phantom"),tn="OTransition"in oi,zo=navigator.platform.indexOf("Win")===0,en=_e&&"transition"in oi,ai="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Yi,nn="MozPerspective"in oi,Zo=!window.L_DISABLE_3D&&(en||ai||nn)&&!tn&&!Qi,Xt=typeof orientation<"u"||mt("mobile"),Ro=Xt&&ri,Bo=Xt&&ai,on=!window.PointerEvent&&window.MSPointerEvent,rn=!!(window.PointerEvent||on),sn="ontouchstart"in window||!!window.TouchEvent,No=!window.L_NO_TOUCH&&(sn||rn),Fo=Xt&&si,Ho=Xt&&Ji,Uo=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Vo=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",g,e),window.removeEventListener("testPassiveEventSupport",g,e)}catch{}return t}(),qo=function(){return!!document.createElement("canvas").getContext}(),li=!!(document.createElementNS&&Gi("svg").createSVGRect),Go=!!li&&function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),jo=!li&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&typeof e.adj=="object"}catch{return!1}}(),$o=navigator.platform.indexOf("Mac")===0,Xo=navigator.platform.indexOf("Linux")===0;function mt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var I={ie:_e,ielt9:Eo,edge:$i,webkit:ri,android:Xi,android23:Yi,androidStock:Ao,opera:si,chrome:Ki,gecko:Ji,safari:Oo,phantom:Qi,opera12:tn,win:zo,ie3d:en,webkit3d:ai,gecko3d:nn,any3d:Zo,mobile:Xt,mobileWebkit:Ro,mobileWebkit3d:Bo,msPointer:on,pointer:rn,touch:No,touchNative:sn,mobileOpera:Fo,mobileGecko:Ho,retina:Uo,passiveEvents:Vo,canvas:qo,svg:li,vml:jo,inlineSvg:Go,mac:$o,linux:Xo},an=I.msPointer?"MSPointerDown":"pointerdown",ln=I.msPointer?"MSPointerMove":"pointermove",hn=I.msPointer?"MSPointerUp":"pointerup",un=I.msPointer?"MSPointerCancel":"pointercancel",hi={touchstart:an,touchmove:ln,touchend:hn,touchcancel:un},cn={touchstart:er,touchmove:ge,touchend:ge,touchcancel:ge},Rt={},dn=!1;function Yo(t,e,i){return e==="touchstart"&&tr(),cn[e]?(i=cn[e].bind(this,i),t.addEventListener(hi[e],i,!1),i):(console.warn("wrong event specified:",e),L.Util.falseFn)}function Ko(t,e,i){if(!hi[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(hi[e],i,!1)}function Jo(t){Rt[t.pointerId]=t}function Qo(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function fn(t){delete Rt[t.pointerId]}function tr(){dn||(document.addEventListener(an,Jo,!0),document.addEventListener(ln,Qo,!0),document.addEventListener(hn,fn,!0),document.addEventListener(un,fn,!0),dn=!0)}function ge(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in Rt)e.touches.push(Rt[i]);e.changedTouches=[e],t(e)}}function er(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&nt(e),ge(t,e)}function ir(t){var e={},i,n;for(n in t)i=t[n],e[n]=i&&i.bind?i.bind(t):i;return t=e,e.type="dblclick",e.detail=2,e.isTrusted=!1,e._simulated=!0,e}var nr=200;function or(t,e){t.addEventListener("dblclick",e);var i=0,n;function o(l){if(l.detail!==1){n=l.detail;return}if(!(l.pointerType==="mouse"||l.sourceCapabilities&&!l.sourceCapabilities.firesTouchEvents)){var d=vn(l);if(!(d.some(function(_){return _ instanceof HTMLLabelElement&&_.attributes.for})&&!d.some(function(_){return _ instanceof HTMLInputElement||_ instanceof HTMLSelectElement}))){var m=Date.now();m-i<=nr?(n++,n===2&&e(ir(l))):n=1,i=m}}}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function rr(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var ui=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Yt=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),mn=Yt==="webkitTransition"||Yt==="OTransition"?Yt+"End":"transitionend";function pn(t){return typeof t=="string"?document.getElementById(t):t}function Kt(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||i==="auto")&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return i==="auto"?null:i}function B(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function $(t){var e=t.parentNode;e&&e.removeChild(t)}function ve(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Bt(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function Nt(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ci(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=ye(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function O(t,e){if(t.classList!==void 0)for(var i=T(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!ci(t,e)){var l=ye(t);di(t,(l?l+" ":"")+e)}}function X(t,e){t.classList!==void 0?t.classList.remove(e):di(t,C((" "+ye(t)+" ").replace(" "+e+" "," ")))}function di(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e}function ye(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function lt(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&sr(t,e)}function sr(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch{if(e===1)return}e=Math.round(e*100),i?(i.Enabled=e!==100,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function It(t,e,i){var n=e||new W(0,0);t.style[ui]=(I.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function K(t,e){t._leaflet_pos=e,I.any3d?It(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function kt(t){return t._leaflet_pos||new W(0,0)}var Jt,Qt,fi;if("onselectstart"in document)Jt=function(){E(window,"selectstart",nt)},Qt=function(){q(window,"selectstart",nt)};else{var te=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Jt=function(){if(te){var t=document.documentElement.style;fi=t[te],t[te]="none"}},Qt=function(){te&&(document.documentElement.style[te]=fi,fi=void 0)}}function mi(){E(window,"dragstart",nt)}function pi(){q(window,"dragstart",nt)}var be,_i;function gi(t){for(;t.tabIndex===-1;)t=t.parentNode;!t.style||(we(),be=t,_i=t.style.outline,t.style.outline="none",E(window,"keydown",we))}function we(){!be||(be.style.outline=_i,be=void 0,_i=void 0,q(window,"keydown",we))}function _n(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function vi(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var ar={__proto__:null,TRANSFORM:ui,TRANSITION:Yt,TRANSITION_END:mn,get:pn,getStyle:Kt,create:B,remove:$,empty:ve,toFront:Bt,toBack:Nt,hasClass:ci,addClass:O,removeClass:X,setClass:di,getClass:ye,setOpacity:lt,testProp:xe,setTransform:It,setPosition:K,getPosition:kt,get disableTextSelection(){return Jt},get enableTextSelection(){return Qt},disableImageDrag:mi,enableImageDrag:pi,preventOutline:gi,restoreOutline:we,getSizedParentNode:_n,getScale:vi};function E(t,e,i,n){if(e&&typeof e=="object")for(var o in e)xi(t,o,e[o],i);else{e=T(e);for(var l=0,d=e.length;l<d;l++)xi(t,e[l],i,n)}return this}var pt="_leaflet_events";function q(t,e,i,n){if(arguments.length===1)gn(t),delete t[pt];else if(e&&typeof e=="object")for(var o in e)bi(t,o,e[o],i);else if(e=T(e),arguments.length===2)gn(t,function(m){return F(e,m)!==-1});else for(var l=0,d=e.length;l<d;l++)bi(t,e[l],i,n);return this}function gn(t,e){for(var i in t[pt]){var n=i.split(/\d/)[0];(!e||e(n))&&bi(t,n,null,null,i)}}var yi={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function xi(t,e,i,n){var o=e+f(i)+(n?"_"+f(n):"");if(t[pt]&&t[pt][o])return this;var l=function(m){return i.call(n||t,m||window.event)},d=l;!I.touchNative&&I.pointer&&e.indexOf("touch")===0?l=Yo(t,e,l):I.touch&&e==="dblclick"?l=or(t,l):"addEventListener"in t?e==="touchstart"||e==="touchmove"||e==="wheel"||e==="mousewheel"?t.addEventListener(yi[e]||e,l,I.passiveEvents?{passive:!1}:!1):e==="mouseenter"||e==="mouseleave"?(l=function(m){m=m||window.event,Li(t,m)&&d(m)},t.addEventListener(yi[e],l,!1)):t.addEventListener(e,d,!1):t.attachEvent("on"+e,l),t[pt]=t[pt]||{},t[pt][o]=l}function bi(t,e,i,n,o){o=o||e+f(i)+(n?"_"+f(n):"");var l=t[pt]&&t[pt][o];if(!l)return this;!I.touchNative&&I.pointer&&e.indexOf("touch")===0?Ko(t,e,l):I.touch&&e==="dblclick"?rr(t,l):"removeEventListener"in t?t.removeEventListener(yi[e]||e,l,!1):t.detachEvent("on"+e,l),t[pt][o]=null}function Dt(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function wi(t){return xi(t,"wheel",Dt),this}function ee(t){return E(t,"mousedown touchstart dblclick contextmenu",Dt),t._leaflet_disable_click=!0,this}function nt(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Et(t){return nt(t),Dt(t),this}function vn(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function yn(t,e){if(!e)return new W(t.clientX,t.clientY);var i=vi(e),n=i.boundingClientRect;return new W((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var lr=I.linux&&I.chrome?window.devicePixelRatio:I.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function xn(t){return I.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/lr:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function Li(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch{return!1}return i!==t}var hr={__proto__:null,on:E,off:q,stopPropagation:Dt,disableScrollPropagation:wi,disableClickPropagation:ee,preventDefault:nt,stop:Et,getPropagationPath:vn,getMousePosition:yn,getWheelDelta:xn,isExternalTarget:Li,addListener:E,removeListener:q},bn=jt.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=kt(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){!this._inProgress||(this._step(!0),this._complete())},_animate:function(){this._animId=Y(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=this._duration*1e3;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),K(this._el,i),this.fire("step")},_complete:function(){et(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),R=jt.extend({options:{crs:ni,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=w(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=u(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.zoom!==void 0&&(this._zoom=this._limitZoom(e.zoom)),e.center&&e.zoom!==void 0&&this.setView(V(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Yt&&I.any3d&&!I.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),E(this._proxy,mn,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if(e=e===void 0?this._zoom:this._limitZoom(e),t=this._limitCenter(V(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&i!==!0){i.animate!==void 0&&(i.zoom=s({animate:i.animate},i.zoom),i.pan=s({animate:i.animate,duration:i.duration},i.pan));var n=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan);if(n)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e,i.pan&&i.pan.noMoveStart),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(I.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(I.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),l=t instanceof W?t:this.latLngToContainerPoint(t),d=l.subtract(o).multiplyBy(1-1/n),m=this.containerPointToLatLng(o.add(d));return this.setView(m,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():it(t);var i=D(e.paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if(o=typeof e.maxZoom=="number"?Math.min(e.maxZoom,o):o,o===1/0)return{center:t.getCenter(),zoom:o};var l=n.subtract(i).divideBy(2),d=this.project(t.getSouthWest(),o),m=this.project(t.getNorthEast(),o),_=this.unproject(d.add(m).divideBy(2).add(l),o);return{center:_,zoom:o}},fitBounds:function(t,e){if(t=it(t),!t.isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(t=D(t).round(),e=e||{},!t.x&&!t.y)return this.fire("moveend");if(e.animate!==!0&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new bn,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){O(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(i=i||{},i.animate===!1||!I.any3d)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),l=this.getSize(),d=this._zoom;t=V(t),e=e===void 0?d:e;var m=Math.max(l.x,l.y),_=m*this.getZoomScale(d,e),y=o.distanceTo(n)||1,P=1.42,k=P*P;function A(J){var Oe=J?-1:1,Kr=J?_:m,Jr=_*_-m*m+Oe*k*k*y*y,Qr=2*Kr*k*y,Ai=Jr/Qr,eo=Math.sqrt(Ai*Ai+1)-Ai,ts=eo<1e-9?-18:Math.log(eo);return ts}function ut(J){return(Math.exp(J)-Math.exp(-J))/2}function Ot(J){return(Math.exp(J)+Math.exp(-J))/2}function Ae(J){return ut(J)/Ot(J)}var Mt=A(0);function Wi(J){return m*(Ot(Mt)/Ot(Mt+P*J))}function jr(J){return m*(Ot(Mt)*Ae(Mt+P*J)-ut(Mt))/k}function $r(J){return 1-Math.pow(1-J,1.5)}var Xr=Date.now(),Qn=(A(1)-Mt)/P,Yr=i.duration?1e3*i.duration:1e3*Qn*.8;function to(){var J=(Date.now()-Xr)/Yr,Oe=$r(J)*Qn;J<=1?(this._flyToFrame=Y(to,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(jr(Oe)/y)),d),this.getScaleZoom(m/Wi(Oe),d),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),to.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return t=it(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,it(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var i=D(e.paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),l=this.project(t),d=this.getPixelBounds(),m=ot([d.min.add(i),d.max.subtract(n)]),_=m.getSize();if(!m.contains(l)){this._enforcingBounds=!0;var y=l.subtract(m.getCenter()),P=m.extend(l).getSize().subtract(_);o.x+=y.x<0?-P.x:P.x,o.y+=y.y<0?-P.y:P.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=s({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),o=i.divideBy(2).round(),l=n.subtract(o);return!l.x&&!l.y?this:(t.animate&&t.pan?this.panBy(l):(t.pan&&this._rawPanBy(l),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(u(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=s({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=u(this._handleGeolocationResponse,this),i=u(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(!!this._container._leaflet_id){var e=t.code,i=t.message||(e===1?"permission denied":e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(!!this._container._leaflet_id){var e=t.coords.latitude,i=t.coords.longitude,n=new U(e,i),o=n.toBounds(t.coords.accuracy*2),l=this._locateOptions;if(l.setView){var d=this.getBoundsZoom(o);this.setView(n,l.maxZoom?Math.min(d,l.maxZoom):d)}var m={latlng:n,bounds:o,timestamp:t.timestamp};for(var _ in t.coords)typeof t.coords[_]=="number"&&(m[_]=t.coords[_]);this.fire("locationfound",m)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),$(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(et(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)$(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),n=B("div",i,e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new rt(e,i)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=it(t),i=D(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),l=this.getMaxZoom(),d=t.getNorthWest(),m=t.getSouthEast(),_=this.getSize().subtract(i),y=ot(this.project(m,n),this.project(d,n)).getSize(),P=I.any3d?this.options.zoomSnap:1,k=_.x/y.x,A=_.y/y.y,ut=e?Math.max(k,A):Math.min(k,A);return n=this.getScaleZoom(ut,n),P&&(n=Math.round(n/(P/100))*(P/100),n=e?Math.ceil(n/P)*P:Math.floor(n/P)*P),Math.max(o,Math.min(l,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new W(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new j(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=e===void 0?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=e===void 0?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.latLngToPoint(V(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(D(t),e)},layerPointToLatLng:function(t){var e=D(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(V(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(V(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(it(t))},distance:function(t,e){return this.options.crs.distance(V(t),V(e))},containerPointToLayerPoint:function(t){return D(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return D(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(D(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(V(t)))},mouseEventToContainerPoint:function(t){return yn(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=pn(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");E(e,"scroll",this._onScroll,this),this._containerId=f(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&I.any3d,O(t,"leaflet-container"+(I.touch?" leaflet-touch":"")+(I.retina?" leaflet-retina":"")+(I.ielt9?" leaflet-oldie":"")+(I.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=Kt(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),K(this._mapPane,new W(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(O(t.markerPane,"leaflet-zoom-hide"),O(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){K(this._mapPane,new W(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){e===void 0&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return et(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){K(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[f(this._container)]=this;var e=t?q:E;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),I.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){et(this._resizeRequest),this._resizeRequest=Y(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i=[],n,o=e==="mouseout"||e==="mouseover",l=t.target||t.srcElement,d=!1;l;){if(n=this._targets[f(l)],n&&(e==="click"||e==="preclick")&&this._draggableMoved(n)){d=!0;break}if(n&&n.listens(e,!0)&&(o&&!Li(l,t)||(i.push(n),o))||l===this._container)break;l=l.parentNode}return!i.length&&!d&&!o&&this.listens(e,!0)&&(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))){var i=t.type;i==="mousedown"&&gi(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if(t.type==="click"){var n=s({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}var o=this._findEventTargets(t,e);if(i){for(var l=[],d=0;d<i.length;d++)i[d].listens(e,!0)&&l.push(i[d]);o=l.concat(o)}if(!!o.length){e==="contextmenu"&&nt(t);var m=o[0],_={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var y=m.getLatLng&&(!m._radius||m._radius<=10);_.containerPoint=y?this.latLngToContainerPoint(m.getLatLng()):this.mouseEventToContainerPoint(t),_.layerPoint=this.containerPointToLayerPoint(_.containerPoint),_.latlng=y?m.getLatLng():this.layerPointToLatLng(_.layerPoint)}for(d=0;d<o.length;d++)if(o[d].fire(e,_,!0),_.originalEvent._stopped||o[d].options.bubblingMouseEvents===!1&&F(this._mouseEvents,e)!==-1)return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return kt(this._mapPane)||new W(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){var i=t&&e!==void 0?this._getNewPixelOrigin(t,e):this.getPixelOrigin();return i.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return ot([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),l=new j(n.subtract(o),n.add(o)),d=this._getBoundsOffset(l,i,e);return d.round().equals([0,0])?t:this.unproject(n.add(d),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new j(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=ot(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),l=n.max.subtract(t.max),d=this._rebound(o.x,-l.x),m=this._rebound(o.y,-l.y);return new W(d,m)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=I.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){X(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return(e&&e.animate)!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,e),!0)},_createAnimProxy:function(){var t=this._proxy=B("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=ui,n=this._proxy.style[i];It(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){$(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();It(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return i.animate!==!0&&!this.getSize().contains(o)?!1:(Y(function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,i,n){!this._mapPane||(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,O(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(u(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){!this._animatingZoom||(this._mapPane&&X(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ur(t,e){return new R(t,e)}var ct=yt.extend({options:{position:"topright"},initialize:function(t){w(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return O(e,"leaflet-control"),i.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?($(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ie=function(t){return new ct(t)};R.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=B("div",e+"control-container",this._container);function n(o,l){var d=e+o+" "+e+l;t[o+l]=B("div",d,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)$(this._controlCorners[t]);$(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var wn=ct.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){w(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return ct.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(f(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){O(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(O(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):X(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return X(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=B("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),ee(e),wi(e);var n=this._section=B("section",t+"-list");i&&(this._map.on("click",this.collapse,this),E(e,{mouseenter:function(){E(n,"click",nt),this.expand(),setTimeout(function(){q(n,"click",nt)})},mouseleave:this.collapse},this));var o=this._layersLink=B("a",t+"-toggle",e);o.href="#",o.title="Layers",o.setAttribute("role","button"),E(o,"click",nt),E(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=B("div",t+"-base",n),this._separator=B("div",t+"-separator",n),this._overlaysList=B("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&f(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(u(function(n,o){return this.options.sortFunction(n.layer,o.layer,n.name,o.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ve(this._baseLayersList),ve(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(f(t.target)),i=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e=document.createElement("label"),i=this._map.hasLayer(t.layer),n;t.overlay?(n=document.createElement("input"),n.type="checkbox",n.className="leaflet-control-layers-selector",n.defaultChecked=i):n=this._createRadioElement("leaflet-base-layers_"+f(this),i),this._layerControlInputs.push(n),n.layerId=f(t.layer),E(n,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var l=document.createElement("span");e.appendChild(l),l.appendChild(n),l.appendChild(o);var d=t.overlay?this._overlaysList:this._baseLayersList;return d.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t=this._layerControlInputs,e,i,n=[],o=[];this._handlingClick=!0;for(var l=t.length-1;l>=0;l--)e=t[l],i=this._getLayer(e.layerId).layer,e.checked?n.push(i):e.checked||o.push(i);for(l=0;l<o.length;l++)this._map.hasLayer(o[l])&&this._map.removeLayer(o[l]);for(l=0;l<n.length;l++)this._map.hasLayer(n[l])||this._map.addLayer(n[l]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,e,i,n=this._map.getZoom(),o=t.length-1;o>=0;o--)e=t[o],i=this._getLayer(e.layerId).layer,e.disabled=i.options.minZoom!==void 0&&n<i.options.minZoom||i.options.maxZoom!==void 0&&n>i.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this}}),cr=function(t,e,i){return new wn(t,e,i)},Ti=ct.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=B("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var l=B("a",i,n);return l.innerHTML=t,l.href="#",l.title=e,l.setAttribute("role","button"),l.setAttribute("aria-label",e),ee(l),E(l,"click",Et),E(l,"click",o,this),E(l,"click",this._refocusOnMap,this),l},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";X(this._zoomInButton,e),X(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(O(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(O(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});R.mergeOptions({zoomControl:!0}),R.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ti,this.addControl(this.zoomControl))});var dr=function(t){return new Ti(t)},Ln=ct.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=B("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=B("div",e,i)),t.imperial&&(this._iScale=B("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e=t*3.2808399,i,n,o;e>5280?(i=e/5280,n=this._getRoundNum(i),this._updateScale(this._iScale,n+" mi",n/i)):(o=this._getRoundNum(e),this._updateScale(this._iScale,o+" ft",o/e))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),fr=function(t){return new Ln(t)},mr='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Pi=ct.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(I.inlineSvg?mr+" ":"")+"Leaflet</a>"},initialize:function(t){w(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=B("div","leaflet-control-attribution"),ee(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(!!this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}});R.mergeOptions({attributionControl:!0}),R.addInitHook(function(){this.options.attributionControl&&new Pi().addTo(this)});var pr=function(t){return new Pi(t)};ct.Layers=wn,ct.Zoom=Ti,ct.Scale=Ln,ct.Attribution=Pi,ie.layers=cr,ie.zoom=dr,ie.scale=fr,ie.attribution=pr;var _t=yt.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});_t.addTo=function(t,e){return t.addHandler(e,this),this};var _r={Events:st},Tn=I.touch?"touchstart mousedown":"mousedown",St=jt.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){w(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(E(this._dragStartTarget,Tn,this._onDown,this),this._enabled=!0)},disable:function(){!this._enabled||(St._dragging===this&&this.finishDrag(!0),q(this._dragStartTarget,Tn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!!this._enabled&&(this._moved=!1,!ci(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){St._dragging===this&&this.finishDrag();return}if(!(St._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(St._dragging=this,this._preventOutline&&gi(this._element),mi(),Jt(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,i=_n(this._element);this._startPoint=new W(e.clientX,e.clientY),this._startPos=kt(this._element),this._parentScale=vi(i);var n=t.type==="mousedown";E(document,n?"mousemove":"touchmove",this._onMove,this),E(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(!!this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&t.touches.length===1?t.touches[0]:t,i=new W(e.clientX,e.clientY)._subtract(this._startPoint);!i.x&&!i.y||Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,nt(t),this._moved||(this.fire("dragstart"),this._moved=!0,O(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),O(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,this._lastEvent=t,this._updatePosition())}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),K(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){!this._enabled||this.finishDrag()},finishDrag:function(t){X(document.body,"leaflet-dragging"),this._lastTarget&&(X(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),q(document,"mousemove touchmove",this._onMove,this),q(document,"mouseup touchend touchcancel",this._onUp,this),pi(),Qt(),this._moved&&this._moving&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)}),this._moving=!1,St._dragging=!1}});function Pn(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=yr(t,i),t=vr(t,i),t}function Sn(t,e,i){return Math.sqrt(ne(t,e,i,!0))}function gr(t,e,i){return ne(t,e,i)}function vr(t,e){var i=t.length,n=typeof Uint8Array!=void 0+""?Uint8Array:Array,o=new n(i);o[0]=o[i-1]=1,Si(t,o,e,0,i-1);var l,d=[];for(l=0;l<i;l++)o[l]&&d.push(t[l]);return d}function Si(t,e,i,n,o){var l=0,d,m,_;for(m=n+1;m<=o-1;m++)_=ne(t[m],t[n],t[o],!0),_>l&&(d=m,l=_);l>i&&(e[d]=1,Si(t,e,i,n,d),Si(t,e,i,d,o))}function yr(t,e){for(var i=[t[0]],n=1,o=0,l=t.length;n<l;n++)xr(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<l-1&&i.push(t[l-1]),i}var Cn;function Mn(t,e,i,n,o){var l=n?Cn:Wt(t,i),d=Wt(e,i),m,_,y;for(Cn=d;;){if(!(l|d))return[t,e];if(l&d)return!1;m=l||d,_=Le(t,e,m,i,o),y=Wt(_,i),m===l?(t=_,l=y):(e=_,d=y)}}function Le(t,e,i,n,o){var l=e.x-t.x,d=e.y-t.y,m=n.min,_=n.max,y,P;return i&8?(y=t.x+l*(_.y-t.y)/d,P=_.y):i&4?(y=t.x+l*(m.y-t.y)/d,P=m.y):i&2?(y=_.x,P=t.y+d*(_.x-t.x)/l):i&1&&(y=m.x,P=t.y+d*(m.x-t.x)/l),new W(y,P,o)}function Wt(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function xr(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function ne(t,e,i,n){var o=e.x,l=e.y,d=i.x-o,m=i.y-l,_=d*d+m*m,y;return _>0&&(y=((t.x-o)*d+(t.y-l)*m)/_,y>1?(o=i.x,l=i.y):y>0&&(o+=d*y,l+=m*y)),d=t.x-o,m=t.y-l,n?d*d+m*m:new W(o,l)}function ht(t){return!Z(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function In(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ht(t)}function kn(t,e){var i,n,o,l,d,m,_,y;if(!t||t.length===0)throw new Error("latlngs not passed");ht(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var P=[];for(var k in t)P.push(e.project(V(t[k])));var A=P.length;for(i=0,n=0;i<A-1;i++)n+=P[i].distanceTo(P[i+1])/2;if(n===0)y=P[0];else for(i=0,l=0;i<A-1;i++)if(d=P[i],m=P[i+1],o=d.distanceTo(m),l+=o,l>n){_=(l-n)/o,y=[m.x-_*(m.x-d.x),m.y-_*(m.y-d.y)];break}return e.unproject(D(y))}var br={__proto__:null,simplify:Pn,pointToSegmentDistance:Sn,closestPointOnSegment:gr,clipSegment:Mn,_getEdgeIntersection:Le,_getBitCode:Wt,_sqClosestPointOnSegment:ne,isFlat:ht,_flat:In,polylineCenter:kn};function Dn(t,e,i){var n,o=[1,4,2,8],l,d,m,_,y,P,k,A;for(l=0,P=t.length;l<P;l++)t[l]._code=Wt(t[l],e);for(m=0;m<4;m++){for(k=o[m],n=[],l=0,P=t.length,d=P-1;l<P;d=l++)_=t[l],y=t[d],_._code&k?y._code&k||(A=Le(y,_,k,e,i),A._code=Wt(A,e),n.push(A)):(y._code&k&&(A=Le(y,_,k,e,i),A._code=Wt(A,e),n.push(A)),n.push(_));t=n}return t}function En(t,e){var i,n,o,l,d,m,_,y,P;if(!t||t.length===0)throw new Error("latlngs not passed");ht(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var k=[];for(var A in t)k.push(e.project(V(t[A])));var ut=k.length;for(m=_=y=0,i=0,n=ut-1;i<ut;n=i++)o=k[i],l=k[n],d=o.y*l.x-l.y*o.x,_+=(o.x+l.x)*d,y+=(o.y+l.y)*d,m+=d*3;return m===0?P=k[0]:P=[_/m,y/m],e.unproject(D(P))}var wr={__proto__:null,clipPolygon:Dn,polygonCenter:En},Ci={project:function(t){return new W(t.lng,t.lat)},unproject:function(t){return new U(t.y,t.x)},bounds:new j([-180,-90],[180,90])},Mi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new j([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,l=Math.sqrt(1-o*o),d=l*Math.sin(n),m=Math.tan(Math.PI/4-n/2)/Math.pow((1-d)/(1+d),l/2);return n=-i*Math.log(Math.max(m,1e-10)),new W(t.lng*e*i,n)},unproject:function(t){for(var e=180/Math.PI,i=this.R,n=this.R_MINOR/i,o=Math.sqrt(1-n*n),l=Math.exp(-t.y/i),d=Math.PI/2-2*Math.atan(l),m=0,_=.1,y;m<15&&Math.abs(_)>1e-7;m++)y=o*Math.sin(d),y=Math.pow((1-y)/(1+y),o/2),_=Math.PI/2-2*Math.atan(l*y)-d,d+=_;return new U(d*e,t.x*e/i)}},Lr={__proto__:null,LonLat:Ci,Mercator:Mi,SphericalMercator:ei},Tr=s({},Pt,{code:"EPSG:3395",projection:Mi,transformation:function(){var t=.5/(Math.PI*Mi.R);return $t(t,.5,-t,.5)}()}),Wn=s({},Pt,{code:"EPSG:4326",projection:Ci,transformation:$t(1/180,1,-1/180,.5)}),Pr=s({},xt,{projection:Ci,transformation:$t(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});xt.Earth=Pt,xt.EPSG3395=Tr,xt.EPSG3857=ni,xt.EPSG900913=Do,xt.EPSG4326=Wn,xt.Simple=Pr;var dt=jt.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[f(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[f(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(!!e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});R.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=f(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=f(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return f(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){t=t?Z(t)?t:[t]:[];for(var e=0,i=t.length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){(!isNaN(t.options.maxZoom)||!isNaN(t.options.minZoom))&&(this._zoomBoundLayers[f(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=f(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=o.minZoom===void 0?t:Math.min(t,o.minZoom),e=o.maxZoom===void 0?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ft=dt.extend({initialize:function(t,e){w(this,e),this._layers={};var i,n;if(t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){var e=typeof t=="number"?t:this.getLayerId(t);return e in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e=Array.prototype.slice.call(arguments,1),i,n;for(i in this._layers)n=this._layers[i],n[t]&&n[t].apply(n,e);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return f(t)}}),Sr=function(t,e){return new Ft(t,e)},At=Ft.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Ft.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Ft.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new rt;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Cr=function(t,e){return new At(t,e)},Ht=yt.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){w(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&e.tagName==="IMG"?e:null);return this._setIconStyles(n,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];typeof n=="number"&&(n=[n,n]);var o=D(n),l=D(e==="shadow"&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),l&&(t.style.marginLeft=-l.x+"px",t.style.marginTop=-l.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return e=e||document.createElement("img"),e.src=t,e},_getIconUrl:function(t){return I.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Mr(t){return new Ht(t)}var oe=Ht.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return typeof oe.imagePath!="string"&&(oe.imagePath=this._detectIconPath()),(this.options.imagePath||oe.imagePath)+Ht.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(i,n,o){var l=n.exec(i);return l&&l[o]};return t=e(t,/^url\((['"])?(.+)\1\)$/,2),t&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=B("div","leaflet-default-icon-path",document.body),e=Kt(t,"background-image")||Kt(t,"backgroundImage");if(document.body.removeChild(t),e=this._stripUrl(e),e)return e;var i=document.querySelector('link[href$="leaflet.css"]');return i?i.href.substring(0,i.href.length-11-1):""}}),An=_t.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new St(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),O(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&X(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,l=kt(e._icon),d=i.getPixelBounds(),m=i.getPixelOrigin(),_=ot(d.min._subtract(m).add(o),d.max._subtract(m).subtract(o));if(!_.contains(l)){var y=D((Math.max(_.max.x,l.x)-_.max.x)/(d.max.x-_.max.x)-(Math.min(_.min.x,l.x)-_.min.x)/(d.min.x-_.min.x),(Math.max(_.max.y,l.y)-_.max.y)/(d.max.y-_.max.y)-(Math.min(_.min.y,l.y)-_.min.y)/(d.min.y-_.min.y)).multiplyBy(n);i.panBy(y,{animate:!1}),this._draggable._newPos._add(y),this._draggable._startPos._add(y),K(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=Y(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(et(this._panRequest),this._panRequest=Y(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=kt(e._icon),o=e._map.layerPointToLatLng(n);i&&K(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){et(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Te=dt.extend({options:{icon:new oe,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){w(this,e),this._latlng=V(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=V(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),i.tagName==="IMG"&&(i.alt=t.alt||"")),O(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&E(i,"focus",this._panOnFocus,this);var o=t.icon.createShadow(this._shadow),l=!1;o!==this._shadow&&(this._removeShadow(),l=!0),o&&(O(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&l&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&q(this._icon,"focus",this._panOnFocus,this),$(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&$(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&K(this._icon,t),this._shadow&&K(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(!!this.options.interactive&&(O(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),An)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new An(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&lt(this._icon,t),this._shadow&&lt(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(!!t){var e=this.options.icon.options,i=e.iconSize?D(e.iconSize):D(0,0),n=e.iconAnchor?D(e.iconAnchor):D(0,0);t.panInside(this._latlng,{paddingTopLeft:n,paddingBottomRight:i.subtract(n)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Ir(t,e){return new Te(t,e)}var Ct=dt.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return w(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Pe=Ct.extend({options:{fill:!0,radius:10},initialize:function(t,e){w(this,e),this._latlng=V(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=V(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return Ct.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new j(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function kr(t,e){return new Pe(t,e)}var Ii=Pe.extend({initialize:function(t,e,i){if(typeof e=="number"&&(e=s({},i,{radius:e})),w(this,e),this._latlng=V(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new rt(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Ct.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===Pt.distance){var o=Math.PI/180,l=this._mRadius/Pt.R/o,d=i.project([e+l,t]),m=i.project([e-l,t]),_=d.add(m).divideBy(2),y=i.unproject(_).lat,P=Math.acos((Math.cos(l*o)-Math.sin(e*o)*Math.sin(y*o))/(Math.cos(e*o)*Math.cos(y*o)))/o;(isNaN(P)||P===0)&&(P=l/Math.cos(Math.PI/180*e)),this._point=_.subtract(i.getPixelOrigin()),this._radius=isNaN(P)?0:_.x-i.project([y,t-P]).x,this._radiusY=_.y-d.y}else{var k=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(k).x}this._updateBounds()}});function Dr(t,e,i){return new Ii(t,e,i)}var bt=Ct.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){w(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e=1/0,i=null,n=ne,o,l,d=0,m=this._parts.length;d<m;d++)for(var _=this._parts[d],y=1,P=_.length;y<P;y++){o=_[y-1],l=_[y];var k=n(t,o,l,!0);k<e&&(e=k,i=n(t,o,l))}return i&&(i.distance=Math.sqrt(e)),i},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return kn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=V(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new rt,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return ht(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=ht(t),n=0,o=t.length;n<o;n++)i?(e[n]=V(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new j;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new W(t,t);!this._rawPxBounds||(this._pxBounds=new j([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,i){var n=t[0]instanceof U,o=t.length,l,d;if(n){for(d=[],l=0;l<o;l++)d[l]=this._map.latLngToLayerPoint(t[l]),i.extend(d[l]);e.push(d)}else for(l=0;l<o;l++)this._projectLatlngs(t[l],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}var e=this._parts,i,n,o,l,d,m,_;for(i=0,o=0,l=this._rings.length;i<l;i++)for(_=this._rings[i],n=0,d=_.length;n<d-1;n++)m=Mn(_[n],_[n+1],t,n,!0),m&&(e[o]=e[o]||[],e[o].push(m[0]),(m[1]!==_[n+1]||n===d-2)&&(e[o].push(m[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=Pn(t[i],e)},_update:function(){!this._map||(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,l,d,m,_=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,l=this._parts.length;i<l;i++)for(m=this._parts[i],n=0,d=m.length,o=d-1;n<d;o=n++)if(!(!e&&n===0)&&Sn(t,m[o],m[n])<=_)return!0;return!1}});function Er(t,e){return new bt(t,e)}bt._flat=In;var Ut=bt.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return En(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=bt.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof U&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){bt.prototype._setLatLngs.call(this,t),ht(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ht(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new W(e,e);if(t=new j(t.min.subtract(i),t.max.add(i)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var n=0,o=this._rings.length,l;n<o;n++)l=Dn(this._rings[n],t,!0),l.length&&this._parts.push(l)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e=!1,i,n,o,l,d,m,_,y;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(l=0,_=this._parts.length;l<_;l++)for(i=this._parts[l],d=0,y=i.length,m=y-1;d<y;m=d++)n=i[d],o=i[m],n.y>t.y!=o.y>t.y&&t.x<(o.x-n.x)*(t.y-n.y)/(o.y-n.y)+n.x&&(e=!e);return e||bt.prototype._containsPoint.call(this,t,!0)}});function Wr(t,e){return new Ut(t,e)}var wt=At.extend({initialize:function(t,e){w(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=Z(t)?t:t.features,i,n,o;if(e){for(i=0,n=e.length;i<n;i++)o=e[i],(o.geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var l=this.options;if(l.filter&&!l.filter(t))return this;var d=Se(t,l);return d?(d.feature=Ie(t),d.defaultOptions=d.options,this.resetStyle(d),l.onEachFeature&&l.onEachFeature(t,d),this.addLayer(d)):this},resetStyle:function(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=s({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){t.setStyle&&(typeof e=="function"&&(e=e(t.feature)),t.setStyle(e))}});function Se(t,e){var i=t.type==="Feature"?t.geometry:t,n=i?i.coordinates:null,o=[],l=e&&e.pointToLayer,d=e&&e.coordsToLatLng||ki,m,_,y,P;if(!n&&!i)return null;switch(i.type){case"Point":return m=d(n),On(l,t,m,e);case"MultiPoint":for(y=0,P=n.length;y<P;y++)m=d(n[y]),o.push(On(l,t,m,e));return new At(o);case"LineString":case"MultiLineString":return _=Ce(n,i.type==="LineString"?0:1,d),new bt(_,e);case"Polygon":case"MultiPolygon":return _=Ce(n,i.type==="Polygon"?1:2,d),new Ut(_,e);case"GeometryCollection":for(y=0,P=i.geometries.length;y<P;y++){var k=Se({geometry:i.geometries[y],type:"Feature",properties:t.properties},e);k&&o.push(k)}return new At(o);case"FeatureCollection":for(y=0,P=i.features.length;y<P;y++){var A=Se(i.features[y],e);A&&o.push(A)}return new At(o);default:throw new Error("Invalid GeoJSON object.")}}function On(t,e,i,n){return t?t(e,i):new Te(i,n&&n.markersInheritOptions&&n)}function ki(t){return new U(t[1],t[0],t[2])}function Ce(t,e,i){for(var n=[],o=0,l=t.length,d;o<l;o++)d=e?Ce(t[o],e-1,i):(i||ki)(t[o]),n.push(d);return n}function Di(t,e){return t=V(t),t.alt!==void 0?[b(t.lng,e),b(t.lat,e),b(t.alt,e)]:[b(t.lng,e),b(t.lat,e)]}function Me(t,e,i,n){for(var o=[],l=0,d=t.length;l<d;l++)o.push(e?Me(t[l],ht(t[l])?0:e-1,i,n):Di(t[l],n));return!e&&i&&o.push(o[0]),o}function Vt(t,e){return t.feature?s({},t.feature,{geometry:e}):Ie(e)}function Ie(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Ei={toGeoJSON:function(t){return Vt(this,{type:"Point",coordinates:Di(this.getLatLng(),t)})}};Te.include(Ei),Ii.include(Ei),Pe.include(Ei),bt.include({toGeoJSON:function(t){var e=!ht(this._latlngs),i=Me(this._latlngs,e?1:0,!1,t);return Vt(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),Ut.include({toGeoJSON:function(t){var e=!ht(this._latlngs),i=e&&!ht(this._latlngs[0]),n=Me(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),Vt(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Ft.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),Vt(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(e==="MultiPoint")return this.toMultiPoint(t);var i=e==="GeometryCollection",n=[];return this.eachLayer(function(o){if(o.toGeoJSON){var l=o.toGeoJSON(t);if(i)n.push(l.geometry);else{var d=Ie(l);d.type==="FeatureCollection"?n.push.apply(n,d.features):n.push(d)}}}),i?Vt(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});function zn(t,e){return new wt(t,e)}var Ar=zn,ke=dt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=it(e),w(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(O(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){$(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&Bt(this._image),this},bringToBack:function(){return this._map&&Nt(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=it(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",e=this._image=t?this._url:B("img");if(O(e,"leaflet-image-layer"),this._zoomAnimated&&O(e,"leaflet-zoom-animated"),this.options.className&&O(e,this.options.className),e.onselectstart=g,e.onmousemove=g,e.onload=u(this.fire,this,"load"),e.onerror=u(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;It(this._image,i,e)},_reset:function(){var t=this._image,e=new j(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();K(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){lt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Or=function(t,e,i){return new ke(t,e,i)},Zn=ke.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",e=this._image=t?this._url:B("video");if(O(e,"leaflet-image-layer"),this._zoomAnimated&&O(e,"leaflet-zoom-animated"),this.options.className&&O(e,this.options.className),e.onselectstart=g,e.onmousemove=g,e.onloadeddata=u(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=i.length>0?n:[e.src];return}Z(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var l=0;l<this._url.length;l++){var d=B("source");d.src=this._url[l],e.appendChild(d)}}});function zr(t,e,i){return new Zn(t,e,i)}var Rn=ke.extend({_initImage:function(){var t=this._image=this._url;O(t,"leaflet-image-layer"),this._zoomAnimated&&O(t,"leaflet-zoom-animated"),this.options.className&&O(t,this.options.className),t.onselectstart=g,t.onmousemove=g}});function Zr(t,e,i){return new Rn(t,e,i)}var gt=dt.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof L.LatLng||Z(t))?(this._latlng=V(t),w(this,e)):(w(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&lt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&lt(this._container,1),this.bringToFront(),this.options.interactive&&(O(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(lt(this._container,0),this._removeTimeout=setTimeout(u($,void 0,this._container),200)):$(this._container),this.options.interactive&&(X(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=V(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){!this._map||(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Bt(this._container),this},bringToBack:function(){return this._map&&Nt(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof At){e=null;var i=this._source._layers;for(var n in i)if(i[n]._map){e=i[n];break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else if(e.getBounds)t=e.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(!!this._content){var t=this._contentNode,e=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof e=="string")t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(!!this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=D(this.options.offset),i=this._getAnchor();this._zoomAnimated?K(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}});R.include({_initOverlay:function(t,e,i,n){var o=e;return o instanceof t||(o=new t(n).setContent(e)),i&&o.setLatLng(i),o}}),dt.include({_initOverlay:function(t,e,i,n){var o=i;return o instanceof t?(w(o,n),o._source=this):(o=e&&!n?e:new t(n,this),o.setContent(i)),o}});var De=gt.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,gt.prototype.openOn.call(this,t)},onAdd:function(t){gt.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Ct||this._source.on("preclick",Dt))},onRemove:function(t){gt.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Ct||this._source.off("preclick",Dt))},getEvents:function(){var t=gt.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=B("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=B("div",t+"-content-wrapper",e);if(this._contentNode=B("div",t+"-content",i),ee(e),wi(this._contentNode),E(e,"contextmenu",Dt),this._tipContainer=B("div",t+"-tip-container",e),this._tip=B("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=B("a",t+"-close-button",e);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">&#215;</span>',E(n,"click",function(o){nt(o),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,l="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",O(t,l)):X(t,l),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();K(this._container,e.add(i))},_adjustPan:function(t){if(!!this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var e=this._map,i=parseInt(Kt(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+i,o=this._containerWidth,l=new W(this._containerLeft,-n-this._containerBottom);l._add(kt(this._container));var d=e.layerPointToContainerPoint(l),m=D(this.options.autoPanPadding),_=D(this.options.autoPanPaddingTopLeft||m),y=D(this.options.autoPanPaddingBottomRight||m),P=e.getSize(),k=0,A=0;d.x+o+y.x>P.x&&(k=d.x+o-P.x+y.x),d.x-k-_.x<0&&(k=d.x-_.x),d.y+n+y.y>P.y&&(A=d.y+n-P.y+y.y),d.y-A-_.y<0&&(A=d.y-_.y),(k||A)&&e.fire("autopanstart").panBy([k,A],{animate:t&&t.type==="moveend"})}},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Rr=function(t,e){return new De(t,e)};R.mergeOptions({closePopupOnClick:!0}),R.include({openPopup:function(t,e,i){return this._initOverlay(De,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),dt.include({bindPopup:function(t,e){return this._popup=this._initOverlay(De,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){Et(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof Ct)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var Ee=gt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){gt.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){gt.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=gt.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=B("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+f(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,l=n.latLngToContainerPoint(n.getCenter()),d=n.layerPointToContainerPoint(t),m=this.options.direction,_=o.offsetWidth,y=o.offsetHeight,P=D(this.options.offset),k=this._getAnchor();m==="top"?(e=_/2,i=y):m==="bottom"?(e=_/2,i=0):m==="center"?(e=_/2,i=y/2):m==="right"?(e=0,i=y/2):m==="left"?(e=_,i=y/2):d.x<l.x?(m="right",e=0,i=y/2):(m="left",e=_+(P.x+k.x)*2,i=y/2),t=t.subtract(D(e,i,!0)).add(P).add(k),X(o,"leaflet-tooltip-right"),X(o,"leaflet-tooltip-left"),X(o,"leaflet-tooltip-top"),X(o,"leaflet-tooltip-bottom"),O(o,"leaflet-tooltip-"+m),K(o,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&lt(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Br=function(t,e){return new Ee(t,e)};R.include({openTooltip:function(t,e,i){return this._initOverlay(Ee,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),dt.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ee,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(!(!t&&this._tooltipHandlersAdded)){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this)),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e=t.getElement();e&&(E(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),E(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var e=t.getElement();e&&e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){!this._tooltip||!this._map||this._map.dragging&&this._map.dragging.moving()||(this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0))},_moveTooltip:function(t){var e=t.latlng,i,n;this._tooltip.options.sticky&&t.originalEvent&&(i=this._map.mouseEventToContainerPoint(t.originalEvent),n=this._map.containerPointToLayerPoint(i),e=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(e)}});var Bn=Ht.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&t.tagName==="DIV"?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(ve(e),e.appendChild(i.html)):e.innerHTML=i.html!==!1?i.html:"",i.bgPos){var n=D(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Nr(t){return new Bn(t)}Ht.Default=oe;var re=dt.extend({options:{tileSize:256,opacity:1,updateWhenIdle:I.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){w(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),$(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Bt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Nt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=p(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof W?t:new W(t,t)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e=this.getPane().children,i=-t(-1/0,1/0),n=0,o=e.length,l;n<o;n++)l=e[n].style.zIndex,e[n]!==this._container&&l&&(i=t(i,+l));isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(!!this._map&&!I.ielt9){lt(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(!(!o.current||!o.loaded)){var l=Math.min(1,(t-o.loaded)/200);lt(o.el,l),l<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(et(this._fadeFrame),this._fadeFrame=Y(this._updateOpacity,this))}},_onOpaqueTile:g,_initContainer:function(){this._container||(this._container=B("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(t!==void 0){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):($(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||(n=this._levels[t]={},n.el=B("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),g(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:g,_onRemoveLevel:g,_onCreateLevel:g,_pruneTiles:function(){if(!!this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom){this._removeAllTiles();return}for(t in this._tiles)e=this._tiles[t],e.retain=e.current;for(t in this._tiles)if(e=this._tiles[t],e.current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)$(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),l=Math.floor(e/2),d=i-1,m=new W(+o,+l);m.z=+d;var _=this._tileCoordsToKey(m),y=this._tiles[_];return y&&y.active?(y.retain=!0,!0):(y&&y.loaded&&(y.retain=!0),d>n?this._retainParent(o,l,d,n):!1)},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var l=2*e;l<2*e+2;l++){var d=new W(o,l);d.z=i+1;var m=this._tileCoordsToKey(d),_=this._tiles[m];if(_&&_.active){_.retain=!0;continue}else _&&_.loaded&&(_.retain=!0);i+1<n&&this._retainChildren(o,l,i+1,n)}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return e.minNativeZoom!==void 0&&t<e.minNativeZoom?e.minNativeZoom:e.maxNativeZoom!==void 0&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e);this.options.maxZoom!==void 0&&o>this.options.maxZoom||this.options.minZoom!==void 0&&o<this.options.minZoom?o=void 0:o=this._clampZoom(o);var l=this.options.updateWhenZooming&&o!==this._tileZoom;(!n||l)&&(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),o!==void 0&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();I.any3d?It(t.el,o,n):K(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),l=e.getSize().divideBy(n*2);return new j(o.subtract(l),o.add(l))},_update:function(t){var e=this._map;if(!!e){var i=this._clampZoom(e.getZoom());if(t===void 0&&(t=e.getCenter()),this._tileZoom!==void 0){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),l=o.getCenter(),d=[],m=this.options.keepBuffer,_=new j(o.getBottomLeft().subtract([m,-m]),o.getTopRight().add([m,-m]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var y in this._tiles){var P=this._tiles[y].coords;(P.z!==this._tileZoom||!_.contains(new W(P.x,P.y)))&&(this._tiles[y].current=!1)}if(Math.abs(i-this._tileZoom)>1){this._setView(t,i);return}for(var k=o.min.y;k<=o.max.y;k++)for(var A=o.min.x;A<=o.max.x;A++){var ut=new W(A,k);if(ut.z=this._tileZoom,!!this._isValidTile(ut)){var Ot=this._tiles[this._tileCoordsToKey(ut)];Ot?Ot.current=!0:d.push(ut)}}if(d.sort(function(Mt,Wi){return Mt.distanceTo(l)-Wi.distanceTo(l)}),d.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Ae=document.createDocumentFragment();for(A=0;A<d.length;A++)this._addTile(d[A],Ae);this._level.el.appendChild(Ae)}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return it(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),l=e.unproject(n,t.z),d=e.unproject(o,t.z);return[l,d]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new rt(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new W(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];!e||($(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){O(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=g,t.onmousemove=g,I.ielt9&&this.options.opacity<1&&lt(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),u(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&Y(u(this._tileReady,this,t,null,o)),K(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);i=this._tiles[n],i&&(i.loaded=+new Date,this._map._fadeAnimated?(lt(i.el,0),et(this._fadeFrame),this._fadeFrame=Y(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(O(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),I.ielt9||!this._map._fadeAnimated?Y(this._pruneTiles,this):setTimeout(u(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new W(this._wrapX?v(t.x,this._wrapX):t.x,this._wrapY?v(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new j(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Fr(t){return new re(t)}var qt=re.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,e=w(this,e),e.detectRetina&&I.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),typeof e.subdomains=="string"&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return E(i,"load",u(this._tileOnLoad,this,e,i)),E(i,"error",u(this._tileOnError,this,e,i)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(i.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:I.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return M(this._url,s(e,this.options))},_tileOnLoad:function(t,e){I.ielt9?setTimeout(u(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,i=this.options.zoomReverse,n=this.options.zoomOffset;return i&&(t=e-t),t+n},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=g,e.onerror=g,!e.complete)){e.src=N;var i=this._tiles[t].coords;$(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(!!e)return e.el.setAttribute("src",N),re.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===N))return re.prototype._tileReady.call(this,t,e,i)}});function Nn(t,e){return new qt(t,e)}var Fn=qt.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=s({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);e=w(this,e);var o=e.detectRetina&&I.retina?2:1,l=this.getTileSize();i.width=l.x*o,i.height=l.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,qt.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=ot(i.project(e[0]),i.project(e[1])),o=n.min,l=n.max,d=(this._wmsVersion>=1.3&&this._crs===Wn?[o.y,o.x,l.y,l.x]:[o.x,o.y,l.x,l.y]).join(","),m=qt.prototype.getTileUrl.call(this,t);return m+S(this.wmsParams,m,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+d},setParams:function(t,e){return s(this.wmsParams,t),e||this.redraw(),this}});function Hr(t,e){return new Fn(t,e)}qt.WMS=Fn,Nn.wms=Hr;var Lt=dt.extend({options:{padding:.1},initialize:function(t){w(this,t),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&O(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),l=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));I.any3d?It(this._container,l,i):K(this._container,l)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new j(i,i.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Hn=Lt.extend({options:{tolerance:0},getEvents:function(){var t=Lt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Lt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");E(t,"mousemove",this._onMouseMove,this),E(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),E(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){et(this._redrawRequest),delete this._ctx,$(this._container),q(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var e in this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lt.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=I.retina?2:1;K(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",I.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Lt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[f(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[f(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var e=t.options.dashArray.split(/[, ]+/),i=[],n,o;for(o=0;o<e.length;o++){if(n=Number(e[o]),isNaN(n))return;i.push(n)}t.options._dashArray=i}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){!this._map||(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||Y(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new j,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(!!this._drawing){var i,n,o,l,d=t._parts,m=d.length,_=this._ctx;if(!!m){for(_.beginPath(),i=0;i<m;i++){for(n=0,o=d[i].length;n<o;n++)l=d[i][n],_[n?"lineTo":"moveTo"](l.x,l.y);e&&_.closePath()}this._fillStroke(_,t)}}},_updateCircle:function(t){if(!(!this._drawing||t._empty())){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;o!==1&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,Math.PI*2,!1),o!==1&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&i.weight!==0&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e=this._map.mouseEventToLayerPoint(t),i,n,o=this._drawFirst;o;o=o.next)i=o.layer,i.options.interactive&&i._containsPoint(e)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(i))&&(n=i);this._fireEvent(n?[n]:!1,t)},_onMouseMove:function(t){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(X(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,o=this._drawFirst;o;o=o.next)i=o.layer,i.options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(O(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._mouseHoverThrottled=!0,setTimeout(u(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(!!e){var i=e.next,n=e.prev;if(i)i.prev=n;else return;n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t)}},_bringToBack:function(t){var e=t._order;if(!!e){var i=e.next,n=e.prev;if(n)n.next=i;else return;i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t)}}});function Un(t){return I.canvas?new Hn(t):null}var se=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Ur={_initContainer:function(){this._container=B("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Lt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=se("shape");O(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=se("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;$(e),t.removeInteractiveTarget(e),delete this._layers[f(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=se("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=Z(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=se("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,"+65535*360)},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){Bt(t._container)},_bringToBack:function(t){Nt(t._container)}},We=I.vml?se:Gi,ae=Lt.extend({_initContainer:function(){this._container=We("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=We("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){$(this._container),q(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lt.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;(!this._svgSize||!this._svgSize.equals(e))&&(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),K(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=We("path");t.options.className&&O(e,t.options.className),t.options.interactive&&O(e,"leaflet-interactive"),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){$(t._path),t.removeInteractiveTarget(t._path),delete this._layers[f(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;!e||(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,ji(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n=Math.max(Math.round(t._radiusY),1)||i,o="a"+i+","+n+" 0 1,0 ",l=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+i*2+",0 "+o+-i*2+",0 ";this._setPath(t,l)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){Bt(t._path)},_bringToBack:function(t){Nt(t._path)}});I.vml&&ae.include(Ur);function Vn(t){return I.svg||I.vml?new ae(t):null}R.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var e=this._paneRenderers[t];return e===void 0&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Un(t)||Vn(t)}});var qn=Ut.extend({initialize:function(t,e){Ut.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=it(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Vr(t,e){return new qn(t,e)}ae.create=We,ae.pointsToPath=ji,wt.geometryToLayer=Se,wt.coordsToLatLng=ki,wt.coordsToLatLngs=Ce,wt.latLngToCoords=Di,wt.latLngsToCoords=Me,wt.getFeature=Vt,wt.asFeature=Ie,R.mergeOptions({boxZoom:!0});var Gn=_t.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){E(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){q(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){$(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Jt(),mi(),this._startPoint=this._map.mouseEventToContainerPoint(t),E(document,{contextmenu:Et,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=B("div","leaflet-zoom-box",this._container),O(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new j(this._point,this._startPoint),i=e.getSize();K(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&($(this._box),X(this._container,"leaflet-crosshair")),Qt(),pi(),q(document,{contextmenu:Et,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(u(this._resetState,this),0);var e=new rt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});R.addInitHook("addHandler","boxZoom",Gn),R.mergeOptions({doubleClickZoom:!0});var jn=_t.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;e.options.doubleClickZoom==="center"?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});R.addInitHook("addHandler","doubleClickZoom",jn),R.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var $n=_t.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new St(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}O(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){X(this._map._container,"leaflet-grab"),X(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=it(this._map.options.maxBounds);this._offsetLimit=ot(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,l=(n+e+i)%t-e-i,d=Math.abs(o+i)<Math.abs(l+i)?o:l;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=d},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),l=(this._lastTime-this._times[0])/1e3,d=i.easeLinearity,m=o.multiplyBy(d/l),_=m.distanceTo([0,0]),y=Math.min(i.inertiaMaxSpeed,_),P=m.multiplyBy(y/_),k=y/(i.inertiaDeceleration*d),A=P.multiplyBy(-k/2).round();!A.x&&!A.y?e.fire("moveend"):(A=e._limitOffset(A,e.options.maxBounds),Y(function(){e.panBy(A,{duration:k,easeLinearity:d,noMoveStart:!0,animate:!0})}))}}});R.addInitHook("addHandler","dragging",$n),R.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Xn=_t.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),E(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),q(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e=this._panKeys={},i=this.keyCodes,n,o;for(n=0,o=i.left.length;n<o;n++)e[i.left[n]]=[-1*t,0];for(n=0,o=i.right.length;n<o;n++)e[i.right[n]]=[t,0];for(n=0,o=i.down.length;n<o;n++)e[i.down[n]]=[0,t];for(n=0,o=i.up.length;n<o;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){var e=this._zoomKeys={},i=this.keyCodes,n,o;for(n=0,o=i.zoomIn.length;n<o;n++)e[i.zoomIn[n]]=t;for(n=0,o=i.zoomOut.length;n<o;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){E(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){q(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=t.keyCode,i=this._map,n;if(e in this._panKeys)(!i._panAnim||!i._panAnim._inProgress)&&(n=this._panKeys[e],t.shiftKey&&(n=D(n).multiplyBy(3)),i.panBy(n),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds));else if(e in this._zoomKeys)i.setZoom(i.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else if(e===27&&i._popup&&i._popup.options.closeOnEscapeKey)i.closePopup();else return;Et(t)}}});R.addInitHook("addHandler","keyboard",Xn),R.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Yn=_t.extend({addHooks:function(){E(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){q(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=xn(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(u(this._performZoom,this),n),Et(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(this._map.options.wheelPxPerZoomLevel*4),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,l=i?Math.ceil(o/i)*i:o,d=t._limitZoom(e+(this._delta>0?l:-l))-e;this._delta=0,this._startTime=null,d&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+d):t.setZoomAround(this._lastMousePos,e+d))}});R.addInitHook("addHandler","scrollWheelZoom",Yn);var qr=600;R.mergeOptions({tapHold:I.touchNative&&I.safari&&I.mobile,tapTolerance:15});var Kn=_t.extend({addHooks:function(){E(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){q(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var e=t.touches[0];this._startPos=this._newPos=new W(e.clientX,e.clientY),this._holdTimeout=setTimeout(u(function(){this._cancel(),this._isTapValid()&&(E(document,"touchend",nt),E(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),qr),E(document,"touchend touchcancel contextmenu",this._cancel,this),E(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){q(document,"touchend",nt),q(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),q(document,"touchend touchcancel contextmenu",this._cancel,this),q(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new W(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});R.addInitHook("addHandler","tapHold",Kn),R.mergeOptions({touchZoom:I.touch,bounceAtZoomLimits:!0});var Jn=_t.extend({addHooks:function(){O(this._map._container,"leaflet-touch-zoom"),E(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){X(this._map._container,"leaflet-touch-zoom"),q(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(!(!t.touches||t.touches.length!==2||e._animatingZoom||this._zooming)){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.touchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),E(document,"touchmove",this._onTouchMove,this),E(document,"touchend touchcancel",this._onTouchEnd,this),nt(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,o===1)return}else{var l=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(o===1&&l.x===0&&l.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(l),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),et(this._animRequest);var d=u(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Y(d,this,!0),nt(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,et(this._animRequest),q(document,"touchmove",this._onTouchMove,this),q(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});R.addInitHook("addHandler","touchZoom",Jn),R.BoxZoom=Gn,R.DoubleClickZoom=jn,R.Drag=$n,R.Keyboard=Xn,R.ScrollWheelZoom=Yn,R.TapHold=Kn,R.TouchZoom=Jn,a.Bounds=j,a.Browser=I,a.CRS=xt,a.Canvas=Hn,a.Circle=Ii,a.CircleMarker=Pe,a.Class=yt,a.Control=ct,a.DivIcon=Bn,a.DivOverlay=gt,a.DomEvent=hr,a.DomUtil=ar,a.Draggable=St,a.Evented=jt,a.FeatureGroup=At,a.GeoJSON=wt,a.GridLayer=re,a.Handler=_t,a.Icon=Ht,a.ImageOverlay=ke,a.LatLng=U,a.LatLngBounds=rt,a.Layer=dt,a.LayerGroup=Ft,a.LineUtil=br,a.Map=R,a.Marker=Te,a.Mixin=_r,a.Path=Ct,a.Point=W,a.PolyUtil=wr,a.Polygon=Ut,a.Polyline=bt,a.Popup=De,a.PosAnimation=bn,a.Projection=Lr,a.Rectangle=qn,a.Renderer=Lt,a.SVG=ae,a.SVGOverlay=Rn,a.TileLayer=qt,a.Tooltip=Ee,a.Transformation=ii,a.Util=Io,a.VideoOverlay=Zn,a.bind=u,a.bounds=ot,a.canvas=Un,a.circle=Dr,a.circleMarker=kr,a.control=ie,a.divIcon=Nr,a.extend=s,a.featureGroup=Cr,a.geoJSON=zn,a.geoJson=Ar,a.gridLayer=Fr,a.icon=Mr,a.imageOverlay=Or,a.latLng=V,a.latLngBounds=it,a.layerGroup=Sr,a.map=ur,a.marker=Ir,a.point=D,a.polygon=Wr,a.polyline=Er,a.popup=Rr,a.rectangle=Vr,a.setOptions=w,a.stamp=f,a.svg=Vn,a.svgOverlay=Zr,a.tileLayer=Nn,a.tooltip=Br,a.transformation=$t,a.version=r,a.videoOverlay=zr;var Gr=window.L;a.noConflict=function(){return window.L=Gr,this},window.L=a})});var pe=no(Oi());var ro={comment1:["'degC': ['K', 1, 273.15] -> degC = K * 1 + 273.15",0],comment2:["'hPa': ['Pa', 1000]' -> hPa = Pa * 1000 + 0 (0 - could be ommited)",0],K:["K",1],kelvin:["K",1],F:["K",.5555555555,255.372222222],C:["K",1,273.15],degC:["K",1,273.15],"kg/m^2/s":["kg/m^2/s",1],"Kg/m^2/s":["kg/m^2/s",1],"Kg m**-2 s**-1":["kg/m^2/s",1],"Kg m^-2 s^-1":["kg/m^2/s",1],"Kg m^{-2} s^-1":["kg/m^2/s",1],"mm/h":["kg/m^2/s",.00027777777],"mm/hr":["kg/m^2/s",.00027777777],"W/m^2":["W/m^2",1],"W m^-2":["W/m^2",1],"W m^{-2}":["W/m^2",1],"W/m**2":["W/m^2",1],"W m**-2":["W/m^2",1],"m/s":["m/s",1],"m s**-1":["m/s",1],"m s^-1":["m/s",1],"m.s^{-1}":["m/s",1],knot:["m/s",.514444],knots:["m/s",.514444],"km/h":["m/s",.27777777777],"km h^-1":["m/s",.27777777777],"km h**-1":["m/s",.27777777777],mph:["m/s",.44704],"miles/h":["m/s",.44704],s:["s",1],sec:["s",1],h:["s",3600],min:["s",60],m:["m",1],cm:["m",.01],km:["m",1e3],mile:["m",1609.344],miles:["m",1609.344],inch:["m",.0254],Pa:["Pa",1],hPa:["Pa",100],degree:["degree",1],radian:["degree",57.3],"mg/m^3":["mg/m^3",1],"mg m^-3":["mg/m^3",1],"mg.m^-3":["mg/m^3",1],"%":["%",1],"(0 - 1)":["%",100]};var so={none:["#00000000","#00000000"],divergingbluered:["#2166acff","#92c5deff","#f7f7f7ff","#f4a582ff","#b2182bff"],rainbow:["#ff0000ff","#ffff00ff","#00ff00ff","#00ffffff","#0000ffff","#ff00ffff"],rainbowzerro:["#ff000000","#ff0000ff","#ffff00ff","#00ff00ff","#00ffffff","#0000ffff","#ff00ffff"],rainbow2:["#ff0000ff","#ffff00ff","#00ff00ff","#00ffffff","#0000ffff","#ff00ffff","#ff0000ff"],bluebird:["#0000ffff","#ff00ffff","#00ffffff","#9000ffff","#9090ffff"],bluebirdzerro:["#0000ff00","#0000ffff","#ff00ffff","#00ffffff","#9000ffff","#9090ffff"],bw:["#000000ff","#ffffffff"],wb:["#ffffffff","#000000ff"],redish:["#ff00ffff","#ff0000ff","#ffff00ff"],greenish:["#ffff00ff","#00ff00ff","#00ffffff"],blueish:["#ff00ffff","#0000ffff","#00ffffff"],hspastel:["#AC6EA4FF","#8E92BDFF","#ACD4DEFF","#E9DC8EFF","#E7A97DFF","#E59074FF","#BE7E68FF","#A88F86FF"]};var Ze={base:{parent:void 0,name:"base",fill:"gradient",isolineColor:"inverted",isolineText:!0,vectorType:"arrows",vectorColor:"inverted",vectorFactor:1,streamLineColor:"#777",streamLineSpeedFactor:1,streamLineStatic:!1,showBelowMin:!0,showAboveMax:!0,colorScheme:"rainbow",colors:void 0,colorMap:void 0,levels:void 0,blurRadius:0,addDegrees:0,units:"",extraUnits:void 0,mask:"none"},custom:{parent:void 0,name:"custom",fill:"gradient",isolineColor:"inverted",isolineText:!0,vectorType:"arrows",vectorColor:"inverted",vectorFactor:1,streamLineColor:"#777",streamLineSpeedFactor:1,streamLineStatic:!1,showBelowMin:!0,showAboveMax:!0,colorScheme:"rainbow",colors:void 0,colorMap:void 0,levels:void 0,blurRadius:0,addDegrees:0,units:"",extraUnits:void 0,mask:"none"}};var ao,lo,ho;function uo({colorStyles:a={},units:r={},colorSchemes:s={}}={}){z("WxTile lib setup: start"),ao=Object.assign({},ro,r),lo=Object.assign({},s,so);let h=Object.assign({},a,Ze);ho=ls(h),z("WxTile lib setup: styles unrolled");try{(async()=>(await document.fonts.load("32px barbs"),await document.fonts.load("32px arrows")))()}catch{z("WxTile lib setup: fonts not loaded")}z("WxTile lib setup is done.")}function zt(){return ho}function le(){return lo}function Re(a,r,s){z("makeConverter: From=",a," To=",r);let h=x=>x;if(h.trivial=!0,a===r)return z("Trivial converter"),h;let u=Object.assign({},ao,s),c=u[a],f=u[r];if(!c||!f)return z("Inconvertible units. Trivial converter"),h;let[p,v,g]=c,[b,C,T]=f;if(p!==b||!v||!C)return z("Inconvertible units. Trivial converter"),h;let w=v/C,S=((g||0)-(T||0))/C;return S?x=>w*x+S:x=>w*x}function ls(a){let r=Object.assign({},Ze);for(let c in a){let f=a[c];if(Array.isArray(f))for(let p=0;p<f.length;++p)r[c+"["+p+"]"]=Object.assign({},f[p]);else r[c]=Object.assign({},f)}let s=Object.assign({},Ze.base),h=(c,f)=>{if(f==="base")return s;let p=c[f];if(!p)return s;(!p.parent||!(p.parent in c))&&(p.parent="base");let v=h(c,p.parent);return Object.assign(p,Object.assign({},v,p,{parent:"base"}))},u={base:s};for(let c in r)u[c]=h(r,c);return u}function he(a){let r=new Map;return(s,...h)=>{let u=r.get(s);if(u)return u;let c=a(s,...h);return r.set(s,c),c.catch(f=>{f.name==="AbortError"&&r.delete(s)}),c}}async function hs(a,r){return createImageBitmap(await(await fetch(a,r)).blob())}function Gt(a,r,s=!0){let h=Object.assign(document.createElement("canvas"),{width:a,height:r,imageSmoothingEnabled:!1}).getContext("2d",{willReadFrequently:s});if(!h)throw new Error("Cannot get canvas context");return h}function us(a){let{width:r,height:s}=a,h=Gt(r,s);return h.drawImage(a,0,0),h.getImageData(0,0,r,s)}async function zi(a,r){return us(await hs(a,r))}function cs(a){a.data[34]<1&&z("Warning: image is in too old format. Check the version of the Splitter.");let r=new Uint16Array(a.data.buffer),s=new Uint16Array(r.length/2);for(let g=0;g<s.length;g++)s[g]=r[g*2];let h=new Uint8Array(8);for(let g=0;g<8;++g)h[g]=a.data[g*4+2];let u=new DataView(h.buffer),c=u.getFloat32(0,!0),f=u.getFloat32(4,!0),p=(f-c)/65535,v=ds(s);return{raw:s,dmin:c,dmax:f,dmul:p,integral:v,radius:0}}async function Zi(a,r){return cs(await zi(a,r))}function ds(a){let r=new Uint32Array(66564),s=new Uint32Array(258*258);r[0]=a[0],s[0]=a[0]===0?0:1;for(let h=1;h<258;++h)r[h]=a[h]+r[h-1],r[258*h]=a[258*h]+r[258*h-258],s[h]=(a[h]===0?0:1)+s[h-1],s[258*h]=(a[258*h]===0?0:1)+s[258*h-258];for(let h=1,u=259;h<258;++h,++u)for(let c=1;c<258;++c,++u)r[u]=a[u]+r[u-258]+r[u-1]-r[u-258-1],s[u]=(a[u]===0?0:1)+s[u-258]+s[u-1]-s[u-258-1];return{integral:r,integralNZ:s}}function co(a,r){if(r<0||r===a.radius)return a;a.radius=r;let s=258,{integral:h,integralNZ:u}=a.integral;for(let c=1;c<s;c++)for(let f=1;f<s;f++){if(!a.raw[s*c+f])continue;let p=Math.min(r,f-1,s-1-f),v=Math.min(r,c-1,s-1-c),g=s*(c-v-1)+f,b=s*(c+v)+f,C;if(u){let Z=u[g-p-1],F=u[g+p],N=u[b-p-1],Q=u[b+p];C=Z+Q-F-N}else C=(2*p+1)*(2*v+1);let T=h[g-p-1],w=h[g+p],S=h[b-p-1],x=h[b+p],M=T+x-w-S;a.raw[c*s+f]=M/C}return a}function at(a){let r=a>>0&255,s=a>>8&255,h=a>>16&255,u=r.toString(16),c=s.toString(16),f=h.toString(16);return u=u.length===2?u:"0"+u,c=c.length===2?c:"0"+c,f=f.length===2?f:"0"+f,"#"+u+c+f}function Tt(a){if(a[0]==="#"){if(a.length===4)return+("0xff"+a[3]+a[3]+a[2]+a[2]+a[1]+a[1]);if(a.length===7)return+("0xff"+a[5]+a[6]+a[3]+a[4]+a[1]+a[2]);if(a.length===9)return+("0x"+a[7]+a[8]+a[5]+a[6]+a[3]+a[4]+a[1]+a[2])}return z("wrong color format",a),0}async function Zt(a,r){let s=await fetch(a,r);if(!s.ok)throw new Error("error:"+a+" - "+s.statusText);return s.json()}function Ri(a,r,s){let h=a>>0&255,u=a>>8&255,c=a>>16&255,f=a>>>24,p=r>>0&255,v=r>>8&255,g=r>>16&255,b=r>>>24,C=h+s*(p-h),T=u+s*(v-u),w=c+s*(g-c),S=f+s*(b-f);return C|T<<8|w<<16|S<<24}function fo(a,r,s){let h=[];for(let u=0;u<s;++u)h.push(u*(r-a)/(s-1)+a);return h}var mo=!1;function Bi(a){console.log(a?"Logging on":"Logging off"),mo=a}function z(...a){mo&&console.log(...a)}function po(a){return a[0]==="#"&&a.length===4?"#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:a}function Be(a,{x:r,y:s,z:h}){return a.replace("{x}",`${r}`).replace("{y}",`${s}`).replace("{z}",`${h}`)}function Ne({x:a,y:r,z:s}){return`${s}-${a}-${r}`}var fs="A".charCodeAt(0);var Fe=class{constructor(){this.qtree={nodes:null};this.qtreedepth=0}async load(r,s){try{let h=await Zt(r,s);this.qtree=_o(h,{pos:0})}catch(h){throw new Error(`Failed to load QTree: ${h.message}`)}this.qtreedepth=go(this.qtree)}check(r){let s=r.z-this.qtreedepth,h=s>=0,u=h?{x:r.x>>s,y:r.y>>s,z:this.qtreedepth}:{...r};return vo(this.qtree,u,h)}};function _o(a,r){let s=a.charCodeAt(r.pos)-fs;r.pos++;let h=[1,2,4,8].map(u=>s&u?_o(a,r):null);return{nodes:h.some(u=>u)?h:null}}function go(a){return a?.nodes?1+Math.max(...a.nodes.map(go)):0}function vo(a,r,s){return a===null?"land":s&&!r.z?"mixed":a.nodes===null?"sea":r.z?(r.z--,vo(a.nodes[(r.y>>r.z&1)<<1|r.x>>r.z&1],r,s)):"mixed"}var ue=class{constructor({datasetName:r,instance:s,instanced:h,meta:u,wxapi:c}){if(!c.datasetsMetas.allDatasetsList.includes(r))throw new Error(`Dataset ${r} not found`);this.datasetName=r,this.instanced=h,this.instance=s,this.meta=u,this.wxapi=c}getValidTime(r=Date()){let s=this.getTimes();if(typeof r=="number"){if(r<=0)return s[0];if(r<s.length)return s[r]}let h=new Date(r).getTime(),u=s.find(c=>new Date(c).getTime()>=h);if(isNaN(h)||!u){let c=s.indexOf(r);return c===-1?s[s.length-1]:s[c]}return u}getTimes(){return this.instanced||this.meta.times}getVariables(){return this.meta.variables}getVariableMeta(r){return this.meta.variablesMeta[r]}getMaxZoom(){return this.meta.maxZoom}getBoundaries180(){let r=this.meta.boundaries?.boundaries180;if(r?.length!==1)return;let s=r[0];return[s.west,s.south,s.east,s.north]}getBoundaries(){return this.meta.boundaries}createURI(r,s,h="png"){if(!this.checkVariableValid(r))throw new Error(`in dataset ${this.datasetName} variable ${r} not found`);let u=this.getValidTime(s),c=this.instanced?u:this.instance;return`${this.wxapi.dataServerURL+this.datasetName}/${c}/${r}/${u}/{z}/{x}/{y}.${h}`}checkVariableValid(r){return this.getVariableMeta(r)!==void 0}checkCombineVariableIfVector(r){let s=this.getVariableMeta(r);if(!s)throw new Error(`in dataset ${this.datasetName} variable ${r} not found`);return s.vector||[r]}async checkDatasetOutdated(){return await this.wxapi.initDone,await this.getDatasetInstance()===this.instance}async getDatasetInstance(){let r=await this.getDatasetInstances();return r[r.length-1]}async getDatasetInstances(){try{let r=await Zt(this.wxapi.dataServerURL+this.datasetName+"/instances.json",this.wxapi.requestInit);if(r.length===0)throw new Error(`No instances found for dataset ${this.datasetName}`);return r}catch(r){throw new Error(`getting dataset instances failure message: ${r.message} datasetName: ${this.datasetName}`)}}};var ce=class{constructor({dataServerURL:r,maskURL:s="auto",qtreeURL:h="auto",requestInit:u,colorStyles:c,units:f,colorSchemes:p}){this.datasetsMetas={allDatasetsList:[]};this.qtree=new Fe;this.loadMaskFunc=()=>Promise.reject(new Error("maskURL not defined"));if(uo({colorStyles:c,units:f,colorSchemes:p}),this.dataServerURL=r,this.requestInit=u,h=h==="auto"?r+"seamask.qtree":h,s!=="none"){let v=he(zi);this.maskURL=s=s==="auto"?r+"mask/":s,this.loadMaskFunc=g=>v(Be(s,g),u)}this.initDone=Promise.all([Zt(r+"datasetsmeta.json",u),h!=="none"?this.qtree.load(h,u):Promise.resolve()]).then(([v,g])=>{v.allDatasetsList||(v.allDatasetsList=Object.keys(v)),this.datasetsMetas=v})}getDatasetShortMeta(r){if(r!=="allDatasetsList")return this.datasetsMetas[r]}getDatasetInatance(r){return this.getDatasetShortMeta(r)?.instance}async getDatasetVariables(r){return await this.initDone,this.datasetsMetas[r]?.variables}async createDatasetManager(r){await this.initDone;let s=this.getDatasetShortMeta(r),h=s?.instance;if(!h)throw new Error("Dataset/instance not found:"+r);let u=s.instanced,c=await Zt(this.dataServerURL+r+"/"+h+"/meta.json",this.requestInit);return new ue({datasetName:r,instanced:u,instance:h,meta:c,wxapi:this})}async createAllDatasetsManagers(){return await this.initDone,Promise.allSettled(this.datasetsMetas.allDatasetsList.map(s=>this.createDatasetManager(s)))}async filterDatasetsByVariableName(r){return await this.initDone,this.datasetsMetas.allDatasetsList.filter(s=>this.datasetsMetas[s]?.variables?.includes?.(r))}async getAllDatasetsNames(){return await this.initDone,this.datasetsMetas.allDatasetsList}};function ms(a,r,s){return a>s?s:a<r?r:a}var He=class{constructor(r,s,[h,u],c){let f=u-h;this.levelIndex=new Uint32Array(65536),this.colorsI=new Uint32Array(65536);let p=[];this.DataToStyle=Re(s,r.units,r.extraUnits),this.DataToStyle.trivial&&(r.units=s),c&&(this.DataToKnots=Re(s,"knot"));let v=Re(r.units,s,r.extraUnits),g=x=>~~(65535*ms((v(x)-h)/(u-h),0,1));if(Array.isArray(r.colorMap)){r.colorMap.sort((x,M)=>x[0]<M[0]?-1:x[0]>M[0]?1:0);for(let[x]of r.colorMap)p.push(g(x))}else{if(r.levels||(r.levels=fo(this.DataToStyle(h),this.DataToStyle(u),10)),r.levels.sort((x,M)=>x<M?-1:x>M?1:0),!r.colors){let x=le();r.colorScheme&&r.colorScheme in x?r.colors=x[r.colorScheme]:r.colors=x.wb}for(let x of r.levels)p.push(g(x))}let b=65536,C=Ue(b,r);this.ticks=C.ticks;let T=C.ticks[0].data,S=C.ticks[C.ticks.length-1].data-T;for(let x=0;x<65536;++x){let M=f*x/65535+h,Z=this.DataToStyle(M),F=Math.round((b-1)*(Z-T)/S);F<=0?this.colorsI[x]=r.showBelowMin?C.colors[0]:0:F>=b?this.colorsI[x]=r.showAboveMax?C.colors[b-1]:0:this.colorsI[x]=C.colors[F]}this.colorsI[0]=0;for(let x=0;x<p[0];++x)this.levelIndex[x]=0;for(let x=0;x<p.length-1;x++)for(let M=p[x];M<p[x+1]+1;++M)this.levelIndex[M]=x;for(let x=p[p.length-1];x<65536;++x)this.levelIndex[x]=p.length-1}};function yo(a){if(a!==0&&-.1<a&&a<.1)return a.toExponential(2);let r=a.toString();return r.split(".")[1]?.length>2?a.toFixed(2):r}function Ue(a,r){let s={size:a,showBelowMin:r.showBelowMin,showAboveMax:r.showAboveMax,units:r.units,colors:new Uint32Array(a),ticks:[]},{colorMap:h,levels:u,colors:c}=r,f=r.fill!=="solid";if(h){let T=h[0][0],w=h[h.length-1][0]-T;for(let[S,x]of h){let M=~~((S-T)/w*(a-1)),Z={data:S,dataString:yo(S),color:x,pos:M};s.ticks.push(Z)}for(let S=0;S<h.length-1;S++){let x=s.ticks[S].pos,M=s.ticks[S+1].pos,Z=Tt(h[S][1]),F=f?Tt(h[S+1][1]):0;for(let N=x;N<M;++N)s.colors[N]=f?Ri(Z,F,(N-x)/(M-x)):Z}return s.colors[a-1]=Tt(h[h.length-1][1]),s}if(!c||!u)return s;let p=0,v=0,g=-1;for(let T=0;T<a;++T){let w=T*(c.length-1)/a;g!==~~w&&(g=~~w,p=Tt(c[g]),v=c.length>g+1?Tt(c[g+1]):p),s.colors[T]=f?Ri(p,v,w-g):p}s.colors[a-1]=Tt(c[c.length-1]);let b=u[0],C=(a-1)/(u[u.length-1]-b);for(let T of u){let w=~~((T-b)*C),S={data:T,dataString:yo(T),color:at(s.colors[w]),pos:w};s.ticks.push(S)}return s}var ps=2*Math.PI*6378137/256,Ve=2*Math.PI*6378137/2;function _s(a,r){let s=a/Ve*180,h=r/Ve*180;return h=180/Math.PI*(2*Math.atan(Math.exp(h*Math.PI/180))-Math.PI/2),[h,s]}function gs(a,r,s){let h=vs(s),u=a*h-Ve,c=r*h-Ve;return[u,c]}function vs(a){return ps/Math.pow(2,a)}function Ni(a,r,s){let[h,u]=_s(...gs(a,r,s));return[u,-h]}function xo(a,r){return[a*256,r*256]}function Fi(a,r,s){let h=((r-a)%360+540)%360-180;return(a+h*s+360)%360}function ys(a,r,s,h,u,c,f,p){switch((a?1:0)|(r?2:0)|(s?4:0)|(h?8:0)){case 0:return 0;case 1:return a;case 2:return r;case 3:s=a,h=r;break;case 4:return s;case 5:r=a,h=s;break;case 6:h=r+s>>1,a=h;break;case 7:h=r+s>>1;break;case 8:return h;case 9:r=a+h>>1,s=r;break;case 10:a=r,s=h;break;case 11:s=a+h>>1;break;case 12:a=s,r=h;break;case 13:r=a+h>>1;break;case 14:a=r+s>>1;break}a=f+p*a,r=f+p*r,s=f+p*s,h=f+p*h;let g=Fi(a,r,u),b=Fi(s,h,u);return(Fi(g,b,c)-f)/p||1}function xs(a,r,s,h,u,c,f,p){switch((a?1:0)|(r?2:0)|(s?4:0)|(h?8:0)){case 7:return u+c<1?u*(r-a)+c*(s-a)+a:0;case 14:return u+c<1?0:u*(h-s)+c*(h-r)+r+s-h;case 11:return c<u?(1-u)*(a-r)+c*(h-r)+r:0;case 13:return c<u?0:(1-u)*(s-h)+c*(s-a)+a+h-s;case 15:return u+c<1?u*(r-a)+c*(s-a)+a:u*(h-s)+c*(h-r)+r+s-h;default:return 0}}function bo(a,r,s){if(!s)return r;let h=.9999999/Math.pow(2,s.z),u=s.x*256*h,c=s.y*256*h,{raw:f,dmin:p,dmax:v,dmul:g}=r,b={raw:new Uint16Array(258*258),dmin:p,dmax:v,dmul:g},{raw:C}=b;for(let T=-1,w=0;T<=256;T++){let S=c+T*h,x=Math.floor(S),M=S-x;for(let Z=-1;Z<=256;Z++,w++){let F=u+Z*h,N=Math.floor(F),Q=F-N,H=N+1+(x+1)*258,G=f[H],tt=f[H+1],ft=f[H+258],Y=f[H+258+1];C[w]=a(G,tt,ft,Y,Q,M,p,g)}}return b}function wo(a,r){return bo(xs,a,r)}function Lo(a,r){return bo(ys,a,r)}function To(a,r,s){let h=s==="sea";for(let u=3,c=0;c<256;c++)for(let f=0,p=(c+1)*258+1;f<256;f++,p++,u+=4)h===!r.data[u]&&(a.raw[p]=0);return a}function Po(a){let[r,s]=xo(a.x,a.y),[h,u]=Ni(r,s,a.z),[c,f]=Ni(r+256,s+256,a.z);return{west:h,north:u,east:c,south:f}}function So(a,r){let s=a.z-r;if(s<=0)return{upCoords:a};let h={x:a.x>>>s,y:a.y>>>s,z:r},u={x:a.x&(1<<s)-1,y:a.y&(1<<s)-1,z:s};return{upCoords:h,subCoords:u}}var qe=class{constructor(r){this.loadDataFunc=he(Zi);this.layer=r}async load(r,s){let h=await this.cacheLoad(r,this.layer.tilesURIs,s);if(!h)return null;let{rawdata:u,subCoords:c,tileType:f}=h,{units:p}=this.layer.currentMeta,v=p==="degree"?Lo:wo,g=C=>v(co(C,this.layer.style.blurRadius),c),b=u.map(g);return this._vectorMagnitudesPrepare(b),await this._applyMask(b,r,f,!c&&u.length===1),{data:b,slines:this._createStreamLines(b)}}async cacheLoad(r,s,h){if(!this._checkInsideBoundaries(r))return null;let u=this._checkTypeAndMask(r);if(!u)return null;let{upCoords:c,subCoords:f}=So(r,this.layer.wxdatasetManager.getMaxZoom()),p=s.map(b=>Be(b,c)),v=Object.assign({},this.layer.wxdatasetManager.wxapi.requestInit,{signal:h?.signal});return{rawdata:await Promise.all(p.map(b=>this.loadDataFunc(b,v))),subCoords:f,tileType:u}}clearCache(){this.loadDataFunc=he(Zi)}async _applyMask(r,s,h,u){let{style:c}=this.layer;if((c.mask==="land"||c.mask==="sea")&&h==="mixed"){if(u){let{raw:p,dmin:v,dmax:g,dmul:b}=r[0];r[0]={raw:new Uint16Array(p),dmin:v,dmax:g,dmul:b}}let f;try{f=await this.layer.wxdatasetManager.wxapi.loadMaskFunc(s)}catch{c.mask=void 0,z("Can't load Mask. Masking is Turned OFF");return}To(r[0],f,c.mask)}}_vectorMagnitudesPrepare(r){if(r.length===1)return;r.unshift({raw:new Uint16Array(258*258),dmin:0,dmax:0,dmul:0});let[s,h,u]=r;s.dmax=1.42*Math.max(-h.dmin,h.dmax,-u.dmin,u.dmax),s.dmul=(s.dmax-s.dmin)/65535;for(let c=0;c<258*258;++c){if(!h.raw[c]||!u.raw[c])continue;let f=h.dmin+h.dmul*h.raw[c],p=u.dmin+u.dmul*u.raw[c];s.raw[c]=Math.sqrt(p*p+f*f)/s.dmul}}_checkTypeAndMask(r){let{mask:s}=this.layer.style;var h="mixed";if(!((s==="land"||s==="sea")&&(h=this.layer.wxdatasetManager.wxapi.qtree.check(r),s===h)))return h}_checkInsideBoundaries(r){let s=this.layer.wxdatasetManager.getBoundaries();if(s?.boundaries180){let h=Po(r),u=c=>!(h.west>c.east||c.west>h.east||h.south>c.north||c.south>h.north);if(!s.boundaries180.some(u))return!1}return!0}_createStreamLines(r){if(r.length!==3)return[];let{style:s}=this.layer;if(s.streamLineColor==="none")return[];let h=[],[u,c,f]=r,p=(s.streamLineSpeedFactor||1)/u.dmax,v=s.addDegrees?.017453292519943*s.addDegrees:0,g=s.streamLineGridStep||64,b=s.streamLineSteps||300;for(let C=0;C<=256;C+=g)for(let T=0;T<=256;T+=g){if(!u.raw[1+T+(1+C)*258])continue;let w=[],S=T,x=C,M=-1,Z=0,F=0;for(let H=0;H<=b&&S>=0&&S<=256&&x>=0&&x<=256;H++){H%(b/10)||w.push({x:~~S,y:~~x});let G=~~S+1+(~~x+1)*258;if(G!==M){if(!u.raw[G])break;M=G;let tt=u.dmin+u.raw[G]*u.dmul,ft=c.dmin+c.raw[G]*c.dmul,Y=f.dmin+f.raw[G]*f.dmul,et=Math.atan2(ft,Y)+v;Z=p*tt*Math.sin(et),F=p*tt*Math.cos(et)}S+=Z,x-=F}let N=T,Q=C;M=-1;for(let H=1;H<=b&&N>=0&&N<=256&&Q>=0&&Q<=256;H++){H%(b/10)||w.unshift({x:~~N,y:~~Q});let G=~~N+1+(~~Q+1)*258;if(G!==M){if(!u.raw[G])break;M=G;let tt=u.dmin+u.raw[G]*u.dmul,ft=c.dmin+c.raw[G]*c.dmul,Y=f.dmin+f.raw[G]*f.dmul,et=Math.atan2(ft,Y)+v;Z=p*tt*Math.sin(et),F=p*tt*Math.cos(et)}N-=Z,Q+=F}w.length>2&&h.push(w)}return h}};var Ge=class{constructor(r){this.layer=r}paint({data:r,ctxFill:s,ctxText:h,ctxStreamLines:u}){let{layer:c}=this,{units:f}=c.currentMeta,p=new ImageData(256,256),v=new Uint32Array(p.data.buffer);s.clearRect(0,0,256,256),h.clearRect(0,0,256,256),u.clearRect(0,0,256,256),bs(r.data[0],v,c);let g=ws(v,r.data[0],c);s.putImageData(p,0,0),Ls(g,h,c),Ts(r.data,h,c),Ps(r.data[0],h,f,c),Ss(r,h,c)}imprintVectorAnimationLinesStep({data:r,ctxFill:s,ctxStreamLines:h},u){let{layer:c}=this;h.clearRect(0,0,256,256),h.drawImage(s.canvas,0,0),!(r.slines.length===0||c.style.streamLineStatic||c.style.streamLineColor==="none")&&Cs(r,h,c,u)}};function bs(a,r,{CLUT:s,style:h}){let{raw:u}=a,{colorsI:c}=s;if(h.fill!=="none")for(let f=0,p=0,v=259;f<256;++f,v+=2)for(let g=0;g<256;++g,++p,++v)r[p]=c[u[v]];else r.fill(0)}function ws(a,r,{CLUT:s,style:h}){let{raw:u}=r,{levelIndex:c,colorsI:f}=s,p=[];if(h.isolineColor!=="none"){let v=h.isolineColor[0]==="#"?Tt(h.isolineColor):0;for(let g=0,b=0;g<256;g+=1)for(let C=0;C<256;C+=1){let T=(g+1)*258+(C+1),w=u[T],S=u[T+1],x=u[T+258];if(!w||!S||!x)continue;let M=c[w],Z=c[S],F=c[x];if(M!==Z||M!==F){let N=Math.max(M,Z,F),Q=Math.max(w,S,x),H=g*256+C;switch(h.isolineColor){case"inverted":a[H]=~f[Q]|4278190080;break;case"fill":a[H]=f[Q]|4278190080;break;default:a[H]=v;break}h.isolineText&&!(++b%255)&&C>20&&C<235&&g>20&&g<235&&p.push({x:C,y:g,d:w,dr:S,db:x,mli:N})}}}return p}function Ls(a,r,{CLUT:s}){if(a.length){r.font="1.1em Sans-serif",r.lineWidth=2,r.strokeStyle="white",r.fillStyle="black",r.textAlign="center",r.textBaseline="middle";for(let{x:h,y:u,d:c,dr:f,db:p,mli:v}of a){let g=s.ticks[v].dataString,b=Math.atan2(c-f,p-c);r.save(),r.translate(h,u),r.rotate(b<-1.57||b>1.57?b+3.14:b),r.strokeText(g,0,0),r.fillText(g,0,0),r.restore()}}}function Ts(a,r,{CLUT:s,style:h}){if(!s.DataToKnots||h.vectorColor==="none"||h.vectorType==="none")return;if(a.length!==3)throw new Error("data.length !== 3");let[u,c,f]=a;switch(h.vectorType){case"barbs":r.font="40px barbs";break;case"arrows":r.font="50px arrows";break;default:r.font=h.vectorType}r.textAlign="center",r.textBaseline="middle",r.fillStyle=h.vectorColor;let p=h.addDegrees?.017453292519943*h.addDegrees:0,v=32;for(let g=v/2;g<256;g+=v)for(let b=v/2;b<256;b+=v){let C=b+1+(g+1)*258;if(!u.raw[C])continue;let T=Math.atan2(c.dmin+c.raw[C]*c.dmul,f.dmin+f.raw[C]*f.dmul),w=u.dmin+u.raw[C]*u.dmul,S=h.vectorType!=="barbs"?h.vectorFactor*.2:.2,x=Math.min(s.DataToKnots(w)*S,25)+65,M=String.fromCharCode(x);switch(h.vectorColor){case"inverted":r.fillStyle=at(~s.colorsI[u.raw[C]]);break;case"fill":r.fillStyle=at(s.colorsI[u.raw[C]]);break}r.save(),r.translate(b,g),r.rotate(T+p),r.fillText(M,0,0),r.restore()}}function Ps(a,r,s,{CLUT:h,style:u}){if(s!=="degree")return;let c=.017453292519943*u.addDegrees;r.font="50px arrows",r.textAlign="center",r.textBaseline="middle",r.fillStyle=u.vectorColor;let f="L",p=32;for(let v=p/2;v<256;v+=p)for(let g=p/2;g<256;g+=p){let b=g+1+(v+1)*258;if(!a.raw[b])continue;let T=(a.dmin+a.raw[b]*a.dmul+180)*.01745329251;switch(u.vectorColor){case"inverted":r.fillStyle=at(~h.colorsI[a.raw[b]]);break;case"fill":r.fillStyle=at(h.colorsI[a.raw[b]]);break}r.save(),r.translate(g,v),r.rotate(T+c),r.fillText(f,0,0),r.restore()}}function Ss(a,r,{CLUT:s,style:h}){let{data:u,slines:c}=a;if(!c.length||!h.streamLineStatic||h.streamLineColor==="none")return;let f=u[0];r.lineWidth=1,r.strokeStyle=h.streamLineColor;for(let p=c.length;p--;){let v=c[p];for(let g=0;g<v.length-1;++g){let b=v[g],C=v[g+1],T=b.x+1+(b.y+1)*258;switch(h.streamLineColor){case"inverted":r.strokeStyle=at(~s.colorsI[f.raw[T]]);break;case"fill":r.strokeStyle=at(s.colorsI[f.raw[T]]);break}r.beginPath(),r.moveTo(b.x,b.y),r.lineTo(C.x,C.y),r.stroke()}}}function Cs(a,r,{CLUT:s,style:h},u){let{data:c,slines:f}=a,p=c[0],v=h.streamLineColor.substring(0,7);u=u>>5;for(let g=0;g<f.length;++g){let b=f[g],C=b.length-1,T=(u+(1+b[0].x)*(1+b[0].y))%30;for(let w=0;w<C;++w){let S=b[w],x=b[w+1],M=1-(T-w)/C;(M<0||M>1)&&(M=0);let Z=(~~(M*255)).toString(16).padStart(2,"0"),F=1+~~((1.2-M)*5);r.lineWidth=F;let N=S.x+1+(S.y+1)*258;switch(h.streamLineColor){case"inverted":v=at(~s.colorsI[p.raw[N]]);break;case"fill":v=at(s.colorsI[p.raw[N]]);break}r.strokeStyle=v+Z,r.beginPath(),r.moveTo(S.x,S.y),r.lineTo(x.x,x.y),r.stroke()}}}var je=class{constructor({time:r,variables:s,wxdatasetManager:h,ext:u="png",wxstyleName:c="base"}){this.tilesCache=new Map;this.painter=new Ge(this);this.loader=new qe(this);if(!s?.length||s.length>2)throw new Error(`WxTileSource ${h.datasetName}: only 1 or 2 variables are supported but ${s.length} were given`);s.forEach(f=>{if(!h.checkVariableValid(f))throw new Error(`WxTileSource ${h.datasetName}: variable ${f} is not valid`)}),this.variables=s,this.wxdatasetManager=h,this.ext=u,this.currentMeta=this._getCurrentMeta(),[this.tilesURIs,this.time]=this._createURLsAndTime(r),[this.style,this.CLUT]=this._createCurrentStyleObject(zt()[c]),z(`WxTileSource created ${h.datasetName}, ${s.join(", ")}, ${c}`)}get nonanimatable(){return this.variables.length<2||this.style.streamLineStatic||this.style.streamLineColor==="none"}getTime(){return this.time}clearCache(){this.tilesCache.clear(),this.loader.clearCache()}getCurrentStyleObjectCopy(){return Object.assign({},this.style)}updateCurrentStyleObject(r){[this.style,this.CLUT]=this._createCurrentStyleObject(r)}getTileData(r,s){let h=this.tilesCache.get(Ne(r));if(!h)return;let u=this._getPixelInfo(s,h.data.data);if(!u)return;let{raw:c,data:f}=u,p=c.map(b=>this.CLUT.colorsI[b]),v=p.map(at),g=f.map(b=>this.CLUT.DataToStyle(b));return{data:f,raw:c,rgba:p,hexColor:v,inStyleUnits:g,tilePoint:s,styleUnits:this.style.units,dataUnits:this.currentMeta.units}}setURLsAndTime(r){[this.tilesURIs,this.time]=this._createURLsAndTime(r)}async loadTile(r,s){return this._loadCacheDrawTile(r,this.tilesCache,s)}async preloadTime(r,s,h){let[u]=this._createURLsAndTime(r);await Promise.allSettled(s.map(c=>this.loader.cacheLoad(c,u,h)))}async reloadTiles(r,s){let h=new Map;await Promise.allSettled(r.map(u=>this._loadCacheDrawTile(u,h,s))),s?.signal?.aborted||(this.tilesCache=h)}async _loadCacheDrawTile(r,s,h){let u=s.get(Ne(r));if(u)return u;let c=null;try{c=await this.loader.load(r,h)}catch{throw{status:404}}if(!c)throw{status:404};let f=Gt(256,256),p=f,v=this.variables.length===2?Gt(256,256):f,g={ctxFill:f,ctxText:p,ctxStreamLines:v,data:c};return this.painter.paint(g),s.set(Ne(r),g),g}_createCurrentStyleObject(r){let s=Object.assign(this.getCurrentStyleObjectCopy(),r);s.streamLineColor=po(s.streamLineColor);let h=this._prepareCLUT(s);return[s,h]}_getCurrentMeta(){let r=this.variables.map(f=>{let p=this.wxdatasetManager.getVariableMeta(f);if(!p)throw new Error(`WxTileSource ${this.wxdatasetManager.datasetName}: variable ${f} is not valid`);return p}),{min:s,max:h,units:u,vector:c}=r[0];return this.variables.length>1&&(s=0,h=1.42*Math.max(-r[0].min,r[0].max,-r[1].min,r[1].max)),{min:s,max:h,units:u,vector:c}}_getPixelInfo({x:r,y:s},h){let u=(s+1)*258+(r+1);if(!!h?.[0]?.raw?.[u])return{raw:h.map(c=>c.raw[u]),data:h.map(c=>c.raw[u]*c.dmul+c.dmin)}}_prepareCLUT(r){let{min:s,max:h,units:u}=this.currentMeta;return new He(r,u,[s,h],this.variables.length===2)}_createURLsAndTime(r){let s=this.wxdatasetManager.getValidTime(r);return[this.variables.map(u=>this.wxdatasetManager.createURI(u,s,this.ext)),s]}};var Co=no(Oi()),$e=class extends Co.default.GridLayer{};var Xe=class extends $e{constructor(s,h){super(h);this.animation=!1;this.animationSeed=0;this.layer=new je(s)}get wxdatasetManager(){return this.layer.wxdatasetManager}getMetadata(){return z(`WxTileSource getMetadata (${this.layer.wxdatasetManager.datasetName})`),{...this.layer.currentMeta}}getVariables(){return z(`WxTileSource getVariables (${this.layer.wxdatasetManager.datasetName})`),[...this.layer.variables]}clearCache(){z(`WxTileSource clearCache (${this.layer.wxdatasetManager.datasetName})`),this.layer.clearCache()}getCurrentStyleObjectCopy(){return z(`WxTileSource getCurrentStyleObjectCopy (${this.layer.wxdatasetManager.datasetName})`),this.layer.getCurrentStyleObjectCopy()}getTime(){return z(`WxTileSource getTime (${this.layer.wxdatasetManager.datasetName})`),this.layer.getTime()}async setTime(s,h){z(`WxTileSource setTime (${this.layer.wxdatasetManager.datasetName}) `,{time:s});let u=this.getTime();return this.layer.setURLsAndTime(s),await this._reloadVisible(h),h?.signal?.aborted&&this.layer.setURLsAndTime(u),this.getTime()}async preloadTime(s,h){return z(`WxTileSource preloadTime (${this.layer.wxdatasetManager.datasetName}) `,{time:s}),this.layer.preloadTime(s,this.coveringTiles(),h)}startAnimation(){if(this.animation){z(`WxTileSource startAnimation (${this.layer.wxdatasetManager.datasetName}) already started`);return}if(this.layer.nonanimatable){z(`WxTileSource startAnimation (${this.layer.wxdatasetManager.datasetName}) nonanimatable`);return}z(`WxTileSource startAnimation (${this.layer.wxdatasetManager.datasetName})`),this.animation=!0;let s=async h=>{if(z(`WxTileSource animationStep (${this.layer.wxdatasetManager.datasetName})`),!this.animation||this.layer.nonanimatable){this.animation=!1;return}this.animationSeed=h,await this._redrawTiles(),requestAnimationFrame(s)};requestAnimationFrame(s)}async stopAnimation(){return z(`WxTileSource stopAnimation (${this.layer.wxdatasetManager.datasetName})`),this.animation=!1,this._redrawTiles()}async setCoarseLevel(s=2){return z(`WxTileSource setCoarseLevel (${this.layer.wxdatasetManager.datasetName})`,{level:s}),this.oldMaxZoom=this.layer.wxdatasetManager.getMaxZoom(),this.layer.wxdatasetManager.meta.maxZoom=Math.max(this.oldMaxZoom-s,1),this._reloadVisible()}async unsetCoarseLevel(){if(z(`WxTileSource unsetCoarseLevel (${this.layer.wxdatasetManager.datasetName})`),this.oldMaxZoom)return this.layer.wxdatasetManager.meta.maxZoom=this.oldMaxZoom,this._reloadVisible()}async setStyleByName(s,h=!0){return z(`WxTileSource setStyleByName (${this.layer.wxdatasetManager.datasetName})`),this.updateCurrentStyleObject(zt()[s],h)}async updateCurrentStyleObject(s,h=!0,u){if(z(`WxTileSource updateCurrentStyleObject (${this.layer.wxdatasetManager.datasetName})`,{style:s}),this.layer.updateCurrentStyleObject(s),this.startAnimation(),h)return this._reloadVisible(u)}_redrawTiles(){return this.redrawRequested?this.redrawRequested:(this.redrawRequested=new Promise(s=>{requestAnimationFrame(()=>{z(`WxTileSource _redrawTiles (${this.layer.wxdatasetManager.datasetName})`),this.update(),s(),this.redrawRequested=void 0})}),this.redrawRequested)}async _reloadVisible(s){}coveringTiles(){return[]}update(){}};var Hi=class{constructor(r,s,h){this.coords=r;this.ctx=s;this.raster_data=h;this.draw(h.ctxFill.canvas)}draw(r){this.ctx.clearRect(0,0,256,256),this.ctx.drawImage(r,0,0)}},de=class extends Xe{constructor(r,s){super(r,s),z("WxTileSource constructor: ",r)}getLayerInfoAtLatLon(r,s){if(z(`WxTileSource getLayerInfoAtLatLon (${this.layer.wxdatasetManager.datasetName})`,r),!this._map)return;let h=this._map.getZoom(),u=this._map.project(r,h),c=u.divideBy(256).floor(),f=u.subtract(c.multiplyBy(256)).floor();return this.layer.getTileData({x:c.x,y:c.y,z:h},f)}async _reloadVisible(r){if(z(`WxTileSource _reloadVisible (${this.layer.wxdatasetManager.datasetName})`),await this.layer.reloadTiles(this.coveringTiles(),r),r?.signal?.aborted){z(`WxTileSource _reloadVisible (${this.layer.wxdatasetManager.datasetName}) aborted`);return}return await Promise.allSettled(this._ForEachWxTile(async s=>{s.raster_data=await this.layer.loadTile(s.coords)},"_reloadVisible")),this._redrawTiles()}update(){this._ForEachWxTile(r=>{this.animation?(this.layer.painter.imprintVectorAnimationLinesStep(r.raster_data,this.animationSeed),r.draw(r.raster_data.ctxStreamLines.canvas)):r.draw(r.raster_data.ctxFill.canvas)},"_redrawTiles")}coveringTiles(){z(`WxTileSource coveringTiles (${this.layer.wxdatasetManager.datasetName})`);let r=[];for(let s in this._tiles){let h=this._tiles[s].el?.wxtile;h&&r.push(h.coords)}return r}_ForEachWxTile(r,s){z(`WxTileSource _ForEachWxTile (${this.layer.wxdatasetManager.datasetName}) func=${s}`);let h=[];for(let u in this._tiles){let c=this._tiles[u].el?.wxtile;c&&h.push(r(c))}return h}createTile(r,s){let h=Gt(256,256),u=h.canvas;return this.layer.loadTile(r).then(c=>{u.wxtile=new Hi({x:r.x,y:r.y,z:r.z},h,c),s()}).catch(c=>{s(c)}),u}};var Ye=class{constructor(){let r=document.createElement("div");r.className="mapboxgl-ctrl leaflet-control",r.style.borderStyle="solid",r.style.borderColor="#000",r.style.backgroundColor="#aaaaaaaa",r.style.padding="5px",this._div=r,this._canvas=document.createElement("canvas"),this._canvas.width=600,this._canvas.height=40,r.appendChild(this._canvas)}onAdd(){return this._div}onRemove(){this._div.parentNode?.removeChild(this._div)}drawLegend(r){let{_canvas:s}=this,{width:h,height:u}=s,c=16+u>>2,f=Ue(h-50,r),p=s.getContext("2d"),v=p.createImageData(h,u),g=new Uint32Array(v.data.buffer);g.fill(-1);let b=2,C=2,T=b+h*C,w=c>>1;if(f.showBelowMin){let S=f.colors[0];if(S)for(let x=0;x<w;++x)for(let M=w;M<w+x;++M)g[T+x+M*h]=S,g[T+x+(w*2-M)*h]=S}for(let S=0;S<f.size;++S)for(let x=0;x<c;++x)f.colors[0]&&(g[b+S+w+(x+C+1)*h]=f.colors[S]);if(f.showAboveMax){let S=f.colors[f.colors.length-1];if(S)for(let x=0;x<=w;++x)for(let M=w;M<w+x;++M)g[T+w*2+f.size-x+M*h]=S,g[T+w*2+f.size-x+(w*2-M)*h]=S}p.putImageData(v,0,0),p.font="8px sans-serif",p.beginPath();for(let S of f.ticks)p.strokeStyle="#000",p.moveTo(S.pos+w+b+1,C+3),p.lineTo(S.pos+w+b+1,c),p.fillText(S.dataString,S.pos+w+b+1,c+11);p.font="12px sans-serif",p.fillText(`(${f.units})`,13,u-5),p.stroke(),p.strokeStyle="#888",p.strokeRect(1,1,h-3,u-2)}clear(){let{_canvas:r}=this,{width:s,height:h}=r;r.getContext("2d").clearRect(0,0,s,h)}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var Ke=class{constructor(){this.parent=document.createElement("div"),this.parent.className="mapboxgl-ctrl leaflet-control",this.parent.style.borderStyle="solid",this.parent.style.borderColor="#000",this.parent.style.backgroundColor="#aaaaaaaa",this.parent.style.padding="5px",this.parent.onmousemove=this.parent.ondblclick=this.parent.onclick=v=>v.stopPropagation?.(),this.styleBase=zt().base;let r=vt(this.parent,"div",{onclick:onwheel,ondblclick:onwheel,onwheel,onmousedown,onmouseup}),s=vt(r,"button",{id:"customStyleButton",style:"height: 1.5em; background-color: gray",innerText:"Custom Style"}),h=vt(r,"div",{id:"customStyleDiv",style:"display: none; border-color: black; border-style: solid; border-width: 2px; background-color: rgba(135, 206, 250, 0.8)"});s.addEventListener("click",()=>{h.style.display!=="none"?(h.style.display="none",s.innerHTML="show Custom Style Editor"):(h.style.display="flex",s.innerHTML="update Custom Style & Hide")}),this.editorTextAreaEl=vt(h,"textarea",{id:"customStyleTextArea",style:"width: 20vw; height: 70vh"}),this.editorTextAreaEl.readOnly=!0,this.editorDivEl=vt(h,"div");let u=(v,g=!0)=>{vt(this.editorDivEl,"label",{htmlFor:v,id:v+"Label",className:v+"LabelClass",textContent:v.replace(/Input|Select$/i,"")}),g&&vt(this.editorDivEl,"br",{})},c=({id:v,type:g,min:b,max:C,step:T,onEvent:w="change",br:S=!0})=>{let x=vt(this.editorDivEl,"input",{id:v,className:v+"Class",type:g,min:b,max:C,step:T});return w!=="none"&&x.addEventListener(w,()=>this._onDivChange()),u(v,S),x},f=({id:v,opts:g,onEvent:b="change",br:C=!0})=>{let T=vt(this.editorDivEl,"select",{id:v,className:v+"Class"});return b!=="none"&&T.addEventListener(b,()=>this._onDivChange()),g.forEach(w=>T.options.add(vt(T,"option",{value:w,text:w}))),u(v,C),T.selectedIndex=0,T},p=v=>{let g=f({id:v+"Select",br:!1,opts:["inverted","fill","none","custom"]}),b=c({id:v+"Input",type:"color",onEvent:"none"});return b.addEventListener("change",()=>{g.value="custom",this._onDivChange()}),[g,b]};this.parentInput=c({id:"parentInput",type:"text"}),this.nameInput=c({id:"nameInput",type:"text"}),this.fillSelect=f({id:"fillSelect",opts:["gradient","solid","none"]}),[this.isolineColorSelect,this.isolineColorInput]=p("isolineColor"),this.isolineTextInput=c({id:"isolineTextInput",type:"checkbox"}),this.vectorFactorInput=c({id:"vectorFactorInput",type:"number",min:"0.1",max:"10",step:"0.1"}),this.vectorTypeSelect=f({id:"vectorTypeSelect",opts:["arrows","barbs","none"]}),[this.vectorColorSelect,this.vectorColorInput]=p("vectorColor"),[this.streamLineColorSelect,this.streamLineColorInput]=p("streamLineColor"),this.streamLineSpeedFactorInput=c({id:"streamLineSpeedFactorInput",type:"number",min:"0.1",max:"10",step:"0.1"}),this.streamLineStaticInput=c({id:"streamLineStaticInput",type:"checkbox"}),this.showBelowMinInput=c({id:"showBelowMinInput",type:"checkbox"}),this.showAboveMaxInput=c({id:"showAboveMaxInput",type:"checkbox"}),this.colorSchemeSelect=f({id:"colorSchemeSelect",opts:Object.keys(le()),onEvent:"none"}),this.colorSchemeSelect.addEventListener("change",()=>{let v=this.getStyle();delete v.colors,this._setStyleToTextArea(v),this.colorsInput.value="",this._onDivChange()}),this.colorsInput=c({id:"colorsInput",type:"text"}),this.colorMapInput=c({id:"colorMapInput",type:"text"}),this.levelsInput=c({id:"levelsInput",type:"text"}),this.blurRadiusInput=c({id:"blurRadiusInput",type:"range",onEvent:"input",min:"0",max:"10",step:"1"}),this.addDegreesInput=c({id:"addDegreesInput",type:"number",min:"0",max:"360",step:"1"}),this.unitsInput=c({id:"unitsInput",type:"text"}),this.extraUnitsInput=c({id:"extraUnitsInput",type:"text"}),this.maskSelect=f({id:"maskSelect",opts:["none","sea","land"]})}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}onAdd(){return this.parent}onRemove(){this.parent.parentNode?.removeChild(this.parent)}getStyle(){return this._getStyleFromDiv()}setStyle(r){r.colorMap&&(delete r.colors,delete r.levels),this._setStyleToDiv(r),this._setStyleToTextArea(this._getStyleFromDiv())}_getStyleFromDiv(){let r=u=>{try{return this[u].value?JSON.parse(this[u].value):void 0}catch(c){console.log(u," : parsing error: ",c);return}},s=(u,c)=>u.value==="custom"?c.value:u.value||void 0;return{parent:this.parentInput.value,name:this.nameInput.value||void 0,fill:this.fillSelect.value||void 0,isolineColor:s(this.isolineColorSelect,this.isolineColorInput),isolineText:this.isolineTextInput.checked,vectorType:this.vectorTypeSelect.value||void 0,vectorColor:s(this.vectorColorSelect,this.vectorColorInput),vectorFactor:+this.vectorFactorInput.value,streamLineColor:s(this.streamLineColorSelect,this.streamLineColorInput),streamLineSpeedFactor:+this.streamLineSpeedFactorInput.value,streamLineStatic:this.streamLineStaticInput.checked,showBelowMin:this.showBelowMinInput.checked,showAboveMax:this.showAboveMaxInput.checked,colorScheme:this.colorSchemeSelect.value||void 0,colors:r("colorsInput"),colorMap:r("colorMapInput"),levels:r("levelsInput"),blurRadius:+this.blurRadiusInput.value,addDegrees:+this.addDegreesInput.value,units:this.unitsInput.value||void 0,extraUnits:r("extraUnitsInput"),mask:this.maskSelect.value||void 0}}_setStyleToTextArea(r){this.editorTextAreaEl.value=JSON.stringify(Ui(r),null,2)}_setStyleToDiv(r){this.parentInput.value=r.parent||"",this.nameInput.value=r.name||"",this.fillSelect.value=r.fill||"",this.isolineColorSelect.value=r.isolineColor?.[0]==="#"?"custom":r.isolineColor||"",this.isolineColorInput.value=r.isolineColor?.[0]==="#"?r.isolineColor:"#000000",this.isolineTextInput.checked=r.isolineText||!1,this.vectorTypeSelect.value=r.vectorType||"",this.vectorColorSelect.value=r.vectorColor?.[0]==="#"?"custom":r.vectorColor||"",this.vectorColorInput.value=r.vectorColor?.[0]==="#"?r.vectorColor:"#000000",this.vectorFactorInput.value=r.vectorFactor?.toString()||"1",this.streamLineColorSelect.value=r.streamLineColor?.[0]==="#"?"custom":r.streamLineColor||"",this.streamLineColorInput.value=r.streamLineColor?.[0]==="#"?r.streamLineColor:"#000000",this.streamLineSpeedFactorInput.value=r.streamLineSpeedFactor?.toString()||"1",this.streamLineStaticInput.checked=r.streamLineStatic||!1,this.showBelowMinInput.checked=r.showBelowMin||!1,this.showAboveMaxInput.checked=r.showAboveMax||!1,this.colorSchemeSelect.value=r.colorScheme||"",this.colorsInput.value=r.colors?.length?JSON.stringify(r.colors):"",this.colorMapInput.value=r.colorMap?.length?JSON.stringify(r.colorMap):"",this.levelsInput.value=r.levels?.length?JSON.stringify(r.levels.map(s=>+s.toFixed(2))):"",this.blurRadiusInput.value=r.blurRadius?.toString()||"",this.addDegreesInput.value=r.addDegrees?.toString()||"",this.unitsInput.value=r.units||"",this.extraUnitsInput.value=r.extraUnits?JSON.stringify(r.extraUnits):"",this.maskSelect.value=r.mask||""}_onDivChange(){let r=this._getStyleFromDiv();Object.keys(r).forEach(s=>(r[s]===void 0||r[s]===""||!r[s].length)&&delete r[s]),this._setStyleToTextArea(r),this.onchange?.(this.getStyle())}};function vt(a,r,s){let h=document.createElement(r);return Object.assign(h,s),a?.appendChild(h),h}function Ui(a){return Array.isArray(a)?a.map(Ui):typeof a=="object"&&a!==null?Object.keys(a).sort((s,h)=>{let u=s.toUpperCase(),c=h.toUpperCase();return u==c?0:u>c?1:-1}).reduce((s,h)=>(s[h]=Ui(a[h]),s),{}):a}var Je=class{constructor(){let r=document.createElement("div");r.className="mapboxgl-ctrl leaflet-control",r.style.borderStyle="solid",r.style.borderColor="#000",r.style.backgroundColor="#aaaaaaaa",r.style.padding="5px",this.div=r}onAdd(){return this.div}onRemove(){this.div.parentNode?.removeChild(this.div)}update(r,s,h){if(!r){this.div.innerHTML="";return}let{min:u,max:c,units:f}=r.getMetadata(),{meta:p,datasetName:v}=r.wxdatasetManager,{sourceID:g,baseAtmosphericModel:b,model:C}=p;this.div.innerHTML=`lnglat=(${h.lng.toFixed(2)}, ${h.lat.toFixed(2)})<br>`,this.div.innerHTML+=g&&`sourceID=${g}<br>`||"",this.div.innerHTML+=b&&`baseAtmosphericModel=${b}<br>`||"",this.div.innerHTML+=C&&`model=${C}<br>`||"",this.div.innerHTML+=`dataset=${v}<br>
2
+ variables=${r.getVariables()}<br>
3
+ time=${r.getTime()}<br>
4
+ min=${u.toFixed(2)} ${f}, max=${c.toFixed(2)} ${f}<br>`;let T=r.getLayerInfoAtLatLon(h,s);T?this.div.innerHTML+=`style=${T.inStyleUnits.map(w=>w.toFixed(2))} ${T.styleUnits}<br>
5
+ source=${T.data.map(w=>w.toFixed(2))} ${T.dataUnits}<br>`:this.div.innerHTML+="style=outside<br>source=outside<br>"}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var Qe=class{constructor(r,s){this.delay=r;this.wxsource=s;this.onchange=()=>{};let h=document.createElement("div");h.className="mapboxgl-ctrl leaflet-control",h.style.borderStyle="solid",h.style.borderColor="#000",h.style.backgroundColor="#aaaaaaaa",h.style.padding="5px",h.style.display="flex",h.style.flexDirection="column",this._div=h,h.innerText="Time animation",this.button=document.createElement("button"),h.appendChild(this.button),this.timesEl=document.createElement("select"),h.appendChild(this.timesEl),this.timesEl.onchange=async()=>{this.timesEl.value=await this.wxsource?.setTime(this.timesEl.value)||"",this.onchange(this.timesEl.value)},this.wxsource&&this.updateSource(this.wxsource),this.button.innerHTML="Start";let u=0,c;this.button.onclick=()=>{if(this.button.innerHTML==="Start"){this.button.innerHTML="Stop",c=new AbortController;let f=async()=>{await this.wxsource?.setTime(u++%this.wxsource.wxdatasetManager.getTimes().length,c),this.timesEl.value=this.wxsource?.getTime()||"",this.onchange(this.timesEl.value),this.button.innerHTML==="Stop"&&setTimeout(f,this.delay)};f()}else this.button.innerHTML="Start",c.abort()}}setTimes(r){this.timesEl.options.length=0;for(let s=0;s<r.length;s++){let h=document.createElement("option");h.value=r[s],h.text=r[s],this.timesEl.appendChild(h)}this.onchange(this.timesEl.value)}updateSource(r){this.button.innerHTML="Start",this.wxsource=r,this.timesEl.options.length=0;let s=this.wxsource?.wxdatasetManager.getTimes()||[];this.setTimes(s),this.timesEl.value=this.wxsource.getTime()}onAdd(){return this._div}onRemove(){this._div.parentNode?.removeChild(this._div)}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var ti=class{constructor(r,s,h){this.wxapi=r;let u=document.createElement("div");u.className="mapboxgl-ctrl leaflet-control",u.style.borderStyle="solid",u.style.borderColor="#000",u.style.backgroundColor="#aaaaaaaa",u.style.padding="5px",u.style.display="flex",u.style.flexDirection="column",this._div=u;let c=document.createElement("label");c.innerText="Dataset",u.appendChild(c),this.datasets=document.createElement("select"),u.appendChild(this.datasets),this.fillDatasets(s,h),this.datasets.addEventListener("change",async()=>{await this.fillVariables(),await this.onchange?.(this.datasets.value,this.variables.value)});let f=document.createElement("label");f.innerText="Variable",u.appendChild(f),this.variables=document.createElement("select"),u.appendChild(this.variables),this.variables.addEventListener("change",()=>{this.onchange?.(this.datasets.value,this.variables.value)}),this.datasets.value=s||"",this.variables.value=h||""}async fillDatasets(r,s){this.datasets.options.length=0,(await this.wxapi.getAllDatasetsNames()).forEach(h=>{let u=document.createElement("option");u.value=h,u.text=h,this.datasets.appendChild(u)}),r&&(this.datasets.value=r),await this.fillVariables(s)}async fillVariables(r){this.variables.options.length=0;let s=this.datasets.value;(await this.wxapi.getDatasetVariables(s)).forEach(h=>{let u=document.createElement("option");u.value=h,u.text=h,this.variables.appendChild(u)}),r&&(this.variables.value=r)}onAdd(){return this._div}onRemove(){this._div.parentNode?.removeChild(this._div)}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};Is();var Ms=1;async function Is(){let a=await Ds();Mo(a,"baseS","baseL","https://tiles.metoceanapi.com/base-lines/{z}/{x}/{y}",5),Bi(!1);let r="https://tiles.metoceanapi.com/data/",s=new Headers,h=new ce({dataServerURL:r,maskURL:"none",qtreeURL:"none",requestInit:{headers:s}}),u="ww3-ecmwf.global",c=["wave.direction.mean"],p=window.location.toString().split("#")[1]?.split("/");u=p?.[0]||u,p?.[1]&&(c=p[1].split(","));let v=p?.[2]||"",g=p&&parseFloat(p[3])||0,b=p&&parseFloat(p[4])||0,C=p&&parseFloat(p[5])||0,T=p&&parseFloat(p[6])||0,w=p&&parseFloat(p[3])||0;ks(a,g,b,C,T,w),a.on("zoom",()=>fe(a,v,u,c)),a.on("drag",()=>fe(a,v,u,c)),a.on("rotate",()=>fe(a,v,u,c)),a.on("pitch",()=>fe(a,v,u,c));let S={id:"wxsource",opacity:Ms,attribution:"WxTiles"},x,M=new Ye;me(a,M,"top-right");let Z=new ti(h,u,c[0]);me(a,Z,"top-left");let F=new Qe(10);me(a,F,"top-left"),F.onchange=H=>fe(a,v=H,u,c);let N=new Ke;me(a,N,"top-left"),N.onchange=async H=>{if(!x)return;await x.updateCurrentStyleObject(H);let G=x.getCurrentStyleObjectCopy();M.drawLegend(G),N.setStyle(G)};let Q=new Je;me(a,Q,"bottom-left"),a.on("mousemove",H=>Q.update(x,a,Es(H))),Z.onchange=async(H,G)=>{Ws(a,S.id,x),x=void 0,u=H;let tt=await h.createDatasetManager(u),ft=tt.getVariableMeta(G);c=tt.checkCombineVariableIfVector(G),ft?.units==="RGB"?(Mo(a,S.id,"wxtiles",tt.createURI(c[0],0),tt.getMaxZoom()),F.setTimes(tt.getTimes()),M.clear()):(x=new de({wxdatasetManager:tt,variables:c},S),await As(a,S.id,"wxtiles",x),await N.onchange?.(x.getCurrentStyleObjectCopy()),M.drawLegend(x.getCurrentStyleObjectCopy()),F.updateSource(x))},await Z.onchange(u,c[0])}function ks(a,r,s,h,u,c){a.flyTo([h,s],r)}function fe(a,r,s,h){let u=a.getCenter();location.href=`#${s}/${h.join(",")}/${r}/${a.getZoom().toFixed(2)}/${u.lng.toFixed(2)}/${u.lat.toFixed(2)}`}async function Ds(){let a=pe.default.map("map",{center:[-40.75,174.5],zoom:3,zoomControl:!1});return pe.default.control.zoom({position:"bottomright"}).addTo(a),a}function me(a,r,s){s=s.replace("-",""),a.addControl(new(pe.default.Control.extend(r.extender()))({position:s}))}function Es(a){return a.latlng.wrap()}function Ws(a,r,s){a.eachLayer(h=>{h.options.id===r&&a.removeLayer(h)})}async function As(a,r,s,h){a.addLayer(h),await new Promise(u=>h.once("load",u))}function Mo(a,r,s,h,u){let c=pe.default.tileLayer(h,{id:r,maxNativeZoom:u,zIndex:s==="baseL"?100:0});a.addLayer(c)}})();
6
+ /* @preserve
7
+ * Leaflet 1.9.2, a JS library for interactive maps. https://leafletjs.com
8
+ * (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade
9
+ */
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@metoceanapi/wxtiles-leaflet",
3
- "version": "2.0.0",
3
+ "version": "2.0.4",
4
4
  "description": "WxTile JS lib to render wxtiles datalayers",
5
5
  "main": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "rm -rf dist/ && node build.js && tsc",
9
+ "buildForDocs": "node build-for-docs.js",
9
10
  "start": "PORT=3002 node watch-public.js",
10
11
  "preversion": "npm run build",
11
12
  "version": "changelogkeeper && git add CHANGELOG.md",