@defra/interactive-map 0.0.20-alpha → 0.0.21-alpha

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 (26) hide show
  1. package/docs/examples/index.mdx +2 -2
  2. package/docs/plugins/datasets.md +11 -11
  3. package/package.json +6 -2
  4. package/plugins/beta/datasets/adapters/maplibre/dist/esm/im-datasets-ml-adapter.js +1 -0
  5. package/plugins/beta/datasets/adapters/maplibre/dist/esm/index.js +1 -0
  6. package/plugins/beta/datasets/adapters/maplibre/dist/umd/im-datasets-ml-adapter.js +2 -0
  7. package/plugins/beta/datasets/adapters/maplibre/dist/umd/im-datasets-ml-adapter.js.LICENSE.txt +1 -0
  8. package/plugins/beta/datasets/adapters/maplibre/dist/umd/index.js +1 -0
  9. package/plugins/beta/datasets/dist/esm/im-datasets-plugin.js +1 -1
  10. package/plugins/beta/datasets/dist/umd/im-datasets-plugin.js +1 -1
  11. package/plugins/beta/datasets/src/adapters/maplibre/layerBuilders.js +4 -4
  12. package/plugins/beta/datasets/src/adapters/maplibre/maplibreLayerAdapter.js +26 -7
  13. package/plugins/beta/datasets/src/defaults.js +1 -1
  14. package/plugins/beta/datasets/src/manifest.js +1 -1
  15. package/plugins/beta/datasets/src/panels/Layers.jsx +4 -4
  16. package/plugins/beta/datasets/src/utils/mergeSublayer.js +1 -1
  17. package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
  18. package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
  19. package/providers/maplibre/src/maplibreProvider.js +2 -1
  20. package/providers/maplibre/src/maplibreProvider.test.js +22 -2
  21. package/providers/maplibre/src/utils/patternImages.js +16 -10
  22. package/providers/maplibre/src/utils/patternImages.test.js +50 -19
  23. package/rollup.esm.mjs +9 -0
  24. package/src/utils/patternUtils.js +8 -3
  25. package/src/utils/patternUtils.test.js +17 -0
  26. package/webpack.umd.mjs +1 -0
@@ -1 +1 @@
1
- import{useContext as t,createContext as e}from"preact/compat";import{jsx as r,jsxs as a}from"preact/jsx-runtime";import n from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/objectWithoutProperties";import i from"@babel/runtime/helpers/asyncToGenerator";var s=400,l=7,u=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];new Set;function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var d={slot:"middle",open:!1,dismissible:!0,modal:!0};h({},d),h(h({},d),{},{width:"500px"}),h(h({},d),{},{width:"500px"});var p={small:1,medium:1.5,large:2};var g=(t,e)=>{var r=null,a=function(){for(var a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];clearTimeout(r),r=setTimeout(()=>{t(...n)},e)};return a.cancel=()=>{r&&(clearTimeout(r),r=null)},a};function f(t){var{map:e,events:r,eventBus:a,getCenter:n,getZoom:o,getBounds:i,getResolution:s}=t,l=[],u=[],c=()=>{var t=o();return{center:n(),bounds:i(),resolution:s(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},h=(t,e)=>a.emit(t,e),d=()=>h(r.MAP_LOADED);e.on("load",d),l.push(["load",d]);e.once("idle",()=>h(r.MAP_FIRST_IDLE,c()));var p=()=>h(r.MAP_MOVE_START);e.on("movestart",p),l.push(["movestart",p]);var f=g(()=>{h(r.MAP_MOVE_END,c())},500);e.on("moveend",f),l.push(["moveend",f]),u.push(f);var y,m,v,M=(y=()=>{h(r.MAP_MOVE,c())},m=10,v=0,function(){var t=Date.now();t-v>=m&&(v=t,y(...arguments))});e.on("zoom",M),l.push(["zoom",M]),u.push(M);var b=()=>h(r.MAP_RENDER);e.on("render",b),l.push(["render",b]);var w=g(()=>{h(r.MAP_DATA_CHANGE,c())},500);e.on("styledata",w),l.push(["styledata",w]),u.push(w);var x=()=>h(r.MAP_STYLE_CHANGE);e.on("style.load",x),l.push(["style.load",x]);var P=t=>h(r.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]});return e.on("click",P),l.push(["click",P]),{remove(){u.forEach(t=>t.cancel()),l.forEach(t=>{var[r,a]=t;return e.off(r,a)})}}}let y=" ";class m{static get separator(){return y}static set separator(t){y=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let a=null,n=null,o=null,i=null;switch(e){default:case"d":case"deg":n=t.toFixed(r),n<100&&(n="0"+n),n<10&&(n="0"+n),a=n+"°";break;case"dm":case"deg+min":n=Math.floor(t),o=(60*t%60).toFixed(r),60==o&&(o=(0).toFixed(r),n++),n=("000"+n).slice(-3),o<10&&(o="0"+o),a=n+"°"+m.separator+o+"′";break;case"dms":case"deg+min+sec":n=Math.floor(t),o=Math.floor(3600*t/60)%60,i=(3600*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),o++),60==o&&(o=0,n++),n=("000"+n).slice(-3),o=("00"+o).slice(-2),i<10&&(i="0"+i),a=n+"°"+m.separator+o+"′"+m.separator+i+"″"}return a}static toLat(t,e,r){const a=m.toDms(m.wrap90(t),e,r);return null===a?"–":a.slice(1)+m.separator+(t<0?"S":"N")}static toLon(t,e,r){const a=m.toDms(m.wrap180(t),e,r);return null===a?"–":a+m.separator+(t<0?"W":"E")}static toBrng(t,e,r){const a=m.toDms(m.wrap360(t),e,r);return null===a?"–":a.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=m.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t,r=360;return 1*Math.abs(((e-90)%r+r)%r-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const v=Math.PI;class M{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=m.wrap90(Number(t)),this._lon=m.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?m.wrap90(m.parse(t)):m.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?m.wrap90(m.parse(t)):m.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?m.wrap180(m.parse(t)):m.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?m.wrap180(m.parse(t)):m.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?m.wrap180(m.parse(t)):m.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,r;if(2==t.length&&([e,r]=t,e=m.wrap90(m.parse(e)),r=m.wrap180(m.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,r]=t[0].split(","),e=m.wrap90(m.parse(e)),r=m.wrap180(m.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const a=t[0];if("Point"==a.type&&Array.isArray(a.coordinates)?[r,e]=a.coordinates:(null!=a.latitude&&(e=a.latitude),null!=a.lat&&(e=a.lat),null!=a.longitude&&(r=a.longitude),null!=a.lng&&(r=a.lng),null!=a.lon&&(r=a.lon),e=m.wrap90(m.parse(e)),r=m.wrap180(m.parse(r))),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${t.toString()}’`);return new M(e,r)}distanceTo(t,e=6371e3){if(t instanceof M||(t=M.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const r=e,a=this.lat.toRadians(),n=this.lon.toRadians(),o=t.lat.toRadians(),i=o-a,s=t.lon.toRadians()-n,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(a)*Math.cos(o)*Math.sin(s/2)*Math.sin(s/2);return r*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof M||(t=M.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians(),a=(t.lon-this.lon).toRadians(),n=Math.cos(e)*Math.sin(r)-Math.sin(e)*Math.cos(r)*Math.cos(a),o=Math.sin(a)*Math.cos(r),i=Math.atan2(o,n).toDegrees();return m.wrap360(i)}finalBearingTo(t){t instanceof M||(t=M.parse(t));const e=t.initialBearingTo(this)+180;return m.wrap360(e)}midpointTo(t){t instanceof M||(t=M.parse(t));const e=this.lat.toRadians(),r=this.lon.toRadians(),a=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),o=Math.cos(e),i=0,s=Math.sin(e),l={x:o+Math.cos(a)*Math.cos(n),y:i+Math.cos(a)*Math.sin(n),z:s+Math.sin(a)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),c=r+Math.atan2(l.y,l.x),h=u.toDegrees(),d=c.toDegrees();return new M(h,d)}intermediatePointTo(t,e){if(t instanceof M||(t=M.parse(t)),this.equals(t))return new M(this.lat,this.lon);const r=this.lat.toRadians(),a=this.lon.toRadians(),n=t.lat.toRadians(),o=t.lon.toRadians(),i=n-r,s=o-a,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(r)*Math.cos(n)*Math.sin(s/2)*Math.sin(s/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),c=Math.sin((1-e)*u)/Math.sin(u),h=Math.sin(e*u)/Math.sin(u),d=c*Math.cos(r)*Math.cos(a)+h*Math.cos(n)*Math.cos(o),p=c*Math.cos(r)*Math.sin(a)+h*Math.cos(n)*Math.sin(o),g=c*Math.sin(r)+h*Math.sin(n),f=Math.atan2(g,Math.sqrt(d*d+p*p)),y=Math.atan2(p,d),m=f.toDegrees(),v=y.toDegrees();return new M(m,v)}destinationPoint(t,e,r=6371e3){const a=t/r,n=Number(e).toRadians(),o=this.lat.toRadians(),i=this.lon.toRadians(),s=Math.sin(o)*Math.cos(a)+Math.cos(o)*Math.sin(a)*Math.cos(n),l=Math.asin(s),u=Math.sin(n)*Math.sin(a)*Math.cos(o),c=Math.cos(a)-Math.sin(o)*s,h=i+Math.atan2(u,c),d=l.toDegrees(),p=h.toDegrees();return new M(d,p)}static intersection(t,e,r,a){if(t instanceof M||(t=M.parse(t)),r instanceof M||(r=M.parse(r)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(a))throw new TypeError(`invalid brng2 ‘${a}’`);const n=t.lat.toRadians(),o=t.lon.toRadians(),i=r.lat.toRadians(),s=r.lon.toRadians(),l=Number(e).toRadians(),u=Number(a).toRadians(),c=i-n,h=s-o,d=2*Math.asin(Math.sqrt(Math.sin(c/2)*Math.sin(c/2)+Math.cos(n)*Math.cos(i)*Math.sin(h/2)*Math.sin(h/2)));if(Math.abs(d)<Number.EPSILON)return new M(t.lat,t.lon);const p=(Math.sin(i)-Math.sin(n)*Math.cos(d))/(Math.sin(d)*Math.cos(n)),g=(Math.sin(n)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),f=Math.acos(Math.min(Math.max(p,-1),1)),y=Math.acos(Math.min(Math.max(g,-1),1)),m=l-(Math.sin(s-o)>0?f:2*v-f),b=(Math.sin(s-o)>0?2*v-y:y)-u;if(0==Math.sin(m)&&0==Math.sin(b))return null;if(Math.sin(m)*Math.sin(b)<0)return null;const w=-Math.cos(m)*Math.cos(b)+Math.sin(m)*Math.sin(b)*Math.cos(d),x=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(b),Math.cos(b)+Math.cos(m)*w),P=Math.asin(Math.min(Math.max(Math.sin(n)*Math.cos(x)+Math.cos(n)*Math.sin(x)*Math.cos(l),-1),1)),N=o+Math.atan2(Math.sin(l)*Math.sin(x)*Math.cos(n),Math.cos(x)-Math.sin(n)*Math.sin(P)),S=P.toDegrees(),E=N.toDegrees();return new M(S,E)}crossTrackDistanceTo(t,e,r=6371e3){t instanceof M||(t=M.parse(t)),e instanceof M||(e=M.parse(e));const a=r;if(this.equals(t))return 0;const n=t.distanceTo(this,a)/a,o=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(n)*Math.sin(o-i))*a}alongTrackDistanceTo(t,e,r=6371e3){t instanceof M||(t=M.parse(t)),e instanceof M||(e=M.parse(e));const a=r;if(this.equals(t))return 0;const n=t.distanceTo(this,a)/a,o=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(n)*Math.sin(o-i));return Math.acos(Math.cos(n)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(i-o))*a}maxLatitude(t){const e=Number(t).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(r))).toDegrees()}static crossingParallels(t,e,r){if(t.equals(e))return null;const a=Number(r).toRadians(),n=t.lat.toRadians(),o=t.lon.toRadians(),i=e.lat.toRadians(),s=e.lon.toRadians()-o,l=Math.sin(n)*Math.cos(i)*Math.cos(a)*Math.sin(s),u=Math.sin(n)*Math.cos(i)*Math.cos(a)*Math.cos(s)-Math.cos(n)*Math.sin(i)*Math.cos(a),c=Math.cos(n)*Math.cos(i)*Math.sin(a)*Math.sin(s);if(c*c>l*l+u*u)return null;const h=Math.atan2(-u,l),d=Math.acos(c/Math.sqrt(l*l+u*u)),p=o+h+d,g=(o+h-d).toDegrees(),f=p.toDegrees();return{lon1:m.wrap180(g),lon2:m.wrap180(f)}}rhumbDistanceTo(t,e=6371e3){t instanceof M||(t=M.parse(t));const r=e,a=this.lat.toRadians(),n=t.lat.toRadians(),o=n-a;let i=Math.abs(t.lon-this.lon).toRadians();Math.abs(i)>v&&(i=i>0?-(2*v-i):2*v+i);const s=Math.log(Math.tan(n/2+v/4)/Math.tan(a/2+v/4)),l=Math.abs(s)>1e-11?o/s:Math.cos(a);return Math.sqrt(o*o+l*l*i*i)*r}rhumbBearingTo(t){if(t instanceof M||(t=M.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians();let a=(t.lon-this.lon).toRadians();Math.abs(a)>v&&(a=a>0?-(2*v-a):2*v+a);const n=Math.log(Math.tan(r/2+v/4)/Math.tan(e/2+v/4)),o=Math.atan2(a,n).toDegrees();return m.wrap360(o)}rhumbDestinationPoint(t,e,r=6371e3){const a=this.lat.toRadians(),n=this.lon.toRadians(),o=Number(e).toRadians(),i=t/r,s=i*Math.cos(o);let l=a+s;Math.abs(l)>v/2&&(l=l>0?v-l:-v-l);const u=Math.log(Math.tan(l/2+v/4)/Math.tan(a/2+v/4)),c=Math.abs(u)>1e-11?s/u:Math.cos(a),h=n+i*Math.sin(o)/c,d=l.toDegrees(),p=h.toDegrees();return new M(d,p)}rhumbMidpointTo(t){t instanceof M||(t=M.parse(t));const e=this.lat.toRadians();let r=this.lon.toRadians();const a=t.lat.toRadians(),n=t.lon.toRadians();Math.abs(n-r)>v&&(r+=2*v);const o=(e+a)/2,i=Math.tan(v/4+e/2),s=Math.tan(v/4+a/2),l=Math.tan(v/4+o/2);let u=((n-r)*Math.log(l)+r*Math.log(s)-n*Math.log(i))/Math.log(s/i);isFinite(u)||(u=(r+n)/2);const c=o.toDegrees(),h=u.toDegrees();return new M(c,h)}static areaOf(t,e=6371e3){const r=e,a=t[0].equals(t[t.length-1]);a||t.push(t[0]);const n=t.length-1;let o=0;for(let e=0;e<n;e++){const r=t[e].lat.toRadians(),a=t[e+1].lat.toRadians(),n=(t[e+1].lon-t[e].lon).toRadians();o+=2*Math.atan2(Math.tan(n/2)*(Math.tan(r/2)+Math.tan(a/2)),1+Math.tan(r/2)*Math.tan(a/2))}(function(t){let e=0,r=t[0].initialBearingTo(t[1]);for(let a=0;a<t.length-1;a++){const n=t[a].initialBearingTo(t[a+1]),o=t[a].finalBearingTo(t[a+1]);e+=(n-r+540)%360-180,e+=(o-n+540)%360-180,r=o}const a=t[0].initialBearingTo(t[1]);e+=(a-r+540)%360-180;return Math.abs(e)<90})(t)&&(o=Math.abs(o)-2*v);const i=Math.abs(o*r*r);return a||t.pop(),i}equals(t){return t instanceof M||(t=M.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON)&&!(Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${m.toLat(this.lat,t,e)}, ${m.toLon(this.lon,t,e)}`}}function b(t,e,r){if(null!==t)for(var a,n,o,i,s,l,u,c,h=0,d=0,p=t.type,g="FeatureCollection"===p,f="Feature"===p,y=g?t.features.length:1,m=0;m<y;m++){s=(c=!!(u=g?t.features[m].geometry:f?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var M=0,w=0;if(null!==(i=c?u.geometries[v]:u)){l=i.coordinates;var x=i.type;switch(h=0,x){case null:break;case"Point":if(!1===e(l,d,m,M,w))return!1;d++,M++;break;case"LineString":case"MultiPoint":for(a=0;a<l.length;a++){if(!1===e(l[a],d,m,M,w))return!1;d++,"MultiPoint"===x&&M++}"LineString"===x&&M++;break;case"Polygon":case"MultiLineString":for(a=0;a<l.length;a++){for(n=0;n<l[a].length-h;n++){if(!1===e(l[a][n],d,m,M,w))return!1;d++}"MultiLineString"===x&&M++,"Polygon"===x&&w++}"Polygon"===x&&M++;break;case"MultiPolygon":for(a=0;a<l.length;a++){for(w=0,n=0;n<l[a].length;n++){for(o=0;o<l[a][n].length-h;o++){if(!1===e(l[a][n][o],d,m,M,w))return!1;d++}w++}M++}break;case"GeometryCollection":for(a=0;a<i.geometries.length;a++)if(!1===b(i.geometries[a],e))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var w=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return b(t,t=>{r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r},x=(t,e)=>{var[r,a]=t,[n,o]=e,i=new M(a,r),s=new M(o,n);return i.distanceTo(s)},P=t=>{var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var r=Number.parseFloat(e.toFixed(1)),a=1===r?"mile":"miles";return"".concat(r," ").concat(a)}var n=Math.round(e);return"".concat(n," miles")},N=(t,e,r)=>{var[a,n]=e,o=r.filter(e=>{var[r,o]=e;return(r!==a||o!==n)&&((t,e,r)=>{switch(t){case"ArrowUp":return r<0&&Math.abs(r)>=Math.abs(e);case"ArrowDown":return r>0&&Math.abs(r)>=Math.abs(e);case"ArrowLeft":return e<0&&Math.abs(e)>Math.abs(r);case"ArrowRight":return e>0&&Math.abs(e)>Math.abs(r);default:return!1}})(t,r-a,o-n)});if(!o.length)return r.findIndex(t=>t[0]===a&&t[1]===n);var i=-1,s=1/0;return o.forEach(t=>{var e=t[0]-a,o=t[1]-n,l=e*e+o*o;l<s&&(s=l,i=r.indexOf(t))}),i},S=t=>w(t);function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var O="highlighted-label";function R(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var{stops:r}=t;if(r.length<2)return r.length>0?r[0][1]:0;for(var a=r[0],n=r[r.length-1],o=1;o<r.length;o++){var i=r[o];if(i[0]>e){n=i,a=r[o-1];break}a=r[o-1],n=i}var[s,l]=a,[u,c]=n;return e<=s?l:e>=u?c:l+(e-s)/(u-s)*(c-l)}(t,e);var[,,r,...a]=t;if("zoom"!==r[0])throw new Error("Only zoom-based expressions supported");for(var n=0;n<a.length-2;n+=2){var o=a[n],i=a[n+1],s=a[n+2],l=a[n+3];if(e<=o)return i;if(e<=s)return i+(e-o)/(s-o)*(l-i)}return a[a.length-1]}function j(t,e,r){return e.flatMap(e=>{var a,n=function(t){var e,r;return"string"==typeof t?null===(e=/^{(.+)}$/.exec(t))||void 0===e?void 0:e[1]:Array.isArray(t)?null===(r=t.find(t=>Array.isArray(t)&&"get"===t[0]))||void 0===r?void 0:r[1]:null}(null===(a=e.layout)||void 0===a?void 0:a["text-field"]);return n?r.filter(t=>{var r;return t.layer.id===e.id&&(null===(r=t.properties)||void 0===r?void 0:r[n])}).map(r=>function(t,e,r,a){var n=function(t){var{type:e,coordinates:r}=t;if("Point"===e)return r;if("MultiPoint"===e)return r[0];if(e.includes("LineString")){var a="LineString"===e?r:r[0];return[(a[0][0]+a[a.length-1][0])/2,(a[0][1]+a[a.length-1][1])/2]}if(e.includes("Polygon")){var n="Polygon"===e?r[0]:r[0][0],o=n.reduce((t,e)=>[t[0]+e[0],t[1]+e[1]],[0,0]);return[o[0]/n.length,o[1]/n.length]}return null}(t.geometry);if(!n)return null;var o=a.project({lng:n[0],lat:n[1]});return{text:t.properties[r],x:o.x,y:o.y,feature:t,layer:e}}(r,e,n,t)).filter(Boolean):[]})}function T(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function D(t,e,r){var a;if(null!=e&&null!==(a=e.feature)&&void 0!==a&&a.layer){T(t,r);var{feature:n,layer:o}=e;r.highlightLayerId="highlight-".concat(o.id);var{id:i,type:s,properties:l,geometry:u}=n;t.getSource(O).setData({id:i,type:s,properties:l,geometry:u}),r.highlightedExpr=o.layout["text-size"];var c=t.getZoom(),h=function(t,e,r){return{id:"highlight-".concat(t.id),type:t.type,source:O,layout:L(L({},t.layout),{},{"text-size":e,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:L(L({},t.paint),{},{"text-color":r.text,"text-halo-color":r.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})}}(o,1.5*R(r.highlightedExpr,c),r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"});t.addLayer(h),t.moveLayer(r.highlightLayerId)}}function A(t){t.getSource(O)||t.addSource(O,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function C(t){t.getStyle().layers.filter(t=>{var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(e=>t.setLayoutProperty(e.id,"symbol-placement","line-center"))}function I(t,e,r,a){var n={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function o(){var e=t.getStyle().layers.filter(t=>"symbol"===t.type),r=t.queryRenderedFeatures({layers:e.map(t=>t.id)});n.labels=j(t,e,r)}function i(){if(o(),!n.labels.length)return null;var e=t.project(t.getCenter()),r=function(t,e){var r;return null===(r=t.reduce((t,r)=>{var a=(r.x-e.x)**2+(r.y-e.y)**2;return!t||a<t.dist?{label:r,dist:a}:t},null))||void 0===r?void 0:r.label}(n.labels,e);return n.currentPixel={x:r.x,y:r.y},D(t,r,n),"".concat(r.text," (").concat(r.layer.id,")")}return C(t),A(t),null==a||a.on(r.MAP_SET_STYLE,e=>{t.once("styledata",()=>t.once("idle",()=>{C(t),A(t),n.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)}))}),t.on("zoom",()=>{if(n.highlightLayerId&&n.highlightedExpr){var e=R(n.highlightedExpr,t.getZoom());t.setLayoutProperty(n.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(t=>"symbol"===t.type).forEach(e=>{t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:o,highlightNextLabel:function(e){if(o(),!n.labels.length)return null;if(!n.currentPixel)return i();var r=function(t,e){if(!e.currentPixel)return null;var r=e.labels.map((t,e)=>({pixel:[t.x,t.y],index:e})).filter(t=>t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y);if(!r.length)return null;var a=r.map(t=>t.pixel),n=N(t,[e.currentPixel.x,e.currentPixel.y],a);return(null==n||n<0||n>=r.length)&&(n=0),e.labels[r[n].index]}(e,n);return r?(n.currentPixel={x:r.x,y:r.y},D(t,r,n),"".concat(r.text," (").concat(r.layer.id,")")):null},highlightLabelAtCenter:i,clearHighlightedLabel:()=>T(t,n)}}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var B=(t,e,r,a,n,o,i)=>{t.getLayer(e)||t.addLayer(k(k({id:e,type:r,source:a},n&&{"source-layer":n}),{},{paint:o})),Object.entries(o).forEach(r=>{var[a,n]=r;t.setPaintProperty(e,a,n)}),t.setFilter(e,i),t.moveLayer(e)};function F(t){var{LngLatBounds:e,map:r,selectedFeatures:a,stylesMap:n}=t;if(!r)return null;var o=((t,e)=>{var r={};return null==e||e.forEach(e=>{var{featureId:a,layerId:n,idProperty:o,geometry:i}=e,s=t.getLayer(n);if(s){var l=s.source;r[l]||(r[l]={ids:new Set,fillIds:new Set,idProperty:o,layerId:n,hasFillGeometry:!1}),!i||"Polygon"!==i.type&&"MultiPolygon"!==i.type||(r[l].hasFillGeometry=!0,r[l].fillIds.add(a)),r[l].ids.add(a)}}),r})(r,a),i=[],s=new Set(Object.keys(o)),l=r._highlightedSources||new Set;return((t,e,r)=>{e.forEach(e=>{if(!r.has(e)){var a="highlight-".concat(e);["".concat(a,"-fill"),"".concat(a,"-line"),"".concat(a,"-symbol")].forEach(e=>{t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})})(r,l,s),r._highlightedSources=s,s.forEach(t=>{var{ids:e,fillIds:a,idProperty:s,layerId:l,hasFillGeometry:u}=o[t],c=r.getLayer(l),h=c.sourceLayer,d=u?"fill":c.type,p="highlight-".concat(t),g=s?["get",s]:["id"],f=["in",g,["literal",[...e]]];if("fill"===d){var{stroke:y,strokeWidth:m,fill:v}=n[l],M=["in",g,["literal",[...a]]],b={"line-color":y,"line-width":m};B(r,"".concat(p,"-fill"),"fill",t,h,{"fill-color":v},M),B(r,"".concat(p,"-line"),"line",t,h,b,f)}if("line"===d){var{stroke:w,strokeWidth:x}=n[l],P={"line-color":w,"line-width":x};r.getLayer("".concat(p,"-fill"))&&r.setFilter("".concat(p,"-fill"),["==","id",""]),B(r,"".concat(p,"-line"),"line",t,h,P,f)}if("symbol"===d){var N=r.getLayoutProperty(l,"icon-image"),S=((t,e)=>{var r,a;return null!==(r=null===(a=t._symbolImageMap)||void 0===a?void 0:a[e])&&void 0!==r?r:null})(r,N);S&&((t,e,r,a,n,o,i)=>{var s;t.getLayer(e)||t.addLayer(k(k({id:e,type:"symbol",source:r},a&&{"source-layer":a}),{},{layout:{"icon-image":o,"icon-anchor":null!==(s=t.getLayoutProperty(n,"icon-anchor"))&&void 0!==s?s:"center","icon-allow-overlap":!0}})),t.setLayoutProperty(e,"icon-image",o),t.setFilter(e,i),t.moveLayer(e)})(r,"".concat(p,"-symbol"),t,h,l,S,f)}i.push(...r.queryRenderedFeatures({layers:[l]}).filter(t=>{var r;return e.has(s?null===(r=t.properties)||void 0===r?void 0:r[s]:t.id)}))}),((t,e)=>{if(!e.length)return null;var r=new t;return e.forEach(t=>{var e=t=>"number"==typeof t[0]?r.extend(t):t.forEach(e);e(t.geometry.coordinates)}),[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]})(e,i)}var z=(t,e,r)=>{var a=(e.x-r.x)**2+(e.y-r.y)**2;if(0===a)return(t.x-e.x)**2+(t.y-e.y)**2;var n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/a;return n=Math.max(0,Math.min(1,n)),(t.x-(e.x+n*(r.x-e.x)))**2+(t.y-(e.y+n*(r.y-e.y)))**2},$=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{radius:a=10}=r,n=[[e.x-a,e.y-a],[e.x+a,e.y+a]],o=t.queryRenderedFeatures(n);if(0===o.length)return[];var i=new Set(t.queryRenderedFeatures([e.x,e.y]).map(t=>{var e,r=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(r)})),s=[];o.forEach(t=>{!1===s.includes(t.layer.id)&&s.push(t.layer.id)});for(var l=new Set,u=[],c=o.length-1;c>=0;c--){var h,d=o[c],p=void 0===d.id?JSON.stringify(d.properties):d.id,g="".concat(null===(h=d.layer)||void 0===h?void 0:h.source,":").concat(p);!1===l.has(g)&&(l.add(g),u.push(d))}var f=t.unproject(e),y=[f.lng,f.lat],m=u.filter(t=>{var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(t=>((t,e)=>{for(var[r,a]=t,n=!1,o=0,i=e.length-1;o<e.length;i=o,o++){var[s,l]=e[o],[u,c]=e[i];l>a!=c>a&&r<(u-s)*(a-l)/(c-l)+s&&(n=!n)}return n})(y,t[0]));if("Point"===e||"MultiPoint"===e){var r,a=void 0===t.id?JSON.stringify(t.properties):t.id;return i.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(a))}return!0});return m.map(r=>{var a=0,n=r.geometry.type,o=((t,e,r)=>{var{coordinates:a,type:n}=r,o=1/0,i=e=>t.project(e),s=t=>{for(var r=0;r<t.length-1;r++){var a=z(e,i(t[r]),i(t[r+1]));a<o&&(o=a)}};if("Point"===n){var l=i(a);o=(e.x-l.x)**2+(e.y-l.y)**2}else"LineString"===n||"MultiPoint"===n?"LineString"===n?s(a):a.forEach(t=>{var r=i(t),a=(e.x-r.x)**2+(e.y-r.y)**2;a<o&&(o=a)}):"Polygon"===n||"MultiLineString"===n?a.forEach(s):"MultiPolygon"===n&&a.forEach(t=>t.forEach(s));return o})(t,e,r.geometry);return a+=1e6*s.indexOf(r.layer.id),n.includes("Polygon")&&(a-=5e5),{f:r,score:a+=o}}).sort((t,e)=>t.score-e.score).map(t=>{var{f:e}=t;return e})},q=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),W=(t,e)=>t.symbolSvgContent?{svg:t.symbolSvgContent}:t.symbol?e.get(t.symbol):void 0,Z=t=>{if(!(t=>!(!t.symbol&&!t.symbolSvgContent))(t))return{};var e={};return q.forEach(r=>{if(null!=t[r]){var a=r.charAt(6).toLowerCase()+r.slice(7);e[a]=t[r]}}),e},G=(t,e,r)=>new Promise((a,n)=>{var o=new Blob([t],{type:"image/svg+xml"}),i=URL.createObjectURL(o),s=new Image(e,r);s.onload=()=>{var t=document.createElement("canvas");t.width=e,t.height=r;var n=t.getContext("2d");n.drawImage(s,0,0,e,r),URL.revokeObjectURL(i),a(n.getImageData(0,0,e,r))},s.onerror=()=>{URL.revokeObjectURL(i),n(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},s.src=i}),H=t=>{var e=0;for(var r of t)e=Math.trunc((e<<5)-e+r.codePointAt(0));return Math.abs(e).toString(36)},U=function(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,o=W(t,r);if(!o)return null;var i=Z(t),s=a?r.resolveSelected(o,i,e):r.resolve(o,i,e);return"symbol-".concat(a?"sel-":"").concat(H(s),"-").concat(n,"x")},V=new Map,J=function(){var t=i(function*(t,e,r,a,n){var o=W(t,r);if(!o)return null;var i=Z(t),s=a?r.resolveSelected(o,i,e):r.resolve(o,i,e),l="symbol-".concat(a?"sel-":"").concat(H(s),"-").concat(n,"x"),u=V.get(l);if(!u){var c=((t,e)=>{var r;return t.symbolViewBox?t.symbolViewBox:null!==(r=null==e?void 0:e.viewBox)&&void 0!==r?r:"0 0 38 38"})(t,o),[,,h,d]=c.split(" ").map(Number),p='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(h*n,'" height="').concat(d*n,'" viewBox="').concat(c,'">').concat(s,"</svg>");u=yield G(p,h*n,d*n),V.set(l,u)}return{imageId:l,imageData:u}});return function(e,r,a,n,o){return t.apply(this,arguments)}}(),Y=function(){var t=i(function*(t,e,r,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2;e.length&&(t._symbolImageMap={},yield Promise.all(e.flatMap(e=>{var o=U(e,r,a,!1,n),s=U(e,r,a,!0,n);return o&&s&&(t._symbolImageMap[o]=s),[!1,!0].map(function(){var l=i(function*(i){var l=i?s:o;if(l&&!t.hasImage(l)){var u=yield J(e,r,a,i,n);u&&!t.hasImage(u.imageId)&&t.addImage(u.imageId,u.imageData,{pixelRatio:n})}});return function(t){return l.apply(this,arguments)}}())})))});return function(e,r,a,n){return t.apply(this,arguments)}}(),K=(t,e)=>{if(!t)return null;if("string"==typeof t)return t.trim();if("object"==typeof t){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null},X=(t,e)=>{return t.fillPatternSvgContent?t.fillPatternSvgContent:t.fillPattern&&null!==(r=null==e||null===(a=e.get(t.fillPattern))||void 0===a?void 0:a.svgContent)&&void 0!==r?r:null;var r,a},Q=(t,e,r)=>{var a=X(t,r);if(!a)return null;var n=K(t.fillPatternForegroundColor,e)||"black",o=K(t.fillPatternBackgroundColor,e)||"transparent";return"pattern-".concat((t=>{var e=0;for(var r of t)e=(e<<5)-e+r.codePointAt(0),e&=e;return Math.abs(e).toString(36)})(a+n+o))},tt=new Map,et=function(){var t=i(function*(t,e,r){var a=X(t,r);if(!a)return null;var n=Q(t,e,r);if(!n)return null;var o,i,s=tt.get(n);if(!s){var l=K(t.fillPatternForegroundColor,e)||"black",u=K(t.fillPatternBackgroundColor,e)||"transparent",c=(o=l,i=u,a.replace(/\{\{foregroundColor\}\}/g,o||"black").replace(/\{\{backgroundColor\}\}/g,i||"transparent")),h='<rect width="16" height="16" fill="'.concat(u,'"/>'),d='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">'.concat(h).concat(c,"</svg>");s=yield G(d,16,16),tt.set(n,s)}return{imageId:n,imageData:s}});return function(e,r,a){return t.apply(this,arguments)}}(),rt=function(){var t=i(function*(t,e,r,a){e.length&&(yield Promise.all(e.map(function(){var e=i(function*(e){var n=Q(e,r,a);if(n&&!t.hasImage(n)){var o=yield et(e,r,a);o&&t.addImage(o.imageId,o.imageData,{pixelRatio:2})}});return function(t){return e.apply(this,arguments)}}())))});return function(e,r,a,n){return t.apply(this,arguments)}}(),at=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)}return r}function ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}class it{constructor(t){var{mapFramework:e,mapProviderConfig:r={},events:a,eventBus:n}=t;this.maplibreModule=e,this.events=a,this.eventBus=n,this.capabilities={supportedShortcuts:u,supportsMapSizes:!0},Object.assign(this,r)}initMap(t){var e=this;return i(function*(){var{container:r,padding:a,mapStyle:n,mapSize:i,center:s,zoom:l,bounds:u,pixelRatio:c}=t,h=o(t,at);e.mapStyleId=null==n?void 0:n.id,e.mapSize=i;var{Map:d}=e.maplibreModule,{events:p,eventBus:g}=e,y=new d(ot(ot({},h),{},{container:r,style:null==n?void 0:n.url,pixelRatio:c,padding:a,center:s,zoom:l,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}));y.touchZoomRotate.disableRotation(),e.map=y,e.map.setPadding(a),u&&y.fitBounds(u,{duration:0}),function(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var r=t.getCanvas();if(r&&(this.target===r||r.contains(this.target)))return}e.call(this)}}(y),function(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block"}(y),f({map:y,events:p,eventBus:g,getCenter:e.getCenter.bind(e),getZoom:e.getZoom.bind(e),getBounds:e.getBounds.bind(e),getResolution:e.getResolution.bind(e)}),function(t){var{mapProvider:e,map:r,events:a,eventBus:n}=t,o=t=>{r.once("style.load",()=>{n.emit(a.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},i=t=>{r.setPixelRatio(t)},s=t=>{var{mapSize:r}=t;e.mapSize=r};n.on(a.MAP_SET_STYLE,o),n.on(a.MAP_SET_PIXEL_RATIO,i),n.on(a.MAP_SIZE_CHANGE,s)}({mapProvider:e,map:y,events:p,eventBus:g}),y.on("load",()=>{e.labelNavigator=I(y,null==n?void 0:n.mapColorScheme,p,g)}),e.eventBus.emit(p.MAP_READY,{map:e.map,mapStyleId:e.mapStyleId,mapSize:e.mapSize,crs:e.crs})})()}destroyMap(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}setHoverCursor(t){this.map&&(this._onHoverMove=((t,e,r)=>{var a=t.getCanvas();if(r&&t.off("mousemove",r),null==e||!e.length)return a.style.cursor="",null;var n=r=>{var n=e.filter(e=>t.getLayer(e));if(0!==n.length){var{lineLayers:o,otherLayers:i}=((t,e)=>{var r=[],a=[];for(var n of e)if("line"===t.getLayer(n).type){var o=n.endsWith("-stroke")?n.slice(0,-7):null;null!==o&&e.includes(o)||r.push(n)}else a.push(n);return{lineLayers:r,otherLayers:a}})(t,n),{x:s,y:l}=r.point,u=[[s-10,l-10],[s+10,l+10]],c=o.length>0&&t.queryRenderedFeatures(u,{layers:o}).length>0,h=i.length>0&&t.queryRenderedFeatures(r.point,{layers:i}).length>0;a.style.cursor=c||h?"pointer":""}else a.style.cursor=""};return t.on("mousemove",n),n})(this.map,t,this._onHoverMove))}setView(t){var{center:e,zoom:r}=t;this.map.flyTo({center:e||this.getCenter(),zoom:r||this.getZoom(),duration:this.map.isStyleLoaded()?s:0})}zoomIn(t){this.map.easeTo({zoom:this.getZoom()+t,duration:s})}zoomOut(t){this.map.easeTo({zoom:this.getZoom()-t,duration:s})}panBy(t){this.map.panBy(t,{duration:s})}fitToBounds(t){var e=Array.isArray(t)?t:S(t),r=this.map.isStyleLoaded()?s:0;this.map.fitBounds(e,{duration:r})}setPadding(t){this.map.setPadding(t)}updateHighlightedFeatures(t,e){var{LngLatBounds:r}=this.maplibreModule;return F({LngLatBounds:r,map:this.map,selectedFeatures:t,stylesMap:e})}highlightNextLabel(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}highlightLabelAtCenter(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}clearHighlightedLabel(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}getCenter(){var t=this.map.getCenter();return[Number(t.lng.toFixed(l)),Number(t.lat.toFixed(l))]}getZoom(){return Number(this.map.getZoom().toFixed(l))}getBounds(){return this.map.getBounds().toArray().flat(1)}getFeaturesAtPoint(t,e){return $(this.map,t,e)}registerSymbols(t,e,r){var a=this;return i(function*(){var n=(a.map.getPixelRatio()||1)*(p[a.mapSize]||1);return Y(a.map,t,e,r,n)})()}registerPatterns(t,e,r){var a=this;return i(function*(){return rt(a.map,t,e,r)})()}getAreaDimensions(){var{LngLatBounds:t}=this.maplibreModule;return(t=>{var e,r,a,n;if(t&&"function"==typeof t.getWest)e=t.getWest(),r=t.getSouth(),a=t.getEast(),n=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";[[e,r],[a,n]]=t}var o=x([e,r],[a,r]),i=x([e,r],[e,n]),s=P(o),l=P(i);return"".concat(l," by ").concat(s)})(((t,e)=>{var{width:r,height:a}=e.getContainer().getBoundingClientRect(),n=e.getPadding(),o=[n.left,a-n.bottom],i=[r-n.right,n.top];return new t(e.unproject(o),e.unproject(i))})(t,this.map))}getCardinalMove(t,e){return((t,e)=>{var[r,a]=t,[n,o]=e,i=o-a,s=n-r,l=[];if(Math.abs(i)>1e-4){var u=Math.round(x([r,a],[r,o]));l.push("".concat(i>0?"north":"south"," ").concat(P(u)))}if(Math.abs(s)>1e-4){var c=Math.round(x([r,a],[n,a]));l.push("".concat(s>0?"east":"west"," ").concat(P(c)))}return l.join(", ")})(t,e)}getResolution(){return t=this.map.getCenter(),e=this.map.getZoom(),r=t.lat,a=Math.pow(2,e),40075016.686*Math.cos(r*Math.PI/180)/(512*a);var t,e,r,a}mapToScreen(t){return this.map.project(t)}screenToMap(t){var{lng:e,lat:r}=this.map.unproject([t.x,t.y]);return[e,r]}isGeometryObscured(t,e){return((t,e,r)=>{var a=r.getContainer().getBoundingClientRect(),[n,o,i,s]=S(t),l=[r.project([n,o]),r.project([n,s]),r.project([i,o]),r.project([i,s])],u=Math.min(...l.map(t=>t.x)),c=Math.max(...l.map(t=>t.x)),h=Math.min(...l.map(t=>t.y)),d=Math.max(...l.map(t=>t.y)),p=e.left-a.left,g=e.top-a.top,f=e.right-a.left,y=e.bottom-a.top;return u<f&&c>p&&h<y&&d>g})(t,e,this.map)}}export{it as default};
1
+ import{useContext as t,createContext as e}from"preact/compat";import{jsx as r,jsxs as a}from"preact/jsx-runtime";import n from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/objectWithoutProperties";import i from"@babel/runtime/helpers/asyncToGenerator";var s=400,l=7,u=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];new Set;function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var d={slot:"middle",open:!1,dismissible:!0,modal:!0};h({},d),h(h({},d),{},{width:"500px"}),h(h({},d),{},{width:"500px"});var p={small:1,medium:1.5,large:2};var g=(t,e)=>{var r=null,a=function(){for(var a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];clearTimeout(r),r=setTimeout(()=>{t(...n)},e)};return a.cancel=()=>{r&&(clearTimeout(r),r=null)},a};function f(t){var{map:e,events:r,eventBus:a,getCenter:n,getZoom:o,getBounds:i,getResolution:s}=t,l=[],u=[],c=()=>{var t=o();return{center:n(),bounds:i(),resolution:s(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},h=(t,e)=>a.emit(t,e),d=()=>h(r.MAP_LOADED);e.on("load",d),l.push(["load",d]);e.once("idle",()=>h(r.MAP_FIRST_IDLE,c()));var p=()=>h(r.MAP_MOVE_START);e.on("movestart",p),l.push(["movestart",p]);var f=g(()=>{h(r.MAP_MOVE_END,c())},500);e.on("moveend",f),l.push(["moveend",f]),u.push(f);var y,m,v,M=(y=()=>{h(r.MAP_MOVE,c())},m=10,v=0,function(){var t=Date.now();t-v>=m&&(v=t,y(...arguments))});e.on("zoom",M),l.push(["zoom",M]),u.push(M);var b=()=>h(r.MAP_RENDER);e.on("render",b),l.push(["render",b]);var w=g(()=>{h(r.MAP_DATA_CHANGE,c())},500);e.on("styledata",w),l.push(["styledata",w]),u.push(w);var x=()=>h(r.MAP_STYLE_CHANGE);e.on("style.load",x),l.push(["style.load",x]);var P=t=>h(r.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]});return e.on("click",P),l.push(["click",P]),{remove(){u.forEach(t=>t.cancel()),l.forEach(t=>{var[r,a]=t;return e.off(r,a)})}}}let y=" ";class m{static get separator(){return y}static set separator(t){y=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let a=null,n=null,o=null,i=null;switch(e){default:case"d":case"deg":n=t.toFixed(r),n<100&&(n="0"+n),n<10&&(n="0"+n),a=n+"°";break;case"dm":case"deg+min":n=Math.floor(t),o=(60*t%60).toFixed(r),60==o&&(o=(0).toFixed(r),n++),n=("000"+n).slice(-3),o<10&&(o="0"+o),a=n+"°"+m.separator+o+"′";break;case"dms":case"deg+min+sec":n=Math.floor(t),o=Math.floor(3600*t/60)%60,i=(3600*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),o++),60==o&&(o=0,n++),n=("000"+n).slice(-3),o=("00"+o).slice(-2),i<10&&(i="0"+i),a=n+"°"+m.separator+o+"′"+m.separator+i+"″"}return a}static toLat(t,e,r){const a=m.toDms(m.wrap90(t),e,r);return null===a?"–":a.slice(1)+m.separator+(t<0?"S":"N")}static toLon(t,e,r){const a=m.toDms(m.wrap180(t),e,r);return null===a?"–":a+m.separator+(t<0?"W":"E")}static toBrng(t,e,r){const a=m.toDms(m.wrap360(t),e,r);return null===a?"–":a.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=m.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t,r=360;return 1*Math.abs(((e-90)%r+r)%r-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const v=Math.PI;class M{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=m.wrap90(Number(t)),this._lon=m.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?m.wrap90(m.parse(t)):m.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?m.wrap90(m.parse(t)):m.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?m.wrap180(m.parse(t)):m.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?m.wrap180(m.parse(t)):m.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?m.wrap180(m.parse(t)):m.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,r;if(2==t.length&&([e,r]=t,e=m.wrap90(m.parse(e)),r=m.wrap180(m.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,r]=t[0].split(","),e=m.wrap90(m.parse(e)),r=m.wrap180(m.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const a=t[0];if("Point"==a.type&&Array.isArray(a.coordinates)?[r,e]=a.coordinates:(null!=a.latitude&&(e=a.latitude),null!=a.lat&&(e=a.lat),null!=a.longitude&&(r=a.longitude),null!=a.lng&&(r=a.lng),null!=a.lon&&(r=a.lon),e=m.wrap90(m.parse(e)),r=m.wrap180(m.parse(r))),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${t.toString()}’`);return new M(e,r)}distanceTo(t,e=6371e3){if(t instanceof M||(t=M.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const r=e,a=this.lat.toRadians(),n=this.lon.toRadians(),o=t.lat.toRadians(),i=o-a,s=t.lon.toRadians()-n,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(a)*Math.cos(o)*Math.sin(s/2)*Math.sin(s/2);return r*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof M||(t=M.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians(),a=(t.lon-this.lon).toRadians(),n=Math.cos(e)*Math.sin(r)-Math.sin(e)*Math.cos(r)*Math.cos(a),o=Math.sin(a)*Math.cos(r),i=Math.atan2(o,n).toDegrees();return m.wrap360(i)}finalBearingTo(t){t instanceof M||(t=M.parse(t));const e=t.initialBearingTo(this)+180;return m.wrap360(e)}midpointTo(t){t instanceof M||(t=M.parse(t));const e=this.lat.toRadians(),r=this.lon.toRadians(),a=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),o=Math.cos(e),i=0,s=Math.sin(e),l={x:o+Math.cos(a)*Math.cos(n),y:i+Math.cos(a)*Math.sin(n),z:s+Math.sin(a)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),c=r+Math.atan2(l.y,l.x),h=u.toDegrees(),d=c.toDegrees();return new M(h,d)}intermediatePointTo(t,e){if(t instanceof M||(t=M.parse(t)),this.equals(t))return new M(this.lat,this.lon);const r=this.lat.toRadians(),a=this.lon.toRadians(),n=t.lat.toRadians(),o=t.lon.toRadians(),i=n-r,s=o-a,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(r)*Math.cos(n)*Math.sin(s/2)*Math.sin(s/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),c=Math.sin((1-e)*u)/Math.sin(u),h=Math.sin(e*u)/Math.sin(u),d=c*Math.cos(r)*Math.cos(a)+h*Math.cos(n)*Math.cos(o),p=c*Math.cos(r)*Math.sin(a)+h*Math.cos(n)*Math.sin(o),g=c*Math.sin(r)+h*Math.sin(n),f=Math.atan2(g,Math.sqrt(d*d+p*p)),y=Math.atan2(p,d),m=f.toDegrees(),v=y.toDegrees();return new M(m,v)}destinationPoint(t,e,r=6371e3){const a=t/r,n=Number(e).toRadians(),o=this.lat.toRadians(),i=this.lon.toRadians(),s=Math.sin(o)*Math.cos(a)+Math.cos(o)*Math.sin(a)*Math.cos(n),l=Math.asin(s),u=Math.sin(n)*Math.sin(a)*Math.cos(o),c=Math.cos(a)-Math.sin(o)*s,h=i+Math.atan2(u,c),d=l.toDegrees(),p=h.toDegrees();return new M(d,p)}static intersection(t,e,r,a){if(t instanceof M||(t=M.parse(t)),r instanceof M||(r=M.parse(r)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(a))throw new TypeError(`invalid brng2 ‘${a}’`);const n=t.lat.toRadians(),o=t.lon.toRadians(),i=r.lat.toRadians(),s=r.lon.toRadians(),l=Number(e).toRadians(),u=Number(a).toRadians(),c=i-n,h=s-o,d=2*Math.asin(Math.sqrt(Math.sin(c/2)*Math.sin(c/2)+Math.cos(n)*Math.cos(i)*Math.sin(h/2)*Math.sin(h/2)));if(Math.abs(d)<Number.EPSILON)return new M(t.lat,t.lon);const p=(Math.sin(i)-Math.sin(n)*Math.cos(d))/(Math.sin(d)*Math.cos(n)),g=(Math.sin(n)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),f=Math.acos(Math.min(Math.max(p,-1),1)),y=Math.acos(Math.min(Math.max(g,-1),1)),m=l-(Math.sin(s-o)>0?f:2*v-f),b=(Math.sin(s-o)>0?2*v-y:y)-u;if(0==Math.sin(m)&&0==Math.sin(b))return null;if(Math.sin(m)*Math.sin(b)<0)return null;const w=-Math.cos(m)*Math.cos(b)+Math.sin(m)*Math.sin(b)*Math.cos(d),x=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(b),Math.cos(b)+Math.cos(m)*w),P=Math.asin(Math.min(Math.max(Math.sin(n)*Math.cos(x)+Math.cos(n)*Math.sin(x)*Math.cos(l),-1),1)),N=o+Math.atan2(Math.sin(l)*Math.sin(x)*Math.cos(n),Math.cos(x)-Math.sin(n)*Math.sin(P)),S=P.toDegrees(),E=N.toDegrees();return new M(S,E)}crossTrackDistanceTo(t,e,r=6371e3){t instanceof M||(t=M.parse(t)),e instanceof M||(e=M.parse(e));const a=r;if(this.equals(t))return 0;const n=t.distanceTo(this,a)/a,o=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(n)*Math.sin(o-i))*a}alongTrackDistanceTo(t,e,r=6371e3){t instanceof M||(t=M.parse(t)),e instanceof M||(e=M.parse(e));const a=r;if(this.equals(t))return 0;const n=t.distanceTo(this,a)/a,o=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(n)*Math.sin(o-i));return Math.acos(Math.cos(n)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(i-o))*a}maxLatitude(t){const e=Number(t).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(r))).toDegrees()}static crossingParallels(t,e,r){if(t.equals(e))return null;const a=Number(r).toRadians(),n=t.lat.toRadians(),o=t.lon.toRadians(),i=e.lat.toRadians(),s=e.lon.toRadians()-o,l=Math.sin(n)*Math.cos(i)*Math.cos(a)*Math.sin(s),u=Math.sin(n)*Math.cos(i)*Math.cos(a)*Math.cos(s)-Math.cos(n)*Math.sin(i)*Math.cos(a),c=Math.cos(n)*Math.cos(i)*Math.sin(a)*Math.sin(s);if(c*c>l*l+u*u)return null;const h=Math.atan2(-u,l),d=Math.acos(c/Math.sqrt(l*l+u*u)),p=o+h+d,g=(o+h-d).toDegrees(),f=p.toDegrees();return{lon1:m.wrap180(g),lon2:m.wrap180(f)}}rhumbDistanceTo(t,e=6371e3){t instanceof M||(t=M.parse(t));const r=e,a=this.lat.toRadians(),n=t.lat.toRadians(),o=n-a;let i=Math.abs(t.lon-this.lon).toRadians();Math.abs(i)>v&&(i=i>0?-(2*v-i):2*v+i);const s=Math.log(Math.tan(n/2+v/4)/Math.tan(a/2+v/4)),l=Math.abs(s)>1e-11?o/s:Math.cos(a);return Math.sqrt(o*o+l*l*i*i)*r}rhumbBearingTo(t){if(t instanceof M||(t=M.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians();let a=(t.lon-this.lon).toRadians();Math.abs(a)>v&&(a=a>0?-(2*v-a):2*v+a);const n=Math.log(Math.tan(r/2+v/4)/Math.tan(e/2+v/4)),o=Math.atan2(a,n).toDegrees();return m.wrap360(o)}rhumbDestinationPoint(t,e,r=6371e3){const a=this.lat.toRadians(),n=this.lon.toRadians(),o=Number(e).toRadians(),i=t/r,s=i*Math.cos(o);let l=a+s;Math.abs(l)>v/2&&(l=l>0?v-l:-v-l);const u=Math.log(Math.tan(l/2+v/4)/Math.tan(a/2+v/4)),c=Math.abs(u)>1e-11?s/u:Math.cos(a),h=n+i*Math.sin(o)/c,d=l.toDegrees(),p=h.toDegrees();return new M(d,p)}rhumbMidpointTo(t){t instanceof M||(t=M.parse(t));const e=this.lat.toRadians();let r=this.lon.toRadians();const a=t.lat.toRadians(),n=t.lon.toRadians();Math.abs(n-r)>v&&(r+=2*v);const o=(e+a)/2,i=Math.tan(v/4+e/2),s=Math.tan(v/4+a/2),l=Math.tan(v/4+o/2);let u=((n-r)*Math.log(l)+r*Math.log(s)-n*Math.log(i))/Math.log(s/i);isFinite(u)||(u=(r+n)/2);const c=o.toDegrees(),h=u.toDegrees();return new M(c,h)}static areaOf(t,e=6371e3){const r=e,a=t[0].equals(t[t.length-1]);a||t.push(t[0]);const n=t.length-1;let o=0;for(let e=0;e<n;e++){const r=t[e].lat.toRadians(),a=t[e+1].lat.toRadians(),n=(t[e+1].lon-t[e].lon).toRadians();o+=2*Math.atan2(Math.tan(n/2)*(Math.tan(r/2)+Math.tan(a/2)),1+Math.tan(r/2)*Math.tan(a/2))}(function(t){let e=0,r=t[0].initialBearingTo(t[1]);for(let a=0;a<t.length-1;a++){const n=t[a].initialBearingTo(t[a+1]),o=t[a].finalBearingTo(t[a+1]);e+=(n-r+540)%360-180,e+=(o-n+540)%360-180,r=o}const a=t[0].initialBearingTo(t[1]);e+=(a-r+540)%360-180;return Math.abs(e)<90})(t)&&(o=Math.abs(o)-2*v);const i=Math.abs(o*r*r);return a||t.pop(),i}equals(t){return t instanceof M||(t=M.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON)&&!(Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${m.toLat(this.lat,t,e)}, ${m.toLon(this.lon,t,e)}`}}function b(t,e,r){if(null!==t)for(var a,n,o,i,s,l,u,c,h=0,d=0,p=t.type,g="FeatureCollection"===p,f="Feature"===p,y=g?t.features.length:1,m=0;m<y;m++){s=(c=!!(u=g?t.features[m].geometry:f?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var M=0,w=0;if(null!==(i=c?u.geometries[v]:u)){l=i.coordinates;var x=i.type;switch(h=0,x){case null:break;case"Point":if(!1===e(l,d,m,M,w))return!1;d++,M++;break;case"LineString":case"MultiPoint":for(a=0;a<l.length;a++){if(!1===e(l[a],d,m,M,w))return!1;d++,"MultiPoint"===x&&M++}"LineString"===x&&M++;break;case"Polygon":case"MultiLineString":for(a=0;a<l.length;a++){for(n=0;n<l[a].length-h;n++){if(!1===e(l[a][n],d,m,M,w))return!1;d++}"MultiLineString"===x&&M++,"Polygon"===x&&w++}"Polygon"===x&&M++;break;case"MultiPolygon":for(a=0;a<l.length;a++){for(w=0,n=0;n<l[a].length;n++){for(o=0;o<l[a][n].length-h;o++){if(!1===e(l[a][n][o],d,m,M,w))return!1;d++}w++}M++}break;case"GeometryCollection":for(a=0;a<i.geometries.length;a++)if(!1===b(i.geometries[a],e))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var w=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return b(t,t=>{r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r},x=(t,e)=>{var[r,a]=t,[n,o]=e,i=new M(a,r),s=new M(o,n);return i.distanceTo(s)},P=t=>{var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var r=Number.parseFloat(e.toFixed(1)),a=1===r?"mile":"miles";return"".concat(r," ").concat(a)}var n=Math.round(e);return"".concat(n," miles")},N=(t,e,r)=>{var[a,n]=e,o=r.filter(e=>{var[r,o]=e;return(r!==a||o!==n)&&((t,e,r)=>{switch(t){case"ArrowUp":return r<0&&Math.abs(r)>=Math.abs(e);case"ArrowDown":return r>0&&Math.abs(r)>=Math.abs(e);case"ArrowLeft":return e<0&&Math.abs(e)>Math.abs(r);case"ArrowRight":return e>0&&Math.abs(e)>Math.abs(r);default:return!1}})(t,r-a,o-n)});if(!o.length)return r.findIndex(t=>t[0]===a&&t[1]===n);var i=-1,s=1/0;return o.forEach(t=>{var e=t[0]-a,o=t[1]-n,l=e*e+o*o;l<s&&(s=l,i=r.indexOf(t))}),i},S=t=>w(t);function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var O="highlighted-label";function R(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var{stops:r}=t;if(r.length<2)return r.length>0?r[0][1]:0;for(var a=r[0],n=r[r.length-1],o=1;o<r.length;o++){var i=r[o];if(i[0]>e){n=i,a=r[o-1];break}a=r[o-1],n=i}var[s,l]=a,[u,c]=n;return e<=s?l:e>=u?c:l+(e-s)/(u-s)*(c-l)}(t,e);var[,,r,...a]=t;if("zoom"!==r[0])throw new Error("Only zoom-based expressions supported");for(var n=0;n<a.length-2;n+=2){var o=a[n],i=a[n+1],s=a[n+2],l=a[n+3];if(e<=o)return i;if(e<=s)return i+(e-o)/(s-o)*(l-i)}return a[a.length-1]}function j(t,e,r){return e.flatMap(e=>{var a,n=function(t){var e,r;return"string"==typeof t?null===(e=/^{(.+)}$/.exec(t))||void 0===e?void 0:e[1]:Array.isArray(t)?null===(r=t.find(t=>Array.isArray(t)&&"get"===t[0]))||void 0===r?void 0:r[1]:null}(null===(a=e.layout)||void 0===a?void 0:a["text-field"]);return n?r.filter(t=>{var r;return t.layer.id===e.id&&(null===(r=t.properties)||void 0===r?void 0:r[n])}).map(r=>function(t,e,r,a){var n=function(t){var{type:e,coordinates:r}=t;if("Point"===e)return r;if("MultiPoint"===e)return r[0];if(e.includes("LineString")){var a="LineString"===e?r:r[0];return[(a[0][0]+a[a.length-1][0])/2,(a[0][1]+a[a.length-1][1])/2]}if(e.includes("Polygon")){var n="Polygon"===e?r[0]:r[0][0],o=n.reduce((t,e)=>[t[0]+e[0],t[1]+e[1]],[0,0]);return[o[0]/n.length,o[1]/n.length]}return null}(t.geometry);if(!n)return null;var o=a.project({lng:n[0],lat:n[1]});return{text:t.properties[r],x:o.x,y:o.y,feature:t,layer:e}}(r,e,n,t)).filter(Boolean):[]})}function T(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function D(t,e,r){var a;if(null!=e&&null!==(a=e.feature)&&void 0!==a&&a.layer){T(t,r);var{feature:n,layer:o}=e;r.highlightLayerId="highlight-".concat(o.id);var{id:i,type:s,properties:l,geometry:u}=n;t.getSource(O).setData({id:i,type:s,properties:l,geometry:u}),r.highlightedExpr=o.layout["text-size"];var c=t.getZoom(),h=function(t,e,r){return{id:"highlight-".concat(t.id),type:t.type,source:O,layout:L(L({},t.layout),{},{"text-size":e,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:L(L({},t.paint),{},{"text-color":r.text,"text-halo-color":r.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})}}(o,1.5*R(r.highlightedExpr,c),r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"});t.addLayer(h),t.moveLayer(r.highlightLayerId)}}function A(t){t.getSource(O)||t.addSource(O,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function C(t){t.getStyle().layers.filter(t=>{var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(e=>t.setLayoutProperty(e.id,"symbol-placement","line-center"))}function I(t,e,r,a){var n={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function o(){var e=t.getStyle().layers.filter(t=>"symbol"===t.type),r=t.queryRenderedFeatures({layers:e.map(t=>t.id)});n.labels=j(t,e,r)}function i(){if(o(),!n.labels.length)return null;var e=t.project(t.getCenter()),r=function(t,e){var r;return null===(r=t.reduce((t,r)=>{var a=(r.x-e.x)**2+(r.y-e.y)**2;return!t||a<t.dist?{label:r,dist:a}:t},null))||void 0===r?void 0:r.label}(n.labels,e);return n.currentPixel={x:r.x,y:r.y},D(t,r,n),"".concat(r.text," (").concat(r.layer.id,")")}return C(t),A(t),null==a||a.on(r.MAP_SET_STYLE,e=>{t.once("styledata",()=>t.once("idle",()=>{C(t),A(t),n.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)}))}),t.on("zoom",()=>{if(n.highlightLayerId&&n.highlightedExpr){var e=R(n.highlightedExpr,t.getZoom());t.setLayoutProperty(n.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(t=>"symbol"===t.type).forEach(e=>{t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:o,highlightNextLabel:function(e){if(o(),!n.labels.length)return null;if(!n.currentPixel)return i();var r=function(t,e){if(!e.currentPixel)return null;var r=e.labels.map((t,e)=>({pixel:[t.x,t.y],index:e})).filter(t=>t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y);if(!r.length)return null;var a=r.map(t=>t.pixel),n=N(t,[e.currentPixel.x,e.currentPixel.y],a);return(null==n||n<0||n>=r.length)&&(n=0),e.labels[r[n].index]}(e,n);return r?(n.currentPixel={x:r.x,y:r.y},D(t,r,n),"".concat(r.text," (").concat(r.layer.id,")")):null},highlightLabelAtCenter:i,clearHighlightedLabel:()=>T(t,n)}}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var B=(t,e,r,a,n,o,i)=>{t.getLayer(e)||t.addLayer(k(k({id:e,type:r,source:a},n&&{"source-layer":n}),{},{paint:o})),Object.entries(o).forEach(r=>{var[a,n]=r;t.setPaintProperty(e,a,n)}),t.setFilter(e,i),t.moveLayer(e)};function F(t){var{LngLatBounds:e,map:r,selectedFeatures:a,stylesMap:n}=t;if(!r)return null;var o=((t,e)=>{var r={};return null==e||e.forEach(e=>{var{featureId:a,layerId:n,idProperty:o,geometry:i}=e,s=t.getLayer(n);if(s){var l=s.source;r[l]||(r[l]={ids:new Set,fillIds:new Set,idProperty:o,layerId:n,hasFillGeometry:!1}),!i||"Polygon"!==i.type&&"MultiPolygon"!==i.type||(r[l].hasFillGeometry=!0,r[l].fillIds.add(a)),r[l].ids.add(a)}}),r})(r,a),i=[],s=new Set(Object.keys(o)),l=r._highlightedSources||new Set;return((t,e,r)=>{e.forEach(e=>{if(!r.has(e)){var a="highlight-".concat(e);["".concat(a,"-fill"),"".concat(a,"-line"),"".concat(a,"-symbol")].forEach(e=>{t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})})(r,l,s),r._highlightedSources=s,s.forEach(t=>{var{ids:e,fillIds:a,idProperty:s,layerId:l,hasFillGeometry:u}=o[t],c=r.getLayer(l),h=c.sourceLayer,d=u?"fill":c.type,p="highlight-".concat(t),g=s?["get",s]:["id"],f=["in",g,["literal",[...e]]];if("fill"===d){var{stroke:y,strokeWidth:m,fill:v}=n[l],M=["in",g,["literal",[...a]]],b={"line-color":y,"line-width":m};B(r,"".concat(p,"-fill"),"fill",t,h,{"fill-color":v},M),B(r,"".concat(p,"-line"),"line",t,h,b,f)}if("line"===d){var{stroke:w,strokeWidth:x}=n[l],P={"line-color":w,"line-width":x};r.getLayer("".concat(p,"-fill"))&&r.setFilter("".concat(p,"-fill"),["==","id",""]),B(r,"".concat(p,"-line"),"line",t,h,P,f)}if("symbol"===d){var N=r.getLayoutProperty(l,"icon-image"),S=((t,e)=>{var r,a;return null!==(r=null===(a=t._symbolImageMap)||void 0===a?void 0:a[e])&&void 0!==r?r:null})(r,N);S&&((t,e,r,a,n,o,i)=>{var s;t.getLayer(e)||t.addLayer(k(k({id:e,type:"symbol",source:r},a&&{"source-layer":a}),{},{layout:{"icon-image":o,"icon-anchor":null!==(s=t.getLayoutProperty(n,"icon-anchor"))&&void 0!==s?s:"center","icon-allow-overlap":!0}})),t.setLayoutProperty(e,"icon-image",o),t.setFilter(e,i),t.moveLayer(e)})(r,"".concat(p,"-symbol"),t,h,l,S,f)}i.push(...r.queryRenderedFeatures({layers:[l]}).filter(t=>{var r;return e.has(s?null===(r=t.properties)||void 0===r?void 0:r[s]:t.id)}))}),((t,e)=>{if(!e.length)return null;var r=new t;return e.forEach(t=>{var e=t=>"number"==typeof t[0]?r.extend(t):t.forEach(e);e(t.geometry.coordinates)}),[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]})(e,i)}var z=(t,e,r)=>{var a=(e.x-r.x)**2+(e.y-r.y)**2;if(0===a)return(t.x-e.x)**2+(t.y-e.y)**2;var n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/a;return n=Math.max(0,Math.min(1,n)),(t.x-(e.x+n*(r.x-e.x)))**2+(t.y-(e.y+n*(r.y-e.y)))**2},$=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{radius:a=10}=r,n=[[e.x-a,e.y-a],[e.x+a,e.y+a]],o=t.queryRenderedFeatures(n);if(0===o.length)return[];var i=new Set(t.queryRenderedFeatures([e.x,e.y]).map(t=>{var e,r=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(r)})),s=[];o.forEach(t=>{!1===s.includes(t.layer.id)&&s.push(t.layer.id)});for(var l=new Set,u=[],c=o.length-1;c>=0;c--){var h,d=o[c],p=void 0===d.id?JSON.stringify(d.properties):d.id,g="".concat(null===(h=d.layer)||void 0===h?void 0:h.source,":").concat(p);!1===l.has(g)&&(l.add(g),u.push(d))}var f=t.unproject(e),y=[f.lng,f.lat],m=u.filter(t=>{var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(t=>((t,e)=>{for(var[r,a]=t,n=!1,o=0,i=e.length-1;o<e.length;i=o,o++){var[s,l]=e[o],[u,c]=e[i];l>a!=c>a&&r<(u-s)*(a-l)/(c-l)+s&&(n=!n)}return n})(y,t[0]));if("Point"===e||"MultiPoint"===e){var r,a=void 0===t.id?JSON.stringify(t.properties):t.id;return i.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(a))}return!0});return m.map(r=>{var a=0,n=r.geometry.type,o=((t,e,r)=>{var{coordinates:a,type:n}=r,o=1/0,i=e=>t.project(e),s=t=>{for(var r=0;r<t.length-1;r++){var a=z(e,i(t[r]),i(t[r+1]));a<o&&(o=a)}};if("Point"===n){var l=i(a);o=(e.x-l.x)**2+(e.y-l.y)**2}else"LineString"===n||"MultiPoint"===n?"LineString"===n?s(a):a.forEach(t=>{var r=i(t),a=(e.x-r.x)**2+(e.y-r.y)**2;a<o&&(o=a)}):"Polygon"===n||"MultiLineString"===n?a.forEach(s):"MultiPolygon"===n&&a.forEach(t=>t.forEach(s));return o})(t,e,r.geometry);return a+=1e6*s.indexOf(r.layer.id),n.includes("Polygon")&&(a-=5e5),{f:r,score:a+=o}}).sort((t,e)=>t.score-e.score).map(t=>{var{f:e}=t;return e})},q=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),W=(t,e)=>t.symbolSvgContent?{svg:t.symbolSvgContent}:t.symbol?e.get(t.symbol):void 0,Z=t=>{if(!(t=>!(!t.symbol&&!t.symbolSvgContent))(t))return{};var e={};return q.forEach(r=>{if(null!=t[r]){var a=r.charAt(6).toLowerCase()+r.slice(7);e[a]=t[r]}}),e},G=(t,e,r)=>new Promise((a,n)=>{var o=new Blob([t],{type:"image/svg+xml"}),i=URL.createObjectURL(o),s=new Image(e,r);s.onload=()=>{var t=document.createElement("canvas");t.width=e,t.height=r;var n=t.getContext("2d");n.drawImage(s,0,0,e,r),URL.revokeObjectURL(i),a(n.getImageData(0,0,e,r))},s.onerror=()=>{URL.revokeObjectURL(i),n(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},s.src=i}),H=t=>{var e=0;for(var r of t)e=Math.trunc((e<<5)-e+r.codePointAt(0));return Math.abs(e).toString(36)},U=function(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,o=W(t,r);if(!o)return null;var i=Z(t),s=a?r.resolveSelected(o,i,e):r.resolve(o,i,e);return"symbol-".concat(a?"sel-":"").concat(H(s),"-").concat(n,"x")},V=new Map,J=function(){var t=i(function*(t,e,r,a,n){var o=W(t,r);if(!o)return null;var i=Z(t),s=a?r.resolveSelected(o,i,e):r.resolve(o,i,e),l="symbol-".concat(a?"sel-":"").concat(H(s),"-").concat(n,"x"),u=V.get(l);if(!u){var c=((t,e)=>{var r;return t.symbolViewBox?t.symbolViewBox:null!==(r=null==e?void 0:e.viewBox)&&void 0!==r?r:"0 0 38 38"})(t,o),[,,h,d]=c.split(" ").map(Number),p='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(h*n,'" height="').concat(d*n,'" viewBox="').concat(c,'">').concat(s,"</svg>");u=yield G(p,h*n,d*n),V.set(l,u)}return{imageId:l,imageData:u}});return function(e,r,a,n,o){return t.apply(this,arguments)}}(),Y=function(){var t=i(function*(t,e,r,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2;e.length&&(t._symbolImageMap={},yield Promise.all(e.flatMap(e=>{var o=U(e,r,a,!1,n),s=U(e,r,a,!0,n);return o&&s&&(t._symbolImageMap[o]=s),[!1,!0].map(function(){var l=i(function*(i){var l=i?s:o;if(l&&!t.hasImage(l)){var u=yield J(e,r,a,i,n);u&&!t.hasImage(u.imageId)&&t.addImage(u.imageId,u.imageData,{pixelRatio:n})}});return function(t){return l.apply(this,arguments)}}())})))});return function(e,r,a,n){return t.apply(this,arguments)}}(),K=(t,e)=>{if(!t)return null;if("string"==typeof t)return t.trim();if("object"==typeof t){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null},X=(t,e)=>{return t.fillPatternSvgContent?t.fillPatternSvgContent:t.fillPattern&&null!==(r=null==e||null===(a=e.get(t.fillPattern))||void 0===a?void 0:a.svgContent)&&void 0!==r?r:null;var r,a},Q=function(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=X(t,r);if(!n)return null;var o=K(t.fillPatternForegroundColor,e)||"black",i=K(t.fillPatternBackgroundColor,e)||"transparent",s=Math.max(2,a);return"pattern-".concat((t=>{var e=0;for(var r of t)e=(e<<5)-e+r.codePointAt(0),e&=e;return Math.abs(e).toString(36)})(n+o+i),"-").concat(s,"x")},tt=new Map,et=function(){var t=i(function*(t,e,r,a){var n=X(t,r);if(!n)return null;var o=Q(t,e,r,a);if(!o)return null;var i,s,l=tt.get(o);if(!l){var u=K(t.fillPatternForegroundColor,e)||"black",c=K(t.fillPatternBackgroundColor,e)||"transparent",h=(i=u,s=c,n.replace(/\{\{foregroundColor\}\}/g,i||"black").replace(/\{\{backgroundColor\}\}/g,s||"transparent")),d='<rect width="16" height="16" fill="'.concat(c,'"/>'),p=Math.max(2,a),g=Math.round(8*p),f='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(g,'" height="').concat(g,'" viewBox="0 0 16 16">').concat(d).concat(h,"</svg>");l=yield G(f,g,g),tt.set(o,l)}return{imageId:o,imageData:l}});return function(e,r,a,n){return t.apply(this,arguments)}}(),rt=function(){var t=i(function*(t,e,r,a,n){if(e.length){var o=Math.max(2,n);yield Promise.all(e.map(function(){var e=i(function*(e){var i=Q(e,r,a,n);if(i&&!t.hasImage(i)){var s=yield et(e,r,a,n);s&&t.addImage(s.imageId,s.imageData,{pixelRatio:o})}});return function(t){return e.apply(this,arguments)}}()))}});return function(e,r,a,n,o){return t.apply(this,arguments)}}(),at=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)}return r}function ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}class it{constructor(t){var{mapFramework:e,mapProviderConfig:r={},events:a,eventBus:n}=t;this.maplibreModule=e,this.events=a,this.eventBus=n,this.capabilities={supportedShortcuts:u,supportsMapSizes:!0},Object.assign(this,r)}initMap(t){var e=this;return i(function*(){var{container:r,padding:a,mapStyle:n,mapSize:i,center:s,zoom:l,bounds:u,pixelRatio:c}=t,h=o(t,at);e.mapStyleId=null==n?void 0:n.id,e.mapSize=i;var{Map:d}=e.maplibreModule,{events:p,eventBus:g}=e,y=new d(ot(ot({},h),{},{container:r,style:null==n?void 0:n.url,pixelRatio:c,padding:a,center:s,zoom:l,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}));y.touchZoomRotate.disableRotation(),e.map=y,e.map.setPadding(a),u&&y.fitBounds(u,{duration:0}),function(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var r=t.getCanvas();if(r&&(this.target===r||r.contains(this.target)))return}e.call(this)}}(y),function(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block"}(y),f({map:y,events:p,eventBus:g,getCenter:e.getCenter.bind(e),getZoom:e.getZoom.bind(e),getBounds:e.getBounds.bind(e),getResolution:e.getResolution.bind(e)}),function(t){var{mapProvider:e,map:r,events:a,eventBus:n}=t,o=t=>{r.once("style.load",()=>{n.emit(a.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},i=t=>{r.setPixelRatio(t)},s=t=>{var{mapSize:r}=t;e.mapSize=r};n.on(a.MAP_SET_STYLE,o),n.on(a.MAP_SET_PIXEL_RATIO,i),n.on(a.MAP_SIZE_CHANGE,s)}({mapProvider:e,map:y,events:p,eventBus:g}),y.on("load",()=>{e.labelNavigator=I(y,null==n?void 0:n.mapColorScheme,p,g)}),e.eventBus.emit(p.MAP_READY,{map:e.map,mapStyleId:e.mapStyleId,mapSize:e.mapSize,crs:e.crs})})()}destroyMap(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}setHoverCursor(t){this.map&&(this._onHoverMove=((t,e,r)=>{var a=t.getCanvas();if(r&&t.off("mousemove",r),null==e||!e.length)return a.style.cursor="",null;var n=r=>{var n=e.filter(e=>t.getLayer(e));if(0!==n.length){var{lineLayers:o,otherLayers:i}=((t,e)=>{var r=[],a=[];for(var n of e)if("line"===t.getLayer(n).type){var o=n.endsWith("-stroke")?n.slice(0,-7):null;null!==o&&e.includes(o)||r.push(n)}else a.push(n);return{lineLayers:r,otherLayers:a}})(t,n),{x:s,y:l}=r.point,u=[[s-10,l-10],[s+10,l+10]],c=o.length>0&&t.queryRenderedFeatures(u,{layers:o}).length>0,h=i.length>0&&t.queryRenderedFeatures(r.point,{layers:i}).length>0;a.style.cursor=c||h?"pointer":""}else a.style.cursor=""};return t.on("mousemove",n),n})(this.map,t,this._onHoverMove))}setView(t){var{center:e,zoom:r}=t;this.map.flyTo({center:e||this.getCenter(),zoom:r||this.getZoom(),duration:this.map.isStyleLoaded()?s:0})}zoomIn(t){this.map.easeTo({zoom:this.getZoom()+t,duration:s})}zoomOut(t){this.map.easeTo({zoom:this.getZoom()-t,duration:s})}panBy(t){this.map.panBy(t,{duration:s})}fitToBounds(t){var e=Array.isArray(t)?t:S(t),r=this.map.isStyleLoaded()?s:0;this.map.fitBounds(e,{duration:r})}setPadding(t){this.map.setPadding(t)}updateHighlightedFeatures(t,e){var{LngLatBounds:r}=this.maplibreModule;return F({LngLatBounds:r,map:this.map,selectedFeatures:t,stylesMap:e})}highlightNextLabel(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}highlightLabelAtCenter(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}clearHighlightedLabel(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}getCenter(){var t=this.map.getCenter();return[Number(t.lng.toFixed(l)),Number(t.lat.toFixed(l))]}getZoom(){return Number(this.map.getZoom().toFixed(l))}getBounds(){return this.map.getBounds().toArray().flat(1)}getFeaturesAtPoint(t,e){return $(this.map,t,e)}registerSymbols(t,e,r){var a=this;return i(function*(){var n=(a.map.getPixelRatio()||1)*(p[a.mapSize]||1);return Y(a.map,t,e,r,n)})()}registerPatterns(t,e,r){var a=this;return i(function*(){var n=(a.map.getPixelRatio()||1)*(p[a.mapSize]||1);return rt(a.map,t,e,r,n)})()}getAreaDimensions(){var{LngLatBounds:t}=this.maplibreModule;return(t=>{var e,r,a,n;if(t&&"function"==typeof t.getWest)e=t.getWest(),r=t.getSouth(),a=t.getEast(),n=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";[[e,r],[a,n]]=t}var o=x([e,r],[a,r]),i=x([e,r],[e,n]),s=P(o),l=P(i);return"".concat(l," by ").concat(s)})(((t,e)=>{var{width:r,height:a}=e.getContainer().getBoundingClientRect(),n=e.getPadding(),o=[n.left,a-n.bottom],i=[r-n.right,n.top];return new t(e.unproject(o),e.unproject(i))})(t,this.map))}getCardinalMove(t,e){return((t,e)=>{var[r,a]=t,[n,o]=e,i=o-a,s=n-r,l=[];if(Math.abs(i)>1e-4){var u=Math.round(x([r,a],[r,o]));l.push("".concat(i>0?"north":"south"," ").concat(P(u)))}if(Math.abs(s)>1e-4){var c=Math.round(x([r,a],[n,a]));l.push("".concat(s>0?"east":"west"," ").concat(P(c)))}return l.join(", ")})(t,e)}getResolution(){return t=this.map.getCenter(),e=this.map.getZoom(),r=t.lat,a=Math.pow(2,e),40075016.686*Math.cos(r*Math.PI/180)/(512*a);var t,e,r,a}mapToScreen(t){return this.map.project(t)}screenToMap(t){var{lng:e,lat:r}=this.map.unproject([t.x,t.y]);return[e,r]}isGeometryObscured(t,e){return((t,e,r)=>{var a=r.getContainer().getBoundingClientRect(),[n,o,i,s]=S(t),l=[r.project([n,o]),r.project([n,s]),r.project([i,o]),r.project([i,s])],u=Math.min(...l.map(t=>t.x)),c=Math.max(...l.map(t=>t.x)),h=Math.min(...l.map(t=>t.y)),d=Math.max(...l.map(t=>t.y)),p=e.left-a.left,g=e.top-a.top,f=e.right-a.left,y=e.bottom-a.top;return u<f&&c>p&&h<y&&d>g})(t,e,this.map)}}export{it as default};
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see im-maplibre-provider.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[772],{335(t,e,r){r.r(e),r.d(e,{default:()=>Ut});var n=400,o=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];r(738);new Set,new Set,r(287);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){u(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function u(t,e,r){return(e=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s={slot:"middle",open:!1,dismissible:!0,modal:!0},c=(l({},s),l(l({},s),{},{width:"500px"}),l(l({},s),{},{width:"500px"}),{small:1,medium:1.5,large:2});function f(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block"}function h(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var r=t.getCanvas();if(r&&(this.target===r||r.contains(this.target)))return}e.call(this)}}var y=function(t,e){var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o)},e)};return n.cancel=function(){r&&(clearTimeout(r),r=null)},n};function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function d(t){var e=t.map,r=t.events,n=t.eventBus,o=t.getCenter,a=t.getZoom,i=t.getBounds,l=t.getResolution,u=[],s=[],c=function(){var t=a();return{center:o(),bounds:i(),resolution:l(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},f=function(t,e){return n.emit(t,e)},h=function(){return f(r.MAP_LOADED)};e.on("load",h),u.push(["load",h]),e.once("idle",function(){return f(r.MAP_FIRST_IDLE,c())});var d=function(){return f(r.MAP_MOVE_START)};e.on("movestart",d),u.push(["movestart",d]);var v=y(function(){f(r.MAP_MOVE_END,c())},500);e.on("moveend",v),u.push(["moveend",v]),s.push(v);var g,m,b=(g=function(){f(r.MAP_MOVE,c())},m=0,function(){var t=Date.now();t-m>=10&&(m=t,g.apply(void 0,arguments))});e.on("zoom",b),u.push(["zoom",b]),s.push(b);var M=function(){return f(r.MAP_RENDER)};e.on("render",M),u.push(["render",M]);var w=y(function(){f(r.MAP_DATA_CHANGE,c())},500);e.on("styledata",w),u.push(["styledata",w]),s.push(w);var S=function(){return f(r.MAP_STYLE_CHANGE)};e.on("style.load",S),u.push(["style.load",S]);var P=function(t){return f(r.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]})};return e.on("click",P),u.push(["click",P]),{remove:function(){s.forEach(function(t){return t.cancel()}),u.forEach(function(t){var r,n,o=(n=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(r,n)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],i=o[1];return e.off(a,i)})}}}function v(t){var e=t.mapProvider,r=t.map,n=t.events,o=t.eventBus,a=function(t){r.once("style.load",function(){o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},i=function(t){r.setPixelRatio(t)},l=function(t){var r=t.mapSize;e.mapSize=r};return o.on(n.MAP_SET_STYLE,a),o.on(n.MAP_SET_PIXEL_RATIO,i),o.on(n.MAP_SIZE_CHANGE,l),{remove:function(){o.off(n.MAP_SET_STYLE,a),o.off(n.MAP_SET_PIXEL_RATIO,i),o.off(n.MAP_SIZE_CHANGE,l)}}}let g=" ";class m{static get separator(){return g}static set separator(t){g=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,o=null,a=null,i=null;switch(e){default:case"d":case"deg":o=t.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),n=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),a=(60*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),o++),o=("000"+o).slice(-3),a<10&&(a="0"+a),n=o+"°"+m.separator+a+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),a=Math.floor(3600*t/60)%60,i=(3600*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),a++),60==a&&(a=0,o++),o=("000"+o).slice(-3),a=("00"+a).slice(-2),i<10&&(i="0"+i),n=o+"°"+m.separator+a+"′"+m.separator+i+"″"}return n}static toLat(t,e,r){const n=m.toDms(m.wrap90(t),e,r);return null===n?"–":n.slice(1)+m.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=m.toDms(m.wrap180(t),e,r);return null===n?"–":n+m.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=m.toDms(m.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=m.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const b=m,M=Math.PI;class w{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=b.wrap90(Number(t)),this._lon=b.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?b.wrap90(b.parse(t)):b.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?b.wrap90(b.parse(t)):b.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?b.wrap180(b.parse(t)):b.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?b.wrap180(b.parse(t)):b.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?b.wrap180(b.parse(t)):b.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,r;if(2==t.length&&([e,r]=t,e=b.wrap90(b.parse(e)),r=b.wrap180(b.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,r]=t[0].split(","),e=b.wrap90(b.parse(e)),r=b.wrap180(b.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const n=t[0];if("Point"==n.type&&Array.isArray(n.coordinates)?[r,e]=n.coordinates:(null!=n.latitude&&(e=n.latitude),null!=n.lat&&(e=n.lat),null!=n.longitude&&(r=n.longitude),null!=n.lng&&(r=n.lng),null!=n.lon&&(r=n.lon),e=b.wrap90(b.parse(e)),r=b.wrap180(b.parse(r))),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${t.toString()}’`);return new w(e,r)}distanceTo(t,e=6371e3){if(t instanceof w||(t=w.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const r=e,n=this.lat.toRadians(),o=this.lon.toRadians(),a=t.lat.toRadians(),i=a-n,l=t.lon.toRadians()-o,u=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n)*Math.cos(a)*Math.sin(l/2)*Math.sin(l/2);return r*(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))}initialBearingTo(t){if(t instanceof w||(t=w.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),o=Math.cos(e)*Math.sin(r)-Math.sin(e)*Math.cos(r)*Math.cos(n),a=Math.sin(n)*Math.cos(r),i=Math.atan2(a,o).toDegrees();return b.wrap360(i)}finalBearingTo(t){t instanceof w||(t=w.parse(t));const e=t.initialBearingTo(this)+180;return b.wrap360(e)}midpointTo(t){t instanceof w||(t=w.parse(t));const e=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),a=Math.cos(e),i=Math.sin(e),l={x:a+Math.cos(n)*Math.cos(o),y:0+Math.cos(n)*Math.sin(o),z:i+Math.sin(n)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),s=r+Math.atan2(l.y,l.x),c=u.toDegrees(),f=s.toDegrees();return new w(c,f)}intermediatePointTo(t,e){if(t instanceof w||(t=w.parse(t)),this.equals(t))return new w(this.lat,this.lon);const r=this.lat.toRadians(),n=this.lon.toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=o-r,l=a-n,u=Math.sin(i/2)*Math.sin(i/2)+Math.cos(r)*Math.cos(o)*Math.sin(l/2)*Math.sin(l/2),s=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),c=Math.sin((1-e)*s)/Math.sin(s),f=Math.sin(e*s)/Math.sin(s),h=c*Math.cos(r)*Math.cos(n)+f*Math.cos(o)*Math.cos(a),y=c*Math.cos(r)*Math.sin(n)+f*Math.cos(o)*Math.sin(a),p=c*Math.sin(r)+f*Math.sin(o),d=Math.atan2(p,Math.sqrt(h*h+y*y)),v=Math.atan2(y,h),g=d.toDegrees(),m=v.toDegrees();return new w(g,m)}destinationPoint(t,e,r=6371e3){const n=t/r,o=Number(e).toRadians(),a=this.lat.toRadians(),i=this.lon.toRadians(),l=Math.sin(a)*Math.cos(n)+Math.cos(a)*Math.sin(n)*Math.cos(o),u=Math.asin(l),s=Math.sin(o)*Math.sin(n)*Math.cos(a),c=Math.cos(n)-Math.sin(a)*l,f=i+Math.atan2(s,c),h=u.toDegrees(),y=f.toDegrees();return new w(h,y)}static intersection(t,e,r,n){if(t instanceof w||(t=w.parse(t)),r instanceof w||(r=w.parse(r)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(n))throw new TypeError(`invalid brng2 ‘${n}’`);const o=t.lat.toRadians(),a=t.lon.toRadians(),i=r.lat.toRadians(),l=r.lon.toRadians(),u=Number(e).toRadians(),s=Number(n).toRadians(),c=i-o,f=l-a,h=2*Math.asin(Math.sqrt(Math.sin(c/2)*Math.sin(c/2)+Math.cos(o)*Math.cos(i)*Math.sin(f/2)*Math.sin(f/2)));if(Math.abs(h)<Number.EPSILON)return new w(t.lat,t.lon);const y=(Math.sin(i)-Math.sin(o)*Math.cos(h))/(Math.sin(h)*Math.cos(o)),p=(Math.sin(o)-Math.sin(i)*Math.cos(h))/(Math.sin(h)*Math.cos(i)),d=Math.acos(Math.min(Math.max(y,-1),1)),v=Math.acos(Math.min(Math.max(p,-1),1)),g=u-(Math.sin(l-a)>0?d:2*M-d),m=(Math.sin(l-a)>0?2*M-v:v)-s;if(0==Math.sin(g)&&0==Math.sin(m))return null;if(Math.sin(g)*Math.sin(m)<0)return null;const b=-Math.cos(g)*Math.cos(m)+Math.sin(g)*Math.sin(m)*Math.cos(h),S=Math.atan2(Math.sin(h)*Math.sin(g)*Math.sin(m),Math.cos(m)+Math.cos(g)*b),P=Math.asin(Math.min(Math.max(Math.sin(o)*Math.cos(S)+Math.cos(o)*Math.sin(S)*Math.cos(u),-1),1)),O=a+Math.atan2(Math.sin(u)*Math.sin(S)*Math.cos(o),Math.cos(S)-Math.sin(o)*Math.sin(P)),x=P.toDegrees(),j=O.toDegrees();return new w(x,j)}crossTrackDistanceTo(t,e,r=6371e3){t instanceof w||(t=w.parse(t)),e instanceof w||(e=w.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(o)*Math.sin(a-i))*n}alongTrackDistanceTo(t,e,r=6371e3){t instanceof w||(t=w.parse(t)),e instanceof w||(e=w.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians(),l=Math.asin(Math.sin(o)*Math.sin(a-i));return Math.acos(Math.cos(o)/Math.abs(Math.cos(l)))*Math.sign(Math.cos(i-a))*n}maxLatitude(t){const e=Number(t).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(r))).toDegrees()}static crossingParallels(t,e,r){if(t.equals(e))return null;const n=Number(r).toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=e.lat.toRadians(),l=e.lon.toRadians()-a,u=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.sin(l),s=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.cos(l)-Math.cos(o)*Math.sin(i)*Math.cos(n),c=Math.cos(o)*Math.cos(i)*Math.sin(n)*Math.sin(l);if(c*c>u*u+s*s)return null;const f=Math.atan2(-s,u),h=Math.acos(c/Math.sqrt(u*u+s*s)),y=a+f+h,p=(a+f-h).toDegrees(),d=y.toDegrees();return{lon1:b.wrap180(p),lon2:b.wrap180(d)}}rhumbDistanceTo(t,e=6371e3){t instanceof w||(t=w.parse(t));const r=e,n=this.lat.toRadians(),o=t.lat.toRadians(),a=o-n;let i=Math.abs(t.lon-this.lon).toRadians();Math.abs(i)>M&&(i=i>0?-(2*M-i):2*M+i);const l=Math.log(Math.tan(o/2+M/4)/Math.tan(n/2+M/4)),u=Math.abs(l)>1e-11?a/l:Math.cos(n);return Math.sqrt(a*a+u*u*i*i)*r}rhumbBearingTo(t){if(t instanceof w||(t=w.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians();let n=(t.lon-this.lon).toRadians();Math.abs(n)>M&&(n=n>0?-(2*M-n):2*M+n);const o=Math.log(Math.tan(r/2+M/4)/Math.tan(e/2+M/4)),a=Math.atan2(n,o).toDegrees();return b.wrap360(a)}rhumbDestinationPoint(t,e,r=6371e3){const n=this.lat.toRadians(),o=this.lon.toRadians(),a=Number(e).toRadians(),i=t/r,l=i*Math.cos(a);let u=n+l;Math.abs(u)>M/2&&(u=u>0?M-u:-M-u);const s=Math.log(Math.tan(u/2+M/4)/Math.tan(n/2+M/4)),c=Math.abs(s)>1e-11?l/s:Math.cos(n),f=o+i*Math.sin(a)/c,h=u.toDegrees(),y=f.toDegrees();return new w(h,y)}rhumbMidpointTo(t){t instanceof w||(t=w.parse(t));const e=this.lat.toRadians();let r=this.lon.toRadians();const n=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-r)>M&&(r+=2*M);const a=(e+n)/2,i=Math.tan(M/4+e/2),l=Math.tan(M/4+n/2),u=Math.tan(M/4+a/2);let s=((o-r)*Math.log(u)+r*Math.log(l)-o*Math.log(i))/Math.log(l/i);isFinite(s)||(s=(r+o)/2);const c=a.toDegrees(),f=s.toDegrees();return new w(c,f)}static areaOf(t,e=6371e3){const r=e,n=t[0].equals(t[t.length-1]);n||t.push(t[0]);const o=t.length-1;let a=0;for(let e=0;e<o;e++){const r=t[e].lat.toRadians(),n=t[e+1].lat.toRadians(),o=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(o/2)*(Math.tan(r/2)+Math.tan(n/2)),1+Math.tan(r/2)*Math.tan(n/2))}(function(t){let e=0,r=t[0].initialBearingTo(t[1]);for(let n=0;n<t.length-1;n++){const o=t[n].initialBearingTo(t[n+1]),a=t[n].finalBearingTo(t[n+1]);e+=(o-r+540)%360-180,e+=(a-o+540)%360-180,r=a}return e+=(t[0].initialBearingTo(t[1])-r+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*M);const i=Math.abs(a*r*r);return n||t.pop(),i}equals(t){return t instanceof w||(t=w.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`):`${b.toLat(this.lat,t,e)}, ${b.toLon(this.lon,t,e)}`}}function S(t,e,r){if(null!==t)for(var n,o,a,i,l,u,s,c,f=0,h=0,y=t.type,p="FeatureCollection"===y,d="Feature"===y,v=p?t.features.length:1,g=0;g<v;g++){l=(c=!!(s=p?t.features[g].geometry:d?t.geometry:t)&&"GeometryCollection"===s.type)?s.geometries.length:1;for(var m=0;m<l;m++){var b=0,M=0;if(null!==(i=c?s.geometries[m]:s)){u=i.coordinates;var w=i.type;switch(f=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,h,g,b,M))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===e(u[n],h,g,b,M))return!1;h++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(o=0;o<u[n].length-f;o++){if(!1===e(u[n][o],h,g,b,M))return!1;h++}"MultiLineString"===w&&b++,"Polygon"===w&&M++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(M=0,o=0;o<u[n].length;o++){for(a=0;a<u[n][o].length-f;a++){if(!1===e(u[n][o][a],h,g,b,M))return!1;h++}M++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===S(i.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var P=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return S(t,t=>{r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r};function O(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||j(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||j(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var A=function(t,e){var r=x(t,2),n=r[0],o=r[1],a=x(e,2),i=a[0],l=a[1],u=new w(o,n),s=new w(l,i);return u.distanceTo(s)},N=function(t){var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var r=Number.parseFloat(e.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(e);return"".concat(o," miles")},T=function(t){return P(t)};function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach(function(e){C(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function C(t,e,r){return(e=function(t){var e=function(t){if("object"!=R(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==R(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var F="highlighted-label";function B(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var r=t.stops;if(r.length<2)return r.length>0?r[0][1]:0;for(var n=r[0],o=r[r.length-1],a=1;a<r.length;a++){var i=r[a];if(i[0]>e){o=i,n=r[a-1];break}n=r[a-1],o=i}var l=L(n,2),u=l[0],s=l[1],c=L(o,2),f=c[0],h=c[1];return e<=u?s:e>=f?h:s+(e-u)/(f-u)*(h-s)}(t,e);var r,n=function(t){if(Array.isArray(t))return t}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[2],a=D(n).slice(3);if("zoom"!==o[0])throw new Error("Only zoom-based expressions supported");for(var i=0;i<a.length-2;i+=2){var l=a[i],u=a[i+1],s=a[i+2],c=a[i+3];if(e<=l)return u;if(e<=s)return u+(e-l)/(s-l)*(c-u)}return a[a.length-1]}function G(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function $(t,e,r){var n,o,a,i;if(null!=e&&null!==(n=e.feature)&&void 0!==n&&n.layer){G(t,r);var l=e.feature,u=e.layer;r.highlightLayerId="highlight-".concat(u.id);var s=l.id,c=l.type,f=l.properties,h=l.geometry;t.getSource(F).setData({id:s,type:c,properties:f,geometry:h}),r.highlightedExpr=u.layout["text-size"];var y=t.getZoom(),p=(o=u,a=1.5*B(r.highlightedExpr,y),i=r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"},{id:"highlight-".concat(o.id),type:o.type,source:F,layout:_(_({},o.layout),{},{"text-size":a,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:_(_({},o.paint),{},{"text-color":i.text,"text-halo-color":i.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})});t.addLayer(p),t.moveLayer(r.highlightLayerId)}}function z(t){t.getSource(F)||t.addSource(F,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function q(t){t.getStyle().layers.filter(function(t){var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(function(e){return t.setLayoutProperty(e.id,"symbol-placement","line-center")})}function Z(t,e,r,n){var o={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function a(){var e=t.getStyle().layers.filter(function(t){return"symbol"===t.type}),r=t.queryRenderedFeatures({layers:e.map(function(t){return t.id})});o.labels=function(t,e,r){return e.flatMap(function(e){var n,o,a,i,l="string"==typeof(o=null===(n=e.layout)||void 0===n?void 0:n["text-field"])?null===(a=/^{(.+)}$/.exec(o))||void 0===a?void 0:a[1]:Array.isArray(o)?null===(i=o.find(function(t){return Array.isArray(t)&&"get"===t[0]}))||void 0===i?void 0:i[1]:null;return l?r.filter(function(t){var r;return t.layer.id===e.id&&(null===(r=t.properties)||void 0===r?void 0:r[l])}).map(function(r){return function(t,e,r,n){var o=function(t){var e=t.type,r=t.coordinates;if("Point"===e)return r;if("MultiPoint"===e)return r[0];if(e.includes("LineString")){var n="LineString"===e?r:r[0];return[(n[0][0]+n[n.length-1][0])/2,(n[0][1]+n[n.length-1][1])/2]}if(e.includes("Polygon")){var o="Polygon"===e?r[0]:r[0][0],a=o.reduce(function(t,e){return[t[0]+e[0],t[1]+e[1]]},[0,0]);return[a[0]/o.length,a[1]/o.length]}return null}(t.geometry);if(!o)return null;var a=n.project({lng:o[0],lat:o[1]});return{text:t.properties[r],x:a.x,y:a.y,feature:t,layer:e}}(r,e,l,t)}).filter(Boolean):[]})}(t,e,r)}function i(){if(a(),!o.labels.length)return null;var e=t.project(t.getCenter()),r=function(t,e){var r;return null===(r=t.reduce(function(t,r){var n=Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2);return!t||n<t.dist?{label:r,dist:n}:t},null))||void 0===r?void 0:r.label}(o.labels,e);return o.currentPixel={x:r.x,y:r.y},$(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")}return q(t),z(t),null==n||n.on(r.MAP_SET_STYLE,function(e){t.once("styledata",function(){return t.once("idle",function(){q(t),z(t),o.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)})})}),t.on("zoom",function(){if(o.highlightLayerId&&o.highlightedExpr){var e=B(o.highlightedExpr,t.getZoom());t.setLayoutProperty(o.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(function(t){return"symbol"===t.type}).forEach(function(e){t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:a,highlightNextLabel:function(e){if(a(),!o.labels.length)return null;if(!o.currentPixel)return i();var r=function(t,e){if(!e.currentPixel)return null;var r=e.labels.map(function(t,e){return{pixel:[t.x,t.y],index:e}}).filter(function(t){return t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y});if(!r.length)return null;var n=r.map(function(t){return t.pixel}),o=function(t,e,r){var n=x(e,2),o=n[0],a=n[1],i=r.filter(function(e){var r=x(e,2),n=r[0],i=r[1];return(n!==o||i!==a)&&function(t,e,r){switch(t){case"ArrowUp":return r<0&&Math.abs(r)>=Math.abs(e);case"ArrowDown":return r>0&&Math.abs(r)>=Math.abs(e);case"ArrowLeft":return e<0&&Math.abs(e)>Math.abs(r);case"ArrowRight":return e>0&&Math.abs(e)>Math.abs(r);default:return!1}}(t,n-o,i-a)});if(!i.length)return r.findIndex(function(t){return t[0]===o&&t[1]===a});var l=-1,u=1/0;return i.forEach(function(t){var e=t[0]-o,n=t[1]-a,i=e*e+n*n;i<u&&(u=i,l=r.indexOf(t))}),l}(t,[e.currentPixel.x,e.currentPixel.y],n);return(null==o||o<0||o>=r.length)&&(o=0),e.labels[r[o].index]}(e,o);return r?(o.currentPixel={x:r.x,y:r.y},$(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")):null},highlightLabelAtCenter:i,clearHighlightedLabel:function(){return G(t,o)}}}function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function U(t){return function(t){if(Array.isArray(t))return V(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||H(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){if(t){if("string"==typeof t)return V(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(t,e):void 0}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function J(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(r),!0).forEach(function(e){K(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function K(t,e,r){return(e=function(t){var e=function(t){if("object"!=W(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=W(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==W(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var X=function(t,e,r,n,o,a,i){t.getLayer(e)||t.addLayer(J(J({id:e,type:r,source:n},o&&{"source-layer":o}),{},{paint:a})),Object.entries(a).forEach(function(r){var n,o,a=(o=2,function(t){if(Array.isArray(t))return t}(n=r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(n,o)||H(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=a[0],l=a[1];t.setPaintProperty(e,i,l)}),t.setFilter(e,i),t.moveLayer(e)};function Q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return tt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var et=function(t,e,r){var n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);if(0===n)return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2);var o=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return o=Math.max(0,Math.min(1,o)),Math.pow(t.x-(e.x+o*(r.x-e.x)),2)+Math.pow(t.y-(e.y+o*(r.y-e.y)),2)};function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var nt=function(t,e,r){var n=t.getCanvas();if(r&&t.off("mousemove",r),null==e||!e.length)return n.style.cursor="",null;var o=function(r){var o=e.filter(function(e){return t.getLayer(e)});if(0!==o.length){var a=function(t,e){var r,n=[],o=[],a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return rt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if("line"===t.getLayer(i).type){var l=i.endsWith("-stroke")?i.slice(0,-7):null;null!==l&&e.includes(l)||n.push(i)}else o.push(i)}}catch(t){a.e(t)}finally{a.f()}return{lineLayers:n,otherLayers:o}}(t,o),i=a.lineLayers,l=a.otherLayers,u=r.point,s=u.x,c=u.y,f=[[s-10,c-10],[s+10,c+10]],h=i.length>0&&t.queryRenderedFeatures(f,{layers:i}).length>0,y=l.length>0&&t.queryRenderedFeatures(r.point,{layers:l}).length>0;n.style.cursor=h||y?"pointer":""}else n.style.cursor=""};return t.on("mousemove",o),o},ot=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),at=function(t,e){return t.symbolSvgContent?{svg:t.symbolSvgContent}:t.symbol?e.get(t.symbol):void 0},it=function(t){if(!function(t){return!(!t.symbol&&!t.symbolSvgContent)}(t))return{};var e={};return ot.forEach(function(r){if(null!=t[r]){var n=r.charAt(6).toLowerCase()+r.slice(7);e[n]=t[r]}}),e},lt=function(t,e){var r;return t.symbolViewBox?t.symbolViewBox:null!==(r=null==e?void 0:e.viewBox)&&void 0!==r?r:"0 0 38 38"},ut=function(t,e,r){return new Promise(function(n,o){var a=new Blob([t],{type:"image/svg+xml"}),i=URL.createObjectURL(a),l=new Image(e,r);l.onload=function(){var t=document.createElement("canvas");t.width=e,t.height=r;var o=t.getContext("2d");o.drawImage(l,0,0,e,r),URL.revokeObjectURL(i),n(o.getImageData(0,0,e,r))},l.onerror=function(){URL.revokeObjectURL(i),o(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},l.src=i})};function st(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var u=n&&n.prototype instanceof l?n:l,s=Object.create(u.prototype);return ct(s,"_invoke",function(r,n,o){var a,l,u,s=0,c=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,r){return a=e,l=0,u=t,h.n=r,i}};function y(r,n){for(l=r,u=n,e=0;!f&&s&&!o&&e<c.length;e++){var o,a=c[e],y=h.p,p=a[2];r>3?(o=p===n)&&(u=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=t):a[0]<=y&&((o=r<2&&y<a[1])?(l=0,h.v=n,h.n=a[1]):y<p&&(o=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,h.n=p,l=0))}if(o||r>1)return i;throw f=!0,n}return function(o,c,p){if(s>1)throw TypeError("Generator is already running");for(f&&1===c&&y(c,p),l=c,u=p;(e=l<2?t:u)||!f;){a||(l?l<3?(l>1&&(h.n=-1),y(l,u)):h.n=u:h.v=u);try{if(s=2,a){if(l||(o="next"),e=a[o]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,l<2&&(l=0)}else 1===l&&(e=a.return)&&e.call(a),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=t}else if((e=(f=h.n<0)?u:r.call(n,h))!==i)break}catch(e){a=t,l=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,a),!0),s}var i={};function l(){}function u(){}function s(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(ct(e={},n,function(){return this}),e),f=s.prototype=l.prototype=Object.create(c);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,ct(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,ct(f,"constructor",s),ct(s,"constructor",u),u.displayName="GeneratorFunction",ct(s,o,"GeneratorFunction"),ct(f),ct(f,o,"Generator"),ct(f,n,function(){return this}),ct(f,"toString",function(){return"[object Generator]"}),(st=function(){return{w:a,m:h}})()}function ct(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}ct=function(t,e,r,n){function a(e,r){ct(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},ct(t,e,r,n)}function ft(t,e,r,n,o,a,i){try{var l=t[a](i),u=l.value}catch(t){return void r(t)}l.done?e(u):Promise.resolve(u).then(n,o)}function ht(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){ft(a,n,o,i,l,"next",t)}function l(t){ft(a,n,o,i,l,"throw",t)}i(void 0)})}}function yt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||pt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pt(t,e){if(t){if("string"==typeof t)return dt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dt(t,e):void 0}}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var vt=function(t){var e,r=0,n=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=pt(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){i=!0,o=t},f:function(){try{a||null==e.return||e.return()}finally{if(i)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r=Math.trunc((r<<5)-r+o.codePointAt(0))}}catch(t){n.e(t)}finally{n.f()}return Math.abs(r).toString(36)},gt=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,a=at(t,r);if(!a)return null;var i=it(t),l=n?r.resolveSelected(a,i,e):r.resolve(a,i,e);return"symbol-".concat(n?"sel-":"").concat(vt(l),"-").concat(o,"x")},mt=new Map,bt=function(){var t=ht(st().m(function t(e,r,n,o,a){var i,l,u,s,c,f,h,y,p,d,v;return st().w(function(t){for(;;)switch(t.n){case 0:if(i=at(e,n)){t.n=1;break}return t.a(2,null);case 1:if(l=it(e),u=o?n.resolveSelected(i,l,r):n.resolve(i,l,r),s="symbol-".concat(o?"sel-":"").concat(vt(u),"-").concat(a,"x"),c=mt.get(s)){t.n=3;break}return f=lt(e,i),h=f.split(" ").map(Number),y=yt(h,4),p=y[2],d=y[3],v='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(p*a,'" height="').concat(d*a,'" viewBox="').concat(f,'">').concat(u,"</svg>"),t.n=2,ut(v,p*a,d*a);case 2:c=t.v,mt.set(s,c);case 3:return t.a(2,{imageId:s,imageData:c})}},t)}));return function(e,r,n,o,a){return t.apply(this,arguments)}}(),Mt=function(){var t=ht(st().m(function t(e,r,n,o){var a,i=arguments;return st().w(function(t){for(;;)switch(t.n){case 0:if(a=i.length>4&&void 0!==i[4]?i[4]:2,r.length){t.n=1;break}return t.a(2);case 1:return e._symbolImageMap={},t.n=2,Promise.all(r.flatMap(function(t){var r=gt(t,n,o,!1,a),i=gt(t,n,o,!0,a);return r&&i&&(e._symbolImageMap[r]=i),[!1,!0].map(function(){var l=ht(st().m(function l(u){var s,c;return st().w(function(l){for(;;)switch(l.n){case 0:if((s=u?i:r)&&!e.hasImage(s)){l.n=1;break}return l.a(2);case 1:return l.n=2,bt(t,n,o,u,a);case 2:(c=l.v)&&!e.hasImage(c.imageId)&&e.addImage(c.imageId,c.imageData,{pixelRatio:a});case 3:return l.a(2)}},l)}));return function(t){return l.apply(this,arguments)}}())}));case 2:return t.a(2)}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}();function wt(t){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(t)}var St=function(t,e){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===wt(t)){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null};function Pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Ot=function(t,e,r){return t.replace(/\{\{foregroundColor\}\}/g,e||"black").replace(/\{\{backgroundColor\}\}/g,r||"transparent")},xt=function(t,e){return t.fillPatternSvgContent?t.fillPatternSvgContent:t.fillPattern&&null!==(r=null==e||null===(n=e.get(t.fillPattern))||void 0===n?void 0:n.svgContent)&&void 0!==r?r:null;var r,n},jt=function(t,e,r){var n=xt(t,r);if(!n)return null;var o=St(t.fillPatternForegroundColor,e)||"black",a=St(t.fillPatternBackgroundColor,e)||"transparent";return"pattern-".concat(function(t){var e,r=0,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}(t);try{for(n.s();!(e=n.n()).done;)r=(r<<5)-r+e.value.codePointAt(0),r&=r}catch(t){n.e(t)}finally{n.f()}return Math.abs(r).toString(36)}(n+o+a))};function Et(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var u=n&&n.prototype instanceof l?n:l,s=Object.create(u.prototype);return At(s,"_invoke",function(r,n,o){var a,l,u,s=0,c=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,r){return a=e,l=0,u=t,h.n=r,i}};function y(r,n){for(l=r,u=n,e=0;!f&&s&&!o&&e<c.length;e++){var o,a=c[e],y=h.p,p=a[2];r>3?(o=p===n)&&(u=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=t):a[0]<=y&&((o=r<2&&y<a[1])?(l=0,h.v=n,h.n=a[1]):y<p&&(o=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,h.n=p,l=0))}if(o||r>1)return i;throw f=!0,n}return function(o,c,p){if(s>1)throw TypeError("Generator is already running");for(f&&1===c&&y(c,p),l=c,u=p;(e=l<2?t:u)||!f;){a||(l?l<3?(l>1&&(h.n=-1),y(l,u)):h.n=u:h.v=u);try{if(s=2,a){if(l||(o="next"),e=a[o]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,l<2&&(l=0)}else 1===l&&(e=a.return)&&e.call(a),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=t}else if((e=(f=h.n<0)?u:r.call(n,h))!==i)break}catch(e){a=t,l=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,a),!0),s}var i={};function l(){}function u(){}function s(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(At(e={},n,function(){return this}),e),f=s.prototype=l.prototype=Object.create(c);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,At(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,At(f,"constructor",s),At(s,"constructor",u),u.displayName="GeneratorFunction",At(s,o,"GeneratorFunction"),At(f),At(f,o,"Generator"),At(f,n,function(){return this}),At(f,"toString",function(){return"[object Generator]"}),(Et=function(){return{w:a,m:h}})()}function At(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}At=function(t,e,r,n){function a(e,r){At(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},At(t,e,r,n)}function Nt(t,e,r,n,o,a,i){try{var l=t[a](i),u=l.value}catch(t){return void r(t)}l.done?e(u):Promise.resolve(u).then(n,o)}function Tt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){Nt(a,n,o,i,l,"next",t)}function l(t){Nt(a,n,o,i,l,"throw",t)}i(void 0)})}}var Lt=new Map,kt=function(){var t=Tt(Et().m(function t(e,r,n){var o,a,i,l,u,s,c,f;return Et().w(function(t){for(;;)switch(t.n){case 0:if(o=xt(e,n)){t.n=1;break}return t.a(2,null);case 1:if(a=jt(e,r,n)){t.n=2;break}return t.a(2,null);case 2:if(i=Lt.get(a)){t.n=4;break}return l=St(e.fillPatternForegroundColor,r)||"black",u=St(e.fillPatternBackgroundColor,r)||"transparent",s=Ot(o,l,u),c='<rect width="16" height="16" fill="'.concat(u,'"/>'),f='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">'.concat(c).concat(s,"</svg>"),t.n=3,ut(f,16,16);case 3:i=t.v,Lt.set(a,i);case 4:return t.a(2,{imageId:a,imageData:i})}},t)}));return function(e,r,n){return t.apply(this,arguments)}}(),Rt=function(){var t=Tt(Et().m(function t(e,r,n,o){return Et().w(function(t){for(;;)switch(t.n){case 0:if(r.length){t.n=1;break}return t.a(2);case 1:return t.n=2,Promise.all(r.map(function(){var t=Tt(Et().m(function t(r){var a,i;return Et().w(function(t){for(;;)switch(t.n){case 0:if((a=jt(r,n,o))&&!e.hasImage(a)){t.n=1;break}return t.a(2);case 1:return t.n=2,kt(r,n,o);case 2:(i=t.v)&&e.addImage(i.imageId,i.imageData,{pixelRatio:2});case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()));case 2:return t.a(2)}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),It=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function Ct(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var u=n&&n.prototype instanceof l?n:l,s=Object.create(u.prototype);return Dt(s,"_invoke",function(r,n,o){var a,l,u,s=0,c=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,r){return a=e,l=0,u=t,h.n=r,i}};function y(r,n){for(l=r,u=n,e=0;!f&&s&&!o&&e<c.length;e++){var o,a=c[e],y=h.p,p=a[2];r>3?(o=p===n)&&(u=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=t):a[0]<=y&&((o=r<2&&y<a[1])?(l=0,h.v=n,h.n=a[1]):y<p&&(o=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,h.n=p,l=0))}if(o||r>1)return i;throw f=!0,n}return function(o,c,p){if(s>1)throw TypeError("Generator is already running");for(f&&1===c&&y(c,p),l=c,u=p;(e=l<2?t:u)||!f;){a||(l?l<3?(l>1&&(h.n=-1),y(l,u)):h.n=u:h.v=u);try{if(s=2,a){if(l||(o="next"),e=a[o]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,l<2&&(l=0)}else 1===l&&(e=a.return)&&e.call(a),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=t}else if((e=(f=h.n<0)?u:r.call(n,h))!==i)break}catch(e){a=t,l=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,a),!0),s}var i={};function l(){}function u(){}function s(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(Dt(e={},n,function(){return this}),e),f=s.prototype=l.prototype=Object.create(c);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Dt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Dt(f,"constructor",s),Dt(s,"constructor",u),u.displayName="GeneratorFunction",Dt(s,o,"GeneratorFunction"),Dt(f),Dt(f,o,"Generator"),Dt(f,n,function(){return this}),Dt(f,"toString",function(){return"[object Generator]"}),(Ct=function(){return{w:a,m:h}})()}function Dt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Dt=function(t,e,r,n){function a(e,r){Dt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},Dt(t,e,r,n)}function Ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ft(Object(r),!0).forEach(function(e){Gt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ft(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Gt(t,e,r){return(e=Wt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $t(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function zt(t,e,r,n,o,a,i){try{var l=t[a](i),u=l.value}catch(t){return void r(t)}l.done?e(u):Promise.resolve(u).then(n,o)}function qt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){zt(a,n,o,i,l,"next",t)}function l(t){zt(a,n,o,i,l,"throw",t)}i(void 0)})}}function Zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wt(n.key),n)}}function Wt(t){var e=function(t){if("object"!=_t(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_t(e)?e:e+""}var Ut=function(){return t=function t(e){var r=e.mapFramework,n=e.mapProviderConfig,a=void 0===n?{}:n,i=e.events,l=e.eventBus;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.maplibreModule=r,this.events=i,this.eventBus=l,this.capabilities={supportedShortcuts:o,supportsMapSizes:!0},Object.assign(this,a)},e=[{key:"initMap",value:(i=qt(Ct().m(function t(e){var r,n,o,a,i,l,u,s,c,y,p,g,m,b=this;return Ct().w(function(t){for(;;)switch(t.n){case 0:r=e.container,n=e.padding,o=e.mapStyle,a=e.mapSize,i=e.center,l=e.zoom,u=e.bounds,s=e.pixelRatio,c=$t(e,It),this.mapStyleId=null==o?void 0:o.id,this.mapSize=a,y=this.maplibreModule.Map,p=this.events,g=this.eventBus,(m=new y(Bt(Bt({},c),{},{container:r,style:null==o?void 0:o.url,pixelRatio:s,padding:n,center:i,zoom:l,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}))).touchZoomRotate.disableRotation(),this.map=m,this.map.setPadding(n),u&&m.fitBounds(u,{duration:0}),h(m),f(m),d({map:m,events:p,eventBus:g,getCenter:this.getCenter.bind(this),getZoom:this.getZoom.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),v({mapProvider:this,map:m,events:p,eventBus:g}),m.on("load",function(){b.labelNavigator=Z(m,null==o?void 0:o.mapColorScheme,p,g)}),this.eventBus.emit(p.MAP_READY,{map:this.map,mapStyleId:this.mapStyleId,mapSize:this.mapSize,crs:this.crs});case 1:return t.a(2)}},t,this)})),function(t){return i.apply(this,arguments)})},{key:"destroyMap",value:function(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}},{key:"setHoverCursor",value:function(t){this.map&&(this._onHoverMove=nt(this.map,t,this._onHoverMove))}},{key:"setView",value:function(t){var e=t.center,r=t.zoom;this.map.flyTo({center:e||this.getCenter(),zoom:r||this.getZoom(),duration:this.map.isStyleLoaded()?n:0})}},{key:"zoomIn",value:function(t){this.map.easeTo({zoom:this.getZoom()+t,duration:n})}},{key:"zoomOut",value:function(t){this.map.easeTo({zoom:this.getZoom()-t,duration:n})}},{key:"panBy",value:function(t){this.map.panBy(t,{duration:n})}},{key:"fitToBounds",value:function(t){var e=Array.isArray(t)?t:T(t),r=this.map.isStyleLoaded()?n:0;this.map.fitBounds(e,{duration:r})}},{key:"setPadding",value:function(t){this.map.setPadding(t)}},{key:"updateHighlightedFeatures",value:function(t,e){return function(t){var e=t.LngLatBounds,r=t.map,n=t.selectedFeatures,o=t.stylesMap;if(!r)return null;var a=function(t,e){var r={};return null==e||e.forEach(function(e){var n=e.featureId,o=e.layerId,a=e.idProperty,i=e.geometry,l=t.getLayer(o);if(l){var u=l.source;r[u]||(r[u]={ids:new Set,fillIds:new Set,idProperty:a,layerId:o,hasFillGeometry:!1}),!i||"Polygon"!==i.type&&"MultiPolygon"!==i.type||(r[u].hasFillGeometry=!0,r[u].fillIds.add(n)),r[u].ids.add(n)}}),r}(r,n),i=[],l=new Set(Object.keys(a)),u=r._highlightedSources||new Set;return function(t,e,r){e.forEach(function(e){if(!r.has(e)){var n="highlight-".concat(e);["".concat(n,"-fill"),"".concat(n,"-line"),"".concat(n,"-symbol")].forEach(function(e){t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})}(r,u,l),r._highlightedSources=l,l.forEach(function(t){var e=a[t],n=e.ids,l=e.fillIds,u=e.idProperty,s=e.layerId,c=e.hasFillGeometry,f=r.getLayer(s),h=f.sourceLayer,y=c?"fill":f.type,p="highlight-".concat(t),d=u?["get",u]:["id"],v=["in",d,["literal",U(n)]];if("fill"===y){var g=o[s],m=g.stroke,b=g.strokeWidth,M=g.fill,w=["in",d,["literal",U(l)]],S={"line-color":m,"line-width":b};X(r,"".concat(p,"-fill"),"fill",t,h,{"fill-color":M},w),X(r,"".concat(p,"-line"),"line",t,h,S,v)}if("line"===y){var P=o[s],O={"line-color":P.stroke,"line-width":P.strokeWidth};r.getLayer("".concat(p,"-fill"))&&r.setFilter("".concat(p,"-fill"),["==","id",""]),X(r,"".concat(p,"-line"),"line",t,h,O,v)}if("symbol"===y){var x=r.getLayoutProperty(s,"icon-image"),j=function(t,e){var r,n;return null!==(r=null===(n=t._symbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null}(r,x);j&&function(t,e,r,n,o,a,i){var l;t.getLayer(e)||t.addLayer(J(J({id:e,type:"symbol",source:r},n&&{"source-layer":n}),{},{layout:{"icon-image":a,"icon-anchor":null!==(l=t.getLayoutProperty(o,"icon-anchor"))&&void 0!==l?l:"center","icon-allow-overlap":!0}})),t.setLayoutProperty(e,"icon-image",a),t.setFilter(e,i),t.moveLayer(e)}(r,"".concat(p,"-symbol"),t,h,s,j,v)}i.push.apply(i,U(r.queryRenderedFeatures({layers:[s]}).filter(function(t){var e;return n.has(u?null===(e=t.properties)||void 0===e?void 0:e[u]:t.id)})))}),function(t,e){if(!e.length)return null;var r=new t;return e.forEach(function(t){var e=function(t){return"number"==typeof t[0]?r.extend(t):t.forEach(e)};e(t.geometry.coordinates)}),[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]}(e,i)}({LngLatBounds:this.maplibreModule.LngLatBounds,map:this.map,selectedFeatures:t,stylesMap:e})}},{key:"highlightNextLabel",value:function(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}},{key:"highlightLabelAtCenter",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}},{key:"clearHighlightedLabel",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}},{key:"getCenter",value:function(){var t=this.map.getCenter();return[Number(t.lng.toFixed(7)),Number(t.lat.toFixed(7))]}},{key:"getZoom",value:function(){return Number(this.map.getZoom().toFixed(7))}},{key:"getBounds",value:function(){return this.map.getBounds().toArray().flat(1)}},{key:"getFeaturesAtPoint",value:function(t,e){return function(t,e){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).radius,n=void 0===r?10:r,o=[[e.x-n,e.y-n],[e.x+n,e.y+n]],a=t.queryRenderedFeatures(o);if(0===a.length)return[];var i=new Set(t.queryRenderedFeatures([e.x,e.y]).map(function(t){var e,r=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(r)})),l=[];a.forEach(function(t){!1===l.includes(t.layer.id)&&l.push(t.layer.id)});for(var u=new Set,s=[],c=a.length-1;c>=0;c--){var f,h=a[c],y=void 0===h.id?JSON.stringify(h.properties):h.id,p="".concat(null===(f=h.layer)||void 0===f?void 0:f.source,":").concat(y);!1===u.has(p)&&(u.add(p),s.push(h))}var d=t.unproject(e),v=[d.lng,d.lat],g=s.filter(function(t){var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(function(t){return function(t,e){for(var r=Q(t,2),n=r[0],o=r[1],a=!1,i=0,l=e.length-1;i<e.length;l=i,i++){var u=Q(e[i],2),s=u[0],c=u[1],f=Q(e[l],2),h=f[0],y=f[1];c>o!=y>o&&n<(h-s)*(o-c)/(y-c)+s&&(a=!a)}return a}(v,t[0])});if("Point"===e||"MultiPoint"===e){var r,n=void 0===t.id?JSON.stringify(t.properties):t.id;return i.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(n))}return!0});return g.map(function(r){var n=0,o=r.geometry.type,a=function(t,e,r){var n=r.coordinates,o=r.type,a=1/0,i=function(e){return t.project(e)},l=function(t){for(var r=0;r<t.length-1;r++){var n=et(e,i(t[r]),i(t[r+1]));n<a&&(a=n)}};if("Point"===o){var u=i(n);a=Math.pow(e.x-u.x,2)+Math.pow(e.y-u.y,2)}else"LineString"===o||"MultiPoint"===o?"LineString"===o?l(n):n.forEach(function(t){var r=i(t),n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);n<a&&(a=n)}):"Polygon"===o||"MultiLineString"===o?n.forEach(l):"MultiPolygon"===o&&n.forEach(function(t){return t.forEach(l)});return a}(t,e,r.geometry);return n+=1e6*l.indexOf(r.layer.id),o.includes("Polygon")&&(n-=5e5),{f:r,score:n+=a}}).sort(function(t,e){return t.score-e.score}).map(function(t){return t.f})}(this.map,t,e)}},{key:"registerSymbols",value:(a=qt(Ct().m(function t(e,r,n){var o;return Ct().w(function(t){for(;;)if(0===t.n)return o=(this.map.getPixelRatio()||1)*(c[this.mapSize]||1),t.a(2,Mt(this.map,e,r,n,o))},t,this)})),function(t,e,r){return a.apply(this,arguments)})},{key:"registerPatterns",value:(r=qt(Ct().m(function t(e,r,n){return Ct().w(function(t){for(;;)if(0===t.n)return t.a(2,Rt(this.map,e,r,n))},t,this)})),function(t,e,n){return r.apply(this,arguments)})},{key:"getAreaDimensions",value:function(){return function(t){var e,r,n,o;if(t&&"function"==typeof t.getWest)e=t.getWest(),r=t.getSouth(),n=t.getEast(),o=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";var a=x(t,2),i=x(a[0],2);e=i[0],r=i[1];var l=x(a[1],2);n=l[0],o=l[1]}var u=A([e,r],[n,r]),s=A([e,r],[e,o]),c=N(u),f=N(s);return"".concat(f," by ").concat(c)}((t=this.maplibreModule.LngLatBounds,e=this.map,r=e.getContainer().getBoundingClientRect(),n=r.width,o=r.height,a=e.getPadding(),i=[a.left,o-a.bottom],l=[n-a.right,a.top],new t(e.unproject(i),e.unproject(l))));var t,e,r,n,o,a,i,l}},{key:"getCardinalMove",value:function(t,e){return function(t,e){var r=x(t,2),n=r[0],o=r[1],a=x(e,2),i=a[0],l=a[1],u=l-o,s=i-n,c=[];if(Math.abs(u)>1e-4){var f=Math.round(A([n,o],[n,l]));c.push("".concat(u>0?"north":"south"," ").concat(N(f)))}if(Math.abs(s)>1e-4){var h=Math.round(A([n,o],[i,o]));c.push("".concat(s>0?"east":"west"," ").concat(N(h)))}return c.join(", ")}(t,e)}},{key:"getResolution",value:function(){return t=this.map.getCenter(),e=this.map.getZoom(),r=t.lat,n=Math.pow(2,e),40075016.686*Math.cos(r*Math.PI/180)/(512*n);var t,e,r,n}},{key:"mapToScreen",value:function(t){return this.map.project(t)}},{key:"screenToMap",value:function(t){var e=this.map.unproject([t.x,t.y]);return[e.lng,e.lat]}},{key:"isGeometryObscured",value:function(t,e){return function(t,e,r){var n=r.getContainer().getBoundingClientRect(),o=x(T(t),4),a=o[0],i=o[1],l=o[2],u=o[3],s=[r.project([a,i]),r.project([a,u]),r.project([l,i]),r.project([l,u])],c=Math.min.apply(Math,O(s.map(function(t){return t.x}))),f=Math.max.apply(Math,O(s.map(function(t){return t.x}))),h=Math.min.apply(Math,O(s.map(function(t){return t.y}))),y=Math.max.apply(Math,O(s.map(function(t){return t.y}))),p=e.left-n.left,d=e.top-n.top,v=e.right-n.left,g=e.bottom-n.top;return c<v&&f>p&&h<g&&y>d}(t,e,this.map)}}],e&&Zt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,a,i}()}}]);
2
+ "use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[772],{335(t,e,r){r.r(e),r.d(e,{default:()=>Ut});var n=400,o=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];r(738);new Set,new Set,r(287);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){u(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function u(t,e,r){return(e=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s={slot:"middle",open:!1,dismissible:!0,modal:!0},c=(l({},s),l(l({},s),{},{width:"500px"}),l(l({},s),{},{width:"500px"}),{small:1,medium:1.5,large:2});function f(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block"}function h(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var r=t.getCanvas();if(r&&(this.target===r||r.contains(this.target)))return}e.call(this)}}var y=function(t,e){var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o)},e)};return n.cancel=function(){r&&(clearTimeout(r),r=null)},n};function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function d(t){var e=t.map,r=t.events,n=t.eventBus,o=t.getCenter,a=t.getZoom,i=t.getBounds,l=t.getResolution,u=[],s=[],c=function(){var t=a();return{center:o(),bounds:i(),resolution:l(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},f=function(t,e){return n.emit(t,e)},h=function(){return f(r.MAP_LOADED)};e.on("load",h),u.push(["load",h]),e.once("idle",function(){return f(r.MAP_FIRST_IDLE,c())});var d=function(){return f(r.MAP_MOVE_START)};e.on("movestart",d),u.push(["movestart",d]);var v=y(function(){f(r.MAP_MOVE_END,c())},500);e.on("moveend",v),u.push(["moveend",v]),s.push(v);var g,m,b=(g=function(){f(r.MAP_MOVE,c())},m=0,function(){var t=Date.now();t-m>=10&&(m=t,g.apply(void 0,arguments))});e.on("zoom",b),u.push(["zoom",b]),s.push(b);var M=function(){return f(r.MAP_RENDER)};e.on("render",M),u.push(["render",M]);var w=y(function(){f(r.MAP_DATA_CHANGE,c())},500);e.on("styledata",w),u.push(["styledata",w]),s.push(w);var S=function(){return f(r.MAP_STYLE_CHANGE)};e.on("style.load",S),u.push(["style.load",S]);var P=function(t){return f(r.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]})};return e.on("click",P),u.push(["click",P]),{remove:function(){s.forEach(function(t){return t.cancel()}),u.forEach(function(t){var r,n,o=(n=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(r,n)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],i=o[1];return e.off(a,i)})}}}function v(t){var e=t.mapProvider,r=t.map,n=t.events,o=t.eventBus,a=function(t){r.once("style.load",function(){o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},i=function(t){r.setPixelRatio(t)},l=function(t){var r=t.mapSize;e.mapSize=r};return o.on(n.MAP_SET_STYLE,a),o.on(n.MAP_SET_PIXEL_RATIO,i),o.on(n.MAP_SIZE_CHANGE,l),{remove:function(){o.off(n.MAP_SET_STYLE,a),o.off(n.MAP_SET_PIXEL_RATIO,i),o.off(n.MAP_SIZE_CHANGE,l)}}}let g=" ";class m{static get separator(){return g}static set separator(t){g=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,o=null,a=null,i=null;switch(e){default:case"d":case"deg":o=t.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),n=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),a=(60*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),o++),o=("000"+o).slice(-3),a<10&&(a="0"+a),n=o+"°"+m.separator+a+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),a=Math.floor(3600*t/60)%60,i=(3600*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),a++),60==a&&(a=0,o++),o=("000"+o).slice(-3),a=("00"+a).slice(-2),i<10&&(i="0"+i),n=o+"°"+m.separator+a+"′"+m.separator+i+"″"}return n}static toLat(t,e,r){const n=m.toDms(m.wrap90(t),e,r);return null===n?"–":n.slice(1)+m.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=m.toDms(m.wrap180(t),e,r);return null===n?"–":n+m.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=m.toDms(m.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=m.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const b=m,M=Math.PI;class w{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=b.wrap90(Number(t)),this._lon=b.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?b.wrap90(b.parse(t)):b.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?b.wrap90(b.parse(t)):b.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?b.wrap180(b.parse(t)):b.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?b.wrap180(b.parse(t)):b.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?b.wrap180(b.parse(t)):b.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,r;if(2==t.length&&([e,r]=t,e=b.wrap90(b.parse(e)),r=b.wrap180(b.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,r]=t[0].split(","),e=b.wrap90(b.parse(e)),r=b.wrap180(b.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const n=t[0];if("Point"==n.type&&Array.isArray(n.coordinates)?[r,e]=n.coordinates:(null!=n.latitude&&(e=n.latitude),null!=n.lat&&(e=n.lat),null!=n.longitude&&(r=n.longitude),null!=n.lng&&(r=n.lng),null!=n.lon&&(r=n.lon),e=b.wrap90(b.parse(e)),r=b.wrap180(b.parse(r))),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${t.toString()}’`);return new w(e,r)}distanceTo(t,e=6371e3){if(t instanceof w||(t=w.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const r=e,n=this.lat.toRadians(),o=this.lon.toRadians(),a=t.lat.toRadians(),i=a-n,l=t.lon.toRadians()-o,u=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n)*Math.cos(a)*Math.sin(l/2)*Math.sin(l/2);return r*(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))}initialBearingTo(t){if(t instanceof w||(t=w.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),o=Math.cos(e)*Math.sin(r)-Math.sin(e)*Math.cos(r)*Math.cos(n),a=Math.sin(n)*Math.cos(r),i=Math.atan2(a,o).toDegrees();return b.wrap360(i)}finalBearingTo(t){t instanceof w||(t=w.parse(t));const e=t.initialBearingTo(this)+180;return b.wrap360(e)}midpointTo(t){t instanceof w||(t=w.parse(t));const e=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),a=Math.cos(e),i=Math.sin(e),l={x:a+Math.cos(n)*Math.cos(o),y:0+Math.cos(n)*Math.sin(o),z:i+Math.sin(n)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),s=r+Math.atan2(l.y,l.x),c=u.toDegrees(),f=s.toDegrees();return new w(c,f)}intermediatePointTo(t,e){if(t instanceof w||(t=w.parse(t)),this.equals(t))return new w(this.lat,this.lon);const r=this.lat.toRadians(),n=this.lon.toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=o-r,l=a-n,u=Math.sin(i/2)*Math.sin(i/2)+Math.cos(r)*Math.cos(o)*Math.sin(l/2)*Math.sin(l/2),s=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),c=Math.sin((1-e)*s)/Math.sin(s),f=Math.sin(e*s)/Math.sin(s),h=c*Math.cos(r)*Math.cos(n)+f*Math.cos(o)*Math.cos(a),y=c*Math.cos(r)*Math.sin(n)+f*Math.cos(o)*Math.sin(a),p=c*Math.sin(r)+f*Math.sin(o),d=Math.atan2(p,Math.sqrt(h*h+y*y)),v=Math.atan2(y,h),g=d.toDegrees(),m=v.toDegrees();return new w(g,m)}destinationPoint(t,e,r=6371e3){const n=t/r,o=Number(e).toRadians(),a=this.lat.toRadians(),i=this.lon.toRadians(),l=Math.sin(a)*Math.cos(n)+Math.cos(a)*Math.sin(n)*Math.cos(o),u=Math.asin(l),s=Math.sin(o)*Math.sin(n)*Math.cos(a),c=Math.cos(n)-Math.sin(a)*l,f=i+Math.atan2(s,c),h=u.toDegrees(),y=f.toDegrees();return new w(h,y)}static intersection(t,e,r,n){if(t instanceof w||(t=w.parse(t)),r instanceof w||(r=w.parse(r)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(n))throw new TypeError(`invalid brng2 ‘${n}’`);const o=t.lat.toRadians(),a=t.lon.toRadians(),i=r.lat.toRadians(),l=r.lon.toRadians(),u=Number(e).toRadians(),s=Number(n).toRadians(),c=i-o,f=l-a,h=2*Math.asin(Math.sqrt(Math.sin(c/2)*Math.sin(c/2)+Math.cos(o)*Math.cos(i)*Math.sin(f/2)*Math.sin(f/2)));if(Math.abs(h)<Number.EPSILON)return new w(t.lat,t.lon);const y=(Math.sin(i)-Math.sin(o)*Math.cos(h))/(Math.sin(h)*Math.cos(o)),p=(Math.sin(o)-Math.sin(i)*Math.cos(h))/(Math.sin(h)*Math.cos(i)),d=Math.acos(Math.min(Math.max(y,-1),1)),v=Math.acos(Math.min(Math.max(p,-1),1)),g=u-(Math.sin(l-a)>0?d:2*M-d),m=(Math.sin(l-a)>0?2*M-v:v)-s;if(0==Math.sin(g)&&0==Math.sin(m))return null;if(Math.sin(g)*Math.sin(m)<0)return null;const b=-Math.cos(g)*Math.cos(m)+Math.sin(g)*Math.sin(m)*Math.cos(h),S=Math.atan2(Math.sin(h)*Math.sin(g)*Math.sin(m),Math.cos(m)+Math.cos(g)*b),P=Math.asin(Math.min(Math.max(Math.sin(o)*Math.cos(S)+Math.cos(o)*Math.sin(S)*Math.cos(u),-1),1)),O=a+Math.atan2(Math.sin(u)*Math.sin(S)*Math.cos(o),Math.cos(S)-Math.sin(o)*Math.sin(P)),x=P.toDegrees(),j=O.toDegrees();return new w(x,j)}crossTrackDistanceTo(t,e,r=6371e3){t instanceof w||(t=w.parse(t)),e instanceof w||(e=w.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(o)*Math.sin(a-i))*n}alongTrackDistanceTo(t,e,r=6371e3){t instanceof w||(t=w.parse(t)),e instanceof w||(e=w.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians(),l=Math.asin(Math.sin(o)*Math.sin(a-i));return Math.acos(Math.cos(o)/Math.abs(Math.cos(l)))*Math.sign(Math.cos(i-a))*n}maxLatitude(t){const e=Number(t).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(r))).toDegrees()}static crossingParallels(t,e,r){if(t.equals(e))return null;const n=Number(r).toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=e.lat.toRadians(),l=e.lon.toRadians()-a,u=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.sin(l),s=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.cos(l)-Math.cos(o)*Math.sin(i)*Math.cos(n),c=Math.cos(o)*Math.cos(i)*Math.sin(n)*Math.sin(l);if(c*c>u*u+s*s)return null;const f=Math.atan2(-s,u),h=Math.acos(c/Math.sqrt(u*u+s*s)),y=a+f+h,p=(a+f-h).toDegrees(),d=y.toDegrees();return{lon1:b.wrap180(p),lon2:b.wrap180(d)}}rhumbDistanceTo(t,e=6371e3){t instanceof w||(t=w.parse(t));const r=e,n=this.lat.toRadians(),o=t.lat.toRadians(),a=o-n;let i=Math.abs(t.lon-this.lon).toRadians();Math.abs(i)>M&&(i=i>0?-(2*M-i):2*M+i);const l=Math.log(Math.tan(o/2+M/4)/Math.tan(n/2+M/4)),u=Math.abs(l)>1e-11?a/l:Math.cos(n);return Math.sqrt(a*a+u*u*i*i)*r}rhumbBearingTo(t){if(t instanceof w||(t=w.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians();let n=(t.lon-this.lon).toRadians();Math.abs(n)>M&&(n=n>0?-(2*M-n):2*M+n);const o=Math.log(Math.tan(r/2+M/4)/Math.tan(e/2+M/4)),a=Math.atan2(n,o).toDegrees();return b.wrap360(a)}rhumbDestinationPoint(t,e,r=6371e3){const n=this.lat.toRadians(),o=this.lon.toRadians(),a=Number(e).toRadians(),i=t/r,l=i*Math.cos(a);let u=n+l;Math.abs(u)>M/2&&(u=u>0?M-u:-M-u);const s=Math.log(Math.tan(u/2+M/4)/Math.tan(n/2+M/4)),c=Math.abs(s)>1e-11?l/s:Math.cos(n),f=o+i*Math.sin(a)/c,h=u.toDegrees(),y=f.toDegrees();return new w(h,y)}rhumbMidpointTo(t){t instanceof w||(t=w.parse(t));const e=this.lat.toRadians();let r=this.lon.toRadians();const n=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-r)>M&&(r+=2*M);const a=(e+n)/2,i=Math.tan(M/4+e/2),l=Math.tan(M/4+n/2),u=Math.tan(M/4+a/2);let s=((o-r)*Math.log(u)+r*Math.log(l)-o*Math.log(i))/Math.log(l/i);isFinite(s)||(s=(r+o)/2);const c=a.toDegrees(),f=s.toDegrees();return new w(c,f)}static areaOf(t,e=6371e3){const r=e,n=t[0].equals(t[t.length-1]);n||t.push(t[0]);const o=t.length-1;let a=0;for(let e=0;e<o;e++){const r=t[e].lat.toRadians(),n=t[e+1].lat.toRadians(),o=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(o/2)*(Math.tan(r/2)+Math.tan(n/2)),1+Math.tan(r/2)*Math.tan(n/2))}(function(t){let e=0,r=t[0].initialBearingTo(t[1]);for(let n=0;n<t.length-1;n++){const o=t[n].initialBearingTo(t[n+1]),a=t[n].finalBearingTo(t[n+1]);e+=(o-r+540)%360-180,e+=(a-o+540)%360-180,r=a}return e+=(t[0].initialBearingTo(t[1])-r+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*M);const i=Math.abs(a*r*r);return n||t.pop(),i}equals(t){return t instanceof w||(t=w.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`):`${b.toLat(this.lat,t,e)}, ${b.toLon(this.lon,t,e)}`}}function S(t,e,r){if(null!==t)for(var n,o,a,i,l,u,s,c,f=0,h=0,y=t.type,p="FeatureCollection"===y,d="Feature"===y,v=p?t.features.length:1,g=0;g<v;g++){l=(c=!!(s=p?t.features[g].geometry:d?t.geometry:t)&&"GeometryCollection"===s.type)?s.geometries.length:1;for(var m=0;m<l;m++){var b=0,M=0;if(null!==(i=c?s.geometries[m]:s)){u=i.coordinates;var w=i.type;switch(f=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,h,g,b,M))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===e(u[n],h,g,b,M))return!1;h++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(o=0;o<u[n].length-f;o++){if(!1===e(u[n][o],h,g,b,M))return!1;h++}"MultiLineString"===w&&b++,"Polygon"===w&&M++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(M=0,o=0;o<u[n].length;o++){for(a=0;a<u[n][o].length-f;a++){if(!1===e(u[n][o][a],h,g,b,M))return!1;h++}M++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===S(i.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var P=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return S(t,t=>{r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r};function O(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||j(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||j(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var A=function(t,e){var r=x(t,2),n=r[0],o=r[1],a=x(e,2),i=a[0],l=a[1],u=new w(o,n),s=new w(l,i);return u.distanceTo(s)},N=function(t){var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var r=Number.parseFloat(e.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(e);return"".concat(o," miles")},T=function(t){return P(t)};function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach(function(e){C(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function C(t,e,r){return(e=function(t){var e=function(t){if("object"!=R(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==R(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var F="highlighted-label";function B(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var r=t.stops;if(r.length<2)return r.length>0?r[0][1]:0;for(var n=r[0],o=r[r.length-1],a=1;a<r.length;a++){var i=r[a];if(i[0]>e){o=i,n=r[a-1];break}n=r[a-1],o=i}var l=L(n,2),u=l[0],s=l[1],c=L(o,2),f=c[0],h=c[1];return e<=u?s:e>=f?h:s+(e-u)/(f-u)*(h-s)}(t,e);var r,n=function(t){if(Array.isArray(t))return t}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[2],a=D(n).slice(3);if("zoom"!==o[0])throw new Error("Only zoom-based expressions supported");for(var i=0;i<a.length-2;i+=2){var l=a[i],u=a[i+1],s=a[i+2],c=a[i+3];if(e<=l)return u;if(e<=s)return u+(e-l)/(s-l)*(c-u)}return a[a.length-1]}function G(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function $(t,e,r){var n,o,a,i;if(null!=e&&null!==(n=e.feature)&&void 0!==n&&n.layer){G(t,r);var l=e.feature,u=e.layer;r.highlightLayerId="highlight-".concat(u.id);var s=l.id,c=l.type,f=l.properties,h=l.geometry;t.getSource(F).setData({id:s,type:c,properties:f,geometry:h}),r.highlightedExpr=u.layout["text-size"];var y=t.getZoom(),p=(o=u,a=1.5*B(r.highlightedExpr,y),i=r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"},{id:"highlight-".concat(o.id),type:o.type,source:F,layout:_(_({},o.layout),{},{"text-size":a,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:_(_({},o.paint),{},{"text-color":i.text,"text-halo-color":i.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})});t.addLayer(p),t.moveLayer(r.highlightLayerId)}}function z(t){t.getSource(F)||t.addSource(F,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function q(t){t.getStyle().layers.filter(function(t){var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(function(e){return t.setLayoutProperty(e.id,"symbol-placement","line-center")})}function Z(t,e,r,n){var o={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function a(){var e=t.getStyle().layers.filter(function(t){return"symbol"===t.type}),r=t.queryRenderedFeatures({layers:e.map(function(t){return t.id})});o.labels=function(t,e,r){return e.flatMap(function(e){var n,o,a,i,l="string"==typeof(o=null===(n=e.layout)||void 0===n?void 0:n["text-field"])?null===(a=/^{(.+)}$/.exec(o))||void 0===a?void 0:a[1]:Array.isArray(o)?null===(i=o.find(function(t){return Array.isArray(t)&&"get"===t[0]}))||void 0===i?void 0:i[1]:null;return l?r.filter(function(t){var r;return t.layer.id===e.id&&(null===(r=t.properties)||void 0===r?void 0:r[l])}).map(function(r){return function(t,e,r,n){var o=function(t){var e=t.type,r=t.coordinates;if("Point"===e)return r;if("MultiPoint"===e)return r[0];if(e.includes("LineString")){var n="LineString"===e?r:r[0];return[(n[0][0]+n[n.length-1][0])/2,(n[0][1]+n[n.length-1][1])/2]}if(e.includes("Polygon")){var o="Polygon"===e?r[0]:r[0][0],a=o.reduce(function(t,e){return[t[0]+e[0],t[1]+e[1]]},[0,0]);return[a[0]/o.length,a[1]/o.length]}return null}(t.geometry);if(!o)return null;var a=n.project({lng:o[0],lat:o[1]});return{text:t.properties[r],x:a.x,y:a.y,feature:t,layer:e}}(r,e,l,t)}).filter(Boolean):[]})}(t,e,r)}function i(){if(a(),!o.labels.length)return null;var e=t.project(t.getCenter()),r=function(t,e){var r;return null===(r=t.reduce(function(t,r){var n=Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2);return!t||n<t.dist?{label:r,dist:n}:t},null))||void 0===r?void 0:r.label}(o.labels,e);return o.currentPixel={x:r.x,y:r.y},$(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")}return q(t),z(t),null==n||n.on(r.MAP_SET_STYLE,function(e){t.once("styledata",function(){return t.once("idle",function(){q(t),z(t),o.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)})})}),t.on("zoom",function(){if(o.highlightLayerId&&o.highlightedExpr){var e=B(o.highlightedExpr,t.getZoom());t.setLayoutProperty(o.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(function(t){return"symbol"===t.type}).forEach(function(e){t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:a,highlightNextLabel:function(e){if(a(),!o.labels.length)return null;if(!o.currentPixel)return i();var r=function(t,e){if(!e.currentPixel)return null;var r=e.labels.map(function(t,e){return{pixel:[t.x,t.y],index:e}}).filter(function(t){return t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y});if(!r.length)return null;var n=r.map(function(t){return t.pixel}),o=function(t,e,r){var n=x(e,2),o=n[0],a=n[1],i=r.filter(function(e){var r=x(e,2),n=r[0],i=r[1];return(n!==o||i!==a)&&function(t,e,r){switch(t){case"ArrowUp":return r<0&&Math.abs(r)>=Math.abs(e);case"ArrowDown":return r>0&&Math.abs(r)>=Math.abs(e);case"ArrowLeft":return e<0&&Math.abs(e)>Math.abs(r);case"ArrowRight":return e>0&&Math.abs(e)>Math.abs(r);default:return!1}}(t,n-o,i-a)});if(!i.length)return r.findIndex(function(t){return t[0]===o&&t[1]===a});var l=-1,u=1/0;return i.forEach(function(t){var e=t[0]-o,n=t[1]-a,i=e*e+n*n;i<u&&(u=i,l=r.indexOf(t))}),l}(t,[e.currentPixel.x,e.currentPixel.y],n);return(null==o||o<0||o>=r.length)&&(o=0),e.labels[r[o].index]}(e,o);return r?(o.currentPixel={x:r.x,y:r.y},$(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")):null},highlightLabelAtCenter:i,clearHighlightedLabel:function(){return G(t,o)}}}function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function U(t){return function(t){if(Array.isArray(t))return V(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||H(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){if(t){if("string"==typeof t)return V(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(t,e):void 0}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function J(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(r),!0).forEach(function(e){K(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function K(t,e,r){return(e=function(t){var e=function(t){if("object"!=W(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=W(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==W(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var X=function(t,e,r,n,o,a,i){t.getLayer(e)||t.addLayer(J(J({id:e,type:r,source:n},o&&{"source-layer":o}),{},{paint:a})),Object.entries(a).forEach(function(r){var n,o,a=(o=2,function(t){if(Array.isArray(t))return t}(n=r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(n,o)||H(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=a[0],l=a[1];t.setPaintProperty(e,i,l)}),t.setFilter(e,i),t.moveLayer(e)};function Q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return tt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var et=function(t,e,r){var n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);if(0===n)return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2);var o=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return o=Math.max(0,Math.min(1,o)),Math.pow(t.x-(e.x+o*(r.x-e.x)),2)+Math.pow(t.y-(e.y+o*(r.y-e.y)),2)};function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var nt=function(t,e,r){var n=t.getCanvas();if(r&&t.off("mousemove",r),null==e||!e.length)return n.style.cursor="",null;var o=function(r){var o=e.filter(function(e){return t.getLayer(e)});if(0!==o.length){var a=function(t,e){var r,n=[],o=[],a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return rt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if("line"===t.getLayer(i).type){var l=i.endsWith("-stroke")?i.slice(0,-7):null;null!==l&&e.includes(l)||n.push(i)}else o.push(i)}}catch(t){a.e(t)}finally{a.f()}return{lineLayers:n,otherLayers:o}}(t,o),i=a.lineLayers,l=a.otherLayers,u=r.point,s=u.x,c=u.y,f=[[s-10,c-10],[s+10,c+10]],h=i.length>0&&t.queryRenderedFeatures(f,{layers:i}).length>0,y=l.length>0&&t.queryRenderedFeatures(r.point,{layers:l}).length>0;n.style.cursor=h||y?"pointer":""}else n.style.cursor=""};return t.on("mousemove",o),o},ot=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),at=function(t,e){return t.symbolSvgContent?{svg:t.symbolSvgContent}:t.symbol?e.get(t.symbol):void 0},it=function(t){if(!function(t){return!(!t.symbol&&!t.symbolSvgContent)}(t))return{};var e={};return ot.forEach(function(r){if(null!=t[r]){var n=r.charAt(6).toLowerCase()+r.slice(7);e[n]=t[r]}}),e},lt=function(t,e){var r;return t.symbolViewBox?t.symbolViewBox:null!==(r=null==e?void 0:e.viewBox)&&void 0!==r?r:"0 0 38 38"},ut=function(t,e,r){return new Promise(function(n,o){var a=new Blob([t],{type:"image/svg+xml"}),i=URL.createObjectURL(a),l=new Image(e,r);l.onload=function(){var t=document.createElement("canvas");t.width=e,t.height=r;var o=t.getContext("2d");o.drawImage(l,0,0,e,r),URL.revokeObjectURL(i),n(o.getImageData(0,0,e,r))},l.onerror=function(){URL.revokeObjectURL(i),o(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},l.src=i})};function st(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var u=n&&n.prototype instanceof l?n:l,s=Object.create(u.prototype);return ct(s,"_invoke",function(r,n,o){var a,l,u,s=0,c=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,r){return a=e,l=0,u=t,h.n=r,i}};function y(r,n){for(l=r,u=n,e=0;!f&&s&&!o&&e<c.length;e++){var o,a=c[e],y=h.p,p=a[2];r>3?(o=p===n)&&(u=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=t):a[0]<=y&&((o=r<2&&y<a[1])?(l=0,h.v=n,h.n=a[1]):y<p&&(o=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,h.n=p,l=0))}if(o||r>1)return i;throw f=!0,n}return function(o,c,p){if(s>1)throw TypeError("Generator is already running");for(f&&1===c&&y(c,p),l=c,u=p;(e=l<2?t:u)||!f;){a||(l?l<3?(l>1&&(h.n=-1),y(l,u)):h.n=u:h.v=u);try{if(s=2,a){if(l||(o="next"),e=a[o]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,l<2&&(l=0)}else 1===l&&(e=a.return)&&e.call(a),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=t}else if((e=(f=h.n<0)?u:r.call(n,h))!==i)break}catch(e){a=t,l=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,a),!0),s}var i={};function l(){}function u(){}function s(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(ct(e={},n,function(){return this}),e),f=s.prototype=l.prototype=Object.create(c);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,ct(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,ct(f,"constructor",s),ct(s,"constructor",u),u.displayName="GeneratorFunction",ct(s,o,"GeneratorFunction"),ct(f),ct(f,o,"Generator"),ct(f,n,function(){return this}),ct(f,"toString",function(){return"[object Generator]"}),(st=function(){return{w:a,m:h}})()}function ct(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}ct=function(t,e,r,n){function a(e,r){ct(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},ct(t,e,r,n)}function ft(t,e,r,n,o,a,i){try{var l=t[a](i),u=l.value}catch(t){return void r(t)}l.done?e(u):Promise.resolve(u).then(n,o)}function ht(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){ft(a,n,o,i,l,"next",t)}function l(t){ft(a,n,o,i,l,"throw",t)}i(void 0)})}}function yt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||pt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pt(t,e){if(t){if("string"==typeof t)return dt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dt(t,e):void 0}}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var vt=function(t){var e,r=0,n=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=pt(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){i=!0,o=t},f:function(){try{a||null==e.return||e.return()}finally{if(i)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r=Math.trunc((r<<5)-r+o.codePointAt(0))}}catch(t){n.e(t)}finally{n.f()}return Math.abs(r).toString(36)},gt=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,a=at(t,r);if(!a)return null;var i=it(t),l=n?r.resolveSelected(a,i,e):r.resolve(a,i,e);return"symbol-".concat(n?"sel-":"").concat(vt(l),"-").concat(o,"x")},mt=new Map,bt=function(){var t=ht(st().m(function t(e,r,n,o,a){var i,l,u,s,c,f,h,y,p,d,v;return st().w(function(t){for(;;)switch(t.n){case 0:if(i=at(e,n)){t.n=1;break}return t.a(2,null);case 1:if(l=it(e),u=o?n.resolveSelected(i,l,r):n.resolve(i,l,r),s="symbol-".concat(o?"sel-":"").concat(vt(u),"-").concat(a,"x"),c=mt.get(s)){t.n=3;break}return f=lt(e,i),h=f.split(" ").map(Number),y=yt(h,4),p=y[2],d=y[3],v='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(p*a,'" height="').concat(d*a,'" viewBox="').concat(f,'">').concat(u,"</svg>"),t.n=2,ut(v,p*a,d*a);case 2:c=t.v,mt.set(s,c);case 3:return t.a(2,{imageId:s,imageData:c})}},t)}));return function(e,r,n,o,a){return t.apply(this,arguments)}}(),Mt=function(){var t=ht(st().m(function t(e,r,n,o){var a,i=arguments;return st().w(function(t){for(;;)switch(t.n){case 0:if(a=i.length>4&&void 0!==i[4]?i[4]:2,r.length){t.n=1;break}return t.a(2);case 1:return e._symbolImageMap={},t.n=2,Promise.all(r.flatMap(function(t){var r=gt(t,n,o,!1,a),i=gt(t,n,o,!0,a);return r&&i&&(e._symbolImageMap[r]=i),[!1,!0].map(function(){var l=ht(st().m(function l(u){var s,c;return st().w(function(l){for(;;)switch(l.n){case 0:if((s=u?i:r)&&!e.hasImage(s)){l.n=1;break}return l.a(2);case 1:return l.n=2,bt(t,n,o,u,a);case 2:(c=l.v)&&!e.hasImage(c.imageId)&&e.addImage(c.imageId,c.imageData,{pixelRatio:a});case 3:return l.a(2)}},l)}));return function(t){return l.apply(this,arguments)}}())}));case 2:return t.a(2)}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}();function wt(t){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(t)}var St=function(t,e){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===wt(t)){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null};function Pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Ot=function(t,e,r){return t.replace(/\{\{foregroundColor\}\}/g,e||"black").replace(/\{\{backgroundColor\}\}/g,r||"transparent")},xt=function(t,e){return t.fillPatternSvgContent?t.fillPatternSvgContent:t.fillPattern&&null!==(r=null==e||null===(n=e.get(t.fillPattern))||void 0===n?void 0:n.svgContent)&&void 0!==r?r:null;var r,n},jt=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=xt(t,r);if(!o)return null;var a=St(t.fillPatternForegroundColor,e)||"black",i=St(t.fillPatternBackgroundColor,e)||"transparent",l=Math.max(2,n);return"pattern-".concat(function(t){var e,r=0,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}(t);try{for(n.s();!(e=n.n()).done;)r=(r<<5)-r+e.value.codePointAt(0),r&=r}catch(t){n.e(t)}finally{n.f()}return Math.abs(r).toString(36)}(o+a+i),"-").concat(l,"x")};function Et(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var u=n&&n.prototype instanceof l?n:l,s=Object.create(u.prototype);return At(s,"_invoke",function(r,n,o){var a,l,u,s=0,c=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,r){return a=e,l=0,u=t,h.n=r,i}};function y(r,n){for(l=r,u=n,e=0;!f&&s&&!o&&e<c.length;e++){var o,a=c[e],y=h.p,p=a[2];r>3?(o=p===n)&&(u=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=t):a[0]<=y&&((o=r<2&&y<a[1])?(l=0,h.v=n,h.n=a[1]):y<p&&(o=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,h.n=p,l=0))}if(o||r>1)return i;throw f=!0,n}return function(o,c,p){if(s>1)throw TypeError("Generator is already running");for(f&&1===c&&y(c,p),l=c,u=p;(e=l<2?t:u)||!f;){a||(l?l<3?(l>1&&(h.n=-1),y(l,u)):h.n=u:h.v=u);try{if(s=2,a){if(l||(o="next"),e=a[o]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,l<2&&(l=0)}else 1===l&&(e=a.return)&&e.call(a),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=t}else if((e=(f=h.n<0)?u:r.call(n,h))!==i)break}catch(e){a=t,l=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,a),!0),s}var i={};function l(){}function u(){}function s(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(At(e={},n,function(){return this}),e),f=s.prototype=l.prototype=Object.create(c);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,At(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,At(f,"constructor",s),At(s,"constructor",u),u.displayName="GeneratorFunction",At(s,o,"GeneratorFunction"),At(f),At(f,o,"Generator"),At(f,n,function(){return this}),At(f,"toString",function(){return"[object Generator]"}),(Et=function(){return{w:a,m:h}})()}function At(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}At=function(t,e,r,n){function a(e,r){At(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},At(t,e,r,n)}function Nt(t,e,r,n,o,a,i){try{var l=t[a](i),u=l.value}catch(t){return void r(t)}l.done?e(u):Promise.resolve(u).then(n,o)}function Tt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){Nt(a,n,o,i,l,"next",t)}function l(t){Nt(a,n,o,i,l,"throw",t)}i(void 0)})}}var Lt=new Map,kt=function(){var t=Tt(Et().m(function t(e,r,n,o){var a,i,l,u,s,c,f,h,y,p;return Et().w(function(t){for(;;)switch(t.n){case 0:if(a=xt(e,n)){t.n=1;break}return t.a(2,null);case 1:if(i=jt(e,r,n,o)){t.n=2;break}return t.a(2,null);case 2:if(l=Lt.get(i)){t.n=4;break}return u=St(e.fillPatternForegroundColor,r)||"black",s=St(e.fillPatternBackgroundColor,r)||"transparent",c=Ot(a,u,s),f='<rect width="16" height="16" fill="'.concat(s,'"/>'),h=Math.max(2,o),y=Math.round(8*h),p='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(y,'" height="').concat(y,'" viewBox="0 0 16 16">').concat(f).concat(c,"</svg>"),t.n=3,ut(p,y,y);case 3:l=t.v,Lt.set(i,l);case 4:return t.a(2,{imageId:i,imageData:l})}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),Rt=function(){var t=Tt(Et().m(function t(e,r,n,o,a){var i;return Et().w(function(t){for(;;)switch(t.n){case 0:if(r.length){t.n=1;break}return t.a(2);case 1:return i=Math.max(2,a),t.n=2,Promise.all(r.map(function(){var t=Tt(Et().m(function t(r){var l,u;return Et().w(function(t){for(;;)switch(t.n){case 0:if((l=jt(r,n,o,a))&&!e.hasImage(l)){t.n=1;break}return t.a(2);case 1:return t.n=2,kt(r,n,o,a);case 2:(u=t.v)&&e.addImage(u.imageId,u.imageData,{pixelRatio:i});case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()));case 2:return t.a(2)}},t)}));return function(e,r,n,o,a){return t.apply(this,arguments)}}(),It=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function Ct(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var u=n&&n.prototype instanceof l?n:l,s=Object.create(u.prototype);return Dt(s,"_invoke",function(r,n,o){var a,l,u,s=0,c=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,r){return a=e,l=0,u=t,h.n=r,i}};function y(r,n){for(l=r,u=n,e=0;!f&&s&&!o&&e<c.length;e++){var o,a=c[e],y=h.p,p=a[2];r>3?(o=p===n)&&(u=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=t):a[0]<=y&&((o=r<2&&y<a[1])?(l=0,h.v=n,h.n=a[1]):y<p&&(o=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,h.n=p,l=0))}if(o||r>1)return i;throw f=!0,n}return function(o,c,p){if(s>1)throw TypeError("Generator is already running");for(f&&1===c&&y(c,p),l=c,u=p;(e=l<2?t:u)||!f;){a||(l?l<3?(l>1&&(h.n=-1),y(l,u)):h.n=u:h.v=u);try{if(s=2,a){if(l||(o="next"),e=a[o]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,l<2&&(l=0)}else 1===l&&(e=a.return)&&e.call(a),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);a=t}else if((e=(f=h.n<0)?u:r.call(n,h))!==i)break}catch(e){a=t,l=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,a),!0),s}var i={};function l(){}function u(){}function s(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(Dt(e={},n,function(){return this}),e),f=s.prototype=l.prototype=Object.create(c);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Dt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Dt(f,"constructor",s),Dt(s,"constructor",u),u.displayName="GeneratorFunction",Dt(s,o,"GeneratorFunction"),Dt(f),Dt(f,o,"Generator"),Dt(f,n,function(){return this}),Dt(f,"toString",function(){return"[object Generator]"}),(Ct=function(){return{w:a,m:h}})()}function Dt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Dt=function(t,e,r,n){function a(e,r){Dt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},Dt(t,e,r,n)}function Ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ft(Object(r),!0).forEach(function(e){Gt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ft(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Gt(t,e,r){return(e=Wt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $t(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function zt(t,e,r,n,o,a,i){try{var l=t[a](i),u=l.value}catch(t){return void r(t)}l.done?e(u):Promise.resolve(u).then(n,o)}function qt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){zt(a,n,o,i,l,"next",t)}function l(t){zt(a,n,o,i,l,"throw",t)}i(void 0)})}}function Zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wt(n.key),n)}}function Wt(t){var e=function(t){if("object"!=_t(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_t(e)?e:e+""}var Ut=function(){return t=function t(e){var r=e.mapFramework,n=e.mapProviderConfig,a=void 0===n?{}:n,i=e.events,l=e.eventBus;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.maplibreModule=r,this.events=i,this.eventBus=l,this.capabilities={supportedShortcuts:o,supportsMapSizes:!0},Object.assign(this,a)},e=[{key:"initMap",value:(i=qt(Ct().m(function t(e){var r,n,o,a,i,l,u,s,c,y,p,g,m,b=this;return Ct().w(function(t){for(;;)switch(t.n){case 0:r=e.container,n=e.padding,o=e.mapStyle,a=e.mapSize,i=e.center,l=e.zoom,u=e.bounds,s=e.pixelRatio,c=$t(e,It),this.mapStyleId=null==o?void 0:o.id,this.mapSize=a,y=this.maplibreModule.Map,p=this.events,g=this.eventBus,(m=new y(Bt(Bt({},c),{},{container:r,style:null==o?void 0:o.url,pixelRatio:s,padding:n,center:i,zoom:l,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}))).touchZoomRotate.disableRotation(),this.map=m,this.map.setPadding(n),u&&m.fitBounds(u,{duration:0}),h(m),f(m),d({map:m,events:p,eventBus:g,getCenter:this.getCenter.bind(this),getZoom:this.getZoom.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),v({mapProvider:this,map:m,events:p,eventBus:g}),m.on("load",function(){b.labelNavigator=Z(m,null==o?void 0:o.mapColorScheme,p,g)}),this.eventBus.emit(p.MAP_READY,{map:this.map,mapStyleId:this.mapStyleId,mapSize:this.mapSize,crs:this.crs});case 1:return t.a(2)}},t,this)})),function(t){return i.apply(this,arguments)})},{key:"destroyMap",value:function(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}},{key:"setHoverCursor",value:function(t){this.map&&(this._onHoverMove=nt(this.map,t,this._onHoverMove))}},{key:"setView",value:function(t){var e=t.center,r=t.zoom;this.map.flyTo({center:e||this.getCenter(),zoom:r||this.getZoom(),duration:this.map.isStyleLoaded()?n:0})}},{key:"zoomIn",value:function(t){this.map.easeTo({zoom:this.getZoom()+t,duration:n})}},{key:"zoomOut",value:function(t){this.map.easeTo({zoom:this.getZoom()-t,duration:n})}},{key:"panBy",value:function(t){this.map.panBy(t,{duration:n})}},{key:"fitToBounds",value:function(t){var e=Array.isArray(t)?t:T(t),r=this.map.isStyleLoaded()?n:0;this.map.fitBounds(e,{duration:r})}},{key:"setPadding",value:function(t){this.map.setPadding(t)}},{key:"updateHighlightedFeatures",value:function(t,e){return function(t){var e=t.LngLatBounds,r=t.map,n=t.selectedFeatures,o=t.stylesMap;if(!r)return null;var a=function(t,e){var r={};return null==e||e.forEach(function(e){var n=e.featureId,o=e.layerId,a=e.idProperty,i=e.geometry,l=t.getLayer(o);if(l){var u=l.source;r[u]||(r[u]={ids:new Set,fillIds:new Set,idProperty:a,layerId:o,hasFillGeometry:!1}),!i||"Polygon"!==i.type&&"MultiPolygon"!==i.type||(r[u].hasFillGeometry=!0,r[u].fillIds.add(n)),r[u].ids.add(n)}}),r}(r,n),i=[],l=new Set(Object.keys(a)),u=r._highlightedSources||new Set;return function(t,e,r){e.forEach(function(e){if(!r.has(e)){var n="highlight-".concat(e);["".concat(n,"-fill"),"".concat(n,"-line"),"".concat(n,"-symbol")].forEach(function(e){t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})}(r,u,l),r._highlightedSources=l,l.forEach(function(t){var e=a[t],n=e.ids,l=e.fillIds,u=e.idProperty,s=e.layerId,c=e.hasFillGeometry,f=r.getLayer(s),h=f.sourceLayer,y=c?"fill":f.type,p="highlight-".concat(t),d=u?["get",u]:["id"],v=["in",d,["literal",U(n)]];if("fill"===y){var g=o[s],m=g.stroke,b=g.strokeWidth,M=g.fill,w=["in",d,["literal",U(l)]],S={"line-color":m,"line-width":b};X(r,"".concat(p,"-fill"),"fill",t,h,{"fill-color":M},w),X(r,"".concat(p,"-line"),"line",t,h,S,v)}if("line"===y){var P=o[s],O={"line-color":P.stroke,"line-width":P.strokeWidth};r.getLayer("".concat(p,"-fill"))&&r.setFilter("".concat(p,"-fill"),["==","id",""]),X(r,"".concat(p,"-line"),"line",t,h,O,v)}if("symbol"===y){var x=r.getLayoutProperty(s,"icon-image"),j=function(t,e){var r,n;return null!==(r=null===(n=t._symbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null}(r,x);j&&function(t,e,r,n,o,a,i){var l;t.getLayer(e)||t.addLayer(J(J({id:e,type:"symbol",source:r},n&&{"source-layer":n}),{},{layout:{"icon-image":a,"icon-anchor":null!==(l=t.getLayoutProperty(o,"icon-anchor"))&&void 0!==l?l:"center","icon-allow-overlap":!0}})),t.setLayoutProperty(e,"icon-image",a),t.setFilter(e,i),t.moveLayer(e)}(r,"".concat(p,"-symbol"),t,h,s,j,v)}i.push.apply(i,U(r.queryRenderedFeatures({layers:[s]}).filter(function(t){var e;return n.has(u?null===(e=t.properties)||void 0===e?void 0:e[u]:t.id)})))}),function(t,e){if(!e.length)return null;var r=new t;return e.forEach(function(t){var e=function(t){return"number"==typeof t[0]?r.extend(t):t.forEach(e)};e(t.geometry.coordinates)}),[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]}(e,i)}({LngLatBounds:this.maplibreModule.LngLatBounds,map:this.map,selectedFeatures:t,stylesMap:e})}},{key:"highlightNextLabel",value:function(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}},{key:"highlightLabelAtCenter",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}},{key:"clearHighlightedLabel",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}},{key:"getCenter",value:function(){var t=this.map.getCenter();return[Number(t.lng.toFixed(7)),Number(t.lat.toFixed(7))]}},{key:"getZoom",value:function(){return Number(this.map.getZoom().toFixed(7))}},{key:"getBounds",value:function(){return this.map.getBounds().toArray().flat(1)}},{key:"getFeaturesAtPoint",value:function(t,e){return function(t,e){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).radius,n=void 0===r?10:r,o=[[e.x-n,e.y-n],[e.x+n,e.y+n]],a=t.queryRenderedFeatures(o);if(0===a.length)return[];var i=new Set(t.queryRenderedFeatures([e.x,e.y]).map(function(t){var e,r=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(r)})),l=[];a.forEach(function(t){!1===l.includes(t.layer.id)&&l.push(t.layer.id)});for(var u=new Set,s=[],c=a.length-1;c>=0;c--){var f,h=a[c],y=void 0===h.id?JSON.stringify(h.properties):h.id,p="".concat(null===(f=h.layer)||void 0===f?void 0:f.source,":").concat(y);!1===u.has(p)&&(u.add(p),s.push(h))}var d=t.unproject(e),v=[d.lng,d.lat],g=s.filter(function(t){var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(function(t){return function(t,e){for(var r=Q(t,2),n=r[0],o=r[1],a=!1,i=0,l=e.length-1;i<e.length;l=i,i++){var u=Q(e[i],2),s=u[0],c=u[1],f=Q(e[l],2),h=f[0],y=f[1];c>o!=y>o&&n<(h-s)*(o-c)/(y-c)+s&&(a=!a)}return a}(v,t[0])});if("Point"===e||"MultiPoint"===e){var r,n=void 0===t.id?JSON.stringify(t.properties):t.id;return i.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(n))}return!0});return g.map(function(r){var n=0,o=r.geometry.type,a=function(t,e,r){var n=r.coordinates,o=r.type,a=1/0,i=function(e){return t.project(e)},l=function(t){for(var r=0;r<t.length-1;r++){var n=et(e,i(t[r]),i(t[r+1]));n<a&&(a=n)}};if("Point"===o){var u=i(n);a=Math.pow(e.x-u.x,2)+Math.pow(e.y-u.y,2)}else"LineString"===o||"MultiPoint"===o?"LineString"===o?l(n):n.forEach(function(t){var r=i(t),n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);n<a&&(a=n)}):"Polygon"===o||"MultiLineString"===o?n.forEach(l):"MultiPolygon"===o&&n.forEach(function(t){return t.forEach(l)});return a}(t,e,r.geometry);return n+=1e6*l.indexOf(r.layer.id),o.includes("Polygon")&&(n-=5e5),{f:r,score:n+=a}}).sort(function(t,e){return t.score-e.score}).map(function(t){return t.f})}(this.map,t,e)}},{key:"registerSymbols",value:(a=qt(Ct().m(function t(e,r,n){var o;return Ct().w(function(t){for(;;)if(0===t.n)return o=(this.map.getPixelRatio()||1)*(c[this.mapSize]||1),t.a(2,Mt(this.map,e,r,n,o))},t,this)})),function(t,e,r){return a.apply(this,arguments)})},{key:"registerPatterns",value:(r=qt(Ct().m(function t(e,r,n){var o;return Ct().w(function(t){for(;;)if(0===t.n)return o=(this.map.getPixelRatio()||1)*(c[this.mapSize]||1),t.a(2,Rt(this.map,e,r,n,o))},t,this)})),function(t,e,n){return r.apply(this,arguments)})},{key:"getAreaDimensions",value:function(){return function(t){var e,r,n,o;if(t&&"function"==typeof t.getWest)e=t.getWest(),r=t.getSouth(),n=t.getEast(),o=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";var a=x(t,2),i=x(a[0],2);e=i[0],r=i[1];var l=x(a[1],2);n=l[0],o=l[1]}var u=A([e,r],[n,r]),s=A([e,r],[e,o]),c=N(u),f=N(s);return"".concat(f," by ").concat(c)}((t=this.maplibreModule.LngLatBounds,e=this.map,r=e.getContainer().getBoundingClientRect(),n=r.width,o=r.height,a=e.getPadding(),i=[a.left,o-a.bottom],l=[n-a.right,a.top],new t(e.unproject(i),e.unproject(l))));var t,e,r,n,o,a,i,l}},{key:"getCardinalMove",value:function(t,e){return function(t,e){var r=x(t,2),n=r[0],o=r[1],a=x(e,2),i=a[0],l=a[1],u=l-o,s=i-n,c=[];if(Math.abs(u)>1e-4){var f=Math.round(A([n,o],[n,l]));c.push("".concat(u>0?"north":"south"," ").concat(N(f)))}if(Math.abs(s)>1e-4){var h=Math.round(A([n,o],[i,o]));c.push("".concat(s>0?"east":"west"," ").concat(N(h)))}return c.join(", ")}(t,e)}},{key:"getResolution",value:function(){return t=this.map.getCenter(),e=this.map.getZoom(),r=t.lat,n=Math.pow(2,e),40075016.686*Math.cos(r*Math.PI/180)/(512*n);var t,e,r,n}},{key:"mapToScreen",value:function(t){return this.map.project(t)}},{key:"screenToMap",value:function(t){var e=this.map.unproject([t.x,t.y]);return[e.lng,e.lat]}},{key:"isGeometryObscured",value:function(t,e){return function(t,e,r){var n=r.getContainer().getBoundingClientRect(),o=x(T(t),4),a=o[0],i=o[1],l=o[2],u=o[3],s=[r.project([a,i]),r.project([a,u]),r.project([l,i]),r.project([l,u])],c=Math.min.apply(Math,O(s.map(function(t){return t.x}))),f=Math.max.apply(Math,O(s.map(function(t){return t.x}))),h=Math.min.apply(Math,O(s.map(function(t){return t.y}))),y=Math.max.apply(Math,O(s.map(function(t){return t.y}))),p=e.left-n.left,d=e.top-n.top,v=e.right-n.left,g=e.bottom-n.top;return c<v&&f>p&&h<g&&y>d}(t,e,this.map)}}],e&&Zt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,a,i}()}}]);
@@ -333,7 +333,8 @@ export default class MapLibreProvider {
333
333
  * @returns {Promise<void>}
334
334
  */
335
335
  async registerPatterns (patternConfigs, mapStyleId, patternRegistry) {
336
- return registerPatterns(this.map, patternConfigs, mapStyleId, patternRegistry)
336
+ const pixelRatio = (this.map.getPixelRatio() || 1) * (scaleFactor[this.mapSize] || 1)
337
+ return registerPatterns(this.map, patternConfigs, mapStyleId, patternRegistry, pixelRatio)
337
338
  }
338
339
 
339
340
  // ==========================
@@ -280,13 +280,33 @@ describe('MapLibreProvider', () => {
280
280
  expect(registerSymbols).toHaveBeenCalledWith(map, [], { id: 'test' }, registry, 1) // (0 || 1) * 1
281
281
  })
282
282
 
283
- test('registerPatterns delegates to utility with map instance', async () => {
283
+ test('registerPatterns delegates to utility with map instance and pixelRatio', async () => {
284
284
  const p = makeProvider()
285
285
  await doInitMap(p)
286
286
  const configs = [{ fillPattern: 'dot' }]
287
287
  const registry = {}
288
288
  await p.registerPatterns(configs, 'test', registry)
289
- expect(registerPatterns).toHaveBeenCalledWith(map, configs, 'test', registry)
289
+ expect(registerPatterns).toHaveBeenCalledWith(map, configs, 'test', registry, 1) // getPixelRatio()=1, mapSize unset → 1*1
290
+ })
291
+
292
+ test('registerPatterns computes pixelRatio from getPixelRatio and mapSize scale factor', async () => {
293
+ const p = makeProvider()
294
+ await doInitMap(p)
295
+ map.getPixelRatio.mockReturnValue(2)
296
+ p.mapSize = 'medium' // scaleFactor['medium'] = 1.5
297
+ const registry = {}
298
+ await p.registerPatterns([], 'test', registry)
299
+ expect(registerPatterns).toHaveBeenCalledWith(map, [], 'test', registry, 3) // 2 * 1.5
300
+ })
301
+
302
+ test('registerPatterns falls back to pixelRatio 1 when getPixelRatio returns 0', async () => {
303
+ const p = makeProvider()
304
+ await doInitMap(p)
305
+ map.getPixelRatio.mockReturnValue(0)
306
+ p.mapSize = 'small' // scaleFactor['small'] = 1
307
+ const registry = {}
308
+ await p.registerPatterns([], 'test', registry)
309
+ expect(registerPatterns).toHaveBeenCalledWith(map, [], 'test', registry, 1) // (0 || 1) * 1
290
310
  })
291
311
 
292
312
  describe('setHoverCursor', () => {