!function(t,e){"object"==typeofexports&&"undefined"!=typeofmodule?e(exports,require("leaflet")):"function"==typeofdefine&&define.amd?define(["exports","leaflet"],e):e(((t="undefined"!=typeofglobalThis?globalThis:t||self).L=t.L||{},t.L.esri={}),t.L)}(this,function(t,g){"use strict";vare="3.0.4",i=window.XMLHttpRequest&&"withCredentials"innewwindow.XMLHttpRequest,s=""===document.documentElement.style.pointerEvents,a={cors:i,pointerEvents:s},r={attributionWidthOffset:55},n=0;functionl(t){vare,i,s,r="";for(varoint.f=t.f||"json",t){t.hasOwnProperty(o)&&(e=t[o],i=Object.prototype.toString.call(e),r.length&&(r+="&"),s="[object Array]"===i?"[object Object]"===Object.prototype.toString.call(e[0])?JSON.stringify(e):e.join(","):"[object Object]"===i?JSON.stringify(e):"[object Date]"===i?e.valueOf():e,r+=encodeURIComponent(o)+"="+encodeURIComponent(s))}returnr}functionu(s,r){varo=newwindow.XMLHttpRequest;returno.onerror=function(t){o.onreadystatechange=g.Util.falseFn,s.call(r,{error:{code:500,message:"XMLHttpRequest error"}},null)},o.onreadystatechange=function(){vare,i;if(4===o.readyState){try{e=JSON.parse(o.responseText)}catch(t){e=null,i={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!i&&e.error&&(i=e.error,e=null),o.onerror=g.Util.falseFn,s.call(r,i,e)}},o.ontimeout=function(){this.onerror()},o}functiono(t,e,i,s){varr=u(i,s);returnr.open("POST",t),null!=s&&void0!==s.options&&(r.timeout=s.options.timeout),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),r.send(l(e)),r}functionh(t,e,i,s){varr=u(i,s);returnr.open("GET",t+"?"+l(e),!0),null!=s&&void0!==s.options&&(r.timeout=s.options.timeout,s.options.withCredentials&&(r.withCredentials=!0)),r.send(null),r}functionc(t,e,i,s){varr=l(e),o=u(i,s),n=(t+"?"+r).length;if(n<=2e3&&a.cors?o.open("GET",t+"?"+r):2e3<n&&a.cors&&(o.open("POST",t),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8")),null!=s&&void0!==s.options&&(o.timeout=s.options.timeout,s.options.withCredentials&&(o.withCredentials=!0)),n<=2e3&&a.cors)o.send(null);else{if(!(2e3<n&&a.cors))returnn<=2e3&&!a.cors?p(t,e,i,s):voidm("arequestto"+t+"waslongerthen2000charactersandthisbrowsercannotmakeacross-domainpostrequest.Pleaseuseaproxyhttp://esri.github.io/esri-leaflet/api-reference/request.html");o.send(r)}returno}functionp(t,e,s,r){window._EsriLeafletCallbacks=window._EsriLeafletCallbacks||{};varo="c"+n;e.callback="window._EsriLeafletCallbacks."+o,window._EsriLeafletCallbacks[o]=function(t){vare,i;!0!==window._EsriLeafletCallbacks[o]&&("[objectObject]"!==(i=Object.prototype.toString.call(t))&&"[objectArray]"!==i&&(e={error:{code:500,message:"Expected array or object as JSONP response"}},t=null),!e&&t.error&&(e=t,t=null),s.call(r,e,t),window._EsriLeafletCallbacks[o]=!0)};vari=g.DomUtil.create("script",null,document.body);returni.type="text/javascript",i.src=t+"?"+l(e),i.id=o,i.onerror=function(t){t&&!0!==window._EsriLeafletCallbacks[o]&&(s.call(r,{error:{code:500,message:"Anunknownerroroccurred"}}),window._EsriLeafletCallbacks[o]=!0)},g.DomUtil.addClass(i,"esri-leaflet-jsonp"),n++,{id:o,url:i.src,abort:function(){window._EsriLeafletCallbacks._callback[o]({code:0,message:"Requestaborted."})}}}vard=a.cors?h:p;functionm(){console&&console.warn&&console.warn.apply(console,arguments)}d.CORS=h,d.JSONP=p;functiony(t,e){for(vari=0;i<t.length-1;i++)for(vars=0;s<e.length-1;s++)if(function(t,e,i,s){varr=(s[0]-i[0])*(t[1]-i[1])-(s[1]-i[1])*(t[0]-i[0]),o=(e[0]-t[0])*(t[1]-i[1])-(e[1]-t[1])*(t[0]-i[0]),n=(s[1]-i[1])*(e[0]-t[0])-(s[0]-i[0])*(e[1]-t[1]);if(0!=n){vara=r/n,l=o/n;if(0<=a&&a<=1&&0<=l&&l<=1)return!0}return!1}(t[i],t[i+1],e[s],e[s+1]))return!0;return!1}function_(t){returnfunction(t,e){for(vari=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}(t[0],t[t.length-1])||t.push(t[0]),t}functionv(t){for(vare,i=0,s=0,r=t.length,o=t[s];s<r-1;s++)i+=((e=t[s+1])[0]-o[0])*(e[1]+o[1]),o=e;return0<=i}functionf(t){vare={};for(variin