@metoceanapi/wxtiles-leaflet 2.1.1 → 2.1.3
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.
- package/CHANGELOG.md +2 -0
- package/dist/es/controls/WxStyleEditorControl.d.ts +5 -0
- package/dist/es/customlayer/customlayer.d.ts +2 -0
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +2 -2
- package/dist/es/utils/tests_wxtools.d.ts +1 -0
- package/dist/es/utils/wxtools.d.ts +22 -2
- package/dist/es/wxlayer/WxImplementation.d.ts +0 -5
- package/dist/es/wxlayer/loader.d.ts +0 -2
- package/dist/es/wxlayer/wxlayer.d.ts +3 -0
- package/dist/web/index.js +2 -2
- package/docs/docs/assets/main.js +56 -52
- package/docs/docs/assets/search.js +1 -1
- package/docs/docs/assets/style.css +27 -5
- package/docs/docs/classes/CustomWxTilesLayer.html +68 -0
- package/docs/docs/classes/DataIntegral.html +13 -13
- package/docs/docs/classes/Loader.html +5 -12
- package/docs/docs/classes/WxAPI.html +2 -2
- package/docs/docs/classes/WxLayer.html +35 -16
- package/docs/docs/classes/WxLayerBaseImplementation.html +19 -19
- package/docs/docs/classes/WxTileSource.html +18 -18
- package/docs/docs/functions/WXLOG.html +3 -2
- package/docs/docs/functions/WxCreateLegend.html +2 -1
- package/docs/docs/functions/WxGetColorSchemes.html +3 -2
- package/docs/docs/functions/WxGetColorStyles.html +3 -2
- package/docs/docs/functions/WxTilesLogging.html +3 -2
- package/docs/docs/index.html +2 -1
- package/docs/docs/interfaces/ColorStylesIncomplete.html +2 -1
- package/docs/docs/interfaces/Converter.html +2 -2
- package/docs/docs/interfaces/DataPicture.html +5 -5
- package/docs/docs/interfaces/IntegralPare.html +3 -3
- package/docs/docs/interfaces/WxAPIOptions.html +3 -3
- package/docs/docs/interfaces/WxColorSchemes.html +2 -1
- package/docs/docs/interfaces/WxColorStyleStrict.html +22 -0
- package/docs/docs/interfaces/WxColorStyleWeak.html +23 -0
- package/docs/docs/interfaces/WxColorStylesStrict.html +2 -2
- package/docs/docs/interfaces/WxColorStylesWeakMixed.html +2 -1
- package/docs/docs/interfaces/WxTilesLibOptions.html +4 -4
- package/docs/docs/interfaces/WxUnits.html +2 -1
- package/docs/docs/interfaces/WxVariablesMetas.html +2 -1
- package/docs/docs/modules.html +3 -1
- package/docs/docs/types/DataIntegrals.html +3 -2
- package/docs/docs/types/DataPictures.html +3 -2
- package/docs/docs/types/SLine.html +2 -1
- package/docs/docs/types/SubTrees.html +2 -1
- package/docs/docs/types/SubTreesN.html +2 -1
- package/docs/docs/types/TreeN.html +2 -1
- package/docs/docs/types/UriLoaderPromiseFunc.html +3 -2
- package/docs/docs/types/WxDate.html +2 -1
- package/docs/docs/types/WxURIs.html +2 -1
- package/docs/docs/types/WxUnitTuple.html +2 -1
- package/docs/docs/types/WxVars.html +2 -1
- package/docs/examples/seaMaskAndAnimatedBlur.html +2 -2
- package/docs/examples/simpleDemo.html +2 -2
- package/docs/script/script.js +3 -3
- package/package.json +6 -7
- package/src_example/start.ts +12 -9
- package/watch-public.mjs +99 -0
package/docs/script/script.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(()=>{var hs=Object.create;var ho=Object.defineProperty;var us=Object.getOwnPropertyDescriptor;var cs=Object.getOwnPropertyNames;var ds=Object.getPrototypeOf,fs=Object.prototype.hasOwnProperty;var ms=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var ps=(a,o,s,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let u of cs(o))!fs.call(a,u)&&u!==s&&ho(a,u,{get:()=>o[u],enumerable:!(l=us(o,u))||l.enumerable});return a};var uo=(a,o,s)=>(s=a!=null?hs(ds(a)):{},ps(o||!a||!a.__esModule?ho(s,"default",{value:a,enumerable:!0}):s,a));var Xi=ms((Je,Do)=>{(function(a,o){typeof Je=="object"&&typeof Do<"u"?o(Je):typeof define=="function"&&define.amd?define(["exports"],o):(a=typeof globalThis<"u"?globalThis:a||self,o(a.leaflet={}))})(Je,function(a){"use strict";var o="1.9.3";function s(t){var e,i,n,r;for(i=1,n=arguments.length;i<n;i++){r=arguments[i];for(e in r)t[e]=r[e]}return t}var l=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 m(t,e,i){var n,r,h,d;return d=function(){n=!1,r&&(h.apply(i,r),r=!1)},h=function(){n?r=arguments:(t.apply(i,arguments),setTimeout(d,e),n=!0)},h}function g(t,e,i){var n=e[1],r=e[0],h=n-r;return t===n&&i?t:((t-r)%h+h)%h+r}function v(){return!1}function y(t,e){if(e===!1)return t;var i=Math.pow(10,e===void 0?6:e);return Math.round(t*i)/i}function S(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function P(t){return S(t).split(/\s+/)}function w(t,e){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?l(t.options):{});for(var i in e)t.options[i]=e[i];return t.options}function C(t,e,i){var n=[];for(var r in t)n.push(encodeURIComponent(i?r.toUpperCase():r)+"="+encodeURIComponent(t[r]));return(!e||e.indexOf("?")===-1?"?":"&")+n.join("&")}var x=/\{ *([\w_ -]+) *\}/g;function I(t,e){return t.replace(x,function(i,n){var r=e[n];if(r===void 0)throw new Error("No value provided for variable "+i);return typeof r=="function"&&(r=r(e)),r})}var O=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 R="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function $(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var Y=0;function q(t){var e=+new Date,i=Math.max(0,16-(e-Y));return Y=e+i,window.setTimeout(t,i)}var j=window.requestAnimationFrame||$("RequestAnimationFrame")||q,rt=window.cancelAnimationFrame||$("CancelAnimationFrame")||$("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function H(t,e,i){if(i&&j===q)t.call(e);else return j.call(window,u(t,e))}function U(t){t&&rt.call(window,t)}var Le={__proto__:null,extend:s,create:l,bind:u,get lastId(){return c},stamp:f,throttle:m,wrapNum:g,falseFn:v,formatNum:y,trim:S,splitWords:P,setOptions:w,getParamString:C,template:I,isArray:O,indexOf:F,emptyImageUrl:R,requestFn:j,cancelFn:rt,requestAnimFrame:H,cancelAnimFrame:U};function mt(){}mt.extend=function(t){var e=function(){w(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,n=l(i);n.constructor=e,e.prototype=n;for(var r in this)Object.prototype.hasOwnProperty.call(this,r)&&r!=="prototype"&&r!=="__super__"&&(e[r]=this[r]);return t.statics&&s(e,t.statics),t.includes&&(xt(t.includes),s.apply(null,[n].concat(t.includes))),s(n,t),delete n.statics,delete n.includes,n.options&&(n.options=i.options?l(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 h=0,d=n._initHooks.length;h<d;h++)n._initHooks[h].call(this)}},e},mt.include=function(t){var e=this.prototype.options;return s(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},mt.mergeOptions=function(t){return s(this.prototype.options,t),this},mt.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 xt(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=O(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 ot={on:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e);else{t=P(t);for(var r=0,h=t.length;r<h;r++)this._on(t[r],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=P(t);for(var r=arguments.length===1,h=0,d=t.length;h<d;h++)r?this._off(t[h]):this._off(t[h],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 r={fn:e,ctx:i};n&&(r.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(r)}},_off:function(t,e,i){var n,r,h;if(!!this._events&&(n=this._events[t],!!n)){if(arguments.length===1){if(this._firingCount)for(r=0,h=n.length;r<h;r++)n[r].fn=v;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 p=n[d];this._firingCount&&(p.fn=v,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 r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var h=0,d=r.length;h<d;h++){var p=r[h],_=p.fn;p.once&&this.off(t,_,p.ctx),_.call(p.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 r=e;typeof e!="function"&&(n=!!e,r=void 0,i=void 0);var h=this._events&&this._events[t];if(h&&h.length&&this._listens(t,r,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 r=0,h=n.length;r<h;r++)if(n[r].fn===e&&n[r].ctx===i)return r;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=P(t);for(var r=0,h=t.length;r<h;r++)this._on(t[r],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)}};ot.addEventListener=ot.on,ot.removeEventListener=ot.clearAllEventListeners=ot.off,ot.addOneTimeEventListener=ot.once,ot.fireEvent=ot.fire,ot.hasEventListeners=ot.listens;var Ct=mt.extend(ot);function D(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var Te=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};D.prototype={clone:function(){return new D(this.x,this.y)},add:function(t){return this.clone()._add(E(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(E(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 D(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new D(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=Te(this.x),this.y=Te(this.y),this},distanceTo:function(t){t=E(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=E(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=E(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+y(this.x)+", "+y(this.y)+")"}};function E(t,e,i){return t instanceof D?t:O(t)?new D(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new D(t.x,t.y):new D(t,e,i)}function K(t,e){if(!!t)for(var i=e?[t,e]:t,n=0,r=i.length;n<r;n++)this.extend(i[n])}K.prototype={extend:function(t){var e,i;if(!t)return this;if(t instanceof D||typeof t[0]=="number"||"x"in t)e=i=E(t);else if(t=st(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 E((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return E(this.min.x,this.max.y)},getTopRight:function(){return E(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 D?t=E(t):t=st(t),t instanceof K?(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=st(t);var e=this.min,i=this.max,n=t.min,r=t.max,h=r.x>=e.x&&n.x<=i.x,d=r.y>=e.y&&n.y<=i.y;return h&&d},overlaps:function(t){t=st(t);var e=this.min,i=this.max,n=t.min,r=t.max,h=r.x>e.x&&n.x<i.x,d=r.y>e.y&&n.y<i.y;return h&&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,r=Math.abs(e.y-i.y)*t;return st(E(e.x-n,e.y-r),E(i.x+n,i.y+r))},equals:function(t){return t?(t=st(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function st(t,e){return!t||t instanceof K?t:new K(t,e)}function at(t,e){if(!!t)for(var i=e?[t,e]:t,n=0,r=i.length;n<r;n++)this.extend(i[n])}at.prototype={extend:function(t){var e=this._southWest,i=this._northEast,n,r;if(t instanceof V)n=t,r=t;else if(t instanceof at){if(n=t._southWest,r=t._northEast,!n||!r)return this}else return t?this.extend(G(t)||it(t)):this;return!e&&!i?(this._southWest=new V(n.lat,n.lng),this._northEast=new V(r.lat,r.lng)):(e.lat=Math.min(n.lat,e.lat),e.lng=Math.min(n.lng,e.lng),i.lat=Math.max(r.lat,i.lat),i.lng=Math.max(r.lng,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,r=Math.abs(e.lng-i.lng)*t;return new at(new V(e.lat-n,e.lng-r),new V(i.lat+n,i.lng+r))},getCenter:function(){return new V((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 V(this.getNorth(),this.getWest())},getSouthEast:function(){return new V(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 V||"lat"in t?t=G(t):t=it(t);var e=this._southWest,i=this._northEast,n,r;return t instanceof at?(n=t.getSouthWest(),r=t.getNorthEast()):n=r=t,n.lat>=e.lat&&r.lat<=i.lat&&n.lng>=e.lng&&r.lng<=i.lng},intersects:function(t){t=it(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),r=t.getNorthEast(),h=r.lat>=e.lat&&n.lat<=i.lat,d=r.lng>=e.lng&&n.lng<=i.lng;return h&&d},overlaps:function(t){t=it(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),r=t.getNorthEast(),h=r.lat>e.lat&&n.lat<i.lat,d=r.lng>e.lng&&n.lng<i.lng;return h&&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 at?t:new at(t,e)}function V(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)}V.prototype={equals:function(t,e){if(!t)return!1;t=G(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("+y(this.lat,t)+", "+y(this.lng,t)+")"},distanceTo:function(t){return It.distance(this,G(t))},wrap:function(){return It.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 V(this.lat,this.lng,this.alt)}};function G(t,e,i){return t instanceof V?t:O(t)&&typeof t[0]!="object"?t.length===3?new V(t[0],t[1],t[2]):t.length===2?new V(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new V(t.lat,"lng"in t?t.lng:t.lon,t.alt):e===void 0?null:new V(t,e,i)}var bt={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),r=this.transformation.transform(e.max,i);return new K(n,r)},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?g(t.lng,this.wrapLng,!0):t.lng,i=this.wrapLat?g(t.lat,this.wrapLat,!0):t.lat,n=t.alt;return new V(i,e,n)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,r=e.lng-i.lng;if(n===0&&r===0)return t;var h=t.getSouthWest(),d=t.getNorthEast(),p=new V(h.lat-n,h.lng-r),_=new V(d.lat-n,d.lng-r);return new at(p,_)}},It=s({},bt,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,r=e.lat*i,h=Math.sin((e.lat-t.lat)*i/2),d=Math.sin((e.lng-t.lng)*i/2),p=h*h+Math.cos(n)*Math.cos(r)*d*d,_=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p));return this.R*_}}),Ji=6378137,si={R:Ji,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),r=Math.sin(n*e);return new D(this.R*t.lng*e,this.R*Math.log((1+r)/(1-r))/2)},unproject:function(t){var e=180/Math.PI;return new V((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=Ji*Math.PI;return new K([-t,-t],[t,t])}()};function ai(t,e,i,n){if(O(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}ai.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 D((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};function Kt(t,e,i,n){return new ai(t,e,i,n)}var li=s({},It,{code:"EPSG:3857",projection:si,transformation:function(){var t=.5/(Math.PI*si.R);return Kt(t,.5,-t,.5)}()}),Ro=s({},li,{code:"EPSG:900913"});function Qi(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function tn(t,e){var i="",n,r,h,d,p,_;for(n=0,h=t.length;n<h;n++){for(p=t[n],r=0,d=p.length;r<d;r++)_=p[r],i+=(r?"L":"M")+_.x+" "+_.y;i+=e?W.svg?"z":"x":""}return i||"M0 0"}var hi=document.documentElement.style,Pe="ActiveXObject"in window,No=Pe&&!document.addEventListener,en="msLaunchUri"in navigator&&!("documentMode"in document),ui=pt("webkit"),nn=pt("android"),on=pt("android 2")||pt("android 3"),Fo=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Ho=nn&&pt("Google")&&Fo<537&&!("AudioNode"in window),ci=!!window.opera,rn=!en&&pt("chrome"),sn=pt("gecko")&&!ui&&!ci&&!Pe,Uo=!rn&&pt("safari"),an=pt("phantom"),ln="OTransition"in hi,Vo=navigator.platform.indexOf("Win")===0,hn=Pe&&"transition"in hi,di="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!on,un="MozPerspective"in hi,$o=!window.L_DISABLE_3D&&(hn||di||un)&&!ln&&!an,Jt=typeof orientation<"u"||pt("mobile"),qo=Jt&&ui,Go=Jt&&di,cn=!window.PointerEvent&&window.MSPointerEvent,dn=!!(window.PointerEvent||cn),fn="ontouchstart"in window||!!window.TouchEvent,Xo=!window.L_NO_TOUCH&&(fn||dn),jo=Jt&&ci,Yo=Jt&&sn,Ko=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Jo=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",v,e),window.removeEventListener("testPassiveEventSupport",v,e)}catch{}return t}(),Qo=function(){return!!document.createElement("canvas").getContext}(),fi=!!(document.createElementNS&&Qi("svg").createSVGRect),tr=!!fi&&function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),er=!fi&&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}}(),ir=navigator.platform.indexOf("Mac")===0,nr=navigator.platform.indexOf("Linux")===0;function pt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var W={ie:Pe,ielt9:No,edge:en,webkit:ui,android:nn,android23:on,androidStock:Ho,opera:ci,chrome:rn,gecko:sn,safari:Uo,phantom:an,opera12:ln,win:Vo,ie3d:hn,webkit3d:di,gecko3d:un,any3d:$o,mobile:Jt,mobileWebkit:qo,mobileWebkit3d:Go,msPointer:cn,pointer:dn,touch:Xo,touchNative:fn,mobileOpera:jo,mobileGecko:Yo,retina:Ko,passiveEvents:Jo,canvas:Qo,svg:fi,vml:er,inlineSvg:tr,mac:ir,linux:nr},mn=W.msPointer?"MSPointerDown":"pointerdown",pn=W.msPointer?"MSPointerMove":"pointermove",_n=W.msPointer?"MSPointerUp":"pointerup",gn=W.msPointer?"MSPointerCancel":"pointercancel",mi={touchstart:mn,touchmove:pn,touchend:_n,touchcancel:gn},vn={touchstart:hr,touchmove:Se,touchend:Se,touchcancel:Se},Ft={},yn=!1;function or(t,e,i){return e==="touchstart"&&lr(),vn[e]?(i=vn[e].bind(this,i),t.addEventListener(mi[e],i,!1),i):(console.warn("wrong event specified:",e),v)}function rr(t,e,i){if(!mi[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(mi[e],i,!1)}function sr(t){Ft[t.pointerId]=t}function ar(t){Ft[t.pointerId]&&(Ft[t.pointerId]=t)}function xn(t){delete Ft[t.pointerId]}function lr(){yn||(document.addEventListener(mn,sr,!0),document.addEventListener(pn,ar,!0),document.addEventListener(_n,xn,!0),document.addEventListener(gn,xn,!0),yn=!0)}function Se(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in Ft)e.touches.push(Ft[i]);e.changedTouches=[e],t(e)}}function hr(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&nt(e),Se(t,e)}function ur(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 cr=200;function dr(t,e){t.addEventListener("dblclick",e);var i=0,n;function r(h){if(h.detail!==1){n=h.detail;return}if(!(h.pointerType==="mouse"||h.sourceCapabilities&&!h.sourceCapabilities.firesTouchEvents)){var d=Pn(h);if(!(d.some(function(_){return _ instanceof HTMLLabelElement&&_.attributes.for})&&!d.some(function(_){return _ instanceof HTMLInputElement||_ instanceof HTMLSelectElement}))){var p=Date.now();p-i<=cr?(n++,n===2&&e(ur(h))):n=1,i=p}}}return t.addEventListener("click",r),{dblclick:e,simDblclick:r}}function fr(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var pi=Ie(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Qt=Ie(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),bn=Qt==="webkitTransition"||Qt==="OTransition"?Qt+"End":"transitionend";function wn(t){return typeof t=="string"?document.getElementById(t):t}function te(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 N(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function J(t){var e=t.parentNode;e&&e.removeChild(t)}function Me(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ht(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function Ut(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function _i(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=Ce(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function z(t,e){if(t.classList!==void 0)for(var i=P(e),n=0,r=i.length;n<r;n++)t.classList.add(i[n]);else if(!_i(t,e)){var h=Ce(t);gi(t,(h?h+" ":"")+e)}}function Q(t,e){t.classList!==void 0?t.classList.remove(e):gi(t,S((" "+Ce(t)+" ").replace(" "+e+" "," ")))}function gi(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e}function Ce(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function ht(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&mr(t,e)}function mr(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 Ie(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Et(t,e,i){var n=e||new D(0,0);t.style[pi]=(W.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function tt(t,e){t._leaflet_pos=e,W.any3d?Et(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function At(t){return t._leaflet_pos||new D(0,0)}var ee,ie,vi;if("onselectstart"in document)ee=function(){A(window,"selectstart",nt)},ie=function(){X(window,"selectstart",nt)};else{var ne=Ie(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(ne){var t=document.documentElement.style;vi=t[ne],t[ne]="none"}},ie=function(){ne&&(document.documentElement.style[ne]=vi,vi=void 0)}}function yi(){A(window,"dragstart",nt)}function xi(){X(window,"dragstart",nt)}var We,bi;function wi(t){for(;t.tabIndex===-1;)t=t.parentNode;!t.style||(ke(),We=t,bi=t.style.outline,t.style.outline="none",A(window,"keydown",ke))}function ke(){!We||(We.style.outline=bi,We=void 0,bi=void 0,X(window,"keydown",ke))}function Ln(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function Li(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var pr={__proto__:null,TRANSFORM:pi,TRANSITION:Qt,TRANSITION_END:bn,get:wn,getStyle:te,create:N,remove:J,empty:Me,toFront:Ht,toBack:Ut,hasClass:_i,addClass:z,removeClass:Q,setClass:gi,getClass:Ce,setOpacity:ht,testProp:Ie,setTransform:Et,setPosition:tt,getPosition:At,get disableTextSelection(){return ee},get enableTextSelection(){return ie},disableImageDrag:yi,enableImageDrag:xi,preventOutline:wi,restoreOutline:ke,getSizedParentNode:Ln,getScale:Li};function A(t,e,i,n){if(e&&typeof e=="object")for(var r in e)Pi(t,r,e[r],i);else{e=P(e);for(var h=0,d=e.length;h<d;h++)Pi(t,e[h],i,n)}return this}var _t="_leaflet_events";function X(t,e,i,n){if(arguments.length===1)Tn(t),delete t[_t];else if(e&&typeof e=="object")for(var r in e)Si(t,r,e[r],i);else if(e=P(e),arguments.length===2)Tn(t,function(p){return F(e,p)!==-1});else for(var h=0,d=e.length;h<d;h++)Si(t,e[h],i,n);return this}function Tn(t,e){for(var i in t[_t]){var n=i.split(/\d/)[0];(!e||e(n))&&Si(t,n,null,null,i)}}var Ti={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Pi(t,e,i,n){var r=e+f(i)+(n?"_"+f(n):"");if(t[_t]&&t[_t][r])return this;var h=function(p){return i.call(n||t,p||window.event)},d=h;!W.touchNative&&W.pointer&&e.indexOf("touch")===0?h=or(t,e,h):W.touch&&e==="dblclick"?h=dr(t,h):"addEventListener"in t?e==="touchstart"||e==="touchmove"||e==="wheel"||e==="mousewheel"?t.addEventListener(Ti[e]||e,h,W.passiveEvents?{passive:!1}:!1):e==="mouseenter"||e==="mouseleave"?(h=function(p){p=p||window.event,Ci(t,p)&&d(p)},t.addEventListener(Ti[e],h,!1)):t.addEventListener(e,d,!1):t.attachEvent("on"+e,h),t[_t]=t[_t]||{},t[_t][r]=h}function Si(t,e,i,n,r){r=r||e+f(i)+(n?"_"+f(n):"");var h=t[_t]&&t[_t][r];if(!h)return this;!W.touchNative&&W.pointer&&e.indexOf("touch")===0?rr(t,e,h):W.touch&&e==="dblclick"?fr(t,h):"removeEventListener"in t?t.removeEventListener(Ti[e]||e,h,!1):t.detachEvent("on"+e,h),t[_t][r]=null}function Ot(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Mi(t){return Pi(t,"wheel",Ot),this}function oe(t){return A(t,"mousedown touchstart dblclick contextmenu",Ot),t._leaflet_disable_click=!0,this}function nt(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function zt(t){return nt(t),Ot(t),this}function Pn(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function Sn(t,e){if(!e)return new D(t.clientX,t.clientY);var i=Li(e),n=i.boundingClientRect;return new D((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var _r=W.linux&&W.chrome?window.devicePixelRatio:W.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Mn(t){return W.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/_r: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 Ci(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 gr={__proto__:null,on:A,off:X,stopPropagation:Ot,disableScrollPropagation:Mi,disableClickPropagation:oe,preventDefault:nt,stop:zt,getPropagationPath:Pn,getMousePosition:Sn,getWheelDelta:Mn,isExternalTarget:Ci,addListener:A,removeListener:X},Cn=Ct.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=At(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=H(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(),tt(this._el,i),this.fire("step")},_complete:function(){U(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),B=Ct.extend({options:{crs:li,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(G(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Qt&&W.any3d&&!W.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),A(this._proxy,bn,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(G(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||(W.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(W.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),r=this.getSize().divideBy(2),h=t instanceof D?t:this.latLngToContainerPoint(t),d=h.subtract(r).multiplyBy(1-1/n),p=this.containerPointToLatLng(r.add(d));return this.setView(p,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():it(t);var i=E(e.paddingTopLeft||e.padding||[0,0]),n=E(e.paddingBottomRight||e.padding||[0,0]),r=this.getBoundsZoom(t,!1,i.add(n));if(r=typeof e.maxZoom=="number"?Math.min(e.maxZoom,r):r,r===1/0)return{center:t.getCenter(),zoom:r};var h=n.subtract(i).divideBy(2),d=this.project(t.getSouthWest(),r),p=this.project(t.getNorthEast(),r),_=this.unproject(d.add(p).divideBy(2).add(h),r);return{center:_,zoom:r}},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=E(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 Cn,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){z(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||!W.any3d)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),r=this.project(t),h=this.getSize(),d=this._zoom;t=G(t),e=e===void 0?d:e;var p=Math.max(h.x,h.y),_=p*this.getZoomScale(d,e),b=r.distanceTo(n)||1,M=1.42,k=M*M;function Z(et){var Ve=et?-1:1,rs=et?_:p,ss=_*_-p*p+Ve*k*k*b*b,as=2*rs*k*b,Ri=ss/as,lo=Math.sqrt(Ri*Ri+1)-Ri,ls=lo<1e-9?-18:Math.log(lo);return ls}function ct(et){return(Math.exp(et)-Math.exp(-et))/2}function Bt(et){return(Math.exp(et)+Math.exp(-et))/2}function Ue(et){return ct(et)/Bt(et)}var Dt=Z(0);function Bi(et){return p*(Bt(Dt)/Bt(Dt+M*et))}function es(et){return p*(Bt(Dt)*Ue(Dt+M*et)-ct(Dt))/k}function is(et){return 1-Math.pow(1-et,1.5)}var ns=Date.now(),so=(Z(1)-Dt)/M,os=i.duration?1e3*i.duration:1e3*so*.8;function ao(){var et=(Date.now()-ns)/os,Ve=is(et)*so;et<=1?(this._flyToFrame=H(ao,this),this._move(this.unproject(n.add(r.subtract(n).multiplyBy(es(Ve)/b)),d),this.getScaleZoom(p/Bi(Ve),d),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),ao.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=E(e.paddingTopLeft||e.padding||[0,0]),n=E(e.paddingBottomRight||e.padding||[0,0]),r=this.project(this.getCenter()),h=this.project(t),d=this.getPixelBounds(),p=st([d.min.add(i),d.max.subtract(n)]),_=p.getSize();if(!p.contains(h)){this._enforcingBounds=!0;var b=h.subtract(p.getCenter()),M=p.extend(h).getSize().subtract(_);r.x+=b.x<0?-M.x:M.x,r.y+=b.y<0?-M.y:M.y,this.panTo(this.unproject(r),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(),r=i.divideBy(2).round(),h=n.subtract(r);return!h.x&&!h.y?this:(t.animate&&t.pan?this.panBy(h):(t.pan&&this._rawPanBy(h),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 V(e,i),r=n.toBounds(t.coords.accuracy*2),h=this._locateOptions;if(h.setView){var d=this.getBoundsZoom(r);this.setView(n,h.maxZoom?Math.min(d,h.maxZoom):d)}var p={latlng:n,bounds:r,timestamp:t.timestamp};for(var _ in t.coords)typeof t.coords[_]=="number"&&(p[_]=t.coords[_]);this.fire("locationfound",p)}},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(),J(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(U(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)J(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=N("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 at(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=E(i||[0,0]);var n=this.getZoom()||0,r=this.getMinZoom(),h=this.getMaxZoom(),d=t.getNorthWest(),p=t.getSouthEast(),_=this.getSize().subtract(i),b=st(this.project(p,n),this.project(d,n)).getSize(),M=W.any3d?this.options.zoomSnap:1,k=_.x/b.x,Z=_.y/b.y,ct=e?Math.max(k,Z):Math.min(k,Z);return n=this.getScaleZoom(ct,n),M&&(n=Math.round(n/(M/100))*(M/100),n=e?Math.ceil(n/M)*M:Math.floor(n/M)*M),Math.max(r,Math.min(h,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new D(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 K(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(G(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(E(t),e)},layerPointToLatLng:function(t){var e=E(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(G(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(G(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(it(t))},distance:function(t,e){return this.options.crs.distance(G(t),G(e))},containerPointToLayerPoint:function(t){return E(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return E(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(E(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(G(t)))},mouseEventToContainerPoint:function(t){return Sn(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=wn(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");A(e,"scroll",this._onScroll,this),this._containerId=f(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&W.any3d,z(t,"leaflet-container"+(W.touch?" leaflet-touch":"")+(W.retina?" leaflet-retina":"")+(W.ielt9?" leaflet-oldie":"")+(W.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=te(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&e!=="sticky"&&(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),tt(this._mapPane,new D(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(z(t.markerPane,"leaflet-zoom-hide"),z(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){tt(this._mapPane,new D(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var r=this._zoom!==e;this._moveStart(r,i)._move(t,e)._moveEnd(r),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 r=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((r||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 U(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){tt(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?X:A;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),W.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){U(this._resizeRequest),this._resizeRequest=H(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,r=e==="mouseout"||e==="mouseover",h=t.target||t.srcElement,d=!1;h;){if(n=this._targets[f(h)],n&&(e==="click"||e==="preclick")&&this._draggableMoved(n)){d=!0;break}if(n&&n.listens(e,!0)&&(r&&!Ci(h,t)||(i.push(n),r))||h===this._container)break;h=h.parentNode}return!i.length&&!d&&!r&&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"&&wi(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 r=this._findEventTargets(t,e);if(i){for(var h=[],d=0;d<i.length;d++)i[d].listens(e,!0)&&h.push(i[d]);r=h.concat(r)}if(!!r.length){e==="contextmenu"&&nt(t);var p=r[0],_={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var b=p.getLatLng&&(!p._radius||p._radius<=10);_.containerPoint=b?this.latLngToContainerPoint(p.getLatLng()):this.mouseEventToContainerPoint(t),_.layerPoint=this.containerPointToLayerPoint(_.containerPoint),_.latlng=b?p.getLatLng():this.layerPointToLatLng(_.layerPoint)}for(d=0;d<r.length;d++)if(r[d].fire(e,_,!0),_.originalEvent._stopped||r[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 At(this._mapPane)||new D(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 st([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),r=this.getSize().divideBy(2),h=new K(n.subtract(r),n.add(r)),d=this._getBoundsOffset(h,i,e);return Math.abs(d.x)<=1&&Math.abs(d.y)<=1?t:this.unproject(n.add(d),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new K(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=st(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),r=n.min.subtract(t.min),h=n.max.subtract(t.max),d=this._rebound(r.x,-h.x),p=this._rebound(r.y,-h.y);return new D(d,p)},_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=W.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(){Q(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=N("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=pi,n=this._proxy.style[i];Et(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(){J(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Et(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),r=this._getCenterOffset(t)._divideBy(1-1/n);return i.animate!==!0&&!this.getSize().contains(r)?!1:(H(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,z(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&&Q(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 vr(t,e){return new B(t,e)}var dt=mt.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 z(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?(J(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()}}),re=function(t){return new dt(t)};B.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=N("div",e+"control-container",this._container);function n(r,h){var d=e+r+" "+e+h;t[r+h]=N("div",d,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)J(this._controlCorners[t]);J(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var In=dt.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 dt.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(){z(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?(z(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):Q(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Q(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=N("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),oe(e),Mi(e);var n=this._section=N("section",t+"-list");i&&(this._map.on("click",this.collapse,this),A(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var r=this._layersLink=N("a",t+"-toggle",e);r.href="#",r.title="Layers",r.setAttribute("role","button"),A(r,{keydown:function(h){h.keyCode===13&&this._expandSafely()},click:function(h){nt(h),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=N("div",t+"-base",n),this._separator=N("div",t+"-separator",n),this._overlaysList=N("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,r){return this.options.sortFunction(n.layer,r.layer,n.name,r.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Me(this._baseLayersList),Me(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,r=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,r+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&r>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),A(n,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var h=document.createElement("span");e.appendChild(h),h.appendChild(n),h.appendChild(r);var d=t.overlay?this._overlaysList:this._baseLayersList;return d.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t=this._layerControlInputs,e,i,n=[],r=[];this._handlingClick=!0;for(var h=t.length-1;h>=0;h--)e=t[h],i=this._getLayer(e.layerId).layer,e.checked?n.push(i):e.checked||r.push(i);for(h=0;h<r.length;h++)this._map.hasLayer(r[h])&&this._map.removeLayer(r[h]);for(h=0;h<n.length;h++)this._map.hasLayer(n[h])||this._map.addLayer(n[h]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,e,i,n=this._map.getZoom(),r=t.length-1;r>=0;r--)e=t[r],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},_expandSafely:function(){var t=this._section;A(t,"click",nt),this.expand(),setTimeout(function(){X(t,"click",nt)})}}),yr=function(t,e,i){return new In(t,e,i)},Ii=dt.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=N("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,r){var h=N("a",i,n);return h.innerHTML=t,h.href="#",h.title=e,h.setAttribute("role","button"),h.setAttribute("aria-label",e),oe(h),A(h,"click",zt),A(h,"click",r,this),A(h,"click",this._refocusOnMap,this),h},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";Q(this._zoomInButton,e),Q(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(z(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(z(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});B.mergeOptions({zoomControl:!0}),B.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ii,this.addControl(this.zoomControl))});var xr=function(t){return new Ii(t)},Wn=dt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=N("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=N("div",e,i)),t.imperial&&(this._iScale=N("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,r;e>5280?(i=e/5280,n=this._getRoundNum(i),this._updateScale(this._iScale,n+" mi",n/i)):(r=this._getRoundNum(e),this._updateScale(this._iScale,r+" ft",r/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}}),br=function(t){return new Wn(t)},wr='<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>',Wi=dt.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(W.inlineSvg?wr+" ":"")+"Leaflet</a>"},initialize:function(t){w(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=N("div","leaflet-control-attribution"),oe(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> ')}}});B.mergeOptions({attributionControl:!0}),B.addInitHook(function(){this.options.attributionControl&&new Wi().addTo(this)});var Lr=function(t){return new Wi(t)};dt.Layers=In,dt.Zoom=Ii,dt.Scale=Wn,dt.Attribution=Wi,re.layers=yr,re.zoom=xr,re.scale=br,re.attribution=Lr;var gt=mt.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}});gt.addTo=function(t,e){return t.addHandler(e,this),this};var Tr={Events:ot},kn=W.touch?"touchstart mousedown":"mousedown",Wt=Ct.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||(A(this._dragStartTarget,kn,this._onDown,this),this._enabled=!0)},disable:function(){!this._enabled||(Wt._dragging===this&&this.finishDrag(!0),X(this._dragStartTarget,kn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!!this._enabled&&(this._moved=!1,!_i(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){Wt._dragging===this&&this.finishDrag();return}if(!(Wt._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(Wt._dragging=this,this._preventOutline&&wi(this._element),yi(),ee(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,i=Ln(this._element);this._startPoint=new D(e.clientX,e.clientY),this._startPos=At(this._element),this._parentScale=Li(i);var n=t.type==="mousedown";A(document,n?"mousemove":"touchmove",this._onMove,this),A(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 D(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,z(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),z(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),tt(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){!this._enabled||this.finishDrag()},finishDrag:function(t){Q(document.body,"leaflet-dragging"),this._lastTarget&&(Q(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),X(document,"mousemove touchmove",this._onMove,this),X(document,"mouseup touchend touchcancel",this._onUp,this),xi(),ie(),this._moved&&this._moving&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)}),this._moving=!1,Wt._dragging=!1}});function Dn(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Mr(t,i),t=Sr(t,i),t}function En(t,e,i){return Math.sqrt(se(t,e,i,!0))}function Pr(t,e,i){return se(t,e,i)}function Sr(t,e){var i=t.length,n=typeof Uint8Array!=void 0+""?Uint8Array:Array,r=new n(i);r[0]=r[i-1]=1,ki(t,r,e,0,i-1);var h,d=[];for(h=0;h<i;h++)r[h]&&d.push(t[h]);return d}function ki(t,e,i,n,r){var h=0,d,p,_;for(p=n+1;p<=r-1;p++)_=se(t[p],t[n],t[r],!0),_>h&&(d=p,h=_);h>i&&(e[d]=1,ki(t,e,i,n,d),ki(t,e,i,d,r))}function Mr(t,e){for(var i=[t[0]],n=1,r=0,h=t.length;n<h;n++)Cr(t[n],t[r])>e&&(i.push(t[n]),r=n);return r<h-1&&i.push(t[h-1]),i}var An;function On(t,e,i,n,r){var h=n?An:Zt(t,i),d=Zt(e,i),p,_,b;for(An=d;;){if(!(h|d))return[t,e];if(h&d)return!1;p=h||d,_=De(t,e,p,i,r),b=Zt(_,i),p===h?(t=_,h=b):(e=_,d=b)}}function De(t,e,i,n,r){var h=e.x-t.x,d=e.y-t.y,p=n.min,_=n.max,b,M;return i&8?(b=t.x+h*(_.y-t.y)/d,M=_.y):i&4?(b=t.x+h*(p.y-t.y)/d,M=p.y):i&2?(b=_.x,M=t.y+d*(_.x-t.x)/h):i&1&&(b=p.x,M=t.y+d*(p.x-t.x)/h),new D(b,M,r)}function Zt(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 Cr(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function se(t,e,i,n){var r=e.x,h=e.y,d=i.x-r,p=i.y-h,_=d*d+p*p,b;return _>0&&(b=((t.x-r)*d+(t.y-h)*p)/_,b>1?(r=i.x,h=i.y):b>0&&(r+=d*b,h+=p*b)),d=t.x-r,p=t.y-h,n?d*d+p*p:new D(r,h)}function ut(t){return!O(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function zn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ut(t)}function Zn(t,e){var i,n,r,h,d,p,_,b;if(!t||t.length===0)throw new Error("latlngs not passed");ut(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var M=[];for(var k in t)M.push(e.project(G(t[k])));var Z=M.length;for(i=0,n=0;i<Z-1;i++)n+=M[i].distanceTo(M[i+1])/2;if(n===0)b=M[0];else for(i=0,h=0;i<Z-1;i++)if(d=M[i],p=M[i+1],r=d.distanceTo(p),h+=r,h>n){_=(h-n)/r,b=[p.x-_*(p.x-d.x),p.y-_*(p.y-d.y)];break}return e.unproject(E(b))}var Ir={__proto__:null,simplify:Dn,pointToSegmentDistance:En,closestPointOnSegment:Pr,clipSegment:On,_getEdgeIntersection:De,_getBitCode:Zt,_sqClosestPointOnSegment:se,isFlat:ut,_flat:zn,polylineCenter:Zn};function Bn(t,e,i){var n,r=[1,4,2,8],h,d,p,_,b,M,k,Z;for(h=0,M=t.length;h<M;h++)t[h]._code=Zt(t[h],e);for(p=0;p<4;p++){for(k=r[p],n=[],h=0,M=t.length,d=M-1;h<M;d=h++)_=t[h],b=t[d],_._code&k?b._code&k||(Z=De(b,_,k,e,i),Z._code=Zt(Z,e),n.push(Z)):(b._code&k&&(Z=De(b,_,k,e,i),Z._code=Zt(Z,e),n.push(Z)),n.push(_));t=n}return t}function Rn(t,e){var i,n,r,h,d,p,_,b,M;if(!t||t.length===0)throw new Error("latlngs not passed");ut(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var k=[];for(var Z in t)k.push(e.project(G(t[Z])));var ct=k.length;for(p=_=b=0,i=0,n=ct-1;i<ct;n=i++)r=k[i],h=k[n],d=r.y*h.x-h.y*r.x,_+=(r.x+h.x)*d,b+=(r.y+h.y)*d,p+=d*3;return p===0?M=k[0]:M=[_/p,b/p],e.unproject(E(M))}var Wr={__proto__:null,clipPolygon:Bn,polygonCenter:Rn},Di={project:function(t){return new D(t.lng,t.lat)},unproject:function(t){return new V(t.y,t.x)},bounds:new K([-180,-90],[180,90])},Ei={R:6378137,R_MINOR:6356752314245179e-9,bounds:new K([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,r=this.R_MINOR/i,h=Math.sqrt(1-r*r),d=h*Math.sin(n),p=Math.tan(Math.PI/4-n/2)/Math.pow((1-d)/(1+d),h/2);return n=-i*Math.log(Math.max(p,1e-10)),new D(t.lng*e*i,n)},unproject:function(t){for(var e=180/Math.PI,i=this.R,n=this.R_MINOR/i,r=Math.sqrt(1-n*n),h=Math.exp(-t.y/i),d=Math.PI/2-2*Math.atan(h),p=0,_=.1,b;p<15&&Math.abs(_)>1e-7;p++)b=r*Math.sin(d),b=Math.pow((1-b)/(1+b),r/2),_=Math.PI/2-2*Math.atan(h*b)-d,d+=_;return new V(d*e,t.x*e/i)}},kr={__proto__:null,LonLat:Di,Mercator:Ei,SphericalMercator:si},Dr=s({},It,{code:"EPSG:3395",projection:Ei,transformation:function(){var t=.5/(Math.PI*Ei.R);return Kt(t,.5,-t,.5)}()}),Nn=s({},It,{code:"EPSG:4326",projection:Di,transformation:Kt(1/180,1,-1/180,.5)}),Er=s({},bt,{projection:Di,transformation:Kt(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});bt.Earth=It,bt.EPSG3395=Dr,bt.EPSG3857=li,bt.EPSG900913=Ro,bt.EPSG4326=Nn,bt.Simple=Er;var ft=Ct.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})}}});B.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?O(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 r=this._zoomBoundLayers[n].options;t=r.minZoom===void 0?t:Math.min(t,r.minZoom),e=r.maxZoom===void 0?e:Math.max(e,r.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 Vt=ft.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)}}),Ar=function(t,e){return new Vt(t,e)},wt=Vt.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Vt.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),Vt.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 at;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Or=function(t,e){return new wt(t,e)},$t=mt.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 r=E(n),h=E(e==="shadow"&&i.shadowAnchor||i.iconAnchor||r&&r.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),h&&(t.style.marginLeft=-h.x+"px",t.style.marginTop=-h.y+"px"),r&&(t.style.width=r.x+"px",t.style.height=r.y+"px")},_createImg:function(t,e){return e=e||document.createElement("img"),e.src=t,e},_getIconUrl:function(t){return W.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function zr(t){return new $t(t)}var ae=$t.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 ae.imagePath!="string"&&(ae.imagePath=this._detectIconPath()),(this.options.imagePath||ae.imagePath)+$t.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(i,n,r){var h=n.exec(i);return h&&h[r]};return t=e(t,/^url\((['"])?(.+)\1\)$/,2),t&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=N("div","leaflet-default-icon-path",document.body),e=te(t,"background-image")||te(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):""}}),Fn=gt.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Wt(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),z(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&&Q(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,r=this._marker.options.autoPanPadding,h=At(e._icon),d=i.getPixelBounds(),p=i.getPixelOrigin(),_=st(d.min._subtract(p).add(r),d.max._subtract(p).subtract(r));if(!_.contains(h)){var b=E((Math.max(_.max.x,h.x)-_.max.x)/(d.max.x-_.max.x)-(Math.min(_.min.x,h.x)-_.min.x)/(d.min.x-_.min.x),(Math.max(_.max.y,h.y)-_.max.y)/(d.max.y-_.max.y)-(Math.min(_.min.y,h.y)-_.min.y)/(d.min.y-_.min.y)).multiplyBy(n);i.panBy(b,{animate:!1}),this._draggable._newPos._add(b),this._draggable._startPos._add(b),tt(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=H(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&&(U(this._panRequest),this._panRequest=H(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=At(e._icon),r=e._map.layerPointToLatLng(n);i&&tt(i,n),e._latlng=r,t.latlng=r,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){U(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ee=ft.extend({options:{icon:new ae,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=G(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=G(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||"")),z(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&&A(i,"focus",this._panOnFocus,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&(z(r,e),r.alt=""),this._shadow=r,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),r&&h&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&X(this._icon,"focus",this._panOnFocus,this),J(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&J(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&tt(this._icon,t),this._shadow&&tt(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&&(z(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Fn)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Fn(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&&ht(this._icon,t),this._shadow&&ht(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?E(e.iconSize):E(0,0),n=e.iconAnchor?E(e.iconAnchor):E(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 Zr(t,e){return new Ee(t,e)}var kt=ft.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)}}),Ae=kt.extend({options:{fill:!0,radius:10},initialize:function(t,e){w(this,e),this._latlng=G(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=G(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 kt.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 K(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 Br(t,e){return new Ae(t,e)}var Ai=Ae.extend({initialize:function(t,e,i){if(typeof e=="number"&&(e=s({},i,{radius:e})),w(this,e),this._latlng=G(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 at(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:kt.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===It.distance){var r=Math.PI/180,h=this._mRadius/It.R/r,d=i.project([e+h,t]),p=i.project([e-h,t]),_=d.add(p).divideBy(2),b=i.unproject(_).lat,M=Math.acos((Math.cos(h*r)-Math.sin(e*r)*Math.sin(b*r))/(Math.cos(e*r)*Math.cos(b*r)))/r;(isNaN(M)||M===0)&&(M=h/Math.cos(Math.PI/180*e)),this._point=_.subtract(i.getPixelOrigin()),this._radius=isNaN(M)?0:_.x-i.project([b,t-M]).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 Rr(t,e,i){return new Ai(t,e,i)}var Lt=kt.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=se,r,h,d=0,p=this._parts.length;d<p;d++)for(var _=this._parts[d],b=1,M=_.length;b<M;b++){r=_[b-1],h=_[b];var k=n(t,r,h,!0);k<e&&(e=k,i=n(t,r,h))}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 Zn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=G(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new at,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return ut(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=ut(t),n=0,r=t.length;n<r;n++)i?(e[n]=G(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new K;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 D(t,t);!this._rawPxBounds||(this._pxBounds=new K([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,i){var n=t[0]instanceof V,r=t.length,h,d;if(n){for(d=[],h=0;h<r;h++)d[h]=this._map.latLngToLayerPoint(t[h]),i.extend(d[h]);e.push(d)}else for(h=0;h<r;h++)this._projectLatlngs(t[h],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,r,h,d,p,_;for(i=0,r=0,h=this._rings.length;i<h;i++)for(_=this._rings[i],n=0,d=_.length;n<d-1;n++)p=On(_[n],_[n+1],t,n,!0),p&&(e[r]=e[r]||[],e[r].push(p[0]),(p[1]!==_[n+1]||n===d-2)&&(e[r].push(p[1]),r++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=Dn(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,r,h,d,p,_=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,h=this._parts.length;i<h;i++)for(p=this._parts[i],n=0,d=p.length,r=d-1;n<d;r=n++)if(!(!e&&n===0)&&En(t,p[r],p[n])<=_)return!0;return!1}});function Nr(t,e){return new Lt(t,e)}Lt._flat=zn;var qt=Lt.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 Rn(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=Lt.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof V&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Lt.prototype._setLatLngs.call(this,t),ut(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ut(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new D(e,e);if(t=new K(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,r=this._rings.length,h;n<r;n++)h=Bn(this._rings[n],t,!0),h.length&&this._parts.push(h)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e=!1,i,n,r,h,d,p,_,b;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(h=0,_=this._parts.length;h<_;h++)for(i=this._parts[h],d=0,b=i.length,p=b-1;d<b;p=d++)n=i[d],r=i[p],n.y>t.y!=r.y>t.y&&t.x<(r.x-n.x)*(t.y-n.y)/(r.y-n.y)+n.x&&(e=!e);return e||Lt.prototype._containsPoint.call(this,t,!0)}});function Fr(t,e){return new qt(t,e)}var Tt=wt.extend({initialize:function(t,e){w(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=O(t)?t:t.features,i,n,r;if(e){for(i=0,n=e.length;i<n;i++)r=e[i],(r.geometries||r.geometry||r.features||r.coordinates)&&this.addData(r);return this}var h=this.options;if(h.filter&&!h.filter(t))return this;var d=Oe(t,h);return d?(d.feature=Be(t),d.defaultOptions=d.options,this.resetStyle(d),h.onEachFeature&&h.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 Oe(t,e){var i=t.type==="Feature"?t.geometry:t,n=i?i.coordinates:null,r=[],h=e&&e.pointToLayer,d=e&&e.coordsToLatLng||Oi,p,_,b,M;if(!n&&!i)return null;switch(i.type){case"Point":return p=d(n),Hn(h,t,p,e);case"MultiPoint":for(b=0,M=n.length;b<M;b++)p=d(n[b]),r.push(Hn(h,t,p,e));return new wt(r);case"LineString":case"MultiLineString":return _=ze(n,i.type==="LineString"?0:1,d),new Lt(_,e);case"Polygon":case"MultiPolygon":return _=ze(n,i.type==="Polygon"?1:2,d),new qt(_,e);case"GeometryCollection":for(b=0,M=i.geometries.length;b<M;b++){var k=Oe({geometry:i.geometries[b],type:"Feature",properties:t.properties},e);k&&r.push(k)}return new wt(r);case"FeatureCollection":for(b=0,M=i.features.length;b<M;b++){var Z=Oe(i.features[b],e);Z&&r.push(Z)}return new wt(r);default:throw new Error("Invalid GeoJSON object.")}}function Hn(t,e,i,n){return t?t(e,i):new Ee(i,n&&n.markersInheritOptions&&n)}function Oi(t){return new V(t[1],t[0],t[2])}function ze(t,e,i){for(var n=[],r=0,h=t.length,d;r<h;r++)d=e?ze(t[r],e-1,i):(i||Oi)(t[r]),n.push(d);return n}function zi(t,e){return t=G(t),t.alt!==void 0?[y(t.lng,e),y(t.lat,e),y(t.alt,e)]:[y(t.lng,e),y(t.lat,e)]}function Ze(t,e,i,n){for(var r=[],h=0,d=t.length;h<d;h++)r.push(e?Ze(t[h],ut(t[h])?0:e-1,i,n):zi(t[h],n));return!e&&i&&r.push(r[0].slice()),r}function Gt(t,e){return t.feature?s({},t.feature,{geometry:e}):Be(e)}function Be(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Zi={toGeoJSON:function(t){return Gt(this,{type:"Point",coordinates:zi(this.getLatLng(),t)})}};Ee.include(Zi),Ai.include(Zi),Ae.include(Zi),Lt.include({toGeoJSON:function(t){var e=!ut(this._latlngs),i=Ze(this._latlngs,e?1:0,!1,t);return Gt(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),qt.include({toGeoJSON:function(t){var e=!ut(this._latlngs),i=e&&!ut(this._latlngs[0]),n=Ze(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),Gt(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Vt.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),Gt(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(r){if(r.toGeoJSON){var h=r.toGeoJSON(t);if(i)n.push(h.geometry);else{var d=Be(h);d.type==="FeatureCollection"?n.push.apply(n,d.features):n.push(d)}}}),i?Gt(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});function Un(t,e){return new Tt(t,e)}var Hr=Un,Re=ft.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&&(z(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){J(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&&Ht(this._image),this},bringToBack:function(){return this._map&&Ut(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:N("img");if(z(e,"leaflet-image-layer"),this._zoomAnimated&&z(e,"leaflet-zoom-animated"),this.options.className&&z(e,this.options.className),e.onselectstart=v,e.onmousemove=v,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;Et(this._image,i,e)},_reset:function(){var t=this._image,e=new K(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();tt(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){ht(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()}}),Ur=function(t,e,i){return new Re(t,e,i)},Vn=Re.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:N("video");if(z(e,"leaflet-image-layer"),this._zoomAnimated&&z(e,"leaflet-zoom-animated"),this.options.className&&z(e,this.options.className),e.onselectstart=v,e.onmousemove=v,e.onloadeddata=u(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],r=0;r<i.length;r++)n.push(i[r].src);this._url=i.length>0?n:[e.src];return}O(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 h=0;h<this._url.length;h++){var d=N("source");d.src=this._url[h],e.appendChild(d)}}});function Vr(t,e,i){return new Vn(t,e,i)}var $n=Re.extend({_initImage:function(){var t=this._image=this._url;z(t,"leaflet-image-layer"),this._zoomAnimated&&z(t,"leaflet-zoom-animated"),this.options.className&&z(t,this.options.className),t.onselectstart=v,t.onmousemove=v}});function $r(t,e,i){return new $n(t,e,i)}var vt=ft.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof V||O(t))?(this._latlng=G(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&&ht(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&ht(this._container,1),this.bringToFront(),this.options.interactive&&(z(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(ht(this._container,0),this._removeTimeout=setTimeout(u(J,void 0,this._container),200)):J(this._container),this.options.interactive&&(Q(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=G(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&&Ht(this._container),this},bringToBack:function(){return this._map&&Ut(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof wt){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=E(this.options.offset),i=this._getAnchor();this._zoomAnimated?tt(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,r=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=r+"px"}},_getAnchor:function(){return[0,0]}});B.include({_initOverlay:function(t,e,i,n){var r=e;return r instanceof t||(r=new t(n).setContent(e)),i&&r.setLatLng(i),r}}),ft.include({_initOverlay:function(t,e,i,n){var r=i;return r instanceof t?(w(r,n),r._source=this):(r=e&&!n?e:new t(n,this),r.setContent(i)),r}});var Ne=vt.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,vt.prototype.openOn.call(this,t)},onAdd:function(t){vt.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof kt||this._source.on("preclick",Ot))},onRemove:function(t){vt.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof kt||this._source.off("preclick",Ot))},getEvents:function(){var t=vt.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=N("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=N("div",t+"-content-wrapper",e);if(this._contentNode=N("div",t+"-content",i),oe(e),Mi(this._contentNode),A(e,"contextmenu",Ot),this._tipContainer=N("div",t+"-tip-container",e),this._tip=N("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=N("a",t+"-close-button",e);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">×</span>',A(n,"click",function(r){nt(r),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,r=this.options.maxHeight,h="leaflet-popup-scrolled";r&&n>r?(e.height=r+"px",z(t,h)):Q(t,h),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();tt(this._container,e.add(i))},_adjustPan:function(){if(!!this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(te(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,r=new D(this._containerLeft,-i-this._containerBottom);r._add(At(this._container));var h=t.layerPointToContainerPoint(r),d=E(this.options.autoPanPadding),p=E(this.options.autoPanPaddingTopLeft||d),_=E(this.options.autoPanPaddingBottomRight||d),b=t.getSize(),M=0,k=0;h.x+n+_.x>b.x&&(M=h.x+n-b.x+_.x),h.x-M-p.x<0&&(M=h.x-p.x),h.y+i+_.y>b.y&&(k=h.y+i-b.y+_.y),h.y-k-p.y<0&&(k=h.y-p.y),(M||k)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([M,k]))}},_getAnchor:function(){return E(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),qr=function(t,e){return new Ne(t,e)};B.mergeOptions({closePopupOnClick:!0}),B.include({openPopup:function(t,e,i){return this._initOverlay(Ne,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),ft.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Ne,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 instanceof wt||(this._popup._source=this),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)){zt(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof kt)){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 Fe=vt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){vt.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){vt.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=vt.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=N("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,r=this._container,h=n.latLngToContainerPoint(n.getCenter()),d=n.layerPointToContainerPoint(t),p=this.options.direction,_=r.offsetWidth,b=r.offsetHeight,M=E(this.options.offset),k=this._getAnchor();p==="top"?(e=_/2,i=b):p==="bottom"?(e=_/2,i=0):p==="center"?(e=_/2,i=b/2):p==="right"?(e=0,i=b/2):p==="left"?(e=_,i=b/2):d.x<h.x?(p="right",e=0,i=b/2):(p="left",e=_+(M.x+k.x)*2,i=b/2),t=t.subtract(E(e,i,!0)).add(M).add(k),Q(r,"leaflet-tooltip-right"),Q(r,"leaflet-tooltip-left"),Q(r,"leaflet-tooltip-top"),Q(r,"leaflet-tooltip-bottom"),z(r,"leaflet-tooltip-"+p),tt(r,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&ht(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return E(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Gr=function(t,e){return new Fe(t,e)};B.include({openTooltip:function(t,e,i){return this._initOverlay(Fe,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),ft.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Fe,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 instanceof wt||(this._tooltip._source=this),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&&(A(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),A(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 qn=$t.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?(Me(e),e.appendChild(i.html)):e.innerHTML=i.html!==!1?i.html:"",i.bgPos){var n=E(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Xr(t){return new qn(t)}$t.Default=ae;var le=ft.extend({options:{tileSize:256,opacity:1,updateWhenIdle:W.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(),J(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Ht(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ut(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=m(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 D?t:new D(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,r=e.length,h;n<r;n++)h=e[n].style.zIndex,e[n]!==this._container&&h&&(i=t(i,+h));isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(!!this._map&&!W.ielt9){ht(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var r=this._tiles[n];if(!(!r.current||!r.loaded)){var h=Math.min(1,(t-r.loaded)/200);ht(r.el,h),h<1?e=!0:(r.active?i=!0:this._onOpaqueTile(r),r.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(U(this._fadeFrame),this._fadeFrame=H(this._updateOpacity,this))}},_onOpaqueTile:v,_initContainer:function(){this._container||(this._container=N("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)):(J(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],r=this._map;return n||(n=this._levels[t]={},n.el=N("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=r.project(r.unproject(r.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,r.getCenter(),r.getZoom()),v(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:v,_onRemoveLevel:v,_onCreateLevel:v,_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)J(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 r=Math.floor(t/2),h=Math.floor(e/2),d=i-1,p=new D(+r,+h);p.z=+d;var _=this._tileCoordsToKey(p),b=this._tiles[_];return b&&b.active?(b.retain=!0,!0):(b&&b.loaded&&(b.retain=!0),d>n?this._retainParent(r,h,d,n):!1)},_retainChildren:function(t,e,i,n){for(var r=2*t;r<2*t+2;r++)for(var h=2*e;h<2*e+2;h++){var d=new D(r,h);d.z=i+1;var p=this._tileCoordsToKey(d),_=this._tiles[p];if(_&&_.active){_.retain=!0;continue}else _&&_.loaded&&(_.retain=!0);i+1<n&&this._retainChildren(r,h,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 r=Math.round(e);this.options.maxZoom!==void 0&&r>this.options.maxZoom||this.options.minZoom!==void 0&&r<this.options.minZoom?r=void 0:r=this._clampZoom(r);var h=this.options.updateWhenZooming&&r!==this._tileZoom;(!n||h)&&(this._tileZoom=r,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),r!==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),r=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();W.any3d?Et(t.el,r,n):tt(t.el,r)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,r=this._map.getPixelWorldBounds(this._tileZoom);r&&(this._globalTileRange=this._pxBoundsToTileRange(r)),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),r=e.project(t,this._tileZoom).floor(),h=e.getSize().divideBy(n*2);return new K(r.subtract(h),r.add(h))},_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),r=this._pxBoundsToTileRange(n),h=r.getCenter(),d=[],p=this.options.keepBuffer,_=new K(r.getBottomLeft().subtract([p,-p]),r.getTopRight().add([p,-p]));if(!(isFinite(r.min.x)&&isFinite(r.min.y)&&isFinite(r.max.x)&&isFinite(r.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var b in this._tiles){var M=this._tiles[b].coords;(M.z!==this._tileZoom||!_.contains(new D(M.x,M.y)))&&(this._tiles[b].current=!1)}if(Math.abs(i-this._tileZoom)>1){this._setView(t,i);return}for(var k=r.min.y;k<=r.max.y;k++)for(var Z=r.min.x;Z<=r.max.x;Z++){var ct=new D(Z,k);if(ct.z=this._tileZoom,!!this._isValidTile(ct)){var Bt=this._tiles[this._tileCoordsToKey(ct)];Bt?Bt.current=!0:d.push(ct)}}if(d.sort(function(Dt,Bi){return Dt.distanceTo(h)-Bi.distanceTo(h)}),d.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Ue=document.createDocumentFragment();for(Z=0;Z<d.length;Z++)this._addTile(d[Z],Ue);this._level.el.appendChild(Ue)}}}},_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),r=n.add(i),h=e.unproject(n,t.z),d=e.unproject(r,t.z);return[h,d]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new at(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 D(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];!e||(J(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){z(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=v,t.onmousemove=v,W.ielt9&&this.options.opacity<1&&ht(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),u(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&H(u(this._tileReady,this,t,null,r)),tt(r,i),this._tiles[n]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,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?(ht(i.el,0),U(this._fadeFrame),this._fadeFrame=H(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(z(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),W.ielt9||!this._map._fadeAnimated?H(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 D(this._wrapX?g(t.x,this._wrapX):t.x,this._wrapY?g(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new K(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 jr(t){return new le(t)}var Xt=le.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&&W.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 A(i,"load",u(this._tileOnLoad,this,e,i)),A(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:W.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 I(this._url,s(e,this.options))},_tileOnLoad:function(t,e){W.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=v,e.onerror=v,!e.complete)){e.src=R;var i=this._tiles[t].coords;J(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",R),le.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===R))return le.prototype._tileReady.call(this,t,e,i)}});function Gn(t,e){return new Xt(t,e)}var Xn=Xt.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 r=e.detectRetina&&W.retina?2:1,h=this.getTileSize();i.width=h.x*r,i.height=h.y*r,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,Xt.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=st(i.project(e[0]),i.project(e[1])),r=n.min,h=n.max,d=(this._wmsVersion>=1.3&&this._crs===Nn?[r.y,r.x,h.y,h.x]:[r.x,r.y,h.x,h.y]).join(","),p=Xt.prototype.getTileUrl.call(this,t);return p+C(this.wmsParams,p,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+d},setParams:function(t,e){return s(this.wmsParams,t),e||this.redraw(),this}});function Yr(t,e){return new Xn(t,e)}Xt.WMS=Xn,Gn.wms=Yr;var Pt=ft.extend({options:{padding:.1},initialize:function(t){w(this,t),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&z(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),r=this._map.project(this._center,e),h=n.multiplyBy(-i).add(r).subtract(this._map._getNewPixelOrigin(t,e));W.any3d?Et(this._container,h,i):tt(this._container,h)},_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 K(i,i.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),jn=Pt.extend({options:{tolerance:0},getEvents:function(){var t=Pt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Pt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");A(t,"mousemove",this._onMouseMove,this),A(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),A(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){U(this._redrawRequest),delete this._ctx,J(this._container),X(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)){Pt.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=W.retina?2:1;tt(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",W.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Pt.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,r;for(r=0;r<e.length;r++){if(n=Number(e[r]),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||H(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new K,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,r,h,d=t._parts,p=d.length,_=this._ctx;if(!!p){for(_.beginPath(),i=0;i<p;i++){for(n=0,r=d[i].length;n<r;n++)h=d[i][n],_[n?"lineTo":"moveTo"](h.x,h.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),r=(Math.max(Math.round(t._radiusY),1)||n)/n;r!==1&&(i.save(),i.scale(1,r)),i.beginPath(),i.arc(e.x,e.y/r,n,0,Math.PI*2,!1),r!==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,r=this._drawFirst;r;r=r.next)i=r.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&&(Q(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,r=this._drawFirst;r;r=r.next)i=r.layer,i.options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(z(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 Yn(t){return W.canvas?new jn(t):null}var he=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">')}}(),Kr={_initContainer:function(){this._container=N("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Pt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=he("shape");z(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=he("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;J(e),t.removeInteractiveTarget(e),delete this._layers[f(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,r=t._container;r.stroked=!!n.stroke,r.filled=!!n.fill,n.stroke?(e||(e=t._stroke=he("stroke")),r.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=O(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(r.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=he("fill")),r.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(r.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){Ht(t._container)},_bringToBack:function(t){Ut(t._container)}},He=W.vml?he:Qi,ue=Pt.extend({_initContainer:function(){this._container=He("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=He("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){J(this._container),X(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Pt.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)),tt(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=He("path");t.options.className&&z(e,t.options.className),t.options.interactive&&z(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){J(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,tn(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,r="a"+i+","+n+" 0 1,0 ",h=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+r+i*2+",0 "+r+-i*2+",0 ";this._setPath(t,h)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){Ht(t._path)},_bringToBack:function(t){Ut(t._path)}});W.vml&&ue.include(Kr);function Kn(t){return W.svg||W.vml?new ue(t):null}B.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&&Yn(t)||Kn(t)}});var Jn=qt.extend({initialize:function(t,e){qt.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 Jr(t,e){return new Jn(t,e)}ue.create=He,ue.pointsToPath=tn,Tt.geometryToLayer=Oe,Tt.coordsToLatLng=Oi,Tt.coordsToLatLngs=ze,Tt.latLngToCoords=zi,Tt.latLngsToCoords=Ze,Tt.getFeature=Gt,Tt.asFeature=Be,B.mergeOptions({boxZoom:!0});var Qn=gt.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(){A(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){X(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){J(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(),ee(),yi(),this._startPoint=this._map.mouseEventToContainerPoint(t),A(document,{contextmenu:zt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=N("div","leaflet-zoom-box",this._container),z(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new K(this._point,this._startPoint),i=e.getSize();tt(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(J(this._box),Q(this._container,"leaflet-crosshair")),ie(),xi(),X(document,{contextmenu:zt,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 at(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())}});B.addInitHook("addHandler","boxZoom",Qn),B.mergeOptions({doubleClickZoom:!0});var to=gt.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,r=t.originalEvent.shiftKey?i-n:i+n;e.options.doubleClickZoom==="center"?e.setZoom(r):e.setZoomAround(t.containerPoint,r)}});B.addInitHook("addHandler","doubleClickZoom",to),B.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var eo=gt.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Wt(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))}z(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Q(this._map._container,"leaflet-grab"),Q(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=st(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,r=(n-e+i)%t+e-i,h=(n+e+i)%t-e-i,d=Math.abs(r+i)<Math.abs(h+i)?r:h;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 r=this._lastPos.subtract(this._positions[0]),h=(this._lastTime-this._times[0])/1e3,d=i.easeLinearity,p=r.multiplyBy(d/h),_=p.distanceTo([0,0]),b=Math.min(i.inertiaMaxSpeed,_),M=p.multiplyBy(b/_),k=b/(i.inertiaDeceleration*d),Z=M.multiplyBy(-k/2).round();!Z.x&&!Z.y?e.fire("moveend"):(Z=e._limitOffset(Z,e.options.maxBounds),H(function(){e.panBy(Z,{duration:k,easeLinearity:d,noMoveStart:!0,animate:!0})}))}}});B.addInitHook("addHandler","dragging",eo),B.mergeOptions({keyboard:!0,keyboardPanDelta:80});var io=gt.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"),A(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(),X(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,r;for(n=0,r=i.left.length;n<r;n++)e[i.left[n]]=[-1*t,0];for(n=0,r=i.right.length;n<r;n++)e[i.right[n]]=[t,0];for(n=0,r=i.down.length;n<r;n++)e[i.down[n]]=[0,t];for(n=0,r=i.up.length;n<r;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){var e=this._zoomKeys={},i=this.keyCodes,n,r;for(n=0,r=i.zoomIn.length;n<r;n++)e[i.zoomIn[n]]=t;for(n=0,r=i.zoomOut.length;n<r;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){A(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){X(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){if(!i._panAnim||!i._panAnim._inProgress)if(n=this._panKeys[e],t.shiftKey&&(n=E(n).multiplyBy(3)),i.options.maxBounds&&(n=i._limitOffset(E(n),i.options.maxBounds)),i.options.worldCopyJump){var r=i.wrapLatLng(i.unproject(i.project(i.getCenter()).add(n)));i.panTo(r)}else i.panBy(n)}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;zt(t)}}});B.addInitHook("addHandler","keyboard",io),B.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var no=gt.extend({addHooks:function(){A(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){X(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Mn(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),zt(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),r=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,h=i?Math.ceil(r/i)*i:r,d=t._limitZoom(e+(this._delta>0?h:-h))-e;this._delta=0,this._startTime=null,d&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+d):t.setZoomAround(this._lastMousePos,e+d))}});B.addInitHook("addHandler","scrollWheelZoom",no);var Qr=600;B.mergeOptions({tapHold:W.touchNative&&W.safari&&W.mobile,tapTolerance:15});var oo=gt.extend({addHooks:function(){A(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){X(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 D(e.clientX,e.clientY),this._holdTimeout=setTimeout(u(function(){this._cancel(),this._isTapValid()&&(A(document,"touchend",nt),A(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),Qr),A(document,"touchend touchcancel contextmenu",this._cancel,this),A(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){X(document,"touchend",nt),X(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),X(document,"touchend touchcancel contextmenu",this._cancel,this),X(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new D(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)}});B.addInitHook("addHandler","tapHold",oo),B.mergeOptions({touchZoom:W.touch,bounceAtZoomLimits:!0});var ro=gt.extend({addHooks:function(){z(this._map._container,"leaflet-touch-zoom"),A(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Q(this._map._container,"leaflet-touch-zoom"),X(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(),A(document,"touchmove",this._onTouchMove,this),A(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]),r=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,r===1)return}else{var h=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(r===1&&h.x===0&&h.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(h),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),U(this._animRequest);var d=u(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=H(d,this,!0),nt(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,U(this._animRequest),X(document,"touchmove",this._onTouchMove,this),X(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))}});B.addInitHook("addHandler","touchZoom",ro),B.BoxZoom=Qn,B.DoubleClickZoom=to,B.Drag=eo,B.Keyboard=io,B.ScrollWheelZoom=no,B.TapHold=oo,B.TouchZoom=ro,a.Bounds=K,a.Browser=W,a.CRS=bt,a.Canvas=jn,a.Circle=Ai,a.CircleMarker=Ae,a.Class=mt,a.Control=dt,a.DivIcon=qn,a.DivOverlay=vt,a.DomEvent=gr,a.DomUtil=pr,a.Draggable=Wt,a.Evented=Ct,a.FeatureGroup=wt,a.GeoJSON=Tt,a.GridLayer=le,a.Handler=gt,a.Icon=$t,a.ImageOverlay=Re,a.LatLng=V,a.LatLngBounds=at,a.Layer=ft,a.LayerGroup=Vt,a.LineUtil=Ir,a.Map=B,a.Marker=Ee,a.Mixin=Tr,a.Path=kt,a.Point=D,a.PolyUtil=Wr,a.Polygon=qt,a.Polyline=Lt,a.Popup=Ne,a.PosAnimation=Cn,a.Projection=kr,a.Rectangle=Jn,a.Renderer=Pt,a.SVG=ue,a.SVGOverlay=$n,a.TileLayer=Xt,a.Tooltip=Fe,a.Transformation=ai,a.Util=Le,a.VideoOverlay=Vn,a.bind=u,a.bounds=st,a.canvas=Yn,a.circle=Rr,a.circleMarker=Br,a.control=re,a.divIcon=Xr,a.extend=s,a.featureGroup=Or,a.geoJSON=Un,a.geoJson=Hr,a.gridLayer=jr,a.icon=zr,a.imageOverlay=Ur,a.latLng=G,a.latLngBounds=it,a.layerGroup=Ar,a.map=vr,a.marker=Zr,a.point=E,a.polygon=Fr,a.polyline=Nr,a.popup=qr,a.rectangle=Jr,a.setOptions=w,a.stamp=f,a.svg=Kn,a.svgOverlay=$r,a.tileLayer=Gn,a.tooltip=Gr,a.transformation=Kt,a.version=o,a.videoOverlay=Vr;var ts=window.L;a.noConflict=function(){return window.L=ts,this},window.L=a})});var co={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 fo={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 $e={base:{parent:void 0,name:"base",fill:"gradient",isolineColor:"inverted",isolineText:!0,vectorType:"arrows",vectorColor:"inverted",vectorFactor:1,streamLineColor:"#777777",streamLineSpeedFactor:1,streamLineStatic:!1,showBelowMin:!0,showAboveMax:!0,colorScheme:"divergingbluered",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 mo,po,_o;function go({colorStyles:a={},units:o={},colorSchemes:s={}}={}){T("WxTile lib setup: start"),mo=Object.assign({},co,o),po=Object.assign({},s,fo);let l=Object.assign({},a,$e);_o=_s(l),T("WxTile lib setup: styles unrolled");try{(async()=>(await document.fonts.load("32px barbs"),await document.fonts.load("32px arrows")))()}catch{T("WxTile lib setup: fonts not loaded")}T("WxTile lib setup is done.")}function St(){return _o}function ce(){return po}function qe(a,o,s){T("makeConverter: From=",a," To=",o);let l=x=>x;if(l.trivial=!0,a===o)return T("Trivial converter"),l;let u=Object.assign({},mo,s),c=u[a],f=u[o];if(!c||!f)return T("Inconvertible units. Trivial converter"),l;let[m,g,v]=c,[y,S,P]=f;if(m!==y||!g||!S)return T("Inconvertible units. Trivial converter"),l;let w=g/S,C=((v||0)-(P||0))/S;return C?x=>w*x+C:x=>w*x}function _s(a){let o=Object.assign({},$e);for(let c in a){let f=a[c];if(Array.isArray(f))for(let m=0;m<f.length;++m)o[c+"["+m+"]"]=Object.assign({},f[m]);else o[c]=Object.assign({},f)}let s=Object.assign({},$e.base),l=(c,f)=>{if(f==="base")return s;let m=c[f];if(!m)return s;(!m.parent||!(m.parent in c))&&(m.parent="base");let g=l(c,m.parent);return Object.assign(m,Object.assign({},g,m,{parent:"base"}))},u={base:s};for(let c in o)u[c]=l(o,c);return u}function de(a){let o=new Map;return(s,...l)=>{let u=o.get(s);if(u)return u;let c=a(s,...l);return o.set(s,c),c.catch(f=>f.name==="AbortError"&&o.delete(s)),c}}async function gs(a,o){return createImageBitmap(await(await fetch(a,o)).blob())}var Ni=class{constructor(o,s,l,u){this.raw=o;this.dmin=s;this.dmax=l;this.dmul=u;this.radius=0}get integral(){return this.integral_||(this.integral_=xs(this.raw))}};function jt(a,o,s=!0){let l=Object.assign(document.createElement("canvas"),{width:a,height:o,imageSmoothingEnabled:!1}).getContext("2d",{willReadFrequently:s});if(!l)throw new Error("Cannot get canvas context");return l}function vs(a){let{width:o,height:s}=a,l=jt(o,s);return l.drawImage(a,0,0),l.getImageData(0,0,o,s)}async function Fi(a,o){return vs(await gs(a,o))}function ys(a){a.data[34]<1&&T("Warning: image is in too old format. Check the version of the Splitter.");let o=new Uint16Array(a.data.buffer),s=new Uint16Array(o.length/2);for(let g=0;g<s.length;g++)s[g]=o[g*2];let l=new Uint8Array(8);for(let g=0;g<8;++g)l[g]=a.data[g*4+2];let u=new DataView(l.buffer),c=u.getFloat32(0,!0),f=u.getFloat32(4,!0),m=(f-c)/65535;return new Ni(s,c,f,m)}async function Hi(a,o){return ys(await Fi(a,o))}function xs(a){let o=new Uint32Array(66564),s=new Uint32Array(258*258);o[0]=a[0],s[0]=a[0]===0?0:1;for(let l=1;l<258;++l)o[l]=a[l]+o[l-1],o[258*l]=a[258*l]+o[258*l-258],s[l]=(a[l]===0?0:1)+s[l-1],s[258*l]=(a[258*l]===0?0:1)+s[258*l-258];for(let l=1,u=259;l<258;++l,++u)for(let c=1;c<258;++c,++u)o[u]=a[u]+o[u-258]+o[u-1]-o[u-258-1],s[u]=(a[u]===0?0:1)+s[u-258]+s[u-1]-s[u-258-1];return{integral:o,integralNZ:s}}function vo(a,o){if(o<0||o===a.radius)return a;a.radius=o;let s=258,{integral:l,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 m=Math.min(o,f-1,s-1-f),g=Math.min(o,c-1,s-1-c),v=s*(c-g-1)+f,y=s*(c+g)+f,S;if(u){let O=u[v-m-1],F=u[v+m],R=u[y-m-1],$=u[y+m];S=O+$-F-R}else S=(2*m+1)*(2*g+1);let P=l[v-m-1],w=l[v+m],C=l[y-m-1],x=l[y+m],I=P+x-w-C;a.raw[c*s+f]=I/S}return a}function lt(a){let o=a>>0&255,s=a>>8&255,l=a>>16&255,u=o.toString(16),c=s.toString(16),f=l.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 Mt(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 T("wrong color format",a),0}async function Rt(a,o){let s=await fetch(a,o);if(!s.ok)throw new Error("error:"+a+" - "+s.statusText);return s.json()}function Ui(a,o,s){let l=a>>0&255,u=a>>8&255,c=a>>16&255,f=a>>>24,m=o>>0&255,g=o>>8&255,v=o>>16&255,y=o>>>24,S=l+s*(m-l),P=u+s*(g-u),w=c+s*(v-c),C=f+s*(y-f);return S|P<<8|w<<16|C<<24}function yo(a,o,s){let l=[];for(let u=0;u<s;++u)l.push(u*(o-a)/(s-1)+a);return l}var T=(...a)=>{};function Vi(a){return a[0]==="#"&&a.length===4?"#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:a}function Ge(a,{x:o,y:s,z:l}){return a.replace("{x}",`${o}`).replace("{y}",`${s}`).replace("{z}",`${l}`)}function Xe({x:a,y:o,z:s}){return`${s}-${a}-${o}`}var bs="A".charCodeAt(0);var fe=class{constructor(){this.qtree={nodes:null};this.qtreedepth=0;T("QTree.constructor")}async load(o,s){try{let l=await Rt(o,s);this.qtree=xo(l,{pos:0})}catch(l){throw new Error(`Failed to load QTree: ${l.message}`)}this.qtreedepth=bo(this.qtree),T(`QTree.load: qtreedepth=${this.qtreedepth}`)}check(o){let s=o.z-this.qtreedepth,l=s>=0,u=l?{x:o.x>>s,y:o.y>>s,z:this.qtreedepth}:{...o};return wo(this.qtree,u,l)}};function xo(a,o){let s=a.charCodeAt(o.pos)-bs;o.pos++;let l=[1,2,4,8].map(u=>s&u?xo(a,o):null);return{nodes:l.some(u=>u)?l:null}}function bo(a){return a?.nodes?1+Math.max(...a.nodes.map(bo)):0}function wo(a,o,s){return a===null?"land":s&&!o.z?"mixed":a.nodes===null?"sea":o.z?(o.z--,wo(a.nodes[(o.y>>o.z&1)<<1|o.x>>o.z&1],o,s)):"mixed"}function ws(a,o,s){return a>s?s:a<o?o:a}var me=class{constructor(o,s,[l,u],c){T("RawCLUT.constructor");let f=u-l;this.levelIndex=new Uint32Array(65536),this.colorsI=new Uint32Array(65536);let m=[];this.DataToStyle=qe(s,o.units,o.extraUnits),this.DataToStyle.trivial&&(o.units=s),c&&(this.DataToKnots=qe(s,"knot"));let g=qe(o.units,s,o.extraUnits),v=x=>~~(65535*ws((g(x)-l)/(u-l),0,1));if(Array.isArray(o.colorMap)){o.colorMap.sort((x,I)=>x[0]<I[0]?-1:x[0]>I[0]?1:0);for(let[x]of o.colorMap)m.push(v(x))}else{if(o.levels||(o.levels=yo(this.DataToStyle(l),this.DataToStyle(u),10)),o.levels.sort((x,I)=>x<I?-1:x>I?1:0),!o.colors){let x=ce();o.colorScheme&&o.colorScheme in x?o.colors=x[o.colorScheme]:o.colors=x.wb}for(let x of o.levels)m.push(v(x))}let y=65536,S=je(y,o);this.ticks=S.ticks;let P=S.ticks[0].data,C=S.ticks[S.ticks.length-1].data-P;for(let x=0;x<65536;++x){let I=f*x/65535+l,O=this.DataToStyle(I),F=Math.round((y-1)*(O-P)/C);F<=0?this.colorsI[x]=o.showBelowMin?S.colors[0]:0:F>=y?this.colorsI[x]=o.showAboveMax?S.colors[y-1]:0:this.colorsI[x]=S.colors[F]}this.colorsI[0]=0;for(let x=0;x<m[0];++x)this.levelIndex[x]=0;for(let x=0;x<m.length-1;x++)for(let I=m[x];I<m[x+1]+1;++I)this.levelIndex[I]=x;for(let x=m[m.length-1];x<65536;++x)this.levelIndex[x]=m.length-1}};function Lo(a){if(a!==0&&-.1<a&&a<.1)return a.toExponential(2);let o=a.toString();return o.split(".")[1]?.length>2?a.toFixed(2):o}function je(a,o){let s={size:a,showBelowMin:o.showBelowMin,showAboveMax:o.showAboveMax,units:o.units,colors:new Uint32Array(a),ticks:[]},{colorMap:l,levels:u,colors:c}=o,f=o.fill!=="solid";if(l){let P=l[0][0],w=l[l.length-1][0]-P;for(let[C,x]of l){let I=~~((C-P)/w*(a-1)),O={data:C,dataString:Lo(C),color:x,pos:I};s.ticks.push(O)}for(let C=0;C<l.length-1;C++){let x=s.ticks[C].pos,I=s.ticks[C+1].pos,O=Mt(l[C][1]),F=f?Mt(l[C+1][1]):0;for(let R=x;R<I;++R)s.colors[R]=f?Ui(O,F,(R-x)/(I-x)):O}return s.colors[a-1]=Mt(l[l.length-1][1]),s}if(!c||!u)return s;let m=0,g=0,v=-1;for(let P=0;P<a;++P){let w=P*(c.length-1)/a;v!==~~w&&(v=~~w,m=Mt(c[v]),g=c.length>v+1?Mt(c[v+1]):m),s.colors[P]=f?Ui(m,g,w-v):m}s.colors[a-1]=Mt(c[c.length-1]);let y=u[0],S=(a-1)/(u[u.length-1]-y);for(let P of u){let w=~~((P-y)*S),C={data:P,dataString:Lo(P),color:lt(s.colors[w]),pos:w};s.ticks.push(C)}return s}var Ls=2*Math.PI*6378137/256,Ye=2*Math.PI*6378137/2;function Ts(a,o){let s=a/Ye*180,l=o/Ye*180;return l=180/Math.PI*(2*Math.atan(Math.exp(l*Math.PI/180))-Math.PI/2),[l,s]}function Ps(a,o,s){let l=Ss(s),u=a*l-Ye,c=o*l-Ye;return[u,c]}function Ss(a){return Ls/Math.pow(2,a)}function $i(a,o,s){let[l,u]=Ts(...Ps(a,o,s));return[u,-l]}function To(a,o){return[a*256,o*256]}function qi(a,o,s){let l=((o-a)%360+540)%360-180;return(a+l*s+360)%360}function Ms(a,o,s,l,u,c,f,m){switch((a?1:0)|(o?2:0)|(s?4:0)|(l?8:0)){case 0:return 0;case 1:return a;case 2:return o;case 3:s=a,l=o;break;case 4:return s;case 5:o=a,l=s;break;case 6:l=o+s>>1,a=l;break;case 7:l=o+s>>1;break;case 8:return l;case 9:o=a+l>>1,s=o;break;case 10:a=o,s=l;break;case 11:s=a+l>>1;break;case 12:a=s,o=l;break;case 13:o=a+l>>1;break;case 14:a=o+s>>1;break}a=f+m*a,o=f+m*o,s=f+m*s,l=f+m*l;let v=qi(a,o,u),y=qi(s,l,u);return(qi(v,y,c)-f)/m||1}function Po(a,o,s,l,u,c,f,m){switch((a?1:0)|(o?2:0)|(s?4:0)|(l?8:0)){case 7:return u+c<1?u*(o-a)+c*(s-a)+a:0;case 14:return u+c<1?0:u*(l-s)+c*(l-o)+o+s-l;case 11:return c<u?(1-u)*(a-o)+c*(l-o)+o:0;case 13:return c<u?0:(1-u)*(s-l)+c*(s-a)+a+l-s;case 15:return u+c<1?u*(o-a)+c*(s-a)+a:u*(l-s)+c*(l-o)+o+s-l;default:return 0}}function So(a,o,s){let l=1/Math.pow(2,s.z),u=s.x*256*l-.5,c=s.y*256*l-.5,{raw:f,dmin:m,dmax:g,dmul:v}=o,y={raw:new Uint16Array(258*258),dmin:m,dmax:g,dmul:v},{raw:S}=y;for(let P=-1,w=0,C=c-l+1;P<=256;P++,C+=l){let x=Math.floor(C),I=C-x,O=x*258;for(let F=-1,R=u-l+1;F<=256;F++,w++,R+=l){let $=Math.floor(R),Y=R-$,q=$+O,j=f[q],rt=f[q+1],H=f[q+258],U=f[q+258+1];S[w]=a(j,rt,H,U,Y,I,m,v)}}return y}function Mo(a,o,s){if(!o)return a;let l=y=>y<0?0:y>254?254:y,u=1/Math.pow(2,o.z),c=o.x*256*u-.5,f=o.y*256*u-.5,{data:m}=a,g=new ImageData(256,256),{data:v}=g;for(let y=0,S=s,P=f;y<256;y++,P+=u){let w=~~l(P),C=P-w,x=w*256;for(let I=0,O=c;I<256;I++,S+=4,O+=u){let F=~~l(O),R=O-F,$=(F+x)*4+s,Y=m[$],q=m[$+4],j=m[$+4*256],rt=m[$+4*256+4],H=Po(Y,q,j,rt,R,C,0,0);v[S]=H>127?255:0}}return g}function Co(a,o){return o?So(Po,a,o):a}function Io(a,o){return o?So(Ms,a,o):a}function Wo(a,{data:o},s,l){let u=l==="sea",{raw:c}=a;for(let f=s,m=259,g=0;g<256;m+=2,g++)for(let v=0;v<256;v++,m++,f+=4)u===!o[f]&&(c[m]=0);return a}function ko(a){let[o,s]=To(a.x,a.y),[l,u]=$i(o,s,a.z),[c,f]=$i(o+256,s+256,a.z);return{west:l,north:u,east:c,south:f}}function Gi(a,o){let s=a.z-o;if(s<=0)return{upCoords:a};let l={x:a.x>>>s,y:a.y>>>s,z:o},u={x:a.x&(1<<s)-1,y:a.y&(1<<s)-1,z:s};return{upCoords:l,subCoords:u}}var pe=class{constructor(o){this.loadDataFunc=de(Hi);this.layer=o,this.wxAPI=o.wxdatasetManager.wxAPI}async load(o,s){let l=await this.cacheLoad(o,this.layer.tilesURIs,s);if(!l)return null;let{rawdata:u,subCoords:c,tileType:f}=l,{units:m}=this.layer.currentVariableMeta,g=m==="degree"?Io:Co,v=S=>g(vo(S,this.layer.style.blurRadius),c),y=u.map(v);return this._vectorMagnitudesPrepare(y),await this._applyMask(y,o,f,!c&&u.length===1),{data:y,slines:this._createStreamLines(y)}}async cacheLoad(o,s,l){if(!this._checkInsideBoundaries(o))return null;let u=this._checkTypeAndMask(o);if(!u)return null;let{upCoords:c,subCoords:f}=Gi(o,this.layer.getMaxZoom()),m=s.map(y=>Ge(y,c)),g=Object.assign({},this.wxAPI.requestInit,{signal:l?.signal});return{rawdata:await Promise.all(m.map(y=>this.loadDataFunc(y,g))),subCoords:f,tileType:u}}clearCache(){this.loadDataFunc=de(Hi)}async _applyMask(o,s,l,u){let{style:c}=this.layer;if((c.mask==="land"||c.mask==="sea")&&l==="mixed"){if(u){let{raw:m,dmin:g,dmax:v,dmul:y}=o[0];o[0]={raw:new Uint16Array(m),dmin:g,dmax:v,dmul:y}}let f;try{let{upCoords:m,subCoords:g}=Gi(s,this.wxAPI.maskDepth);f=await this.wxAPI.loadMaskFunc(m),f=Mo(f,g,this.wxAPI.maskChannel)}catch{c.mask=void 0,T("Can't load Mask. Masking is disabled");return}Wo(o[0],f,this.wxAPI.maskChannel,c.mask)}}_vectorMagnitudesPrepare(o){if(o.length===1)return;o.unshift({raw:new Uint16Array(258*258),dmin:0,dmax:0,dmul:0});let[s,l,u]=o;s.dmax=1.42*Math.max(-l.dmin,l.dmax,-u.dmin,u.dmax),s.dmul=(s.dmax-s.dmin)/65535;for(let c=0;c<258*258;++c){if(!l.raw[c]||!u.raw[c])continue;let f=l.dmin+l.dmul*l.raw[c],m=u.dmin+u.dmul*u.raw[c];s.raw[c]=Math.sqrt(m*m+f*f)/s.dmul}}_checkTypeAndMask(o){let{mask:s}=this.layer.style;if(s==="land"||s==="sea"){let l=this.wxAPI.qtree.check(o);return s===l?void 0:l}return"mixed"}_checkInsideBoundaries(o){let s=this.layer.getBoundaries();if(s?.boundaries180){let l=ko(o),u=c=>!(l.west>c.east||c.west>l.east||l.south>c.north||c.south>l.north);if(!s.boundaries180.some(u))return!1}return!0}_createStreamLines(o){if(o.length!==3)return[];let{style:s}=this.layer;if(s.streamLineColor==="none")return[];let l=[],[u,c,f]=o,m=(s.streamLineSpeedFactor||1)/u.dmax,g=s.addDegrees?.017453292519943*s.addDegrees:0,v=s.streamLineGridStep||64,y=s.streamLineSteps||300;for(let S=0;S<=256;S+=v)for(let P=0;P<=256;P+=v){if(!u.raw[1+P+(1+S)*258])continue;let w=[],C=P,x=S,I=-1,O=0,F=0;for(let Y=0;Y<=y&&C>=0&&C<=256&&x>=0&&x<=256;Y++){Y%(y/10)||w.push({x:~~C,y:~~x});let q=~~C+1+(~~x+1)*258;if(q!==I){if(!u.raw[q])break;I=q;let j=u.dmin+u.raw[q]*u.dmul,rt=c.dmin+c.raw[q]*c.dmul,H=f.dmin+f.raw[q]*f.dmul,U=Math.atan2(rt,H)+g;O=m*j*Math.sin(U),F=m*j*Math.cos(U)}C+=O,x-=F}let R=P,$=S;I=-1;for(let Y=1;Y<=y&&R>=0&&R<=256&&$>=0&&$<=256;Y++){Y%(y/10)||w.unshift({x:~~R,y:~~$});let q=~~R+1+(~~$+1)*258;if(q!==I){if(!u.raw[q])break;I=q;let j=u.dmin+u.raw[q]*u.dmul,rt=c.dmin+c.raw[q]*c.dmul,H=f.dmin+f.raw[q]*f.dmul,U=Math.atan2(rt,H)+g;O=m*j*Math.sin(U),F=m*j*Math.cos(U)}R-=O,$+=F}w.length>2&&l.push(w)}return l}};var _e=class{constructor(o){this.layer=o}paint({data:o,ctxFill:s,ctxText:l,ctxStreamLines:u}){let{layer:c}=this,{units:f}=c.currentVariableMeta,m=new ImageData(256,256),g=new Uint32Array(m.data.buffer);s.clearRect(0,0,256,256),l.clearRect(0,0,256,256),u.clearRect(0,0,256,256),Cs(o.data[0],g,c);let v=Is(g,o.data[0],c);s.putImageData(m,0,0),Ws(v,l,c),ks(o.data,l,c),Ds(o.data[0],l,f,c),Es(o,l,c)}getPaintedCanvas(o,s,l){return s?(this.imprintVectorAnimationLinesStep(o,l),o.ctxStreamLines.canvas):o.ctxFill.canvas}imprintVectorAnimationLinesStep({data:o,ctxFill:s,ctxStreamLines:l},u){let{layer:c}=this;l.clearRect(0,0,256,256),l.drawImage(s.canvas,0,0),!(o.slines.length===0||c.style.streamLineStatic||c.style.streamLineColor==="none")&&As(o,l,c,u)}};function Cs(a,o,{CLUT:s,style:l}){let{raw:u}=a,{colorsI:c}=s;if(l.fill!=="none")for(let f=0,m=0,g=259;f<256;++f,g+=2)for(let v=0;v<256;++v,++m,++g)o[m]=c[u[g]];else o.fill(0)}function Is(a,o,{CLUT:s,style:l}){let{raw:u}=o,{levelIndex:c,colorsI:f}=s,m=[];if(l.isolineColor!=="none"){let g=l.isolineColor[0]==="#"?Mt(l.isolineColor):0;for(let v=0,y=0;v<256;v+=1)for(let S=0;S<256;S+=1){let P=(v+1)*258+(S+1),w=u[P],C=u[P+1],x=u[P+258];if(!w||!C||!x)continue;let I=c[w],O=c[C],F=c[x];if(I!==O||I!==F){let R=Math.max(I,O,F),$=Math.max(w,C,x),Y=v*256+S;switch(l.isolineColor){case"inverted":a[Y]=~f[$]|4278190080;break;case"fill":a[Y]=f[$]|4278190080;break;default:a[Y]=g;break}l.isolineText&&!(++y%255)&&S>20&&S<235&&v>20&&v<235&&m.push({x:S,y:v,d:w,dr:C,db:x,mli:R})}}}return m}function Ws(a,o,{CLUT:s}){if(a.length){o.font="1.1em Sans-serif",o.lineWidth=2,o.strokeStyle="white",o.fillStyle="black",o.textAlign="center",o.textBaseline="middle";for(let{x:l,y:u,d:c,dr:f,db:m,mli:g}of a){let v=s.ticks[g].dataString,y=Math.atan2(c-f,m-c);o.save(),o.translate(l,u),o.rotate(y<-1.57||y>1.57?y+3.14:y),o.strokeText(v,0,0),o.fillText(v,0,0),o.restore()}}}function ks(a,o,{CLUT:s,style:l}){if(!s.DataToKnots||l.vectorColor==="none"||l.vectorType==="none")return;if(a.length!==3)throw new Error("data.length !== 3");let[u,c,f]=a;switch(l.vectorType){case"barbs":o.font="40px barbs";break;case"arrows":o.font="50px arrows";break;default:o.font=l.vectorType}o.textAlign="center",o.textBaseline="middle",o.fillStyle=l.vectorColor;let m=l.addDegrees?.017453292519943*l.addDegrees:0,g=32;for(let v=g/2;v<256;v+=g)for(let y=g/2;y<256;y+=g){let S=y+1+(v+1)*258;if(!u.raw[S])continue;let P=Math.atan2(c.dmin+c.raw[S]*c.dmul,f.dmin+f.raw[S]*f.dmul),w=u.dmin+u.raw[S]*u.dmul,C=l.vectorType!=="barbs"?l.vectorFactor*.5:.2,x=Math.min(~~(s.DataToKnots(w)*C),25)+65,I=String.fromCharCode(x);switch(l.vectorColor){case"inverted":o.fillStyle=lt(~s.colorsI[u.raw[S]]);break;case"fill":o.fillStyle=lt(s.colorsI[u.raw[S]]);break}o.save(),o.translate(y,v),o.rotate(P+m),o.fillText(I,0,0),o.restore()}}function Ds(a,o,s,{CLUT:l,style:u}){if(s!=="degree")return;let c=.017453292519943*u.addDegrees;o.font="50px arrows",o.textAlign="center",o.textBaseline="middle",o.fillStyle=u.vectorColor;let f="L",m=32;for(let g=m/2;g<256;g+=m)for(let v=m/2;v<256;v+=m){let y=v+1+(g+1)*258;if(!a.raw[y])continue;let P=(a.dmin+a.raw[y]*a.dmul+180)*.01745329251;switch(u.vectorColor){case"inverted":o.fillStyle=lt(~l.colorsI[a.raw[y]]);break;case"fill":o.fillStyle=lt(l.colorsI[a.raw[y]]);break}o.save(),o.translate(v,g),o.rotate(P+c),o.fillText(f,0,0),o.restore()}}function Es(a,o,{CLUT:s,style:l}){let{data:u,slines:c}=a;if(!c.length||!l.streamLineStatic||l.streamLineColor==="none")return;let f=u[0];o.lineWidth=1,l.streamLineColor[0]==="#"&&(o.strokeStyle=Vi(l.streamLineColor));for(let m=c.length;m--;){let g=c[m];for(let v=0;v<g.length-1;++v){let y=g[v],S=g[v+1],P=y.x+1+(y.y+1)*258;switch(l.streamLineColor){case"inverted":o.strokeStyle=lt(~s.colorsI[f.raw[P]]);break;case"fill":o.strokeStyle=lt(s.colorsI[f.raw[P]]);break}o.beginPath(),o.moveTo(y.x,y.y),o.lineTo(S.x,S.y),o.stroke()}}}function As(a,o,{CLUT:s,style:l},u){let{data:c,slines:f}=a,m=c[0],g=l.streamLineColor[0]==="#"?Vi(l.streamLineColor).substring(0,7):"#000000";u=u>>5;for(let v=0;v<f.length;++v){let y=f[v],S=y.length-1,P=(u+(1+y[0].x)*(1+y[0].y))%30;for(let w=0;w<S;++w){let C=y[w],x=y[w+1],I=1-(P-w)/S;(I<0||I>1)&&(I=0);let O=(~~(I*255)).toString(16).padStart(2,"0"),F=1+~~((1.2-I)*5);o.lineWidth=F;let R=C.x+1+(C.y+1)*258;switch(l.streamLineColor){case"inverted":g=lt(~s.colorsI[m.raw[R]]);break;case"fill":g=lt(s.colorsI[m.raw[R]]);break}o.strokeStyle=g+O,o.beginPath(),o.moveTo(C.x,C.y),o.lineTo(x.x,x.y),o.stroke()}}}var Ke=class extends Map{clear(){T("TilesCache.clear()"),this.forEach(o=>{!o.rd||(o.rd.gl.deleteTexture(o.rd.vectorTextureU),o.rd.gl.deleteTexture(o.rd.vectorTextureV))}),super.clear()}},ge=class{constructor(o){this.tilesCache=new Ke;this.painter=new _e(this);if(T(`WxLayer.constructor:
|
|
1
|
+
(()=>{var hs=Object.create;var ho=Object.defineProperty;var us=Object.getOwnPropertyDescriptor;var cs=Object.getOwnPropertyNames;var ds=Object.getPrototypeOf,fs=Object.prototype.hasOwnProperty;var ms=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var ps=(a,o,s,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let u of cs(o))!fs.call(a,u)&&u!==s&&ho(a,u,{get:()=>o[u],enumerable:!(l=us(o,u))||l.enumerable});return a};var uo=(a,o,s)=>(s=a!=null?hs(ds(a)):{},ps(o||!a||!a.__esModule?ho(s,"default",{value:a,enumerable:!0}):s,a));var Xi=ms((Je,Do)=>{(function(a,o){typeof Je=="object"&&typeof Do<"u"?o(Je):typeof define=="function"&&define.amd?define(["exports"],o):(a=typeof globalThis<"u"?globalThis:a||self,o(a.leaflet={}))})(Je,function(a){"use strict";var o="1.9.3";function s(t){var e,i,n,r;for(i=1,n=arguments.length;i<n;i++){r=arguments[i];for(e in r)t[e]=r[e]}return t}var l=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 m(t,e,i){var n,r,h,d;return d=function(){n=!1,r&&(h.apply(i,r),r=!1)},h=function(){n?r=arguments:(t.apply(i,arguments),setTimeout(d,e),n=!0)},h}function y(t,e,i){var n=e[1],r=e[0],h=n-r;return t===n&&i?t:((t-r)%h+h)%h+r}function _(){return!1}function v(t,e){if(e===!1)return t;var i=Math.pow(10,e===void 0?6:e);return Math.round(t*i)/i}function T(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function P(t){return T(t).split(/\s+/)}function w(t,e){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?l(t.options):{});for(var i in e)t.options[i]=e[i];return t.options}function M(t,e,i){var n=[];for(var r in t)n.push(encodeURIComponent(i?r.toUpperCase():r)+"="+encodeURIComponent(t[r]));return(!e||e.indexOf("?")===-1?"?":"&")+n.join("&")}var x=/\{ *([\w_ -]+) *\}/g;function C(t,e){return t.replace(x,function(i,n){var r=e[n];if(r===void 0)throw new Error("No value provided for variable "+i);return typeof r=="function"&&(r=r(e)),r})}var k=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function z(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var Z="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function H(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var V=0;function N(t){var e=+new Date,i=Math.max(0,16-(e-V));return V=e+i,window.setTimeout(t,i)}var q=window.requestAnimationFrame||H("RequestAnimationFrame")||N,rt=window.cancelAnimationFrame||H("CancelAnimationFrame")||H("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function $(t,e,i){if(i&&q===N)t.call(e);else return q.call(window,u(t,e))}function G(t){t&&rt.call(window,t)}var Le={__proto__:null,extend:s,create:l,bind:u,get lastId(){return c},stamp:f,throttle:m,wrapNum:y,falseFn:_,formatNum:v,trim:T,splitWords:P,setOptions:w,getParamString:M,template:C,isArray:k,indexOf:z,emptyImageUrl:Z,requestFn:q,cancelFn:rt,requestAnimFrame:$,cancelAnimFrame:G};function mt(){}mt.extend=function(t){var e=function(){w(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,n=l(i);n.constructor=e,e.prototype=n;for(var r in this)Object.prototype.hasOwnProperty.call(this,r)&&r!=="prototype"&&r!=="__super__"&&(e[r]=this[r]);return t.statics&&s(e,t.statics),t.includes&&(xt(t.includes),s.apply(null,[n].concat(t.includes))),s(n,t),delete n.statics,delete n.includes,n.options&&(n.options=i.options?l(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 h=0,d=n._initHooks.length;h<d;h++)n._initHooks[h].call(this)}},e},mt.include=function(t){var e=this.prototype.options;return s(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},mt.mergeOptions=function(t){return s(this.prototype.options,t),this},mt.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 xt(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=k(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 ot={on:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e);else{t=P(t);for(var r=0,h=t.length;r<h;r++)this._on(t[r],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=P(t);for(var r=arguments.length===1,h=0,d=t.length;h<d;h++)r?this._off(t[h]):this._off(t[h],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 r={fn:e,ctx:i};n&&(r.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(r)}},_off:function(t,e,i){var n,r,h;if(!!this._events&&(n=this._events[t],!!n)){if(arguments.length===1){if(this._firingCount)for(r=0,h=n.length;r<h;r++)n[r].fn=_;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 p=n[d];this._firingCount&&(p.fn=_,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 r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var h=0,d=r.length;h<d;h++){var p=r[h],g=p.fn;p.once&&this.off(t,g,p.ctx),g.call(p.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 r=e;typeof e!="function"&&(n=!!e,r=void 0,i=void 0);var h=this._events&&this._events[t];if(h&&h.length&&this._listens(t,r,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 r=0,h=n.length;r<h;r++)if(n[r].fn===e&&n[r].ctx===i)return r;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=P(t);for(var r=0,h=t.length;r<h;r++)this._on(t[r],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)}};ot.addEventListener=ot.on,ot.removeEventListener=ot.clearAllEventListeners=ot.off,ot.addOneTimeEventListener=ot.once,ot.fireEvent=ot.fire,ot.hasEventListeners=ot.listens;var Ct=mt.extend(ot);function E(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var Te=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};E.prototype={clone:function(){return new E(this.x,this.y)},add:function(t){return this.clone()._add(A(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(A(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 E(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new E(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=Te(this.x),this.y=Te(this.y),this},distanceTo:function(t){t=A(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=A(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=A(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+v(this.x)+", "+v(this.y)+")"}};function A(t,e,i){return t instanceof E?t:k(t)?new E(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new E(t.x,t.y):new E(t,e,i)}function K(t,e){if(!!t)for(var i=e?[t,e]:t,n=0,r=i.length;n<r;n++)this.extend(i[n])}K.prototype={extend:function(t){var e,i;if(!t)return this;if(t instanceof E||typeof t[0]=="number"||"x"in t)e=i=A(t);else if(t=st(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 A((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return A(this.min.x,this.max.y)},getTopRight:function(){return A(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 E?t=A(t):t=st(t),t instanceof K?(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=st(t);var e=this.min,i=this.max,n=t.min,r=t.max,h=r.x>=e.x&&n.x<=i.x,d=r.y>=e.y&&n.y<=i.y;return h&&d},overlaps:function(t){t=st(t);var e=this.min,i=this.max,n=t.min,r=t.max,h=r.x>e.x&&n.x<i.x,d=r.y>e.y&&n.y<i.y;return h&&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,r=Math.abs(e.y-i.y)*t;return st(A(e.x-n,e.y-r),A(i.x+n,i.y+r))},equals:function(t){return t?(t=st(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function st(t,e){return!t||t instanceof K?t:new K(t,e)}function at(t,e){if(!!t)for(var i=e?[t,e]:t,n=0,r=i.length;n<r;n++)this.extend(i[n])}at.prototype={extend:function(t){var e=this._southWest,i=this._northEast,n,r;if(t instanceof X)n=t,r=t;else if(t instanceof at){if(n=t._southWest,r=t._northEast,!n||!r)return this}else return t?this.extend(j(t)||it(t)):this;return!e&&!i?(this._southWest=new X(n.lat,n.lng),this._northEast=new X(r.lat,r.lng)):(e.lat=Math.min(n.lat,e.lat),e.lng=Math.min(n.lng,e.lng),i.lat=Math.max(r.lat,i.lat),i.lng=Math.max(r.lng,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,r=Math.abs(e.lng-i.lng)*t;return new at(new X(e.lat-n,e.lng-r),new X(i.lat+n,i.lng+r))},getCenter:function(){return new X((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 X(this.getNorth(),this.getWest())},getSouthEast:function(){return new X(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 X||"lat"in t?t=j(t):t=it(t);var e=this._southWest,i=this._northEast,n,r;return t instanceof at?(n=t.getSouthWest(),r=t.getNorthEast()):n=r=t,n.lat>=e.lat&&r.lat<=i.lat&&n.lng>=e.lng&&r.lng<=i.lng},intersects:function(t){t=it(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),r=t.getNorthEast(),h=r.lat>=e.lat&&n.lat<=i.lat,d=r.lng>=e.lng&&n.lng<=i.lng;return h&&d},overlaps:function(t){t=it(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),r=t.getNorthEast(),h=r.lat>e.lat&&n.lat<i.lat,d=r.lng>e.lng&&n.lng<i.lng;return h&&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 at?t:new at(t,e)}function X(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)}X.prototype={equals:function(t,e){if(!t)return!1;t=j(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("+v(this.lat,t)+", "+v(this.lng,t)+")"},distanceTo:function(t){return It.distance(this,j(t))},wrap:function(){return It.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 X(this.lat,this.lng,this.alt)}};function j(t,e,i){return t instanceof X?t:k(t)&&typeof t[0]!="object"?t.length===3?new X(t[0],t[1],t[2]):t.length===2?new X(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new X(t.lat,"lng"in t?t.lng:t.lon,t.alt):e===void 0?null:new X(t,e,i)}var wt={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),r=this.transformation.transform(e.max,i);return new K(n,r)},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?y(t.lng,this.wrapLng,!0):t.lng,i=this.wrapLat?y(t.lat,this.wrapLat,!0):t.lat,n=t.alt;return new X(i,e,n)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,r=e.lng-i.lng;if(n===0&&r===0)return t;var h=t.getSouthWest(),d=t.getNorthEast(),p=new X(h.lat-n,h.lng-r),g=new X(d.lat-n,d.lng-r);return new at(p,g)}},It=s({},wt,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,r=e.lat*i,h=Math.sin((e.lat-t.lat)*i/2),d=Math.sin((e.lng-t.lng)*i/2),p=h*h+Math.cos(n)*Math.cos(r)*d*d,g=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p));return this.R*g}}),Ji=6378137,si={R:Ji,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),r=Math.sin(n*e);return new E(this.R*t.lng*e,this.R*Math.log((1+r)/(1-r))/2)},unproject:function(t){var e=180/Math.PI;return new X((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=Ji*Math.PI;return new K([-t,-t],[t,t])}()};function ai(t,e,i,n){if(k(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}ai.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 E((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};function Kt(t,e,i,n){return new ai(t,e,i,n)}var li=s({},It,{code:"EPSG:3857",projection:si,transformation:function(){var t=.5/(Math.PI*si.R);return Kt(t,.5,-t,.5)}()}),Ro=s({},li,{code:"EPSG:900913"});function Qi(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function tn(t,e){var i="",n,r,h,d,p,g;for(n=0,h=t.length;n<h;n++){for(p=t[n],r=0,d=p.length;r<d;r++)g=p[r],i+=(r?"L":"M")+g.x+" "+g.y;i+=e?W.svg?"z":"x":""}return i||"M0 0"}var hi=document.documentElement.style,Pe="ActiveXObject"in window,No=Pe&&!document.addEventListener,en="msLaunchUri"in navigator&&!("documentMode"in document),ui=pt("webkit"),nn=pt("android"),on=pt("android 2")||pt("android 3"),Fo=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Ho=nn&&pt("Google")&&Fo<537&&!("AudioNode"in window),ci=!!window.opera,rn=!en&&pt("chrome"),sn=pt("gecko")&&!ui&&!ci&&!Pe,Uo=!rn&&pt("safari"),an=pt("phantom"),ln="OTransition"in hi,Vo=navigator.platform.indexOf("Win")===0,hn=Pe&&"transition"in hi,di="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!on,un="MozPerspective"in hi,$o=!window.L_DISABLE_3D&&(hn||di||un)&&!ln&&!an,Jt=typeof orientation<"u"||pt("mobile"),qo=Jt&&ui,Go=Jt&&di,cn=!window.PointerEvent&&window.MSPointerEvent,dn=!!(window.PointerEvent||cn),fn="ontouchstart"in window||!!window.TouchEvent,Xo=!window.L_NO_TOUCH&&(fn||dn),jo=Jt&&ci,Yo=Jt&&sn,Ko=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Jo=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",_,e),window.removeEventListener("testPassiveEventSupport",_,e)}catch{}return t}(),Qo=function(){return!!document.createElement("canvas").getContext}(),fi=!!(document.createElementNS&&Qi("svg").createSVGRect),tr=!!fi&&function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),er=!fi&&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}}(),ir=navigator.platform.indexOf("Mac")===0,nr=navigator.platform.indexOf("Linux")===0;function pt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var W={ie:Pe,ielt9:No,edge:en,webkit:ui,android:nn,android23:on,androidStock:Ho,opera:ci,chrome:rn,gecko:sn,safari:Uo,phantom:an,opera12:ln,win:Vo,ie3d:hn,webkit3d:di,gecko3d:un,any3d:$o,mobile:Jt,mobileWebkit:qo,mobileWebkit3d:Go,msPointer:cn,pointer:dn,touch:Xo,touchNative:fn,mobileOpera:jo,mobileGecko:Yo,retina:Ko,passiveEvents:Jo,canvas:Qo,svg:fi,vml:er,inlineSvg:tr,mac:ir,linux:nr},mn=W.msPointer?"MSPointerDown":"pointerdown",pn=W.msPointer?"MSPointerMove":"pointermove",_n=W.msPointer?"MSPointerUp":"pointerup",gn=W.msPointer?"MSPointerCancel":"pointercancel",mi={touchstart:mn,touchmove:pn,touchend:_n,touchcancel:gn},vn={touchstart:hr,touchmove:Se,touchend:Se,touchcancel:Se},Ft={},yn=!1;function or(t,e,i){return e==="touchstart"&&lr(),vn[e]?(i=vn[e].bind(this,i),t.addEventListener(mi[e],i,!1),i):(console.warn("wrong event specified:",e),_)}function rr(t,e,i){if(!mi[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(mi[e],i,!1)}function sr(t){Ft[t.pointerId]=t}function ar(t){Ft[t.pointerId]&&(Ft[t.pointerId]=t)}function xn(t){delete Ft[t.pointerId]}function lr(){yn||(document.addEventListener(mn,sr,!0),document.addEventListener(pn,ar,!0),document.addEventListener(_n,xn,!0),document.addEventListener(gn,xn,!0),yn=!0)}function Se(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in Ft)e.touches.push(Ft[i]);e.changedTouches=[e],t(e)}}function hr(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&nt(e),Se(t,e)}function ur(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 cr=200;function dr(t,e){t.addEventListener("dblclick",e);var i=0,n;function r(h){if(h.detail!==1){n=h.detail;return}if(!(h.pointerType==="mouse"||h.sourceCapabilities&&!h.sourceCapabilities.firesTouchEvents)){var d=Pn(h);if(!(d.some(function(g){return g instanceof HTMLLabelElement&&g.attributes.for})&&!d.some(function(g){return g instanceof HTMLInputElement||g instanceof HTMLSelectElement}))){var p=Date.now();p-i<=cr?(n++,n===2&&e(ur(h))):n=1,i=p}}}return t.addEventListener("click",r),{dblclick:e,simDblclick:r}}function fr(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var pi=Ie(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Qt=Ie(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),wn=Qt==="webkitTransition"||Qt==="OTransition"?Qt+"End":"transitionend";function bn(t){return typeof t=="string"?document.getElementById(t):t}function te(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 U(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function J(t){var e=t.parentNode;e&&e.removeChild(t)}function Me(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ht(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function Ut(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function _i(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=Ce(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function B(t,e){if(t.classList!==void 0)for(var i=P(e),n=0,r=i.length;n<r;n++)t.classList.add(i[n]);else if(!_i(t,e)){var h=Ce(t);gi(t,(h?h+" ":"")+e)}}function Q(t,e){t.classList!==void 0?t.classList.remove(e):gi(t,T((" "+Ce(t)+" ").replace(" "+e+" "," ")))}function gi(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e}function Ce(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function ht(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&mr(t,e)}function mr(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 Ie(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Et(t,e,i){var n=e||new E(0,0);t.style[pi]=(W.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function tt(t,e){t._leaflet_pos=e,W.any3d?Et(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function At(t){return t._leaflet_pos||new E(0,0)}var ee,ie,vi;if("onselectstart"in document)ee=function(){O(window,"selectstart",nt)},ie=function(){Y(window,"selectstart",nt)};else{var ne=Ie(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(ne){var t=document.documentElement.style;vi=t[ne],t[ne]="none"}},ie=function(){ne&&(document.documentElement.style[ne]=vi,vi=void 0)}}function yi(){O(window,"dragstart",nt)}function xi(){Y(window,"dragstart",nt)}var We,wi;function bi(t){for(;t.tabIndex===-1;)t=t.parentNode;!t.style||(ke(),We=t,wi=t.style.outline,t.style.outline="none",O(window,"keydown",ke))}function ke(){!We||(We.style.outline=wi,We=void 0,wi=void 0,Y(window,"keydown",ke))}function Ln(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function Li(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var pr={__proto__:null,TRANSFORM:pi,TRANSITION:Qt,TRANSITION_END:wn,get:bn,getStyle:te,create:U,remove:J,empty:Me,toFront:Ht,toBack:Ut,hasClass:_i,addClass:B,removeClass:Q,setClass:gi,getClass:Ce,setOpacity:ht,testProp:Ie,setTransform:Et,setPosition:tt,getPosition:At,get disableTextSelection(){return ee},get enableTextSelection(){return ie},disableImageDrag:yi,enableImageDrag:xi,preventOutline:bi,restoreOutline:ke,getSizedParentNode:Ln,getScale:Li};function O(t,e,i,n){if(e&&typeof e=="object")for(var r in e)Pi(t,r,e[r],i);else{e=P(e);for(var h=0,d=e.length;h<d;h++)Pi(t,e[h],i,n)}return this}var _t="_leaflet_events";function Y(t,e,i,n){if(arguments.length===1)Tn(t),delete t[_t];else if(e&&typeof e=="object")for(var r in e)Si(t,r,e[r],i);else if(e=P(e),arguments.length===2)Tn(t,function(p){return z(e,p)!==-1});else for(var h=0,d=e.length;h<d;h++)Si(t,e[h],i,n);return this}function Tn(t,e){for(var i in t[_t]){var n=i.split(/\d/)[0];(!e||e(n))&&Si(t,n,null,null,i)}}var Ti={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Pi(t,e,i,n){var r=e+f(i)+(n?"_"+f(n):"");if(t[_t]&&t[_t][r])return this;var h=function(p){return i.call(n||t,p||window.event)},d=h;!W.touchNative&&W.pointer&&e.indexOf("touch")===0?h=or(t,e,h):W.touch&&e==="dblclick"?h=dr(t,h):"addEventListener"in t?e==="touchstart"||e==="touchmove"||e==="wheel"||e==="mousewheel"?t.addEventListener(Ti[e]||e,h,W.passiveEvents?{passive:!1}:!1):e==="mouseenter"||e==="mouseleave"?(h=function(p){p=p||window.event,Ci(t,p)&&d(p)},t.addEventListener(Ti[e],h,!1)):t.addEventListener(e,d,!1):t.attachEvent("on"+e,h),t[_t]=t[_t]||{},t[_t][r]=h}function Si(t,e,i,n,r){r=r||e+f(i)+(n?"_"+f(n):"");var h=t[_t]&&t[_t][r];if(!h)return this;!W.touchNative&&W.pointer&&e.indexOf("touch")===0?rr(t,e,h):W.touch&&e==="dblclick"?fr(t,h):"removeEventListener"in t?t.removeEventListener(Ti[e]||e,h,!1):t.detachEvent("on"+e,h),t[_t][r]=null}function Zt(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Mi(t){return Pi(t,"wheel",Zt),this}function oe(t){return O(t,"mousedown touchstart dblclick contextmenu",Zt),t._leaflet_disable_click=!0,this}function nt(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ot(t){return nt(t),Zt(t),this}function Pn(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function Sn(t,e){if(!e)return new E(t.clientX,t.clientY);var i=Li(e),n=i.boundingClientRect;return new E((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var _r=W.linux&&W.chrome?window.devicePixelRatio:W.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Mn(t){return W.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/_r: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 Ci(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 gr={__proto__:null,on:O,off:Y,stopPropagation:Zt,disableScrollPropagation:Mi,disableClickPropagation:oe,preventDefault:nt,stop:Ot,getPropagationPath:Pn,getMousePosition:Sn,getWheelDelta:Mn,isExternalTarget:Ci,addListener:O,removeListener:Y},Cn=Ct.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=At(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=$(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(),tt(this._el,i),this.fire("step")},_complete:function(){G(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),F=Ct.extend({options:{crs:li,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(j(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Qt&&W.any3d&&!W.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),O(this._proxy,wn,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(j(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||(W.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(W.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),r=this.getSize().divideBy(2),h=t instanceof E?t:this.latLngToContainerPoint(t),d=h.subtract(r).multiplyBy(1-1/n),p=this.containerPointToLatLng(r.add(d));return this.setView(p,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():it(t);var i=A(e.paddingTopLeft||e.padding||[0,0]),n=A(e.paddingBottomRight||e.padding||[0,0]),r=this.getBoundsZoom(t,!1,i.add(n));if(r=typeof e.maxZoom=="number"?Math.min(e.maxZoom,r):r,r===1/0)return{center:t.getCenter(),zoom:r};var h=n.subtract(i).divideBy(2),d=this.project(t.getSouthWest(),r),p=this.project(t.getNorthEast(),r),g=this.unproject(d.add(p).divideBy(2).add(h),r);return{center:g,zoom:r}},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=A(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 Cn,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){B(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||!W.any3d)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),r=this.project(t),h=this.getSize(),d=this._zoom;t=j(t),e=e===void 0?d:e;var p=Math.max(h.x,h.y),g=p*this.getZoomScale(d,e),b=r.distanceTo(n)||1,I=1.42,D=I*I;function R(et){var Ve=et?-1:1,rs=et?g:p,ss=g*g-p*p+Ve*D*D*b*b,as=2*rs*D*b,Ri=ss/as,lo=Math.sqrt(Ri*Ri+1)-Ri,ls=lo<1e-9?-18:Math.log(lo);return ls}function ct(et){return(Math.exp(et)-Math.exp(-et))/2}function Bt(et){return(Math.exp(et)+Math.exp(-et))/2}function Ue(et){return ct(et)/Bt(et)}var Dt=R(0);function Bi(et){return p*(Bt(Dt)/Bt(Dt+I*et))}function es(et){return p*(Bt(Dt)*Ue(Dt+I*et)-ct(Dt))/D}function is(et){return 1-Math.pow(1-et,1.5)}var ns=Date.now(),so=(R(1)-Dt)/I,os=i.duration?1e3*i.duration:1e3*so*.8;function ao(){var et=(Date.now()-ns)/os,Ve=is(et)*so;et<=1?(this._flyToFrame=$(ao,this),this._move(this.unproject(n.add(r.subtract(n).multiplyBy(es(Ve)/b)),d),this.getScaleZoom(p/Bi(Ve),d),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),ao.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=A(e.paddingTopLeft||e.padding||[0,0]),n=A(e.paddingBottomRight||e.padding||[0,0]),r=this.project(this.getCenter()),h=this.project(t),d=this.getPixelBounds(),p=st([d.min.add(i),d.max.subtract(n)]),g=p.getSize();if(!p.contains(h)){this._enforcingBounds=!0;var b=h.subtract(p.getCenter()),I=p.extend(h).getSize().subtract(g);r.x+=b.x<0?-I.x:I.x,r.y+=b.y<0?-I.y:I.y,this.panTo(this.unproject(r),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(),r=i.divideBy(2).round(),h=n.subtract(r);return!h.x&&!h.y?this:(t.animate&&t.pan?this.panBy(h):(t.pan&&this._rawPanBy(h),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 X(e,i),r=n.toBounds(t.coords.accuracy*2),h=this._locateOptions;if(h.setView){var d=this.getBoundsZoom(r);this.setView(n,h.maxZoom?Math.min(d,h.maxZoom):d)}var p={latlng:n,bounds:r,timestamp:t.timestamp};for(var g in t.coords)typeof t.coords[g]=="number"&&(p[g]=t.coords[g]);this.fire("locationfound",p)}},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(),J(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(G(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)J(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=U("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 at(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=A(i||[0,0]);var n=this.getZoom()||0,r=this.getMinZoom(),h=this.getMaxZoom(),d=t.getNorthWest(),p=t.getSouthEast(),g=this.getSize().subtract(i),b=st(this.project(p,n),this.project(d,n)).getSize(),I=W.any3d?this.options.zoomSnap:1,D=g.x/b.x,R=g.y/b.y,ct=e?Math.max(D,R):Math.min(D,R);return n=this.getScaleZoom(ct,n),I&&(n=Math.round(n/(I/100))*(I/100),n=e?Math.ceil(n/I)*I:Math.floor(n/I)*I),Math.max(r,Math.min(h,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new E(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 K(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(j(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(A(t),e)},layerPointToLatLng:function(t){var e=A(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(j(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(j(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(it(t))},distance:function(t,e){return this.options.crs.distance(j(t),j(e))},containerPointToLayerPoint:function(t){return A(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return A(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(A(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(j(t)))},mouseEventToContainerPoint:function(t){return Sn(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=bn(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");O(e,"scroll",this._onScroll,this),this._containerId=f(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&W.any3d,B(t,"leaflet-container"+(W.touch?" leaflet-touch":"")+(W.retina?" leaflet-retina":"")+(W.ielt9?" leaflet-oldie":"")+(W.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=te(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&e!=="sticky"&&(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),tt(this._mapPane,new E(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(B(t.markerPane,"leaflet-zoom-hide"),B(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){tt(this._mapPane,new E(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var r=this._zoom!==e;this._moveStart(r,i)._move(t,e)._moveEnd(r),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 r=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((r||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 G(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){tt(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?Y:O;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),W.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){G(this._resizeRequest),this._resizeRequest=$(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,r=e==="mouseout"||e==="mouseover",h=t.target||t.srcElement,d=!1;h;){if(n=this._targets[f(h)],n&&(e==="click"||e==="preclick")&&this._draggableMoved(n)){d=!0;break}if(n&&n.listens(e,!0)&&(r&&!Ci(h,t)||(i.push(n),r))||h===this._container)break;h=h.parentNode}return!i.length&&!d&&!r&&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"&&bi(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 r=this._findEventTargets(t,e);if(i){for(var h=[],d=0;d<i.length;d++)i[d].listens(e,!0)&&h.push(i[d]);r=h.concat(r)}if(!!r.length){e==="contextmenu"&&nt(t);var p=r[0],g={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var b=p.getLatLng&&(!p._radius||p._radius<=10);g.containerPoint=b?this.latLngToContainerPoint(p.getLatLng()):this.mouseEventToContainerPoint(t),g.layerPoint=this.containerPointToLayerPoint(g.containerPoint),g.latlng=b?p.getLatLng():this.layerPointToLatLng(g.layerPoint)}for(d=0;d<r.length;d++)if(r[d].fire(e,g,!0),g.originalEvent._stopped||r[d].options.bubblingMouseEvents===!1&&z(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 At(this._mapPane)||new E(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 st([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),r=this.getSize().divideBy(2),h=new K(n.subtract(r),n.add(r)),d=this._getBoundsOffset(h,i,e);return Math.abs(d.x)<=1&&Math.abs(d.y)<=1?t:this.unproject(n.add(d),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new K(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=st(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),r=n.min.subtract(t.min),h=n.max.subtract(t.max),d=this._rebound(r.x,-h.x),p=this._rebound(r.y,-h.y);return new E(d,p)},_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=W.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(){Q(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=U("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=pi,n=this._proxy.style[i];Et(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(){J(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Et(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),r=this._getCenterOffset(t)._divideBy(1-1/n);return i.animate!==!0&&!this.getSize().contains(r)?!1:($(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,B(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&&Q(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 vr(t,e){return new F(t,e)}var dt=mt.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 B(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?(J(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()}}),re=function(t){return new dt(t)};F.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=U("div",e+"control-container",this._container);function n(r,h){var d=e+r+" "+e+h;t[r+h]=U("div",d,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)J(this._controlCorners[t]);J(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var In=dt.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 dt.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(){B(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?(B(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):Q(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Q(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=U("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),oe(e),Mi(e);var n=this._section=U("section",t+"-list");i&&(this._map.on("click",this.collapse,this),O(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var r=this._layersLink=U("a",t+"-toggle",e);r.href="#",r.title="Layers",r.setAttribute("role","button"),O(r,{keydown:function(h){h.keyCode===13&&this._expandSafely()},click:function(h){nt(h),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=U("div",t+"-base",n),this._separator=U("div",t+"-separator",n),this._overlaysList=U("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,r){return this.options.sortFunction(n.layer,r.layer,n.name,r.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Me(this._baseLayersList),Me(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,r=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,r+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&r>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),O(n,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var h=document.createElement("span");e.appendChild(h),h.appendChild(n),h.appendChild(r);var d=t.overlay?this._overlaysList:this._baseLayersList;return d.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t=this._layerControlInputs,e,i,n=[],r=[];this._handlingClick=!0;for(var h=t.length-1;h>=0;h--)e=t[h],i=this._getLayer(e.layerId).layer,e.checked?n.push(i):e.checked||r.push(i);for(h=0;h<r.length;h++)this._map.hasLayer(r[h])&&this._map.removeLayer(r[h]);for(h=0;h<n.length;h++)this._map.hasLayer(n[h])||this._map.addLayer(n[h]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,e,i,n=this._map.getZoom(),r=t.length-1;r>=0;r--)e=t[r],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},_expandSafely:function(){var t=this._section;O(t,"click",nt),this.expand(),setTimeout(function(){Y(t,"click",nt)})}}),yr=function(t,e,i){return new In(t,e,i)},Ii=dt.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=U("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,r){var h=U("a",i,n);return h.innerHTML=t,h.href="#",h.title=e,h.setAttribute("role","button"),h.setAttribute("aria-label",e),oe(h),O(h,"click",Ot),O(h,"click",r,this),O(h,"click",this._refocusOnMap,this),h},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";Q(this._zoomInButton,e),Q(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(B(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(B(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});F.mergeOptions({zoomControl:!0}),F.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ii,this.addControl(this.zoomControl))});var xr=function(t){return new Ii(t)},Wn=dt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=U("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=U("div",e,i)),t.imperial&&(this._iScale=U("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,r;e>5280?(i=e/5280,n=this._getRoundNum(i),this._updateScale(this._iScale,n+" mi",n/i)):(r=this._getRoundNum(e),this._updateScale(this._iScale,r+" ft",r/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}}),wr=function(t){return new Wn(t)},br='<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>',Wi=dt.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(W.inlineSvg?br+" ":"")+"Leaflet</a>"},initialize:function(t){w(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=U("div","leaflet-control-attribution"),oe(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> ')}}});F.mergeOptions({attributionControl:!0}),F.addInitHook(function(){this.options.attributionControl&&new Wi().addTo(this)});var Lr=function(t){return new Wi(t)};dt.Layers=In,dt.Zoom=Ii,dt.Scale=Wn,dt.Attribution=Wi,re.layers=yr,re.zoom=xr,re.scale=wr,re.attribution=Lr;var gt=mt.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}});gt.addTo=function(t,e){return t.addHandler(e,this),this};var Tr={Events:ot},kn=W.touch?"touchstart mousedown":"mousedown",Wt=Ct.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||(O(this._dragStartTarget,kn,this._onDown,this),this._enabled=!0)},disable:function(){!this._enabled||(Wt._dragging===this&&this.finishDrag(!0),Y(this._dragStartTarget,kn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!!this._enabled&&(this._moved=!1,!_i(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){Wt._dragging===this&&this.finishDrag();return}if(!(Wt._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(Wt._dragging=this,this._preventOutline&&bi(this._element),yi(),ee(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,i=Ln(this._element);this._startPoint=new E(e.clientX,e.clientY),this._startPos=At(this._element),this._parentScale=Li(i);var n=t.type==="mousedown";O(document,n?"mousemove":"touchmove",this._onMove,this),O(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 E(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,B(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),B(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),tt(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){!this._enabled||this.finishDrag()},finishDrag:function(t){Q(document.body,"leaflet-dragging"),this._lastTarget&&(Q(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Y(document,"mousemove touchmove",this._onMove,this),Y(document,"mouseup touchend touchcancel",this._onUp,this),xi(),ie(),this._moved&&this._moving&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)}),this._moving=!1,Wt._dragging=!1}});function Dn(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Mr(t,i),t=Sr(t,i),t}function En(t,e,i){return Math.sqrt(se(t,e,i,!0))}function Pr(t,e,i){return se(t,e,i)}function Sr(t,e){var i=t.length,n=typeof Uint8Array!=void 0+""?Uint8Array:Array,r=new n(i);r[0]=r[i-1]=1,ki(t,r,e,0,i-1);var h,d=[];for(h=0;h<i;h++)r[h]&&d.push(t[h]);return d}function ki(t,e,i,n,r){var h=0,d,p,g;for(p=n+1;p<=r-1;p++)g=se(t[p],t[n],t[r],!0),g>h&&(d=p,h=g);h>i&&(e[d]=1,ki(t,e,i,n,d),ki(t,e,i,d,r))}function Mr(t,e){for(var i=[t[0]],n=1,r=0,h=t.length;n<h;n++)Cr(t[n],t[r])>e&&(i.push(t[n]),r=n);return r<h-1&&i.push(t[h-1]),i}var An;function Zn(t,e,i,n,r){var h=n?An:zt(t,i),d=zt(e,i),p,g,b;for(An=d;;){if(!(h|d))return[t,e];if(h&d)return!1;p=h||d,g=De(t,e,p,i,r),b=zt(g,i),p===h?(t=g,h=b):(e=g,d=b)}}function De(t,e,i,n,r){var h=e.x-t.x,d=e.y-t.y,p=n.min,g=n.max,b,I;return i&8?(b=t.x+h*(g.y-t.y)/d,I=g.y):i&4?(b=t.x+h*(p.y-t.y)/d,I=p.y):i&2?(b=g.x,I=t.y+d*(g.x-t.x)/h):i&1&&(b=p.x,I=t.y+d*(p.x-t.x)/h),new E(b,I,r)}function zt(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 Cr(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function se(t,e,i,n){var r=e.x,h=e.y,d=i.x-r,p=i.y-h,g=d*d+p*p,b;return g>0&&(b=((t.x-r)*d+(t.y-h)*p)/g,b>1?(r=i.x,h=i.y):b>0&&(r+=d*b,h+=p*b)),d=t.x-r,p=t.y-h,n?d*d+p*p:new E(r,h)}function ut(t){return!k(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function On(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ut(t)}function zn(t,e){var i,n,r,h,d,p,g,b;if(!t||t.length===0)throw new Error("latlngs not passed");ut(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var I=[];for(var D in t)I.push(e.project(j(t[D])));var R=I.length;for(i=0,n=0;i<R-1;i++)n+=I[i].distanceTo(I[i+1])/2;if(n===0)b=I[0];else for(i=0,h=0;i<R-1;i++)if(d=I[i],p=I[i+1],r=d.distanceTo(p),h+=r,h>n){g=(h-n)/r,b=[p.x-g*(p.x-d.x),p.y-g*(p.y-d.y)];break}return e.unproject(A(b))}var Ir={__proto__:null,simplify:Dn,pointToSegmentDistance:En,closestPointOnSegment:Pr,clipSegment:Zn,_getEdgeIntersection:De,_getBitCode:zt,_sqClosestPointOnSegment:se,isFlat:ut,_flat:On,polylineCenter:zn};function Bn(t,e,i){var n,r=[1,4,2,8],h,d,p,g,b,I,D,R;for(h=0,I=t.length;h<I;h++)t[h]._code=zt(t[h],e);for(p=0;p<4;p++){for(D=r[p],n=[],h=0,I=t.length,d=I-1;h<I;d=h++)g=t[h],b=t[d],g._code&D?b._code&D||(R=De(b,g,D,e,i),R._code=zt(R,e),n.push(R)):(b._code&D&&(R=De(b,g,D,e,i),R._code=zt(R,e),n.push(R)),n.push(g));t=n}return t}function Rn(t,e){var i,n,r,h,d,p,g,b,I;if(!t||t.length===0)throw new Error("latlngs not passed");ut(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var D=[];for(var R in t)D.push(e.project(j(t[R])));var ct=D.length;for(p=g=b=0,i=0,n=ct-1;i<ct;n=i++)r=D[i],h=D[n],d=r.y*h.x-h.y*r.x,g+=(r.x+h.x)*d,b+=(r.y+h.y)*d,p+=d*3;return p===0?I=D[0]:I=[g/p,b/p],e.unproject(A(I))}var Wr={__proto__:null,clipPolygon:Bn,polygonCenter:Rn},Di={project:function(t){return new E(t.lng,t.lat)},unproject:function(t){return new X(t.y,t.x)},bounds:new K([-180,-90],[180,90])},Ei={R:6378137,R_MINOR:6356752314245179e-9,bounds:new K([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,r=this.R_MINOR/i,h=Math.sqrt(1-r*r),d=h*Math.sin(n),p=Math.tan(Math.PI/4-n/2)/Math.pow((1-d)/(1+d),h/2);return n=-i*Math.log(Math.max(p,1e-10)),new E(t.lng*e*i,n)},unproject:function(t){for(var e=180/Math.PI,i=this.R,n=this.R_MINOR/i,r=Math.sqrt(1-n*n),h=Math.exp(-t.y/i),d=Math.PI/2-2*Math.atan(h),p=0,g=.1,b;p<15&&Math.abs(g)>1e-7;p++)b=r*Math.sin(d),b=Math.pow((1-b)/(1+b),r/2),g=Math.PI/2-2*Math.atan(h*b)-d,d+=g;return new X(d*e,t.x*e/i)}},kr={__proto__:null,LonLat:Di,Mercator:Ei,SphericalMercator:si},Dr=s({},It,{code:"EPSG:3395",projection:Ei,transformation:function(){var t=.5/(Math.PI*Ei.R);return Kt(t,.5,-t,.5)}()}),Nn=s({},It,{code:"EPSG:4326",projection:Di,transformation:Kt(1/180,1,-1/180,.5)}),Er=s({},wt,{projection:Di,transformation:Kt(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});wt.Earth=It,wt.EPSG3395=Dr,wt.EPSG3857=li,wt.EPSG900913=Ro,wt.EPSG4326=Nn,wt.Simple=Er;var ft=Ct.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})}}});F.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?k(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 r=this._zoomBoundLayers[n].options;t=r.minZoom===void 0?t:Math.min(t,r.minZoom),e=r.maxZoom===void 0?e:Math.max(e,r.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 Vt=ft.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)}}),Ar=function(t,e){return new Vt(t,e)},bt=Vt.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Vt.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),Vt.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 at;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Zr=function(t,e){return new bt(t,e)},$t=mt.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 r=A(n),h=A(e==="shadow"&&i.shadowAnchor||i.iconAnchor||r&&r.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),h&&(t.style.marginLeft=-h.x+"px",t.style.marginTop=-h.y+"px"),r&&(t.style.width=r.x+"px",t.style.height=r.y+"px")},_createImg:function(t,e){return e=e||document.createElement("img"),e.src=t,e},_getIconUrl:function(t){return W.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Or(t){return new $t(t)}var ae=$t.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 ae.imagePath!="string"&&(ae.imagePath=this._detectIconPath()),(this.options.imagePath||ae.imagePath)+$t.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(i,n,r){var h=n.exec(i);return h&&h[r]};return t=e(t,/^url\((['"])?(.+)\1\)$/,2),t&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=U("div","leaflet-default-icon-path",document.body),e=te(t,"background-image")||te(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):""}}),Fn=gt.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Wt(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),B(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&&Q(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,r=this._marker.options.autoPanPadding,h=At(e._icon),d=i.getPixelBounds(),p=i.getPixelOrigin(),g=st(d.min._subtract(p).add(r),d.max._subtract(p).subtract(r));if(!g.contains(h)){var b=A((Math.max(g.max.x,h.x)-g.max.x)/(d.max.x-g.max.x)-(Math.min(g.min.x,h.x)-g.min.x)/(d.min.x-g.min.x),(Math.max(g.max.y,h.y)-g.max.y)/(d.max.y-g.max.y)-(Math.min(g.min.y,h.y)-g.min.y)/(d.min.y-g.min.y)).multiplyBy(n);i.panBy(b,{animate:!1}),this._draggable._newPos._add(b),this._draggable._startPos._add(b),tt(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=$(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&&(G(this._panRequest),this._panRequest=$(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=At(e._icon),r=e._map.layerPointToLatLng(n);i&&tt(i,n),e._latlng=r,t.latlng=r,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){G(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ee=ft.extend({options:{icon:new ae,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=j(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=j(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||"")),B(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&&O(i,"focus",this._panOnFocus,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&(B(r,e),r.alt=""),this._shadow=r,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),r&&h&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Y(this._icon,"focus",this._panOnFocus,this),J(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&J(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&tt(this._icon,t),this._shadow&&tt(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&&(B(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Fn)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Fn(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&&ht(this._icon,t),this._shadow&&ht(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?A(e.iconSize):A(0,0),n=e.iconAnchor?A(e.iconAnchor):A(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 zr(t,e){return new Ee(t,e)}var kt=ft.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)}}),Ae=kt.extend({options:{fill:!0,radius:10},initialize:function(t,e){w(this,e),this._latlng=j(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=j(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 kt.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 K(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 Br(t,e){return new Ae(t,e)}var Ai=Ae.extend({initialize:function(t,e,i){if(typeof e=="number"&&(e=s({},i,{radius:e})),w(this,e),this._latlng=j(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 at(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:kt.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===It.distance){var r=Math.PI/180,h=this._mRadius/It.R/r,d=i.project([e+h,t]),p=i.project([e-h,t]),g=d.add(p).divideBy(2),b=i.unproject(g).lat,I=Math.acos((Math.cos(h*r)-Math.sin(e*r)*Math.sin(b*r))/(Math.cos(e*r)*Math.cos(b*r)))/r;(isNaN(I)||I===0)&&(I=h/Math.cos(Math.PI/180*e)),this._point=g.subtract(i.getPixelOrigin()),this._radius=isNaN(I)?0:g.x-i.project([b,t-I]).x,this._radiusY=g.y-d.y}else{var D=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(D).x}this._updateBounds()}});function Rr(t,e,i){return new Ai(t,e,i)}var Lt=kt.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=se,r,h,d=0,p=this._parts.length;d<p;d++)for(var g=this._parts[d],b=1,I=g.length;b<I;b++){r=g[b-1],h=g[b];var D=n(t,r,h,!0);D<e&&(e=D,i=n(t,r,h))}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 zn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=j(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new at,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return ut(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=ut(t),n=0,r=t.length;n<r;n++)i?(e[n]=j(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new K;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 E(t,t);!this._rawPxBounds||(this._pxBounds=new K([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,i){var n=t[0]instanceof X,r=t.length,h,d;if(n){for(d=[],h=0;h<r;h++)d[h]=this._map.latLngToLayerPoint(t[h]),i.extend(d[h]);e.push(d)}else for(h=0;h<r;h++)this._projectLatlngs(t[h],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,r,h,d,p,g;for(i=0,r=0,h=this._rings.length;i<h;i++)for(g=this._rings[i],n=0,d=g.length;n<d-1;n++)p=Zn(g[n],g[n+1],t,n,!0),p&&(e[r]=e[r]||[],e[r].push(p[0]),(p[1]!==g[n+1]||n===d-2)&&(e[r].push(p[1]),r++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=Dn(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,r,h,d,p,g=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,h=this._parts.length;i<h;i++)for(p=this._parts[i],n=0,d=p.length,r=d-1;n<d;r=n++)if(!(!e&&n===0)&&En(t,p[r],p[n])<=g)return!0;return!1}});function Nr(t,e){return new Lt(t,e)}Lt._flat=On;var qt=Lt.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 Rn(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=Lt.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof X&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Lt.prototype._setLatLngs.call(this,t),ut(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ut(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new E(e,e);if(t=new K(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,r=this._rings.length,h;n<r;n++)h=Bn(this._rings[n],t,!0),h.length&&this._parts.push(h)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e=!1,i,n,r,h,d,p,g,b;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(h=0,g=this._parts.length;h<g;h++)for(i=this._parts[h],d=0,b=i.length,p=b-1;d<b;p=d++)n=i[d],r=i[p],n.y>t.y!=r.y>t.y&&t.x<(r.x-n.x)*(t.y-n.y)/(r.y-n.y)+n.x&&(e=!e);return e||Lt.prototype._containsPoint.call(this,t,!0)}});function Fr(t,e){return new qt(t,e)}var Tt=bt.extend({initialize:function(t,e){w(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=k(t)?t:t.features,i,n,r;if(e){for(i=0,n=e.length;i<n;i++)r=e[i],(r.geometries||r.geometry||r.features||r.coordinates)&&this.addData(r);return this}var h=this.options;if(h.filter&&!h.filter(t))return this;var d=Ze(t,h);return d?(d.feature=Be(t),d.defaultOptions=d.options,this.resetStyle(d),h.onEachFeature&&h.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 Ze(t,e){var i=t.type==="Feature"?t.geometry:t,n=i?i.coordinates:null,r=[],h=e&&e.pointToLayer,d=e&&e.coordsToLatLng||Zi,p,g,b,I;if(!n&&!i)return null;switch(i.type){case"Point":return p=d(n),Hn(h,t,p,e);case"MultiPoint":for(b=0,I=n.length;b<I;b++)p=d(n[b]),r.push(Hn(h,t,p,e));return new bt(r);case"LineString":case"MultiLineString":return g=Oe(n,i.type==="LineString"?0:1,d),new Lt(g,e);case"Polygon":case"MultiPolygon":return g=Oe(n,i.type==="Polygon"?1:2,d),new qt(g,e);case"GeometryCollection":for(b=0,I=i.geometries.length;b<I;b++){var D=Ze({geometry:i.geometries[b],type:"Feature",properties:t.properties},e);D&&r.push(D)}return new bt(r);case"FeatureCollection":for(b=0,I=i.features.length;b<I;b++){var R=Ze(i.features[b],e);R&&r.push(R)}return new bt(r);default:throw new Error("Invalid GeoJSON object.")}}function Hn(t,e,i,n){return t?t(e,i):new Ee(i,n&&n.markersInheritOptions&&n)}function Zi(t){return new X(t[1],t[0],t[2])}function Oe(t,e,i){for(var n=[],r=0,h=t.length,d;r<h;r++)d=e?Oe(t[r],e-1,i):(i||Zi)(t[r]),n.push(d);return n}function Oi(t,e){return t=j(t),t.alt!==void 0?[v(t.lng,e),v(t.lat,e),v(t.alt,e)]:[v(t.lng,e),v(t.lat,e)]}function ze(t,e,i,n){for(var r=[],h=0,d=t.length;h<d;h++)r.push(e?ze(t[h],ut(t[h])?0:e-1,i,n):Oi(t[h],n));return!e&&i&&r.push(r[0].slice()),r}function Gt(t,e){return t.feature?s({},t.feature,{geometry:e}):Be(e)}function Be(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var zi={toGeoJSON:function(t){return Gt(this,{type:"Point",coordinates:Oi(this.getLatLng(),t)})}};Ee.include(zi),Ai.include(zi),Ae.include(zi),Lt.include({toGeoJSON:function(t){var e=!ut(this._latlngs),i=ze(this._latlngs,e?1:0,!1,t);return Gt(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),qt.include({toGeoJSON:function(t){var e=!ut(this._latlngs),i=e&&!ut(this._latlngs[0]),n=ze(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),Gt(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Vt.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),Gt(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(r){if(r.toGeoJSON){var h=r.toGeoJSON(t);if(i)n.push(h.geometry);else{var d=Be(h);d.type==="FeatureCollection"?n.push.apply(n,d.features):n.push(d)}}}),i?Gt(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});function Un(t,e){return new Tt(t,e)}var Hr=Un,Re=ft.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&&(B(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){J(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&&Ht(this._image),this},bringToBack:function(){return this._map&&Ut(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:U("img");if(B(e,"leaflet-image-layer"),this._zoomAnimated&&B(e,"leaflet-zoom-animated"),this.options.className&&B(e,this.options.className),e.onselectstart=_,e.onmousemove=_,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;Et(this._image,i,e)},_reset:function(){var t=this._image,e=new K(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();tt(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){ht(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()}}),Ur=function(t,e,i){return new Re(t,e,i)},Vn=Re.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:U("video");if(B(e,"leaflet-image-layer"),this._zoomAnimated&&B(e,"leaflet-zoom-animated"),this.options.className&&B(e,this.options.className),e.onselectstart=_,e.onmousemove=_,e.onloadeddata=u(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],r=0;r<i.length;r++)n.push(i[r].src);this._url=i.length>0?n:[e.src];return}k(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 h=0;h<this._url.length;h++){var d=U("source");d.src=this._url[h],e.appendChild(d)}}});function Vr(t,e,i){return new Vn(t,e,i)}var $n=Re.extend({_initImage:function(){var t=this._image=this._url;B(t,"leaflet-image-layer"),this._zoomAnimated&&B(t,"leaflet-zoom-animated"),this.options.className&&B(t,this.options.className),t.onselectstart=_,t.onmousemove=_}});function $r(t,e,i){return new $n(t,e,i)}var vt=ft.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof X||k(t))?(this._latlng=j(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&&ht(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&ht(this._container,1),this.bringToFront(),this.options.interactive&&(B(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(ht(this._container,0),this._removeTimeout=setTimeout(u(J,void 0,this._container),200)):J(this._container),this.options.interactive&&(Q(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=j(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&&Ht(this._container),this},bringToBack:function(){return this._map&&Ut(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof bt){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=A(this.options.offset),i=this._getAnchor();this._zoomAnimated?tt(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,r=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=r+"px"}},_getAnchor:function(){return[0,0]}});F.include({_initOverlay:function(t,e,i,n){var r=e;return r instanceof t||(r=new t(n).setContent(e)),i&&r.setLatLng(i),r}}),ft.include({_initOverlay:function(t,e,i,n){var r=i;return r instanceof t?(w(r,n),r._source=this):(r=e&&!n?e:new t(n,this),r.setContent(i)),r}});var Ne=vt.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,vt.prototype.openOn.call(this,t)},onAdd:function(t){vt.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof kt||this._source.on("preclick",Zt))},onRemove:function(t){vt.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof kt||this._source.off("preclick",Zt))},getEvents:function(){var t=vt.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=U("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=U("div",t+"-content-wrapper",e);if(this._contentNode=U("div",t+"-content",i),oe(e),Mi(this._contentNode),O(e,"contextmenu",Zt),this._tipContainer=U("div",t+"-tip-container",e),this._tip=U("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=U("a",t+"-close-button",e);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">×</span>',O(n,"click",function(r){nt(r),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,r=this.options.maxHeight,h="leaflet-popup-scrolled";r&&n>r?(e.height=r+"px",B(t,h)):Q(t,h),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();tt(this._container,e.add(i))},_adjustPan:function(){if(!!this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(te(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,r=new E(this._containerLeft,-i-this._containerBottom);r._add(At(this._container));var h=t.layerPointToContainerPoint(r),d=A(this.options.autoPanPadding),p=A(this.options.autoPanPaddingTopLeft||d),g=A(this.options.autoPanPaddingBottomRight||d),b=t.getSize(),I=0,D=0;h.x+n+g.x>b.x&&(I=h.x+n-b.x+g.x),h.x-I-p.x<0&&(I=h.x-p.x),h.y+i+g.y>b.y&&(D=h.y+i-b.y+g.y),h.y-D-p.y<0&&(D=h.y-p.y),(I||D)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([I,D]))}},_getAnchor:function(){return A(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),qr=function(t,e){return new Ne(t,e)};F.mergeOptions({closePopupOnClick:!0}),F.include({openPopup:function(t,e,i){return this._initOverlay(Ne,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),ft.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Ne,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 instanceof bt||(this._popup._source=this),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)){Ot(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof kt)){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 Fe=vt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){vt.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){vt.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=vt.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=U("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,r=this._container,h=n.latLngToContainerPoint(n.getCenter()),d=n.layerPointToContainerPoint(t),p=this.options.direction,g=r.offsetWidth,b=r.offsetHeight,I=A(this.options.offset),D=this._getAnchor();p==="top"?(e=g/2,i=b):p==="bottom"?(e=g/2,i=0):p==="center"?(e=g/2,i=b/2):p==="right"?(e=0,i=b/2):p==="left"?(e=g,i=b/2):d.x<h.x?(p="right",e=0,i=b/2):(p="left",e=g+(I.x+D.x)*2,i=b/2),t=t.subtract(A(e,i,!0)).add(I).add(D),Q(r,"leaflet-tooltip-right"),Q(r,"leaflet-tooltip-left"),Q(r,"leaflet-tooltip-top"),Q(r,"leaflet-tooltip-bottom"),B(r,"leaflet-tooltip-"+p),tt(r,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&ht(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return A(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Gr=function(t,e){return new Fe(t,e)};F.include({openTooltip:function(t,e,i){return this._initOverlay(Fe,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),ft.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Fe,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 instanceof bt||(this._tooltip._source=this),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&&(O(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),O(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 qn=$t.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?(Me(e),e.appendChild(i.html)):e.innerHTML=i.html!==!1?i.html:"",i.bgPos){var n=A(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Xr(t){return new qn(t)}$t.Default=ae;var le=ft.extend({options:{tileSize:256,opacity:1,updateWhenIdle:W.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(),J(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Ht(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ut(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=m(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 E?t:new E(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,r=e.length,h;n<r;n++)h=e[n].style.zIndex,e[n]!==this._container&&h&&(i=t(i,+h));isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(!!this._map&&!W.ielt9){ht(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var r=this._tiles[n];if(!(!r.current||!r.loaded)){var h=Math.min(1,(t-r.loaded)/200);ht(r.el,h),h<1?e=!0:(r.active?i=!0:this._onOpaqueTile(r),r.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(G(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this))}},_onOpaqueTile:_,_initContainer:function(){this._container||(this._container=U("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)):(J(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],r=this._map;return n||(n=this._levels[t]={},n.el=U("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=r.project(r.unproject(r.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,r.getCenter(),r.getZoom()),_(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:_,_onRemoveLevel:_,_onCreateLevel:_,_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)J(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 r=Math.floor(t/2),h=Math.floor(e/2),d=i-1,p=new E(+r,+h);p.z=+d;var g=this._tileCoordsToKey(p),b=this._tiles[g];return b&&b.active?(b.retain=!0,!0):(b&&b.loaded&&(b.retain=!0),d>n?this._retainParent(r,h,d,n):!1)},_retainChildren:function(t,e,i,n){for(var r=2*t;r<2*t+2;r++)for(var h=2*e;h<2*e+2;h++){var d=new E(r,h);d.z=i+1;var p=this._tileCoordsToKey(d),g=this._tiles[p];if(g&&g.active){g.retain=!0;continue}else g&&g.loaded&&(g.retain=!0);i+1<n&&this._retainChildren(r,h,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 r=Math.round(e);this.options.maxZoom!==void 0&&r>this.options.maxZoom||this.options.minZoom!==void 0&&r<this.options.minZoom?r=void 0:r=this._clampZoom(r);var h=this.options.updateWhenZooming&&r!==this._tileZoom;(!n||h)&&(this._tileZoom=r,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),r!==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),r=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();W.any3d?Et(t.el,r,n):tt(t.el,r)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,r=this._map.getPixelWorldBounds(this._tileZoom);r&&(this._globalTileRange=this._pxBoundsToTileRange(r)),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),r=e.project(t,this._tileZoom).floor(),h=e.getSize().divideBy(n*2);return new K(r.subtract(h),r.add(h))},_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),r=this._pxBoundsToTileRange(n),h=r.getCenter(),d=[],p=this.options.keepBuffer,g=new K(r.getBottomLeft().subtract([p,-p]),r.getTopRight().add([p,-p]));if(!(isFinite(r.min.x)&&isFinite(r.min.y)&&isFinite(r.max.x)&&isFinite(r.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var b in this._tiles){var I=this._tiles[b].coords;(I.z!==this._tileZoom||!g.contains(new E(I.x,I.y)))&&(this._tiles[b].current=!1)}if(Math.abs(i-this._tileZoom)>1){this._setView(t,i);return}for(var D=r.min.y;D<=r.max.y;D++)for(var R=r.min.x;R<=r.max.x;R++){var ct=new E(R,D);if(ct.z=this._tileZoom,!!this._isValidTile(ct)){var Bt=this._tiles[this._tileCoordsToKey(ct)];Bt?Bt.current=!0:d.push(ct)}}if(d.sort(function(Dt,Bi){return Dt.distanceTo(h)-Bi.distanceTo(h)}),d.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Ue=document.createDocumentFragment();for(R=0;R<d.length;R++)this._addTile(d[R],Ue);this._level.el.appendChild(Ue)}}}},_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),r=n.add(i),h=e.unproject(n,t.z),d=e.unproject(r,t.z);return[h,d]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new at(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 E(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];!e||(J(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){B(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=_,t.onmousemove=_,W.ielt9&&this.options.opacity<1&&ht(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),u(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&$(u(this._tileReady,this,t,null,r)),tt(r,i),this._tiles[n]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,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?(ht(i.el,0),G(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(B(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),W.ielt9||!this._map._fadeAnimated?$(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 E(this._wrapX?y(t.x,this._wrapX):t.x,this._wrapY?y(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new K(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 jr(t){return new le(t)}var Xt=le.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&&W.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 O(i,"load",u(this._tileOnLoad,this,e,i)),O(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:W.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 C(this._url,s(e,this.options))},_tileOnLoad:function(t,e){W.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=_,e.onerror=_,!e.complete)){e.src=Z;var i=this._tiles[t].coords;J(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",Z),le.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===Z))return le.prototype._tileReady.call(this,t,e,i)}});function Gn(t,e){return new Xt(t,e)}var Xn=Xt.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 r=e.detectRetina&&W.retina?2:1,h=this.getTileSize();i.width=h.x*r,i.height=h.y*r,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,Xt.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=st(i.project(e[0]),i.project(e[1])),r=n.min,h=n.max,d=(this._wmsVersion>=1.3&&this._crs===Nn?[r.y,r.x,h.y,h.x]:[r.x,r.y,h.x,h.y]).join(","),p=Xt.prototype.getTileUrl.call(this,t);return p+M(this.wmsParams,p,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+d},setParams:function(t,e){return s(this.wmsParams,t),e||this.redraw(),this}});function Yr(t,e){return new Xn(t,e)}Xt.WMS=Xn,Gn.wms=Yr;var Pt=ft.extend({options:{padding:.1},initialize:function(t){w(this,t),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&B(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),r=this._map.project(this._center,e),h=n.multiplyBy(-i).add(r).subtract(this._map._getNewPixelOrigin(t,e));W.any3d?Et(this._container,h,i):tt(this._container,h)},_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 K(i,i.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),jn=Pt.extend({options:{tolerance:0},getEvents:function(){var t=Pt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Pt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");O(t,"mousemove",this._onMouseMove,this),O(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),O(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){G(this._redrawRequest),delete this._ctx,J(this._container),Y(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)){Pt.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=W.retina?2:1;tt(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",W.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Pt.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,r;for(r=0;r<e.length;r++){if(n=Number(e[r]),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||$(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new K,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,r,h,d=t._parts,p=d.length,g=this._ctx;if(!!p){for(g.beginPath(),i=0;i<p;i++){for(n=0,r=d[i].length;n<r;n++)h=d[i][n],g[n?"lineTo":"moveTo"](h.x,h.y);e&&g.closePath()}this._fillStroke(g,t)}}},_updateCircle:function(t){if(!(!this._drawing||t._empty())){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),r=(Math.max(Math.round(t._radiusY),1)||n)/n;r!==1&&(i.save(),i.scale(1,r)),i.beginPath(),i.arc(e.x,e.y/r,n,0,Math.PI*2,!1),r!==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,r=this._drawFirst;r;r=r.next)i=r.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&&(Q(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,r=this._drawFirst;r;r=r.next)i=r.layer,i.options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(B(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 Yn(t){return W.canvas?new jn(t):null}var he=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">')}}(),Kr={_initContainer:function(){this._container=U("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Pt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=he("shape");B(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=he("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;J(e),t.removeInteractiveTarget(e),delete this._layers[f(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,r=t._container;r.stroked=!!n.stroke,r.filled=!!n.fill,n.stroke?(e||(e=t._stroke=he("stroke")),r.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=k(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(r.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=he("fill")),r.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(r.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){Ht(t._container)},_bringToBack:function(t){Ut(t._container)}},He=W.vml?he:Qi,ue=Pt.extend({_initContainer:function(){this._container=He("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=He("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){J(this._container),Y(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Pt.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)),tt(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=He("path");t.options.className&&B(e,t.options.className),t.options.interactive&&B(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){J(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,tn(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,r="a"+i+","+n+" 0 1,0 ",h=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+r+i*2+",0 "+r+-i*2+",0 ";this._setPath(t,h)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){Ht(t._path)},_bringToBack:function(t){Ut(t._path)}});W.vml&&ue.include(Kr);function Kn(t){return W.svg||W.vml?new ue(t):null}F.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&&Yn(t)||Kn(t)}});var Jn=qt.extend({initialize:function(t,e){qt.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 Jr(t,e){return new Jn(t,e)}ue.create=He,ue.pointsToPath=tn,Tt.geometryToLayer=Ze,Tt.coordsToLatLng=Zi,Tt.coordsToLatLngs=Oe,Tt.latLngToCoords=Oi,Tt.latLngsToCoords=ze,Tt.getFeature=Gt,Tt.asFeature=Be,F.mergeOptions({boxZoom:!0});var Qn=gt.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(){O(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Y(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){J(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(),ee(),yi(),this._startPoint=this._map.mouseEventToContainerPoint(t),O(document,{contextmenu:Ot,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=U("div","leaflet-zoom-box",this._container),B(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new K(this._point,this._startPoint),i=e.getSize();tt(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(J(this._box),Q(this._container,"leaflet-crosshair")),ie(),xi(),Y(document,{contextmenu:Ot,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 at(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())}});F.addInitHook("addHandler","boxZoom",Qn),F.mergeOptions({doubleClickZoom:!0});var to=gt.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,r=t.originalEvent.shiftKey?i-n:i+n;e.options.doubleClickZoom==="center"?e.setZoom(r):e.setZoomAround(t.containerPoint,r)}});F.addInitHook("addHandler","doubleClickZoom",to),F.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var eo=gt.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Wt(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))}B(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Q(this._map._container,"leaflet-grab"),Q(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=st(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,r=(n-e+i)%t+e-i,h=(n+e+i)%t-e-i,d=Math.abs(r+i)<Math.abs(h+i)?r:h;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 r=this._lastPos.subtract(this._positions[0]),h=(this._lastTime-this._times[0])/1e3,d=i.easeLinearity,p=r.multiplyBy(d/h),g=p.distanceTo([0,0]),b=Math.min(i.inertiaMaxSpeed,g),I=p.multiplyBy(b/g),D=b/(i.inertiaDeceleration*d),R=I.multiplyBy(-D/2).round();!R.x&&!R.y?e.fire("moveend"):(R=e._limitOffset(R,e.options.maxBounds),$(function(){e.panBy(R,{duration:D,easeLinearity:d,noMoveStart:!0,animate:!0})}))}}});F.addInitHook("addHandler","dragging",eo),F.mergeOptions({keyboard:!0,keyboardPanDelta:80});var io=gt.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"),O(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(),Y(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,r;for(n=0,r=i.left.length;n<r;n++)e[i.left[n]]=[-1*t,0];for(n=0,r=i.right.length;n<r;n++)e[i.right[n]]=[t,0];for(n=0,r=i.down.length;n<r;n++)e[i.down[n]]=[0,t];for(n=0,r=i.up.length;n<r;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){var e=this._zoomKeys={},i=this.keyCodes,n,r;for(n=0,r=i.zoomIn.length;n<r;n++)e[i.zoomIn[n]]=t;for(n=0,r=i.zoomOut.length;n<r;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){O(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Y(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){if(!i._panAnim||!i._panAnim._inProgress)if(n=this._panKeys[e],t.shiftKey&&(n=A(n).multiplyBy(3)),i.options.maxBounds&&(n=i._limitOffset(A(n),i.options.maxBounds)),i.options.worldCopyJump){var r=i.wrapLatLng(i.unproject(i.project(i.getCenter()).add(n)));i.panTo(r)}else i.panBy(n)}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;Ot(t)}}});F.addInitHook("addHandler","keyboard",io),F.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var no=gt.extend({addHooks:function(){O(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Y(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Mn(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),Ot(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),r=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,h=i?Math.ceil(r/i)*i:r,d=t._limitZoom(e+(this._delta>0?h:-h))-e;this._delta=0,this._startTime=null,d&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+d):t.setZoomAround(this._lastMousePos,e+d))}});F.addInitHook("addHandler","scrollWheelZoom",no);var Qr=600;F.mergeOptions({tapHold:W.touchNative&&W.safari&&W.mobile,tapTolerance:15});var oo=gt.extend({addHooks:function(){O(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Y(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 E(e.clientX,e.clientY),this._holdTimeout=setTimeout(u(function(){this._cancel(),this._isTapValid()&&(O(document,"touchend",nt),O(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),Qr),O(document,"touchend touchcancel contextmenu",this._cancel,this),O(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){Y(document,"touchend",nt),Y(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),Y(document,"touchend touchcancel contextmenu",this._cancel,this),Y(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new E(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)}});F.addInitHook("addHandler","tapHold",oo),F.mergeOptions({touchZoom:W.touch,bounceAtZoomLimits:!0});var ro=gt.extend({addHooks:function(){B(this._map._container,"leaflet-touch-zoom"),O(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Q(this._map._container,"leaflet-touch-zoom"),Y(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(),O(document,"touchmove",this._onTouchMove,this),O(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]),r=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,r===1)return}else{var h=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(r===1&&h.x===0&&h.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(h),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),G(this._animRequest);var d=u(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=$(d,this,!0),nt(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,G(this._animRequest),Y(document,"touchmove",this._onTouchMove,this),Y(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))}});F.addInitHook("addHandler","touchZoom",ro),F.BoxZoom=Qn,F.DoubleClickZoom=to,F.Drag=eo,F.Keyboard=io,F.ScrollWheelZoom=no,F.TapHold=oo,F.TouchZoom=ro,a.Bounds=K,a.Browser=W,a.CRS=wt,a.Canvas=jn,a.Circle=Ai,a.CircleMarker=Ae,a.Class=mt,a.Control=dt,a.DivIcon=qn,a.DivOverlay=vt,a.DomEvent=gr,a.DomUtil=pr,a.Draggable=Wt,a.Evented=Ct,a.FeatureGroup=bt,a.GeoJSON=Tt,a.GridLayer=le,a.Handler=gt,a.Icon=$t,a.ImageOverlay=Re,a.LatLng=X,a.LatLngBounds=at,a.Layer=ft,a.LayerGroup=Vt,a.LineUtil=Ir,a.Map=F,a.Marker=Ee,a.Mixin=Tr,a.Path=kt,a.Point=E,a.PolyUtil=Wr,a.Polygon=qt,a.Polyline=Lt,a.Popup=Ne,a.PosAnimation=Cn,a.Projection=kr,a.Rectangle=Jn,a.Renderer=Pt,a.SVG=ue,a.SVGOverlay=$n,a.TileLayer=Xt,a.Tooltip=Fe,a.Transformation=ai,a.Util=Le,a.VideoOverlay=Vn,a.bind=u,a.bounds=st,a.canvas=Yn,a.circle=Rr,a.circleMarker=Br,a.control=re,a.divIcon=Xr,a.extend=s,a.featureGroup=Zr,a.geoJSON=Un,a.geoJson=Hr,a.gridLayer=jr,a.icon=Or,a.imageOverlay=Ur,a.latLng=j,a.latLngBounds=it,a.layerGroup=Ar,a.map=vr,a.marker=zr,a.point=A,a.polygon=Fr,a.polyline=Nr,a.popup=qr,a.rectangle=Jr,a.setOptions=w,a.stamp=f,a.svg=Kn,a.svgOverlay=$r,a.tileLayer=Gn,a.tooltip=Gr,a.transformation=Kt,a.version=o,a.videoOverlay=Vr;var ts=window.L;a.noConflict=function(){return window.L=ts,this},window.L=a})});var co={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 fo={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 $e={base:{parent:void 0,name:"base",fill:"gradient",isolineColor:"inverted",isolineText:!0,vectorType:"arrows",vectorColor:"inverted",vectorFactor:1,streamLineColor:"none",streamLineSpeedFactor:1,streamLineStatic:!1,showBelowMin:!0,showAboveMax:!0,colorScheme:"divergingbluered",colors:void 0,colorMap:void 0,levels:void 0,blurRadius:0,addDegrees:0,units:"",extraUnits:void 0,mask:"none",gl:{animationSpeed:1,noiseTexturePow:5,vectorFieldFactor:1,animationIntensity:5,wavesCount:4}},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 mo,po,_o;function go({colorStyles:a={},units:o={},colorSchemes:s={}}={}){S("WxTile lib setup: start"),mo=Object.assign({},co,o),po=Object.assign({},s,fo);let l=Object.assign({},a,$e);_o=_s(l),S("WxTile lib setup: styles unrolled");try{(async()=>(await document.fonts.load("32px barbs"),await document.fonts.load("32px arrows")))()}catch{S("WxTile lib setup: fonts not loaded")}S("WxTile lib setup is done.")}function St(){return _o}function ce(){return po}function qe(a,o,s){S("makeConverter: From=",a," To=",o);let l=x=>x;if(l.trivial=!0,a===o)return S("Trivial converter"),l;let u=Object.assign({},mo,s),c=u[a],f=u[o];if(!c||!f)return S("Inconvertible units. Trivial converter"),l;let[m,y,_]=c,[v,T,P]=f;if(m!==v||!y||!T)return S("Inconvertible units. Trivial converter"),l;let w=y/T,M=((_||0)-(P||0))/T;return M?x=>w*x+M:x=>w*x}function _s(a){let o=Object.assign({},$e);for(let c in a){let f=a[c];if(Array.isArray(f))for(let m=0;m<f.length;++m)o[c+"["+m+"]"]=Object.assign({},f[m]);else o[c]=Object.assign({},f)}let s=Object.assign({},$e.base),l=(c,f)=>{if(f==="base")return s;let m=c[f];if(!m)return s;(!m.parent||!(m.parent in c))&&(m.parent="base");let y=l(c,m.parent);return Object.assign(m,Object.assign({},y,m,{parent:"base"}))},u={base:s};for(let c in o)u[c]=l(o,c);return u}function de(a){let o=new Map;return(s,...l)=>{let u=o.get(s);if(u)return u;let c=a(s,...l);return o.set(s,c),c.catch(f=>f.name==="AbortError"&&o.delete(s)),c}}async function gs(a,o){let s=await fetch(a,o),l=await s.blob();if(!s.ok){let u=s.headers.get("x-reason");throw console.log(u),{name:"Tile loading failed",reason:u}}return await createImageBitmap(l,{premultiplyAlpha:"none"})}var Ni=class{constructor(o,s,l,u){this.raw=o;this.dmin=s;this.dmax=l;this.dmul=u;this.radius=0}get integral(){return this.integral_||(this.integral_=xs(this.raw))}};function jt(a,o,s=!0){let l=Object.assign(document.createElement("canvas"),{width:a,height:o,imageSmoothingEnabled:!1}).getContext("2d",{willReadFrequently:s});if(!l)throw new Error("Cannot get canvas context");return l}function vs(a){let{width:o,height:s}=a,l=jt(o,s);return l.drawImage(a,0,0),l.getImageData(0,0,o,s)}async function Fi(a,o){return vs(await gs(a,o))}function ys(a){a.data[34]<1&&S("Warning: image is in too old format. Check the version of the Splitter.");let o=new Uint16Array(a.data.buffer),s=new Uint16Array(o.length/2);for(let y=0;y<s.length;y++)s[y]=o[y*2];let l=new Uint8Array(8);for(let y=0;y<8;++y)l[y]=a.data[y*4+2];let u=new DataView(l.buffer),c=u.getFloat32(0,!0),f=u.getFloat32(4,!0),m=(f-c)/65535;return new Ni(s,c,f,m)}async function Hi(a,o){return ys(await Fi(a,o))}function xs(a){let o=new Uint32Array(66564),s=new Uint32Array(258*258);o[0]=a[0],s[0]=a[0]?1:0;for(let l=1;l<258;++l){o[l]=a[l]+o[l-1],s[l]=(a[l]?1:0)+s[l-1];let u=258*l;o[u]=a[u]+o[u-258],s[u]=(a[u]?1:0)+s[u-258]}for(let l=1;l<258;++l)for(let u=1;u<258;++u){let c=258*l+u;o[c]=a[c]+o[c-258]+o[c-1]-o[c-259],s[c]=(a[c]?1:0)+s[c-258]+s[c-1]-s[c-259]}return{integral:o,integralNZ:s[66563]===66564?null:s}}function ws(a){let{integral:o}=a.integral;a.raw[0]=o[0];for(let s=1;s<258;s++){a.raw[s]=o[s]-o[s-1],a.raw[258*s]=o[258*s]-o[258*(s-1)];for(let l=1;l<258;l++){let u=258*s+l;a.raw[u]=o[u-259]+o[u]-o[u-258]-o[u-1]}}return a}function vo(a,o){if(o<0&&(o=0),o===a.radius)return a;if(a.radius=o,!o)return ws(a);let{integral:s,integralNZ:l}=a.integral;for(let u=2;u<256;u++)for(let c=2;c<256;c++){let f=258*u+c;if(!a.raw[f])continue;let m=Math.min(o,c-1,256-c),y=Math.min(o,u-1,256-u),_=258*(u-y-1)+c,v=258*(u+y)+c,T;if(l){let k=l[_-m-1],z=l[_+m],Z=l[v-m-1],H=l[v+m];T=k+H-z-Z}else T=(2*m+1)*(2*y+1);let P=s[_-m-1],w=s[_+m],M=s[v-m-1],x=s[v+m],C=P+x-w-M;a.raw[f]=C/T}for(let u=2;u<256;u++){let c=258+u;if(a.raw[c]){let _=u,v=Math.min(o,_-1,256-_),T=258+_,P;if(l){let V=l[T-v-1];P=0+l[T+v]-0-V}else P=(2*v+1)*2;let w=0,M=0,x=s[T-v-1],C=s[T+v],z=(w+C-M-x)/P;a.raw[c-258]=z,a.raw[c]=z}let f=258*256+u;if(a.raw[f]){let _=u,v=Math.min(o,_-1,256-_),T=258*255+_,P=258*257+_,w=s[T-v-1],M=s[T+v],x=s[P-v-1],C=s[P+v],k=w+C-M-x,z;if(l){let H=l[T-v-1],V=l[T+v],N=l[P-v-1],q=l[P+v];z=H+q-V-N}else z=(2*v+1)*2;let Z=k/z;a.raw[f]=Z,a.raw[f+258]=Z}let m=258*u+1;if(a.raw[m]){let _=u,v=Math.min(o,_-1,256-_),T=258*(_-v-1)+1,P=258*(_+v)+1,w;if(l){let V=l[T],N=0;w=0+l[P]-V-N}else w=(2*v+1)*2;let M=0,x=s[T],C=0,k=s[P],Z=(M+k-x-C)/w;a.raw[m-1]=Z,a.raw[m]=Z}let y=258*u+256;if(a.raw[y]){let _=u,v=Math.min(o,_-1,256-_),T=258*(_-v-1)+256,P=258*(_+v)+256,w;if(l){let H=l[T-1],V=l[T+1],N=l[P-1],q=l[P+1];w=H+q-V-N}else w=2*(2*v+1);let M=s[T-1],x=s[T+1],C=s[P-1],k=s[P+1],Z=(M+k-x-C)/w;a.raw[y]=Z,a.raw[y+1]=Z}}return a}function lt(a){let o=a>>0&255,s=a>>8&255,l=a>>16&255,u=o.toString(16),c=s.toString(16),f=l.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 Mt(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 S("wrong color format",a),0}async function Rt(a,o){let s=await fetch(a,o);if(!s.ok)throw new Error("error:"+a+" - "+s.statusText);return s.json()}function Ui(a,o,s){let l=a>>0&255,u=a>>8&255,c=a>>16&255,f=a>>>24,m=o>>0&255,y=o>>8&255,_=o>>16&255,v=o>>>24,T=l+s*(m-l),P=u+s*(y-u),w=c+s*(_-c),M=f+s*(v-f);return T|P<<8|w<<16|M<<24}function yo(a,o,s){let l=[];for(let u=0;u<s;++u)l.push(u*(o-a)/(s-1)+a);return l}var S=(...a)=>{};function Vi(a){return a[0]==="#"&&a.length===4?"#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:a}function Ge(a,{x:o,y:s,z:l}){return a.replace("{x}",`${o}`).replace("{y}",`${s}`).replace("{z}",`${l}`)}function Xe({x:a,y:o,z:s}){return`${s}-${a}-${o}`}var bs="A".charCodeAt(0);var fe=class{constructor(){this.qtree={nodes:null};this.qtreedepth=0;S("QTree.constructor")}async load(o,s){try{let l=await Rt(o,s);this.qtree=xo(l,{pos:0})}catch(l){throw new Error(`Failed to load QTree: ${l.message}`)}this.qtreedepth=wo(this.qtree),S(`QTree.load: qtreedepth=${this.qtreedepth}`)}check(o){let s=o.z-this.qtreedepth,l=s>=0,u=l?{x:o.x>>s,y:o.y>>s,z:this.qtreedepth}:{...o};return bo(this.qtree,u,l)}};function xo(a,o){let s=a.charCodeAt(o.pos)-bs;o.pos++;let l=[1,2,4,8].map(u=>s&u?xo(a,o):null);return{nodes:l.some(u=>u)?l:null}}function wo(a){return a?.nodes?1+Math.max(...a.nodes.map(wo)):0}function bo(a,o,s){return a===null?"land":s&&!o.z?"mixed":a.nodes===null?"sea":o.z?(o.z--,bo(a.nodes[(o.y>>o.z&1)<<1|o.x>>o.z&1],o,s)):"mixed"}function Ls(a,o,s){return a>s?s:a<o?o:a}var me=class{constructor(o,s,[l,u],c){S("RawCLUT.constructor");let f=u-l;this.levelIndex=new Uint32Array(65536),this.colorsI=new Uint32Array(65536);let m=[];this.DataToStyle=qe(s,o.units,o.extraUnits),this.DataToStyle.trivial&&(o.units=s),c&&(this.DataToKnots=qe(s,"knot"));let y=qe(o.units,s,o.extraUnits),_=x=>~~(65535*Ls((y(x)-l)/(u-l),0,1));if(Array.isArray(o.colorMap)){o.colorMap.sort((x,C)=>x[0]<C[0]?-1:x[0]>C[0]?1:0);for(let[x]of o.colorMap)m.push(_(x))}else{if(o.levels||(o.levels=yo(this.DataToStyle(l),this.DataToStyle(u),10)),o.levels.sort((x,C)=>x<C?-1:x>C?1:0),!o.colors){let x=ce();o.colorScheme&&o.colorScheme in x?o.colors=x[o.colorScheme]:o.colors=x.wb}for(let x of o.levels)m.push(_(x))}let v=65536,T=je(v,o);this.ticks=T.ticks;let P=T.ticks[0].data,M=T.ticks[T.ticks.length-1].data-P;for(let x=0;x<65536;++x){let C=f*x/65535+l,k=this.DataToStyle(C),z=Math.round((v-1)*(k-P)/M);z<=0?this.colorsI[x]=o.showBelowMin?T.colors[0]:0:z>=v?this.colorsI[x]=o.showAboveMax?T.colors[v-1]:0:this.colorsI[x]=T.colors[z]}this.colorsI[0]=0;for(let x=0;x<m[0];++x)this.levelIndex[x]=0;for(let x=0;x<m.length-1;x++)for(let C=m[x];C<m[x+1]+1;++C)this.levelIndex[C]=x;for(let x=m[m.length-1];x<65536;++x)this.levelIndex[x]=m.length-1}};function Lo(a){if(a!==0&&-.1<a&&a<.1)return a.toExponential(2);let o=a.toString();return o.split(".")[1]?.length>2?a.toFixed(2):o}function je(a,o){let s={size:a,showBelowMin:o.showBelowMin,showAboveMax:o.showAboveMax,units:o.units,colors:new Uint32Array(a),ticks:[]},{colorMap:l,levels:u,colors:c}=o,f=o.fill!=="solid";if(l){let P=l[0][0],w=l[l.length-1][0]-P;for(let[M,x]of l){let C=~~((M-P)/w*(a-1)),k={data:M,dataString:Lo(M),color:x,pos:C};s.ticks.push(k)}for(let M=0;M<l.length-1;M++){let x=s.ticks[M].pos,C=s.ticks[M+1].pos,k=Mt(l[M][1]),z=f?Mt(l[M+1][1]):0;for(let Z=x;Z<C;++Z)s.colors[Z]=f?Ui(k,z,(Z-x)/(C-x)):k}return s.colors[a-1]=Mt(l[l.length-1][1]),s}if(!c||!u)return s;let m=0,y=0,_=-1;for(let P=0;P<a;++P){let w=P*(c.length-1)/a;_!==~~w&&(_=~~w,m=Mt(c[_]),y=c.length>_+1?Mt(c[_+1]):m),s.colors[P]=f?Ui(m,y,w-_):m}s.colors[a-1]=Mt(c[c.length-1]);let v=u[0],T=(a-1)/(u[u.length-1]-v);for(let P of u){let w=~~((P-v)*T),M={data:P,dataString:Lo(P),color:lt(s.colors[w]),pos:w};s.ticks.push(M)}return s}var Ts=2*Math.PI*6378137/256,Ye=2*Math.PI*6378137/2;function Ps(a,o){let s=a/Ye*180,l=o/Ye*180;return l=180/Math.PI*(2*Math.atan(Math.exp(l*Math.PI/180))-Math.PI/2),[l,s]}function Ss(a,o,s){let l=Ms(s),u=a*l-Ye,c=o*l-Ye;return[u,c]}function Ms(a){return Ts/2**a}function $i(a,o,s){let[l,u]=Ps(...Ss(a,o,s));return[u,-l]}function To(a,o){return[a*256,o*256]}function qi(a,o,s){let l=((o-a)%360+540)%360-180;return(a+l*s+360)%360}function Cs(a,o,s,l,u,c,f,m){switch((a?1:0)|(o?2:0)|(s?4:0)|(l?8:0)){case 0:return 0;case 1:return a;case 2:return o;case 3:s=a,l=o;break;case 4:return s;case 5:o=a,l=s;break;case 6:l=o+s>>1,a=l;break;case 7:l=o+s>>1;break;case 8:return l;case 9:o=a+l>>1,s=o;break;case 10:a=o,s=l;break;case 11:s=a+l>>1;break;case 12:a=s,o=l;break;case 13:o=a+l>>1;break;case 14:a=o+s>>1;break}a=f+m*a,o=f+m*o,s=f+m*s,l=f+m*l;let _=qi(a,o,u),v=qi(s,l,u),T=(qi(_,v,c)-f)/m;return T<1?1:T}function Po(a,o,s,l,u,c,f,m){switch((a?1:0)|(o?2:0)|(s?4:0)|(l?8:0)){case 7:return u+c<1?u*(o-a)+c*(s-a)+a:0;case 14:return u+c<1?0:u*(l-s)+c*(l-o)+o+s-l;case 11:return c<u?(1-u)*(a-o)+c*(l-o)+o:0;case 13:return c<u?0:(1-u)*(s-l)+c*(s-a)+a+l-s;case 15:return u+c<1?u*(o-a)+c*(s-a)+a:u*(l-s)+c*(l-o)+o+s-l;default:return 0}}function So(a,o,s){let l=1/2**s.z,u=s.x*256*l-.5,c=s.y*256*l-.5,{raw:f,dmin:m,dmax:y,dmul:_}=o,v={raw:new Uint16Array(258*258),dmin:m,dmax:y,dmul:_},{raw:T}=v;for(let P=-1,w=0,M=c-l+1;P<=256;P++,M+=l){let x=Math.floor(M),C=M-x,k=x*258;for(let z=-1,Z=u-l+1;z<=256;z++,w++,Z+=l){let H=Math.floor(Z),V=Z-H,N=H+k,q=f[N],rt=f[N+1],$=f[N+258],G=f[N+258+1];T[w]=a(q,rt,$,G,V,C,m,_)}}return v}function Mo(a,o,s){if(!o)return a;let l=v=>v<0?0:v>254?254:v,u=1/2**o.z,c=o.x*256*u-.5,f=o.y*256*u-.5,{data:m}=a,y=new ImageData(256,256),{data:_}=y;for(let v=0,T=s,P=f;v<256;v++,P+=u){let w=~~l(P),M=P-w,x=w*256;for(let C=0,k=c;C<256;C++,T+=4,k+=u){let z=~~l(k),Z=k-z,H=(z+x)*4+s,V=m[H],N=m[H+4],q=m[H+4*256],rt=m[H+4*256+4],$=Po(V,N,q,rt,Z,M,0,0);_[T]=$>127?255:0}}return y}function Co(a,o){return o?So(Po,a,o):a}function Io(a,o){return o?So(Cs,a,o):a}function Wo(a,{data:o},s,l){let u=l==="sea",{raw:c}=a;for(let f=s,m=259,y=0;y<256;m+=2,y++)for(let _=0;_<256;_++,m++,f+=4)u===!o[f]&&(c[m]=0);return a}function ko(a){let[o,s]=To(a.x,a.y),[l,u]=$i(o,s,a.z),[c,f]=$i(o+256,s+256,a.z);return{west:l,north:u,east:c,south:f}}function Gi(a,o){let s=a.z-o;if(s<=0)return{upCoords:a};let l={x:a.x>>>s,y:a.y>>>s,z:o},u={x:a.x&(1<<s)-1,y:a.y&(1<<s)-1,z:s};return{upCoords:l,subCoords:u}}var pe=class{constructor(o){this.loadDataFunc=de(Hi);this.layer=o}async load(o,s){let l=await this.cacheLoad(o,this.layer.tilesURIs,s);if(!l)return null;let{rawdata:u,subCoords:c,tileType:f}=l,{units:m}=this.layer.currentVariableMeta,y=m==="degree"?Io:Co,_=T=>y(vo(T,this.layer.style.blurRadius),c),v=u.map(_);return this._vectorMagnitudesPrepare(v),await this._applyMask(v,o,f,!c&&u.length===1),{data:v,slines:this._createStreamLines(v)}}async cacheLoad(o,s,l){if(!this._checkInsideBoundaries(o))return null;let u=this._checkTypeAndMask(o);if(!u)return null;let{upCoords:c,subCoords:f}=Gi(o,this.layer.getCoarseMaxZoom()),m=s.map(v=>Ge(v,c)),y=Object.assign({},this.layer.wxdatasetManager.wxAPI.requestInit,{signal:l?.signal});return{rawdata:await Promise.all(m.map(v=>this.loadDataFunc(v,y))),subCoords:f,tileType:u}}clearCache(){this.loadDataFunc=de(Hi)}async _applyMask(o,s,l,u){let{style:c}=this.layer;if((c.mask==="land"||c.mask==="sea")&&l==="mixed"){if(u){let{raw:y,dmin:_,dmax:v,dmul:T}=o[0];o[0]={raw:new Uint16Array(y),dmin:_,dmax:v,dmul:T}}let f,{wxAPI:m}=this.layer.wxdatasetManager;try{let{upCoords:y,subCoords:_}=Gi(s,m.maskDepth);f=await m.loadMaskFunc(y),f=Mo(f,_,m.maskChannel)}catch{c.mask=void 0,S("Can't load Mask. Masking is disabled");return}Wo(o[0],f,m.maskChannel,c.mask)}}_vectorMagnitudesPrepare(o){if(o.length===1)return;o.unshift({raw:new Uint16Array(258*258),dmin:0,dmax:0,dmul:0});let[s,l,u]=o;s.dmax=1.42*Math.max(-l.dmin,l.dmax,-u.dmin,u.dmax),s.dmul=(s.dmax-s.dmin)/65535;for(let c=0;c<258*258;++c){if(!l.raw[c]||!u.raw[c])continue;let f=l.dmin+l.dmul*l.raw[c],m=u.dmin+u.dmul*u.raw[c];s.raw[c]=Math.sqrt(m*m+f*f)/s.dmul}}_checkTypeAndMask(o){let{mask:s}=this.layer.style;if(s==="land"||s==="sea"){let l=this.layer.wxdatasetManager.wxAPI.qtree.check(o);return s===l?void 0:l}return"mixed"}_checkInsideBoundaries(o){let s=this.layer.getBoundaries();if(s?.boundaries180){let l=ko(o),u=c=>!(l.west>c.east||c.west>l.east||l.south>c.north||c.south>l.north);if(!s.boundaries180.some(u))return!1}return!0}_createStreamLines(o){if(o.length!==3)return[];let{style:s}=this.layer;if(s.streamLineColor==="none")return[];let l=[],[u,c,f]=o,m=(s.streamLineSpeedFactor||1)/u.dmax,y=s.addDegrees?.017453292519943*s.addDegrees:0,_=s.streamLineGridStep||64,v=s.streamLineSteps||300;for(let T=0;T<=256;T+=_)for(let P=0;P<=256;P+=_){if(!u.raw[1+P+(1+T)*258])continue;let w=[],M=P,x=T,C=-1,k=0,z=0;for(let V=0;V<=v&&M>=0&&M<=256&&x>=0&&x<=256;V++){V%(v/10)||w.push({x:~~M,y:~~x});let N=~~M+1+(~~x+1)*258;if(N!==C){if(!u.raw[N])break;C=N;let q=u.dmin+u.raw[N]*u.dmul,rt=c.dmin+c.raw[N]*c.dmul,$=f.dmin+f.raw[N]*f.dmul,G=Math.atan2(rt,$)+y;k=m*q*Math.sin(G),z=m*q*Math.cos(G)}M+=k,x-=z}let Z=P,H=T;C=-1;for(let V=1;V<=v&&Z>=0&&Z<=256&&H>=0&&H<=256;V++){V%(v/10)||w.unshift({x:~~Z,y:~~H});let N=~~Z+1+(~~H+1)*258;if(N!==C){if(!u.raw[N])break;C=N;let q=u.dmin+u.raw[N]*u.dmul,rt=c.dmin+c.raw[N]*c.dmul,$=f.dmin+f.raw[N]*f.dmul,G=Math.atan2(rt,$)+y;k=m*q*Math.sin(G),z=m*q*Math.cos(G)}Z-=k,H+=z}w.length>2&&l.push(w)}return l}};var _e=class{constructor(o){this.layer=o}paint({data:o,ctxFill:s,ctxText:l,ctxStreamLines:u}){let{layer:c}=this,{units:f}=c.currentVariableMeta,m=new ImageData(256,256),y=new Uint32Array(m.data.buffer);s.clearRect(0,0,256,256),l.clearRect(0,0,256,256),u.clearRect(0,0,256,256),Is(o.data[0],y,c);let _=Ws(y,o.data[0],c);s.putImageData(m,0,0),ks(_,l,c),Ds(o.data,l,c),Es(o.data[0],l,f,c),As(o,l,c)}getPaintedCanvas(o,s,l){return s?(this.imprintVectorAnimationLinesStep(o,l),o.ctxStreamLines.canvas):o.ctxFill.canvas}imprintVectorAnimationLinesStep({data:o,ctxFill:s,ctxStreamLines:l},u){let{layer:c}=this;l.clearRect(0,0,256,256),l.drawImage(s.canvas,0,0),!(o.slines.length===0||c.style.streamLineStatic||c.style.streamLineColor==="none")&&Zs(o,l,c,u)}};function Is(a,o,{CLUT:s,style:l}){let{raw:u}=a,{colorsI:c}=s;if(l.fill!=="none")for(let f=0,m=0,y=259;f<256;++f,y+=2)for(let _=0;_<256;++_,++m,++y)o[m]=c[u[y]];else o.fill(0)}function Ws(a,o,{CLUT:s,style:l}){let{raw:u}=o,{levelIndex:c,colorsI:f}=s,m=[];if(l.isolineColor!=="none"){let y=l.isolineColor[0]==="#"?Mt(l.isolineColor):0;for(let _=0,v=0;_<256;_+=1)for(let T=0;T<256;T+=1){let P=(_+1)*258+(T+1),w=u[P],M=u[P+1],x=u[P+258];if(!w||!M||!x)continue;let C=c[w],k=c[M],z=c[x];if(C!==k||C!==z){let Z=Math.max(C,k,z),H=Math.max(w,M,x),V=_*256+T;switch(l.isolineColor){case"inverted":a[V]=~f[H]|4278190080;break;case"fill":a[V]=f[H]|4278190080;break;default:a[V]=y;break}l.isolineText&&!(++v%255)&&T>20&&T<235&&_>20&&_<235&&m.push({x:T,y:_,d:w,dr:M,db:x,mli:Z})}}}return m}function ks(a,o,{CLUT:s}){if(a.length){o.font="1.1em Sans-serif",o.lineWidth=2,o.strokeStyle="white",o.fillStyle="black",o.textAlign="center",o.textBaseline="middle";for(let{x:l,y:u,d:c,dr:f,db:m,mli:y}of a){let _=s.ticks[y].dataString,v=Math.atan2(c-f,m-c);o.save(),o.translate(l,u),o.rotate(v<-1.57||v>1.57?v+3.14:v),o.strokeText(_,0,0),o.fillText(_,0,0),o.restore()}}}function Ds(a,o,{CLUT:s,style:l}){if(!s.DataToKnots||l.vectorColor==="none"||l.vectorType==="none")return;if(a.length!==3)throw new Error("data.length !== 3");let[u,c,f]=a;switch(l.vectorType){case"barbs":o.font="40px barbs";break;case"arrows":o.font="50px arrows";break;default:o.font=l.vectorType}o.textAlign="center",o.textBaseline="middle",o.fillStyle=l.vectorColor;let m=l.addDegrees?.017453292519943*l.addDegrees:0,y=32;for(let _=y/2;_<256;_+=y)for(let v=y/2;v<256;v+=y){let T=v+1+(_+1)*258;if(!u.raw[T])continue;let P=Math.atan2(c.dmin+c.raw[T]*c.dmul,f.dmin+f.raw[T]*f.dmul),w=u.dmin+u.raw[T]*u.dmul,M=l.vectorType!=="barbs"?l.vectorFactor*.5:.2,x=Math.min(~~(s.DataToKnots(w)*M),25)+65,C=String.fromCharCode(x);switch(l.vectorColor){case"inverted":o.fillStyle=lt(~s.colorsI[u.raw[T]]);break;case"fill":o.fillStyle=lt(s.colorsI[u.raw[T]]);break}o.save(),o.translate(v,_),o.rotate(P+m),o.fillText(C,0,0),o.restore()}}function Es(a,o,s,{CLUT:l,style:u}){if(s!=="degree")return;let c=.017453292519943*u.addDegrees;o.font="50px arrows",o.textAlign="center",o.textBaseline="middle",o.fillStyle=u.vectorColor;let f="L",m=32;for(let y=m/2;y<256;y+=m)for(let _=m/2;_<256;_+=m){let v=_+1+(y+1)*258;if(!a.raw[v])continue;let P=(a.dmin+a.raw[v]*a.dmul+180)*.01745329251;switch(u.vectorColor){case"inverted":o.fillStyle=lt(~l.colorsI[a.raw[v]]);break;case"fill":o.fillStyle=lt(l.colorsI[a.raw[v]]);break}o.save(),o.translate(_,y),o.rotate(P+c),o.fillText(f,0,0),o.restore()}}function As(a,o,{CLUT:s,style:l}){let{data:u,slines:c}=a;if(!c.length||!l.streamLineStatic||l.streamLineColor==="none")return;let f=u[0];o.lineWidth=1,l.streamLineColor[0]==="#"&&(o.strokeStyle=Vi(l.streamLineColor));for(let m=c.length;m--;){let y=c[m];for(let _=0;_<y.length-1;++_){let v=y[_],T=y[_+1],P=v.x+1+(v.y+1)*258;switch(l.streamLineColor){case"inverted":o.strokeStyle=lt(~s.colorsI[f.raw[P]]);break;case"fill":o.strokeStyle=lt(s.colorsI[f.raw[P]]);break}o.beginPath(),o.moveTo(v.x,v.y),o.lineTo(T.x,T.y),o.stroke()}}}function Zs(a,o,{CLUT:s,style:l},u){let{data:c,slines:f}=a,m=c[0],y=l.streamLineColor[0]==="#"?Vi(l.streamLineColor).substring(0,7):"#000000";u=u>>5;for(let _=0;_<f.length;++_){let v=f[_],T=v.length-1,P=(u+(1+v[0].x)*(1+v[0].y))%30;for(let w=0;w<T;++w){let M=v[w],x=v[w+1],C=1-(P-w)/T;(C<0||C>1)&&(C=0);let k=(~~(C*255)).toString(16).padStart(2,"0"),z=1+~~((1.2-C)*5);o.lineWidth=z;let Z=M.x+1+(M.y+1)*258;switch(l.streamLineColor){case"inverted":y=lt(~s.colorsI[m.raw[Z]]);break;case"fill":y=lt(s.colorsI[m.raw[Z]]);break}o.strokeStyle=y+k,o.beginPath(),o.moveTo(M.x,M.y),o.lineTo(x.x,x.y),o.stroke()}}}var Ke=class extends Map{clear(){S("TilesCache.clear()"),this.forEach(o=>{!o.rd||(o.rd.gl.deleteTexture(o.rd.vectorTextureU),o.rd.gl.deleteTexture(o.rd.vectorTextureV))}),super.clear()}},ge=class{constructor(o){this.tilesCache=new Ke;this.coarseLevel=0;this.painter=new _e(this);this.loader=new pe(this);if(S(`WxLayer.constructor:
|
|
2
2
|
datasetName: ${o.wxdatasetManager.datasetName},
|
|
3
3
|
variables: ${o.variables.join(", ")},
|
|
4
4
|
wxstyleName: ${o.wxstyleName},
|
|
5
5
|
wxstyle: ${JSON.stringify(o.wxstyle)},
|
|
6
|
-
time: ${o.time}`),!o.variables?.length||o.variables.length>2)throw new Error(`datasetName: ${o.wxdatasetManager.datasetName}: only 1 or 2 variables are supported but ${o.variables} was given`);o.variables.forEach(c=>{if(!o.wxdatasetManager.checkVariableValid(c))throw new Error(`datasetName: ${o.wxdatasetManager.datasetName}: variable ${c} is not valid`)}),this.variables=o.variables,this.wxdatasetManager=o.wxdatasetManager,this.loader=new pe(this),[this.tilesURIs,this.time]=this._createURLsAndTime(o.time);let s=St(),l=s.base,u=o.wxstyleName&&s[o.wxstyleName];this.currentVariableMeta=this._getCurrentVariableMeta(),[this.style,this.CLUT]=this._createStyleAndCLUT({...l,...u,...o.wxstyle})}get nonanimatable(){return T("WxLayer.nonanimatabl()"),this.variables.length<2||this.style.streamLineStatic||this.style.streamLineColor==="none"}getMaxZoom(){return T("WxLayer.getMaxZoom"),this.wxdatasetManager.isInstanced()?this.wxdatasetManager.getInstanceMeta(this.getTime()).maxZoom:this.wxdatasetManager.getMaxZoom()}getBoundaries(){return this.wxdatasetManager.isInstanced()?this.wxdatasetManager.getInstanceMeta(this.getTime()).boundaries:this.wxdatasetManager.getBoundaries()}getTime(){return T("WxLayer.getTime"),this.time}clearCache(){T("WxLayer.clearCache"),this.tilesCache.clear(),this.loader.clearCache()}getCurrentStyleObjectCopy(){return T("WxLayer.getCurrentStyleObjectCopy"),Object.assign({},this.style)}updateCurrentStyleObject(o){T(`WxLayer.updateCurrentStyleObject ${JSON.stringify(o)}`),[this.style,this.CLUT]=this._createStyleAndCLUT(o)}getTileData(o,s){let l=this.tilesCache.get(Xe(o));if(!l)return;let u=this._getPixelInfo(s,l.data.data);if(!u)return;let{raw:c,data:f}=u,m=c.map(y=>this.CLUT.colorsI[y]),g=m.map(lt),v=f.map(y=>this.CLUT.DataToStyle(y));return{data:f,raw:c,rgba:m,hexColor:g,inStyleUnits:v,tilePoint:s,styleUnits:this.style.units,dataUnits:this.currentVariableMeta.units}}setURLsAndTime(o){T(`WxLayer.setURLsAndTime time=${o}`),[this.tilesURIs,this.time]=this._createURLsAndTime(o),this.wxdatasetManager.isInstanced()&&(this.currentVariableMeta=this._getCurrentVariableMeta(),[this.style,this.CLUT]=this._createStyleAndCLUT())}async loadTile(o,s){return this._loadCacheDrawTile(o,this.tilesCache,s).catch(l=>{if(l.name==="AbortError")throw l;return null})}async preloadTime(o,s,l){T(`WxLayer.preloadTime time=${o}`);let[u]=this._createURLsAndTime(o);await Promise.allSettled(s.map(c=>this.loader.cacheLoad(c,u,l)))}async reloadTiles(o,s){T("WxLayer.reloadTiles");let l=new Ke;await Promise.allSettled(o.map(u=>this._loadCacheDrawTile(u,l,s))),s?.signal?.aborted?l.clear():(this.tilesCache.clear(),this.tilesCache=l)}async _loadCacheDrawTile(o,s,l){let u=s.get(Xe(o));if(u)return u;let c=await this.loader.load(o,l);if(!c)return null;let f=jt(256,256),m=f,g=this.variables.length===2?jt(256,256):f,v={ctxFill:f,ctxText:m,ctxStreamLines:g,data:c};return this.painter.paint(v),s.set(Xe(o),v),v}_getCurrentVariableMeta(){let o=this.variables.map(f=>{let m=this.wxdatasetManager.getInstanceVariableMeta(f,this.time);if(!m)throw new Error(`WxLayer ${this.wxdatasetManager.datasetName}: variable ${f} is not valid`);return m}),{min:s,max:l,units:u,vector:c}=o[0];return this.variables.length>1&&(s=0,l=1.42*Math.max(-o[0].min,o[0].max,-o[1].min,o[1].max)),{min:s,max:l,units:u,vector:c}}_getPixelInfo({x:o,y:s},l){T(`WxLayer._getPixelInfo x=${o} y=${s}`);let u=(s+1)*258+(o+1);if(!!l?.[0]?.raw?.[u])return{raw:l.map(c=>c.raw[u]),data:l.map(c=>c.raw[u]*c.dmul+c.dmin)}}_createStyleAndCLUT(o){let s=Object.assign({},this.style,o),l=this._prepareCLUT(s);return[s,l]}_prepareCLUT(o){let{min:s,max:l,units:u}=this.currentVariableMeta;return new me(o,u,[s,l],this.variables.length===2)}_createURLsAndTime(o){let s=this.wxdatasetManager.getValidTime(o);return[this.variables.map(u=>this.wxdatasetManager.createURI(u,s)),s]}};var Eo=uo(Xi()),ve=class extends Eo.default.GridLayer{constructor(s){super(s);this.id=s.id}};var Qe=class extends ve{constructor(s,l){T(`WxLayerBaseImplementation.constructor (${l.id})`);super(l);this.animation=!1;this.animationSeed=0;this.layer=new ge(s),this.oldMaxZoom=this.layer.getMaxZoom()}get wxdatasetManager(){return T(`WxLayerBaseImplementation.wxdatasetManager (${this.id})`),this.layer.wxdatasetManager}getCurrentVariableMeta(){return T(`WxLayerBaseImplementation.getCurrentVariableMeta (${this.id})`),{...this.layer.currentVariableMeta}}getDatasetMeta(){return this.layer.wxdatasetManager.getInstanceMeta(this.getTime())}getMetadata(){return T(`WxLayerBaseImplementation.getMetadata (${this.id})`),{...this.layer.currentVariableMeta}}getVariables(){return T(`WxLayerBaseImplementation.getVariables (${this.id})`),[...this.layer.variables]}clearCache(){T(`WxLayerBaseImplementation.clearCache (${this.id})`),this.layer.clearCache()}getCache(){return this.layer.tilesCache}getCurrentStyleObjectCopy(){return T(`WxLayerBaseImplementation.getCurrentStyleObjectCopy (${this.id})`),this.layer.getCurrentStyleObjectCopy()}getTime(){return T(`WxLayerBaseImplementation.getTime (${this.id})`),this.layer.getTime()}getTimes(){return T(`WxLayerBaseImplementation.getTimes (${this.id})`),this.layer.wxdatasetManager.getTimes()}async setTime(s,l){T(`WxLayerBaseImplementation.setTime (${this.id}) time=${s}`);let u=this.getTime();return this.layer.setURLsAndTime(s),await this._reloadVisible(l),l?.signal?.aborted&&this.layer.setURLsAndTime(u),this.getTime()}async preloadTime(s,l){return T(`WxLayerBaseImplementation.preloadTime (${this.id}) time=${s}`),this.layer.preloadTime(s,this.coveringTiles(),l)}startAnimation(){if(this.animation){T(`WxLayerBaseImplementation.startAnimation (${this.id}) already started`);return}if(this.layer.nonanimatable){T(`WxLayerBaseImplementation.startAnimation (${this.id}) nonanimatable`);return}T(`WxLayerBaseImplementation.startAnimation (${this.id})`),this.animation=!0;let s=async l=>{if(T(`WxLayerBaseImplementation.startAnimation (${this.id}) animationStep`),!this.animation||this.layer.nonanimatable){this.animation=!1;return}this.animationSeed=l,await this._redrawTiles(),requestAnimationFrame(s)};requestAnimationFrame(s)}async stopAnimation(){return T(`WxLayerBaseImplementation.stopAnimation (${this.id})`),this.animation=!1,this._redrawTiles()}async setCoarseLevel(s=2){}async unsetCoarseLevel(){}async setStyleByName(s,l=!0){return T(`WxLayerBaseImplementation.setStyleByName (${this.id}) wxstyleName=${s} reload=${l}`),this.updateCurrentStyleObject(St()[s],l)}async updateCurrentStyleObject(s,l=!0,u){if(T(`WxLayerBaseImplementation.updateCurrentStyleObject (${this.id}) style=${s} reload=${l}`),this.layer.updateCurrentStyleObject(s),this.startAnimation(),l)return this._reloadVisible(u)}_redrawTiles(){return this.redrawRequested?this.redrawRequested:(this.redrawRequested=new Promise(s=>{requestAnimationFrame(()=>{T(`WxTileSource _redrawTiles (${this.id})`),this.update(),s(),this.redrawRequested=void 0})}),this.redrawRequested)}async _reloadVisible(s){}coveringTiles(){return[]}update(){}};var ti=class{constructor(o,s,l){this.coords=o;this.ctx=s;this.raster_data=l;this.draw(l?.ctxFill.canvas)}draw(o){this.ctx.clearRect(0,0,256,256),o&&this.ctx.drawImage(o,0,0)}},ye=class extends Qe{constructor(o,s){super(o,s),T("WxTileSource constructor: ",o)}getLayerInfoAtLatLon(o,s){if(T(`WxTileSource getLayerInfoAtLatLon (${this.layer.wxdatasetManager.datasetName})`,o),!this._map)return;let l=this._map.getZoom(),u=this._map.project(o,l),c=u.divideBy(256).floor(),f=u.subtract(c.multiplyBy(256)).floor();return this.layer.getTileData({x:c.x,y:c.y,z:l},f)}async _reloadVisible(o){if(T(`WxTileSource _reloadVisible (${this.layer.wxdatasetManager.datasetName})`),await this.layer.reloadTiles(this.coveringTiles(),o),o?.signal?.aborted){T(`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()}coveringTiles(){T(`WxTileSource coveringTiles (${this.layer.wxdatasetManager.datasetName})`);let o=[];for(let s in this._tiles){let l=this._tiles[s].el?.wxtile;l&&o.push(l.coords)}return o}update(){T(`WxTileSource update (${this.layer.wxdatasetManager.datasetName})`),this._ForEachWxTile(o=>{o.draw(o.raster_data&&this.layer.painter.getPaintedCanvas(o.raster_data,this.animation,this.animationSeed))},"_redrawTiles")}_ForEachWxTile(o,s){T(`WxTileSource _ForEachWxTile (${this.layer.wxdatasetManager.datasetName}) func=${s}`);let l=[];for(let u in this._tiles){let c=this._tiles[u].el?.wxtile;c&&l.push(o(c))}return l}createTile(o,s){let l=jt(256,256),u=l.canvas;return this.layer.loadTile(o).then(c=>{u.wxtile=new ti(o,l,c)}).catch(()=>{u.wxtile=new ti(o,l,null)}).finally(s),u}onRemove(o){return super.onRemove(o),T(`WxTileSource onRemove (${this.layer.wxdatasetManager.datasetName})`),this.animation=!1,this}};var xe=class{constructor({datasetName:o,datasetCurrentInstance:s,instanced:l,datasetCurrentMeta:u,metas:c,wxAPI:f}){if(!f.datasetsMetas.allDatasetsList.includes(o))throw new Error(`Dataset ${o} not found`);this.datasetName=o,this.instanced=l,this.datasetCurrentInstance=s,this.datasetCurrentMeta=u,this.metas=c,this.wxAPI=f,T(`WxDataSetManager.constructor: ${this.datasetName}`)}isInstanced(){return!!this.instanced}getValidTime(o=Date()){T(`WxDataSetManager.getValidTime: ${this.datasetName}, ${o}`);let s=this.getTimes();if(o==="")return s[s.length-1];if(typeof o=="string"){let c=s.indexOf(o);if(c!==-1)return s[c]}if(typeof o=="number"){if(o<=0)return s[0];if(o<s.length)return s[o]}let l=new Date(o).getTime();return isNaN(l)?s[s.length-1]:s.find(c=>new Date(c).getTime()>=l)||s[s.length-1]}getTimes(){return T(`WxDataSetManager.getTimes: ${this.datasetName}`),this.instanced||this.datasetCurrentMeta.times}getVariables(){return T(`WxDataSetManager.getVariables: ${this.datasetName}`),this.datasetCurrentMeta.variables}getVariableMeta(o){return T(`WxDataSetManager.getVariableMeta: ${this.datasetName}, ${o}`),this.datasetCurrentMeta.variablesMeta[o]}getInstanceVariableMeta(o,s){return T(`WxDataSetManager.getInstanceVariableMeta: ${this.datasetName}, ${o}, ${s}`),this.getInstanceMeta(s).variablesMeta[o]}getMaxZoom(){return T(`WxDataSetManager.getMaxZoom: ${this.datasetName}`),this.datasetCurrentMeta.maxZoom}getBoundaries(){return T(`WxDataSetManager.getBoundaries: ${this.datasetName}`),this.datasetCurrentMeta.boundaries}getInstanceMeta(o){return T(`WxDataSetManager.getInstanceMeta: ${this.datasetName}, ${o}`),this.instanced&&this.metas.get(o)||this.datasetCurrentMeta}createURI(o,s,l="png"){if(T(`WxDataSetManager.createURI: ${this.datasetName}, ${o}, ${s}`),!this.checkVariableValid(o))throw new Error(`in dataset ${this.datasetName} variable ${o} not found`);let u=this.instanced?s:this.datasetCurrentInstance;return`${this.wxAPI.dataServerURL+this.datasetName}/${u}/${o}/${s}/{z}/{x}/{y}.${l}`}checkVariableValid(o){return T(`WxDataSetManager.checkVariableValid: ${this.datasetName}, ${o}`),this.getVariableMeta(o)!==void 0}checkCombineVariableIfVector(o){T(`WxDataSetManager.checkCombineVariableIfVector: ${this.datasetName}, ${o}`);let s=this.getVariableMeta(o);if(!s)throw new Error(`in dataset ${this.datasetName} variable ${o} not found`);return s.vector||[o]}createSourceLayer(o,s){T(`WxDataSetManager.createSourceLayer: ${this.datasetName}`);let l={...o,variables:this.checkCombineVariableIfVector(o.variable),wxdatasetManager:this};return new ye(l,s)}async checkDatasetOutdated(){return T(`WxDataSetManager.checkDatasetOutdated: ${this.datasetName}`),await this.wxAPI.initDone,await this.getDatasetInstance()===this.datasetCurrentInstance}async getDatasetInstance(){T(`WxDataSetManager.getDatasetInstance: ${this.datasetName}`);let o=await this.getDatasetInstances();return o[o.length-1]}async getDatasetInstances(){T(`WxDataSetManager.getDatasetInstances: ${this.datasetName}`);try{let o=await Rt(this.wxAPI.dataServerURL+this.datasetName+"/instances.json",this.wxAPI.requestInit);if(o.length===0)throw new Error(`No instances found for dataset ${this.datasetName}`);return o}catch(o){throw new Error(`getting dataset instances failure message: ${o.message} datasetName: ${this.datasetName} (they are likely removed from API)`)}}};var be=class{constructor({dataServerURL:o,maskURL:s="none",maskChannel:l="R",maskDepth:u=11,qtreeURL:c="none",requestInit:f,colorStyles:m,units:g,colorSchemes:v}){this.maskURL="auto";this.datasetsMetas={allDatasetsList:[]};this.qtree=new fe;this.loadMaskFunc=()=>Promise.reject(new Error("maskURL not defined"));if(T("WxAPI.constructor",o),go({colorStyles:m,units:g,colorSchemes:v}),this.dataServerURL=o,this.requestInit=f,c=c==="auto"?o+"masks/11+1.seamask.qtree":c,s!=="none"){let y=de(Fi);this.maskURL=s=s==="auto"?o+"masks/{z}/{x}/{y}.png":s,this.loadMaskFunc=S=>y(Ge(s,S),f)}this.maskChannel=l==="R"?0:l==="G"?1:l==="B"?2:l==="A"?3:0,this.maskDepth=u,this.initDone=Promise.all([Rt(o+"datasetsmeta.json",f),c!=="none"?this.qtree.load(c,f):Promise.resolve()]).then(([y,S])=>{y.allDatasetsList||(y.allDatasetsList=Object.keys(y)),this.datasetsMetas=y,T("WxAPI.constructor initDone")})}getDatasetShortMeta(o){if(T("WxAPI.getDatasetShortMeta",o),o!=="allDatasetsList")return this.datasetsMetas[o]}getDatasetInatance(o){return T("WxAPI.getDatasetInatance",o),this.getDatasetShortMeta(o)?.instance}async getDatasetVariables(o){return await this.initDone,T("WxAPI.getDatasetVariables",o),this.datasetsMetas[o]?.variables}async createDatasetManager(o){await this.initDone,T("WxAPI.createDatasetManager",o);let s=this.getDatasetShortMeta(o),l=s?.instance;if(!l)throw new Error("Dataset/instance not found:"+o);let u=s.instanced,c=v=>Rt(this.dataServerURL+o+"/"+v+"/meta.json",this.requestInit),f=async v=>[v,await c(v)],m=await c(l),g=new Map(u?await Promise.all(u.map(f)):[[l,m]]);return new xe({datasetName:o,datasetCurrentInstance:l,datasetCurrentMeta:m,instanced:u,metas:g,wxAPI:this})}async createAllDatasetsManagers(){return await this.initDone,T("WxAPI.createAllDatasetsManagers"),Promise.allSettled(this.datasetsMetas.allDatasetsList.map(s=>this.createDatasetManager(s)))}async filterDatasetsByVariableName(o){return await this.initDone,T("WxAPI.filterDatasetsByVariableName",o),this.datasetsMetas.allDatasetsList.filter(s=>this.datasetsMetas[s]?.variables?.includes?.(o))}async getAllDatasetsNames(){return await this.initDone,T("WxAPI.getAllDatasetsNames"),this.datasetsMetas.allDatasetsList}};var ei=class{constructor(){let o=document.createElement("div");o.className="mapboxgl-ctrl leaflet-control",o.style.borderStyle="solid",o.style.borderColor="#000",o.style.backgroundColor="#aaaaaaaa",o.style.padding="5px",this._div=o,this._canvas=document.createElement("canvas"),this._canvas.width=600,this._canvas.height=40,o.appendChild(this._canvas)}onAdd(){return this._div}onRemove(){this._div.parentNode?.removeChild(this._div)}drawLegend(o){let{_canvas:s}=this,{width:l,height:u}=s,c=16+u>>2,f=je(l-50,o),m=s.getContext("2d"),g=m.createImageData(l,u),v=new Uint32Array(g.data.buffer);v.fill(-1);let y=2,S=2,P=y+l*S,w=c>>1;if(f.showBelowMin){let C=f.colors[0];if(C)for(let x=0;x<w;++x)for(let I=w;I<w+x;++I)v[P+x+I*l]=C,v[P+x+(w*2-I)*l]=C}for(let C=0;C<f.size;++C)for(let x=0;x<c;++x)f.colors[0]&&(v[y+C+w+(x+S+1)*l]=f.colors[C]);if(f.showAboveMax){let C=f.colors[f.colors.length-1];if(C)for(let x=0;x<=w;++x)for(let I=w;I<w+x;++I)v[P+w*2+f.size-x+I*l]=C,v[P+w*2+f.size-x+(w*2-I)*l]=C}m.putImageData(g,0,0),m.font="8px sans-serif",m.beginPath();for(let C of f.ticks)m.strokeStyle="#000",m.moveTo(C.pos+w+y+1,S+3),m.lineTo(C.pos+w+y+1,c),m.fillText(C.dataString,C.pos+w+y+1,c+11);m.font="12px sans-serif",m.fillText(`(${f.units})`,13,u-5),m.stroke(),m.strokeStyle="#888",m.strokeRect(1,1,l-3,u-2)}clear(){let{_canvas:o}=this,{width:s,height:l}=o;o.getContext("2d").clearRect(0,0,s,l)}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var ii=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=g=>g.stopPropagation?.(),this.styleBase=St().base;let o=yt(this.parent,"div",{onclick:onwheel,ondblclick:onwheel,onwheel,onmousedown,onmouseup}),s=yt(o,"button",{id:"customStyleButton",style:"height: 1.5em; background-color: gray",innerText:"Custom Style"}),l=yt(o,"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",()=>{l.style.display!=="none"?(l.style.display="none",s.innerHTML="show Custom Style Editor"):(l.style.display="flex",s.innerHTML="update Custom Style & Hide")}),this.editorTextAreaEl=yt(l,"textarea",{id:"customStyleTextArea",style:"width: 20vw; height: 70vh"}),this.editorTextAreaEl.readOnly=!0,this.editorDivEl=yt(l,"div");let u=(g,v=!0)=>{yt(this.editorDivEl,"label",{htmlFor:g,id:g+"Label",className:g+"LabelClass",textContent:g.replace(/Input|Select$/i,"")}),v&&yt(this.editorDivEl,"br",{})},c=({id:g,type:v,min:y,max:S,step:P,onEvent:w="change",br:C=!0})=>{let x=yt(this.editorDivEl,"input",{id:g,className:g+"Class",type:v,min:y,max:S,step:P});return w!=="none"&&x.addEventListener(w,()=>this._onDivChange()),u(g,C),x},f=({id:g,opts:v,onEvent:y="change",br:S=!0})=>{let P=yt(this.editorDivEl,"select",{id:g,className:g+"Class"});return y!=="none"&&P.addEventListener(y,()=>this._onDivChange()),v.forEach(w=>P.options.add(yt(P,"option",{value:w,text:w}))),u(g,S),P.selectedIndex=0,P},m=g=>{let v=f({id:g+"Select",br:!1,opts:["inverted","fill","none","custom"]}),y=c({id:g+"Input",type:"color",onEvent:"none"});return y.addEventListener("change",()=>{v.value="custom",this._onDivChange()}),[v,y]};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]=m("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]=m("vectorColor"),[this.streamLineColorSelect,this.streamLineColorInput]=m("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(ce()),onEvent:"none"}),this.colorSchemeSelect.addEventListener("change",()=>{let g=this.getStyle();delete g.colors,this._setStyleToTextArea(g),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(o){o.colorMap&&(delete o.colors,delete o.levels),this._setStyleToDiv(o),this._setStyleToTextArea(this._getStyleFromDiv())}_getStyleFromDiv(){let o=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||void 0,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:o("colorsInput"),colorMap:o("colorMapInput"),levels:o("levelsInput"),blurRadius:+this.blurRadiusInput.value,addDegrees:+this.addDegreesInput.value,units:this.unitsInput.value||void 0,extraUnits:o("extraUnitsInput"),mask:this.maskSelect.value||void 0}}_setStyleToTextArea(o){this.editorTextAreaEl.value=JSON.stringify(ji(o),null,2)}_setStyleToDiv(o){this.parentInput.value=o.parent||"",this.nameInput.value=o.name||"",this.fillSelect.value=o.fill||"",this.isolineColorSelect.value=o.isolineColor?.[0]==="#"?"custom":o.isolineColor||"",this.isolineColorInput.value=o.isolineColor?.[0]==="#"?o.isolineColor:"#000000",this.isolineTextInput.checked=o.isolineText||!1,this.vectorTypeSelect.value=o.vectorType||"",this.vectorColorSelect.value=o.vectorColor?.[0]==="#"?"custom":o.vectorColor||"",this.vectorColorInput.value=o.vectorColor?.[0]==="#"?o.vectorColor:"#000000",this.vectorFactorInput.value=o.vectorFactor?.toString()||"1",this.streamLineColorSelect.value=o.streamLineColor?.[0]==="#"?"custom":o.streamLineColor||"",this.streamLineColorInput.value=o.streamLineColor?.[0]==="#"?o.streamLineColor:"#000000",this.streamLineSpeedFactorInput.value=o.streamLineSpeedFactor?.toString()||"1",this.streamLineStaticInput.checked=o.streamLineStatic||!1,this.showBelowMinInput.checked=o.showBelowMin||!1,this.showAboveMaxInput.checked=o.showAboveMax||!1,this.colorSchemeSelect.value=o.colorScheme||"",this.colorsInput.value=o.colors?.length?JSON.stringify(o.colors):"",this.colorMapInput.value=o.colorMap?.length?JSON.stringify(o.colorMap):"",this.levelsInput.value=o.levels?.length?JSON.stringify(o.levels.map(s=>+s.toFixed(2))):"",this.blurRadiusInput.value=o.blurRadius?.toString()||"",this.addDegreesInput.value=o.addDegrees?.toString()||"",this.unitsInput.value=o.units||"",this.extraUnitsInput.value=o.extraUnits?JSON.stringify(o.extraUnits):"",this.maskSelect.value=o.mask||""}_onDivChange(){let o=this._getStyleFromDiv();Object.keys(o).forEach(s=>(o[s]===void 0||o[s]===""||!o[s].length)&&delete o[s]),this._setStyleToTextArea(o),this.onchange?.(this.getStyle())}};function yt(a,o,s){let l=document.createElement(o);return Object.assign(l,s),a?.appendChild(l),l}function ji(a){return Array.isArray(a)?a.map(ji):typeof a=="object"&&a!==null?Object.keys(a).sort((s,l)=>{let u=s.toUpperCase(),c=l.toUpperCase();return u==c?0:u>c?1:-1}).reduce((s,l)=>(s[l]=ji(a[l]),s),{}):a}var ni=class{constructor(){this.pos={lng:0,lat:0};let o=document.createElement("div");o.className="mapboxgl-ctrl leaflet-control",o.style.borderStyle="solid",o.style.borderColor="#000",o.style.backgroundColor="#aaaaaaaa",o.style.padding="5px",this.div=o}onAdd(){return this.div}onRemove(){this.div.parentNode?.removeChild(this.div)}update(o,s,l){if(l&&(this.pos=l),!o){this.div.innerHTML="";return}let{min:u,max:c,units:f}=o.getCurrentVariableMeta(),{datasetName:m}=o.wxdatasetManager,g=o.wxdatasetManager.getInstanceMeta(o.getTime()),{sourceID:v,baseAtmosphericModel:y,model:S}=g;this.div.innerHTML=`lnglat=(${this.pos.lng.toFixed(2)}, ${this.pos.lat.toFixed(2)})<br>`,this.div.innerHTML+=v&&`sourceID=${v}<br>`||"",this.div.innerHTML+=y&&`baseAtmosphericModel=${y}<br>`||"",this.div.innerHTML+=S&&`model=${S}<br>`||"",this.div.innerHTML+=`dataset=${m}<br>
|
|
6
|
+
time: ${o.time}`),!o.variables?.length||o.variables.length>2)throw new Error(`datasetName: ${o.wxdatasetManager.datasetName}: only 1 or 2 variables are supported but ${o.variables} was given`);o.variables.forEach(c=>{if(!o.wxdatasetManager.checkVariableValid(c))throw new Error(`datasetName: ${o.wxdatasetManager.datasetName}: variable ${c} is not valid`)}),this.variables=o.variables,this.wxdatasetManager=o.wxdatasetManager,[this.tilesURIs,this.time]=this._createURLsAndTime(o.time);let s=St(),l=s.base,u=o.wxstyleName&&s[o.wxstyleName];this.currentVariableMeta=this._getCurrentVariableMeta(),[this.style,this.CLUT]=this._createStyleAndCLUT({...l,...u,...o.wxstyle})}get nonanimatable(){return S("WxLayer.nonanimatabl()"),this.variables.length<2||this.style.streamLineStatic||this.style.streamLineColor==="none"}getMaxZoom(){return S("WxLayer.getMaxZoom"),this.wxdatasetManager.isInstanced()?this.wxdatasetManager.getInstanceMeta(this.getTime()).maxZoom:this.wxdatasetManager.getMaxZoom()}getCoarseMaxZoom(){return S("WxLayer.getCoarseMaxZoom"),this.getMaxZoom()-this.coarseLevel}getBoundaries(){return this.wxdatasetManager.isInstanced()?this.wxdatasetManager.getInstanceMeta(this.getTime()).boundaries:this.wxdatasetManager.getBoundaries()}getTime(){return S("WxLayer.getTime"),this.time}clearCache(){S("WxLayer.clearCache"),this.tilesCache.clear(),this.loader.clearCache()}getCurrentStyleObjectCopy(){return S("WxLayer.getCurrentStyleObjectCopy"),Object.assign({},this.style)}updateCurrentStyleObject(o){S(`WxLayer.updateCurrentStyleObject ${JSON.stringify(o)}`),[this.style,this.CLUT]=this._createStyleAndCLUT(o)}getTileData(o,s){let l=this.tilesCache.get(Xe(o));if(!l)return;let u=this._getPixelInfo(s,l.data.data);if(!u)return;let{raw:c,data:f}=u,m=c.map(v=>this.CLUT.colorsI[v]),y=m.map(lt),_=f.map(v=>this.CLUT.DataToStyle(v));return{data:f,raw:c,rgba:m,hexColor:y,inStyleUnits:_,tilePoint:s,styleUnits:this.style.units,dataUnits:this.currentVariableMeta.units}}setURLsAndTime(o){S(`WxLayer.setURLsAndTime time=${o}`),[this.tilesURIs,this.time]=this._createURLsAndTime(o),this.wxdatasetManager.isInstanced()&&(this.currentVariableMeta=this._getCurrentVariableMeta(),[this.style,this.CLUT]=this._createStyleAndCLUT())}async loadTile(o,s){return this._loadCacheDrawTile(o,this.tilesCache,s).catch(l=>{if(l.name==="AbortError")throw l;return null})}async preloadTime(o,s,l){S(`WxLayer.preloadTime time=${o}`);let[u]=this._createURLsAndTime(o);await Promise.allSettled(s.map(c=>this.loader.cacheLoad(c,u,l)))}async reloadTiles(o,s){S("WxLayer.reloadTiles");let l=new Ke;await Promise.allSettled(o.map(u=>this._loadCacheDrawTile(u,l,s))),s?.signal?.aborted?l.clear():(this.tilesCache.clear(),this.tilesCache=l)}async _loadCacheDrawTile(o,s,l){let u=s.get(Xe(o));if(u)return u;let c=await this.loader.load(o,l);if(!c)return null;let f=jt(256,256),m=f,y=this.variables.length===2?jt(256,256):f,_={ctxFill:f,ctxText:m,ctxStreamLines:y,data:c};return this.painter.paint(_),s.set(Xe(o),_),_}_getCurrentVariableMeta(){let o=this.variables.map(f=>{let m=this.wxdatasetManager.getInstanceVariableMeta(f,this.time);if(!m)throw new Error(`WxLayer ${this.wxdatasetManager.datasetName}: variable ${f} is not valid`);return m}),{min:s,max:l,units:u,vector:c}=o[0];return this.variables.length>1&&(s=0,l=1.42*Math.max(-o[0].min,o[0].max,-o[1].min,o[1].max)),{min:s,max:l,units:u,vector:c}}_getPixelInfo({x:o,y:s},l){S(`WxLayer._getPixelInfo x=${o} y=${s}`);let u=(s+1)*258+(o+1);if(!!l?.[0]?.raw?.[u])return{raw:l.map(c=>c.raw[u]),data:l.map(c=>c.raw[u]*c.dmul+c.dmin)}}_createStyleAndCLUT(o){let s=Object.assign({},this.style,o),l=this._prepareCLUT(s);return[s,l]}_prepareCLUT(o){let{min:s,max:l,units:u}=this.currentVariableMeta;return new me(o,u,[s,l],this.variables.length===2)}_createURLsAndTime(o){let s=this.wxdatasetManager.getValidTime(o);return[this.variables.map(u=>this.wxdatasetManager.createURI(u,s)),s]}};var Eo=uo(Xi()),ve=class extends Eo.default.GridLayer{constructor(s){super(s);this.id=s.id}};var Qe=class extends ve{constructor(s,l){S(`WxLayerBaseImplementation.constructor (${l.id})`);super(l);this.animation=!1;this.animationSeed=0;this.layer=new ge(s)}get wxdatasetManager(){return S(`WxLayerBaseImplementation.wxdatasetManager (${this.id})`),this.layer.wxdatasetManager}getCurrentVariableMeta(){return S(`WxLayerBaseImplementation.getCurrentVariableMeta (${this.id})`),{...this.layer.currentVariableMeta}}getDatasetMeta(){return this.layer.wxdatasetManager.getInstanceMeta(this.getTime())}getMetadata(){return S(`WxLayerBaseImplementation.getMetadata (${this.id})`),{...this.layer.currentVariableMeta}}getVariables(){return S(`WxLayerBaseImplementation.getVariables (${this.id})`),[...this.layer.variables]}clearCache(){S(`WxLayerBaseImplementation.clearCache (${this.id})`),this.layer.clearCache()}getCache(){return this.layer.tilesCache}getCurrentStyleObjectCopy(){return S(`WxLayerBaseImplementation.getCurrentStyleObjectCopy (${this.id})`),this.layer.getCurrentStyleObjectCopy()}getTime(){return S(`WxLayerBaseImplementation.getTime (${this.id})`),this.layer.getTime()}getTimes(){return S(`WxLayerBaseImplementation.getTimes (${this.id})`),this.layer.wxdatasetManager.getTimes()}async setTime(s,l){S(`WxLayerBaseImplementation.setTime (${this.id}) time=${s}`);let u=this.getTime();return this.layer.setURLsAndTime(s),await this._reloadVisible(l),l?.signal?.aborted&&this.layer.setURLsAndTime(u),this.getTime()}async preloadTime(s,l){return S(`WxLayerBaseImplementation.preloadTime (${this.id}) time=${s}`),this.layer.preloadTime(s,this.coveringTiles(),l)}startAnimation(){if(this.animation){S(`WxLayerBaseImplementation.startAnimation (${this.id}) already started`);return}if(this.layer.nonanimatable){S(`WxLayerBaseImplementation.startAnimation (${this.id}) nonanimatable`);return}S(`WxLayerBaseImplementation.startAnimation (${this.id})`),this.animation=!0;let s=async l=>{if(S(`WxLayerBaseImplementation.startAnimation (${this.id}) animationStep`),!this.animation||this.layer.nonanimatable){this.animation=!1;return}this.animationSeed=l,await this._redrawTiles(),requestAnimationFrame(s)};requestAnimationFrame(s)}async stopAnimation(){return S(`WxLayerBaseImplementation.stopAnimation (${this.id})`),this.animation=!1,this._redrawTiles()}async setCoarseLevel(s=2){this.layer.coarseLevel=Math.max(0,Math.min(s,this.wxdatasetManager.getMaxZoom()))}async unsetCoarseLevel(){return this.layer.coarseLevel=0,this._reloadVisible()}async setStyleByName(s,l=!0){return S(`WxLayerBaseImplementation.setStyleByName (${this.id}) wxstyleName=${s} reload=${l}`),this.updateCurrentStyleObject(St()[s],l)}async updateCurrentStyleObject(s,l=!0,u){if(S(`WxLayerBaseImplementation.updateCurrentStyleObject (${this.id}) style=${s} reload=${l}`),this.layer.updateCurrentStyleObject(s),this.startAnimation(),l)return this._reloadVisible(u)}_redrawTiles(){return this.redrawRequested?this.redrawRequested:(this.redrawRequested=new Promise(s=>{requestAnimationFrame(()=>{S(`WxTileSource _redrawTiles (${this.id})`),this.update(),s(),this.redrawRequested=void 0})}),this.redrawRequested)}async _reloadVisible(s){}coveringTiles(){return[]}update(){}};var ti=class{constructor(o,s,l){this.coords=o;this.ctx=s;this.raster_data=l;this.draw(l?.ctxFill.canvas)}draw(o){this.ctx.clearRect(0,0,256,256),o&&this.ctx.drawImage(o,0,0)}},ye=class extends Qe{constructor(o,s){super(o,s),S("WxTileSource constructor: ",o)}getLayerInfoAtLatLon(o,s){if(S(`WxTileSource getLayerInfoAtLatLon (${this.layer.wxdatasetManager.datasetName})`,o),!this._map)return;let l=this._map.getZoom(),u=this._map.project(o,l),c=u.divideBy(256).floor(),f=u.subtract(c.multiplyBy(256)).floor();return this.layer.getTileData({x:c.x,y:c.y,z:l},f)}async _reloadVisible(o){if(S(`WxTileSource _reloadVisible (${this.layer.wxdatasetManager.datasetName})`),await this.layer.reloadTiles(this.coveringTiles(),o),o?.signal?.aborted){S(`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()}coveringTiles(){S(`WxTileSource coveringTiles (${this.layer.wxdatasetManager.datasetName})`);let o=[];for(let s in this._tiles){let l=this._tiles[s].el?.wxtile;l&&o.push(l.coords)}return o}update(){S(`WxTileSource update (${this.layer.wxdatasetManager.datasetName})`),this._ForEachWxTile(o=>{o.draw(o.raster_data&&this.layer.painter.getPaintedCanvas(o.raster_data,this.animation,this.animationSeed))},"_redrawTiles")}_ForEachWxTile(o,s){S(`WxTileSource _ForEachWxTile (${this.layer.wxdatasetManager.datasetName}) func=${s}`);let l=[];for(let u in this._tiles){let c=this._tiles[u].el?.wxtile;c&&l.push(o(c))}return l}createTile(o,s){let l=jt(256,256),u=l.canvas;return this.layer.loadTile(o).then(c=>{u.wxtile=new ti(o,l,c)}).catch(()=>{u.wxtile=new ti(o,l,null)}).finally(s),u}onRemove(o){return super.onRemove(o),S(`WxTileSource onRemove (${this.layer.wxdatasetManager.datasetName})`),this.animation=!1,this}};var xe=class{constructor({datasetName:o,datasetCurrentInstance:s,instanced:l,datasetCurrentMeta:u,metas:c,wxAPI:f}){if(!f.datasetsMetas.allDatasetsList.includes(o))throw new Error(`Dataset ${o} not found`);this.datasetName=o,this.instanced=l,this.datasetCurrentInstance=s,this.datasetCurrentMeta=u,this.metas=c,this.wxAPI=f,S(`WxDataSetManager.constructor: ${this.datasetName}`)}isInstanced(){return!!this.instanced}getValidTime(o=Date()){S(`WxDataSetManager.getValidTime: ${this.datasetName}, ${o}`);let s=this.getTimes();if(o==="")return s[s.length-1];if(typeof o=="string"){let c=s.indexOf(o);if(c!==-1)return s[c]}if(typeof o=="number"){if(o<=0)return s[0];if(o<s.length)return s[o]}let l=new Date(o).getTime();return isNaN(l)?s[s.length-1]:s.find(c=>new Date(c).getTime()>=l)||s[s.length-1]}getTimes(){return S(`WxDataSetManager.getTimes: ${this.datasetName}`),this.instanced||this.datasetCurrentMeta.times}getVariables(){return S(`WxDataSetManager.getVariables: ${this.datasetName}`),this.datasetCurrentMeta.variables}getVariableMeta(o){return S(`WxDataSetManager.getVariableMeta: ${this.datasetName}, ${o}`),this.datasetCurrentMeta.variablesMeta[o]}getInstanceVariableMeta(o,s){return S(`WxDataSetManager.getInstanceVariableMeta: ${this.datasetName}, ${o}, ${s}`),this.getInstanceMeta(s).variablesMeta[o]}getMaxZoom(){return S(`WxDataSetManager.getMaxZoom: ${this.datasetName}`),this.datasetCurrentMeta.maxZoom}getBoundaries(){return S(`WxDataSetManager.getBoundaries: ${this.datasetName}`),this.datasetCurrentMeta.boundaries}getInstanceMeta(o){return S(`WxDataSetManager.getInstanceMeta: ${this.datasetName}, ${o}`),this.instanced&&this.metas.get(o)||this.datasetCurrentMeta}createURI(o,s,l="png"){if(S(`WxDataSetManager.createURI: ${this.datasetName}, ${o}, ${s}`),!this.checkVariableValid(o))throw new Error(`in dataset ${this.datasetName} variable ${o} not found`);let u=this.instanced?s:this.datasetCurrentInstance;return`${this.wxAPI.dataServerURL+this.datasetName}/${u}/${o}/${s}/{z}/{x}/{y}.${l}`}checkVariableValid(o){return S(`WxDataSetManager.checkVariableValid: ${this.datasetName}, ${o}`),this.getVariableMeta(o)!==void 0}checkCombineVariableIfVector(o){S(`WxDataSetManager.checkCombineVariableIfVector: ${this.datasetName}, ${o}`);let s=this.getVariableMeta(o);if(!s)throw new Error(`in dataset ${this.datasetName} variable ${o} not found`);return s.vector||[o]}createSourceLayer(o,s){S(`WxDataSetManager.createSourceLayer: ${this.datasetName}`);let l={...o,variables:this.checkCombineVariableIfVector(o.variable),wxdatasetManager:this};return new ye(l,s)}async checkDatasetOutdated(){return S(`WxDataSetManager.checkDatasetOutdated: ${this.datasetName}`),await this.wxAPI.initDone,await this.getDatasetInstance()===this.datasetCurrentInstance}async getDatasetInstance(){S(`WxDataSetManager.getDatasetInstance: ${this.datasetName}`);let o=await this.getDatasetInstances();return o[o.length-1]}async getDatasetInstances(){S(`WxDataSetManager.getDatasetInstances: ${this.datasetName}`);try{let o=await Rt(this.wxAPI.dataServerURL+this.datasetName+"/instances.json",this.wxAPI.requestInit);if(o.length===0)throw new Error(`No instances found for dataset ${this.datasetName}`);return o}catch(o){throw new Error(`getting dataset instances failure message: ${o.message} datasetName: ${this.datasetName} (they are likely removed from API)`)}}};var we=class{constructor({dataServerURL:o,maskURL:s="none",maskChannel:l="R",maskDepth:u=11,qtreeURL:c="none",requestInit:f,colorStyles:m,units:y,colorSchemes:_}){this.maskURL="auto";this.datasetsMetas={allDatasetsList:[]};this.qtree=new fe;this.loadMaskFunc=()=>Promise.reject(new Error("maskURL not defined"));if(S("WxAPI.constructor",o),go({colorStyles:m,units:y,colorSchemes:_}),this.dataServerURL=o,this.requestInit=f,c=c==="auto"?o+"masks/11+1.seamask.qtree":c,s!=="none"){let v=de(Fi);this.maskURL=s=s==="auto"?o+"masks/{z}/{x}/{y}.png":s,this.loadMaskFunc=T=>v(Ge(s,T),f)}this.maskChannel=l==="R"?0:l==="G"?1:l==="B"?2:l==="A"?3:0,this.maskDepth=u,this.initDone=Promise.all([Rt(o+"datasetsmeta.json",f),c!=="none"?this.qtree.load(c,f):Promise.resolve()]).then(([v,T])=>{v.allDatasetsList||(v.allDatasetsList=Object.keys(v)),this.datasetsMetas=v,S("WxAPI.constructor initDone")})}getDatasetShortMeta(o){if(S("WxAPI.getDatasetShortMeta",o),o!=="allDatasetsList")return this.datasetsMetas[o]}getDatasetInatance(o){return S("WxAPI.getDatasetInatance",o),this.getDatasetShortMeta(o)?.instance}async getDatasetVariables(o){return await this.initDone,S("WxAPI.getDatasetVariables",o),this.datasetsMetas[o]?.variables}async createDatasetManager(o){await this.initDone,S("WxAPI.createDatasetManager",o);let s=this.getDatasetShortMeta(o),l=s?.instance;if(!l)throw new Error("Dataset/instance not found:"+o);let u=s.instanced,c=_=>Rt(this.dataServerURL+o+"/"+_+"/meta.json",this.requestInit),f=async _=>[_,await c(_)],m=await c(l),y=new Map(u?await Promise.all(u.map(f)):[[l,m]]);return new xe({datasetName:o,datasetCurrentInstance:l,datasetCurrentMeta:m,instanced:u,metas:y,wxAPI:this})}async createAllDatasetsManagers(){return await this.initDone,S("WxAPI.createAllDatasetsManagers"),Promise.allSettled(this.datasetsMetas.allDatasetsList.map(s=>this.createDatasetManager(s)))}async filterDatasetsByVariableName(o){return await this.initDone,S("WxAPI.filterDatasetsByVariableName",o),this.datasetsMetas.allDatasetsList.filter(s=>this.datasetsMetas[s]?.variables?.includes?.(o))}async getAllDatasetsNames(){return await this.initDone,S("WxAPI.getAllDatasetsNames"),this.datasetsMetas.allDatasetsList}};var ei=class{constructor(){let o=document.createElement("div");o.className="mapboxgl-ctrl leaflet-control",o.style.borderStyle="solid",o.style.borderColor="#000",o.style.backgroundColor="#aaaaaaaa",o.style.padding="5px",this._div=o,this._canvas=document.createElement("canvas"),this._canvas.width=600,this._canvas.height=40,o.appendChild(this._canvas)}onAdd(){return this._div}onRemove(){this._div.parentNode?.removeChild(this._div)}drawLegend(o){let{_canvas:s}=this,{width:l,height:u}=s,c=16+u>>2,f=je(l-50,o),m=s.getContext("2d"),y=m.createImageData(l,u),_=new Uint32Array(y.data.buffer);_.fill(-1);let v=2,T=2,P=v+l*T,w=c>>1;if(f.showBelowMin){let M=f.colors[0];if(M)for(let x=0;x<w;++x)for(let C=w;C<w+x;++C)_[P+x+C*l]=M,_[P+x+(w*2-C)*l]=M}for(let M=0;M<f.size;++M)for(let x=0;x<c;++x)f.colors[0]&&(_[v+M+w+(x+T+1)*l]=f.colors[M]);if(f.showAboveMax){let M=f.colors[f.colors.length-1];if(M)for(let x=0;x<=w;++x)for(let C=w;C<w+x;++C)_[P+w*2+f.size-x+C*l]=M,_[P+w*2+f.size-x+(w*2-C)*l]=M}m.putImageData(y,0,0),m.font="8px sans-serif",m.beginPath();for(let M of f.ticks)m.strokeStyle="#000",m.moveTo(M.pos+w+v+1,T+3),m.lineTo(M.pos+w+v+1,c),m.fillText(M.dataString,M.pos+w+v+1,c+11);m.font="12px sans-serif",m.fillText(`(${f.units})`,13,u-5),m.stroke(),m.strokeStyle="#888",m.strokeRect(1,1,l-3,u-2)}clear(){let{_canvas:o}=this,{width:s,height:l}=o;o.getContext("2d").clearRect(0,0,s,l)}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var ii=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=y=>y.stopPropagation?.(),this.styleBase=St().base;let o=yt(this.parent,"div",{onclick:onwheel,ondblclick:onwheel,onwheel,onmousedown,onmouseup}),s=yt(o,"button",{id:"customStyleButton",style:"height: 1.5em; background-color: gray",innerText:"Custom Style"}),l=yt(o,"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",()=>{l.style.display!=="none"?(l.style.display="none",s.innerHTML="show Custom Style Editor"):(l.style.display="flex",s.innerHTML="update Custom Style & Hide")}),this.editorTextAreaEl=yt(l,"textarea",{id:"customStyleTextArea",style:"width: 20vw;"}),this.editorTextAreaEl.readOnly=!0,this.editorDivEl=yt(l,"div");let u=(y,_=!0)=>{yt(this.editorDivEl,"label",{htmlFor:y,id:y+"Label",className:y+"LabelClass",textContent:y.replace(/Input|Select$/i,"")}),_&&yt(this.editorDivEl,"br",{})},c=({id:y,type:_,min:v,max:T,step:P,onEvent:w="change",br:M=!0})=>{let x=yt(this.editorDivEl,"input",{id:y,className:y+"Class",type:_,min:v,max:T,step:P});return w!=="none"&&x.addEventListener(w,()=>this._onDivChange()),u(y,M),x},f=({id:y,opts:_,onEvent:v="change",br:T=!0})=>{let P=yt(this.editorDivEl,"select",{id:y,className:y+"Class"});return v!=="none"&&P.addEventListener(v,()=>this._onDivChange()),_.forEach(w=>P.options.add(yt(P,"option",{value:w,text:w}))),u(y,T),P.selectedIndex=0,P},m=y=>{let _=f({id:y+"Select",br:!1,opts:["inverted","fill","none","custom"]}),v=c({id:y+"Input",type:"color",onEvent:"none"});return v.addEventListener("change",()=>{_.value="custom",this._onDivChange()}),[_,v]};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]=m("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]=m("vectorColor"),[this.streamLineColorSelect,this.streamLineColorInput]=m("streamLineColor"),this.streamLineSpeedFactorInput=c({id:"streamLineSpeedFactorInput",type:"range",onEvent:"input",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(ce()),onEvent:"none"}),this.colorSchemeSelect.addEventListener("change",()=>{let y=this.getStyle();delete y.colors,this._setStyleToTextArea(y),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"]}),this.animationSpeed=c({id:"animationSpeed",type:"range",onEvent:"input",min:"0.1",max:"10",step:"0.1"}),this.noiseTexturePow=c({id:"noiseTexturePow",type:"range",onEvent:"input",min:"5",max:"8",step:"1"}),this.vectorFieldFactor=c({id:"vectorFieldFactor",type:"range",onEvent:"input",min:"0.1",max:"3",step:"0.1"}),this.animationIntensity=c({id:"animationIntensity",type:"range",onEvent:"input",min:"0.1",max:"10",step:"0.1"}),this.wavesCount=c({id:"wavesCount",type:"range",onEvent:"input",min:"2",max:"10",step:"1"})}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}onAdd(){return this.parent}onRemove(){this.parent.parentNode?.removeChild(this.parent)}getStyle(){return this._getStyleFromDiv()}setStyle(o){o.colorMap&&(delete o.colors,delete o.levels),this._setStyleToDiv(o),this._setStyleToTextArea(this._getStyleFromDiv())}_getStyleFromDiv(){let o=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||void 0,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:o("colorsInput"),colorMap:o("colorMapInput"),levels:o("levelsInput"),blurRadius:+this.blurRadiusInput.value,addDegrees:+this.addDegreesInput.value,units:this.unitsInput.value||void 0,extraUnits:o("extraUnitsInput"),mask:this.maskSelect.value||void 0,gl:{animationSpeed:+this.animationSpeed.value||void 0,noiseTexturePow:+this.noiseTexturePow.value||void 0,vectorFieldFactor:+this.vectorFieldFactor.value||void 0,animationIntensity:+this.animationIntensity.value||void 0,wavesCount:+this.wavesCount.value||void 0}}}_setStyleToTextArea(o){this.editorTextAreaEl.value=JSON.stringify(ji(o),null,2)}_setStyleToDiv(o){this.parentInput.value=o.parent||"",this.nameInput.value=o.name||"",this.fillSelect.value=o.fill||"",this.isolineColorSelect.value=o.isolineColor?.[0]==="#"?"custom":o.isolineColor||"",this.isolineColorInput.value=o.isolineColor?.[0]==="#"?o.isolineColor:"#000000",this.isolineTextInput.checked=o.isolineText||!1,this.vectorTypeSelect.value=o.vectorType||"",this.vectorColorSelect.value=o.vectorColor?.[0]==="#"?"custom":o.vectorColor||"",this.vectorColorInput.value=o.vectorColor?.[0]==="#"?o.vectorColor:"#000000",this.vectorFactorInput.value=o.vectorFactor?.toString()||"1",this.streamLineColorSelect.value=o.streamLineColor?.[0]==="#"?"custom":o.streamLineColor||"",this.streamLineColorInput.value=o.streamLineColor?.[0]==="#"?o.streamLineColor:"#000000",this.streamLineSpeedFactorInput.value=o.streamLineSpeedFactor?.toString()||"1",this.streamLineStaticInput.checked=o.streamLineStatic||!1,this.showBelowMinInput.checked=o.showBelowMin||!1,this.showAboveMaxInput.checked=o.showAboveMax||!1,this.colorSchemeSelect.value=o.colorScheme||"",this.colorsInput.value=o.colors?.length?JSON.stringify(o.colors):"",this.colorMapInput.value=o.colorMap?.length?JSON.stringify(o.colorMap):"",this.levelsInput.value=o.levels?.length?JSON.stringify(o.levels.map(s=>+s.toFixed(2))):"",this.blurRadiusInput.value=o.blurRadius?.toString()||"",this.addDegreesInput.value=o.addDegrees?.toString()||"",this.unitsInput.value=o.units||"",this.extraUnitsInput.value=o.extraUnits?JSON.stringify(o.extraUnits):"",this.maskSelect.value=o.mask||"",o.gl?.animationSpeed&&(this.animationSpeed.value=o.gl?.animationSpeed.toString()),o.gl?.noiseTexturePow&&(this.noiseTexturePow.value=o.gl?.noiseTexturePow.toString()),o.gl?.vectorFieldFactor&&(this.vectorFieldFactor.value=o.gl?.vectorFieldFactor.toString()),o.gl?.animationIntensity&&(this.animationIntensity.value=o.gl?.animationIntensity.toString()),o.gl?.wavesCount&&(this.wavesCount.value=o.gl?.wavesCount.toString())}_onDivChange(){let o=this._getStyleFromDiv();Object.keys(o).forEach(s=>(o[s]===void 0||o[s]===""||!o[s].length)&&delete o[s]),this._setStyleToTextArea(o),this.onchange?.(this.getStyle())}};function yt(a,o,s){let l=document.createElement(o);return Object.assign(l,s),a?.appendChild(l),l}function ji(a){return Array.isArray(a)?a.map(ji):typeof a=="object"&&a!==null?Object.keys(a).sort((s,l)=>{let u=s.toUpperCase(),c=l.toUpperCase();return u==c?0:u>c?1:-1}).reduce((s,l)=>(s[l]=ji(a[l]),s),{}):a}var ni=class{constructor(){this.pos={lng:0,lat:0};let o=document.createElement("div");o.className="mapboxgl-ctrl leaflet-control",o.style.borderStyle="solid",o.style.borderColor="#000",o.style.backgroundColor="#aaaaaaaa",o.style.padding="5px",this.div=o}onAdd(){return this.div}onRemove(){this.div.parentNode?.removeChild(this.div)}update(o,s,l){if(l&&(this.pos=l),!o){this.div.innerHTML="";return}let{min:u,max:c,units:f}=o.getCurrentVariableMeta(),{datasetName:m}=o.wxdatasetManager,y=o.wxdatasetManager.getInstanceMeta(o.getTime()),{sourceID:_,baseAtmosphericModel:v,model:T}=y;this.div.innerHTML=`lnglat=(${this.pos.lng.toFixed(2)}, ${this.pos.lat.toFixed(2)})<br>`,this.div.innerHTML+=_&&`sourceID=${_}<br>`||"",this.div.innerHTML+=v&&`baseAtmosphericModel=${v}<br>`||"",this.div.innerHTML+=T&&`model=${T}<br>`||"",this.div.innerHTML+=`dataset=${m}<br>
|
|
7
7
|
variables=${o.getVariables()}<br>
|
|
8
8
|
time=${o.getTime()}<br>
|
|
9
9
|
min=${u.toFixed(2)} ${f}, max=${c.toFixed(2)} ${f}<br>`;let P=o.getLayerInfoAtLatLon(this.pos,s);P?this.div.innerHTML+=`style=${P.inStyleUnits.map(w=>w.toFixed(2))} ${P.styleUnits}<br>
|
|
10
|
-
source=${P.data.map(w=>w.toFixed(2))} ${P.dataUnits}<br>`:this.div.innerHTML+="style=outside<br>source=outside<br>"}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var oi=class{constructor(o,s){this.delay=o;this.wxsource=s;this.onchange=()=>{};let l=document.createElement("div");l.className="mapboxgl-ctrl leaflet-control",l.style.borderStyle="solid",l.style.borderColor="#000",l.style.backgroundColor="#aaaaaaaa",l.style.padding="5px",l.style.display="flex",l.style.flexDirection="column",this._div=l,l.innerText="Time animation",this.button=document.createElement("button"),l.appendChild(this.button),this.timesEl=document.createElement("select"),l.appendChild(this.timesEl),this.timesEl.onchange=async()=>{this.timesEl.style.backgroundColor!=="yellow"&&(this.timesEl.style.backgroundColor="yellow",this.timesEl.value=await this.wxsource?.setTime(this.timesEl.value)||"",this.onchange(this.timesEl.value),this.timesEl.style.backgroundColor="white")},this.wxsource&&this.updateSource(this.wxsource),this.button.innerHTML="Start";let u=0,c={abortController:new AbortController};this.button.onclick=async()=>{if(this.button.innerHTML==="Start"){this.button.innerHTML="Stop";let f=async()=>{if(!!this.wxsource){if(this.timesEl.style.backgroundColor="yellow",this.button.innerHTML==="Stop"){let m=u++%this.wxsource.getTimes().length;await this.wxsource.setTime(m,c.abortController),setTimeout(f,this.delay)}else await this.wxsource.unsetCoarseLevel();this.timesEl.value=this.wxsource.getTime()||"",this.onchange(this.timesEl.value),this.timesEl.style.backgroundColor="white"}};await this.wxsource?.setCoarseLevel(
|
|
10
|
+
source=${P.data.map(w=>w.toFixed(2))} ${P.dataUnits}<br>`:this.div.innerHTML+="style=outside<br>source=outside<br>"}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var oi=class{constructor(o,s){this.delay=o;this.wxsource=s;this.onchange=()=>{};let l=document.createElement("div");l.className="mapboxgl-ctrl leaflet-control",l.style.borderStyle="solid",l.style.borderColor="#000",l.style.backgroundColor="#aaaaaaaa",l.style.padding="5px",l.style.display="flex",l.style.flexDirection="column",this._div=l,l.innerText="Time animation",this.button=document.createElement("button"),l.appendChild(this.button),this.timesEl=document.createElement("select"),l.appendChild(this.timesEl),this.timesEl.onchange=async()=>{this.timesEl.style.backgroundColor!=="yellow"&&(this.timesEl.style.backgroundColor="yellow",this.timesEl.value=await this.wxsource?.setTime(this.timesEl.value)||"",this.onchange(this.timesEl.value),this.timesEl.style.backgroundColor="white")},this.wxsource&&this.updateSource(this.wxsource),this.button.innerHTML="Start";let u=0,c={abortController:new AbortController};this.button.onclick=async()=>{if(this.button.innerHTML==="Start"){this.button.innerHTML="Stop";let f=async()=>{if(!!this.wxsource){if(this.timesEl.style.backgroundColor="yellow",this.button.innerHTML==="Stop"){let m=u++%this.wxsource.getTimes().length;await this.wxsource.setTime(m,c.abortController),setTimeout(f,this.delay)}else await this.wxsource.unsetCoarseLevel();this.timesEl.value=this.wxsource.getTime()||"",this.onchange(this.timesEl.value),this.timesEl.style.backgroundColor="white"}};await this.wxsource?.setCoarseLevel(2),f()}else c.abortController.abort(),c.abortController=new AbortController,this.button.innerHTML="Start"}}setTimes(o){this.timesEl.options.length=0;for(let s=0;s<o.length;s++){let l=document.createElement("option");l.value=o[s],l.text=o[s],this.timesEl.appendChild(l)}this.onchange(this.timesEl.value)}updateSource(o){this.button.innerHTML="Start",this.wxsource=o,this.timesEl.options.length=0;let s=this.wxsource?.getTimes()||[];this.setTimes(s),this.timesEl.value=this.wxsource?.getTime()||"",this.onchange(this.timesEl.value)}onAdd(){return this._div}onRemove(){this._div.parentNode?.removeChild(this._div)}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var ri=class{constructor(o,s,l){this.wxapi=o;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,l),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=l||""}async fillDatasets(o,s){this.datasets.options.length=0,(await this.wxapi.getAllDatasetsNames()).forEach(l=>{let u=document.createElement("option");u.value=l,u.text=l,this.datasets.appendChild(u)}),o&&(this.datasets.value=o),await this.fillVariables(s)}async fillVariables(o){this.variables.options.length=0;let s=this.datasets.value;(await this.wxapi.getDatasetVariables(s)).forEach(l=>{let u=document.createElement("option");u.value=l,u.text=l,this.variables.appendChild(u)}),o&&(this.variables.value=o)}onAdd(){return this._div}onRemove(){this._div.parentNode?.removeChild(this._div)}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var be=uo(Xi());function Yi(a,o,s,l,u,c){a.flyTo([l,s],o)}function Nt(a,o,s,l,u){let c=St().base;for(let y in u)u[y]===c[y]&&delete u[y];let f=a.getCenter().wrap(),m=`##${s}/${l}/${o}/${a.getZoom().toFixed(2)}/${f.lng.toFixed(2)}/${f.lat.toFixed(2)}/0/0`+(u?"/"+JSON.stringify(u):"");history.replaceState(null,"",m)}async function Ao(){let a=be.default.map("map",{center:[-40.75,174.5],zoom:7,zoomControl:!1});return be.default.control.zoom({position:"bottomright"}).addTo(a),a}function Yt(a,o,s){s=s.replace("-",""),a.addControl(new(be.default.Control.extend(o.extender()))({position:s}))}function Zo(a){return a.latlng.wrap()}function Oo(a,o,s){a.eachLayer(l=>{l.options.id===o&&a.removeLayer(l)})}async function zo(a,o,s){a.addLayer(s),await new Promise(l=>s.once("load",l))}function Ki(a,o,s,l,u){let c=be.default.tileLayer(l,{id:o,maxNativeZoom:u,zIndex:s==="baseL"?100:0});a.addLayer(c)}var Os=.8;async function Bo(){let a=await Ao();Ki(a,"baseS","baseL","https://tiles.metoceanapi.com/base-lines/{z}/{x}/{y}",5);let o="data/",s=new Headers,l=new we({dataServerURL:o,maskURL:"auto",maskChannel:"R",qtreeURL:"auto",requestInit:{headers:s}}),u="gfs.global",c="wind.speed.eastward.at-10m",m=window.location.toString().split("##")[1]?.split("/");u=m?.[0]||u,m?.[1]&&(c=m[1]);let y=m?.[2]||"",_=m&&parseFloat(m[3])||0,v=m&&parseFloat(m[4])||0,T=m&&parseFloat(m[5])||0,P=m&&parseFloat(m[6])||0,w=m&&parseFloat(m[7])||0;m?.length>8&&(m[8]=m.slice(8).join("/"));let M=m?.[8]&&m[8],x={style:{}};try{x.style=M&&{...JSON.parse(decodeURI(M))}}catch{console.log("Can't parse style from URL")}m&&Yi(a,_,v,T,P,w),a.on("zoom",()=>Nt(a,y,u,c,x.style)),a.on("drag",()=>Nt(a,y,u,c,x.style)),a.on("rotate",()=>Nt(a,y,u,c,x.style)),a.on("pitch",()=>Nt(a,y,u,c,x.style));let C,k=new ei;Yt(a,k,"top-right");let z={id:"wxsource",opacity:Os,attribution:"WxTiles"},Z=new ri(l,u,c);Yt(a,Z,"top-left"),Z.onchange=async(q,rt,$=!0)=>{S("apiControl.onchange datasetName=",q,"variable=",rt),Oo(a,z.id,C),$&&(x.style={}),C=void 0,u=q,c=rt;let G=await l.createDatasetManager(u),Le=G.getBoundaries();if(Le&&$){let{east:xt,west:ot,north:Ct,south:E}=Le.boundariesnorm,Te=Math.round(Math.log(360*360/Math.max((xt-ot+360)%360,Ct-E)/360)/Math.LN2);Yi(a,Te,(xt+ot)/2,(Ct+E)/2,0,0)}if(G.getVariableMeta(c)?.units==="RGB")Ki(a,z.id,"wxtiles",G.createURI(c,G.getTimes()[0]),G.getMaxZoom()),H.setTimes(G.getTimes()),k.clear();else{C=G.createSourceLayer({variable:c,time:y,wxstyle:x.style},z),C.setCoarseLevel(-8),await zo(a,"wxtiles",C);let xt=C.getCurrentStyleObjectCopy();k.drawLegend(xt),xt.levels=x.style?.levels,xt.colors=x.style?.colors,await V.onchange?.(xt,!0)}H.updateSource(C)};let H=new oi(50);Yt(a,H,"top-left"),H.onchange=q=>{Nt(a,y=q,u,c,x.style),N.update(C,a)};let V=new ii;Yt(a,V,"top-right"),V.onchange=async(q,rt)=>{if(S("customStyleEditorControl.onchange"),!C)return;rt||await C.updateCurrentStyleObject(q);let $=C.getCurrentStyleObjectCopy();k.drawLegend($),$.levels=q?.levels,$.colors=q?.colors,V.setStyle($),x.style=$,Nt(a,y,u,c,x.style)};let N=new ni;Yt(a,N,"bottom-left"),a.on("mousemove",q=>N.update(C,a,Zo(q))),await Z.onchange(u,c,!1)}Bo();})();
|
|
11
11
|
/* @preserve
|
|
12
12
|
* Leaflet 1.9.3, a JS library for interactive maps. https://leafletjs.com
|
|
13
13
|
* (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|