@metoceanapi/wxtiles-leaflet 2.1.3 → 2.3.0-0

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/GPLv3.txt +674 -0
  3. package/LICENSE.txt +12 -9
  4. package/README.md +10 -32
  5. package/dist/es/controls/WxAPIControl.d.ts +4 -2
  6. package/dist/es/controls/WxTimeControl .d.ts +1 -1
  7. package/dist/es/index.d.ts +13 -17
  8. package/dist/es/index.js +2 -2
  9. package/dist/es/utils/RawCLUT.d.ts +9 -8
  10. package/dist/es/utils/qtree.d.ts +6 -4
  11. package/dist/es/utils/wxtools.d.ts +16 -5
  12. package/dist/es/wxAPI/WxAPI.d.ts +63 -0
  13. package/dist/es/wxAPI/WxAPItypes.d.ts +152 -0
  14. package/dist/es/wxAPI/WxDataSetManager.d.ts +69 -92
  15. package/dist/es/wxlayer/WxImplementation.d.ts +36 -11
  16. package/dist/es/wxlayer/loader.d.ts +3 -3
  17. package/dist/es/wxlayer/loadertools.d.ts +1 -1
  18. package/dist/es/wxlayer/painter.d.ts +1 -1
  19. package/dist/es/wxlayer/wxlayer.d.ts +48 -26
  20. package/dist/es/wxsource/wxsource.d.ts +3 -1
  21. package/dist/es/wxsource/wxsourcetypes.d.ts +2 -1
  22. package/dist/web/index.js +2 -2
  23. package/docs/docs/assets/highlight.css +4 -4
  24. package/docs/docs/assets/search.js +1 -1
  25. package/docs/docs/classes/CustomWxTilesLayer.html +1 -1
  26. package/docs/docs/classes/DataIntegral.html +13 -13
  27. package/docs/docs/classes/Loader.html +17 -17
  28. package/docs/docs/classes/Painter.html +11 -11
  29. package/docs/docs/classes/QTree.html +63 -34
  30. package/docs/docs/classes/RawCLUT.html +8 -8
  31. package/docs/docs/classes/TilesCache.html +108 -0
  32. package/docs/docs/classes/WxAPI.html +31 -104
  33. package/docs/docs/classes/WxDataSetManager.html +118 -184
  34. package/docs/docs/classes/WxLayer.html +78 -60
  35. package/docs/docs/classes/WxLayerBaseImplementation.html +52 -43
  36. package/docs/docs/classes/WxTileSource.html +63 -47
  37. package/docs/docs/enums/TileType.html +4 -4
  38. package/docs/docs/functions/WXLOG.html +9 -7
  39. package/docs/docs/functions/WxCreateLegend.html +11 -9
  40. package/docs/docs/functions/WxGetColorSchemes.html +9 -7
  41. package/docs/docs/functions/WxGetColorStyles.html +9 -7
  42. package/docs/docs/functions/WxTilesLogging.html +9 -7
  43. package/docs/docs/index.html +21 -20
  44. package/docs/docs/interfaces/CachedUriLoaderPromiseFunc.html +106 -0
  45. package/docs/docs/interfaces/ColorStylesIncomplete.html +9 -7
  46. package/docs/docs/interfaces/Converter.html +5 -3
  47. package/docs/docs/interfaces/DataPicture.html +5 -5
  48. package/docs/docs/interfaces/FrameworkOptions.html +5 -4
  49. package/docs/docs/interfaces/IntegralPare.html +3 -3
  50. package/docs/docs/interfaces/SLinePoint.html +3 -3
  51. package/docs/docs/interfaces/Tree.html +2 -2
  52. package/docs/docs/interfaces/WxAPIOptions.html +17 -17
  53. package/docs/docs/interfaces/WxAllBoundariesMeta.html +4 -4
  54. package/docs/docs/interfaces/WxAllDatasetsShortMetas.html +120 -0
  55. package/docs/docs/interfaces/WxBoundaryMeta.html +5 -5
  56. package/docs/docs/interfaces/WxColorSchemes.html +9 -7
  57. package/docs/docs/interfaces/WxColorStyleStrict.html +45 -27
  58. package/docs/docs/interfaces/WxColorStyleWeak.html +47 -27
  59. package/docs/docs/interfaces/WxColorStylesStrict.html +2 -2
  60. package/docs/docs/interfaces/WxColorStylesWeakMixed.html +9 -7
  61. package/docs/docs/interfaces/WxData.html +3 -3
  62. package/docs/docs/interfaces/WxDataSetManagerOptions.html +12 -12
  63. package/docs/docs/interfaces/WxDatasetMeta.html +18 -9
  64. package/docs/docs/interfaces/WxDatasetShortMeta.html +5 -5
  65. package/docs/docs/interfaces/WxLayerAPI.html +92 -26
  66. package/docs/docs/interfaces/WxLayerBaseAPI.html +21 -21
  67. package/docs/docs/interfaces/WxLayerOptions.html +9 -10
  68. package/docs/docs/interfaces/WxLegend.html +7 -7
  69. package/docs/docs/interfaces/WxLngLat.html +3 -3
  70. package/docs/docs/interfaces/WxRasterData.html +6 -6
  71. package/docs/docs/interfaces/WxRequestInit.html +2 -2
  72. package/docs/docs/interfaces/WxSourceLayerOptions.html +8 -5
  73. package/docs/docs/interfaces/WxTick.html +5 -5
  74. package/docs/docs/interfaces/WxTileInfo.html +9 -9
  75. package/docs/docs/interfaces/WxUnits.html +9 -7
  76. package/docs/docs/interfaces/WxVariableMeta.html +6 -6
  77. package/docs/docs/interfaces/WxVariablesMetas.html +9 -7
  78. package/docs/docs/interfaces/XYZ.html +4 -4
  79. package/docs/docs/modules.html +17 -13
  80. package/docs/docs/types/DataIntegrals.html +9 -7
  81. package/docs/docs/types/DataPictures.html +9 -7
  82. package/docs/docs/types/{UriLoaderPromiseFunc.html → ListenerMethod.html} +21 -23
  83. package/docs/docs/types/SLine.html +9 -7
  84. package/docs/docs/types/SubTrees.html +9 -7
  85. package/docs/docs/types/SubTreesN.html +9 -7
  86. package/docs/docs/types/TreeN.html +9 -7
  87. package/docs/docs/types/WxDate.html +17 -8
  88. package/docs/docs/types/WxEventType.html +116 -0
  89. package/docs/docs/types/{WxVars.html → WxInstances.html} +13 -13
  90. package/docs/docs/types/WxLayerVarsNames.html +113 -0
  91. package/docs/docs/types/WxURIs.html +9 -7
  92. package/docs/docs/types/WxUnitTuple.html +9 -7
  93. package/docs/examples/interactive.html +84 -0
  94. package/docs/examples/seaMaskAndAnimatedBlur.html +31 -23
  95. package/docs/examples/simpleDemo.html +33 -22
  96. package/docs/script/script.css +1 -1
  97. package/docs/script/script.js +13 -9
  98. package/docs/server.py +11 -0
  99. package/package.json +1 -1
  100. package/src_example/frwrkdeps.ts +6 -3
  101. package/src_example/index.ts +31 -54
  102. package/src_example/start.ts +39 -21
  103. package/watch-public.mjs +1 -7
  104. package/dist/es/wxAPI/wxAPI.d.ts +0 -192
  105. package/docs/docs/classes/FrameworkParentClass.html +0 -98
  106. package/docs/docs/interfaces/WxDataSetsMetasJSON.html +0 -75
  107. package/docs/docs/interfaces/WxTilesLibOptions.html +0 -92
@@ -1,14 +1,18 @@
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">&#x2212;</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">&#215;</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:
1
+ (()=>{var cs=Object.create;var uo=Object.defineProperty;var ds=Object.getOwnPropertyDescriptor;var fs=Object.getOwnPropertyNames;var ms=Object.getPrototypeOf,ps=Object.prototype.hasOwnProperty;var _s=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var gs=(a,o,s,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let u of fs(o))!ps.call(a,u)&&u!==s&&uo(a,u,{get:()=>o[u],enumerable:!(l=ds(o,u))||l.enumerable});return a};var co=(a,o,s)=>(s=a!=null?cs(ms(a)):{},gs(o||!a||!a.__esModule?uo(s,"default",{value:a,enumerable:!0}):s,a));var Yi=_s((ti,Ao)=>{(function(a,o){typeof ti=="object"&&typeof Ao<"u"?o(ti):typeof define=="function"&&define.amd?define(["exports"],o):(a=typeof globalThis<"u"?globalThis:a||self,o(a.leaflet={}))})(ti,function(a){"use strict";var o="1.9.4";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 w(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function T(t){return w(t).split(/\s+/)}function x(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 C=/\{ *([\w_ -]+) *\}/g;function S(t,e){return t.replace(C,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 W=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 E="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function N(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var q=0;function F(t){var e=+new Date,i=Math.max(0,16-(e-q));return q=e+i,window.setTimeout(t,i)}var G=window.requestAnimationFrame||N("RequestAnimationFrame")||F,at=window.cancelAnimationFrame||N("CancelAnimationFrame")||N("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function $(t,e,i){if(i&&G===F)t.call(e);else return G.call(window,u(t,e))}function X(t){t&&at.call(window,t)}var Te={__proto__:null,extend:s,create:l,bind:u,get lastId(){return c},stamp:f,throttle:m,wrapNum:g,falseFn:v,formatNum:y,trim:w,splitWords:T,setOptions:x,getParamString:M,template:S,isArray:W,indexOf:Z,emptyImageUrl:E,requestFn:G,cancelFn:at,requestAnimFrame:$,cancelAnimFrame:X};function vt(){}vt.extend=function(t){var e=function(){x(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&&(dt(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},vt.include=function(t){var e=this.prototype.options;return s(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},vt.mergeOptions=function(t){return s(this.prototype.options,t),this},vt.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 dt(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=W(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 rt={on:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e);else{t=T(t);for(var 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=T(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=T(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)}};rt.addEventListener=rt.on,rt.removeEventListener=rt.clearAllEventListeners=rt.off,rt.addOneTimeEventListener=rt.once,rt.fireEvent=rt.fire,rt.hasEventListeners=rt.listens;var kt=vt.extend(rt);function A(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var Se=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};A.prototype={clone:function(){return new A(this.x,this.y)},add:function(t){return this.clone()._add(z(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(z(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 A(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new A(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=Se(this.x),this.y=Se(this.y),this},distanceTo:function(t){t=z(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=z(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=z(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 z(t,e,i){return t instanceof A?t:W(t)?new A(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new A(t.x,t.y):new A(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 A||typeof t[0]=="number"||"x"in t)e=i=z(t);else if(t=lt(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 z((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return z(this.min.x,this.max.y)},getTopRight:function(){return z(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 A?t=z(t):t=lt(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=lt(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=lt(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 lt(z(e.x-n,e.y-r),z(i.x+n,i.y+r))},equals:function(t){return t?(t=lt(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function lt(t,e){return!t||t instanceof K?t:new K(t,e)}function ht(t,e){if(t)for(var i=e?[t,e]:t,n=0,r=i.length;n<r;n++)this.extend(i[n])}ht.prototype={extend:function(t){var e=this._southWest,i=this._northEast,n,r;if(t instanceof j)n=t,r=t;else if(t instanceof ht){if(n=t._southWest,r=t._northEast,!n||!r)return this}else return t?this.extend(H(t)||tt(t)):this;return!e&&!i?(this._southWest=new j(n.lat,n.lng),this._northEast=new j(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 ht(new j(e.lat-n,e.lng-r),new j(i.lat+n,i.lng+r))},getCenter:function(){return new j((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 j(this.getNorth(),this.getWest())},getSouthEast:function(){return new j(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 j||"lat"in t?t=H(t):t=tt(t);var e=this._southWest,i=this._northEast,n,r;return t instanceof ht?(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=tt(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=tt(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=tt(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function tt(t,e){return t instanceof ht?t:new ht(t,e)}function j(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)}j.prototype={equals:function(t,e){if(!t)return!1;t=H(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 Dt.distance(this,H(t))},wrap:function(){return Dt.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return tt([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new j(this.lat,this.lng,this.alt)}};function H(t,e,i){return t instanceof j?t:W(t)&&typeof t[0]!="object"?t.length===3?new j(t[0],t[1],t[2]):t.length===2?new j(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new j(t.lat,"lng"in t?t.lng:t.lon,t.alt):e===void 0?null:new j(t,e,i)}var Tt={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 j(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 j(h.lat-n,h.lng-r),_=new j(d.lat-n,d.lng-r);return new ht(p,_)}},Dt=s({},Tt,{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*_}}),Qi=6378137,ui={R:Qi,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),r=Math.sin(n*e);return new A(this.R*t.lng*e,this.R*Math.log((1+r)/(1-r))/2)},unproject:function(t){var e=180/Math.PI;return new j((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=Qi*Math.PI;return new K([-t,-t],[t,t])}()};function ci(t,e,i,n){if(W(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}ci.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 A((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};function Qt(t,e,i,n){return new ci(t,e,i,n)}var di=s({},Dt,{code:"EPSG:3857",projection:ui,transformation:function(){var t=.5/(Math.PI*ui.R);return Qt(t,.5,-t,.5)}()}),Fo=s({},di,{code:"EPSG:900913"});function tn(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function en(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?k.svg?"z":"x":""}return i||"M0 0"}var fi=document.documentElement.style,Pe="ActiveXObject"in window,Ho=Pe&&!document.addEventListener,nn="msLaunchUri"in navigator&&!("documentMode"in document),mi=yt("webkit"),on=yt("android"),rn=yt("android 2")||yt("android 3"),Uo=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Vo=on&&yt("Google")&&Uo<537&&!("AudioNode"in window),pi=!!window.opera,sn=!nn&&yt("chrome"),an=yt("gecko")&&!mi&&!pi&&!Pe,qo=!sn&&yt("safari"),ln=yt("phantom"),hn="OTransition"in fi,$o=navigator.platform.indexOf("Win")===0,un=Pe&&"transition"in fi,_i="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rn,cn="MozPerspective"in fi,Go=!window.L_DISABLE_3D&&(un||_i||cn)&&!hn&&!ln,te=typeof orientation<"u"||yt("mobile"),Xo=te&&mi,jo=te&&_i,dn=!window.PointerEvent&&window.MSPointerEvent,fn=!!(window.PointerEvent||dn),mn="ontouchstart"in window||!!window.TouchEvent,Yo=!window.L_NO_TOUCH&&(mn||fn),Ko=te&&pi,Jo=te&&an,Qo=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,tr=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}(),er=function(){return!!document.createElement("canvas").getContext}(),gi=!!(document.createElementNS&&tn("svg").createSVGRect),ir=!!gi&&function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),nr=!gi&&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}}(),or=navigator.platform.indexOf("Mac")===0,rr=navigator.platform.indexOf("Linux")===0;function yt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var k={ie:Pe,ielt9:Ho,edge:nn,webkit:mi,android:on,android23:rn,androidStock:Vo,opera:pi,chrome:sn,gecko:an,safari:qo,phantom:ln,opera12:hn,win:$o,ie3d:un,webkit3d:_i,gecko3d:cn,any3d:Go,mobile:te,mobileWebkit:Xo,mobileWebkit3d:jo,msPointer:dn,pointer:fn,touch:Yo,touchNative:mn,mobileOpera:Ko,mobileGecko:Jo,retina:Qo,passiveEvents:tr,canvas:er,svg:gi,vml:nr,inlineSvg:ir,mac:or,linux:rr},pn=k.msPointer?"MSPointerDown":"pointerdown",_n=k.msPointer?"MSPointerMove":"pointermove",gn=k.msPointer?"MSPointerUp":"pointerup",vn=k.msPointer?"MSPointerCancel":"pointercancel",vi={touchstart:pn,touchmove:_n,touchend:gn,touchcancel:vn},yn={touchstart:cr,touchmove:Ce,touchend:Ce,touchcancel:Ce},Ht={},xn=!1;function sr(t,e,i){return e==="touchstart"&&ur(),yn[e]?(i=yn[e].bind(this,i),t.addEventListener(vi[e],i,!1),i):(console.warn("wrong event specified:",e),v)}function ar(t,e,i){if(!vi[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(vi[e],i,!1)}function lr(t){Ht[t.pointerId]=t}function hr(t){Ht[t.pointerId]&&(Ht[t.pointerId]=t)}function bn(t){delete Ht[t.pointerId]}function ur(){xn||(document.addEventListener(pn,lr,!0),document.addEventListener(_n,hr,!0),document.addEventListener(gn,bn,!0),document.addEventListener(vn,bn,!0),xn=!0)}function Ce(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in Ht)e.touches.push(Ht[i]);e.changedTouches=[e],t(e)}}function cr(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ot(e),Ce(t,e)}function dr(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 fr=200;function mr(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<=fr?(n++,n===2&&e(dr(h))):n=1,i=p}}}return t.addEventListener("click",r),{dblclick:e,simDblclick:r}}function pr(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var yi=We(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ee=We(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),wn=ee==="webkitTransition"||ee==="OTransition"?ee+"End":"transitionend";function Ln(t){return typeof t=="string"?document.getElementById(t):t}function ie(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 V(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 Ut(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function Vt(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function xi(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=Ie(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function B(t,e){if(t.classList!==void 0)for(var i=T(e),n=0,r=i.length;n<r;n++)t.classList.add(i[n]);else if(!xi(t,e)){var h=Ie(t);bi(t,(h?h+" ":"")+e)}}function Q(t,e){t.classList!==void 0?t.classList.remove(e):bi(t,w((" "+Ie(t)+" ").replace(" "+e+" "," ")))}function bi(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e}function Ie(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function ft(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&_r(t,e)}function _r(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 We(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Zt(t,e,i){var n=e||new A(0,0);t.style[yi]=(k.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function et(t,e){t._leaflet_pos=e,k.any3d?Zt(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function zt(t){return t._leaflet_pos||new A(0,0)}var ne,oe,wi;if("onselectstart"in document)ne=function(){O(window,"selectstart",ot)},oe=function(){Y(window,"selectstart",ot)};else{var re=We(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ne=function(){if(re){var t=document.documentElement.style;wi=t[re],t[re]="none"}},oe=function(){re&&(document.documentElement.style[re]=wi,wi=void 0)}}function Li(){O(window,"dragstart",ot)}function Ti(){Y(window,"dragstart",ot)}var ke,Si;function Pi(t){for(;t.tabIndex===-1;)t=t.parentNode;t.style&&(De(),ke=t,Si=t.style.outlineStyle,t.style.outlineStyle="none",O(window,"keydown",De))}function De(){ke&&(ke.style.outlineStyle=Si,ke=void 0,Si=void 0,Y(window,"keydown",De))}function Tn(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function Ci(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var gr={__proto__:null,TRANSFORM:yi,TRANSITION:ee,TRANSITION_END:wn,get:Ln,getStyle:ie,create:V,remove:J,empty:Me,toFront:Ut,toBack:Vt,hasClass:xi,addClass:B,removeClass:Q,setClass:bi,getClass:Ie,setOpacity:ft,testProp:We,setTransform:Zt,setPosition:et,getPosition:zt,get disableTextSelection(){return ne},get enableTextSelection(){return oe},disableImageDrag:Li,enableImageDrag:Ti,preventOutline:Pi,restoreOutline:De,getSizedParentNode:Tn,getScale:Ci};function O(t,e,i,n){if(e&&typeof e=="object")for(var r in e)Ii(t,r,e[r],i);else{e=T(e);for(var h=0,d=e.length;h<d;h++)Ii(t,e[h],i,n)}return this}var xt="_leaflet_events";function Y(t,e,i,n){if(arguments.length===1)Sn(t),delete t[xt];else if(e&&typeof e=="object")for(var r in e)Wi(t,r,e[r],i);else if(e=T(e),arguments.length===2)Sn(t,function(p){return Z(e,p)!==-1});else for(var h=0,d=e.length;h<d;h++)Wi(t,e[h],i,n);return this}function Sn(t,e){for(var i in t[xt]){var n=i.split(/\d/)[0];(!e||e(n))&&Wi(t,n,null,null,i)}}var Mi={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ii(t,e,i,n){var r=e+f(i)+(n?"_"+f(n):"");if(t[xt]&&t[xt][r])return this;var h=function(p){return i.call(n||t,p||window.event)},d=h;!k.touchNative&&k.pointer&&e.indexOf("touch")===0?h=sr(t,e,h):k.touch&&e==="dblclick"?h=mr(t,h):"addEventListener"in t?e==="touchstart"||e==="touchmove"||e==="wheel"||e==="mousewheel"?t.addEventListener(Mi[e]||e,h,k.passiveEvents?{passive:!1}:!1):e==="mouseenter"||e==="mouseleave"?(h=function(p){p=p||window.event,Di(t,p)&&d(p)},t.addEventListener(Mi[e],h,!1)):t.addEventListener(e,d,!1):t.attachEvent("on"+e,h),t[xt]=t[xt]||{},t[xt][r]=h}function Wi(t,e,i,n,r){r=r||e+f(i)+(n?"_"+f(n):"");var h=t[xt]&&t[xt][r];if(!h)return this;!k.touchNative&&k.pointer&&e.indexOf("touch")===0?ar(t,e,h):k.touch&&e==="dblclick"?pr(t,h):"removeEventListener"in t?t.removeEventListener(Mi[e]||e,h,!1):t.detachEvent("on"+e,h),t[xt][r]=null}function Ot(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function ki(t){return Ii(t,"wheel",Ot),this}function se(t){return O(t,"mousedown touchstart dblclick contextmenu",Ot),t._leaflet_disable_click=!0,this}function ot(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Bt(t){return ot(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 Cn(t,e){if(!e)return new A(t.clientX,t.clientY);var i=Ci(e),n=i.boundingClientRect;return new A((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var vr=k.linux&&k.chrome?window.devicePixelRatio:k.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Mn(t){return k.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/vr: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 Di(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 yr={__proto__:null,on:O,off:Y,stopPropagation:Ot,disableScrollPropagation:ki,disableClickPropagation:se,preventDefault:ot,stop:Bt,getPropagationPath:Pn,getMousePosition:Cn,getWheelDelta:Mn,isExternalTarget:Di,addListener:O,removeListener:Y},In=kt.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=zt(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(),et(this._el,i),this.fire("step")},_complete:function(){X(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),U=kt.extend({options:{crs:di,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=x(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(H(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ee&&k.any3d&&!k.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(H(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||(k.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(k.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 A?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():tt(t);var i=z(e.paddingTopLeft||e.padding||[0,0]),n=z(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=tt(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=z(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 In,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||!k.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=H(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,I=1.42,D=I*I;function R(it){var Ve=it?-1:1,as=it?_:p,ls=_*_-p*p+Ve*D*D*b*b,hs=2*as*D*b,Ui=ls/hs,ho=Math.sqrt(Ui*Ui+1)-Ui,us=ho<1e-9?-18:Math.log(ho);return us}function st(it){return(Math.exp(it)-Math.exp(-it))/2}function nt(it){return(Math.exp(it)+Math.exp(-it))/2}function pt(it){return st(it)/nt(it)}var ut=R(0);function Yt(it){return p*(nt(ut)/nt(ut+I*it))}function ns(it){return p*(nt(ut)*pt(ut+I*it)-st(ut))/D}function os(it){return 1-Math.pow(1-it,1.5)}var rs=Date.now(),ao=(R(1)-ut)/I,ss=i.duration?1e3*i.duration:1e3*ao*.8;function lo(){var it=(Date.now()-rs)/ss,Ve=os(it)*ao;it<=1?(this._flyToFrame=$(lo,this),this._move(this.unproject(n.add(r.subtract(n).multiplyBy(ns(Ve)/b)),d),this.getScaleZoom(p/Yt(Ve),d),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),lo.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=tt(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,tt(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var i=z(e.paddingTopLeft||e.padding||[0,0]),n=z(e.paddingBottomRight||e.padding||[0,0]),r=this.project(this.getCenter()),h=this.project(t),d=this.getPixelBounds(),p=lt([d.min.add(i),d.max.subtract(n)]),_=p.getSize();if(!p.contains(h)){this._enforcingBounds=!0;var b=h.subtract(p.getCenter()),I=p.extend(h).getSize().subtract(_);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 j(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&&(X(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=V("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 ht(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=tt(t),i=z(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=lt(this.project(p,n),this.project(d,n)).getSize(),I=k.any3d?this.options.zoomSnap:1,D=_.x/b.x,R=_.y/b.y,st=e?Math.max(D,R):Math.min(D,R);return n=this.getScaleZoom(st,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 A(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(H(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(z(t),e)},layerPointToLatLng:function(t){var e=z(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(H(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(H(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(tt(t))},distance:function(t,e){return this.options.crs.distance(H(t),H(e))},containerPointToLayerPoint:function(t){return z(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return z(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(z(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(H(t)))},mouseEventToContainerPoint:function(t){return Cn(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=Ln(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&&k.any3d,B(t,"leaflet-container"+(k.touch?" leaflet-touch":"")+(k.retina?" leaflet-retina":"")+(k.ielt9?" leaflet-oldie":"")+(k.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ie(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),et(this._mapPane,new A(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){et(this._mapPane,new A(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 X(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){et(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),k.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){X(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&&!Di(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"&&Pi(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"&&ot(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&&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 zt(this._mapPane)||new A(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 lt([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=lt(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 A(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=k.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=V("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=yi,n=this._proxy.style[i];Zt(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();Zt(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,i.noMoveStart||!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 xr(t,e){return new U(t,e)}var _t=vt.extend({options:{position:"topright"},initialize:function(t){x(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()}}),ae=function(t){return new _t(t)};U.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=V("div",e+"control-container",this._container);function n(r,h){var d=e+r+" "+e+h;t[r+h]=V("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 Wn=_t.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){x(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!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 _t.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=V("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),se(e),ki(e);var n=this._section=V("section",t+"-list");i&&(this._map.on("click",this.collapse,this),O(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var r=this._layersLink=V("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){ot(h),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=V("div",t+"-base",n),this._separator=V("div",t+"-separator",n),this._overlaysList=V("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(){if(!this._preventClick){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;this._preventClick=!0,O(t,"click",ot),this.expand();var e=this;setTimeout(function(){Y(t,"click",ot),e._preventClick=!1})}}),br=function(t,e,i){return new Wn(t,e,i)},Ei=_t.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=V("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=V("a",i,n);return h.innerHTML=t,h.href="#",h.title=e,h.setAttribute("role","button"),h.setAttribute("aria-label",e),se(h),O(h,"click",Bt),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"))}});U.mergeOptions({zoomControl:!0}),U.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ei,this.addControl(this.zoomControl))});var wr=function(t){return new Ei(t)},kn=_t.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=V("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=V("div",e,i)),t.imperial&&(this._iScale=V("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}}),Lr=function(t){return new kn(t)},Tr='<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>',Ai=_t.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(k.inlineSvg?Tr+" ":"")+"Leaflet</a>"},initialize:function(t){x(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=V("div","leaflet-control-attribution"),se(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> ')}}});U.mergeOptions({attributionControl:!0}),U.addInitHook(function(){this.options.attributionControl&&new Ai().addTo(this)});var Sr=function(t){return new Ai(t)};_t.Layers=Wn,_t.Zoom=Ei,_t.Scale=kn,_t.Attribution=Ai,ae.layers=br,ae.zoom=wr,ae.scale=Lr,ae.attribution=Sr;var bt=vt.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}});bt.addTo=function(t,e){return t.addHandler(e,this),this};var Pr={Events:rt},Dn=k.touch?"touchstart mousedown":"mousedown",Et=kt.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){x(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(O(this._dragStartTarget,Dn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Et._dragging===this&&this.finishDrag(!0),Y(this._dragStartTarget,Dn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!xi(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){Et._dragging===this&&this.finishDrag();return}if(!(Et._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(Et._dragging=this,this._preventOutline&&Pi(this._element),Li(),ne(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,i=Tn(this._element);this._startPoint=new A(e.clientX,e.clientY),this._startPos=zt(this._element),this._parentScale=Ci(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 A(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,ot(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),et(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),Ti(),oe();var e=this._moved&&this._moving;this._moving=!1,Et._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function En(t,e,i){var n,r=[1,4,2,8],h,d,p,_,b,I,D,R;for(h=0,I=t.length;h<I;h++)t[h]._code=Rt(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++)_=t[h],b=t[d],_._code&D?b._code&D||(R=Ee(b,_,D,e,i),R._code=Rt(R,e),n.push(R)):(b._code&D&&(R=Ee(b,_,D,e,i),R._code=Rt(R,e),n.push(R)),n.push(_));t=n}return t}function An(t,e){var i,n,r,h,d,p,_,b,I;if(!t||t.length===0)throw new Error("latlngs not passed");mt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var D=H([0,0]),R=tt(t),st=R.getNorthWest().distanceTo(R.getSouthWest())*R.getNorthEast().distanceTo(R.getNorthWest());st<1700&&(D=Zi(t));var nt=t.length,pt=[];for(i=0;i<nt;i++){var ut=H(t[i]);pt.push(e.project(H([ut.lat-D.lat,ut.lng-D.lng])))}for(p=_=b=0,i=0,n=nt-1;i<nt;n=i++)r=pt[i],h=pt[n],d=r.y*h.x-h.y*r.x,_+=(r.x+h.x)*d,b+=(r.y+h.y)*d,p+=d*3;p===0?I=pt[0]:I=[_/p,b/p];var Yt=e.unproject(z(I));return H([Yt.lat+D.lat,Yt.lng+D.lng])}function Zi(t){for(var e=0,i=0,n=0,r=0;r<t.length;r++){var h=H(t[r]);e+=h.lat,i+=h.lng,n++}return H([e/n,i/n])}var Cr={__proto__:null,clipPolygon:En,polygonCenter:An,centroid:Zi};function Zn(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Wr(t,i),t=Ir(t,i),t}function zn(t,e,i){return Math.sqrt(le(t,e,i,!0))}function Mr(t,e,i){return le(t,e,i)}function Ir(t,e){var i=t.length,n=typeof Uint8Array!=void 0+""?Uint8Array:Array,r=new n(i);r[0]=r[i-1]=1,zi(t,r,e,0,i-1);var h,d=[];for(h=0;h<i;h++)r[h]&&d.push(t[h]);return d}function zi(t,e,i,n,r){var h=0,d,p,_;for(p=n+1;p<=r-1;p++)_=le(t[p],t[n],t[r],!0),_>h&&(d=p,h=_);h>i&&(e[d]=1,zi(t,e,i,n,d),zi(t,e,i,d,r))}function Wr(t,e){for(var i=[t[0]],n=1,r=0,h=t.length;n<h;n++)kr(t[n],t[r])>e&&(i.push(t[n]),r=n);return r<h-1&&i.push(t[h-1]),i}var On;function Bn(t,e,i,n,r){var h=n?On:Rt(t,i),d=Rt(e,i),p,_,b;for(On=d;;){if(!(h|d))return[t,e];if(h&d)return!1;p=h||d,_=Ee(t,e,p,i,r),b=Rt(_,i),p===h?(t=_,h=b):(e=_,d=b)}}function Ee(t,e,i,n,r){var h=e.x-t.x,d=e.y-t.y,p=n.min,_=n.max,b,I;return i&8?(b=t.x+h*(_.y-t.y)/d,I=_.y):i&4?(b=t.x+h*(p.y-t.y)/d,I=p.y):i&2?(b=_.x,I=t.y+d*(_.x-t.x)/h):i&1&&(b=p.x,I=t.y+d*(p.x-t.x)/h),new A(b,I,r)}function Rt(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 kr(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function le(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 A(r,h)}function mt(t){return!W(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Rn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),mt(t)}function Nn(t,e){var i,n,r,h,d,p,_,b;if(!t||t.length===0)throw new Error("latlngs not passed");mt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var I=H([0,0]),D=tt(t),R=D.getNorthWest().distanceTo(D.getSouthWest())*D.getNorthEast().distanceTo(D.getNorthWest());R<1700&&(I=Zi(t));var st=t.length,nt=[];for(i=0;i<st;i++){var pt=H(t[i]);nt.push(e.project(H([pt.lat-I.lat,pt.lng-I.lng])))}for(i=0,n=0;i<st-1;i++)n+=nt[i].distanceTo(nt[i+1])/2;if(n===0)b=nt[0];else for(i=0,h=0;i<st-1;i++)if(d=nt[i],p=nt[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}var ut=e.unproject(z(b));return H([ut.lat+I.lat,ut.lng+I.lng])}var Dr={__proto__:null,simplify:Zn,pointToSegmentDistance:zn,closestPointOnSegment:Mr,clipSegment:Bn,_getEdgeIntersection:Ee,_getBitCode:Rt,_sqClosestPointOnSegment:le,isFlat:mt,_flat:Rn,polylineCenter:Nn},Oi={project:function(t){return new A(t.lng,t.lat)},unproject:function(t){return new j(t.y,t.x)},bounds:new K([-180,-90],[180,90])},Bi={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 A(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 j(d*e,t.x*e/i)}},Er={__proto__:null,LonLat:Oi,Mercator:Bi,SphericalMercator:ui},Ar=s({},Dt,{code:"EPSG:3395",projection:Bi,transformation:function(){var t=.5/(Math.PI*Bi.R);return Qt(t,.5,-t,.5)}()}),Fn=s({},Dt,{code:"EPSG:4326",projection:Oi,transformation:Qt(1/180,1,-1/180,.5)}),Zr=s({},Tt,{projection:Oi,transformation:Qt(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});Tt.Earth=Dt,Tt.EPSG3395=Ar,Tt.EPSG3857=di,Tt.EPSG900913=Fo,Tt.EPSG4326=Fn,Tt.Simple=Zr;var gt=kt.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})}}});U.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?W(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 qt=gt.extend({initialize:function(t,e){x(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)}}),zr=function(t,e){return new qt(t,e)},St=qt.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),qt.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),qt.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 ht;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 St(t,e)},$t=vt.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){x(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=z(n),h=z(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 k.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Br(t){return new $t(t)}var he=$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 he.imagePath!="string"&&(he.imagePath=this._detectIconPath()),(this.options.imagePath||he.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=V("div","leaflet-default-icon-path",document.body),e=ie(t,"background-image")||ie(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):""}}),Hn=bt.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Et(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=zt(e._icon),d=i.getPixelBounds(),p=i.getPixelOrigin(),_=lt(d.min._subtract(p).add(r),d.max._subtract(p).subtract(r));if(!_.contains(h)){var b=z((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),et(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&&(X(this._panRequest),this._panRequest=$(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=zt(e._icon),r=e._map.layerPointToLatLng(n);i&&et(i,n),e._latlng=r,t.latlng=r,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){X(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ae=gt.extend({options:{icon:new he,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){x(this,e),this._latlng=H(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=H(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&&et(this._icon,t),this._shadow&&et(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),Hn)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Hn(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&&ft(this._icon,t),this._shadow&&ft(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?z(e.iconSize):z(0,0),n=e.iconAnchor?z(e.iconAnchor):z(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 Rr(t,e){return new Ae(t,e)}var At=gt.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 x(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)}}),Ze=At.extend({options:{fill:!0,radius:10},initialize:function(t,e){x(this,e),this._latlng=H(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=H(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 At.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 Nr(t,e){return new Ze(t,e)}var Ri=Ze.extend({initialize:function(t,e,i){if(typeof e=="number"&&(e=s({},i,{radius:e})),x(this,e),this._latlng=H(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 ht(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:At.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===Dt.distance){var r=Math.PI/180,h=this._mRadius/Dt.R/r,d=i.project([e+h,t]),p=i.project([e-h,t]),_=d.add(p).divideBy(2),b=i.unproject(_).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=_.subtract(i.getPixelOrigin()),this._radius=isNaN(I)?0:_.x-i.project([b,t-I]).x,this._radiusY=_.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 Fr(t,e,i){return new Ri(t,e,i)}var Pt=At.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){x(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=le,r,h,d=0,p=this._parts.length;d<p;d++)for(var _=this._parts[d],b=1,I=_.length;b<I;b++){r=_[b-1],h=_[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 Nn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=H(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new ht,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return mt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=mt(t),n=0,r=t.length;n<r;n++)i?(e[n]=H(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 A(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 j,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=Bn(_[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]=Zn(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)&&zn(t,p[r],p[n])<=_)return!0;return!1}});function Hr(t,e){return new Pt(t,e)}Pt._flat=Rn;var Gt=Pt.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 An(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=Pt.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof j&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Pt.prototype._setLatLngs.call(this,t),mt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return mt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new A(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=En(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||Pt.prototype._containsPoint.call(this,t,!0)}});function Ur(t,e){return new Gt(t,e)}var Ct=St.extend({initialize:function(t,e){x(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=W(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=Re(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||Ni,p,_,b,I;if(!n&&!i)return null;switch(i.type){case"Point":return p=d(n),Un(h,t,p,e);case"MultiPoint":for(b=0,I=n.length;b<I;b++)p=d(n[b]),r.push(Un(h,t,p,e));return new St(r);case"LineString":case"MultiLineString":return _=Oe(n,i.type==="LineString"?0:1,d),new Pt(_,e);case"Polygon":case"MultiPolygon":return _=Oe(n,i.type==="Polygon"?1:2,d),new Gt(_,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 St(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 St(r);default:throw new Error("Invalid GeoJSON object.")}}function Un(t,e,i,n){return t?t(e,i):new Ae(i,n&&n.markersInheritOptions&&n)}function Ni(t){return new j(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||Ni)(t[r]),n.push(d);return n}function Fi(t,e){return t=H(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 Be(t,e,i,n){for(var r=[],h=0,d=t.length;h<d;h++)r.push(e?Be(t[h],mt(t[h])?0:e-1,i,n):Fi(t[h],n));return!e&&i&&r.length>0&&r.push(r[0].slice()),r}function Xt(t,e){return t.feature?s({},t.feature,{geometry:e}):Re(e)}function Re(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Hi={toGeoJSON:function(t){return Xt(this,{type:"Point",coordinates:Fi(this.getLatLng(),t)})}};Ae.include(Hi),Ri.include(Hi),Ze.include(Hi),Pt.include({toGeoJSON:function(t){var e=!mt(this._latlngs),i=Be(this._latlngs,e?1:0,!1,t);return Xt(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),Gt.include({toGeoJSON:function(t){var e=!mt(this._latlngs),i=e&&!mt(this._latlngs[0]),n=Be(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),Xt(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),qt.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),Xt(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=Re(h);d.type==="FeatureCollection"?n.push.apply(n,d.features):n.push(d)}}}),i?Xt(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});function Vn(t,e){return new Ct(t,e)}var Vr=Vn,Ne=gt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=tt(e),x(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&&Ut(this._image),this},bringToBack:function(){return this._map&&Vt(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=tt(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:V("img");if(B(e,"leaflet-image-layer"),this._zoomAnimated&&B(e,"leaflet-zoom-animated"),this.options.className&&B(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;Zt(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();et(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){ft(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()}}),qr=function(t,e,i){return new Ne(t,e,i)},qn=Ne.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:V("video");if(B(e,"leaflet-image-layer"),this._zoomAnimated&&B(e,"leaflet-zoom-animated"),this.options.className&&B(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}W(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=V("source");d.src=this._url[h],e.appendChild(d)}}});function $r(t,e,i){return new qn(t,e,i)}var $n=Ne.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=v,t.onmousemove=v}});function Gr(t,e,i){return new $n(t,e,i)}var wt=gt.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof j||W(t))?(this._latlng=H(t),x(this,e)):(x(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&&ft(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&ft(this._container,1),this.bringToFront(),this.options.interactive&&(B(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(ft(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=H(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&&Ut(this._container),this},bringToBack:function(){return this._map&&Vt(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof St){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=z(this.options.offset),i=this._getAnchor();this._zoomAnimated?et(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]}});U.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}}),gt.include({_initOverlay:function(t,e,i,n){var r=i;return r instanceof t?(x(r,n),r._source=this):(r=e&&!n?e:new t(n,this),r.setContent(i)),r}});var Fe=wt.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,wt.prototype.openOn.call(this,t)},onAdd:function(t){wt.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof At||this._source.on("preclick",Ot))},onRemove:function(t){wt.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof At||this._source.off("preclick",Ot))},getEvents:function(){var t=wt.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=V("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=V("div",t+"-content-wrapper",e);if(this._contentNode=V("div",t+"-content",i),se(e),ki(this._contentNode),O(e,"contextmenu",Ot),this._tipContainer=V("div",t+"-tip-container",e),this._tip=V("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=V("a",t+"-close-button",e);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">&#215;</span>',O(n,"click",function(r){ot(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();et(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(ie(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,r=new A(this._containerLeft,-i-this._containerBottom);r._add(zt(this._container));var h=t.layerPointToContainerPoint(r),d=z(this.options.autoPanPadding),p=z(this.options.autoPanPaddingTopLeft||d),_=z(this.options.autoPanPaddingBottomRight||d),b=t.getSize(),I=0,D=0;h.x+n+_.x>b.x&&(I=h.x+n-b.x+_.x),h.x-I-p.x<0&&(I=h.x-p.x),h.y+i+_.y>b.y&&(D=h.y+i-b.y+_.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 z(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Xr=function(t,e){return new Fe(t,e)};U.mergeOptions({closePopupOnClick:!0}),U.include({openPopup:function(t,e,i){return this._initOverlay(Fe,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),gt.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Fe,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 St||(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)){Bt(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof At)){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 He=wt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){wt.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){wt.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=wt.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=V("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,I=z(this.options.offset),D=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=_+(I.x+D.x)*2,i=b/2),t=t.subtract(z(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),et(r,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&ft(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return z(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),jr=function(t,e){return new He(t,e)};U.include({openTooltip:function(t,e,i){return this._initOverlay(He,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),gt.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(He,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 St||(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=typeof t.getElement=="function"&&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=typeof t.getElement=="function"&&t.getElement();e&&e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var e=this;this._map.once("moveend",function(){e._openOnceFlag=!1,e._openTooltip(t)});return}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 Gn=$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=z(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Yr(t){return new Gn(t)}$t.Default=he;var ue=gt.extend({options:{tileSize:256,opacity:1,updateWhenIdle:k.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){x(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&&(Ut(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Vt(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 A?t:new A(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&&!k.ielt9){ft(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);ft(r.el,h),h<1?e=!0:(r.active?i=!0:this._onOpaqueTile(r),r.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(X(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this))}},_onOpaqueTile:v,_initContainer:function(){this._container||(this._container=V("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=V("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 A(+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 A(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();k.any3d?Zt(t.el,r,n):et(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 I=this._tiles[b].coords;(I.z!==this._tileZoom||!_.contains(new A(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 st=new A(R,D);if(st.z=this._tileZoom,!!this._isValidTile(st)){var nt=this._tiles[this._tileCoordsToKey(st)];nt?nt.current=!0:d.push(st)}}if(d.sort(function(ut,Yt){return ut.distanceTo(h)-Yt.distanceTo(h)}),d.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var pt=document.createDocumentFragment();for(R=0;R<d.length;R++)this._addTile(d[R],pt);this._level.el.appendChild(pt)}}}},_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 tt(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 ht(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 A(+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=v,t.onmousemove=v,k.ielt9&&this.options.opacity<1&&ft(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)),et(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?(ft(i.el,0),X(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"),k.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 A(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 Kr(t){return new ue(t)}var jt=ue.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=x(this,e),e.detectRetina&&k.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:k.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 S(this._url,s(e,this.options))},_tileOnLoad:function(t,e){k.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=E;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",E),ue.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===E))return ue.prototype._tileReady.call(this,t,e,i)}});function Xn(t,e){return new jt(t,e)}var jn=jt.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=x(this,e);var r=e.detectRetina&&k.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,jt.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=lt(i.project(e[0]),i.project(e[1])),r=n.min,h=n.max,d=(this._wmsVersion>=1.3&&this._crs===Fn?[r.y,r.x,h.y,h.x]:[r.x,r.y,h.x,h.y]).join(","),p=jt.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 Jr(t,e){return new jn(t,e)}jt.WMS=jn,Xn.wms=Jr;var Mt=gt.extend({options:{padding:.1},initialize:function(t){x(this,t),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),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));k.any3d?Zt(this._container,h,i):et(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()}}),Yn=Mt.extend({options:{tolerance:0},getEvents:function(){var t=Mt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Mt.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(){X(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)){Mt.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=k.retina?2:1;et(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",k.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Mt.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,_=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&&(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 Kn(t){return k.canvas?new Yn(t):null}var ce=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">')}}(),Qr={_initContainer:function(){this._container=V("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Mt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=ce("shape");B(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=ce("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=ce("stroke")),r.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=W(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=ce("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){Ut(t._container)},_bringToBack:function(t){Vt(t._container)}},Ue=k.vml?ce:tn,de=Mt.extend({_initContainer:function(){this._container=Ue("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ue("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)){Mt.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)),et(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=Ue("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,en(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){Ut(t._path)},_bringToBack:function(t){Vt(t._path)}});k.vml&&de.include(Qr);function Jn(t){return k.svg||k.vml?new de(t):null}U.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&&Kn(t)||Jn(t)}});var Qn=Gt.extend({initialize:function(t,e){Gt.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=tt(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function ts(t,e){return new Qn(t,e)}de.create=Ue,de.pointsToPath=en,Ct.geometryToLayer=ze,Ct.coordsToLatLng=Ni,Ct.coordsToLatLngs=Oe,Ct.latLngToCoords=Fi,Ct.latLngsToCoords=Be,Ct.getFeature=Xt,Ct.asFeature=Re,U.mergeOptions({boxZoom:!0});var to=bt.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(),ne(),Li(),this._startPoint=this._map.mouseEventToContainerPoint(t),O(document,{contextmenu:Bt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=V("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();et(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")),oe(),Ti(),Y(document,{contextmenu:Bt,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 ht(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())}});U.addInitHook("addHandler","boxZoom",to),U.mergeOptions({doubleClickZoom:!0});var eo=bt.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)}});U.addInitHook("addHandler","doubleClickZoom",eo),U.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var io=bt.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Et(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=tt(this._map.options.maxBounds);this._offsetLimit=lt(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,_),I=p.multiplyBy(b/_),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})}))}}});U.addInitHook("addHandler","dragging",io),U.mergeOptions({keyboard:!0,keyboardPanDelta:80});var no=bt.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=z(n).multiplyBy(3)),i.options.maxBounds&&(n=i._limitOffset(z(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;Bt(t)}}});U.addInitHook("addHandler","keyboard",no),U.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var oo=bt.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),Bt(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))}});U.addInitHook("addHandler","scrollWheelZoom",oo);var es=600;U.mergeOptions({tapHold:k.touchNative&&k.safari&&k.mobile,tapTolerance:15});var ro=bt.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 A(e.clientX,e.clientY),this._holdTimeout=setTimeout(u(function(){this._cancel(),this._isTapValid()&&(O(document,"touchend",ot),O(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),es),O(document,"touchend touchcancel contextmenu",this._cancel,this),O(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){Y(document,"touchend",ot),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 A(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)}});U.addInitHook("addHandler","tapHold",ro),U.mergeOptions({touchZoom:k.touch,bounceAtZoomLimits:!0});var so=bt.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),ot(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),X(this._animRequest);var d=u(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=$(d,this,!0),ot(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,X(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))}});U.addInitHook("addHandler","touchZoom",so),U.BoxZoom=to,U.DoubleClickZoom=eo,U.Drag=io,U.Keyboard=no,U.ScrollWheelZoom=oo,U.TapHold=ro,U.TouchZoom=so,a.Bounds=K,a.Browser=k,a.CRS=Tt,a.Canvas=Yn,a.Circle=Ri,a.CircleMarker=Ze,a.Class=vt,a.Control=_t,a.DivIcon=Gn,a.DivOverlay=wt,a.DomEvent=yr,a.DomUtil=gr,a.Draggable=Et,a.Evented=kt,a.FeatureGroup=St,a.GeoJSON=Ct,a.GridLayer=ue,a.Handler=bt,a.Icon=$t,a.ImageOverlay=Ne,a.LatLng=j,a.LatLngBounds=ht,a.Layer=gt,a.LayerGroup=qt,a.LineUtil=Dr,a.Map=U,a.Marker=Ae,a.Mixin=Pr,a.Path=At,a.Point=A,a.PolyUtil=Cr,a.Polygon=Gt,a.Polyline=Pt,a.Popup=Fe,a.PosAnimation=In,a.Projection=Er,a.Rectangle=Qn,a.Renderer=Mt,a.SVG=de,a.SVGOverlay=$n,a.TileLayer=jt,a.Tooltip=He,a.Transformation=ci,a.Util=Te,a.VideoOverlay=qn,a.bind=u,a.bounds=lt,a.canvas=Kn,a.circle=Fr,a.circleMarker=Nr,a.control=ae,a.divIcon=Yr,a.extend=s,a.featureGroup=Or,a.geoJSON=Vn,a.geoJson=Vr,a.gridLayer=Kr,a.icon=Br,a.imageOverlay=qr,a.latLng=H,a.latLngBounds=tt,a.layerGroup=zr,a.map=xr,a.marker=Rr,a.point=z,a.polygon=Ur,a.polyline=Hr,a.popup=Xr,a.rectangle=ts,a.setOptions=x,a.stamp=f,a.svg=Jn,a.svgOverlay=Gr,a.tileLayer=Xn,a.tooltip=jr,a.transformation=Qt,a.version=o,a.videoOverlay=$r;var is=window.L;a.noConflict=function(){return window.L=is,this},window.L=a})});var fo={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 mo={none:["#00000000","#00000000"],diverging_blue_red:["#2166acff","#92c5deff","#f7f7f7ff","#f4a582ff","#b2182bff"],rainbow:["#ff0000ff","#ffff00ff","#00ff00ff","#00ffffff","#0000ffff","#ff00ffff"],rainbow_zero:["#ff000000","#ff0000ff","#ffff00ff","#00ff00ff","#00ffffff","#0000ffff","#ff00ffff"],rainbow_wrap:["#ff0000ff","#ffff00ff","#00ff00ff","#00ffffff","#0000ffff","#ff00ffff","#ff0000ff"],rainbow_backwards:["#0000ffff","#00ffffff","#00ff00ff","#ffff00ff","#ff0000ff","#ff00ffff"],rainbow_backwards_zero:["#0000ff00","#0000ffff","#00ffffff","#00ff00ff","#ffff00ff","#ff0000ff","#ff00ffff"],bluebird:["#0000ffff","#ff00ffff","#00ffffff","#9000ffff","#9090ffff"],bluebird_zero:["#0000ff00","#0000ffff","#ff00ffff","#00ffffff","#9000ffff","#9090ffff"],black_white:["#000000ff","#ffffffff"],white_black:["#ffffffff","#000000ff"],reddish:["#ff00ffff","#ff0000ff","#ffff00ff"],greenish:["#ffff00ff","#00ff00ff","#00ffffff"],blueish:["#ff00ffff","#0000ffff","#00ffffff"],hspastel:["#AC6EA4FF","#8E92BDFF","#ACD4DEFF","#E9DC8EFF","#E7A97DFF","#E59074FF","#BE7E68FF","#A88F86FF"],black:["#000000ff","#000000ff"],white:["#ffffffff","#ffffffff"],transparent:["#ffffff00"],peach_red_zero:["#fdd49f00","#fdd49fff","#d7301fff"]};var qe={base:{parent:void 0,name:"base",fill:"gradient",isolineColor:"none",isolineText:!0,isolineTextSizeEm:1.1,isolineTextBackground:!1,vectorType:"arrows",vectorColor:"inverted",vectorFactor:1,streamLineColor:"none",streamLineSpeedFactor:1,streamLineStatic:!1,showBelowMin:!0,showAboveMax:!0,colorScheme:"diverging_blue_red",colors:void 0,colorMap:void 0,levels:void 0,blurRadius:0,addDegrees:0,units:"",extraUnits:void 0,mask:"none",gl:{animationIntensity:5,animationSpeed:1,noiseTexturePow:5,vectorFieldFactor:1,wavesCount:4}},custom:{parent:void 0,name:"custom",fill:"gradient",isolineColor:"inverted",isolineText:!0,isolineTextSizeEm:1.1,isolineTextBackground:!1,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 po,_o,go;function vo({colorStyles:a={},units:o={},colorSchemes:s={}}={}){P("WxTile lib setup: start"),po=Object.assign({},fo,o),_o=Object.assign({},s,mo);let l=Object.assign({},a,qe);go=vs(l),P("WxTile lib setup: styles unrolled"),(async()=>{try{await document.fonts.load("32px barbs"),await document.fonts.load("32px arrows")}catch{P("WxTile lib setup: fonts not loaded")}})(),P("WxTile lib setup is done.")}function It(){return go}function fe(){return _o}function Ge(a,o,s){P("makeConverter: From=",a," To=",o);let l=C=>C;if(l.trivial=!0,a===o)return P("Trivial converter"),l;let u=Object.assign({},po,s),c=u[a],f=u[o];if(!c||!f)return P("Inconvertible units. Trivial converter"),l;let[m,g,v]=c,[y,w,T]=f;if(m!==y||!g||!w)return P("Inconvertible units. Trivial converter"),l;let x=g/w,M=((v||0)-(T||0))/w;return M?C=>x*C+M:C=>x*C}function vs(a){let o=Object.assign({},qe);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({},qe.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 Xe(a){let o=new Map,s=(l,...u)=>{let c=o.get(l);if(c)return c;let f=a(l,...u);return o.set(l,f),f.catch(m=>m.name==="AbortError"&&o.delete(l)),f};return s.clearCache=()=>o.clear(),s}async function ys(a,o){let s=await fetch(a,o);if(s.status!==200&&s.status!==304)throw{name:"Tile loading failed",reason:s.headers.get("x-reason"),status:s.status};return await createImageBitmap(await s.blob(),{premultiplyAlpha:"none"})}var $e=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_=ws(this.raw))}};function Kt(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 xs(a){let{width:o,height:s}=a,l=Kt(o,s);return l.drawImage(a,0,0),l.getImageData(0,0,o,s)}async function Vi(a,o){return xs(await ys(a,o))}function bs(a){a.data[34]<1&&P("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 $e(s,c,f,m)}async function yo(a,o){return bs(await Vi(a,o))}function ws(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 Ls(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 xo(a,o){if(o<0&&(o=0),o===a.radius)return a;if(a.radius=o,!o)return Ls(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),g=Math.min(o,u-1,256-u),v=258*(u-g-1)+c,y=258*(u+g)+c,w;if(l){let W=l[v-m-1],Z=l[v+m],E=l[y-m-1],N=l[y+m];w=W+N-Z-E}else w=(2*m+1)*(2*g+1);let T=s[v-m-1],x=s[v+m],M=s[y-m-1],C=s[y+m],S=T+C-x-M;a.raw[f]=S/w}for(let u=2;u<256;u++){let c=258+u;if(a.raw[c]){let v=u,y=Math.min(o,v-1,256-v),w=258+v,T;if(l){let q=l[w-y-1];T=0+l[w+y]-0-q}else T=(2*y+1)*2;let x=0,M=0,C=s[w-y-1],S=s[w+y],Z=(x+S-M-C)/T;a.raw[c-258]=Z,a.raw[c]=Z}let f=258*256+u;if(a.raw[f]){let v=u,y=Math.min(o,v-1,256-v),w=258*255+v,T=258*257+v,x=s[w-y-1],M=s[w+y],C=s[T-y-1],S=s[T+y],W=x+S-M-C,Z;if(l){let N=l[w-y-1],q=l[w+y],F=l[T-y-1],G=l[T+y];Z=N+G-q-F}else Z=(2*y+1)*2;let E=W/Z;a.raw[f]=E,a.raw[f+258]=E}let m=258*u+1;if(a.raw[m]){let v=u,y=Math.min(o,v-1,256-v),w=258*(v-y-1)+1,T=258*(v+y)+1,x;if(l){let q=l[w],F=0;x=0+l[T]-q-F}else x=(2*y+1)*2;let M=0,C=s[w],S=0,W=s[T],E=(M+W-C-S)/x;a.raw[m-1]=E,a.raw[m]=E}let g=258*u+256;if(a.raw[g]){let v=u,y=Math.min(o,v-1,256-v),w=258*(v-y-1)+256,T=258*(v+y)+256,x;if(l){let N=l[w-1],q=l[w+1],F=l[T-1],G=l[T+1];x=N+G-q-F}else x=2*(2*y+1);let M=s[w-1],C=s[w+1],S=s[T-1],W=s[T+1],E=(M+W-C-S)/x;a.raw[g]=E,a.raw[g+1]=E}}return a}function ct(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 Wt(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 P("wrong color format",a),0}async function Nt(a,o){let s=await fetch(a,o);if(!s.ok)throw new Error("error:"+a+" - "+s.statusText);return s.json()}function qi(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,w=l+s*(m-l),T=u+s*(g-u),x=c+s*(v-c),M=f+s*(y-f);return w|T<<8|x<<16|M<<24}function bo(a,o,s){let l=[];for(let u=0;u<s;++u)l.push(u*(o-a)/(s-1)+a);return l}var P=(...a)=>{};function $i(a){return a[0]==="#"&&a.length===4?"#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:a}function je(a,{x:o,y:s,z:l}){return a.replace("{x}",`${o}`).replace("{y}",`${s}`).replace("{z}",`${l}`)}function Ye({x:a,y:o,z:s}){return`${s}-${a}-${o}`}var Ts="A".charCodeAt(0);var me=class{constructor(o,s){this._qtree={nodes:null};this._qtreedepth=0;P("QTree.constructor"),this._ready=this._load(o,s)}get ready(){return this._ready}async _load(o,s){if(o!="none"){try{let l=await Nt(o,s);this._qtree=wo(l,{pos:0})}catch(l){throw new Error(`Failed to load QTree: ${l.message}`)}this._qtreedepth=Lo(this._qtree),P(`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 To(this._qtree,u,l)}};function wo(a,o){let s=a.charCodeAt(o.pos)-Ts;o.pos++;let l=[1,2,4,8].map(u=>s&u?wo(a,o):null);return{nodes:l.some(u=>u)?l:null}}function Lo(a){return a?.nodes?1+Math.max(...a.nodes.map(Lo)):0}function To(a,o,s){return a===null?"land":s&&!o.z?"mixed":a.nodes===null?"sea":o.z?(o.z--,To(a.nodes[(o.y>>o.z&1)<<1|o.x>>o.z&1],o,s)):"mixed"}var Ss=2*Math.PI*6378137/256,Ke=2*Math.PI*6378137/2;function Ps(a,o){let s=a/Ke*180,l=o/Ke*180;return l=180/Math.PI*(2*Math.atan(Math.exp(l*Math.PI/180))-Math.PI/2),[l,s]}function Cs(a,o,s){let l=Ms(s),u=a*l-Ke,c=o*l-Ke;return[u,c]}function Ms(a){return Ss/2**a}function Gi(a,o,s){let[l,u]=Ps(...Cs(a,o,s));return[u,-l]}function So(a,o){return[a*256,o*256]}function Xi(a,o,s){let l=((o-a)%360+540)%360-180;return(a+l*s+360)%360}function Is(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=Xi(a,o,u),y=Xi(s,l,u),w=(Xi(v,y,c)-f)/m;return w<1?1:w}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 Co(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:g,dmul:v}=o,y={raw:new Uint16Array(258*258),dmin:m,dmax:g,dmul:v},{raw:w}=y;for(let T=-1,x=0,M=c-l+1;T<=256;T++,M+=l){let C=Math.floor(M),S=M-C,W=C*258;for(let Z=-1,E=u-l+1;Z<=256;Z++,x++,E+=l){let N=Math.floor(E),q=E-N,F=N+W,G=f[F],at=f[F+1],$=f[F+258],X=f[F+258+1];w[x]=a(G,at,$,X,q,S,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/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,w=s,T=f;y<256;y++,T+=u){let x=~~l(T),M=T-x,C=x*256;for(let S=0,W=c;S<256;S++,w+=4,W+=u){let Z=~~l(W),E=W-Z,N=(Z+C)*4+s,q=m[N],F=m[N+4],G=m[N+4*256],at=m[N+4*256+4],$=Po(q,F,G,at,E,M,0,0);v[w]=$>127?255:0}}return g}function Io(a,o){return o?Co(Po,a,o):a}function Wo(a,o){return o?Co(Is,a,o):a}function ko(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 Do(a){let[o,s]=So(a.x,a.y),[l,u]=Gi(o,s,a.z),[c,f]=Gi(o+256,s+256,a.z);return{west:l,north:u,east:c,south:f}}function ji(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=Xe(yo);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,g=m==="degree"?Wo:Io,v=w=>g(xo(w,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}=ji(o,this._layer.getCoarseMaxZoom()),m=s.map(y=>je(y,c)),g=Object.assign({},this._layer.wxdatasetManager.wxAPI.requestInit,{signal:l?.signal});return{rawdata:await Promise.all(m.map(y=>this._loadDataFunc(y,g))),subCoords:f,tileType:u}}clearCache(){this._loadDataFunc.clearCache()}async _applyMask(o,s,l,u){let{style:c}=this._layer;if((c.mask==="land"||c.mask==="sea")&&l==="mixed"){if(u){let{raw:g,dmin:v,dmax:y,dmul:w}=o[0];o[0]={raw:new Uint16Array(g),dmin:v,dmax:y,dmul:w}}let f,{wxAPI:m}=this._layer.wxdatasetManager;try{let{upCoords:g,subCoords:v}=ji(s,m.maskDepth);f=await m.loadMaskFunc(g),f=Mo(f,v,m.maskChannel)}catch{c.mask=void 0,P("Can't load Mask. Masking is disabled");return}ko(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=Do(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 w=0;w<=256;w+=v)for(let T=0;T<=256;T+=v){if(!u.raw[1+T+(1+w)*258])continue;let x=[],M=T,C=w,S=-1,W=0,Z=0;for(let q=0;q<=y&&M>=0&&M<=256&&C>=0&&C<=256;q++){q%(y/10)||x.push({x:~~M,y:~~C});let F=~~M+1+(~~C+1)*258;if(F!==S){if(!u.raw[F])break;S=F;let G=u.dmin+u.raw[F]*u.dmul,at=c.dmin+c.raw[F]*c.dmul,$=f.dmin+f.raw[F]*f.dmul,X=Math.atan2(at,$)+g;W=m*G*Math.sin(X),Z=m*G*Math.cos(X)}M+=W,C-=Z}let E=T,N=w;S=-1;for(let q=1;q<=y&&E>=0&&E<=256&&N>=0&&N<=256;q++){q%(y/10)||x.unshift({x:~~E,y:~~N});let F=~~E+1+(~~N+1)*258;if(F!==S){if(!u.raw[F])break;S=F;let G=u.dmin+u.raw[F]*u.dmul,at=c.dmin+c.raw[F]*c.dmul,$=f.dmin+f.raw[F]*f.dmul,X=Math.atan2(at,$)+g;W=m*G*Math.sin(X),Z=m*G*Math.cos(X)}E-=W,N+=Z}x.length>2&&l.push(x)}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),Ws(o.data[0],g,c);let v=ks(g,o.data[0],c);s.putImageData(m,0,0),Ds(v,l,c),Zs(o.data,l,c),zs(o.data[0],l,f,c),Os(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")&&Bs(o,l,c,u)}};function Ws(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 ks(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]==="#"?Wt(l.isolineColor):0;for(let v=0,y=0;v<256;v+=1)for(let w=0;w<256;w+=1){let T=(v+1)*258+(w+1),x=u[T],M=u[T+1],C=u[T+258];if(!x||!M||!C)continue;let S=c[x],W=c[M],Z=c[C];if(S!==W||S!==Z){let E=Math.max(S,W,Z),N=Math.max(x,M,C),q=v*256+w;switch(l.isolineColor){case"inverted":a[q]=~f[N]|4278190080;break;case"fill":a[q]=f[N]|4278190080;break;default:a[q]=g;break}l.isolineText&&!(++y%255)&&w>20&&w<235&&v>20&&v<235&&m.push({x:w,y:v,d:x,dr:M,db:C,mli:E})}}}return m}function Ds(a,o,{CLUT:s,style:l}){if(a.length){let u=l.isolineTextSizeEm||1.1;o.font=u.toString()+"em Sans-serif",o.lineWidth=2,o.strokeStyle="white",o.fillStyle="black",o.textAlign="center",o.textBaseline="middle";let c=o.measureText("-.0123456789"),f=c.actualBoundingBoxAscent+c.actualBoundingBoxDescent,g=1.5*f,v=c.actualBoundingBoxAscent+(g-f)/2,y=1.1,w=u*2.5,T=l.isolineTextBackground?Es:As;for(let{x,y:M,d:C,dr:S,db:W,mli:Z}of a){let E=Math.atan2(C-S,W-C);o.save(),o.translate(x,M),o.rotate(E<-1.57||E>1.57?E+3.14:E);let N=s.ticks[Z].dataString;T(N,o,{height:g,hOffset:v,wScale:y,radii:w}),o.fillText(N,0,0),o.restore()}}}function Es(a,o,s){o.strokeText(a,0,0)}function As(a,o,{height:s,hOffset:l,wScale:u,radii:c}){let f=o.fillStyle;o.fillStyle=o.strokeStyle;let m=u*o.measureText(a).width;o.beginPath(),o.roundRect(-m/2,-l,m,s,c),o.closePath(),o.fill(),o.fillStyle=f}function Zs(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 w=y+1+(v+1)*258;if(!u.raw[w])continue;let T=Math.atan2(c.dmin+c.raw[w]*c.dmul,f.dmin+f.raw[w]*f.dmul),x=u.dmin+u.raw[w]*u.dmul,M=l.vectorType!=="barbs"?l.vectorFactor*.5:.2,C=Math.min(~~(s.DataToKnots(x)*M),25)+65,S=String.fromCharCode(C);switch(l.vectorColor){case"inverted":o.fillStyle=ct(~s.colorsI[u.raw[w]]);break;case"fill":o.fillStyle=ct(s.colorsI[u.raw[w]]);break}o.save(),o.translate(y,v),o.rotate(T+m),o.fillText(S,0,0),o.restore()}}function zs(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 T=(a.dmin+a.raw[y]*a.dmul+180)*.01745329251;switch(u.vectorColor){case"inverted":o.fillStyle=ct(~l.colorsI[a.raw[y]]);break;case"fill":o.fillStyle=ct(l.colorsI[a.raw[y]]);break}o.save(),o.translate(v,g),o.rotate(T+c),o.fillText(f,0,0),o.restore()}}function Os(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=$i(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],w=g[v+1],T=y.x+1+(y.y+1)*258;switch(l.streamLineColor){case"inverted":o.strokeStyle=ct(~s.colorsI[f.raw[T]]);break;case"fill":o.strokeStyle=ct(s.colorsI[f.raw[T]]);break}o.beginPath(),o.moveTo(y.x,y.y),o.lineTo(w.x,w.y),o.stroke()}}}function Bs(a,o,{CLUT:s,style:l},u){let{data:c,slines:f}=a,m=c[0],g=l.streamLineColor[0]==="#"?$i(l.streamLineColor).substring(0,7):"#000000";u=u>>5;for(let v=0;v<f.length;++v){let y=f[v],w=y.length-1,T=(u+(1+y[0].x)*(1+y[0].y))%30;for(let x=0;x<w;++x){let M=y[x],C=y[x+1],S=1-(T-x)/w;(S<0||S>1)&&(S=0);let W=(~~(S*255)).toString(16).padStart(2,"0"),Z=1+~~((1.2-S)*5);o.lineWidth=Z;let E=M.x+1+(M.y+1)*258;switch(l.streamLineColor){case"inverted":g=ct(~s.colorsI[m.raw[E]]);break;case"fill":g=ct(s.colorsI[m.raw[E]]);break}o.strokeStyle=g+W,o.beginPath(),o.moveTo(M.x,M.y),o.lineTo(C.x,C.y),o.stroke()}}}function Rs(a,o,s){return a>s?s:a<o?o:a}var Je=class{constructor(o,s,[l,u],c){P("RawCLUT.constructor"),this.levelIndex=new Uint32Array(65536),this.colorsI=new Uint32Array(65536);let f;this.DataToStyle=Ge(s,o.units,o.extraUnits),this.DataToStyle.trivial&&(o.units=s),c&&(this.DataToKnots=Ge(s,"knot"));let m=Ge(o.units,s,o.extraUnits),g=S=>~~(65535*Rs((m(S)-l)/(u-l),0,1));if(o.colorMap?.length)f=o.colorMap.sort((S,W)=>S[0]-W[0]).map(([S])=>g(S));else{o.levels||(o.levels=bo(this.DataToStyle(l),this.DataToStyle(u),10)),o.levels.sort((W,Z)=>W-Z);let S=fe();o.colors||(o.colors=S[o.colorScheme]||["#ffffffff","#000000ff"]),f=o.levels.map(g)}let v=u-l,y=Qe(65536,o);this.ticks=y.ticks;let w=y.ticks[0].data,x=y.ticks[y.ticks.length-1].data-w,M=o.showBelowMin?y.colors[0]:0,C=o.showAboveMax?y.colors[65535]:0;this.colorsI[0]=0;for(let S=1;S<65536;++S){let W=this.DataToStyle(v*S/65535+l),Z=Math.round(65535*(W-w)/x);this.colorsI[S]=Z<=0?M:Z>65535?C:y.colors[Z]}for(let S=0;S<f[0];++S)this.levelIndex[S]=0;for(let S=0;S<f.length-1;S++)for(let W=f[S];W<f[S+1]+1;++W)this.levelIndex[W]=S;for(let S=f[f.length-1];S<65536;++S)this.levelIndex[S]=f.length-1}};function Eo(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 Qe(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 T=l[0][0],x=(a-1)/(l[l.length-1][0]-T);s.ticks=l.map(([M,C])=>({data:M,dataString:Eo(M),color:C,pos:~~((M-T)*x)}));for(let M=0;M<l.length-1;M++){let C=s.ticks[M].pos,S=s.ticks[M+1].pos,W=Wt(l[M][1]),Z=f?Wt(l[M+1][1]):0;for(let E=C;E<S;++E)s.colors[E]=f?qi(W,Z,(E-C)/(S-C)):W}return s.colors[a-1]=Wt(l[l.length-1][1]),s}if(!c||!u)return s;let m=0,g=0,v=-1;for(let T=0;T<a;++T){let x=T*(c.length-1)/a;v!==~~x&&(v=~~x,m=Wt(c[v]),g=c.length>v+1?Wt(c[v+1]):m),s.colors[T]=f?qi(m,g,x-v):m}s.colors[a-1]=Wt(c[c.length-1]);let y=u[0],w=(a-1)/(u[u.length-1]-y);return s.ticks=u.map(T=>{let x=~~((T-y)*w);return{data:T,dataString:Eo(T),pos:x,color:ct(s.colors[x])}}),s}var ge=class extends Map{clear(){P("TilesCache.clear()"),this.forEach(o=>{o.rd&&(o.rd.gl.deleteTexture(o.rd.vectorTextureU),o.rd.gl.deleteTexture(o.rd.vectorTextureV))}),super.clear()}},ve=class{constructor(o){this.tilesRasterCache=new ge;this.coarseLevel=0;this._painter=new _e(this);this._loader=new pe(this);if(P(`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.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
- variables=${o.getVariables()}<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.isVariableValid(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=It(),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 P("WxLayer.nonanimatabl()"),this.variables.length<2||this.style.streamLineStatic||this.style.streamLineColor==="none"}getMaxZoom(){return P("WxLayer.getMaxZoom"),this.wxdatasetManager.isInstanced()?this.wxdatasetManager.getInstanceMeta(this.getTime()).maxZoom:this.wxdatasetManager.getMaxZoom()}getCoarseMaxZoom(){return P("WxLayer.getCoarseMaxZoom"),this.getMaxZoom()-this.coarseLevel}getBoundaries(){return this.wxdatasetManager.isInstanced()?this.wxdatasetManager.getInstanceMeta(this.getTime()).boundaries:this.wxdatasetManager.getBoundaries()}getTime(){return P("WxLayer.getTime"),this._time}clearCache(){P("WxLayer.clearCache"),this.tilesRasterCache.clear(),this._loader.clearCache()}getCurrentStyleObjectCopy(){return P("WxLayer.getCurrentStyleObjectCopy"),Object.assign({},this.style)}updateCurrentStyleObject(o){P(`WxLayer.updateCurrentStyleObject ${JSON.stringify(o)}`),[this.style,this.CLUT]=this._createStyleAndCLUT(o)}getTileData(o,s){let l=this.tilesRasterCache.get(Ye(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(ct),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){P(`WxLayer.setURLsAndTime time=${o}`),[this.tilesURIs,this._time]=this._createURLsAndTime(o),this.wxdatasetManager.isInstanced()&&(this.currentVariableMeta=this._getCurrentVariableMeta(),[this.style,this.CLUT]=this._createStyleAndCLUT())}getPaintedCanvas(o,s,l){return this._painter.getPaintedCanvas(o,s,l)}async loadTile(o,s){return this._loadCacheDrawTile(o,this.tilesRasterCache,s)}async preloadTime(o,s,l){P(`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){P("WxLayer.reloadTiles");let l=new ge;await Promise.allSettled(o.map(u=>this._loadCacheDrawTile(u,l,s))),s?.signal?.aborted?l.clear():(this.tilesRasterCache.clear(),this.tilesRasterCache=l)}async _loadCacheDrawTile(o,s,l){let u=s.get(Ye(o));if(u)return u;let c=await this._loader.load(o,l);if(!c)return null;let f=Kt(256,256),m=f,g=this.variables.length===2?Kt(256,256):f,v={ctxFill:f,ctxText:m,ctxStreamLines:g,data:c};return this._painter.paint(v),s.set(Ye(o),v),v}_getCurrentVariableMeta(){let o=this.variables.map(f=>{let m=this.wxdatasetManager.getInstanceVariableMeta(f,this._time);if(!m)throw new Error(`datasetName ${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){P(`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 Je(o,u,[s,l],this.variables.length===2)}_createURLsAndTime(o){let s=this.wxdatasetManager.getNearestValidTime(o);return[this.variables.map(u=>this.wxdatasetManager.createURI(u,s)),s]}};var Zo=co(Yi()),ei=class extends Zo.default.GridLayer{constructor(s){super(s);this.id=s.id}};var ye=class extends ei{constructor(s,l){P(`WxLayerBaseImplementation.constructor (${l.id})`);super(l);this._animation=!1;this._animationSeed=0;this._needUpdateDSManager=!1;this._layer=new ve(s)}get wxdatasetManager(){return P(`WxLayerBaseImplementation.wxdatasetManager (${this.id})`),this._layer.wxdatasetManager}getCurrentVariableMeta(){return P(`WxLayerBaseImplementation.getCurrentVariableMeta (${this.id})`),{...this._layer.currentVariableMeta}}getDatasetMeta(){return this._layer.wxdatasetManager.getInstanceMeta(this.getTime())}getMetadata(){return P(`WxLayerBaseImplementation.getMetadata (${this.id})`),{...this._layer.currentVariableMeta}}getVariablesNames(){return P(`WxLayerBaseImplementation.getVariables (${this.id})`),[...this._layer.variables]}clearCache(){P(`WxLayerBaseImplementation.clearCache (${this.id})`),this._layer.clearCache()}getCache(){return this._layer.tilesRasterCache}getCurrentStyleObjectCopy(){return P(`WxLayerBaseImplementation.getCurrentStyleObjectCopy (${this.id})`),this._layer.getCurrentStyleObjectCopy()}getTime(){return P(`WxLayerBaseImplementation.getTime (${this.id})`),this._layer.getTime()}getAllTimes(){return P(`WxLayerBaseImplementation.getTimes (${this.id})`),this._layer.wxdatasetManager.getAllTimes()}async setTime(s,l){P(`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 P(`WxLayerBaseImplementation.preloadTime (${this.id}) time=${s}`),this._layer.preloadTime(s,this.coveringTiles(),l)}startAnimation(){if(this._animation){P(`WxLayerBaseImplementation.startAnimation (${this.id}) already started`);return}if(this._layer.nonanimatable){P(`WxLayerBaseImplementation.startAnimation (${this.id}) nonanimatable`);return}P(`WxLayerBaseImplementation.startAnimation (${this.id})`),this._animation=!0;let s=async l=>{if(P(`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 P(`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 P(`WxLayerBaseImplementation.setStyleByName (${this.id}) wxstyleName=${s} reload=${l}`),this.updateCurrentStyleObject(It()[s],l)}async updateCurrentStyleObject(s,l=!0,u){if(P(`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(()=>{P(`WxTileSource _redrawTiles (${this.id})`),this.update(),s(),this._redrawRequested=void 0})}),this._redrawRequested)}async _reloadVisible(s){}coveringTiles(){return[]}update(){}async _loadTileHelper(s,l){let u=null;if(!this._needUpdateDSManager)try{u=await this._layer.loadTile(s,l)}catch(c){if(c.name==="AbortError")throw c;c.reason==="instance-not-found"&&!this._needUpdateDSManager&&(this._needUpdateDSManager=!0,P(`WxTileSource.loadTile (${this.id}) instance-not-found. Trying to update wxdatasetManager and load again.`),this.wxdatasetManager.update().then(()=>{this._needUpdateDSManager=!1,this.setTime(this.getTime()).then(()=>this.fire("changed",this))}).catch(f=>{P(`WxTileSource.loadTile (${this.id}) instance-not-found. wxdatasetManager update failed.`,f)}))}return u}};var ii=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)}},xe=class extends ye{constructor(o,s){super(o,s),P("WxTileSource constructor: ",o)}getLayerInfoAtLatLon(o,s){if(P(`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(P(`WxTileSource _reloadVisible (${this._layer.wxdatasetManager.datasetName})`),await this._layer.reloadTiles(this.coveringTiles(),o),o?.signal?.aborted){P(`WxTileSource _reloadVisible (${this._layer.wxdatasetManager.datasetName}) aborted`);return}return await Promise.allSettled(this._ForEachWxTile(async s=>{s.raster_data=null,s.raster_data=await this._layer.loadTile(s.coords)},"_reloadVisible")),this._redrawTiles()}coveringTiles(){P(`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(){P(`WxTileSource update (${this._layer.wxdatasetManager.datasetName})`),this._ForEachWxTile(o=>{o.draw(o.raster_data&&this._layer.getPaintedCanvas(o.raster_data,this._animation,this._animationSeed))},"_redrawTiles")}_ForEachWxTile(o,s){P(`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=Kt(256,256),u=l.canvas;return this._loadTileHelper(o).then(c=>{u.wxtile=new ii(o,l,c)}).catch(()=>{u.wxtile=new ii(o,l,null)}).finally(s),u}onRemove(o){return super.onRemove(o),P(`WxTileSource onRemove (${this._layer.wxdatasetManager.datasetName})`),this._animation=!1,this}};var be=class{constructor({datasetName:o,datasetCurrentInstance:s,instanced:l,datasetCurrentMeta:u,metas:c,wxAPI:f}){this.datasetName=o,this._instanced=l,this._datasetCurrentInstance=s,this._datasetCurrentMeta=u,this._metas=c,this.wxAPI=f,P(`WxDataSetManager.constructor: ${this.datasetName}`)}createSourceLayer(o,s){P(`WxDataSetManager.createSourceLayer: ${this.datasetName}`);let l={...o,variables:this._checkCombineVariableIfVector(o.variable),wxdatasetManager:this};return new xe(l,s)}getNearestValidTime(o=Date()){P(`WxDataSetManager.getValidTime: ${this.datasetName}, ${o}`);let s=this.getAllTimes();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]}getAllTimes(){return P(`WxDataSetManager.getTimes: ${this.datasetName}`),this._instanced||this._datasetCurrentMeta.times}getAllVariables(){return P(`WxDataSetManager.getVariables: ${this.datasetName}`),this._datasetCurrentMeta.variables}getVariableCurrentMeta(o){return P(`WxDataSetManager.getVariableCurrentMeta: ${this.datasetName}, ${o}`),this._datasetCurrentMeta.variablesMeta[o]}getInstanceVariableMeta(o,s){return P(`WxDataSetManager.getInstanceVariableMeta: ${this.datasetName}, ${o}, ${s}`),this.getInstanceMeta(s).variablesMeta[o]}getMaxZoom(){return P(`WxDataSetManager.getMaxZoom: ${this.datasetName}`),this._datasetCurrentMeta.maxZoom}getBoundaries(){return P(`WxDataSetManager.getBoundaries: ${this.datasetName}`),this._datasetCurrentMeta.boundaries}getInstanceMeta(o){return P(`WxDataSetManager.getInstanceMeta: ${this.datasetName}, ${o}`),o&&this._metas?.get(o)||this._datasetCurrentMeta}createURI(o,s,l="webp"){if(P(`WxDataSetManager.createURI: ${this.datasetName}, ${o}, ${s}`),!this.isVariableValid(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}`}isVariableValid(o){return P(`WxDataSetManager.checkVariableValid: ${this.datasetName}, ${o}`),this._datasetCurrentMeta.variablesMeta[o]!==void 0}async update(){let o=await this.wxAPI.createDatasetManager(this.datasetName);this._datasetCurrentInstance=o._datasetCurrentInstance,this._instanced=o._instanced,this._datasetCurrentMeta=o._datasetCurrentMeta,this._metas=o._metas}isInstanced(){return this._instanced!==void 0}_checkCombineVariableIfVector(o){P(`WxDataSetManager.checkCombineVariableIfVector: ${this.datasetName}, ${o}`);let s=this._datasetCurrentMeta.variablesMeta[o];if(!s)throw new Error(`in dataset ${this.datasetName} variable ${o} not found`);return s.vector||[o]}},ni=class{constructor(o){this.wxAPI=o;this.allDatasetsShortMetas={};this.ready=this.updateAll()}updateAll(){return this.ready=Nt(this.wxAPI.dataServerURL+"meta.json",this.wxAPI.requestInit),this.ready.then(o=>this.allDatasetsShortMetas=o),this.ready}async updateOne(o){try{let s=this.wxAPI.dataServerURL+o+"/meta.json",l=await Nt(s,this.wxAPI.requestInit);return Object.assign(this.allDatasetsShortMetas,l)}catch{return this.updateAll()}}};var we=class{constructor({dataServerURL:o,maskURL:s="none",maskChannel:l="R",maskDepth:u=11,qtreeURL:c="none",requestInit:f,colorStyles:m,units:g,colorSchemes:v}){if(P("WxAPI.constructor",o),vo({colorStyles:m,units:g,colorSchemes:v}),c==="auto"&&(c=o+"masks/11+1.seamask.qtree"),s==="auto"&&(s=o+"masks/{z}/{x}/{y}.webp"),this.dataServerURL=o,this.requestInit=f,this.maskURL=s,this.maskChannel=l==="R"?0:l==="G"?1:l==="B"?2:l==="A"?3:0,this.maskDepth=u,this.maskURL!=="none"){let y=Xe(Vi);this.loadMaskFunc=w=>y(je(this.maskURL,w),f)}else this.loadMaskFunc=()=>Promise.reject(new Error("maskURL not defined"));this._allDatasetsManager=new ni(this),this.qtree=new me(c,f),this.initDone=Promise.all([this._allDatasetsManager.ready,this.qtree.ready]).then(()=>P("WxAPI.constructor initDone"))}async createDatasetManager(o){await this.initDone,await this._allDatasetsManager.updateOne(o),P("WxAPI.createDatasetManager",o);let s=this._allDatasetsManager.allDatasetsShortMetas[o],l=s?.instance;if(!l)throw new Error("Dataset/instance not found:"+o);let u=s.instanced,c=await Nt(this.dataServerURL+o+"/metafull.json"),f=c[0],m=u&&new Map(c.map(g=>[g.instance,g]));return new be({datasetName:o,datasetCurrentInstance:l,datasetCurrentMeta:f,instanced:u,metas:m,wxAPI:this})}async getDatasetAllVariables(o){return await this.initDone,P("WxAPI.getDatasetVariables",o),this._allDatasetsManager.allDatasetsShortMetas[o]?.variables}async filterDatasetsByVariableName(o){await this.initDone,P("WxAPI.filterDatasetsByVariableName:",o);let{allDatasetsShortMetas:s}=this._allDatasetsManager;return Object.keys(s).filter(l=>s[l].variables.includes(o))}async getAllDatasetsNames(){return await this.initDone,P("WxAPI.getAllDatasetsNames"),Object.keys(this._allDatasetsManager.allDatasetsShortMetas)}};var oi=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=Qe(l-50,o),m=s.getContext("2d"),g=m.createImageData(l,u),v=new Uint32Array(g.data.buffer);v.fill(-1);let y=2,w=2,T=y+l*w,x=c>>1;if(f.showBelowMin){let M=f.colors[0];if(M)for(let C=0;C<x;++C)for(let S=x;S<x+C;++S)v[T+C+S*l]=M,v[T+C+(x*2-S)*l]=M}for(let M=0;M<f.size;++M)for(let C=0;C<c;++C)f.colors[0]&&(v[y+M+x+(C+w+1)*l]=f.colors[M]);if(f.showAboveMax){let M=f.colors[f.colors.length-1];if(M)for(let C=0;C<=x;++C)for(let S=x;S<x+C;++S)v[T+x*2+f.size-C+S*l]=M,v[T+x*2+f.size-C+(x*2-S)*l]=M}m.putImageData(g,0,0),m.font="8px sans-serif",m.beginPath();for(let M of f.ticks)m.strokeStyle="#000",m.moveTo(M.pos+x+y+1,w+3),m.lineTo(M.pos+x+y+1,c),m.fillText(M.dataString,M.pos+x+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 ri=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=It().base;let o=Lt(this.parent,"div",{onclick:onwheel,ondblclick:onwheel,onwheel,onmousedown,onmouseup}),s=Lt(o,"button",{id:"customStyleButton",style:"height: 1.5em; background-color: gray",innerText:"Custom Style"}),l=Lt(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=Lt(l,"textarea",{id:"customStyleTextArea",style:"width: 20vw;"}),this.editorTextAreaEl.readOnly=!0,this.editorDivEl=Lt(l,"div");let u=(g,v=!0)=>{Lt(this.editorDivEl,"label",{htmlFor:g,id:g+"Label",className:g+"LabelClass",textContent:g.replace(/Input|Select$/i,"")}),v&&Lt(this.editorDivEl,"br",{})},c=({id:g,type:v,min:y,max:w,step:T,onEvent:x="change",br:M=!0})=>{let C=Lt(this.editorDivEl,"input",{id:g,className:g+"Class",type:v,min:y,max:w,step:T});return x!=="none"&&C.addEventListener(x,()=>this._onDivChange()),u(g,M),C},f=({id:g,opts:v,onEvent:y="change",br:w=!0})=>{let T=Lt(this.editorDivEl,"select",{id:g,className:g+"Class"});return y!=="none"&&T.addEventListener(y,()=>this._onDivChange()),v.forEach(x=>T.options.add(Lt(T,"option",{value:x,text:x}))),u(g,w),T.selectedIndex=0,T},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:"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(fe()),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"]}),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(Ki(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 Lt(a,o,s){let l=document.createElement(o);return Object.assign(l,s),a?.appendChild(l),l}function Ki(a){return Array.isArray(a)?a.map(Ki):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]=Ki(a[l]),s),{}):a}var si=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:w}=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+=w&&`model=${w}<br>`||"",this.div.innerHTML+=`dataset=${m}<br>
7
+ variables=${o.getVariablesNames()}<br>
8
8
  time=${o.getTime()}<br>
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(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
- /* @preserve
12
- * Leaflet 1.9.3, a JS library for interactive maps. https://leafletjs.com
13
- * (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade
14
- */
9
+ min=${u.toFixed(2)} ${f}, max=${c.toFixed(2)} ${f}<br>`;let T=o.getLayerInfoAtLatLon(this.pos,s);T?this.div.innerHTML+=`style=${T.inStyleUnits.map(x=>x.toFixed(2))} ${T.styleUnits}<br>
10
+ source=${T.data.map(x=>x.toFixed(2))} ${T.dataUnits}<br>`:this.div.innerHTML+="style=outside<br>source=outside<br>"}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var ai=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.buttonPlayStop=document.createElement("button"),l.appendChild(this.buttonPlayStop),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.buttonPlayStop.innerHTML="Start";let u=0,c={abortController:new AbortController};this.buttonPlayStop.onclick=async()=>{if(this.buttonPlayStop.innerHTML==="Start"){this.buttonPlayStop.innerHTML="Stop";let f=async()=>{if(this.wxsource){if(this.timesEl.style.backgroundColor="yellow",this.buttonPlayStop.innerHTML==="Stop"){let m=u++%this.wxsource.getAllTimes().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.buttonPlayStop.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.buttonPlayStop.innerHTML="Start",this.wxsource=o;let s=this.wxsource?.getAllTimes()||[];this.setTimes(s),this.timesEl.value=this.wxsource?.getTime()||"",this.onchange(this.timesEl.value),o?.on("changed",()=>this.updateSource(o))}onAdd(){return this._div}onRemove(){this._div.parentNode?.removeChild(this._div)}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var li=class{constructor(o,s,l){this.wxapi=o;this._busy=!1;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()=>{if(this._busy)return;this.setBusy(!0);let m=this.datasets.value;await this.fillVariables();let g=this.variables.value;await this.onchange?.(this.datasets.value,this.variables.value),this.datasets.value=m,this.variables.value=g,this.setBusy(!1)});let f=document.createElement("label");f.innerText="Variable",u.appendChild(f),this.variables=document.createElement("select"),u.appendChild(this.variables),this.variables.addEventListener("change",async()=>{if(this._busy)return;this.setBusy(!0);let m=this.variables.value;await this.onchange?.(this.datasets.value,this.variables.value),this.variables.value=m,this.setBusy(!1)}),this.datasets.value=s||"",this.variables.value=l||""}setBusy(o){this._busy=o,this._div.style.backgroundColor=o?"yellow":"lightgray"}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.getDatasetAllVariables(s))?.forEach(l=>{let u=document.createElement("option");u.value=l,u.text=l,this.variables.appendChild(u)}),o&&this.variables.options.length&&(this.variables.value=o)}onAdd(){return this._div}onRemove(){this._div.parentNode?.removeChild(this._div)}extender(){return{onAdd:()=>this.onAdd(),onRemove:()=>this.onRemove()}}};var Le=co(Yi());function Ji(a,o,s,l,u,c){a.flyTo([l,s],o)}function Ft(a,o,s,l,u){let c=It().base;for(let g in u)u[g]===c[g]&&delete u[g];if(u.gl){for(let g in u.gl)u.gl[g]===c.gl?.[g]&&delete u.gl[g];Object.keys(u.gl).length===0&&delete u.gl}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 zo(){let a=Le.default.map("map",{center:[-40.75,174.5],zoom:7,zoomControl:!1});return Le.default.control.zoom({position:"bottomright"}).addTo(a),a}function Jt(a,o,s){s=s.replace("-",""),a.addControl(new(Le.default.Control.extend(o.extender()))({position:s}))}function Oo(a){return a.latlng.wrap()}function Bo(a,o,s){a.eachLayer(l=>{l.options.id===o&&a.removeLayer(l)})}async function Ro(a,o,s){a.addLayer(s),await new Promise(l=>s.once("load",l))}function hi(a,o,s,l,u,c){let f=Le.default.tileLayer(l,{id:o,maxNativeZoom:u,zIndex:s==="baseL"?1:0});a.addLayer(f)}var Ns=.8;async function No(){let a=await zo();hi(a,"baseS","baseL","https://tile.openstreetmap.org/{z}/{x}/{y}.png",3),hi(a,"baseS","baseL","https://tiles.metoceanapi.com/base-lines/{z}/{x}/{y}",5);let o="https://tilesdev.metoceanapi.com/data/",s=new Headers,l=new we({dataServerURL:o,maskURL:"auto",maskChannel:"R",qtreeURL:"auto",requestInit:{headers:s}}),u="obs-radar.rain.nzl.national",c="reflectivity",m=window.location.toString().split("##")[1]?.split("/");u=m?.[0]||u,m?.[1]&&(c=m[1]);let g=m?.[2]||"",v=m&&parseFloat(m[3])||0,y=m&&parseFloat(m[4])||0,w=m&&parseFloat(m[5])||0,T=m&&parseFloat(m[6])||0,x=m&&parseFloat(m[7])||0;m?.length>8&&(m[8]=m.slice(8).join("/"));let M=m?.[8]&&m[8],C={style:{}};try{C.style=M&&{...JSON.parse(decodeURI(M))}}catch{console.log("Can't parse style from URL")}m&&Ji(a,v,y,w,T,x),a.on("zoom",()=>Ft(a,g,u,c,C.style)),a.on("drag",()=>Ft(a,g,u,c,C.style)),a.on("rotate",()=>Ft(a,g,u,c,C.style)),a.on("pitch",()=>Ft(a,g,u,c,C.style));let S,W=new oi;Jt(a,W,"top-right");let Z={id:"wxsource",opacity:Ns,attribution:'<a href="https://metoceanapi.github.io/wxtiles-mbox/docs">WxTiles DOCS</a>'},E=new li(l,u,c);Jt(a,E,"top-left"),E.onchange=async(G,at,$=!0)=>{u=G,c=at,P("apiControl.onchange datasetName=",u,"variable=",c),Bo(a,Z.id,S),$&&(C.style={}),S=void 0;let X=await l.createDatasetManager(u),Te=X.getBoundaries();if(Te&&$){let{east:dt,west:rt,north:kt,south:A}=Te.boundariesnorm,Se=Math.round(Math.log(360*360/Math.max((dt-rt+360)%360,kt-A)/360)/Math.LN2);Ji(a,Se,(dt+rt)/2,(kt+A)/2,0,0)}if(X.getVariableCurrentMeta(c)?.units==="RGB"){let dt=X.getAllTimes();hi(a,Z.id,"wxtiles",X.createURI(c,dt[0]),X.getMaxZoom(),X.getBoundaries()?.boundariesnorm),N.setTimes(dt),W.clear()}else{S=X.createSourceLayer({variable:c,time:g,wxstyle:C.style},Z),S.setCoarseLevel(0),await Ro(a,"wxtiles",S);let dt=S.getCurrentStyleObjectCopy();W.drawLegend(dt),dt.levels=C.style?.levels,dt.colors=C.style?.colors,await q.onchange?.(dt,!0),N.updateSource(S)}};let N=new ai(50);Jt(a,N,"top-left"),N.onchange=G=>{Ft(a,g=G,u,c,C.style),F.update(S,a)};let q=new ri;Jt(a,q,"top-right"),q.onchange=async(G,at)=>{if(P("customStyleEditorControl.onchange"),!S)return;at||await S.updateCurrentStyleObject(G);let $=S.getCurrentStyleObjectCopy();W.drawLegend($),$.levels=G?.levels,$.colors=G?.colors,q.setStyle($),C.style=$,Ft(a,g,u,c,C.style)};let F=new si;Jt(a,F,"bottom-left"),a.on("mousemove",G=>F.update(S,a,Oo(G))),await E.onchange(u,c,!1)}No();})();
11
+ /*! Bundled license information:
12
+
13
+ leaflet/dist/leaflet-src.js:
14
+ (* @preserve
15
+ * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
16
+ * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
17
+ *)
18
+ */