iobroker.javascript
Version:
Rules Engine for ioBroker
4 lines • 150 kB
JavaScript
import{g as Vo}from"./_commonjsHelpers-D6-XlEtG.js";function qo(Gt,Vt){for(var l=0;l<Vt.length;l++){const it=Vt[l];if(typeof it!="string"&&!Array.isArray(it)){for(const x in it)if(x!=="default"&&!(x in Gt)){const ut=Object.getOwnPropertyDescriptor(it,x);ut&&Object.defineProperty(Gt,x,ut.get?ut:{enumerable:!0,get:()=>it[x]})}}}return Object.freeze(Object.defineProperty(Gt,Symbol.toStringTag,{value:"Module"}))}var fe={exports:{}};/* @preserve
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/var jo=fe.exports;(function(Gt,Vt){(function(l,it){it(Vt)})(jo,function(l){var it="1.9.4";function x(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++){o=arguments[i];for(e in o)t[e]=o[e]}return t}var ut=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function S(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 Je=0;function P(t){return"_leaflet_id"in t||(t._leaflet_id=++Je),t._leaflet_id}function $e(t,e,i){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(i,o),o=!1)},s=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(r,e),n=!0)},s}function Ct(t,e,i){var n=e[1],o=e[0],s=n-o;return t===n&&i?t:((t-o)%s+s)%s+o}function E(){return!1}function J(t,e){if(e===!1)return t;var i=Math.pow(10,e===void 0?6:e);return Math.round(t*i)/i}function de(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function dt(t){return de(t).split(/\s+/)}function C(t,e){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?ut(t.options):{});for(var i in e)t.options[i]=e[i];return t.options}function Qe(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(!e||e.indexOf("?")===-1?"?":"&")+n.join("&")}var vn=/\{ *([\w_ -]+) *\}/g;function ti(t,e){return t.replace(vn,function(i,n){var o=e[n];if(o===void 0)throw new Error("No value provided for variable "+i);return typeof o=="function"&&(o=o(e)),o})}var K=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function _e(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var qt="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function me(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var ei=0;function ii(t){var e=+new Date,i=Math.max(0,16-(e-ei));return ei=e+i,window.setTimeout(t,i)}var pe=window.requestAnimationFrame||me("RequestAnimationFrame")||ii,ni=window.cancelAnimationFrame||me("CancelAnimationFrame")||me("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function D(t,e,i){if(i&&pe===ii)t.call(e);else return pe.call(window,S(t,e))}function G(t){t&&ni.call(window,t)}var gn={__proto__:null,extend:x,create:ut,bind:S,get lastId(){return Je},stamp:P,throttle:$e,wrapNum:Ct,falseFn:E,formatNum:J,trim:de,splitWords:dt,setOptions:C,getParamString:Qe,template:ti,isArray:K,indexOf:_e,emptyImageUrl:qt,requestFn:pe,cancelFn:ni,requestAnimFrame:D,cancelAnimFrame:G};function nt(){}nt.extend=function(t){var e=function(){C(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,n=ut(i);n.constructor=e,e.prototype=n;for(var o in this)Object.prototype.hasOwnProperty.call(this,o)&&o!=="prototype"&&o!=="__super__"&&(e[o]=this[o]);return t.statics&&x(e,t.statics),t.includes&&(yn(t.includes),x.apply(null,[n].concat(t.includes))),x(n,t),delete n.statics,delete n.includes,n.options&&(n.options=i.options?ut(i.options):{},x(n.options,t.options)),n._initHooks=[],n.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var s=0,r=n._initHooks.length;s<r;s++)n._initHooks[s].call(this)}},e},nt.include=function(t){var e=this.prototype.options;return x(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},nt.mergeOptions=function(t){return x(this.prototype.options,t),this},nt.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 yn(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 U={on:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e);else{t=dt(t);for(var o=0,s=t.length;o<s;o++)this._on(t[o],e,i)}return this},off:function(t,e,i){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var n in t)this._off(n,t[n],e);else{t=dt(t);for(var o=arguments.length===1,s=0,r=t.length;s<r;s++)o?this._off(t[s]):this._off(t[s],e,i)}return this},_on:function(t,e,i,n){if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}if(this._listens(t,e,i)===!1){i===this&&(i=void 0);var o={fn:e,ctx:i};n&&(o.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(o)}},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t],!!n)){if(arguments.length===1){if(this._firingCount)for(o=0,s=n.length;o<s;o++)n[o].fn=E;delete this._events[t];return}if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}var r=this._listens(t,e,i);if(r!==!1){var a=n[r];this._firingCount&&(a.fn=E,this._events[t]=n=n.slice()),n.splice(r,1)}}},fire:function(t,e,i){if(!this.listens(t,i))return this;var n=x({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,r=o.length;s<r;s++){var a=o[s],h=a.fn;a.once&&this.off(t,h,a.ctx),h.call(a.ctx||this,n)}this._firingCount--}}return i&&this._propagateEvent(n),this},listens:function(t,e,i,n){typeof t!="string"&&console.warn('"string" type argument expected');var o=e;typeof e!="function"&&(n=!!e,o=void 0,i=void 0);var s=this._events&&this._events[t];if(s&&s.length&&this._listens(t,o,i)!==!1)return!0;if(n){for(var r in this._eventParents)if(this._eventParents[r].listens(t,e,i,n))return!0}return!1},_listens:function(t,e,i){if(!this._events)return!1;var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,s=n.length;o<s;o++)if(n[o].fn===e&&n[o].ctx===i)return o;return!1},once:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e,!0);else{t=dt(t);for(var o=0,s=t.length;o<s;o++)this._on(t[o],e,i,!0)}return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[P(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[P(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,x({layer:t.target,propagatedFrom:t.target},t),!0)}};U.addEventListener=U.on,U.removeEventListener=U.clearAllEventListeners=U.off,U.addOneTimeEventListener=U.once,U.fireEvent=U.fire,U.hasEventListeners=U.listens;var zt=nt.extend(U);function m(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var oi=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};m.prototype={clone:function(){return new m(this.x,this.y)},add:function(t){return this.clone()._add(_(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(_(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 m(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new m(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=oi(this.x),this.y=oi(this.y),this},distanceTo:function(t){t=_(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=_(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=_(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+J(this.x)+", "+J(this.y)+")"}};function _(t,e,i){return t instanceof m?t:K(t)?new m(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new m(t.x,t.y):new m(t,e,i)}function z(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}z.prototype={extend:function(t){var e,i;if(!t)return this;if(t instanceof m||typeof t[0]=="number"||"x"in t)e=i=_(t);else if(t=F(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 _((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return _(this.min.x,this.max.y)},getTopRight:function(){return _(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 m?t=_(t):t=F(t),t instanceof z?(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=F(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=F(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.x<i.x,r=o.y>e.y&&n.y<i.y;return s&&r},isValid:function(){return!!(this.min&&this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,o=Math.abs(e.y-i.y)*t;return F(_(e.x-n,e.y-o),_(i.x+n,i.y+o))},equals:function(t){return t?(t=F(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function F(t,e){return!t||t instanceof z?t:new z(t,e)}function H(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}H.prototype={extend:function(t){var e=this._southWest,i=this._northEast,n,o;if(t instanceof b)n=t,o=t;else if(t instanceof H){if(n=t._southWest,o=t._northEast,!n||!o)return this}else return t?this.extend(y(t)||O(t)):this;return!e&&!i?(this._southWest=new b(n.lat,n.lng),this._northEast=new b(o.lat,o.lng)):(e.lat=Math.min(n.lat,e.lat),e.lng=Math.min(n.lng,e.lng),i.lat=Math.max(o.lat,i.lat),i.lng=Math.max(o.lng,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new H(new b(e.lat-n,e.lng-o),new b(i.lat+n,i.lng+o))},getCenter:function(){return new b((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 b(this.getNorth(),this.getWest())},getSouthEast:function(){return new b(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 b||"lat"in t?t=y(t):t=O(t);var e=this._southWest,i=this._northEast,n,o;return t instanceof H?(n=t.getSouthWest(),o=t.getNorthEast()):n=o=t,n.lat>=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},intersects:function(t){t=O(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=O(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.lat<i.lat,r=o.lng>e.lng&&n.lng<i.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return t?(t=O(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function O(t,e){return t instanceof H?t:new H(t,e)}function b(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)}b.prototype={equals:function(t,e){if(!t)return!1;t=y(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("+J(this.lat,t)+", "+J(this.lng,t)+")"},distanceTo:function(t){return lt.distance(this,y(t))},wrap:function(){return lt.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return O([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new b(this.lat,this.lng,this.alt)}};function y(t,e,i){return t instanceof b?t:K(t)&&typeof t[0]!="object"?t.length===3?new b(t[0],t[1],t[2]):t.length===2?new b(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new b(t.lat,"lng"in t?t.lng:t.lon,t.alt):e===void 0?null:new b(t,e,i)}var ot={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t),n=this.transformation.transform(e.min,i),o=this.transformation.transform(e.max,i);return new z(n,o)},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?Ct(t.lng,this.wrapLng,!0):t.lng,i=this.wrapLat?Ct(t.lat,this.wrapLat,!0):t.lat,n=t.alt;return new b(i,e,n)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(n===0&&o===0)return t;var s=t.getSouthWest(),r=t.getNorthEast(),a=new b(s.lat-n,s.lng-o),h=new b(r.lat-n,r.lng-o);return new H(a,h)}},lt=x({},ot,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(n)*Math.cos(o)*r*r,h=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*h}}),si=6378137,ve={R:si,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new m(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new b((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=si*Math.PI;return new z([-t,-t],[t,t])}()};function ge(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}ge.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 m((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};function kt(t,e,i,n){return new ge(t,e,i,n)}var ye=x({},lt,{code:"EPSG:3857",projection:ve,transformation:function(){var t=.5/(Math.PI*ve.R);return kt(t,.5,-t,.5)}()}),wn=x({},ye,{code:"EPSG:900913"});function ri(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ai(t,e){var i="",n,o,s,r,a,h;for(n=0,s=t.length;n<s;n++){for(a=t[n],o=0,r=a.length;o<r;o++)h=a[o],i+=(o?"L":"M")+h.x+" "+h.y;i+=e?f.svg?"z":"x":""}return i||"M0 0"}var we=document.documentElement.style,jt="ActiveXObject"in window,xn=jt&&!document.addEventListener,hi="msLaunchUri"in navigator&&!("documentMode"in document),xe=$("webkit"),ui=$("android"),li=$("android 2")||$("android 3"),Pn=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Ln=ui&&$("Google")&&Pn<537&&!("AudioNode"in window),Pe=!!window.opera,ci=!hi&&$("chrome"),fi=$("gecko")&&!xe&&!Pe&&!jt,Tn=!ci&&$("safari"),di=$("phantom"),_i="OTransition"in we,bn=navigator.platform.indexOf("Win")===0,mi=jt&&"transition"in we,Le="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!li,pi="MozPerspective"in we,Mn=!window.L_DISABLE_3D&&(mi||Le||pi)&&!_i&&!di,Et=typeof orientation<"u"||$("mobile"),Sn=Et&&xe,Cn=Et&&Le,vi=!window.PointerEvent&&window.MSPointerEvent,gi=!!(window.PointerEvent||vi),yi="ontouchstart"in window||!!window.TouchEvent,zn=!window.L_NO_TOUCH&&(yi||gi),kn=Et&&Pe,En=Et&&fi,Zn=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,On=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",E,e),window.removeEventListener("testPassiveEventSupport",E,e)}catch{}return t}(),In=function(){return!!document.createElement("canvas").getContext}(),Te=!!(document.createElementNS&&ri("svg").createSVGRect),An=!!Te&&function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Bn=!Te&&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}}(),Nn=navigator.platform.indexOf("Mac")===0,Rn=navigator.platform.indexOf("Linux")===0;function $(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var f={ie:jt,ielt9:xn,edge:hi,webkit:xe,android:ui,android23:li,androidStock:Ln,opera:Pe,chrome:ci,gecko:fi,safari:Tn,phantom:di,opera12:_i,win:bn,ie3d:mi,webkit3d:Le,gecko3d:pi,any3d:Mn,mobile:Et,mobileWebkit:Sn,mobileWebkit3d:Cn,msPointer:vi,pointer:gi,touch:zn,touchNative:yi,mobileOpera:kn,mobileGecko:En,retina:Zn,passiveEvents:On,canvas:In,svg:Te,vml:Bn,inlineSvg:An,mac:Nn,linux:Rn},wi=f.msPointer?"MSPointerDown":"pointerdown",xi=f.msPointer?"MSPointerMove":"pointermove",Pi=f.msPointer?"MSPointerUp":"pointerup",Li=f.msPointer?"MSPointerCancel":"pointercancel",be={touchstart:wi,touchmove:xi,touchend:Pi,touchcancel:Li},Ti={touchstart:Gn,touchmove:Kt,touchend:Kt,touchcancel:Kt},yt={},bi=!1;function Dn(t,e,i){return e==="touchstart"&&Un(),Ti[e]?(i=Ti[e].bind(this,i),t.addEventListener(be[e],i,!1),i):(console.warn("wrong event specified:",e),E)}function Fn(t,e,i){if(!be[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(be[e],i,!1)}function Hn(t){yt[t.pointerId]=t}function Wn(t){yt[t.pointerId]&&(yt[t.pointerId]=t)}function Mi(t){delete yt[t.pointerId]}function Un(){bi||(document.addEventListener(wi,Hn,!0),document.addEventListener(xi,Wn,!0),document.addEventListener(Pi,Mi,!0),document.addEventListener(Li,Mi,!0),bi=!0)}function Kt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in yt)e.touches.push(yt[i]);e.changedTouches=[e],t(e)}}function Gn(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&N(e),Kt(t,e)}function Vn(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 qn=200;function jn(t,e){t.addEventListener("dblclick",e);var i=0,n;function o(s){if(s.detail!==1){n=s.detail;return}if(!(s.pointerType==="mouse"||s.sourceCapabilities&&!s.sourceCapabilities.firesTouchEvents)){var r=Ei(s);if(!(r.some(function(h){return h instanceof HTMLLabelElement&&h.attributes.for})&&!r.some(function(h){return h instanceof HTMLInputElement||h instanceof HTMLSelectElement}))){var a=Date.now();a-i<=qn?(n++,n===2&&e(Vn(s))):n=1,i=a}}}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function Kn(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var Me=Jt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Zt=Jt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Si=Zt==="webkitTransition"||Zt==="OTransition"?Zt+"End":"transitionend";function Ci(t){return typeof t=="string"?document.getElementById(t):t}function Ot(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 T(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function k(t){var e=t.parentNode;e&&e.removeChild(t)}function Yt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function wt(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function xt(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function Se(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=Xt(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function v(t,e){if(t.classList!==void 0)for(var i=dt(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!Se(t,e)){var s=Xt(t);Ce(t,(s?s+" ":"")+e)}}function Z(t,e){t.classList!==void 0?t.classList.remove(e):Ce(t,de((" "+Xt(t)+" ").replace(" "+e+" "," ")))}function Ce(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e}function Xt(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function V(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&Yn(t,e)}function Yn(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 Jt(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function _t(t,e,i){var n=e||new m(0,0);t.style[Me]=(f.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function I(t,e){t._leaflet_pos=e,f.any3d?_t(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function mt(t){return t._leaflet_pos||new m(0,0)}var It,At,ze;if("onselectstart"in document)It=function(){p(window,"selectstart",N)},At=function(){M(window,"selectstart",N)};else{var Bt=Jt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);It=function(){if(Bt){var t=document.documentElement.style;ze=t[Bt],t[Bt]="none"}},At=function(){Bt&&(document.documentElement.style[Bt]=ze,ze=void 0)}}function ke(){p(window,"dragstart",N)}function Ee(){M(window,"dragstart",N)}var $t,Ze;function Oe(t){for(;t.tabIndex===-1;)t=t.parentNode;t.style&&(Qt(),$t=t,Ze=t.style.outlineStyle,t.style.outlineStyle="none",p(window,"keydown",Qt))}function Qt(){$t&&($t.style.outlineStyle=Ze,$t=void 0,Ze=void 0,M(window,"keydown",Qt))}function zi(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function Ie(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Xn={__proto__:null,TRANSFORM:Me,TRANSITION:Zt,TRANSITION_END:Si,get:Ci,getStyle:Ot,create:T,remove:k,empty:Yt,toFront:wt,toBack:xt,hasClass:Se,addClass:v,removeClass:Z,setClass:Ce,getClass:Xt,setOpacity:V,testProp:Jt,setTransform:_t,setPosition:I,getPosition:mt,get disableTextSelection(){return It},get enableTextSelection(){return At},disableImageDrag:ke,enableImageDrag:Ee,preventOutline:Oe,restoreOutline:Qt,getSizedParentNode:zi,getScale:Ie};function p(t,e,i,n){if(e&&typeof e=="object")for(var o in e)Be(t,o,e[o],i);else{e=dt(e);for(var s=0,r=e.length;s<r;s++)Be(t,e[s],i,n)}return this}var Q="_leaflet_events";function M(t,e,i,n){if(arguments.length===1)ki(t),delete t[Q];else if(e&&typeof e=="object")for(var o in e)Ne(t,o,e[o],i);else if(e=dt(e),arguments.length===2)ki(t,function(a){return _e(e,a)!==-1});else for(var s=0,r=e.length;s<r;s++)Ne(t,e[s],i,n);return this}function ki(t,e){for(var i in t[Q]){var n=i.split(/\d/)[0];(!e||e(n))&&Ne(t,n,null,null,i)}}var Ae={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Be(t,e,i,n){var o=e+P(i)+(n?"_"+P(n):"");if(t[Q]&&t[Q][o])return this;var s=function(a){return i.call(n||t,a||window.event)},r=s;!f.touchNative&&f.pointer&&e.indexOf("touch")===0?s=Dn(t,e,s):f.touch&&e==="dblclick"?s=jn(t,s):"addEventListener"in t?e==="touchstart"||e==="touchmove"||e==="wheel"||e==="mousewheel"?t.addEventListener(Ae[e]||e,s,f.passiveEvents?{passive:!1}:!1):e==="mouseenter"||e==="mouseleave"?(s=function(a){a=a||window.event,De(t,a)&&r(a)},t.addEventListener(Ae[e],s,!1)):t.addEventListener(e,r,!1):t.attachEvent("on"+e,s),t[Q]=t[Q]||{},t[Q][o]=s}function Ne(t,e,i,n,o){o=o||e+P(i)+(n?"_"+P(n):"");var s=t[Q]&&t[Q][o];if(!s)return this;!f.touchNative&&f.pointer&&e.indexOf("touch")===0?Fn(t,e,s):f.touch&&e==="dblclick"?Kn(t,s):"removeEventListener"in t?t.removeEventListener(Ae[e]||e,s,!1):t.detachEvent("on"+e,s),t[Q][o]=null}function pt(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Re(t){return Be(t,"wheel",pt),this}function Nt(t){return p(t,"mousedown touchstart dblclick contextmenu",pt),t._leaflet_disable_click=!0,this}function N(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function vt(t){return N(t),pt(t),this}function Ei(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function Zi(t,e){if(!e)return new m(t.clientX,t.clientY);var i=Ie(e),n=i.boundingClientRect;return new m((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var Jn=f.linux&&f.chrome?window.devicePixelRatio:f.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Oi(t){return f.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Jn: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 De(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 $n={__proto__:null,on:p,off:M,stopPropagation:pt,disableScrollPropagation:Re,disableClickPropagation:Nt,preventDefault:N,stop:vt,getPropagationPath:Ei,getMousePosition:Zi,getWheelDelta:Oi,isExternalTarget:De,addListener:p,removeListener:M},Ii=zt.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=mt(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=D(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(),I(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)}}),w=zt.extend({options:{crs:ye,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=C(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=S(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(y(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Zt&&f.any3d&&!f.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),p(this._proxy,Si,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(y(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&i!==!0){i.animate!==void 0&&(i.zoom=x({animate:i.animate},i.zoom),i.pan=x({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||(f.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(f.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),s=t instanceof m?t:this.latLngToContainerPoint(t),r=s.subtract(o).multiplyBy(1-1/n),a=this.containerPointToLatLng(o.add(r));return this.setView(a,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():O(t);var i=_(e.paddingTopLeft||e.padding||[0,0]),n=_(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if(o=typeof e.maxZoom=="number"?Math.min(e.maxZoom,o):o,o===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o),h=this.unproject(r.add(a).divideBy(2).add(s),o);return{center:h,zoom:o}},fitBounds:function(t,e){if(t=O(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=_(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 Ii,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){v(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||!f.any3d)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),s=this.getSize(),r=this._zoom;t=y(t),e=e===void 0?r:e;var a=Math.max(s.x,s.y),h=a*this.getZoomScale(r,e),u=o.distanceTo(n)||1,c=1.42,d=c*c;function g(A){var ce=A?-1:1,Ho=A?h:a,Wo=h*h-a*a+ce*d*d*u*u,Uo=2*Ho*d*u,Xe=Wo/Uo,mn=Math.sqrt(Xe*Xe+1)-Xe,Go=mn<1e-9?-18:Math.log(mn);return Go}function R(A){return(Math.exp(A)-Math.exp(-A))/2}function B(A){return(Math.exp(A)+Math.exp(-A))/2}function j(A){return R(A)/B(A)}var W=g(0);function St(A){return a*(B(W)/B(W+c*A))}function No(A){return a*(B(W)*j(W+c*A)-R(W))/d}function Ro(A){return 1-Math.pow(1-A,1.5)}var Do=Date.now(),dn=(g(1)-W)/c,Fo=i.duration?1e3*i.duration:1e3*dn*.8;function _n(){var A=(Date.now()-Do)/Fo,ce=Ro(A)*dn;A<=1?(this._flyToFrame=D(_n,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(No(ce)/u)),r),this.getScaleZoom(a/St(ce),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),_n.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=O(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,O(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var i=_(e.paddingTopLeft||e.padding||[0,0]),n=_(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),r=this.getPixelBounds(),a=F([r.min.add(i),r.max.subtract(n)]),h=a.getSize();if(!a.contains(s)){this._enforcingBounds=!0;var u=s.subtract(a.getCenter()),c=a.extend(s).getSize().subtract(h);o.x+=u.x<0?-c.x:c.x,o.y+=u.y<0?-c.y:c.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=x({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),o=i.divideBy(2).round(),s=n.subtract(o);return!s.x&&!s.y?this:(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(S(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=x({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=S(this._handleGeolocationResponse,this),i=S(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 b(e,i),o=n.toBounds(t.coords.accuracy*2),s=this._locateOptions;if(s.setView){var r=this.getBoundsZoom(o);this.setView(n,s.maxZoom?Math.min(r,s.maxZoom):r)}var a={latlng:n,bounds:o,timestamp:t.timestamp};for(var h in t.coords)typeof t.coords[h]=="number"&&(a[h]=t.coords[h]);this.fire("locationfound",a)}},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(),k(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)k(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=T("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 H(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=O(t),i=_(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(i),u=F(this.project(a,n),this.project(r,n)).getSize(),c=f.any3d?this.options.zoomSnap:1,d=h.x/u.x,g=h.y/u.y,R=e?Math.max(d,g):Math.min(d,g);return n=this.getScaleZoom(R,n),c&&(n=Math.round(n/(c/100))*(c/100),n=e?Math.ceil(n/c)*c:Math.floor(n/c)*c),Math.max(o,Math.min(s,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new m(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 z(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(y(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(_(t),e)},layerPointToLatLng:function(t){var e=_(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(y(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(y(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(O(t))},distance:function(t,e){return this.options.crs.distance(y(t),y(e))},containerPointToLayerPoint:function(t){return _(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return _(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(_(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(y(t)))},mouseEventToContainerPoint:function(t){return Zi(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=Ci(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");p(e,"scroll",this._onScroll,this),this._containerId=P(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&f.any3d,v(t,"leaflet-container"+(f.touch?" leaflet-touch":"")+(f.retina?" leaflet-retina":"")+(f.ielt9?" leaflet-oldie":"")+(f.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=Ot(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),I(this._mapPane,new m(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(v(t.markerPane,"leaflet-zoom-hide"),v(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){I(this._mapPane,new m(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){e===void 0&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return G(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){I(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[P(this._container)]=this;var e=t?M:p;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),f.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){G(this._resizeRequest),this._resizeRequest=D(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i=[],n,o=e==="mouseout"||e==="mouseover",s=t.target||t.srcElement,r=!1;s;){if(n=this._targets[P(s)],n&&(e==="click"||e==="preclick")&&this._draggableMoved(n)){r=!0;break}if(n&&n.listens(e,!0)&&(o&&!De(s,t)||(i.push(n),o))||s===this._container)break;s=s.parentNode}return!i.length&&!r&&!o&&this.listens(e,!0)&&(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))){var i=t.type;i==="mousedown"&&Oe(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if(t.type==="click"){var n=x({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}var o=this._findEventTargets(t,e);if(i){for(var s=[],r=0;r<i.length;r++)i[r].listens(e,!0)&&s.push(i[r]);o=s.concat(o)}if(o.length){e==="contextmenu"&&N(t);var a=o[0],h={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var u=a.getLatLng&&(!a._radius||a._radius<=10);h.containerPoint=u?this.latLngToContainerPoint(a.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=u?a.getLatLng():this.layerPointToLatLng(h.layerPoint)}for(r=0;r<o.length;r++)if(o[r].fire(e,h,!0),h.originalEvent._stopped||o[r].options.bubblingMouseEvents===!1&&_e(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 mt(this._mapPane)||new m(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 F([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),s=new z(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,i,e);return Math.abs(r.x)<=1&&Math.abs(r.y)<=1?t:this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new z(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=F(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),s=n.max.subtract(t.max),r=this._rebound(o.x,-s.x),a=this._rebound(o.y,-s.y);return new m(r,a)},_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=f.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(){Z(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=T("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=Me,n=this._proxy.style[i];_t(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(){k(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();_t(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return i.animate!==!0&&!this.getSize().contains(o)?!1:(D(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,v(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(S(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Z(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 Qn(t,e){return new w(t,e)}var Y=nt.extend({options:{position:"topright"},initialize:function(t){C(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 v(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?(k(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()}}),Rt=function(t){return new Y(t)};w.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCo